Loading [MathJax]/jax/output/CommonHTML/jax.js

9.5 The Yoneda lemma


Recall that we have a categoryMathworldPlanetmath š’®et whose objects are sets and whose morphismsMathworldPlanetmath are functions. We now show that every precategory has a š’®et-valued hom-functor. First we need to define opposites and productsPlanetmathPlanetmathPlanetmathPlanetmath 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 equivalentMathworldPlanetmathPlanetmathPlanetmathPlanetmathPlanetmath.

  1. 1.

    FunctorsMathworldPlanetmath AƗBā†’C.

  2. 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 componentsPlanetmathPlanetmath 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 operationsMathworldPlanetmath are inversesPlanetmathPlanetmathPlanetmath. āˆŽ

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 isomorphismMathworldPlanetmathPlanetmathPlanetmathPlanetmath

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 embeddingMathworldPlanetmath. 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 adjunctionsPlanetmathPlanetmath 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. 1.

    F is a left adjoint.

  2. 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)

(by the triangle identities). Thus we also have 1ā†’ 2.

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