Category theory — functors & natural transformations

⚡ Key Takeaways

Functors are structure-preserving maps between categories; natural transformations are structure-preserving maps between functors. One-line: a functor sends objects to objects and arrows to arrows compatibly with composition and identities, while a natural transformation provides a coherent family of arrows relating two parallel functors. Key result: functors and natural transformations between two categories themselves form a category (the functor category), and naturality is exactly the condition that makes "morphisms of morphisms" compose correctly. Applies throughout algebra, topology, logic, and theoretical computer science. Introduced by Eilenberg and Mac Lane (1942–1945).

💡 The Core Insight

Functoriality turns the slogan "compatible with composition" into the only data you ever need to carry structure between mathematical worlds. Naturality then makes precise the elusive intuition that an isomorphism or transformation is "canonical" — independent of arbitrary choices — by demanding that it commute uniformly with all morphisms at once. The naturality square is the single diagram from which almost everything in higher category theory grows.

Formal Statement

DefinitionFunctor

Let C\mathcal{C} and D\mathcal{D} be categories. A (covariant) functor F:C→DF : \mathcal{C} \to \mathcal{D} consists of:

  • an object function X↦F(X)X \mapsto F(X), Ob⁡(C)→Ob⁡(D)\operatorname{Ob}(\mathcal{C}) \to \operatorname{Ob}(\mathcal{D});
  • for each pair of objects X,YX, Y, a morphism function Hom⁡C(X,Y)→Hom⁡D(F(X),F(Y))\operatorname{Hom}_{\mathcal{C}}(X, Y) \to \operatorname{Hom}_{\mathcal{D}}(F(X), F(Y)), written f↦F(f)f \mapsto F(f);

satisfying the two functoriality axioms:

1
F(idX)=idF(X)for all X∈Ob⁡(C).\quad F(\mathrm{id}_X) = \mathrm{id}_{F(X)} \quad \text{for all } X \in \operatorname{Ob}(\mathcal{C}).

Derivation hint: identities are uniquely characterized by g∘id=gg\circ\mathrm{id}=g and id∘h=h\mathrm{id}\circ h=h; applying FF to these and using [2][2] forces F(idX)F(\mathrm{id}_X) to be the identity on F(X)F(X) — so [1][1] is the minimal axiom making identities track.

2
F(g∘f)=F(g)∘F(f)for all composable f:X→Y, g:Y→Z.\quad F(g \circ f) = F(g) \circ F(f) \quad \text{for all composable } f : X \to Y,\ g : Y \to Z.

Derivation hint: read both sides as morphisms F(X)→F(Z)F(X)\to F(Z); the axiom states that the object function on hom-sets is a homomorphism of the composition operation, the categorical analogue of ϕ(ab)=ϕ(a)ϕ(b)\phi(ab)=\phi(a)\phi(b). Here F(X),F(Y),F(Z)F(X), F(Y), F(Z) are objects of D\mathcal{D} and all symbols ∘\circ denote composition in the respective category. A contravariant functor reverses arrows: F(f):F(Y)→F(X)F(f) : F(Y) \to F(X) and F(g∘f)=F(f)∘F(g)F(g \circ f) = F(f) \circ F(g); equivalently, it is a covariant functor Cop→D\mathcal{C}^{\mathrm{op}} \to \mathcal{D}.

DefinitionNatural Transformation

Let F,G:C→DF, G : \mathcal{C} \to \mathcal{D} be functors. A natural transformation η:F⇒G\eta : F \Rightarrow G assigns to each object X∈Ob⁡(C)X \in \operatorname{Ob}(\mathcal{C}) a morphism ηX:F(X)→G(X)\eta_X : F(X) \to G(X) in D\mathcal{D}, called the component at XX, such that for every morphism f:X→Yf : X \to Y in C\mathcal{C} the naturality square commutes:

3
G(f)∘ηX=ηY∘F(f).\quad G(f) \circ \eta_X = \eta_Y \circ F(f).

