Category Theory
Zulip Server
Archive

You're reading the public-facing archive of the Category Theory Zulip server.
To join the server you need an invite. Anybody can get an invite by contacting Matteo Capucci at name dot surname at gmail dot com.
For all things related to this archive refer to the same person.


Stream: deprecated: recommendations

Topic: intuitive explanation of Yoneda lemma


view this post on Zulip Brendan Fong (Apr 30 2020 at 18:20):

I've been asked to recommend an intuitive/non-technical explanation of the Yoneda lemma, preferably in video form, and targeted towards non-mathematicians. Does anybody have any favourites to share?

view this post on Zulip Gershom (Apr 30 2020 at 18:24):

i think its not so simple to explain without _some_ prerequisites. This is a classic post that made it "click" for a lot of programmers: http://blog.sigfpe.com/2006/11/yoneda-lemma.html

view this post on Zulip Gershom (Apr 30 2020 at 18:26):

here's a video of a talk at a FP conference trying to get across the basic idea, but it requires a fair amount of background as well: https://www.youtube.com/watch?v=Z3vr5xylMCE

view this post on Zulip Simon Burton (Apr 30 2020 at 18:54):

This math3ma video dances around yoneda nicely: https://www.youtube.com/watch?v=wiadG3ywJIs

view this post on Zulip Fabrizio Genovese (Apr 30 2020 at 19:22):

I don't think Yoneda really clicks without examples. There are two stages at work here:

view this post on Zulip Arthur Parzygnat (Apr 30 2020 at 19:34):

