Yoneda lemma

Natural transformations from a representable functor correspond to elements of the target functor.
Yoneda lemma

Let C\mathcal C be a such that each hom-class HomC(A,B)\mathrm{Hom}_{\mathcal C}(A,B) is a set (i.e. C\mathcal C is locally small). Fix an ACA\in\mathcal C and a F:CSetF:\mathcal C\to \mathbf{Set}.

Write the representable functor

hA:=HomC(A,):CSet, h^A := \mathrm{Hom}_{\mathcal C}(A,-):\mathcal C\to \mathbf{Set},

which is a .

Statement (covariant Yoneda)

There is a natural bijection

Nat(hA,F)    F(A), \mathrm{Nat}(h^A,\,F)\;\cong\;F(A),

natural in both AA and FF, where Nat(,)\mathrm{Nat}(-,-) denotes the set of .

Explicit correspondence

  • Given ηNat(hA,F)\eta\in \mathrm{Nat}(h^A,F), the corresponding element of F(A)F(A) is

    ηA(idA)F(A), \eta_A(\mathrm{id}_A)\in F(A),

    where idA\mathrm{id}_A is the of AA.

  • Given xF(A)x\in F(A), define a natural transformation ηx:hAF\eta^x:h^A\Rightarrow F by, for each object XX,

    ηXx:HomC(A,X)F(X),fF(f)(x). \eta^x_X:\mathrm{Hom}_{\mathcal C}(A,X)\to F(X),\quad f \mapsto F(f)(x).

    Naturality follows from functoriality of FF and in C\mathcal C.

This bijection is in fact a between functors in AA and FF.

Contravariant form

For a functor G:CopSetG:\mathcal C^{\mathrm{op}}\to \mathbf{Set}, there is a natural bijection

Nat(HomC(,A),G)    G(A). \mathrm{Nat}(\mathrm{Hom}_{\mathcal C}(-,A),\,G)\;\cong\;G(A).

(Here HomC(,A)\mathrm{Hom}_{\mathcal C}(-,A) is the usual contravariant representable.)

Examples

  1. Subsets via the power set functor. Take C=Set\mathcal C=\mathbf{Set}, let AA be a set, and let F=PF=\mathcal P be the power set functor XP(X)X\mapsto \mathcal P(X). The Yoneda lemma gives a bijection

    Nat(Hom(A,),P)P(A), \mathrm{Nat}(\mathrm{Hom}(A,-),\mathcal P)\cong \mathcal P(A),

    so natural transformations correspond exactly to subsets SAS\subseteq A. Concretely, SAS\subseteq A yields ηXS(f)=f(S)X\eta^S_X(f)=f(S)\subseteq X.

  2. Picking an element of a group naturally. Take C=Grp\mathcal C=\mathbf{Grp}, let A=GA=G be a group, and let F=U:GrpSetF=U:\mathbf{Grp}\to\mathbf{Set} be the underlying-set functor. Then

    Nat(HomGrp(G,),U)U(G), \mathrm{Nat}(\mathrm{Hom}_{\mathbf{Grp}}(G,-),U)\cong U(G),

    i.e. natural transformations correspond to elements gGg\in G. The corresponding ηHg:Hom(G,H)U(H)\eta^g_H:\mathrm{Hom}(G,H)\to U(H) sends a homomorphism φ:GH\varphi:G\to H to φ(g)H\varphi(g)\in H.

  3. Recovering maps into a fixed module. Let C=R-Mod\mathcal C=R\text{-}\mathbf{Mod} and take F(X)=HomR(M,X)F(X)=\mathrm{Hom}_R(M,X) viewed as a set-valued functor (forgetting the abelian group structure). Yoneda yields

    Nat(HomR(A,),HomR(M,))HomR(M,A), \mathrm{Nat}(\mathrm{Hom}_R(A,-),\,\mathrm{Hom}_R(M,-))\cong \mathrm{Hom}_R(M,A),

    so a natural way to turn maps AXA\to X into maps MXM\to X is the same as choosing a map MAM\to A.

The Yoneda lemma implies that the is fully faithful, and it is the basic tool for working with .