9.5 The Yoneda lemma
Recall that we have a category š®et whose objects are sets and whose morphisms
are functions.
We now show that every precategory has a š®et-valued hom-functor.
First we need to define opposites and products
of (pre)categories.
Definition 9.5.1.
For a precategory A, its opposite Aop is a precategory with the same type of objects, with homAop(a,b):ā”homA(b,a), and with identities and composition inherited from A.
Definition 9.5.2.
For precategories A and B, their product AĆB is a precategory with (AĆB)0:ā”A0ĆB0 and
homAĆB((a,b),(aā²,bā²)):ā”homA(a,aā²)ĆhomB(b,bā²). |
Identities are defined by 1(a,b):ā”(1a,1b) and composition by (g,gā²)(f,fā²):ā”((gf),(gā²fā²)).
Lemma 9.5.3.
For precategories A,B,C, the following types are equivalent.
-
1.
Functors
AĆBāC.
-
2.
Functors AāCB.
Proof.
Given F:AĆBāC, for any a:A we obviously have a functor Fa:BāC.
This gives a function A0ā(CB)0.
Next, for any f:homA(a,aā²), we have for any b:B the morphism F(a,b),(aā²,b)(f,1b):Fa(b)āFaā²(b).
These are the components of a natural transformation FaāFaā².
Functoriality in a is easy to check, so we have a functor ĖF:AāCB.
Conversely, suppose given G:AāCB. Then for any a:A and b:B we have the object G(a)(b):C, giving a function A0ĆB0āC0. And for f:homA(a,aā²) and g:homB(b,bā²), we have the morphism
G(aā²)b,bā²(g)āGa,aā²(f)b=Ga,aā²(f)bā²āG(a)b,bā²(g) |
in homC(G(a)(b),G(aā²)(bā²)). Functoriality is again easy to check, so we have a functor ĖG:AĆBāC.
Finally, it is also clear that these operations are inverses
.
ā
Now for any precategory A, we have a hom-functor
homA:AopĆAāš®et. |
It takes a pair (a,b):(Aop)0ĆA0ā”A0ĆA0 to the set homA(a,b). For a morphism (f,fā²):homAopĆA((a,b),(aā²,bā²)), by definition we have f:homA(aā²,a) and fā²:homA(b,bā²), so we can define
(homA)(a,b),(aā²,bā²)(f,fā²) | :ā”(gā¦(fā²gf)) | ||
:homA(a,b)āhomA(aā²,bā²). |
Functoriality is easy to check.
By \autorefct:functorexpadj, therefore, we have an induced functor š²:Aāš®etAop, which we call the Yoneda embedding.
Theorem 9.5.4 (The Yoneda lemma).
For any precategory A, any a:A, and any functor F:SetAop, we have an isomorphism
homš®etAop(š²a,F)ā Fa. | (9.5.4) |
Moreover, this is natural in both a and F.
Proof.
Given a natural transformation Ī±:š²aāF, we can consider the component Ī±a:š²a(a)āFa. Since š²a(a)ā”homA(a,a), we have 1a:š²a(a), so that Ī±a(1a):Fa. This gives a function (Ī±ā¦Ī±a(1a)) from left to right in (9.5.4).
In the other direction, given x:Fa, we define Ī±:š²aāF by
Ī±aā²(f):ā”Faā²,a(f)(x). |
Naturality is easy to check, so this gives a function from right to left in (9.5.4).
To show that these are inverses, first suppose given x:Fa. Then with Ī± defined as above, we have Ī±a(1a)=Fa,a(1a)(x)=1Fa(x)=x. On the other hand, if we suppose given Ī±:š²aāF and define x as above, then for any f:homA(aā²,a) we have
Ī±aā²(f) | =Ī±aā²(š²aaā²,a(f)) | ||
=(Ī±aā²āš²aaā²,a(f))(1a) | |||
=(Faā²,a(f)āĪ±a)(1a) | |||
=Faā²,a(f)(Ī±a(1a)) | |||
=Faā²,a(f)(x). |
Thus, both composites are equal to identities. We leave the proof of naturality to the reader. ā
Corollary 9.5.6.
The Yoneda embedding y:AāSetAop is fully faithful.
Proof.
By \autorefct:yoneda, we have
homš®etAop(š²a,š²b)ā š²b(a)ā”homA(a,b). |
It is easy to check that this isomorphism is in fact the action of š² on hom-sets. ā
Corollary 9.5.7.
If A is a category, then y0:A0ā(SetAop)0 is an embedding.
In particular, if ya=yb, then a=b.
Proof.
By \autorefct:yoneda-embedding, š² induces an isomorphism on sets of isomorphisms. But as A and š®etAop are categories and š² is a functor, this is equivalently an isomorphism on identity types, which is the definition of being an embedding. ā
Definition 9.5.8.
A functor F:SetAop is said to be representable if there exists a:A and an isomorphism yaā F.
Theorem 9.5.9.
If A is a category, then the type āF is representableā is a mere proposition.
Proof.
By definition āF is representableā is just the fiber of š²0 over F. Since š²0 is an embedding by \autorefct:yoneda-mono, this fiber is a mere proposition. ā
In particular, in a category, any two representations of the same functor are equal.
We can use this to give a different proof of \autorefct:adjprop.
First we give a characterization of adjunctions in terms of representability.
Lemma 9.5.10.
For any precategories A and B and a functor F:AāB, the following types are equivalent.
-
1.
F is a left adjoint.
-
2.
For each b:B, the functor (aā¦homB(Fa,b)) from Aop to š®et is representable.
Proof.
An element of the type 2 consists of a function G0:B0āA0 together with, for every a:A and b:B an isomorphism
Ī³a,b:homB(Fa,b)ā homA(a,G0b) |
such that Ī³a,b(gāFf)=Ī³aā²,b(g)āf for f:homA(a,aā²).
Given this, for a:A we define Ī·a:ā”Ī³a,Fa(1Fa), and for b:B we define Ļµb:ā”(Ī³Gb,b)-1(1Gb). Now for g:homB(b,bā²) we define
Gb,bā²(g):ā”Ī³Gb,bā²(gāĻµb) |
The verifications that G is a functor and Ī· and Ļµ are natural transformations satisfying the triangle identities are exactly as in the classical case, and as they are all mere propositions we will not care about their values. Thus, we have a function 2ā1.
In the other direction, if F is a left adjoint, we of course have G0 specified, and we can take Ī³a,b to be the composite
homB(Fa,b)GFa,bāhomA(GFa,Gb)(āāĪ·a)āhomA(a,Gb). |
This is clearly natural since Ī· is, and it has an inverse given by
homA(a,Gb)Fa,GbāhomB(Fa,FGb)(Ļµbāā)āhomA(Fa,b) |
For the composite 2ā1ā 2, clearly the function G0 is preserved, so it suffices to check that we get back Ī³. But the new Ī³ is defined to take f:homB(Fa,b) to
G(f)āĪ·a | ā”Ī³GFa,b(fāĻµFa)āĪ·a | ||
=Ī³GFa,b(fāĻµFaāFĪ·a) | |||
=Ī³GFa,b(f) |
so it agrees with the old one.
Finally, for 1ā2ā 1, we certainly get back the functor G on objects. The new Gb,bā²:homB(b,bā²)āhomA(Gb,Gbā²) is defined to take g to
Ī³Gb,bā²(gāĻµb) | ā”G(gāĻµb)āĪ·Gb | ||
=G(g)āGĻµbāĪ·Gb | |||
=G(g) |
so it agrees with the old one. The new Ī·a is defined to be Ī³a,Fa(1Fa)ā”G(1Fa)āĪ·a, so it equals the old Ī·a. And finally, the new Ļµb is defined to be (Ī³Gb,b)-1(1Gb)ā”ĻµbāF(1Gb), which also equals the old Ļµb. ā
Corollary 9.5.11.
[\autorefct:adjprop] If A is a category and F:AāB, then the type āF is a left adjointā is a mere proposition.
Proof.
By \autorefct:representable-prop, if A is a category then the type in \autorefct:adj-repr2 is a mere proposition. ā
Title | 9.5 The Yoneda lemma |
---|---|
\metatable |