· Math

A Simple Intuition for Understanding the Yoneda Lemma

The Yoneda Lemma says:

An object is determined by how every other object maps into it.

Instead of studying an object XX directly, study all morphisms into it.

The Hom Functor

For each object AA in a category C\mathcal C, consider

Hom(A,X)\mathrm{Hom}(A,X)

the set of arrows from AA to XX.

This defines a functor

hX=Hom(,X)h_X = \mathrm{Hom}(-,X)

called a representable functor.

The Lemma

For any functor

F:CopSetF : \mathcal C^{op} \to \mathbf{Set}

there is a natural bijection

Nat(hX,F)F(X)\mathrm{Nat}(h_X,F) \cong F(X)

where:

  • Nat(hX,F)\mathrm{Nat}(h_X,F) is the set of natural transformations
  • F(X)F(X) is the value of the functor at (X)(X)

Meaning

Every natural transformation

η:Hom(,X)F\eta : \mathrm{Hom}(-,X)\to F

is completely determined by a single element

xF(X)x \in F(X)

Why This Works

Evaluate the transformation at the identity morphism:

idXHom(X,X)\mathrm{id}_X \in \mathrm{Hom}(X,X)

Then

x=ηX(idX)x = \eta_X(\mathrm{id}_X)

and this one element reconstructs all of η\eta.

Famous Consequence

If

Hom(,X)Hom(,Y)\mathrm{Hom}(-,X) \cong \mathrm{Hom}(-,Y)

then

XYX \cong Y

Objects are fully encoded by their relationships.

Intuition

Do not ask:

“What is XX?”

Ask:

“How does everything map into XX?”

Those mapping patterns are the object.

One Line Summary

Nat(Hom(,X),F)F(X)\boxed{ \mathrm{Nat}(\mathrm{Hom}(-,X),F)\cong F(X) }

That is the famous Yoneda Lemma.