The Physics Travel Guide

Yoneda Lemma

Prerequisites: Category Theory.

Best explanations

Why is it interesting?

The Yoneda lemma is "arguably the most important result of category theory" (source).

It is important for physics, because it allows us to make the ideas of relational physics precise.

Intuitive

Informally, [the Yoneda Lemma] implies that you can gain information about an object by viewing it from *all* possible angles. That kinda makes sense, right? To put it another way: a mathematical object is totally determined by its relationships to other objects. It's sort of like the old saying, “Tell me who your friends are, and I’ll tell you who *you* are.”Math3ma

Concrete

[T]he collection of all ways to relate an object to other objects is isomorphic to the object itself.https://news.ycombinator.com/item?id=7715277

[A]n object is completely determined by its relationships to other objects. The Yoneda Lemma

One way to think of the Yoneda lemma is precisely this: that the objects of any category can be interpreted as sets with extra structure. Think about this a minute. We have an abstract category C and we wish to associate to each object of C some set equipped with extra structure. Moreover, we want to do this in a way which completely records everything there is to know about this object. How can we do it?

Well, the only interesting thing about an object in a category is its morphisms to and from other objects, and how these compose with *other* morphisms. This principle should be our guide.

So, what should we do? Simple: associate to the object c the set of all morphisms from c to other objects in C! Let's call this set hom(c,-).

Of course, this is more than a mere set: it's a set with extra structure. First of all, it's a set made of lots of little subsets for each object c' in C, we get a subset hom(c,c'), consisting of all morphisms from c to c'. Second of all, it's a set with an "action of C". In other words, given an element f in hom(c,c'), and a morphism g: c' -> c' ', we get an element fg in hom(c,c' '), just by composing f and g.

A set with all this structure has a name: it's called a "functor from C to Set".

The Yoneda lemma says that this "set with extra structure" knows everything you'd ever want to know about the object c.

Note that I got away with less than you might have thought I'd need! I only considered the morphisms *from* c, not the morphisms *to* c. In fact there is another version of the Yoneda lemma that uses the morphisms *to* c instead. I believe this is the one people usually talk about - but of course it doesn't really matter.

John Baez

Great explanations can be found here:

Abstract

Let C\mathcal{C} be a locally small category, cc an object of C\mathcal{C} and F:C→SetF : \mathcal{C} \to \mathbf{Set} a functor. The Yoneda lemma states that there is a bijection

Nat(HomC(c,−), F)  ≅  F(c),\mathrm{Nat}\big(\mathrm{Hom}_{\mathcal{C}}(c, -),\, F\big) \;\cong\; F(c),

natural in both cc and FF. The map sends a natural transformation α\alpha to the element αc(1c)∈F(c)\alpha_c(1_c) \in F(c). Its inverse sends x∈F(c)x \in F(c) to the transformation whose component at dd is

HomC(c,d)→F(d),f↦F(f)(x).\mathrm{Hom}_{\mathcal{C}}(c, d) \to F(d), \qquad f \mapsto F(f)(x) .

The proof is a single observation: naturality forces αd(f)=αd(f∘1c)=F(f)(αc(1c))\alpha_d(f) = \alpha_d(f \circ 1_c) = F(f)\big(\alpha_c(1_c)\big), so α\alpha is fixed by where it sends 1c1_c. The dual version holds for contravariant functors F:Cop→SetF : \mathcal{C}^{\mathrm{op}} \to \mathbf{Set}, with Nat(HomC(−,c),F)≅F(c)\mathrm{Nat}\big(\mathrm{Hom}_{\mathcal{C}}(-, c), F\big) \cong F(c).

Yoneda embedding. Taking F=HomC(−,c′)F = \mathrm{Hom}_{\mathcal{C}}(-, c') in the dual version gives Nat(Hom(−,c),Hom(−,c′))≅Hom(c,c′)\mathrm{Nat}\big(\mathrm{Hom}(-, c), \mathrm{Hom}(-, c')\big) \cong \mathrm{Hom}(c, c'). So the functor

y:C→[Cop,Set],c↦HomC(−,c)y : \mathcal{C} \to [\mathcal{C}^{\mathrm{op}}, \mathbf{Set}], \qquad c \mapsto \mathrm{Hom}_{\mathcal{C}}(-, c)

is fully faithful. In particular, if Hom(−,c)≅Hom(−,c′)\mathrm{Hom}(-, c) \cong \mathrm{Hom}(-, c') as functors, then c≅c′c \cong c'. This is the precise form of the statement that an object is determined up to isomorphism by the morphisms into it from all other objects.

Representable functors. A functor isomorphic to some Hom(−,c)\mathrm{Hom}(-, c) is called representable, and by the lemma the representing object is unique up to unique isomorphism. Every universal construction (products, limits, free objects, tensor products) is a statement that some functor is representable, which is why objects defined by universal properties are unique up to unique isomorphism.

Example: groups. Regard a group GG as a category with one object ∗\ast. A functor to Set\mathbf{Set} is a GG-set, and Hom(∗,−)\mathrm{Hom}(\ast, -) is GG acting on itself by left multiplication. The lemma says that GG-equivariant maps from GG to a GG-set XX are in bijection with XX, each map being determined by the image of the identity. Applied to X=GX = G, the equivariant maps G→GG \to G are the right multiplications g↦ghg \mapsto g h, so GG (with the order of multiplication reversed) is the automorphism group of its regular action. In particular GG embeds into the permutations of its underlying set, which is Cayley's theorem.

Functor of points. In algebraic geometry and in the theory of supermanifolds, a space XX is described by the functor Hom(−,X)\mathrm{Hom}(-, X) that assigns to each test space TT the set of "TT-points" of XX. By the Yoneda embedding no information is lost, and the functor can be used even when it is not representable by a space in the original category.