Functors

Structure-preserving maps between categories

Functors

A functor is a bridge between two categories: it carries every dot and every arrow across while keeping all the connections intact.

The Functor Machine

Press Run Functor and watch each object and arrow travel from C into D. Notice that composites land on composites.

CfgABCFFunctor
Go deeper:The Functor Machine

If categories are "worlds of mathematical objects," then functors are the bridges between them. A functor maps objects to objects and arrows to arrows, preserving all the structure. They are the morphisms in the "category of categories."

A functor F : C → D is a "machine" that takes an entire category and maps it into another, preserving all the structure: objects map to objects, arrows map to arrows, and composition is respected.

Key insight: A functor must satisfy: F(g ∘ f) = F(g) ∘ F(f) and F(id_A) = id_{F(A)}. It's a "homomorphism of categories" — it preserves all the categorical structure.

Covariant vs Contravariant

Switch between covariant and contravariant and watch the arrows keep or flip their direction.

CfABFDF(f)F(A)F(B)
f : A → B ⟹ F(f) : F(A) → F(B) (same direction!)
Go deeper:Covariant vs Contravariant

A covariant functor preserves arrow direction. A contravariant functor reverses arrows — it's a functor from Cop to D.

Key insight: Contravariant functors are surprisingly common: the dual space functor V → V* reverses arrows, and so does the power set functor via preimage. A contravariant functor C → D is the same as a covariant functor Cop → D.

The Forgetful Functor

Click the button to forget the group operation and watch the structure dissolve, leaving only the underlying set.

The Klein Four-Group (V₄)
·eabab
eeabab
aaeabb
bbabea
ababbae
U(V₄) = Just a Set
e
a
b
ab
{e, a, b, ab} — just 4 elements, no operation
Go deeper:The Forgetful Functor

The forgetful functor U : Grp → Set takes a group and "forgets" the group operation, leaving just the underlying set of elements. Click to see the structure dissolve!

Key insight: Forgetful functors "strip away" algebraic structure. The functor U : Grp → Set forgets the operation, U : Top → Set forgets the topology, and U : Vect → Set forgets the vector space structure. Forgetful functors almost always have a left adjoint (the "free" construction) — a deep fact we'll explore later!

Hom Functor Visualizer

Toggle between Hom(A, −) and Hom(−, A) and watch which way the arrows point.

Category C
A
(fixed)
X
Y
Z
⟹
Hom(A,−)
Category Set
Hom(A,X)
{f₁}
|Hom(A,X)| = 1
Hom(A,Y)
{g₁, g₂}
|Hom(A,Y)| = 2
Hom(A,Z)
{h₁, h₂, h₃}
|Hom(A,Z)| = 3
Go deeper:Hom Functor Visualizer

Fix an object A. The covariant hom-functor Hom(A, −) sends each object B to the set of arrows from A to B. The contravariant version Hom(−, A) reverses arrow direction.

Key insight: The hom-functors are the most fundamental functors in category theory. They encode how an object relates to the rest of the category. The Yoneda Lemma (coming soon!) says that an object is completely determined by its hom-functor.

Key Takeaways

  • A functor maps objects to objects and arrows to arrows, keeping composition.
  • Covariant functors keep arrow direction; contravariant ones flip it.
  • Forgetful functors strip structure away.
  • Hom-functors record how one object relates to all the others.

Spot a mistake or have an idea?

Search