What does Yoneda’s Lemma mean?
As I promised, today I’ll try to explain what Yoneda’s Lemma really does for us.
First off, let’s think about functions of two variables. To be very explicit, think of the function defined by
. We can turn this into a function of one variable that returns another function. Specifically, if we write
for the set of functions from the natural numbers to themselves, we can write
, where
. That is,
is the function that sends
to
. This method of “Currying” (named for Haskell Curry) a function should be familiar if you’ve worked with functional programming languages like LISP, ML, or Haskell. There’s really a lot to be said about it in general, and I’ll get back to exploring it in more depth another time.
Anyhow, a similar statement goes for functors of more than one variable. Since such functors are “functorial in each variable”, we can stick an object into all but one slot and be left with a functor of the last slot. The thing is, this assignment is itself functorial.
Let’s focus on a functor . Then for any object
we have a functor
. Now when we change the object
by applying a morphism
we get a natural transformation
. It should have components
. The clear choice is
, and indeed this is natural since the morphisms from
commute with those from
.
Now, strictly speaking this may not be a functor since we only know that
is a category when at least one of
and
is small, but the general idea should be clear.
Now to the situation at hand: we know that any category comes equipped with a functor
. We apply this Currying operation on each slot to get two “functors”
and
. Of course, the targets are only sure to be categories when
(and thus
as well) is small, but we’ll gloss over that point. What the Yoneda Lemma says is that these functors are fully faithful!
To see this, notice that sends an object
to the covariant functor
, while
sends an object
to the contravariant functor
. Since the objects of
and
are the same, I hope that using
for both won’t be too confusing.
Now let’s take the statement of the (covariant) Yoneda Lemma and apply it to the functor for some object
. It says that
. But notice that
is
— the set of morphisms from
to
in the functor category
. Now since
is a functor from
to
, it acts on the hom sets, sending
to
. And the Yoneda Lemma tells us that this is a bijection — the functor
is fully faithful!
And the same argument goes through for . Now we apply the contravariant Yoneda Lemma to see that
. The functor
induces a bijection on each hom set, so it’s fully faithful too!
Now remember what the point of fully faithful functors is: they’re all about full subcategories. This means that any (small) category can be seen as a full subcategory of
. And full subcategories are nice because they just restrict the objects we’re interested in without throwing out any morphisms between those objects. So, the objects of any category can be seen as a special kind of contravariant
-valued functor on that category.
And now: which contravariant -valued functors on a category
are so special that they constitute objects of
under this embedding? Well, as usual in category theory we’re interested in things up to isomorphism, so we should ask, “What contravariant set-valued functors are (naturally) isomorphic to one in the image of
?”
These are just the representable functors.
The representable, contravariant, -valued functors on a category
constitute a full subcategory of all contravariant
-valued functors on
, which is equivalent to the category
itself.
And that’s why Yoneda’s Lemma is so amazing.