# Difficulty understanding proof of Yoneda's Lemma

I've been trying to wrap my head around Yoneda's Lemma but it isn't clicking. I've been reading through this post here but I need some help.

I spent a while starring at this commutative diagram on Wikipedia: Here is how I'm thinking about this and how it goes astray. I think the outer square is showing us the images of $A$ and $X$ under both functors, then we fix any $f : X \rightarrow Y$ and the inside square follows the behavior of $Hom(A,f)$ and $F(f)$, respectively in order to properly establish $\Phi_*$. So clearly $Hom(A,f)$ maps $id_A$ to $f$ (by definition of $Hom(A,-)$). Now we freely pick $u$ (because the theorem says each such choice leads to a unique $\Phi$). Then we know that $F(f)$ acts on $u$ by taking it to $(Ff)u$ and so we define $\Phi_X$ to take $f$ to that to get commutativity. Fine,but how does this extend to arbitrary $X,Y$ where none of them are $A$ if all we know how to do is map $id_A$? In other words, If on the topmost left corner square we replace $Hom(A,A)$ with $Hom(A,Y)$ then how do we know $\Phi_Y$ and $\Phi_X$ do the right thing, or how do we even know how they behave

Here is a diagram where I attempt to look at what happens for arbitrary $X$ and $Y$. I know I need a $g : X \rightarrow Y$ to get a map $Hom(A,g)$ which must take an $f : A \rightarrow X$ to $g \circ f \in Hom(A,Y)$. Then I know the bottom right corner is $\Phi_Y(g \circ f)$ but I don't know where $f$ goes. Taking it from the Wikipedia square (which took $f$ to $(Ff)u$ I now have something like $F[(Ff)u]$ should equal $\Phi_Y(g \circ f)$? • Your explanation up until you get to the line "But it's not really..." looks fine- so I don't understand your confusion from then on: as you say, $${\rm Hom} ( A, f) id = f \in {\rm Hom} ( A, X).$$ No? – peter a g Nov 15 '15 at 1:15
• So $Hom(A,f) \in Hom(Hom(A,A),Hom(A,X))$ because the objects in the target category of $Hom(A,-)$ are Hom-sets. I get that $Hom(A,f)$ maps $id_A \in Hom(A,A)$ to $f \circ id_A = f \in Hom(A,X)$ but it isn't $f$ because $f$ and $Hom(A,f)$ live in different categories. So it confuses me to see $id_A \rightarrow f$ there. – Palace Chan Nov 15 '15 at 1:24
• @peterag, I updated my question to take into account my latest understanding as I keep thinking about this. – Palace Chan Nov 15 '15 at 1:34
• oops I didn't mean to post it as an answer - I was using the answer space as a scrap sheet. – peter a g Nov 15 '15 at 1:39
• putting this where I meant this to be - not an answer: OK : point 1: it seems to me that you are confusing the map with its image: i.e., $f \ne {\rm Hom} (A, f)$; instead $f = {\rm Hom} (A, f) id$. Point 2: you said $f$ and $f_* ={\rm Hom} (A, f)$ live in different categories - yes... a priori $f$ and $id$ are MORPHISMS in one category, and $f_*$ in another. The idea of Yoneda is to consider $f$ and $id$ as OBJECTs in the category where $f_*$ is a morphism: so that it makes sense to write $f_*(id) =f$, i.e., $f$ is in the image of $f_*$. – peter a g Nov 15 '15 at 1:42

OK : point 1: it seems to me that you are confusing the map with its image: i.e., $f \ne {\rm Hom} (A, f)$; instead $f = {\rm Hom} (A, f) id$.

Point 2: you said $f$ and $f_* ={\rm Hom} (A, f)$ live in different categories - yes... a priori $f$ and $id$ are MORPHISMS in one category, and $f_*$ in another. The idea of Yoneda is to consider $f$ and $id$ as ELEMENTS of SETS, which are objects in the category (Set) where $f_*$ is a morphism: $id \in {\rm Hom} (A,A)$ and $f \in {\rm Hom} (A,B)$ so that it makes sense to write $f_*(id) =f$, i.e., $f$ is in the image of $f_*$.

Comment - as I noted in the comment sections, the above originally was meant to appear in the comment section, and not here. I am leaving it, as it allows me to correct here a mis-statement in the original, and for 'posterity.'

Note: The statement of Yoneda often comes in two 'parts' - although the proof is 'identical' in both cases. The question treats the second part.

So - for completeness - here is the first (embedding) part:

Suppose $\mathcal C$ is a category where ${\rm Hom}(A,B)$ is a set, for any two objects $A$ and $B$ - for some people (me), this is in the definition of category, but for others, such categories are called locally small.

