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:
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 be a category, and let be any object of . The Yoneda lemma states that the set of natural transformations from the functor to any contravariant functor from to the category of sets is in bijection with the set .
In the case that is the contravariant functor , where is an element of , the Yoneda lemma says that the set of natural transformations from to is in bijection with the set .
We can treat the functor as a covariant functor from the category to the category of contravariant functors from to the category of sets, which sends an object of to the contravariant functor , and a morphism of to the natural transformation . Then the Yoneda lemma, via the result given in the preceding paragraph, says that the functor is fully faithful. We also say that this functor is an embedding; in particular, it is called the Yoneda embedding. It embeds the category into the category .
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.
Categories for the Working Mathematician by Saunders Mac Lane