Mathematics.

representable functors and the Yoneda embedding

The Yoneda Lemma

Category Theory100 minDifficulty9 out of 10

You should know: natural transformations, functors, categories and morphisms, limits and colimits

Overview

The Yoneda lemma is arguably the single most important result in category theory. It states that a functor \(F: \mathcal{C} \to \text{Set}\) is completely determined by its behavior on a single representable functor, and that natural transformations from \(\text{Hom}(A, -)\) to \(F\) are in natural bijection with elements of \(F(A)\). As a corollary, the Yoneda embedding \(\mathcal{C} \hookrightarrow [\mathcal{C}^{\text{op}}, \text{Set}]\) is fully faithful, meaning every category embeds into a presheaf category — one of the most powerful tools in modern mathematics.

Intuition

The Yoneda lemma says: 'An object \(A\) in a category is completely determined by how other objects map into it.' This is the categorical version of the principle that you can know everything about a mathematical object by studying its relationships. The Yoneda embedding is like a 'hall of mirrors': it places \(A\) inside the presheaf category where it is represented by the functor \(\text{Hom}(-, A)\), and the Yoneda lemma says this representation is faithful — distinct objects give distinct representable functors.

Formal Definition

Definition

Let \(\mathcal{C}\) be a locally small category, \(F: \mathcal{C} \to \text{Set}\) a functor, and \(A \in \mathcal{C}\). The Yoneda lemma provides a natural bijection:

Nat(Hom(A,),F)F(A)\text{Nat}(\text{Hom}(A, -), F) \cong F(A)

The Yoneda bijection: natural transformations from the representable functor Hom(A,−) to F correspond to elements of F(A)

yoneda-lemma
ηηA(idA)F(A)\eta \mapsto \eta_A(\text{id}_A) \in F(A)

The bijection sends a natural transformation η to η_A(id_A)

yoneda-forward
x[fF(f)(x)],the natural transformation αxx \mapsto \left[ f \mapsto F(f)(x) \right], \quad \text{the natural transformation } \alpha^x

An element x ∈ F(A) gives the natural transformation α^x_B(f) = F(f)(x)

yoneda-backward
y:C[Cop,Set],AHomC(,A)\mathbf{y}: \mathcal{C} \hookrightarrow [\mathcal{C}^{\text{op}}, \text{Set}], \quad A \mapsto \text{Hom}_{\mathcal{C}}(-, A)

The Yoneda embedding: a fully faithful functor from C into its presheaf category

yoneda-embedding

Notation

NotationMeaning
Nat(F,G)\text{Nat}(F, G)Set of natural transformations from functor F to functor G
hA=Hom(A,)h^A = \text{Hom}(A,-)Covariant representable functor at A
hA=Hom(,A)h_A = \text{Hom}(-,A)Contravariant representable functor at A
y(A)=Hom(,A)\mathbf{y}(A) = \text{Hom}(-,A)Image of A under the Yoneda embedding
PSh(C)=[Cop,Set]\text{PSh}(\mathcal{C}) = [\mathcal{C}^{\text{op}}, \text{Set}]Presheaf category on C

Proofs

Proof of the Yoneda Lemma
  1. Define Φ:Nat(Hom(A,),F)F(A) by Φ(η)=ηA(idA).\text{Define } \Phi: \text{Nat}(\text{Hom}(A,-), F) \to F(A) \text{ by } \Phi(\eta) = \eta_A(\text{id}_A).(Evaluating η at the object A and applying to the identity gives an element of F(A).)
  2. Define Ψ:F(A)Nat(Hom(A,),F) by Ψ(x)B(f)=F(f)(x) for f:AB.\text{Define } \Psi: F(A) \to \text{Nat}(\text{Hom}(A,-), F) \text{ by } \Psi(x)_B(f) = F(f)(x) \text{ for } f: A \to B.(Given x ∈ F(A), for each B define (Ψ(x))_B: Hom(A,B) → F(B) by chasing x along F(f).)
  3. Ψ(x) is natural: for g:BC and f:AB,  F(g)(Ψ(x)B(f))=F(g)(F(f)(x))=F(gf)(x)=Ψ(x)C(gf)=Ψ(x)C(Hom(A,g)(f)).\Psi(x) \text{ is natural: for } g: B \to C \text{ and } f: A \to B, \; F(g)(\Psi(x)_B(f)) = F(g)(F(f)(x)) = F(g \circ f)(x) = \Psi(x)_C(g \circ f) = \Psi(x)_C(\text{Hom}(A,g)(f)).(Functoriality of F gives F(g)∘F(f) = F(g∘f), which is exactly the naturality square.)
  4. ΦΨ=id:  (ΦΨ)(x)=Φ(Ψ(x))=Ψ(x)A(idA)=F(idA)(x)=idF(A)(x)=x.\Phi \circ \Psi = \text{id}: \; (\Phi \circ \Psi)(x) = \Phi(\Psi(x)) = \Psi(x)_A(\text{id}_A) = F(\text{id}_A)(x) = \text{id}_{F(A)}(x) = x.(F preserves identities.)
  5. ΨΦ=id:  for any ηNat(Hom(A,),F) and f:AB,  Ψ(ηA(idA))B(f)=F(f)(ηA(idA))=ηB(fidA)=ηB(f),\Psi \circ \Phi = \text{id}: \; \text{for any } \eta \in \text{Nat}(\text{Hom}(A,-),F) \text{ and } f: A \to B, \; \Psi(\eta_A(\text{id}_A))_B(f) = F(f)(\eta_A(\text{id}_A)) = \eta_B(f \circ \text{id}_A) = \eta_B(f),(The last step uses naturality of η: η_B ∘ Hom(A,f) = F(f) ∘ η_A, applied to id_A.)
  6. Φ and Ψ are inverse bijections. Naturality in A and F follows by direct computation.\Phi \text{ and } \Psi \text{ are inverse bijections. Naturality in } A \text{ and } F \text{ follows by direct computation.}(The bijection is natural in both arguments by the way Φ and Ψ are defined.)

