Functors

Structure-preserving maps between categories

Functors

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."

The Functor Machine

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.

CfgABCFFunctor

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

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

CfABFDF(f)F(A)F(B)
f : A → B ⟹ F(f) : F(A) → F(B) (same direction!)

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

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!

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

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

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.

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

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

  • Functors — Maps F : C → D sending objects to objects and morphisms to morphisms, preserving composition and identity.
  • Covariant vs Contravariant — Covariant preserves direction; contravariant reverses it.
  • Forgetful Functors — Strip away structure (Grp → Set forgets the group operation).
  • Hom-Functors — Hom(A, −) and Hom(−, A) are the most fundamental examples.