9.5 The Yoneda lemma

9.5 The Yoneda lemma

Recall that we have a

category

𝒮

⁢

e

⁢

t

whose objects are sets and whose

morphisms

are

functions

.
We now show that every

precategory

has a

𝒮

⁢

e

⁢

t

-valued hom-functor.
First we need to define

opposites

and

products

of (pre)categories.

Definition 9.5.1

.

For a precategory

A

, its

opposite

A

op

is a precategory with the same type of objects, with

hom

A

op

(

a

,

b

)

:

≡

hom

A

(

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

:

≡

A

0

×

B

0

and

hom

A

×

B

(

(

a

,

b

)

,

(

a

′

,

b

′

)

)

:

≡

hom

A

(

a

,

a

′

)

×

hom

B

(

b

,

b

′

)

.

Identities are defined by

1

(

a

,

b

)

:

≡

(

1

a

,

1

b

)

and composition by

(

g

,

g

′

)

(

f

,

f

′

)

:

≡

(

(

g

f

)

,

(

g

′

f

′

)

)

.

Lemma 9.5.3

.

For precategories

A

,

B

,

C

, the following types are

equivalent

.

1.

Functors

A

×

B

→

C

.

2.

Functors

A

→

C

B

.

Proof.

Given

F

:

A

×

B

→

C

, for any

a

:

A

we obviously have a functor

F

a

:

B

→

C

.
This gives a function

A

0

→

(

C

B

)

0

.
Next, for any

f

:

hom

A

⁡

(

a

,

a

′

)

, we have for any

b

:

B

the morphism

F

(

a

,

b

)

,

(

a

′

,

b

)

⁢

(

f

,

1

b

)

:

F

a

⁢

(

b

)

→

F

a

′

⁢

(

b

)

.
These are the

components

of a

natural transformation

F

a

→

F

a

′

.
Functoriality in

a

is easy to check, so we have a functor

F

^

:

A

→

C

B

.

Conversely

, suppose given

G

:

A

→

C

B

.
Then for any

a

:

A

and

b

:

B

we have the object

G

⁢

(

a

)

⁢

(

b

)

:

C

, giving a function

A

0

×

B

0

→

C

0

.
And for

f

:

hom

A

⁡

(

a

,

a

′

)

and

g

:

hom

B

⁡

(

b

,

b

′

)

, we have the morphism

G

⁢

(

a

′

)

b

,

b

′

⁢

(

g

)

∘

G

a

,

a

′

⁢

(

f

)

b

=

G

a

,

a

′

⁢

(

f

)

b

′

∘

G

⁢

(

a

)

b

,

b

′

⁢

(

g

)

in

hom

C

⁡

(

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

hom

A

:

A

op

×

A

→

𝒮

⁢

e

⁢

t

.

It takes a pair

(

a

,

b

)

:

(

A

op

)

0

×

A

0

≡

A

0

×

A

0

to the set

hom

A

⁡

(

a

,

b

)

.
For a morphism

(

f

,

f

′

)

:

hom

A

op

×

A

⁡

(

(

a

,

b

)

,

(

a

′

,

b

′

)

)

, by definition we have

f

:

hom

A

⁡

(

a

′

,

a

)

and

f

′

:

hom

A

⁡

(

b

,

b

′

)

, so we can define

(

hom

A

)

(

a

,

b

)

,

(

a

′

,

b

′

)

⁢

(

f

,

f

′

)

:

≡

(

g

↦

(

f

′

g

f

)

)

:

hom

A

⁡

(

a

,

b

)

→

hom

A

⁡

(

a

′

,

b

′

)

.

Functoriality is easy to check.

By

\autoref

ct:functorexpadj, therefore, we have an induced functor

𝐲

:

A

→

𝒮

⁢

e

⁢

t

A

op

, which we call the

Yoneda embedding

.

Theorem 9.5.4

(The Yoneda lemma).

For any precategory

A

, any

a

:

A

, and any functor

F

:

S

⁢

e

⁢

t

A

op

, we have an

isomorphism

hom

𝒮

⁢

e

⁢

t

A

op

⁡

(

𝐲

⁢

a

,

F

)

≅

F

⁢

a

.

(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

)

→

F

⁢

a

.
Since

𝐲

⁢

a

⁢

(

a

)

≡

hom

A

⁡

(

a

,

a

)

, we have

1

a

:

𝐲

⁢

a

⁢

(

a

)

, so that

α

a

⁢

(

1

a

)

:

F

⁢

a

.
This gives a function

(

α

↦

α

a

⁢

(

1

a

)

)

from left to right in (

9.5.4

).

In the other

direction

, given

x

:

F

⁢

a

, we define

α

:

𝐲

⁢

a

→

F

by

α

a

′

(

f

)

:

≡

F

a

′

,

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

:

F

⁢

a

.
Then with

α

defined as above, we have

α

a

⁢

(

1

a

)

=

F

a

,

a

⁢

(

1

a

)

⁢

(

x

)

=

1

F

⁢

a

⁢

(

x

)

=

x

.
On the other hand, if we suppose given

α

:

𝐲

⁢

a

→

F

and define

x

as above, then for any

f

:

hom

A

⁡

(

a

′

,

a

)

we have

α

a

′

⁢

(

f

)

=

α

a

′

⁢

(

𝐲

⁢

a

a

′

,

a

⁢

(

f

)

)

=

(

α

a

′

∘

𝐲

⁢

a

a

′

,

a

⁢

(

f

)

)

⁢

(

1

a

)

=

(

F

a

′

,

a

⁢

(

f

)

∘

α

a

)

⁢

(

1

a

)

=

F

a

′

,

a

⁢

(

f

)

⁢

(

α

a

⁢

(

1

a

)

)

=

F

a

′

,

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

→

S

⁢

e

⁢

t

A

op

is fully faithful.

Proof.

By

\autoref

ct:yoneda, we have

hom

𝒮

⁢

e

⁢

t

A

op

⁡

(

𝐲

⁢

a

,

𝐲

⁢

b

)

≅

𝐲

⁢

b

⁢

(

a

)

≡

hom

A

⁡

(

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

y

0

:

A

0

→

(

S

⁢

e

⁢

t

A

op

)

0

is an

embedding

.
In particular, if

y

⁢

a

=

y

⁢

b

, then

a

=

b

.

Proof.

By

\autoref

ct:yoneda-embedding,

𝐲

induces an isomorphism on sets of isomorphisms.
But as

A

and

𝒮

⁢

e

⁢

t

A

op

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

:

S

⁢

e

⁢

t

A

op

is said to be

representable

if there exists

a

:

A

and an isomorphism

y

⁢

a

≅

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

\autoref

ct: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

\autoref

ct: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

↦

hom

B

⁡

(

F

⁢

a

,

b

)

)

from

A

op

to

𝒮

⁢

e

⁢

t

is representable.

Proof.

An element of the type

2

consists of a function

G

0

:

B

0

→

A

0

together with, for every

a

:

A

and

b

:

B

an isomorphism

γ

a

,

b

:

hom

B

⁡

(

F

⁢

a

,

b

)

≅

hom

A

⁡

(

a

,

G

0

⁢

b

)

such that

γ

a

,

b

⁢

(

g

∘

F

⁢

f

)

=

γ

a

′

,

b

⁢

(

g

)

∘

f

for

f

:

hom

A

⁡

(

a

,

a

′

)

.

Given this, for

a

:

A

we define

η

a

:

≡

γ

a

,

F

⁢

a

(

1

F

⁢

a

)

, and for

b

:

B

we define

ϵ

b

:

≡

(

γ

G

⁢

b

,

b

)

-

1

(

1

G

⁢

b

)

.
Now for

g

:

hom

B

⁡

(

b

,

b

′

)

we define

G

b

,

b

′

(

g

)

:

≡

γ

G

⁢

b

,

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

G

0

specified, and we can take

γ

a

,

b

to be the composite

hom

B

⁡

(

F

⁢

a

,

b

)

→

G

F

⁢

a

,

b

hom

A

⁡

(

G

⁢

F

⁢

a

,

G

⁢

b

)

→

(

–

∘

η

a

)

hom

A

⁡

(

a

,

G

⁢

b

)

.

This is clearly natural since

η

is, and it has an inverse given by

hom

A

⁡

(

a

,

G

⁢

b

)

→

F

a

,

G

⁢

b

hom

B

⁡

(

F

⁢

a

,

F

⁢

G

⁢

b

)

→

(

ϵ

b

∘

–

)

hom

A

⁡

(

F

⁢

a

,

b

)

(by the triangle identities).
Thus we also have

1

→

2

.

For the composite

2

→

1

→

2

, clearly the function

G

0

is preserved, so it suffices to check that we get back

γ

.
But the new

γ

is defined to take

f

:

hom

B

⁡

(

F

⁢

a

,

b

)

to

G

⁢

(

f

)

∘

η

a

≡

γ

G

⁢

F

⁢

a

,

b

⁢

(

f

∘

ϵ

F

⁢

a

)

∘

η

a

=

γ

G

⁢

F

⁢

a

,

b

⁢

(

f

∘

ϵ

F

⁢

a

∘

F

⁢

η

a

)

=

γ

G

⁢

F

⁢

a

,

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

G

b

,

b

′

:

hom

B

⁡

(

b

,

b

′

)

→

hom

A

⁡

(

G

⁢

b

,

G

⁢

b

′

)

is defined to take

g

to

γ

G

⁢

b

,

b

′

⁢

(

g

∘

ϵ

b

)

≡

G

⁢

(

g

∘

ϵ

b

)

∘

η

G

⁢

b

=

G

⁢

(

g

)

∘

G

⁢

ϵ

b

∘

η

G

⁢

b

=

G

⁢

(

g

)

so it agrees with the old one.
The new

η

a

is defined to be

γ

a

,

F

⁢

a

⁢

(

1

F

⁢

a

)

≡

G

⁢

(

1

F

⁢

a

)

∘

η

a

, so it equals the old

η

a

.
And finally, the new

ϵ

b

is defined to be

(

γ

G

⁢

b

,

b

)

-

1

⁢

(

1

G

⁢

b

)

≡

ϵ

b

∘

F

⁢

(

1

G

⁢

b

)

, which also equals the old

ϵ

b

.
∎

Corollary 9.5.11

.

[

\autoref

ct:adjprop]
If

A

is a category and

F

:

A

→

B

, then the type “

F

is a left adjoint” is a mere proposition.

Proof.

By

\autoref

ct:representable-prop, if

A

is a category then the type in

\autoref

ct:adj-repr

2

is a mere proposition.
∎

Title

9.5 The Yoneda lemma

\metatable

Generated on Thu Feb 8 19:42:47 2018 by

LaTeXML