Awodey calls it “the single most used result” of category theory (Category Theory, p. 185), Crole regards it as “an indispensable tool which every category theorist should carry in his kit and be able to use” (Categories for Types, p. 63), and Leinster says if it were false “the world would look much more complex” (Basic Category Theory, p. 95). Yes, that’s just how significant the Yoneda lemma is! Alongside its unanimous significance, however, is its notorious difficulty for beginners. Almost every textbook I’ve read has a message at the beginning of the chapter or section on the lemma (or really theorem) warning students that it’s a challenging lesson ahead or that the material that follows will be heavy. The comment below from StackExchange gives a relatable hint of how mind-bending the Yoneda lemma is:

Chris Taylor: I have trouble following the category-theoretic statement and proof of the Yoneda Lemma. Indeed, I followed a category theory course for 4-5 lectures (several years ago now) and felt like I understood everything until we covered the Yoneda Lemma, after which point I lost interest.

So, those who manage to survive the Yoneda lemma can proudly call themselves “true categorists.” 🤓

Two Yonedas

It seems to me that there are two Yoneda lemmas folded together—just like there are three Beijings folded together in Jingfang Hao’s Hugo-award-winning sci-fi noveletteone is like zen while the other is like an assembly language.1 The zen-like Yoneda is crystal clear in its purpose and ambition, but it’s only suitable for spiritual discussion; nothing down-to-earth can be done with its zen in mathematical practice. The assembly-language-like Yoneda, on the other hand, fleshes out the details of the lemma that are glossed over in its zen, but the details are so convoluted and multithreaded that novices will quickly lose direction in its logical and notational juggernaut. So, it’d be way too early for a beginner to feel relieved when meeting the zen-like Yoneda 🧘 and think “well it’s not as hard as they say”—wait till you see its other face 🧟‍♀️!

What’s my own experience with the Yoneda lemma? It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard. It’s hard…😝

And like many other parts of category theory. The way it’s taught in textbooks doesn’t really help reduce the difficulty. In fact I realize in hindsight that sometimes I got stuck not because of the intrinsic complexity of the lemma (it is complex of course!) but because of the ambiguous notation. Notational ambiguity may be easily filtered out by experts, but they can be really frustrating for beginners.

So, in this and the next two posts I’ll try to explain the Yoneda lemma in a way that has been helpful to myself. Hopefully it’ll also help you if you happen to be puzzled by the same questions. For ease of later reference I’ll give the lemma up front. The following version is taken from Awodey’s textbook:

Yoneda lemma: Let $\mathbb{C}$ be locally small. For any object $C\in\mathbb{C}$ and functor $F\in\mathbf{Sets}^{\mathbb{C}^{op}},$ there is an isomorphism $Hom(yC, F) \cong FC$ which, moreover, is natural in both $F$ and $C.$ (Category Theory, pp. 188–189)

The $y$ in this definition is the Yoneda functor (aka Yoneda embedding), which is defined as follows:

The Yoneda embedding is the functor $y\colon \mathbb{C}\rightarrow\mathbf{Sets}^{\mathbb{C}^{\mathrm{op}}}$ taking $C\in\mathbb{C}$ to the contravariant representable functor $yC = \mathrm{Hom}_\mathbb{C}(-,C)\colon \mathbb{C}^{\mathrm{op}} \rightarrow \mathbf{Sets}$ and taking $f\colon C\rightarrow D$ to the natural transformation $yf = \mathrm{hom}_\mathbb{C}(-,f)\colon \mathrm{Hom}_\mathbb{C}(-,C)\rightarrow\mathrm{Hom}_\mathbb{C}(-,D),$ … One should thus think of the Yoneda embedding $y$ as a “representation” of $\mathbb{C}$ in a category of set-valued functors and natural transformations…. (Category Theory, p. 187)

The zen-like Yoneda

First let’s see the Yoneda lemma through the “zen lens.” (For now ignore the definition above.) Mathematicians like talking of a “Yoneda philosophy,” which is sometimes smartly conveyed in the following Dutch proverb:2

Zeg me wie uw vrienden zijn, dan zeg ik wie u bent.
“Tell me who your friends are, and I will tell you who you are.”

Some people also like citing a particle accelerator analogy, allegedly due to Ravi Vakil:

Theo Johnson-Freyd: You work at a particle accelerator. You want to understand some particle. All you can do are throw other particles at it and see what happens. If you understand how your mystery particle responds to all possible test particles at all possible test energies, then you know everything there is to know about your mystery particle.

In her blog post Tai-Danae Bradley nicely states the above philosophy as “the Yoneda perspective”:

Mathematical objects are completely determined by their relationships to other objects.

Now the gist of the Yoneda philosophy should be clear. It simply says that we can learn everything about an object by studying its interaction with all other objects in its categorical locality. But exactly how? The philosophy is more spiritual than mathematical and has absolutely no resemblance to the formal definition above.

For the remaining part of this article see my next post “Category theory notes 15: Yoneda lemma (Part 2).”

1. This assembly language analogy is inspired by Milewski's statement that “set theory [is] the assembly language of mathematics” (Category Theory for Programmers, p. 153).
2. This particular version of the quote is from Boisseau & Gibbons's 2018 article “What you needa know about Yoneda.”

Tags:

Categories:

Updated:

Subscribe to I-Yuwen

* indicates required