Theorems

Theorem 1: Yoneda Lemma
ForanylocallysmallcategoryC,functorF:CSet,andobjectAC,thereisabijection extNat(Hom(A,),F)F(A),naturalinbothAandF.For any locally small category \mathcal{C}, functor F: \mathcal{C} \to \text{Set}, and object A \in \mathcal{C}, there is a bijection \ ext{Nat}(\text{Hom}(A,-), F) \cong F(A), natural in both A and F.
Theorem 2: Yoneda Embedding
Thefunctory:C[Cop,Set]definedbyy(A)=Hom(,A)isfullyfaithful.Inparticular,AB    Hom(,A)Hom(,B)aspresheaves.The functor \mathbf{y}: \mathcal{C} \to [\mathcal{C}^{\text{op}}, \text{Set}] defined by \mathbf{y}(A) = \text{Hom}(-, A) is fully faithful. In particular, A \cong B \iff \text{Hom}(-,A) \cong \text{Hom}(-,B) as presheaves.
Theorem 3: Representability criterion
AfunctorF:CSetisrepresentable(i.e.,FHom(A,)forsomeAifandonlyifthecategoryofelementsofFhasaterminalobject.A functor F: \mathcal{C} \to \text{Set} is representable (i.e., F \cong \text{Hom}(A,-) for some A if and only if the category of elements of F has a terminal object.

Worked Examples

  1. By the Yoneda lemma with \(F = U\) (the forgetful functor) and \(A = \mathbb{Z}\):

    Nat(Hom(Z,),U)U(Z)=Z\text{Nat}(\text{Hom}(\mathbb{Z},-), U) \cong U(\mathbb{Z}) = \mathbb{Z}
  2. So natural transformations from the representable functor \(\text{Hom}(\mathbb{Z},-)\) to \(U\) correspond to elements of \(\mathbb{Z}\).

  3. Concretely: an element \(n \in \mathbb{Z}\) gives the natural transformation \(\alpha^n\) where \(\alpha^n_A: \text{Hom}(\mathbb{Z}, A) \to A\) sends a group hom \(\varphi: \mathbb{Z} \to A\) to \(\varphi(n) \in A\) (evaluation at \(n\)).

    αAn(φ)=φ(n)\alpha^n_A(\varphi) = \varphi(n)
  4. This makes sense: \(\text{Hom}(\mathbb{Z}, A) \cong A\) via \(\varphi \mapsto \varphi(1)\), and the natural transformation for \(n\) sends \(\varphi\) to its \(n\)-th 'multiple' \(\varphi(n) = n \cdot \varphi(1)\).

Answer: By Yoneda, \(\text{Nat}(\text{Hom}(\mathbb{Z},-), U) \cong \mathbb{Z}\). The natural transformation corresponding to \(n \in \mathbb{Z}\) sends each group hom \(\varphi: \mathbb{Z} \to A\) to \(\varphi(n)\).

Practice Problems

Difficulty 9/10

Use the contravariant Yoneda lemma to show: for any presheaf \(F: \mathcal{C}^{\text{op}} \to \text{Set}\) and object \(A\), there is a natural bijection \(\text{Nat}(\text{Hom}(-,A), F) \cong F(A)\). State which element of \(F(A)\) a natural transformation \(\eta\) corresponds to.

Difficulty 8/10

Show that the Yoneda embedding \(\mathbf{y}: \mathcal{C} \to [\mathcal{C}^{\text{op}}, \text{Set}]\) defined by \(A \mapsto \text{Hom}(-,A)\) is a functor. What does it do to morphisms?

Difficulty 9/10

Prove: if \(F: \mathcal{C} \to \text{Set}\) is representable, say \(F \cong \text{Hom}(A,-)\), then the representing object \(A\) is unique up to unique isomorphism.

Common Mistakes

Common Mistake

The Yoneda lemma only applies to Set-valued functors.

The classical Yoneda lemma is stated for \(F: \mathcal{C} \to \text{Set}\). There are enriched versions for other target categories (Ab-enriched, etc.), but in the basic setting the target must be Set.

Common Mistake

The bijection \(\text{Nat}(\text{Hom}(A,-), F) \cong F(A)\) depends on some arbitrary choice.

The bijection is completely canonical: \(\eta \mapsto \eta_A(\text{id}_A)\). No choices are involved. This is precisely what 'natural' means in the Yoneda sense.

Common Mistake

The Yoneda embedding \(\mathbf{y}(A) = \text{Hom}(-,A)\) goes from \(\mathcal{C}\) to functors on \(\mathcal{C}\), so it is covariant.

Yes, \(\mathbf{y}: \mathcal{C} \to [\mathcal{C}^{\text{op}}, \text{Set}]\) is covariant as a functor. But each \(\mathbf{y}(A) = \text{Hom}(-,A)\) is a contravariant functor on \(\mathcal{C}\), i.e., a covariant functor on \(\mathcal{C}^{\text{op}}\). The covariant Yoneda embedding uses \(\text{Hom}(A,-)\) and targets \([\mathcal{C}, \text{Set}]\).

Quiz

The Yoneda lemma states that \(\text{Nat}(\text{Hom}(A,-), F) \cong\):
The Yoneda embedding \(\mathbf{y}: \mathcal{C} \to [\mathcal{C}^{\text{op}}, \text{Set}]\) is:
If \(F: \mathcal{C} \to \text{Set}\) is representable, represented by \(A\), what does the Yoneda lemma say about the 'universal element'?
Why does the Yoneda lemma imply that two objects with the same universal property are isomorphic?

Historical Background

The lemma is named after Nobuo Yoneda, who communicated it to Saunders Mac Lane during a chance meeting at Paris Gare du Nord in 1954. Yoneda never published a proof, but Mac Lane recorded and popularized the result. It has since become the foundation of modern algebraic geometry (via Grothendieck's functor-of-points approach), algebraic topology (representability theorems), and theoretical computer science (denotational semantics).

  1. 1954

    Yoneda communicates the lemma to Mac Lane at Paris Gare du Nord

    Nobuo Yoneda, Saunders Mac Lane

  2. 1960s

    Grothendieck uses the Yoneda perspective to recast algebraic geometry via functor of points

    Alexander Grothendieck

  3. 1971

    Mac Lane publishes the lemma in 'Categories for the Working Mathematician'

Summary

  • The Yoneda lemma: \(\text{Nat}(\text{Hom}(A,-), F) \cong F(A)\), naturally in \(A \in \mathcal{C}\) and \(F: \mathcal{C} \to \text{Set}\); the bijection is \(\eta \mapsto \eta_A(\text{id}_A)\).
  • The Yoneda embedding \(\mathbf{y}: \mathcal{C} \hookrightarrow [\mathcal{C}^{\text{op}}, \text{Set}]\), \(A \mapsto \text{Hom}(-,A)\), is fully faithful — every category embeds into a presheaf category.
  • Corollary: An object is determined up to unique isomorphism by its representable functor; this is why 'universal properties' uniquely determine objects.
  • The universal element \(u \in F(A)\) corresponding to the identity natural transformation is the key ingredient; every other element of \(F(B)\) is obtained by acting on \(u\) with a unique morphism \(A \to B\).
  • Applications are ubiquitous: Grothendieck's functor-of-points in algebraic geometry, Brown representability in topology, and adjoint functor theorems all rest on the Yoneda lemma.

References

  1. BookMac Lane, S. Categories for the Working Mathematician, 2nd ed. Springer, 1998. Ch. III.2.
  2. BookRiehl, E. Category Theory in Context. Dover, 2016. Ch. 2.
  3. BookLeinster, T. Basic Category Theory. Cambridge University Press, 2014. Ch. 4.