@Brendan Fong I would agree with @Simon Burton that Tai's video gives a very intuitive explanation (look at around 8:30 if you're short on time). She explains that Yoneda describes how an object in a category is determined by its relations to all other objects in that category. Maybe a cool example is to consider the special case of groups (https://en.wikipedia.org/wiki/Yoneda_lemma#Relationship_to_Cayley's_theorem), which you can explain with pictures of permutations of geometric figures in the plane.
This, by the way, reminds me of a wonderful quote I once read on mathoverflow:
"Groups, as men, will be known by their actions".
-Guillermo Moreno. (Reference: https://mathoverflow.net/questions/7155/famous-mathematical-quotes)

view this post on Zulip sarahzrf (May 01 2020 at 04:22):

oh man i STILL need to go back and finish writing up my explainer :weary:

view this post on Zulip সায়ন্তন রায় (May 01 2020 at 04:44):

@Brendan Fong See this answer.

view this post on Zulip sarahzrf (May 01 2020 at 04:47):

i think there are a lot more intuitive explanations out there for the full faithfulness of the yoneda embedding than there are for Hom(y(A),F)F(A)\operatorname{Hom}(y(A), F) \cong F(A) itself

view this post on Zulip Brendan Fong (May 01 2020 at 04:59):

Thanks Gershom, Simon, Fab, Arthur, Sayantan! Those are all great resources! I think my friend is after something that lies somewhere in between them though -- a short (maybe ten minute) video explanation that doesn't assume a mathematical or programming background, and doesn't necessarily try to get across the proof, but does reward a dedicated learner with an ability to explain the theorem statement and have a sense of the philosophical importance. I'll search a bit more and let you know if I come up with something.

view this post on Zulip Gershom (May 01 2020 at 05:41):

The best "slogan" for explaining yoneda I came up with, by the way (which is I think an intuitive explanation, but does not get at the significance at all, and may even hide it), when I was presenting it at some reading group or another, was "Yoneda is essentially the statement that curry and uncurry are inverses in the category of categories".

view this post on Zulip sarahzrf (May 01 2020 at 05:41):

huh, wha

view this post on Zulip sarahzrf (May 01 2020 at 05:42):

how do you work that

view this post on Zulip sarahzrf (May 01 2020 at 05:42):

ooh is it like... yy is the currying of the hom functor? has something to do with it?

view this post on Zulip sarahzrf (May 01 2020 at 05:43):

...im not sure id fully thought about that before 🤯

view this post on Zulip Johannes Drever (May 01 2020 at 09:04):

@Fabrizio Genovese what is a commutative square of homsets?

view this post on Zulip Fabrizio Genovese (May 01 2020 at 11:48):

A square where some of the vertexes are Homsets. What I mean is this: Imagine you have the following situation: Hom(A,)anythingHom(A,)Hom(A,-) \xrightarrow{anything} Hom(A,-), meaning: you can plug whatever you want on the arrow, and in place of the dashes. This is the case for instance if you have a natural transformation Hom(A,)FHom(A,-) \to F, since for every couple of objects X,YX,Y and every morphisms ff you get a square:
Hom(A,Y) -> FY
.|....................|
.|Hom(A,f).....|Ff
.|....................|
.V...................V
Hom(A,X) -> FX
Now the idea is that if I plug the identity in the homset on top, I can lift whatever element of the homset in the bottom to be an edge. Namely, for every g:AXg:A \to X, if I consider Hom(A,A)Hom(A,g)Hom(A,X)Hom(A,A) \xrightarrow{Hom(A,g)} Hom(A,X), then the identity hits exactly gg, since idA;g=gid_A;g = g. This is what makes Yoneda work, since once you decide where the identity goes, you fully determine a natural transformation: To know where a given element in a given homset is mapped, you just lift it to an edge. From here you can say that "there are as many natural transformations from Hom(A,)Hom(A,-) to a functor FF as there are ways to map the identity on AA to FAFA. Since the identity can be mapped to any element of FAFA, this means that Nat(Hom(A,),F)FANat(Hom(A,-),F) \simeq FA, which is (covariant) yoneda xD

view this post on Zulip Matteo Capucci (he/him) (May 01 2020 at 18:57):

I see Yoneda from a logical perspective. To me, it's the statement that SetSet-enriched categories can always be thought as "categories of sets" in some way.
Here's what I mean.
Hom-sets C(X,A)C(X, A) can be considered as generalized elements of AA "at stage XX. Hence Yoneda tells me that I know everything about an object if I know everything about its generalized elements. A naive way to think about this is to imagine objects of CC as being sets which can contain elements of different types. If you reason this way, everything checks out, since you're reasoning in the internal logic of CC.
In fact one should call generalized elements XAX \to A "terms of type AA in context XX". Then Yoneda says two types of this type theory are equal iff they have the same terms.

view this post on Zulip Matteo Capucci (he/him) (May 01 2020 at 18:57):

I guess it's not entirely straightforward nor elementary, but it works for me.

view this post on Zulip Matteo Capucci (he/him) (May 01 2020 at 18:59):

If I were to explain Yoneda lemma to a layman, I'll just say it's the mathematical formalization of "tell me your friends I'll tell you who you are"

view this post on Zulip sarahzrf (May 01 2020 at 19:23):

the compressed version of the explanation that i keep meaning to finish writing down is like

  1. presheaves are "codomains for generalized morphisms out of objects of C"
  2. yoneda lemma says that once you assemble presheaves into a category of their own, those generalized morphisms are exactly the ordinary morphisms of the appropriate type in the generalized category, if we identify an object of C with its yoneda embedding

view this post on Zulip sarahzrf (May 01 2020 at 19:27):

in other words: im trying to make a case for writing F(A)F(A) as Hom(A,F)\operatorname{Hom}(A, F) in the first place as an intuitive abuse of notation, at which point it looks way more intuitive to say Hom(A,F)Hom(y(A),F)\operatorname{Hom}(A, F) \cong \operatorname{Hom}(y(A), F)

view this post on Zulip sarahzrf (May 01 2020 at 19:29):

:heart: turning abuses of notation into things that are formally correct :heart:

view this post on Zulip Eduardo Ochs (May 02 2020 at 00:35):

sarahzrf said:

in other words: im trying to make a case for writing F(A)F(A) as Hom(A,F)\operatorname{Hom}(A, F) in the first place as an intuitive abuse of notation, at which point it looks way more intuitive to say Hom(A,F)Hom(y(A),F)\operatorname{Hom}(A, F) \cong \operatorname{Hom}(y(A), F)

I think that Reyes*2 and Zolfaghari's book do something like that...
https://marieetgonzalo.files.wordpress.com/2004/06/generic-figures.pdf

view this post on Zulip Eduardo Ochs (May 02 2020 at 00:36):

I'll try to decypher its notation again and check if what I said proceeds.

view this post on Zulip John Baez (May 02 2020 at 01:36):

Matteo Capucci said:

I see Yoneda from a logical perspective. To me, it's the statement that Set\mathsf{Set}-enriched categories can always be thought as "categories of sets" in some way.

Yes: Yoneda is a generalization of Cayley's theorem, which says that every group can be seen as a group of (some of the) permutations of a set.

There's a funny mutant version of the Yoneda embedding where you take each object of your category CC and send it to the set of all arrows into that object. This gives a functor CSetC \to \mathsf{Set}, at least if CC is small. People may enjoy playing around with this.

view this post on Zulip Aniruddh Agarwal (May 02 2020 at 05:29):

John Baez said:

Matteo Capucci said:

I see Yoneda from a logical perspective. To me, it's the statement that Set\mathsf{Set}-enriched categories can always be thought as "categories of sets" in some way.

Yes: Yoneda is a generalization of Cayley's theorem, which says that every group can be seen as a group of (some of the) permutations of a set.

There's a funny mutant version of the Yoneda embedding where you take each object of your category CC and send it to the set of all arrows into that object. This gives a functor CSetC \to \mathsf{Set}, at least if CC is small. People may enjoy playing around with this.

I think you only need the category to be locally small for the "mutant" Yoneda embedding to work?

view this post on Zulip sarahzrf (May 02 2020 at 05:45):

that isn't enough—say C is Set

view this post on Zulip sarahzrf (May 02 2020 at 05:46):

that's locally small, but the collection of all functions into a given set is a class

view this post on Zulip John Baez (May 02 2020 at 06:34):

You only need the category to be locally small for the usual, non-mutant Yoneda embedding to work.

view this post on Zulip Matteo Capucci (he/him) (May 02 2020 at 13:44):

Matteo Capucci said:

I see Yoneda from a logical perspective. To me, it's the statement that SetSet-enriched categories can always be thought as "categories of sets" in some way.
Here's what I mean.
Hom-sets C(X,A)C(X, A) can be considered as generalized elements of AA "at stage XX. Hence Yoneda tells me that I know everything about an object if I know everything about its generalized elements. A naive way to think about this is to imagine objects of CC as being sets which can contain elements of different types. If you reason this way, everything checks out, since you're reasoning in the internal logic of CC.
In fact one should call generalized elements XAX \to A "terms of type AA in context XX". Then Yoneda says two types of this type theory are equal iff they have the same terms.

This morning it occurred to me this is actually quite a useful perspective, since it allows to perform diagram chasing by chasing elements: you just chase generalized elements.

view this post on Zulip Todd Trimble (May 02 2020 at 14:02):

Yes. For example, theorems about internal structures in a category EE expressed in finite limit logic reduce to the case E=SetE = Set.

view this post on Zulip Oscar Cunningham (May 02 2020 at 14:26):

John Baez said:

There's a funny mutant version of the Yoneda embedding where you take each object of your category CC and send it to the set of all arrows into that object. This gives a functor CSetC \to \mathsf{Set}, at least if CC is small. People may enjoy playing around with this.

You can use it to show that every poset embeds into a powerset and every graph is an intersection graph.

view this post on Zulip Paul Blain Levy (Jun 18 2020 at 23:48):

The statement that "an object is determined by its relation to all other objects in the category" is an explanation of the full faithfulness of the Yoneda embedding. It is not an explanation of the Yoneda lemma, which is a stronger result.

view this post on Zulip Paul Blain Levy (Jun 18 2020 at 23:52):

Sorry, I just realize that @sarahzrf said exactly this (but more politely).

view this post on Zulip Paul Blain Levy (Jun 19 2020 at 00:11):

"If you want to impress someone, say 'By the Yoneda Lemma'. If you want them to understand you, say 'Apply it to the identity'. " - Neil Ghani

view this post on Zulip Fabrizio Genovese (Jun 19 2020 at 13:17):

Paul Blain Levy said:

"If you want to impress someone, say 'By the Yoneda Lemma'. If you want them to understand you, say 'Apply it to the identity'. " - Neil Ghani

For me the explanation of the Yoneda lemma is literally " I can take a point that lives in the corner of a square and make it become an edge of such square". This is the whole intuition that makes the proof click.

view this post on Zulip Oliver Shetler (Jun 21 2020 at 00:32):

Fabrizio Genovese said:

Paul Blain Levy said:

"If you want to impress someone, say 'By the Yoneda Lemma'. If you want them to understand you, say 'Apply it to the identity'. " - Neil Ghani

For me the explanation of the Yoneda lemma is literally " I can take a point that lives in the corner of a square and make it become an edge of such square". This is the whole intuition that makes the proof click.

Can you elaborate a little more? I like where this is going.

view this post on Zulip Fabrizio Genovese (Jun 21 2020 at 00:36):

Yoneda lemma says Nat[Hom(A),F]FANat[Hom(-A),F] \simeq FA. To prove this, you start by considering a natural transformation from Hom[,A]Hom[-,A] to FF. On any given component BB, this is just a function Hom(B,A)FBHom(B,A) \to FB. Let's consider where this function sends an f:BAf:B \to A. To understand this, we consider the AA component of the natural transformation, a function Hom(A,A)FAHom(A,A) \to FA. We can draw a commutative square where these two functions are the rows. and we can plug any morphism BAB \to A (acted upon by Hom[B,A]Hom[B,A] and FF, respectively) in the columns.

view this post on Zulip Fabrizio Genovese (Jun 21 2020 at 00:37):

The key observation is that our ff is in the bottom left of this square we just draw, but we can "lift it to an edge" by plugging it in the columns. And the magical thing is that at this point the identity AAA \to A in the top left corner gets sent exactly to it!

view this post on Zulip Fabrizio Genovese (Jun 21 2020 at 00:38):

So, in this sense, the whole point of proving Yoneda is that, in considering that square, by looking at the identity AAA \to A you actually get a way to lift the morphisms into the bottom-left corner of the square to edges.