Professional Documents
Culture Documents
Contents
1 Categories, Functors and Natural Transformations 2
1.1 Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Functors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Natural Transformations . . . . . . . . . . . . . . . . . . . . . . . 7
1.4 Functor Categories . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2 Constructions on Categories 9
2.1 Opposite Category and Contravariance . . . . . . . . . . . . . . . 9
2.2 Product of Categories . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3 Natural Transformations between Bifunctors . . . . . . . . . . . 12
2.4 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1
5 Ends 33
5.1 Dinaturality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.2 Special Cases of Dinatural Transformations . . . . . . . . . . . . 36
5.3 Definition of End . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.4 Ends in Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.5 Ends with Parameters . . . . . . . . . . . . . . . . . . . . . . . . 41
7 Coends 44
7.1 Definition of Coend . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.2 Density Formula . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
7.3 Recasting the Density Formula . . . . . . . . . . . . . . . . . . . 46
9 Adjunctions 62
9.1 Definition of Adjunctions . . . . . . . . . . . . . . . . . . . . . . 62
9.2 The Naturality Laws for Adjunctions . . . . . . . . . . . . . . . . 63
9.3 The Triangle Identities . . . . . . . . . . . . . . . . . . . . . . . . 64
9.4 Limits and Adjunctions . . . . . . . . . . . . . . . . . . . . . . . 66
9.5 Representation Functors . . . . . . . . . . . . . . . . . . . . . . . 66
9.6 Cartesian-closed Categories . . . . . . . . . . . . . . . . . . . . . 67
9.7 Presheaf Categories . . . . . . . . . . . . . . . . . . . . . . . . . . 68
10 Presheaf Categories 70
2
a collection of objects ob(C),
for each pair of objects X, Y a collection C(X, Y ) of arrows/maps/morphisms,
for each triple of objects X, Y, Z a composition mapping XY Z : C(Y, Z)
C(X, Y ) C(X, Z) and
for each object X an identity idX in C(X, X);
satisfying the axioms
f g
X /Y /3 Z .
gf
Definition 1.4 (Small Category) A locally small category is small iff the
collection of objects is a set.
Simple examples of small categories are 0 and 1, the empty category and
the singleton category respectively. Another example of small category is given
by any partial order where the objects are the elements and the arrows are given
by pairs of the partial-order relation; the identities correspond to reflexivity and
composition to transitivity.
3
Exercise 1.5 Show that any set can be interpreted as a small category. In
general categories of this kind are called discrete categories, but not all discrete
categories are small.
Proposition 1.8 Given one arrow of an iso pair, the other arrow is uniquely
determined.
Proof: Assume (f, g) and (f, g ) are iso pairs, where f : X Y , then (g
f ) g = idX g = g and g (f g) = g idY = g . From associativity of the
composition (g f ) g = g (f g) and then g = g .
Notation 1.9 This proposition allows us to denote an iso pair by just one of
the arrows. If f : X Y is an arrow of an iso pair, we say that f is an
f
Y or f : X
isomorphism (or f is an iso), and we write X = =Y.
Exercise 1.11 Show that the composition of monos gives a mono. Show that
if the composition g f is mono then f is mono. What are the monos in Set?
Definition 1.12 (Epi) The arrow f : X Y in the category C is epi iff for
any pair of arrows g, h Z and for all g, h C(Y, Z)
g
f /
X /Y /Z
h
Exercise 1.13 Show that the composition of epis gives an epi. Show that if
the composition g f is epi then g is epi. What are the epis in Set?
4
1.2 Functors
Definition 1.14 (Functor) Let A and B be categories. A functor F : A B
consists of
a mapping F0 : ob(A) ob(B) and
for each pair X, Y A a mapping FXY : A(X, Y ) B F0 (X), F0 (Y ) ;
satisfying the axioms
Definition 1.16 (Full Functor) A functor F : A B is full iff for each pair
X, Y A the mapping F : A(X, Y ) B(F X, F Y ) is surjective.
Proposition 1.18 Functors preserve iso: if (f, g) is an iso pair in the category
A, and F : A B is a functor, then (F f, F g) is an iso pair in B.
f Ff
/ /
Proof: Let X o Y be iso in A. We are to show that F X o F Y is iso
g Fg
in B. This follows from
(F f ) (F g) = F (f g)
= F idY as (f, g) is an iso pair,
= idF Y .
5
Proof: Assume F X
= F Y . Then there exists a pair of arrows f, g
f
/
FX o FY
g
F (f g ) = F f F g
=f g
= idF Y
= F (idY ).
Exercise 1.22 Why is a full and faithful functor not necessarily an isomor-
phism?
6
for each pair of composable arrows f : A B and g : B C in A, we
have the composition g f : A C in A.
Clearly, the definition above ensures that a subcategory is itself category. The
mapping which sends objects and arrows in A to themselves in B defines the
inclusion functor. This functor is faithful and if it is full we say that A is a full
subcategory of B.
Fh Gh
FY Y
/ GY
G
A /B
C
H
Exercise 1.27 Check that the componentwise composition of two natural trans-
formations is a natural transformation.
7
This composition is often called vertical composition to distinguish it from
the horizontal composition of natural transformations see exercise 1.29 below.
Given the functors F : A B and K : C D and a natural transformation
:GH
G
F K
A /B
>C
/D
H
F H
$ %
A :B 9C,
G K
Definition 1.30 (Functor Category) Given the categories A and B, the func-
tor category [A, B] is the category where the objects are the functors from A to
B and the arrows are the natural transformations between them.
As natural transformations are arrows in a functor category we can spe-
cialised the notions of iso, mono and epi to them. For example, a natural
transformation : F G is an iso, called natural isomorphism, if there is a
natural transformation : G F such that = idF and = idG .
8
Exercise 1.32 Prove the proposition above.
Exercise 1.34 The category [A, B] need not be locally small even though A
and B are locally small. However, when A is small [A, B] is locally small why?
2 Constructions on Categories
2.1 Opposite Category and Contravariance
Definition 2.1 (Opposite Category) Let C be a category, we define the op-
posite category C op as:
ob(C op ) = ob(C), and
f g f g
C op : X /Y /4 Z C : X ko Yo Z .
gf f g
9
Exercise 2.2 Show the opposite construction gives rise to a functor ()op :
CAT CAT acting on objects and arrows
C C op
F F op
D Dop .
10
3. F (f, g) = F (C , g) F (f, D) = F (f, D ) F (C, g), i.e., the diagram
F (f,D)
F (C, D) / F (C , D)
MMM
MMFM(f,g)
F (C,g) MMM F (C ,g)
M&
F (C, D )
/ F (C , D )
F (f,D )
Proof:
Only-if : if F is a functor then F (C, ) and F (, D) are functors, and F must
satisfy 3 since (f, g) = (f, idD ) (idC , g) = (idC , g) (f, idD ).
If : we need to prove F satisfies the functor laws. It is easy to show F (id(C,D) ) =
idF (C,D) by using the fact that F (C, ) is a functor (or equivalently that F (, D)
f f
is a functor). It remains to prove F preserves composition; assume C / C / C
g g
and D / D / D , then
F (f , g ) (f, g) = F (f f, g g) by comp. in C D,
= F (C , g g) F (f f, D) by 3,
= F (C , g ) F (C , g) F (f , D) F (f, D) by 1 and 2,
= F (C , g ) F (C , g) F (f , D) F (f, D) by associativity,
= F (C , g ) F (f , D ) F (C , g) F (f, D) by 3,
= F (f , g ) F (f, g) by associativity and twice 3.
The next example considers a mapping satisfying conditions 1 and 2 but not
3.
f g
A : Z B : Z .
id id
11
in B and acts on arrows as follows
F (f, f ) = g
F (id, f ) = id = F (, f )
F (id, id) = id = F (, id) = F (id, )
F (f, id) = id = F (f, ).
One can check F (, ) and F (, ) are functors from A to B, but F does not
satisfy condition 3 of Proposition 2.4
F (f, f ) = g
F (id, f ) F (f, id) = id id = id .
Hence,
F (id, f ) (f, id) = F (f, f ) = g 6= F (id, f ) F (f, id) .
Therefore, F is not a functor.
12
2. ,D = hC,D iCC is a natural transformation from F (, D) to G(, D)
for any D D.
Proof:
Only-if : left as exercise.
If : It follows from exhibing the arrow
(f,g)
(C, D) / (C , D )
as the composition
(C, D)
(f,idD )
/ (C , D) (idC ,g)/ (C , D ) .
(,D )C =C,D
(C, D) F (C, D) / G(C, D)
From 2 we have the commutativity of the upper square and from 1 of the lower
square. Hence the outermost square commutes
C ,D F (f, g) = (C , )D F (idC , g) (f, idD )
= (C , )D F (idC , g) F (f, idD ) as F is functor,
= G(idC , g) G(f, idD ) (,D )C by commutativity of the squares,
= G (idC , g) (f, idD ) (,D )C as G is functor,
= G(f, g) C,D .
Exercise 2.7 Prove the Only-if part in the proof of Proposition 2.6.
13
in X, as X ranges over A, if this assignment yields a functor from A to C. For
example, for a category C, the hom-set expression C(X, Y ) is functorial in X
ranging over C op and Y over C.
Traditionally, arguments in expressions are denoted by place-holders like for
example C(, +). This notation might lead to some confusion specially in dis-
tinguishing the scope where each argument is defined. To save this potential
source of confution we sometimes use -notation to indicate arguments in ex-
pressions. Thus, assuming E(X) is functorial in X of type A then the expression
X. E(X) denotes a functor from A to C.
We say that the expressions E1 (X) and E2 (X) both functorial in X are
naturally isomorphic in X or equivantly that there is an isomorphism natural in
X, iff there is a natural isomorphism between X. E1 (X) and X. E2 (X).
2.4 Examples
Evaluation Functor: Define the evaluation functor eval : [C, D] C D for
categories C and D as follows
(F, C) / F (C)
(,g)
/ F (g)C =C F (g)
(F , C ) / F (C )
14
3. finally we want
eval (, g) = F g C = C F g
C(f,g)=gf
C(C, D) / C(C , D )
h / f h g
where C(f, g) is a function mapping any arrow C D to the arrow C /C /D / D .
Informally, to obtain an arrow from C to D out of an arrow from C to D, we
need both a way to go from D to D and a way to go from C to C.
Exercise 2.10 Check that the definition of the hom-functor above is actually
a bifunctor.
From Proposition 2.4 we have a functor C(, D) : C op Set which acts on
objects and arrows
C C(C, D)
O
f C(,D)=f
C C(C , D) .
Notice that the arrow f drawn above is in the category C not C op ; that explains
why the direction of the arrow is reversed after applying C(, D). In the same
manner we can define a functor C(C, ) : C Set.
C Y C = C(, C)
g Y g=hgiEC
D Y D = C(, D).
15
Exercise 2.11 Check that Y defines a functor from C to [C op , Set].
Dually, we define the contravariant version of the Yoneda functor Y o : C op
[C, Set] which acts on objects and arrows
C Y o C = C(C, )
O
g Y o g=hgiEC
D Y o D = C(D, ) .
C Y (C) = Y
f Y (f )=idY
C Y (C ) = Y
x
eD = F ()(x) . (1)
g F (g)
eE
x
C(E, C) / F (E)
16
Theorem 3.3 (Yoneda Lemma) The mapping C,F which takes in [C op , Set](Y C, F )
to C (idC ) F (C) is an isomorphism
C,F
[C op , Set](Y C, F )
= F (C)
Remark 3.4 Notice that the naturality condition in the statement of the Yoneda
lemma uses expressions which are functorial in their arguments. The right
hand side corresponds to the application of the evaluation functor eval : C op
[C op , Set] Set. The right hand side is a more complex expression that involves
composition of functors:
Y op id [C op ,Set](,+)
C op [C op , Set] / [C op , Set]op [C op , Set] / Set.
Proof: We show that (e) defined by (1) is the inverse of C,F . From Proposi-
^
tion 3.2 we already have that C,F () = ^
C (idC ) = . Let x be an element in
F (C)
C,F (e
x) = x
eC (idC ) by definition of C,F ,
= F (idC )(x) by definition of (e),
= idF (C) (x) as F is a functor,
=x.
17
commutes. Given [C op , Set](Y D, F ), we have
C,F ( (Y f )) = ( (Yf ))C (idC ) by definition of C,F ,
= (C (Yf )C )(idC ) as composition is componentwise,
= (C (f ))(idC ) by definition of Y,
= C (f )
= F (f )(D (idD ))
which gives the commutativity of the diagram above.
C
C,G
G [C op , Set](Y C, G) / G(C) .
The Yoneda lemma is stated for an arbitrary set-valued functor F . A special
case arises when F is itself a hom-functor, say C(, D). In this setting the
Yoneda lemma tells us that there is an isomorphism between the morphisms in
C(C, D) and the natural transformations in [C op , Set](YC, YD). As one might
expect this isomorphism coincides with the Yoneda functor on arrows.
Exercise 3.7 State the Yoneda Lemma for the Yoneda contravariant functor
case.
18
3.2 Representability
Definition 3.8 (Representation) A representation for a functor F : C op
Set consists of an object C C and a natural isomorphism
Y C = C(, C)
=F .
We then say that F is representable.
19
Proof: By currying F we have the functor X. Y. F (X, Y ) : A [B op , Set]
see Exercise 2.9. Then, given f : A A we can construct the commuting
square
= A
Y(B(A)) / F (A, )
( A )1 F (f,) A F (f,)=hF (f,B)iBB
= A
Y(B(A )) / F (A , ) .
Since Y is full and faithful, there must exist a unique arrow, say B(f ), from
B(A) to B(A ) in B such that Y(B(f )) = (A )1 F (f, ) A . We need to
check that this extension to B() indeed satisfies the definition of functor:
f f
Given the arrows A / A / A in A, we have
Y B(f f ) = (A )1 F (f f, ) A
= (A )1 F (f , ) F (f, ) A as X. Y. F (X, Y ) is a functor,
A 1 A A 1 A
= ( ) F (f , ) ( ) F (f, )
= Y(B(f )) Y(B(f ))
= Y B(f ) B(f ) as Y is a functor;
Y(B(idA )) = (A )1 F (idA , ) A
= (A )1 idF (A,) A as X. Y. F (X, Y ) is a functor,
= idY(B(A))
= Y(idB(A) ) as Y is a functor;
The composition of the functor B() and Y gives rise to a functor which is
isomorphic to the curried version of F where the natural isomorphism is given
by = hA iAA
X. Y. F (X,Y )
A; KS / [B op , Set]
;; 9 =
=
;; zzz
;; zz
B() ;; YB() zzz
;; z Y
zz
op z
B .
20
Exercise 3.14 State the dual version of parametrised representability theorem,
i.e., where representables are of the form Y o (B(A)).
Exercise 3.15 Let n and let P rod : Set Set be the functor which
sends the set X to X n and acts on arrows accordingly, i.e., it sends f : X Y
to f n : X n Y n . In this setting, f n (x1 , . . . , xn ) = (f x1 , . . . , f xn ). Suppose
: P rod P rod is a natural isomorphism. Show that there is a permutation
on the sequence 1, . . . , n such that
Hint: Use the contravariant Yoneda embedding Y o : Setop [Set, Set] noting
that X n
= Set(~n, X), where ~n = {1, . . . , n}.
Notice that the functor [I, C](, F ) : C op Set in the definition above is
obtained as the composition
[I,C](,F )
C op / [I, C]op / Set.
X
Take X C in the definition above, then we have C(X, limI F )
= [I, C](X, F ),
i.e., an arrow f : X limI F is mapped to a natural transformation X (f ) =
: X F . Given an arrow u : I J in I we have the associated naturality
square in C
I
I X(I) = X / F (I)
21
This diagram can be drawn as
I I hhhh4 F (I)
hhhhh
hh
u X VVVVV J F (u)
VVVV
V*
J F (J);
from the commutativity of (2) we have that this triangle commutes, i.e., J =
F (u) I . A natural transformation of this kind is called a cone.
f (L (idL ))I
X /L / F (I) .
22
L C to F such that for any other cone = hI : X F (I)iII there exists a
unique arrow f : X L such that for every I I the diagram
I
X / F (I)
z=
f
I zzz
zzz
z
L
Exercise 4.7 Prove the proposition above (use the concrete understanding of
limiting cone).
23
4.2 Examples of Limits
Definition 4.8 (Terminal Object) An object 1C in a category C is called a
terminal object (final, one) iff there is exactly one arrow from every A C to
1C .
A limit for a diagram F : I C where I is the empty category is a terminal
object in C. Notice that this limit might not exist. Any A C is the vertex for
an empty cone to F , then there must be a unique arrow from A to limI F = 1C .
Exercise 4.9 What is the terminal object in Set?
C
f g
hf,gi
1 2
Ao AB /B
fI
X / F (I)
tt9
t
hfI iII tt
ttt I
Q t
II F (I)
24
1. f g = g f , i.e., the diagram
f
P /B
g g
f
A /C
commutes, and
2. for any X C together with arrows h : X A and i : X B for which
f h = g i, i.e., the diagram
X
i
"
h
B
g
f
A /C
X@
@ i
@
k @ "
h
P
/B
f
g g
f
A /C
commute.
$
/z .
f
/
Definition 4.14 (Equaliser) An equaliser of a pair of parallel arrows A /B
g
in a category C is an arrow m : E A such that f m = g m and with the
25
universal property that for any arrow h : X A such that f h = g h there is
a unique arrow k : X E making m k = h, i.e., the triangle in the diagram
f
m / /
EO >A /B
~~ g
k
~~
~~~ h
X
commutes.
and the limiting cone = hI iII by letting I be the projection on the Ith
component. Clearly, any other cone = hI : X F (I)iII factors uniquely
through our choice of limit in Set by the mapping z X 7 hI (z)iII .
26
Pullbacks in Set: Let us assume F is a diagram in Set whose limit gives a
pullback for the arrows
A
f
g
B /C
(the identities arrows are not drawn). From the definition of limits in Set, the
pullback P is
Exercise 4.18 The set [I, C]( X, F ) is itself (isomorphic to) a limit, of which
diagram?
F (I)
o oo7 O
I ooo
I
ooooo
ooo Q
X =h i / II F (I)
I II
F (u)
F (I) h/4 F (J)
h h hhhhh O
J hhhhh
hhhh u
hhh h
Q hhh hJ iu:IJarr(I) Q
F (I) / u:IJarr(I) F (J)
II
commutes; and
27
2. hF (u) I iu:IJarr(I) such that for an arbitrary u : I J the diagram
F (u)
F (I) / F (J)
t: O
I ttt
tt u
tt
Q t hF (u)I iu:IJarr(I) Q
II F (I)
/ u:IJarr(I) F (J)
commutes.
Theorem 4.19 A category C has all small limits iff C has all products and
equalisers.
Proof:
Only-if : Obvious since products and equalisers are limits.
If : Given a diagram F : I C, a cone from X to F equalises the mediating
arrows hJ iu:IJarr(I) and hF (u) I iu:IJarr(I) . On the other hand, any
arrow equalising these arrows determines a cone on F . So a limit of F is an
equaliser for hJ iu:IJarr(I) and hF (u) I iu:IJarr(I) .
F (I) VVV I
VVVV
VVVV
*
F (u)
J hhh4 X
hhhhhhh
F (J)
commutes.
28
from F to some C D such that given any other cone = hI : F (I) CiII
there exists a unique arrow g : C X such that for every I I the diagram
I
F (I) /X
z=
I z
z g
z
C
commutes.
Proof: Left as exercise.
Exercise 4.22 Prove the proposition above by using the dual of Theorem 3.12.
All the remarks we made for limits are applied to colimits in the dual version.
29
Definition 4.26 Assume I is a discrete category. Given aP diagram F : I D a
colimit for F isP
called a coproduct and consists of an object II F (I) and a cone
hI : F (I) II F (I)iII such that for any other cone hfI : F (I) XiII
there exists a unique arrow [fI ]II such that for each I I the diagram
I P
F (I) II F (I)
/
KKK
KKfKI
KKK [fI ]II
KK%
X
commutes.
PO o BO
f
g g
f
Ao C
commutes, and
2. for any object X together with arrows h : A X and i : B X for
which h f = i g, i.e., the diagram
XS k
i
h
BO
g
f
Ao C
XS `@k
@ i
@k
@
PO o BO
h f
g
g
f
Ao C
commute.
30
Exercise 4.28 Let I be a category defined by the graph
$
O
$ z
o .
Show that colimit for a diagram F : I D is a pushout in D.
f
/
Definition 4.29 (Coequaliser) A coequaliser of a pair of parallel arrows A /B
g
in a category D is an arrow m : B E such that m f = m g with the uni-
versal property that for any arrow h : B X such that h f = h g there is a
unique arrow k : E X making k m = h, i.e., the triangle in the diagram
f
/ m
A / B CC /E
g CC
CC k
h CC
!
X .
commutes.
commutes, where hI iII is a colimiting cone. Then for any x F (I) we have
I (x) = (j F (u))(x). U
We define our choice of colimits in Set to be limI F = II F (I)/ , where
the relation represents the constraints imposed by Uthe arrows Uin I. We define
the relation as the least equivalence relation on II F (I) II F (I) such
that
(I, x) (J, y) u : I J arr(I) (F (u))x = y . (3)
U
For (I, x) II F (I) we let [(I, x)] denote the equivalence class of con-
taining (I, x). The colimiting cone is given by the collection of injection arrows
I : x 7 [(I, x)] .
31
Exercise 4.31 Show this choice indeed gives a colimit in Set.
(A )X
C X, lim F (, A) = [I, C] X, F (, A) (4)
I
natural in A A and X C.
Proof: This proposition is just a corollary of Theorem ?? (Parametrised Repre-
sentability) applied to the functor A, X. [I, C](X, F (, A)) : A C op Set.
Given the functor F : I A C in the proposition, an arrow g : A B in
A has associated the naturality square
A
=X
A C X, limI F (, A) / [I, C] X, F (, A)
g lim F (,g) F (,g)
I
B
=X
B C X, limI F (, B) / [I, C] X, F (, B)
32
An important special case of Proposition 4.33 arises by taking A = [I, C] and
F to be the evaluation functor eval : I [I, C] C where C has all limits for
I-indexed diagrams. Hence, from the definition of the evaluation functor, for
every G [I, C] there is a representation
C , lim eval (, G) = [I, C] , eval (, G) .
I
natural in X C and F [I, C]. From the observation above, given a natural
transformation : F G the arrow limI is just the mediating arrow associ-
ated with the cone resulting from the composition of the limiting cone for limI F
with .
Remark 4.35 The definition of the limit functor is given w.r.t. a particular
choice of representation for each diagram F [I, C]; or equivalently w.r.t. a par-
ticular choice of limiting cone for each diagram. The limit functors asscociated
with different choices of representation are, however, all isomorphic.
Remark 4.36 In general there are categories where limits for some diagrams
are missing. We can still define the limit functor, however, by restricting to
the subcategory of diagrams for which all limits exists. Given a category A for
which not necessarily all limits of type I exist, we define the full subcategory
Diag[I, A] [I, A] of diagrams with limits in A and restrict the limit functor
to range over such diagrams. Notice that if A is not the empty category then
Diag[I, A] contains at least the constant diagrams since their limits always exist
in A.
Exercise 4.37 State the dual of the Proposition 4.33 for colimits and conclude
that if C has all limits for I-indexed diagrams there is a colimit functor limI :
[I, C] C.
Exercise 4.38 Check that the definition of limI satisfies the axioms in the
definition of functor. In principle that is not necessary since parametrised rep-
resentability ensures that the extension of the mapping F 7 limI F is a functor!
5 Ends
5.1 Dinaturality
We have considered bifunctors and natural transformations between them in
2.2. We now study special kinds of bifunctors of mixed-variance, e.g. with
33
domain C op C, and dinatural transformations between them. A main moti-
vation for dinatural transformations is to present ends and dually coends as
representations for suitable functors.
commutes.
Recall that F (idU , f ) = F (U, f ) where F (U, ) : C Set is the functor
obtained by fixing the object U in the first argument of F (see 2.2). Henceforth
we use the more compact F (U, f ) instead of F (idU , f ). Similarly, we use F (f, V )
instead of F (f, idV ).
Every ordinary natural transformation gives rise to a dinatural transforma-
tion: Let
F
'
C op C 7E
G
where
(1) is the naturality square associated with (idU , f ) : (U, V ) (U, U ),
34
(2) is the naturality square associated with (f, idV ) : (U, V ) (V, V ), and
(3) commutes since G is a bifunctor and then G(f, f ) = G(V, f ) G(f, V ) =
G(f, U ) G(U, f ) (see 2.2).
Therefore,
G(f, U ) U,U F (U, f ) = G(f, U ) G(U, f ) U,V (1) commutes,
= G(V, f ) G(f, V ) U,V (3) commutes,
= G(V, f ) V,V F (f, V ) (2) commutes.
Thus hU,U iUC is a dinatural transformation.
In general dinatural transformations do not compose. But dinatural trans-
formations obtained from natural transformations compose with arbitrary di-
natural transformations.
35
5.2 Special Cases of Dinatural Transformations
In the next examples we consider functors F, G : C op C D and dinatural
transformations from F to G.
G(U, U )
U
jjjjjj5 LLL
LLG(f,U)
jjj LLL
jjjjj LL
jj %
jjj
X TTTT G(V, U )
TTTT 9
TTTT rrrrr
V
TTTT rr
TT) rrr G(V,f )
G(V, V ).
36
dinatural transformation from {} to C(, +). For any f : V U in C we
construct the diagram
C(U, U )
nn6 KKK
U
nnn KKf
nn KKK
nnnn KK%
nnn
{} PP C(V, U )
PPP
PPP ssss9
PP
V PPP sss
P( sss f
C(V, V ) .
Set(C, A) C
ll6 RRR
lll
Set(C,A)f RRRev C
l ll RRR
ll RRR
lll RRR
R)
Set(C, A) D ll5 A
RRR ll
RRR lll
RRR
R lllll
f D RRR l D
( lll ev
Set(D, A) D .
ev D (f D)
(k, x) / (k f )(x) = k(f (x)) .
Therefore hev B iBSet is a dinatural transformation from Set(, A) + to
A.
37
Suppose F, G : C op C D are both dummy in the first argument and
: F G
is a dinatural transformation. Then for any f : V U in C the
diagram
U
F (U, U ) = F0 (U ) / G(U, U ) = G0 (U )
kk5 SSS
kkk SS
F (U,f )=F0 (f ) G(f,U)=GS
0S(U)
kk SSS
kkk )
F (U, V ) = F0 (V ) G(V, U ) = G0 (U )
SSS kk5
SS kkk
F (f,V )=FS(V )
0S G(V,f )=G0 (f )
SSS kk
) kkk
F (V, V ) = F0 (V ) V
/ G(V, V ) = G0 (V )
V
F0 (V ) / G0 (V )
commutes. The case where F is dummy in its first argument and G is dummy
in its second argument is similar.
D(, end F )
= Dinat , F .
38
The set Dinat X, F for X D is the set of wedges from X to F . We can
recover a more concrete characterisation
of ends as we have done with limits.
Given a wedge Dinat X, F by Theorem 3.12 there exists a unique
arrow h : X end F such that
= Dinat h, F end F (idend F )
= end F (idend F ) h
= h end F (idend F ) I hiII .
In other words, the universal or ending wedge end F (idend F ) is uniquely ex-
tended by the arrow h resulting in the wedge . Given f : V U the situation
is illustrated in the following commutative diagram where = end F (idend F )
2 F (U, U )
U 9 LLL
t tt LLFL(f,U)
t
tttU LLL
ttt L%
h
D _ _ _ _ _ _/ end FJ F (V, U )
JJ
JJV r rr9
JJ
JJ rrr
V J% rrrrF (V,f )
,
F (V, V ).
X
D(X, lim F0 )
= [I, D](I X, F0 ) = Dinat Iop I X, F
I
natural in X, i.e., (limI F0 , ) is a representation for Dinat Iop I , F and
R
consequently limI F0 = I F (I, I).
R
Notation 5.6 This justifies writing I F0 (I) for limI F0 .
39
Ends are Limits: Let F : Iop I D be a functor with end the representation
R
D(, I F (I, I))
= Dinat , F . We construct a category I and a functor
R
d : I Iop I such that I F (I, I) = limI (F d ). The category I is built
from the objects and arrows in the category I as follows:
ob(I ) = ob(I) arr(I); and
arr(I ) is the collection of identities and for every f : V U in I the
arrows
U UUUUU
UUUU
UU*
iiiii4 f
iii
iii
V.
R
D(, I F (I, I)) = Dinat Iop I , F = [I , D](I , F d ) .
R
Therefore I F (I, I) is a limit for F d .
Exercise 5.7 Show that [I , D](I , F d ) = Dinat Iop I , F .
As a consequence of these two results we can deduce that if D has all limits
then D has all ends; we also have a choice for ends in Set given by the choice
for limits and a parametricity result.
40
5.5 Ends with Parameters
R Let F : I I B D be a functor
op
Proposition 5.8 (Parametrise Ends)
such that for every B B the end I F (I, I, B)R of the functor F (, +, B) :
Iop I D exists in D. Then the function B 7 I F (I, I, B) extends uniquely
to a functor from B to D such that
R
D D, I F (I, I, B) = Dinat D, F (, +, B)
natural in D D and B B.
Exercise 5.9 Define the end functor end : [Iop I, C] C where C has all
ends of type I.
R X,F
D(X, I
F (I))
= [I, D]( X, F )
natural in X D and F [I, D] see 4.8. Moreover, from Theorem 3.12 the
isomorphism is defined by
R X,F
f D X, I
F (I) / f [I, D]( X, F ) (7)
41
The case for ends goes similarly. As D has all limits then it has all ends,
then from parametrised representability for ends there is an isomorphism
R X,G
D(X, I G(I, I))
= Dinat X, G
natural in X D and G [Iop I, D], where X,G is defined by
R X,G
f D X, I
G(I, I) / f Dinat X, G (8)
Exercise 6.2 Prove the dinaturality formula by using our explicit choice for
ends in Set.
42
R
Proof: We show [J, D] Y, J. I F (I, J) = [I, [J, D]] I Y, I. J. F (I, J) nat-
ural in Y [I, D]. This natural isomorphism is obtained as the composition of
the following natural isomorphisms:
R R R
[J, D] Y, J. I F (I, J) = J D Y (J), I F (I, J) by naturality formula (10),
R
= J [I, D] I. Y (J), I. F (I, J) by representation of limits,
= [J, [I, D]] J. I. (Y (J)), J. I. F (I, J) by naturality formula (10),
= [I J, D] I, J. Y (J), I, J. F (I, J) by uncurrying and swapping,
= [I, [J, D]] I. J. (Y J), I. J. F (I, J) by currying.
As each isomorphism is natural in Y [J, D] we obtain R the required
repre-
sentation.
R
J
In particular the identity idJ. F (I, J) is sent to hI iJJ II which by The-
I
orem 3.12 is a limiting cone for I. J. F (I, J). As each isomorphism is natural
in F as well, by parametrised representability, we have
R R
I J. F (I, J) = J. I F (I, J)
natural in F .
meaning if one limit exists so does the other. If D is complete the isomorphism
is natural in F .
R
Proof: By parametrised representability
R and since I F (I, J) exists for any
J J we have the functor J. I F (I, J). By representation of limits
R R R
D , J I F (I, J) = [J, D] , J. I F (I, J) and
R
D , F (I, J) = [I J, D] , I, J. F (I, J) .
(I,J)
43
Notice that each isomorphism is natural in V D and F [I J, D] (provided
we assume D is complete).
Corollary 6.6 (Fubini for Ends) Given F : Iop I Jop J D such that
R
I F (I, I, J , J + ) exists for all J ,J + J; and
R
J F (I , I + , J, J) exists for all I ,I + I,
then R R R R
I J F (I, I, J, J)
= J I F (I, I, J, J) ,
meaning if one side exists so does the other. Moreover this isomorphism is
natural in F if D is complete.
7 Coends
7.1 Definition of Coend
Definition 7.1 (Coend Abstractly)
A coend for F : Iop I D is a repre-
sentation for Dinat F, : D Set
RI
D F (I, I), = Dinat F, .
An element of the set Dinat F, X is a wedge from F to X. By using the dual
form of Theorem 3.12 we can recover a concrete definition for coends
in terms
of couniversal wedges. Thus given a wedge Dinat F, X there exists a
RI
unique arrow h : R R
F (I, I) X such that = h I F (I,I) id I F (I,I)
44
where R I F (I,I) idR I F (I,I) is the couniversal wedge. Therefore, given an arrow
f : V U in I we have that in the diagram
F (U, U )
t9 LLL U
F (U,f ) ttt LLLU
tt LLLL
tt (1)
tt %
RI h (
F (U, V ) F (I, I) _ _ _ _ _ _/6 X
JJ r 9
JJ (2)
JJ
JJ rr rrr
F (f,V ) JJ rr V
% rr V
F (V, V )
(1) and (2) commutes, where = R I F (I,I) idR I F (I,I) .
By means of the dinaturality 9 formula we can define coends in terms of
ends, given a functor F : Iop I D
RI R
D F (I, I), V = Dinat F, V = I D(F (I, I), V ) (11)
natural in V (and also natural in F if D is a complete category).
The relation between colimits and coends allows to extend our choice for
colimits of set-valued functors to coends in Set. Thus, given a functor F :
Iop I Set RI U
F (I, I) = II F (I, I)/ (12)
U U
where the relation is the least equivalence relation on II F (I, I) II F (I, I)
such that
(U, x) (V, y) if f : V U arr(I) z F (U, V ) . (x = F (U, f )z) & (y = F (f, V )z) .
The universal wedge is given by the collection of injection arrows x 7 [(U, x)] .
The results for ends have a dual version for coends: parametricity coends,
Fubini Theorem and pointwise coends in functor categories.
Notation 7.2 Henceforth we shall denote hom-sets in Set with square R brack-
ets, for instance [A, B] instead of Set(A, B). Rewriting (13) to X(U )
= V [C(V, U ), X(V )].
We now present a coend formula for X. The density formula expresses X(U )
in terms of the coend
RW
X(U )
= C(U, W ) X(W )
natural in U and X [Cop , Set]. Notice that the right hand side is a coend
for the functor W , W + . C(U, W + ) X(W ) : Cop C Set where U C.
45
Notation 7.3 In a category C with all small
P coproducts, for S Set and
A C, the copower S A is the coproduct sS A.
Let us rewrite the density formula using copowers:
RW
X
= U. X(W ) C(U, W )
RW
= U. X(W ) C(U, W ) as coends are computed pointwise,
RW
= X(W ) (U. C(U, W )) (14)
RW
= X(W ) YW
46
Often we will take the category of elements defined by a contravariant functor
G : Cop Set, in this case h : (C, z) (C , z ) is an arrow of els(G) if
h : C C is an arrow in C and (G h)(z) = z .
Note that a product of sets X(W ) C(U, W ) can be written as a coproduct
in two ways X R xX(W )
C(U, W ) = C(U, W ) (15)
xX(W )
or X R f C(U,W )
X(W ) = X(W ) (16)
f C(U,W )
where we treat the sets X(W ) and C(W, U ) as discrete categories (i.e. all maps
are identities) when using the integral notation (here representing colimits).
From the density formula, we have
RW R W R xX(W )
X(U )
= X(W ) C(U, W ) = C(U, W ) .
Exercise 7.5 Considering our particular choice for coends and colimits in Set
prove that the isomorphism (17) holds and conclude that it is natural in U .
R (W,x)els(X)
Hence, X(U ) = C(U, W ), so
R (W,x)els(X) R (W,x)els(X)
X
= U. C(U, W )
= U. C(U, W ) , (18)
47
Clearly, if composition with G sends one limit for a diagram D : I C
to a limit for G D then it sends any other limit for D to a limit for G D.
Most often we talk of the functor G preserving I-limits, or being I-continuous;
this means that G preserves limits of all diagrams in [I, C]. Sometimes we are
interested in a subcategory of diagrams K [I, C] for which limits exist in C.
Just as above we can define a functor limI : K C. And, as later, talk about a
functor preserving K-limits or being K-continuous.
That does not ensure that C(C, ) is limiting. Let us examine the diagram
for I
R C(C,I )=I
C(C, I F (I)) / C(C, F (I))
kkk5
kkkk
=
kkkkkkI
R kk
I
C(C, F (I)) ,
R
given f C(C, I F (I)), we have from the representation for limits (7)
I
f / I f .
48
Let G : C D be a functor. Given a cone : limI D D for a diagram
D : I C the natural transformation G : G(limI D) G D obtained by
composition is a cone as well. Thus, given a limiting cone : limI GD GD
there is a unique mediating morphism m : G(limI D) d such that the diagram
G(limI D) m / lim
I
GD
PP
PPP
PPP
G PPPP
'
GD
G(lim D)
= lim G D.
I I
Indeed, the action of G over arrows may result in a family that is not univer-
sal. As an example consider the category count of countably infinite sets and
functions. Clearly the objects of count are all isomorphic. There is a functor
+ 1 : count count that acts over sets by adding a new element: given
X count then X + 1 = X {X} and given a function f : X Y , the function
f + 1 sends a X to f (a) and {X} to {Y }. There is an isomorphism
(X Y ) + 1
= (X + 1) (Y + 1),
G(lim D)
= lim(G D)
I I
natural in D K.
An isomorphism G(limI D) = lim (G D) natural in D is not always unique.
I
Consider, for instance, the category 1 with one object, say , and the identity
arrow. The functor category [1,1 ] has only one object: the constant functor
49
. The limit for this functor is the object itself where the limiting cone is
the identity. We can extend 1 with an extra morphism
id : / id :d f
G(lim D)
= lim(G D)
I I
a e1 e2 . . . en b.
Observe that if I is connected then C has limits for all I-indexed constant
diagrams.
50
commute, where and are the chosen limiting cones associated to limJ c
f
and limJ D respectively. As J is connected there is an isomorphism limI c = c
such that = f . As and are limiting cones by Proposition 4.4 there is an
isomorphism g : c
= lim D such that = g. Hence,
J
(g f ) = g f = f = = lim .
J
Since is limiting,
lim = g f.
J
51
The limiting cone : c D induces the naturality square
c
G limJ c
= / lim (G(c))
J
G(lim ) lim G
J
J
D
G(limJ D)
= / lim (G D).
J
commute where h is the chosen limiting cone associated with limJ (G c).
Since J is connected h is an isomorphism. Hence,
m = (lim G) h1
J
52
1. for every D K, G D has a limit in D; and
2. there exists an isomorphism limJ (G D)
= G(lim D) natural in D K.
J
Proof: We use the proof of Theorem 8.6 within the subcategory K. Notice that
the expression limJ D is functorial in D but the domain is K instead of [J,C ].
As the indexing category J is connected the limits for constants diagrams exist
in C.
Connectivity is a significant constraint on diagrams. There are, however,
many applications where connected limits (and colimits) are central and then
the result above (and its dual) can be useful.
Theorem 8.6 does not necessarily hold when the indexing category is not
connected. For example, consider the functor category [2,1 ] were 2 is the
two-objects discrete category. This functor category has a unique object: the
constant diagram . Now consider the functor G : 1 Set selecting a
countable infinite set, say the natural numbers N. As = in 1, where the
projections are given by the identity, we have
G( )
= G() G()
natural in since N
= N N. The pair (idN , idN ), however, is not a product.
8.3 Products
Clearly, Theorem 8.6 cannot be applied to products; then the index category is
discrete, an extreme example of lack of connectivity.
Given a discrete category K a diagram D : K C can be regarded as a
tuple of objects hxk ikK in C where xk = D(k). A cone for this functor is any
family of arrows (called projections) hfk : x xk ikK for some object x. Notice
that as the index category is discrete there is no commutativity to check and
naturality comes for free. We say that a family hfk : x xk ikK is a K-product
(or often just product) when it is a limiting cone. Because with a discrete index
category naturality is automatic, we can strengthen Proposition 4.4; we retain
a product when objects in the diagram vary to within isomorphism.
fk fk
xk
=
sk
/ xk
53
We now study the conditions for a functor to preserve products. In the next
section we see how these same conditions are enough to ensure preservation of
limits in the general case. In a category with terminal object we use ! : c
to denote the unique arrow from c to . We will use the following simple fact
about products with a terminal object.
hf : x x, ! : x i
G(x y)
= G(x) G(y)
natural in x, y C.
Proof: Assume that G preserves terminal objects and that the isomorphism
sx,y
G(x y)
= G(x) G(y)
54
By Proposition 8.9 the morphism 1x, is an isomorphism and so G(1x, ) is an
isomorphism as well. The right triangle commutes as products are special limit
functors.
By assumption G() is a terminal object and so from Proposition 8.9 the
arrow 1Gx,G is an isomorphism. Thus the composition
commutes.
We can follow the same argument with y instead of x. Then by Proposi-
tion 8.8 the pair
hG(1x,y ), G(2x,y )i
is a product. (Notice that the mediating arrow defined by hG(1x,y ), G(2x,y )i is
an isomorphism but does not necessarily coincide with sx,y .)
We generalise the last theorem to K-products where the naturality of the
isomorphism is required within a subcategory K [K, C] of product diagrams.
natural in hxk ik K.
Proof: This generalises the proof of Theorem 8.10 above to K-products of tuples
within K. It follows by fixing one component at a time and mapping all other
components to the terminal object .
55
8.4 General Limits
P category I can be decomposed into its connected components. We write
A small
I = kK Ik for this decomposition where Ik s are the connected components of
Ithis assumes that K is a discrete category. A connected component Ik is a
full subcategory of I and there is an inclusion functor k : Ik I. This functor
defines by pre-composition the restriction functor
[I, C](c, d)
= C(c, d)
Q k ik
limI (D k ) / lim (D k ) / D(i)
kK k Ik
56
natural in c. Hence,
Y
[I, C] c, D = [Ik , C] c, D k
kK
Y
= C c, lim(D k ) the limit as a representation,
kK Ik
Y
= C c, lim(D k ) since hom-functor preserves limits,
kK Ik
The task now is to combine the results on products (Theorem 8.11) and on
connected diagrams (Theorem 8.6) to treat preservation of more general limits.
In order to do so we use two embeddings of functor categories. Assuming C has
terminal object , the first embedding is the right adjoint of k :
k
/
[I, C] o [Ik , C] . (19)
+
57
Proof: For 1 consider the chain of isomorphisms
C(c, lim H + )
= [I, C] c, H + the limit as a representation,
I
= [Ik , C] (c) k , H by the adjunction (19),
= [Ik , C] c, H
= C(c, lim H) the limit as a representation,
Ik
lim H +
= lim H
I Ik
natural in H K.
For 2 observe that since G preserves the terminal objects it is possible to
define an adjunction as (19) with D as codomain where G H + = (G H)+ .
Thus we have
D(d, lim G H + )
= [I, D] d, G H + the limit as a representation,
I
= [I, D] d, (G H)+
= [Ik , D] (d) k , G H by the adjunction (19),
= [Ik , D] d, G H
= D(d, lim G H) the limit as a representation,
Ik
lim G H +
= lim GH
I Ik
natural in H.
There is a less obvious embedding : [K, C] [I, C] where K is the discrete
category whose objects are identified with the connected components of I. Given
a tuple hxk ikK , the functor hxk ikK : I C acts as the constant xk over
the objects and arrows in Ik .
P
Proposition 8.15 Let G : C D be a functor and I = kK Ik be a small
category with Ik , where k K, its connected components:
Q
1. there is an isomorphism limI hxk ikK
= kK xk , and
Q
2. there is an isomorphism limI G hxk ikK
= kK G(xk ).
58
In both cases it is meant that if one side of the isomorphism exists then so does
the other. The isomorphisms are natural in hxk ikK K for a subcategory of
K-tuples K [K, C] such that C is K-complete.
Proof: For 1,
C(c, lim hxk ikK )
= [I, C] c, hxk ikK the limit as a representation,
I
Y
= [Ik , C] c k , hxk ikK k by Proposition 8.12,
kK
Y
= [Ik , C] c, Ik xk by definition of ,
kK
= [K, C] c, hxk ikK
= C(c, limhx i ) the limit as a representation,
k kK
K
Q
all natural in c and hxk ikK . Thus limI hxk ikK is isomorphic to kK xk =
limK hxk ikK with naturality following from Yoneda. In a similar way, using the
identity
G x = G(x) ,
we can prove 2.
Now we can reduce the preservation of general limits to naturality.
G(lim D)
= lim(G D) (20)
I I
Q k ik
limI (D k ) / lim (D k ) / D(i)
kK k Ik
with projections k and where k is the limiting cone associated with limI (D
k
k ). So in order to prove that G is limiting, it is enough to verify that the cone
with components
G(ik ) G(k )
59
is limiting. For this it suffices to show that hG(k )ikK is a product and that
for every k the cone G k is limiting.
However,
Y
G( xk )
= G(lim
hxk ik ) by Proposition 8.15,
kK I
= lim(G hxk ik ) by assumption (20),
I
Y
= G(xk ) by Proposition 8.15,
kK
all natural in hxk ik [K, C]. So G preserves K-products by Theorem 8.11 and
hG(k )ikK above is a product.
Similarly,
G(lim H)
= G(lim H +) by Proposition 8.14,
Ik I
= lim (G H + ) by assumption (20),
I
= lim (G H + ) by Proposition 8.14,
I
all natural in H [Ik , C]. Thus G preserves Ik -limits by Theorem 8.6 and G( k )
above is a limit for G(D k ).
The proof of the theorem above can be carried out under more liberal as-
sumptions, to cover the preservation of I-limits, for a particular small category
I.
60
8.4.1 Examples
Proposition 8.18 The Yoneda embedding Y : C [C op , Set] preserves limits.
Proof: As a consequence of Propositions 8.2 and 6.3 there is an isomorphism
R R
(Y I F (I))(C) = ( I Y F (I))(C)
Theorem 8.20 Suppose the category I is small and connected. Suppose cate-
gories C, D have initial objects and all I-colimits.
A functor G : C D preserves I-colimits iff there is an isomorphism
G(lim D)
= lim(G D) ,
I I
G(lim D)
= lim(G D) ,
I I
61
Theorem 8.22 Suppose categories C, D are cocomplete.
A functor G : C D preserves all colimits iff for all small categories I there
is an isomorphism
G(lim D) = lim (G D) ,
I I
9 Adjunctions
9.1 Definition of Adjunctions
F /
Definition 9.1 (Adjunction) Let C o D be functors where C and D are
G
categories. An adjunction in which F is the left adjoint and G is the right adjoint
consists of an isomorphism
X,Y
D(F (X), Y )
= C(X, G(Y ))
natural in X C and Y D. When such a natural isomorphism exists we write
F G.
By (the dual form of) parametrised representability (Theorem ??), it is suf-
ficient to specify an adjunction via a representation for the functor C(X, G())
X
D(F [X], )
= C(X, G())
where F [X] D for each X C. Then, the mapping which sends X to F [X]
extends uniquely to a functor F : C D such that
X
Y
D(F (X), Y )
= C(X, G(Y ))
natural in X C and Y D, i.e., so F is the left adjoint of G.
From (the dual form of) Theorem 3.12, the representation for C(X, G())
defines a universal element X = FX[X] (idF [X] ), i.e., for any f C(X, G(Y ))
where Y D there exists a unique f D(F [X], Y ) such that
f = C(X, G())(f ) (X )
= G(f ) (X )
= G(f ) X .
Then the diagram
X
XG / G(F [X]) F [X]
GG
GGf f
GG
GG G(f )
#
G(Y ) Y
62
commutes. The collection of universal elements hX iXC is called the unit of
the adjunction. Thus we obtain the freeness condition sufficient to establish an
adjunction.
Exercise 9.3 Show that the action of the induced functor F over an arrow
f : C C in C is the unique arrow determined by the freeness condition of C
for the arrow C f . Then conclude that the collection hX iXC is a natural
transformation from idC to G F .
Dually, suppose F : C D is a functor, a necessary and sufficient condition
for there to be a functor G : D C such that F G is that for each object
Y D there is an object G[Y ] C and an arrow Y : F (G[Y ]) Y in D such
that (G[Y ], Y ) is co-free over Y with respect to F , i.e. the diagram
Y
G[Y ] Y cGo G F (G[Y ])
O GG O
g GG F (g)
G
g GG
X F (X)
Given that both the isomorphism and its inverse are written as () we must
have f = f and g = g. Given an arrow h we called the arrow h the transpose of
h. Using this notation, we investigate the consequences of naturality.
63
Naturality in X: For h : X X in C the square
XO D(F (X), Y )
= C(X, G(Y ))
h F h h
X D(F (X ), Y )
= D(X , G(Y ))
Y D(F (X), Y )
= C(X, G(Y ))
k k G k
Y D(F (X), Y )
= D(X, G(Y ))
64
Proof: Recall from exercise 9.3 (and its dual) that the unit and counit of an
adjunction are natural transformations. We prove only the left hand identity
above, the other follows analogously. Given Y D, we have
G(Y ) G(Y )
G(Y ) / G(F (G(Y ))) / G(Y )
G(Y ) =idG(Y ) Y
F (G(Y )) / F (G(Y )) / Y,
65
9.4 Limits and Adjunctions
F /
Theorem 9.7 Suppose the functors C o D form an adjunction F G.
G
Then G preserves all limits which exist in D, and F preserves all colimits which
exist in C.
Proof: Assume D : I D is a diagram whose limit exists in D. Composing
isomorphisms
R R
C U, G( I D(I)) = D F (U ), I D(I) by the adjunction,
R
D F (U ), D(I)
= by Proposition 8.2,
RI
= I C U, G(D(I)) by the adjunction,
R
= C U, G(D(I)) by representation of limits,
I
Exercise 9.8 Complete the proof by showing that left adjoints preserve colim-
its.
idA m
A m
/B
F
w
[Cop , Set] 9D
F!
66
The functor F! is got by extending F along the Yoneda embedding Y (an example
of a left Kan extension):
Y
C HH / [Cop , Set]
HH
HH F
HH
F HH !
$
D.
RC
Define F! = X. X(C) F (C) and F = Y. C. D(F (C), Y ). To show
F! F :
RC
D(F! (X), Y ) = D X(C) F (C), Y by definition,
R
= C D(X(C) F (C), Y ) by representation for coends,
R P
= C D( xX(C) F (C), Y ) by definition of copower,
R Q
= C xX(C) D(F (C), Y ) (21)
R
= C [X(C), D(F (C), Y )]
R
= C [X(C), (F (Y ))(C)] by definition of F ,
op
= [C , Set](X, F (Y )) by naturality formula,
F
|
b
C b
: D.
F!
67
a representation for the functor C( B, C):
C(, [B, C])
= C( B, C)
for all B, C C.
Notation 9.11 The object [B, C] C is called the exponential of B and C and
sometimes is written as C B .
By parameterised representability (Theorem ??) for a ccc C there is a unique
way to extend the mapping (B, C) 7 [B, C] to an exponentiation functor [, +]
from C op C to C such that
68
R
b
C(X, [Y, Z])
= U [X(U ), [Y, Z](U )] by naturality formula,
R
b U Y, Z)]
= U [X(U ), C(Y by definition of [Y, Z],
R R
= U X(U ), V [C(V, U ) Y (V ), Z(V )] by naturality formula,
R R
= U V X(U ), [C(V, U ) Y (V ), Z(V )] by representation for ends,
R R
= U V X(U ) C(V, U ), [Y (V ), Z(V )] by currying and uncurrying,
R R
= V U X(U ) C(V, U ), [Y (V ), Z(V )] by Fubini (Corollary 6.6),
R RU
= V X(U ) C(V, U ), [Y (V ), Z(V )] by representation of coends,
R
= V X(V ), [Y (V ), Z(V )] by the density formula,
R
[X(V ) Y (V ), Z(V )]
= by uncurrying,
RV
= V [(X Y )(V ), Z(V )] product is got pointwise (Proposition 6.3,
C(X
= b Y, Z) by naturality formula,
b
all natural in X C.
Theorem 9.14 (Presheaf categories are free colimit completions) The cat-
b = [Cop , Set] with the Yoneda embbeding Y : C C
egory of presheaves C b is the
free colimit completion of C, i.e. for any functor F : C D, where D is a cate-
bD
gory with all colimits there is a unique colimit-preserving functor F! : C
such that the diagram
Y
C> /Cb
>>
>>
> F!
F >>
D
commutes, i.e., F! Y = F .
RC
Proof: Let us define F! = X. X(C) F (C). As shown in 9.5 there is an
adjunction F! D. D(F (), D). By Theorem 9.7 as a left adjoint F! preserves
colimits.
The adjunction F! D. D(F (), D) is given by an isomorphism
D(F! (X), D) b
= C(X, D(F (), D))
69
b D is a
It remains to prove the uniqueness of F! . Suppose that H : C
colimit-preserving functor such that H Y
= F . Then,
R
C
H(X)
=H X(C) Y C by the density formula,
RC
= X(C) H(Y C) as H preserves colimits, (22)
RC
= X(C) F (C) since H Y = F,
= F! (X) by definition of F! ,
T T
T3 / T2 T A / T2 o T T
AA }
AA }} (23)
T AA }}}
idT A ~}} idT
T2 /T T
70
Proof: By naturality of for any B D the square
F GB
F GF GB / F GB
F G B B
B
F GB /B
commute.
Tf
TA /TB
(25)
f
A /B
commutes.
71
There is a forgetful functor GT : C T C acting on objects and arrows
:TAA A
f
/ f
:TBB B.
Exercise 10.11 Prove that the collection of arrows h:T AA = i:T AAC T
is a natural transformation from F T GT to idC T .
Theorem 10.12 Every monad is defined by its T -algebras: the monad induced
by the adjunction F T GT is T istself.
Proof: From proposition 11.4 the adjunction F T GT with unit and counit
defines a monad (GT F T , , GT F T ). Clearly, GT F T = T and is the unit
of T . Given A C the component (GT F T )A = A .
72
ob(CT ) = ob(C),
CT (A, B) = C(A, T B),
for f CT (A, B) and g CT (B, C) the composition g f CT (A, C) is
defined to be C T g f C(A, T C), and
the identity idA CT (A, A) is A C(A, T A).
This is the Kleisli category defined by T and is written as CT .
Proof: That this definition gives indeed a category follows from the indentities
in the definition of monad and naturality; the details are left as exercise.
H(g C ) = D T g T C
= g C T C g is a T -algebra,
= g idT (C) by triangle in ??,
= g.
f = D T D f by triangle in (??),
= D T f C by naturality of ,
= D T g C by assumption H(f ) = H(g),
= D T D g by naturality of ,
=g by triangle in (??).
73
Therefore, H is an equivalence.
We have the diagram of categories and functors:
H
CT > / CT
FT }}} }
} }
}}}}
}} }}} GT
~}
C.
74