Natural Transformation
Statement
Let be functors. A natural transformation is a family of morphisms in , one for each object , such that for every morphism in the following square commutes:
This is the naturality condition: the components interlock coherently with how and act on morphisms.
Visualization
Identity natural transformation on the power-set functor :
For any f : X → Y and subset S ⊆ X:
id_{F(X)}
F(X) ──────────▶ F(X)
│ │
F(f)│ │F(f) F(f)(S) = f[S] = {f(s) | s ∈ S}
▼ ▼
F(Y) ──────────▶ F(Y)
id_{F(Y)}
Check: F(f)(id_{F(X)}(S)) = F(f)(S) = id_{F(Y)}(F(f)(S)) ✓
Concrete non-trivial example: on , where (singleton embedding):
X = {a, b}, Y = {1, 2, 3}, f : {a,b} → {1,2,3}, f(a)=1, f(b)=3
α_X : {a,b} ──▶ P({a,b}) α_Y : {1,2,3} ──▶ P({1,2,3})
a ↦ {a} 1 ↦ {1}
b ↦ {b} 3 ↦ {3}
Naturality: P(f)(α_X(a)) = P(f)({a}) = {f(a)} = {1} = α_Y(f(a)) ✓
P(f)(α_X(b)) = {3} = α_Y(3) = α_Y(f(b)) ✓
Proof Sketch
-
Identity natural transformation: Define . Naturality: .
-
Vertical composition: Given and , define . Naturality follows by composing the two naturality squares.
-
Horizontal composition (whiskering): For and a functor , the whiskered has components .
-
Functors and natural transformations form a category: The functor category has functors as objects and natural transformations as morphisms.
Connections
Natural transformations are the morphisms in functor categories and are precisely what the Yoneda LemmaYoneda LemmaNatural transformations from a representable functor y_X to F biject with elements of F(X)Read more → classifies when one functor is representable. The notion underpins the definition of Adjoint FunctorsAdjoint FunctorsA pair of functors L ⊣ R with a natural bijection Hom(LX, Y) ≅ Hom(X, RY)Read more → (the unit and counit are natural transformations) and appears in the Fundamental Theorem of Galois TheoryFundamental Theorem of Galois TheoryBijection between intermediate fields and subgroups of the Galois groupRead more → as the natural isomorphism between Galois groups.
Lean4 Proof
import Mathlib.CategoryTheory.NatTrans
open CategoryTheory
/-- The identity natural transformation exists and its components are identities.
Mathlib: `NatTrans.id` and `NatTrans.id_app`. -/
theorem nat_trans_id_app {C D : Type*} [Category C] [Category D]
(F : C ⥤ D) (X : C) :
(NatTrans.id F).app X = 𝟙 (F.obj X) :=
rfl
/-- Naturality square: for any α : F ⟹ G and f : X ⟶ Y,
G.map f ≫ α.app X = α.app Y ≫ F.map f. -/
theorem nat_trans_naturality {C D : Type*} [Category C] [Category D]
{F G : C ⥤ D} (α : F ⟶ G) {X Y : C} (f : X ⟶ Y) :
F.map f ≫ α.app Y = α.app X ≫ G.map f :=
α.naturality fReferenced by
- Functor CompositionCategory Theory