Derivation hint: trace an element conceptually around the square F(X)→F(Y)→G(Y)F(X)\to F(Y)\to G(Y) versus F(X)→G(X)→G(Y)F(X)\to G(X)\to G(Y); both routes must land at the same morphism F(X)→G(Y)F(X)\to G(Y), which is precisely the equality [3][3]. If every component ηX\eta_X is an isomorphism in D\mathcal{D}, then η\eta is a natural isomorphism, written F≅GF \cong G, and the componentwise inverses ηX−1\eta_X^{-1} assemble into a natural transformation η−1:G⇒F\eta^{-1} : G \Rightarrow F.

TheoremFunctor Category

For categories C,D\mathcal{C}, \mathcal{D} (with C\mathcal{C} small), the functors C→D\mathcal{C} \to \mathcal{D} as objects and natural transformations as morphisms form a category, the functor category DC=[C,D]=Fun⁡(C,D)\mathcal{D}^{\mathcal{C}} = [\mathcal{C}, \mathcal{D}] = \operatorname{Fun}(\mathcal{C}, \mathcal{D}). Composition is vertical composition of natural transformations: for η:F⇒G\eta : F \Rightarrow G and θ:G⇒H\theta : G \Rightarrow H,

4
(θ∘η)X=θX∘ηX.\quad (\theta \circ \eta)_X = \theta_X \circ \eta_X.

Derivation hint: pasting two naturality squares along their shared middle column G(f)G(f) yields a commuting rectangle whose outer boundary is exactly the naturality square for θ∘η\theta\circ\eta; the component formula is read off the bottom row. The identity morphism on FF is the natural transformation idF\mathrm{id}_F with components (idF)X=idF(X)(\mathrm{id}_F)_X = \mathrm{id}_{F(X)}.

TheoremInterchange / Horizontal Composition

Given functors and natural transformations

C→ F, G D→ H, K E,η:F⇒G,ϵ:H⇒K,\mathcal{C} \xrightarrow{\ F,\,G\ } \mathcal{D} \xrightarrow{\ H,\,K\ } \mathcal{E}, \qquad \eta : F \Rightarrow G,\quad \epsilon : H \Rightarrow K,

there is a horizontal composite ϵ∗η:HF⇒KG\epsilon * \eta : H F \Rightarrow K G with components

5
(ϵ∗η)X=ϵG(X)∘H(ηX)=K(ηX)∘ϵF(X).\quad (\epsilon * \eta)_X = \epsilon_{G(X)} \circ H(\eta_X) = K(\eta_X) \circ \epsilon_{F(X)}.

Derivation hint: the two expressions are equal precisely because the naturality square of ϵ\epsilon applied to the morphism ηX\eta_X commutes; the equality [5][5] is naturality of ϵ\epsilon instantiated at ηX\eta_X. Horizontal and vertical composition satisfy the interchange law:

6
(θ∗δ)∘(η∗ϵ)=(θ∘η)∗(δ∘ϵ),\quad (\theta * \delta) \circ (\eta * \epsilon) = (\theta \circ \eta) * (\delta \circ \epsilon),

Derivation hint: both sides are computed componentwise; expand each using [4][4] and [5][5], then apply functoriality [2][2] to H,KH,K and naturality [3][3] to rearrange the resulting four-term composite — every reordering is licensed by one square commuting. making the totality of categories, functors, and natural transformations a 2-category Cat\mathbf{Cat}.

Why It Holds / Derivation

ProofVertical composition is well-defined and associative

