Yoneda lemma

category theory

topos theory

# Contents

## Idea

What is sometimes called the co-Yoneda lemma is a basic fact about presheaves (a basic fact of topos theory): it says that every presheaf is a colimit of representables and more precisely that it is the “colimit over itself of all the representables contained in it”.

One might think of this as related by duality to the Yoneda lemma, hence the name.

## Every presheaf is a colimit of representables

Recall that the Yoneda lemma says that for $C$ a $V$-enriched category, $F:{C}^{\mathrm{op}}\to V$ a $V$-valued presheaf on $C$ and $c\in C$ an object of $C$, there is a natural isomorphism in $V$

$\left[{C}^{\mathrm{op}},V\right]\left(C\left(-,c\right),F\right)\simeq F\left(c\right)\phantom{\rule{thinmathspace}{0ex}}.$[C^{op},V](C(-,c), F) \simeq F(c) \,.

Using the definition of the enriched functor category on the left in terms of an end, this reads

${\int }_{c\prime \in C}V\left(C\left(c\prime ,c\right),F\left(c\prime \right)\right)\simeq F\left(c\right)\phantom{\rule{thinmathspace}{0ex}}.$\int_{c' \in C} V(C(c',c), F(c')) \simeq F(c) \,.

In this form the Yoneda lemma is also referred to as Yoneda reduction.

Under abstract duality an end turns into a coend, so a co-Yoneda lemma ought to be a similarly fundamental expression for $F\left(c\right)$ in terms of a coend.

The natural candidate is the statement that every presheaf is a colimit of representables which may be stated as

$F\left(c\right)\simeq {\int }^{c\prime \in C}C\left(c,c\prime \right)\otimes F\left(c\prime \right)$F(c) \simeq \int^{c' \in C} C(c,c')\otimes F(c')

hence

$F\left(-\right)\simeq {\int }^{c\prime \in C}Y\left(c\prime \right)\otimes F\left(c\prime \right)\phantom{\rule{thinmathspace}{0ex}},$F(-) \simeq \int^{c' \in C} Y(c')\otimes F(c') \,,

where $Y$ denotes the Yoneda embedding. In module language (…I forget which entry gives the discussion of this…) this reads

$F\left(c\right)\simeq C\left(c,-\right){\otimes }_{C}F\phantom{\rule{thinmathspace}{0ex}}.$F(c) \simeq C(c,-)\otimes_C F \,.

This statement we call the co-Yoneda lemma.

Yet another way to state this is as a colimit over the comma category $\left(Y,F\right)$, for $Y$ the Yoneda embedding:

$F\simeq {\mathrm{colim}}_{\left(U\to F\right)\in \left(Y,F\right)}Y\left(U\right)\phantom{\rule{thinmathspace}{0ex}}.$F \simeq colim_{(U \to F) \in (Y,F)} Y(U) \,.
###### Proof

To show that a presheaf $F:{C}^{\mathrm{op}}\to \mathrm{Set}$ is canonically presented as a colimit of representables, we exhibit a natural isomorphism

${\int }^{c:C}F\left(c\right)×{\mathrm{hom}}_{C}\left(-,c\right)\cong F$\int^{c: C} F(c) \times \hom_C(-, c) \cong F

By the definition of coend, maps ${\int }^{c}F\left(c\right)×{\mathrm{hom}}_{C}\left(-,c\right)\to G\left(-\right)$ are in natural bijection with families of maps $F\left(c\right)×{\mathrm{hom}}_{C}\left(d,c\right)\to G\left(d\right)$ extranatural in $c$ and natural in $d$. Those are in natural bijection with families of maps $F\left(c\right)\to \mathrm{hom}\left({\mathrm{hom}}_{C}\left(d,c\right),G\left(d\right)\right)$ natural in $c$ and extranatural in $d$. These are in natural bijection with families of maps $F\left(c\right)\to \mathrm{Nat}\left({\mathrm{hom}}_{C}\left(-,c\right),G\right)\cong G\left(c\right)$ (natural in $c$), where the isomorphism is by the Yoneda lemma. Thus we have exhibited a natural isomorphism

$\mathrm{Nat}\left({\int }^{c}F\left(c\right)×{\mathrm{hom}}_{C}\left(-,c\right),G\right)\cong \mathrm{Nat}\left(F,G\right)$Nat(\int^c F(c) \times \hom_C(-, c), G) \cong Nat(F, G)

(natural in $G$). By Yoneda again, this gives ${\int }^{c}F\left(c\right)×{\mathrm{hom}}_{C}\left(-,c\right)\cong F$.

If one follows the Yoneda-lemma argument at the end, one arrives at the explicit isomorphism

${\int }^{c}F\left(c\right)×{\mathrm{hom}}_{C}\left(-,c\right)\to F$\int^c F(c) \times \hom_C(-, c) \to F

Namely, it corresponds to the family of maps

$F\left(c\right)×{\mathrm{hom}}_{C}\left(d,c\right)\to F\left(d\right)$F(c) \times \hom_C(d, c) \to F(d)

(extranatural in $c$ and natural in $d$) which in turn corresponds to the natural family

${\mathrm{hom}}_{C}\left(d,c\right)\to \mathrm{hom}\left(F\left(c\right),F\left(d\right)\right)$\hom_C(d, c) \to \hom(F(c), F(d))

associated with the structure of the functor $F:{C}^{\mathrm{op}}\to \mathrm{Set}$.

## MacLane’s co-Yoneda lemma

In a brief uncommented exercise on MacLane, p. 62
the following statement, which is atrributed to Kan, is called the co-Yoneda lemma.

For $D$ a category, Set the category of sets, $K:D\to \mathrm{Set}$ a functor, let $\left(*↓K\right)$ be the comma category of elements $x\in Kd$, let $\Pi :\left(*↓K\right)\to D$ be the projection $\left(x\in Kd\right)↦d$ and let for each $a\in D$ the functor ${\Delta }_{a}:\left(*↓K\right)\to D$ be the diagonal functor sending everything to the constant value $a$.

The co-Yoneda lemma in the sense of Kan/MacLane is the statement that there is a natural isomorphism of functor categories

$\left[D,\mathrm{Set}\right]\left(K,D\left(a,-\right)\right)\cong \left[\left(*↓K\right),D\right]\left({\Delta }_{a},\Pi \right).$[D,Set](K, D(a, -)) \cong [(*\darr K), D](\Delta_a, \Pi).

Here is an outline of an explicit proof:

###### Proof

A natural transformation $\varphi :K\to D\left(a,-\right)$ assigns to each element $x\in Kc$ an element ${\varphi }_{c}\left(x\right)\in D\left(a,c\right)$, i.e., an arrow ${\varphi }_{c}\left(x\right):a\to c$. We define a corresponding transformation $\psi :{\Delta }_{a}\to \Pi$ which assigns to each object $\left(c,x\in Kc\right)$ in $\left(*↓K\right)$ the morphism ${\varphi }_{c}\left(x\right):a\to c=\Pi \left(c,x\right)$. It is easy to check that the naturality condition on $\varphi$ corresponds to the naturality condition on $\psi$, and that the correspondence is bijective.

Here is a more conceptual proof in terms of comma categories:

###### Proof

Set classifies discrete fibrations, in the sense that a functor $G:D\to \mathrm{Set}$ classifies the discrete fibration

$Q:{\Pi }_{G}:\mathrm{El}\left(G\right)\to D$Q : \Pi_G : El(G) \to D

and natural transformations $\alpha :G\to F$ correspond to maps of fibrations

$\mathrm{El}\left(G\right)\to \mathrm{El}\left(f\right)$El(G) \to El(f)

i.e. functor which commute on the nose with the projections ${\Pi }_{G}$, ${\Pi }_{F}$ to the base category $D$).

This applies in particular to $F=\mathrm{hom}\left(a,-\right)$. Notice the category of elements $\mathrm{El}\left(\mathrm{hom}\left(a,-\right)\right)$ is the co-slice $\left(a↓D\right)$, with its usual projection $\Pi$ to $D$.

However, the comma category $\left(a↓D\right)$ is the “lax pullback” (really, the comma object, the discussion at 2-limit) appearing in

$\begin{array}{ccc}\left(a↓D\right)& \stackrel{\Pi }{\to }& D\\ ↓& ⇑& {↓}^{\mathrm{Id}}\\ *& \stackrel{a}{\to }& D\end{array}$\array{ (a \downarrow D) &\stackrel{\Pi}{\to}& D \\ \downarrow &\Uparrow& \downarrow^{Id} \\ * &\stackrel{a}{\to}& D }

and so a fibration map $\mathrm{El}\left(G\right)\to \left(a↓D\right)$ corresponds exactly to a lax square

$\begin{array}{ccc}\mathrm{El}\left(G\right)& \stackrel{{\Pi }_{G}}{\to }& D\\ ↓& ⇑& {↓}^{\mathrm{Id}}\\ *& \stackrel{a}{\to }& D\end{array}\phantom{\rule{thinmathspace}{0ex}}.$\array{ El(G) &\stackrel{\Pi_G}{\to}& D \\ \downarrow &\Uparrow& \downarrow^{Id} \\ * &\stackrel{a}{\to}& D } \,.

This yields the co-Yoneda lemma in the sense of MacLane’s exercise.

## References

The coYoneda lemma appears as a brief uncommented exercise on p. 63 of

where it is atributed to Kan.

A blog discussion which led to the creation of this entry is here.

Revised on October 3, 2012 16:58:07 by Urs Schreiber (131.174.189.169)