The Yoneda lemma, according to Ravil Vakil in Foundations of Algebraic Geometry, is an "important exercise you should do once in your life." In this post, we give a slight variant of the usual proof and explain the idea behind the lemma.
Presheaves
In category theory, a presheaf is a mild generalization of the usual geometric notion of a presheaf. Instead of attaching data to each open set of a topological space, we attach data to each object in a category. More precisely, a presheaf on a category C is a functor F:Cop→Set. Morphisms between presheaves are defined to be natural transformations of these functors. Together, these form the category of presheaves on C, denoted by PSh(C).
Example. For a topological space X, let C=Open(X) be the category of open subsets of X, whose morphisms are inclusions ιV,U:V↪U of open sets. A typical example of a presheaf on this category is the presheaf of continuous real-valued functions, denoted by F=C0(−,R).
This presheaf attaches to each open subset U⊆X a set of sectionsF(U)=C0(U,R), visualized as graphs lying over U. For each inclusion ιV,U, we define a restriction map which takes a section over U and restricts it to V. Specifically, we define
F(ιV,U)=ιV,U∗:F(U)→F(V);f↦f∘ιV,U.
In fact, any presheaf or sheaf on Open(X) can be interpreted as arising from the sheaf of continuous sections to a larger space sitting above X, known as the étale space, Et(F). The étale space comes with a natural projection π:Et(F)→X, and sections over U⊆X are given by continuous maps σ:U→Et(F) such that π∘σ=idU.
In the above example, HomOpen(X)(V,U) has at most one morphism, determining whether or not V is contained in U. Using this as intuition for a general category C, we similarly think of HomC(V,U) as comprising all of the ways in which the structure of V can "fit inside" the structure of U.
Given a presheaf F on C, we think of each section over U as a way of fitting the data of U inside of F, much like in the étale space viewpoint. Then for f∈Hom(V,U), the map F(f):F(U)→F(V) takes each occurrence of U in F and "restricts" it to obtain a suboccurrence of V in F (this is also the intuition suggested in nLab article on presheaves).
In this article, we will call the map F(f) the pullback by f and denote it by f∗ when the presheaf F is understood.
Representable Presheaves
Let F∈PSh(C) be a presheaf and U∈F. Given a section s∈F(U), what is the minimal subpresheaf containing s? To construct this, we intuitively must "throw away" or "cut out" all sections of F which don't fit inside s.
Example. Let X be a topological space and F be a presheaf on X. Given an open set U⊆X and a section s∈F(U) we may construct the subpresheaf FU,s given by
FU,s(V)={{s∣V}∅if V⊆Uif V⊆U.
This subpresheaf consists of all the restrictions of s, and nothing more.
In general, for every f∈Hom(V,U), we must include the pullback f∗s as a section of the minimal subpresheaf. To formalize this notion, consider the functor Hom(−,U), which may be interpreted as the presheaf of morphisms toU. By definition, the sections of this presheaf over an object V∈C are given by Hom(−,U)(V)=Hom(V,U), and the pullback along a morphism f∈Hom(V,W) is given by
f∗=defHom(−,U)(f):Hom(W,U)→Hom(V,U);f∗s=defs∘f.
Given U∈C, let us call a pair (G,s), where G is a presheaf on C and s∈G(U) a presheaf onCwith a distinguished section onU. These form a category PSh∙(C,U) where a morphism between objects (G,s) and (H,t) is defined to be a morphism of presheaves G⇒H which maps s↦t.
Proposition. The presheaf Hom(−,U) with distinguished section idU is an initial object of PSh∙(C,U).
Proof. Let F be a presheaf with a distinguished section s∈F(U). Then there exists a morphism ϕ:Hom(−,U)⇒F given by f↦f∗s=[F(f)](s). In other words, ϕ maps a section f∈Hom(V,U) to the pullback of the distinguished section s, which is a once again section over V (but in F). To check that this defines a morphism of presheaves, consider a morphism g:V→W in C. Then the diagram
commutes, since for all f∈Hom(W,U) we have g∗(f∗s)=(f∘g)∗s=(g∗f)∗s. Moreover, the identity idU is mapped to the distinguished section s, since idU∗s=s. Hence, ϕ defines a morphism (Hom(−,U),idU)→(F,s).
Conversely, to show uniqueness, suppose that ψ:(Hom(−,U),idU)→(F,s) is a morphism of presheaves with distinguished sections on U. Then ψV(f) is automatically determined for all sections f∈Hom(V,U), since
ψV(f)=ψV(f∗idU)=f∗(ψU(idU))=f∗s.
■
We call the initial object Hom(−,U) of PSh∙(C,U) the presheaf represented byU and denote it by HU. In a sense, this is the "least specific" presheaf on C which contains a section over U. The map taking an object to the presheaf it represents is known as the Yoneda embedding, which we denote by よ.
Proposition. The Yoneda embedding defines a functor as follows: given f∈HomC(V,U) define よ(f) to be the underlying map of the unique map (HV,idV)→(HU,f) in PSh∙(C,V).
Proof. Let W→gV→fU be a sequence of morphisms. Then
idW⟼よ(g)W(g=g∗idV)⟼よ(f)V(g∗f=f∘g).
By uniqueness of maps from initial objects, it follows that よ(f∘g)=よ(f)∘よ(g).
■
Explicitly, よ(f) is the pushforward along f, taking s∈Hom(W,V) and mapping it to f∗s=f∘s∈Hom(W,U). Indeed, the pushforward commutes with pullbacks, making it into a morphism of presheaves mapping the identity section over V to f; by definition, this must be the Yoneda embedding.
The Yoneda Lemma
We now state and prove the Yoneda lemma.
Theorem (Yoneda lemma). Let C be a category. If F is a presheaf on C and U∈C, then there is an isomorphism of sets
evU,F:HomPSh(C)(HU,F)≅F(U);ϕ⟼ϕU(idU).
Moreover, this a natural isomorphism of bifunctors Cop×PSh(C)→Set.
Proof. For any section s∈F(U), there exists a unique morphism ϕ:HU→F such that ϕU(idU)=s, since (HU,idU) is initial in PSh∙(C,U). It follows that the evaluation map evU,F is a bijection.
For fixed F, the map U↦F(U) is functorial by the definition of a presheaf. Likewise, for fixed U, the map F↦F(U) is functorial by the definition of the presheaf category. Thus, (U,F)↦F(U) defines a bifunctorBpairing.
On the other hand, the Yoneda embedding U↦HU is a functor, and HomPsh(C)(−,−) is a bifunctor, which implies that (U,F)↦HomPSh(C)(HU,F) also defines a bifunctor Byoneda.
It remains to show that the two bifunctors are naturally isomorphic. For this, it suffices to check that they are natural on each factor. So, let f∈Hom(V,U). Then for all presheaf morphisms ϕ∈HomPSh(C)(HU,F), we have
Therefore, the bifunctor isomorphism is natural in the first factor. For the second factor, consider a presheaf morphism ψ:F⇒G. Then for all presheaf morphisms ϕ∈HomPSh(C)(HU,F), we have
Therefore, the bifunctor isomorphism is also natural in the second factor. It follows that the evaluation bifunctor ev is natural, which concludes the argument.
■
The Yoneda Embedding
The Yoneda lemma implies that there is an isomorphism
evU,V:HomPSh(C)(HU,HV)⟶≅Hom(U,V)
which implies that the Yoneda embedding functor is fully faithful. In particular, an isomorphism of representable presheaves in PSh(C) must be induced by an isomorphism of their representing objects in C. This can expressed as the following principle, whose importance cannot be understated:
To understand an object X in a category C, it suffices to understand how X relates to every other object in C.