We verify the functor category axioms. 1. Composite is natural. Given η:F⇒G\eta : F \Rightarrow G and θ:G⇒H\theta : G \Rightarrow H, and a morphism f:X→Yf : X \to Y, we must show H(f)∘(θ∘η)X=(θ∘η)Y∘F(f)H(f) \circ (\theta \circ \eta)_X = (\theta \circ \eta)_Y \circ F(f). Using [4][4], the left side is H(f)∘θX∘ηXH(f) \circ \theta_X \circ \eta_X. 2. By naturality of θ\theta (equation [3][3] for θ\theta), H(f)∘θX=θY∘G(f)H(f) \circ \theta_X = \theta_Y \circ G(f). Substituting gives θY∘G(f)∘ηX\theta_Y \circ G(f) \circ \eta_X. 3. By naturality of η\eta, G(f)∘ηX=ηY∘F(f)G(f) \circ \eta_X = \eta_Y \circ F(f). Substituting gives θY∘ηY∘F(f)=(θ∘η)Y∘F(f)\theta_Y \circ \eta_Y \circ F(f) = (\theta \circ \eta)_Y \circ F(f), as required. The two naturality squares pasted side by side close into one rectangle. 4. Identity laws. (idG∘η)X=idG(X)∘ηX=ηX=ηX∘idF(X)=(η∘idF)X(\mathrm{id}_G \circ \eta)_X = \mathrm{id}_{G(X)} \circ \eta_X = \eta_X = \eta_X \circ \mathrm{id}_{F(X)} = (\eta \circ \mathrm{id}_F)_X, so id\mathrm{id} acts as a two-sided unit. 5. Associativity. ((ζ∘θ)∘η)X=(ζX∘θX)∘ηX=ζX∘(θX∘ηX)=(ζ∘(θ∘η))X((\zeta \circ \theta) \circ \eta)_X = (\zeta_X \circ \theta_X) \circ \eta_X = \zeta_X \circ (\theta_X \circ \eta_X) = (\zeta \circ (\theta \circ \eta))_X, inheriting associativity from D\mathcal{D} componentwise. ■\blacksquare

∎

:::proof[The two formulas in [5][5] agree] Apply the naturality square [3][3] of the natural transformation ϵ:H⇒K\epsilon : H \Rightarrow K to the specific D\mathcal{D}-morphism ηX:F(X)→G(X)\eta_X : F(X) \to G(X). Naturality gives

K(ηX)∘ϵF(X)=ϵG(X)∘H(ηX).K(\eta_X) \circ \epsilon_{F(X)} = \epsilon_{G(X)} \circ H(\eta_X).

This is exactly the claimed equality of the two component expressions; the common value is (ϵ∗η)X(\epsilon * \eta)_X. Functoriality of HH and KK ensures these are morphisms HF(X)→KG(X)HF(X) \to KG(X). ■\blacksquare

mathematician · Samuel Eilenberg & Saunders Mac Lane | 1909–1998, 1909–2005

Eilenberg (a Polish-American topologist) and Mac Lane (an American algebraist) jointly created category theory in a 1945 paper, General Theory of Natural Equivalences. Their motivation was strikingly concrete: in algebraic topology and homological algebra they kept encountering isomorphisms that were "natural" versus those that depended on arbitrary choices (e.g. a finite-dimensional vector space is isomorphic to its dual, but naturally isomorphic only to its double dual). To make "natural" rigorous they needed a notion of map between functors, which required defining functors, which in turn required defining categories. Eilenberg's topological instincts and Mac Lane's algebraic precision combined to yield a framework that Mac Lane later codified in the standard graduate text Categories for the Working Mathematician (1971). The pair also founded much of homological algebra (Eilenberg–MacLane spaces, the Eilenberg–Steenrod axioms).

Building Intuition

🧠 Intuition

Think of a category as a "world" of objects and the legal ways to transform them. A functor is a translation of one world into another that respects the grammar of composition: if you can do ff then gg in the source, the translation of "gg after ff" equals "translation of gg after translation of ff." Crucially a functor never invents structure — it can only carry along what composition gives. A natural transformation is a dialect adjustment between two translations FF and GG of the same world. At each object it offers a bridge ηX:F(X)→G(X)\eta_X : F(X) \to G(X). Naturality says these bridges are not arbitrary: whichever object you transform first — apply ff then cross the bridge, or cross the bridge then apply ff — you reach the same place. This uniformity is the mathematical content of the word "natural" (or "canonical"): no arbitrary choices were smuggled in, because the bridge commutes with everything simultaneously. A useful mental image: a functor is a movie of one space deforming into another; a natural transformation is a homotopy between two such movies — and indeed under the nerve construction this analogy becomes literally true.

