# The Yoneda Lemma

Update: Some time after I published this post, I came across the following post on another blog that makes for a really nice intuitive introduction to the ideas expressed by the Yoneda lemma:

The Most Obvious Secret in Mathematics at Math3ma

I must admit that my own post might not offer much in the way of intuition (and really could have been written better), so I highly recommend reading the above link in conjunction with this one.

In Algebraic Spaces and Stacks we introduced the notion of a representable functor, and we made use of it to “transfer” the properties of schemes to functors and categories over some fixed category. In this short post we discuss an important related concept, one of the most important concepts in category theory, called the Yoneda lemma.

Let $\mathbf{C}$ be a category, and let $A$ be any object of $\mathbf{C}$. The Yoneda lemma states that the set of natural transformations from the functor $\text{Hom}(-,A)$ to any contravariant functor $G$ from $\mathbf{C}$ to the category of sets is in bijection with the set $G(A)$.

In the case that $G$ is the contravariant functor $\text{Hom}(-,B)$, where $B$ is an element of $\mathbf{C}$, the Yoneda lemma says that the set of natural transformations from $\text{Hom}(-,A)$ to $\text{Hom}(-,B)$ is in bijection with the set $\text{Hom}(A,B)$.

We can treat the functor $\text{Hom}(-,-)$ as a covariant functor from the category $\mathbf{C}$ to the category $\textbf{Sets}^{\mathbf{C}^{\text{op}}}$ of contravariant functors from $\mathbf{C}$ to the category of sets, which sends an object $A$ of $\mathbf{C}$ to the contravariant functor $\text{Hom}(-,A)$, and a morphism $f:A\rightarrow B$ of $\mathbf{C}$ to the natural transformation $\text{Hom}(-,f):\text{Hom}(-,A)\rightarrow\text{Hom}(-,B)$. Then the Yoneda lemma, via the result given in the preceding paragraph, says that the functor $\text{Hom}(-,-): \mathbf{C}\rightarrow\mathbf{Sets}^{\mathbf{C}^{\text{op}}}$ is fully faithful. We also say that this functor is an embedding; in particular, it is called the Yoneda embedding. It embeds the category $\mathbf{C}$ into the category $\mathbf{Sets}^{\mathbf{C}^{\text{op}}}$.

The Yoneda lemma is an important ingredient of the functor of points approach to the theory of schemes. Furthermore, the Yoneda lemma tells us that the category of schemes is embedded as a subcategory of the category of contravariant functors from the category of schemes to the category of sets, so we can also try looking at a bigger subcategory of the latter category, and see if we can come up with interesting objects to study – this actually leads us to the theory of algebraic spaces.

References:

Yoneda Lemma on Wikipedia

Yoneda Lemma on nLab

Representable Functors on Rigorous Trivialities

The Most Obvious Secret in Mathematics at Math3ma

Localization and Gromov-Witten Invariants by Kai Behrend

Categories for the Working Mathematician by Saunders Mac Lane