Write ${Set}^{\mathcal C}$ to denote the category of (co-variant) functors from $\mathcal C$ to the category of sets: objects are functors, and arrows are natural transformations.

The Yoneda functor is the contravariant functor $Y\colon {\mathcal C} \rightarrow {Set}^{\mathcal C}$, which on objects carries
$$A \mapsto {\rm Hom} (A,- ),$$ and on arrows, takes $g \in {\rm Hom} (A,B )$ to

$$g^*\colon {\rm Hom} (B,- ) \rightarrow {\rm Hom} (A,- ),$$ where $g^*_C\colon {\rm Hom} (B,C ) \rightarrow {\rm Hom} (A,C )$ is the map

$$f \mapsto f \circ g.$$ (I'm writing the subscript $C$ in $g^*_C$ to conform with the notation above.)

The 'embedding part' of the Yoneda lemma is that the (contravariant ) Yoneda functor $Y$ is faithful and full - i.e. $g\mapsto g^*$ is injective, and every arrow (natural transformation)

$$\Phi\colon {\rm Hom} (B,- )\rightarrow {\rm Hom} (A,- )$$ is of the form $g^*$.

As I mentioned in the conversation off-line, a category theory friend of mine liked to say that the Yoneda embedding statement is a tautology, and paraphrased it by saying: "the statement of Yoneda is: an object is determined by the arrows from (or to, depending which version of Yoneda) the object. The proof of Yoneda is: in particular, the object is determined by the identity."

In any case, the proof of this version of Yoneda goes as above:

If $\Phi_B(id_B) = g \in {\rm Hom} (A,C )$, then to calculate $\Phi_C(f)$, for $f \in {\rm Hom} (B ,C )$:

Since $f =f \circ id = f_*(id_B)$,

$$\Phi_C (f) = \Phi_C ( f_* (id_B) ) = f_*\Phi_B(id) = f_*(g) = f\circ g = g^*_C (f),$$ so $\Phi = g^*$.

For the injectivity $g^*_B(id) = g$.

Remark: consistency suggests subscripts on $f_*$ too - but I didn't in the first exchange, and it makes it harder to read anyway. Usually, one doesn't on $g^*$ either...

• see my comment above - I didn't mean to post this as an answer! Do you know how to 'chat' ? I don't... – peter a g Nov 15 '15 at 1:40
• I don't know how either, I think I've updated my question to agree with your Point 2. $f_*(id) = f$ is true, yes. I think what I don't get is $\Phi$ - it's some "higher level" abstraction so I'm having trouble extending the logical consistency of the inner square above to arbitrary $X,Y$ and visualizing all of $\Phi$ – Palace Chan Nov 15 '15 at 1:42
• @PalaceChan - I corrected a 'typo' - you can see what it is by comparing with the corresponding Point 1 Point 2 comment under your original question. For completeness, I added the 'embedding' part of Yoneda - I hope I haven't screwed anything up, as it is rather late... Best! – peter a g Nov 16 '15 at 9:27
• I was just reading about this part today. Yoneda functor. I can follow the arrows but I'm still not as comfortable as id like bookkeeping in my head the appearance of the natural transforms because of the layering (arrows on sets of arrows). I'll keep at it. – Palace Chan Nov 17 '15 at 5:54
• Do you know the catsters? A v. good humored presentation series on category theory - each lecture is no more than 15 mins - here is Eugenia Cheng with the first of three on Yoneda (the version with the arrows going the other way) : youtube.com/watch?v=4QgjKUzyrhM I remember the sequence on monads as being particularly good. – peter a g Nov 17 '15 at 12:17

Palace Chan, not sure if you are still perplexed by Yoneda's lemma but if so I may be able to help. Looking at an early post you write: "I now have something like F[(Ff)u]should equal ΦY(g∘f)?". You appear to be treating F here like a function acting on the set F(X). The functorial notion can be confusing that way, but F does not act as a set function, taking elements of F(X) to elements of another set. It takes objects in the category A to objects in the category of sets.

I found that a good introduction to understanding Yoneda was via looking at monoids, a special type of category. Yoneda's lemma turns out to reduce to a simple algebraic fact. If you look at the action of elements of a monoid M acting on M by left multiplication, this "left action" maps the M homomorphically into the set of permutations of M. One can ask, what are the mappings of M into itself of M that commute with the left actions, ie the set of endomporhisms of M under this action? They turn out to be just the set of right actions of M. You can find the right action element of M corresponding to a homomorphism g as being just g(1). This is analogous to the Yoneda lemma's mapping of a natural mapping from Hom(A,-) to F, by finding the action of that mapping on 1A. Natural mappings are analogous to homomorphisms in the monoid case.

If interested, I can write all this out in more detail?

• This site provides MathJax. – choco_addicted Apr 22 '16 at 11:09