Figure
The naturality square: the one diagram everything grows from
Naturality square for η : F ⇒ G at f : X → Y F(X) F(Y) G(X) G(Y) F(f) G(f) η_X η_Y G(f) ∘ η_X = η_Y ∘ F(f)

Worked Examples

ExampleThe free-group / abelianization functors and a natural transformation between forgetful composites

Given. Let Grp\mathbf{Grp} be the category of groups, Ab\mathbf{Ab} the category of abelian groups. Consider the functor G=IdGrpG = \mathrm{Id}_{\mathbf{Grp}} and the functor F=ι∘AbF = \iota \circ \mathrm{Ab}, where Ab:Grp→Ab\mathrm{Ab} : \mathbf{Grp} \to \mathbf{Ab} is abelianization H↦H/[H,H]H \mapsto H/[H,H] and ι:Ab↪Grp\iota : \mathbf{Ab} \hookrightarrow \mathbf{Grp} is inclusion. We compare Id\mathrm{Id} with ι∘Ab\iota\circ\mathrm{Ab} via the quotient.

Steps. 1. Define the component at a group HH as the canonical projection ηH:H↠H/[H,H]\eta_H : H \twoheadrightarrow H/[H,H]. (Direction: we take η:Id⇒ι∘Ab\eta : \mathrm{Id} \Rightarrow \iota\circ\mathrm{Ab}.) 2. Take any homomorphism ϕ:H→K\phi : H \to K. We must verify [3][3]: (ι Ab)(ϕ)∘ηH=ηK∘ϕ(\iota\,\mathrm{Ab})(\phi) \circ \eta_H = \eta_K \circ \phi. 3. The induced map Ab(ϕ):H/[H,H]→K/[K,K]\mathrm{Ab}(\phi) : H/[H,H] \to K/[K,K] sends h[H,H]↦ϕ(h)[K,K]h[H,H] \mapsto \phi(h)[K,K]; this is well defined because ϕ\phi carries commutators to commutators. 4. Trace h∈Hh \in H: clockwise ϕ\phi then project gives ϕ(h)[K,K]\phi(h)[K,K]; project then induced map gives h[H,H]↦ϕ(h)[K,K]h[H,H] \mapsto \phi(h)[K,K]. They agree.

Concrete numbers. Take H=S3H = S_3 (order 66), K=S3K = S_3, ϕ=id\phi = \mathrm{id}. Then [S3,S3]=A3≅Z/3[S_3, S_3] = A_3 \cong \mathbb{Z}/3, so ηS3:S3↠S3/A3≅Z/2\eta_{S_3} : S_3 \twoheadrightarrow S_3/A_3 \cong \mathbb{Z}/2. The transposition (1 2)(1\,2) maps to the nontrivial element of Z/2\mathbb{Z}/2; the 33-cycle (1 2 3)(1\,2\,3) maps to 00.

 η:IdGrp⇒ι∘Ab  is natural; ηS3:S3↠Z/2,  (1 2)↦1, (1 2 3)↦0 \boxed{\ \eta : \mathrm{Id}_{\mathbf{Grp}} \Rightarrow \iota\circ\mathrm{Ab}\ \text{ is natural; } \eta_{S_3}: S_3 \twoheadrightarrow \mathbb{Z}/2,\ \ (1\,2)\mapsto 1,\ (1\,2\,3)\mapsto 0\ }
ExampleDouble-dual: a natural transformation that is a natural isomorphism only on finite dimensions

Given. Let Vectk\mathbf{Vect}_k be vector spaces over a field kk. Define D=(−)∗∗D = (-)^{**}, the double-dual functor (covariant), and compare with Id\mathrm{Id}.

Steps. 1. Component at VV: the evaluation map ηV:V→V∗∗\eta_V : V \to V^{**}, ηV(v)(φ)=φ(v)\eta_V(v)(\varphi) = \varphi(v) for φ∈V∗\varphi \in V^*. 2. Naturality: for linear T:V→WT : V \to W we need T∗∗∘ηV=ηW∘TT^{**} \circ \eta_V = \eta_W \circ T. Compute on v∈Vv \in V, evaluated at ψ∈W∗\psi \in W^*:

(T∗∗ηV(v))(ψ)=ηV(v)(T∗ψ)=(T∗ψ)(v)=ψ(Tv)=ηW(Tv)(ψ).(T^{**}\eta_V(v))(\psi) = \eta_V(v)(T^*\psi) = (T^*\psi)(v) = \psi(Tv) = \eta_W(Tv)(\psi).

3. Both sides equal ψ(Tv)\psi(Tv), so [3][3] holds — η\eta is natural.

Concrete numbers. Let k=Rk = \mathbb{R}, V=R3V = \mathbb{R}^3. Then dim⁡V=dim⁡V∗=dim⁡V∗∗=3\dim V = \dim V^* = \dim V^{**} = 3, and ηR3\eta_{\mathbb{R}^3} is an isomorphism; e.g. e1↦eve1e_1 \mapsto \mathrm{ev}_{e_1}, the functional "extract first coordinate of a dual vector." For V=R(∞)V = \mathbb{R}^{(\infty)} (countable direct sum), dim⁡V∗=2ℵ0>ℵ0=dim⁡V\dim V^* = 2^{\aleph_0} > \aleph_0 = \dim V, so ηV\eta_V is injective but not surjective.

 ηV:V→V∗∗ is a natural iso  ⟺  dim⁡kV<∞ \boxed{\ \eta_V : V \to V^{**}\ \text{is a natural iso} \iff \dim_k V < \infty\ }

Common Misconceptions

⚠️ Common mistake

A functor is not "a map sending objects to objects." The morphism data is part of the definition and is not optional or recoverable. Two functors can agree on all objects yet differ on morphisms (e.g. the identity vs. an inner-automorphism-twisted version on a one-object groupoid). Always specify both the object and arrow assignments.

"Natural" is a technical term, not an aesthetic one. A construction being "obvious" or "canonical-looking" does not make it natural; you must exhibit the functors and verify the square [3][3]. Conversely a transformation can be defined by choices yet still turn out natural if the choices cohere.

Naturality is a property of the whole family, not of single components. Each ηX\eta_X being an isomorphism is necessary but not sufficient for a natural isomorphism — the squares must commute for all ff. (In fact: if η\eta is natural and each component is iso, the inverses are automatically natural; but a family of componentwise isos that does not satisfy [3][3] is simply not a natural transformation at all.)

CounterexampleA non-natural "isomorphism": V≅V∗V \cong V^*

For finite-dimensional VV, choosing a basis gives an isomorphism βV:V→V∗\beta_V : V \to V^* (send basis vectors to dual basis). Every βV\beta_V is an isomorphism. Yet there is no natural isomorphism Id⇒(−)∗\mathrm{Id} \Rightarrow (-)^* on Vectk\mathbf{Vect}_k, because (−)∗(-)^* is contravariant while Id\mathrm{Id} is covariant — there is no naturality square to even write, and forcing one fails. Concretely, take V=kV = k and scalar multiplication T=(⋅ c):k→kT = (\cdot\,c) : k \to k. Naturality would demand T∗∘βk=βk∘TT^* \circ \beta_k = \beta_k \circ T; but T∗T^* is multiplication by cc on k∗≅kk^* \cong k while the required direction reverses, giving c⋅βk=βk⋅c−1c\cdot\beta_k = \beta_k\cdot c^{-1} after careful bookkeeping — impossible for c≠±1c \ne \pm 1. This is exactly the phenomenon Eilenberg–Mac Lane formalized: V≅V∗V \cong V^* is unnatural, V≅V∗∗V \cong V^{**} is natural.

Connections

connection

