Diagram illustrating the Yoneda Lemma isomorphism.

Yoneda Lemma

Let's check naturality carefully in both components of the family

φF,c : F(c) ≅ Nat(Y(c),F) : ψF,c

where

φF,c (x) = ( ηdx : Hom(d,c) → F(d) , ηdx (f) = F(f)(x) )
ψF,c (η) = ηc (idc)
Notation reminder: For a presheaf F:Cop→Set and arrow u:d→e we write F(u):F(e)→F(d). For Y(c)=Hom(−,c) we have Y(c)(u):Hom(e,c)→Hom(d,c) given by precomposition with u.

1. Naturality in the first variable (in F) — postcomposition by τ

Fix c∈C. Let τ:F⇒G be a natural transformation of presheaves. The square to prove commutes is:

F(c) →φF,c Nat(Y(c),F) ↓τc ↓τ∘(−) G(c) →φG,c Nat(Y(c),G)

We must show for every x∈F(c)

φG,c (τc(x)) = τ∘φF,c (x)

Take arbitrary d∈C and f:d→c. Evaluate both sides at the component d and argument f.

Left-hand side (LHS):

(φG,c(τc(x))) d (f) = G(f)(τc(x))

Right-hand side (RHS):

(τ∘φF,c(x)) d (f) = τd ( φF,cd (x) (f) ) = τd (F(f)(x))

But τ is a natural transformation F⇒G. Naturality at the arrow f:d→c says

τd ∘ F(f) = G(f) ∘ τc

Apply both sides to x∈F(c) and get

τd (F(f)(x)) = G(f) (τc(x))

So RHS = LHS for the chosen d and f. Since d,f were arbitrary, the natural transformations are equal. Thus the square commutes. QED for naturality in F.

2. Naturality in the second variable (in c) — precomposition by Y(k)

Fix F∈C^. Let k:c′→c be a morphism in C. The square to prove commutes is:

F(c) →φF,c Nat(Y(c),F) ↓F(k) ↓(−)∘Y(k) F(c′) →φF,c′ Nat(Y(c′),F)

We must show for every x∈F(c)

φF,c′ (F(k)(x)) = φF,c (x) ∘ Y(k)

Again take arbitrary d∈C and f:d→c′. Evaluate both sides at component d and argument f.

Left-hand side (LHS):

(φF,c′(F(k)(x))) d (f) = F(f) (F(k)(x))

By functoriality of F (contravariant), F(k∘f)=F(f)∘F(k), so

F(f) (F(k)(x)) = F(k∘f)(x)

Right-hand side (RHS):

(φF,c(x)∘Y(k)) d (f) = φF,cd (x) (Yd(k)(f))

But Yd(k)(f)=k∘f (postcompose f with k to get an arrow d→c), and φF,cd(x)(k∘f)=F(k∘f)(x). So

(φF,c(x)∘Y(k)) d (f) = F(k∘f)(x)

Hence LHS = RHS (= F(k∘f)(x)) for arbitrary d,f. Therefore the square commutes. QED for naturality in c.

3. Naturality on the product C^×C (general morphism (τ,k))

A morphism in C^×C from (F,c) to (G,c′) is a pair (τ,k) with τ:F⇒G and k:c′→c. On the functors

p(F,c) = F(c) , q(F,c) = Nat(Y(c),F)

the induced maps are

p(τ,k) : F(c) →τc G(c) →G(k) G(c′)
q(τ,k) : Nat(Y(c),F) →(−)∘Y(k) Nat(Y(c′),F) →τ∘(−) Nat(Y(c′),G)

We need to show the square

F(c) →φF,c Nat(Y(c),F) ↓p(τ,k)=G(k)∘τc ↓q(τ,k)=τ∘(−)∘Y(k) G(c′) →φG,c′ Nat(Y(c′),G)

commutes, i.e. for all x∈F(c),

φG,c′ (G(k) (τc(x))) = τ∘φF,c (x) ∘ Y(k)

Evaluate both sides at an arbitrary d∈C and f:d→c′.

Left-hand side (LHS):

(φG,c′(G(k)(τc(x)))) d (f) = G(f) (G(k) (τc(x))) = G(k∘f) (τc(x))

(used functoriality G(f)∘G(k)=G(k∘f).)

Right-hand side (RHS):

(τ∘φF,c(x)∘Y(k)) d (f) = τd ( φF,cd (x) (Yd(k)(f)) )

Now Yd(k)(f)=k∘f, and φF,cd(x)(k∘f)=F(k∘f)(x). Thus

(τ∘φF,c(x)∘Y(k)) d (f) = τd (F(k∘f)(x))

Use naturality of τ:F⇒G at the arrow k∘f:d→c:

τd ∘ F(k∘f) = G(k∘f) ∘ τc

Apply both sides to x∈F(c) to obtain

τd (F(k∘f)(x)) = G(k∘f) (τc(x))

Therefore RHS (= G(k∘f)(τc(x))), which equals LHS. Since d,f were arbitrary, the two natural transformations coincide on all components and values. Thus the product square commutes and φ is natural as a transformation p⇒q on C^×C.

4. Naturality of the inverse ψ

Because φ is a natural bijection with inverse ψF,c(η)=ηc(idc), ψ is also natural. Concretely:

For τ:F⇒G:

ψG,c (τ∘η) = (τ∘η)c (idc) = τc (ηc(idc)) = τc (ψF,c(η))

So postcomposition by τ commutes with ψ.

For k:c′→c:

ψF,c′ (η∘Y(k)) = (η∘Y(k))c′ (idc′) = ηc′ (k) = F(k) (ηc(idc)) = F(k) (ψF,c(η))

So precomposition by Y(k) commutes with ψ.

Hence ψ is natural in both variables and is the inverse natural transformation to φ.

Conclusion

We have shown in full elementwise detail that for every arrow τ:F⇒G in C^ and every arrow k:c′→c in C all required squares commute. Therefore the family {φF,c} is natural in both components and gives a natural isomorphism of functors

p(F,c) = F(c) →φ q(F,c) = Nat(Y(c),F)

This completes the proof of the Yoneda Lemma.