Yoneda Lemma
Statement
Let be a locally small category, an object, and a presheaf. The Yoneda Lemma states there is a natural bijection:
The bijection sends a natural transformation to the element . Its inverse sends to the natural transformation .
Visualization
Concretely, take , (one-element set), (power-set functor on ). Then picks out elements, and a natural transformation corresponds to a subset of :
Naturality square for α : Hom(-,X) ⇒ F, and f : A → B
α_B
Hom(B, X) ─────────────────────────────▶ F(B)
│ │
-∘f │ │ F(f)
▼ ▼
Hom(A, X) ─────────────────────────────▶ F(A)
α_A
α commutes: F(f)(α_B(g)) = α_A(g ∘ f) for all g : B → X
Key computation (recovering x from α):
given α, set x := α_X(id_X) ∈ F(X)
then for any f : A → X:
α_A(f) = α_A(id_X ∘ f) = F(f)(α_X(id_X)) = F(f)(x) ✓
So is completely determined by the single element .
Proof Sketch
-
Define the map : Given , set .
-
Define the inverse : Given , define for . Naturality of follows from functoriality of .
-
: . Since is a functor, .
-
: For natural and any , naturality forces .
-
Naturality of : Both bijections vary naturally in and , so is a natural isomorphism.
Connections
The Yoneda Lemma is the categorical generalization of Cayley's TheoremCayley's TheoremEvery group embeds into a symmetric groupRead more → (every group embeds in its permutation group) and underlies the theory of representable functorsRepresentable FunctorA functor F is representable if it is naturally isomorphic to Hom(X,-) for some object XRead more →. It also drives the universal properties behind Adjoint FunctorsAdjoint FunctorsA pair of functors L ⊣ R with a natural bijection Hom(LX, Y) ≅ Hom(X, RY)Read more →.
Lean4 Proof
import Mathlib.CategoryTheory.Yoneda
open CategoryTheory
/-- The Yoneda bijection: natural transformations from the representable
presheaf yoneda.obj X to F correspond to elements of F.obj (op X).
Mathlib provides this as `yonedaEquiv`. -/
theorem yoneda_bijection {C : Type*} [Category C]
{X : C} {F : Cᵒᵖ ⥤ Type*} :
(yoneda.obj X ⟶ F) ≃ F.obj (Opposite.op X) :=
yonedaEquiv
/-- The underlying element recovered from a natural transformation. -/
theorem yoneda_apply {C : Type*} [Category C]
{X : C} {F : Cᵒᵖ ⥤ Type*} (α : yoneda.obj X ⟶ F) :
yonedaEquiv α = α.app (Opposite.op X) (𝟙 X) :=
yonedaEquiv_apply αReferenced by
- Natural TransformationCategory Theory
- Adjoint FunctorsCategory Theory
- Representable FunctorCategory Theory
- Functor CompositionCategory Theory
- MonadCategory Theory