Functors and natural transformations are the backbone connecting nearly every categorical concept. The <span class="wiki-link-missing">Yoneda Lemma</span> is a statement about natural transformations out of representable functors Hom⁡(X,−)\operatorname{Hom}(X, -), showing Nat⁡(Hom⁡(X,−),F)≅F(X)\operatorname{Nat}(\operatorname{Hom}(X,-), F) \cong F(X) — naturality is its entire engine. <span class="wiki-link-missing">Adjoint Functors</span> are pairs F⊣GF \dashv G specified by a natural isomorphism Hom⁡D(F−,−)≅Hom⁡C(−,G−)\operatorname{Hom}_{\mathcal{D}}(F-, -) \cong \operatorname{Hom}_{\mathcal{C}}(-, G-); the unit and counit are natural transformations Id⇒GF\mathrm{Id} \Rightarrow GF and FG⇒IdFG \Rightarrow \mathrm{Id}. A <span class="wiki-link-missing">Monad</span> is an endofunctor TT equipped with natural transformations η:Id⇒T\eta : \mathrm{Id} \Rightarrow T and μ:T2⇒T\mu : T^2 \Rightarrow T satisfying coherence. <span class="wiki-link-missing">Limits and Colimits</span> are objects representing the functor of cones, where a cone is itself a natural transformation from a constant functor. The functor category [C,Set][\mathcal{C}, \mathbf{Set}] is the <span class="wiki-link-missing">Presheaf Category</span>, the central object of topos theory and the natural habitat of the Yoneda embedding. The 2-categorical structure Cat\mathbf{Cat} from [6][6] launches <span class="wiki-link-missing">Higher Category Theory</span>.

Real-World Applications

🔬 Where this appears

Historical Development

⏳ History
- 1942 — Eilenberg & Mac Lane publish Group Extensions and Homology, where the need to express "natural" isomorphisms first crystallizes in homological computations.
- 1945 — General Theory of Natural Equivalences (Trans. AMS) formally introduces categories, functors, and natural transformations; the trio is born explicitly to define "natural."
- 1950s — Functorial methods spread through algebraic topology; the Eilenberg–Steenrod axioms (1952) recast homology theories as functors with natural transformations.
- 1957 — Grothendieck's Tôhoku paper develops abelian categories and derived functors, making functorial language indispensable in homological algebra.
- 1958 — Daniel Kan introduces adjoint functors and Kan extensions, defined via universal natural transformations; "all concepts are Kan extensions."
- 1958–1963 — Lawvere's program reformulates set theory and algebraic theories functorially; functorial semantics treats models as functors.
- 1964 — Yoneda's lemma (named by Mac Lane after Nobuo Yoneda's 1954 observations) becomes the cornerstone result about natural transformations.
- 1965 — Eilenberg & Kelly formalize enriched and 2-categorical structure; the interchange law [6][6] is recognized as defining 2-categories.
- 1971 — Mac Lane's Categories for the Working Mathematician canonizes the definitions and proofs used to this day.

Subtleties & Limits

open-problem

Size and foundations. The functor category [C,D][\mathcal{C}, \mathcal{D}] is well-behaved when C\mathcal{C} is small; for large C\mathcal{C}, Nat⁡(F,G)\operatorname{Nat}(F,G) may be a proper class, and one must invoke Grothendieck universes or a careful set/class distinction. The "category of all categories" is not naively a category for this reason.

Strictness vs. coherence. Equation [2][2] demands functoriality on the nose. In higher category theory one weakens this to functoriality up to coherent natural isomorphism (pseudofunctors, lax functors), and the management of these coherence isomorphisms (Mac Lane's coherence theorem, and its open higher analogues) becomes deeply nontrivial. Whether every weak ∞\infty-functor can be strictified is delicate and false in general beyond low dimensions.

Naturality vs. dinaturality and parametricity. For functors of mixed variance T(Xop,X)T(X^{\mathrm{op}}, X), ordinary naturality fails and one needs dinatural transformations, whose composites do not always compose — a known pathology with no fully satisfactory general fix. Relating syntactic parametricity (Reynolds) to genuine (di)naturality in all type-theoretic models remains an active research interface between logic and category theory.

See Also

Categories and Morphisms · Yoneda Lemma · Adjoint Functors · Limits and Colimits · Monad · Presheaf Category · Higher Category Theory · Representable Functors · 2-Categories and Bicategories