Você está na página 1de 196

Categories for Everybody

Steve Awodey

Carnegie Mellon University

Draft of February 5, 2003

Copyright
2002, Steve Awodey
ii

Draft of February 5, 2003


Contents
1 Categories 1
1.1 Introdu tion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Fun tions of sets . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 De nition of a ategory . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5 Isomorphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.6 Constru tions on ategories . . . . . . . . . . . . . . . . . . . . . 12
1.7 Free ategories . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.8 Foundations: large, small, and lo ally small . . . . . . . . . . . . 19
1.9 Exer ises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2 Spe ial obje ts and arrows 23
2.1 Epis and monos . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.2 Initial and terminal obje ts . . . . . . . . . . . . . . . . . . . . . 25
2.3 Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.4 Splits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.5 Exer ises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3 Finite limits 33
3.1 Produ ts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.3 Categories with produ ts . . . . . . . . . . . . . . . . . . . . . . 39
3.4 Hom-sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.5 Duality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.6 Coprodu ts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.7 Equalizers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3.8 Coequalizers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.9 Exer ises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
4 Groups and ategories 57
4.1 Groups in a ategory . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.2 The ategory of groups . . . . . . . . . . . . . . . . . . . . . . . . 59
4.3 Categories as generalized groups . . . . . . . . . . . . . . . . . . 62
4.4 Finitely presented ategories . . . . . . . . . . . . . . . . . . . . . 64

Draft of February 5, 2003


iv CONTENTS

4.5 Exer ises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66


5 Limits and olimits 67
5.1 Subobje ts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
5.2 Pullba ks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
5.3 Properties of pullba ks . . . . . . . . . . . . . . . . . . . . . . . . 74
5.4 Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
5.5 Preservation of limits . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.6 Colimits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.7 Exer ises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
6 Exponentials 95
6.1 Exponential in a ategory . . . . . . . . . . . . . . . . . . . . . . 95
6.2 Cartesian losed ategories . . . . . . . . . . . . . . . . . . . . . . 98
6.3 Boolean and Heyting algebras . . . . . . . . . . . . . . . . . . . . 100
6.4 Properties of exponentials . . . . . . . . . . . . . . . . . . . . . . 103
6.5 Equational de nition . . . . . . . . . . . . . . . . . . . . . . . . . 107
6.6 - al ulus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
6.7 Exer ises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
7 Fun tors 113
7.1 Category of ategories . . . . . . . . . . . . . . . . . . . . . . . . 113
7.2 Representable fun tors . . . . . . . . . . . . . . . . . . . . . . . . 116
7.3 Stone representation . . . . . . . . . . . . . . . . . . . . . . . . . 119
7.4 Exer ises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
8 Natural transformations 123
8.1 Naturality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
8.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
8.3 Exponentials of ategories . . . . . . . . . . . . . . . . . . . . . . 128
8.4 Fun tor ategories . . . . . . . . . . . . . . . . . . . . . . . . . . 131
8.5 Exer ises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
9 Equivalen e of ategories 135
9.1 De nition of equivalen e . . . . . . . . . . . . . . . . . . . . . . . 136
9.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
9.3 Exer ises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
10 The Yoneda lemma 145
10.1 Categories of diagrams . . . . . . . . . . . . . . . . . . . . . . . . 145
10.2 The Yoneda embedding . . . . . . . . . . . . . . . . . . . . . . . 146
10.3 The Yoneda lemma . . . . . . . . . . . . . . . . . . . . . . . . . . 148
10.4 Appli ations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
10.5 Limits in diagram ategories . . . . . . . . . . . . . . . . . . . . . 151
10.6 Exponentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
10.7 Exer ises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154

Draft of February 5, 2003


CONTENTS v

11 Adjoints 155
11.1 De nition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
11.2 Hom-set de nition . . . . . . . . . . . . . . . . . . . . . . . . . . 159
11.3 Examples of adjoints . . . . . . . . . . . . . . . . . . . . . . . . . 162
11.4 Order adjoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
11.5 Quanti ers as adjoints . . . . . . . . . . . . . . . . . . . . . . . . 167
11.6 RAPL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
11.7 Adjoint fun tor theorem . . . . . . . . . . . . . . . . . . . . . . . 172
11.8 Exer ises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
12 Monads 179
12.1 The triangle identities . . . . . . . . . . . . . . . . . . . . . . . . 179
12.2 Monads and adjoints . . . . . . . . . . . . . . . . . . . . . . . . . 181
12.3 Algebras for a monad . . . . . . . . . . . . . . . . . . . . . . . . 183
12.4 Exer ises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189

Draft of February 5, 2003


vi CONTENTS

Draft of February 5, 2003


Chapter 1

Categories
1.1 Introdu tion
As a rst approximation, one ould say that ategory theory is the mathemati al
study of (abstra t) algebras of fun tions. Just as group theory is the abstra -
tion of the idea of a olle tion of permutations of the elements of a set or the
symmetries of a geometry, and ring theory an be regarded as an abstra tion of
the algebra of ontinuous, real-valued fun tions on a spa e, so ategory theory
arises from the idea of a system of fun tions among some obje ts.
f
A >B

g Æ f
g
R _
C
We think of the omposition g Æ f as a sort of \produ t" of the fun tions f
and g, and onsider abstra t \algebras" of the sort arising from olle tions of
fun tions. A ategory is just su h an \algebra," onsisting of obje ts A; B; C; : : :
and arrows f : A ! B , g : B ! C , : : : , that are losed under omposition and
satisfy ertain onditions typi al of the omposition of fun tions. A pre ise
de nition is given later in this hapter.
The histori al development of the subje t has been roughly as follows:
1945 Eilenberg and Ma Lane's \General theory of natural equivalen es" was
the original paper, in whi h the theory was rst formulated.
1950's The main appli ations were in the elds of algebrai topology, parti u-
larly homology theory, and abstra t algebra.
1960's Grothendie k et al. developed appli ations in number theory and alge-
brai geometry.

Draft of February 5, 2003


2 Categories

1970's Lawvere and others began applying ategories to logi .


1980's Appli ations in omputer s ien e, linguisti s, ognitive s ien e, : : :
A striking thing about the eld is that it has su h wide-ranging appli ations.
In fa t, it turns out to be a kind of universal mathemati al language, like set
theory. As a result of these various appli ations, ategory theory also tends to
make apparent ertain onne tions between di erent elds { like between logi
and geometry. For example, the important notion of an adjoint fun tor o urs
in logi as the universal quanti er and in topology as the dire t image operation
along a ontinuous fun tion. From a ategori al point of view, these turn out
to be essentially the same operation.
The on ept of adjoint fun tor is in fa t one of the main things that the
reader should take away from the study of this book. It's a stri tly ategory-
theoreti al on ept that has turned out to be a on eptual tool of the rst
magnitude { on a par with the idea of a ontinuous fun tion.
In fa t, just like the idea of a topologi al spa e arises in onne tion with
ontinuous fun tions, so also the notion of a ategory arose in order to de ne
that of a fun tor, at least a ording to one of the inventors. The notion of a
fun tor arose { so the story goes on { in order to de ne natural transformations.
One might as well ontinue that natural transformations serve to de ne adjoints:

Category
Fun tor
Natural Transformation
Adjun tion
Indeed, that gives a pretty good outline of this book.
Before getting down to business, let's ask why it should be that ategory
theory has su h far-rea hing appli ations? Well, we said that it's the abstra t
theory of fun tions; so the answer is simply this:
Fun tions are everywhere!
And everywhere that fun tions are, there are ategories.

1.2 Fun tions of sets


We begin by onsidering fun tions between sets. I'm not going to say here what
a fun tion is, anymore than what a set is. We'll assume a working knowledge
of these terms. (They an in fa t be de ned using ategory theory, but that is
not our purpose here.)
Let f be a fun tion from a set A to another set B , we write:
f :A!B
Draft of February 5, 2003
1.2 Fun tions of sets 3

To be expli it, this means that f is de ned on all of A and all values of f are
in B ,
range(f )  B :
Now suppose we also have a fun tion g : B ! C ,
f
A >B
...
.
. ..
. g
g Æ f .....
_ R.
C
then there is a omposite fun tion g Æ f : A ! C , given by
(g Æ f )(a) = g(f (a)) a2A (1.1)
Now this operation \Æ" of omposition of fun tions is asso iative, as follows. If
we have a further fun tion h : C ! D

f
A >B
  h Æ g
g Æ f 
g
R _ R
C >D
h
and form h Æ g and g Æ f then we an ompare (h Æ g) Æ f and h Æ (g Æ f ) as indi ated
in the above diagram. It turns out that these two fun tions are always identi al:

(h Æ g) Æ f = h Æ (g Æ f )
sin e for any a 2 A, we have
((h Æ g) Æ f )(a) = h(g(f (a))) = (h Æ (g Æ f ))(a)
using (1.1).
By the way, this is of ourse what it means for two fun tions to be equal:
for every argument, they have the same value.
Finally, note that every set A has an identity fun tion
1A : A ! A;
given by
1A(a) = a:

Draft of February 5, 2003


4 Categories

These identity fun tions a t as \units" for the operation of omposition, in


the sense of abstra t algebra. That is to say,
f Æ 1A = f = 1B Æ f
for any f : A ! B . These are all the properties of set fun tions that we want
to onsider for the abstra t notion of fun tion { omposition and identities. We
want to \abstra t away" everything else, so to speak. That's what is a om-
plished by the following de nition.

1.3 De nition of a ategory


De nition 1.1. A ategory onsists of the following data:
 Obje ts : A; B; C; : : :
 Arrows : f; g; h; : : :
 For ea h arrow f there are given obje ts
dom(f ); od(f )
alled the domain and odomain of f . We write
f :A!B
to indi ate A = dom(f ) and B = od(f ).
f g
 Given arrows A ! B! C , i.e. with
od(f ) = dom(g)
there is an arrow
gÆf :A!C
alled the omposite of f and g.
 For ea h obje t A there is an arrow
1A : A ! A
alled the identity arrow of A.
These data are required to satisfy the following laws:
 Asso iativity:
h Æ (g Æ f ) = (h Æ g) Æ f
f g h
for all A ! B! C! D.
Draft of February 5, 2003
1.4 Examples 5

 Unit:
f Æ 1A = f = 1B Æ f
for all f : A ! B .
A ategory is anything that satis es this de nition { and we'll have plenty of
examples very soon. For now I want to emphasize that the obje ts don't have
to be sets and the arrows need not be fun tions. In this sense, a ategory is an
abstra t algebra of fun tions, or \arrows", with the omposition operation \Æ"
as primitive. If you're familiar with groups, you may think of a ategory as a
sort of generalized group.

1.4 Examples
1. We have already en ountered the ategory Sets of sets and fun tions.
There is also the ategory
Sets n
of all nite sets and fun tions between them.
Indeed, there are many ategories like this, given by restri ting the sets
that are to be the obje ts and the fun tions that are to be the arrows. For
example, take nite sets as obje ts and inje tive (that is, 1-1) fun tions
as arrows. Sin e inje tive fun tions ompose to give an inje tive fun tion,
and sin e the identity fun tion is inje tive, this also gives a ategory.
What if we take sets as obje ts and as arrows, those f : A ! B su h that
for all b 2 B , the subset
f 1(b)  A
has at most two elements (rather than one)? Is this still a ategory? What
if we take the fun tions su h that f 1 (b) is nite? in nite? There are lots
of su h restri ted ategories of sets and fun tions.
2. Another kind of example one often sees in mathemati s are the ategories
of stru tured sets, i.e. sets with some further stru ture and fun tions whi h
preserve it, or \homomorphisms". Examples of this kind you may be
familiar with are:
 groups and group homomorphisms,
 the natural numbers N and all omputable fun tions N ! N ,
 the real numbers R and ontinuous fun tions R ! R,
 open subsets U  R and ontinuous fun tions f : U ! V  R de ned
on them,
 topologi al spa es and ontinuous mappings,
 di erentiable manifolds and smooth mappings,
 graphs and graph homomorphisms,

Draft of February 5, 2003


6 Categories

 posets and monotone fun tions.


Don't worry if some of these examples are unfamiliar to you. Later on, we
will take a loser look at some of them. For now, let's just onsider the
last of the above examples in more detail.
3. A poset is a set A equipped with a binary relation a A b su h that the
following onditions hold for all a; b; 2 A:
re exivity: a A a,
transitivity: if a A b and b A , then a A ,
antisymmetry: if a A b and b A a, then a = b.
An arrow from a poset A to a poset B is a fun tion
m:A!B
that is monotone, in the sense that, for all a; a0 2 A,
a A a0 implies m(a) B m(a0 ) :
What does it take for this to be a ategory? We need to know that
1A : A ! A is monotone, but that is lear sin e a A a0 implies a A a0 .
We also need to know that if f : A ! B and g : B ! C are monotone,
then g Æ f : A ! C is monotone. This also holds, sin e a  a0 implies
f (a)  f (a0 ) implies g(f (a))  g(f (a0 )) implies (g Æ f )(a)  (g Æ f )(a0 ).
So we have the ategory Pos of posets and monotone fun tions.
4. The ategories that we have been onsidering so far are examples of on-
rete ategories { in whi h the obje ts are (stru tured) sets and the arrows
are simply ertain fun tions. Let's now take a look at few examples that
are not of this sort.
Let Rel be the following ategory: take sets as obje ts and take binary
relations as arrows. That is, an arrow f : A ! B is a subset f  A  B .
The identity arrow on a set A is the identity relation
1A = f(a; a) 2 A  A j a 2 Ag  A  A :
Given R  A  B and S  B  C , de ne omposition S Æ R by
(a; ) 2 S Æ R i 9b: (a; b) 2 R & (b; ) 2 S;
i.e. the \relative produ t" of S and R. We leave it as an exer ise to show
that Rel is in fa t a ategory. (What needs to be done?)
5. Finite ategories
Of ourse, the obje ts of a ategory don't have to be sets, either. Here
some very simple examples:

Draft of February 5, 2003


1.4 Examples 7

 The ategory 1 looks like this:

It has one obje t and only it's identity arrow.


 The ategory 2 looks like this:

It has two obje ts, the required identity arrows, and exa tly one
arrow between the obje ts.
 The ategory 3 looks like this:

It has three obje ts, the required identity arrows, exa tly one arrow
from the rst to the se ond obje t, exa tly one arrow from the se ond
to the third obje t, and exa tly one arrow from the rst to the third
obje t.
 The ategory 0 looks like this:

It has no obje ts or arrows.


We'll omit the identity arrows in drawing ategories from now on.
It's fairly easy to spe ify nite ategories { just take some obje ts and
start putting arrows between them, but make sure to put in the ne essary
identities and omposites, as required by the axioms for a ategory. Also,
if there are any loops, then they need to be ut o by equations to keep
the ategory nite. For example, onsider the following spe i ation:

f
>B
A<
g
Unless we stipulate an equation like
gf = 1A;
Draft of February 5, 2003
8 Categories

we'll end up with the in nitely many arrows gf; gfgf; gfgfgf; : : : . This
is still a ategory, of ourse, but it is not a nite ategory. We'll ome
ba k to this situation when we dis uss free ategories later in this hapter.
6. One important slogan of ategory theory is:
It's the maps that matter!
So, we should also look at the maps of ategories. A \homomorphism of
ategories" is alled a fun tor.
De nition 1.2. A fun tor
F :C!D
between ategories C and D is a mapping of obje ts to obje ts and arrows
to arrows, in su h a way that:
(a) F (f : A ! B ) = F (f ) : F (A) ! F (B ),
(b) F (g Æ f ) = F (g) Æ F (f ),
( ) F (1A ) = 1F (A).
Now, one an he k that fun tors ompose in the obvious way, and that
every ategory C has an identity fun tor 1C : C ! C. So we have
another example of a ategory, namely Cat, the ategory of all ategories
and fun tors.
7. A preorder is a set P equipped with a binary relation p  q that is both
re exive and transitive: a  a, and if a  b and b  , then a  ). Any
preorder P an be regarded as a ategory by taking the obje ts to be the
elements of P and taking a unique arrow,
a ! b if and only if a  b : (1.2)
The re exive and transitive onditions on  ensure that this is a ategory.
Going in the other dire tion, any ategory with at most one arrow between
any two obje ts determines a preorder, simply by de ning a binary relation
 on the obje ts by (1.2).
8. A poset is a preorder satisfying the additional ondition of antisymmetry:
if a  b and b  a, then a = b. So, in parti ular, a poset is also a ategory.
Su h poset ategories are very ommon; e.g. for any set X , the power set
P (X ) is a poset under the usual in lusion relation U  V between the
subsets U; V of X .
What is a fun tor F : P ! Q between poset ategories P and Q? It must
satisfy the identity and omposition laws ...
It's often useful to think of a ategory as a kind of generalized poset, one
with with \more stru ture" than just p  q. One an also think of a
fun tor as a generalized monotone map.

Draft of February 5, 2003


1.4 Examples 9

9. An example from logi : Given a dedu tive system of logi , there's an


asso iated ategory, where the obje ts are formulas
'; ; : : :
An arrow from ' to is a dedu tion of from the assumption '. Compo-
sition of arrows is given by putting together dedu tions in the obvious way,
whi h is learly asso iative. (What are the identity arrows 1'?) Observe
that there an be many di erent arrows
p:'! ;
sin e there may be many di erent proofs. This ategory turns out to have
a very ri h stru ture, whi h we will study later on.
10. An example from omputer s ien e: Given a fun tional programming lan-
guage L, there's an asso iated ategory, where the obje ts are the data
types of L, and the arrows are the omputable fun tions of L (\pro-
esses", \pro edures", \programs"). The omposition of two su h pro-
f g
grams X ! Y ! Z is given by applying g to the output of f , sometimes
also written
g Æ f = f; g :
The identity is the \do nothing" program.
Categories su h as this are basi to the idea of denotational semanti s of
programming languages. For example, if C(L) is the ategory just de ned,
then the denotational semanti s of the language L in a ategory D of, say,
S ott domains is simply a fun tor
S : C(L) ! D ;
sin e S assigns domains to the types of L and ontinuous fun tions to the
programs.
11. Let X be a set. We an regard X as a ategory Dis(X ) by taking the
obje ts to be the elements of X and taking the arrows to be just the
identity arrows, one for ea h x 2 X . Su h ategories are alled dis rete.
12. A monoid (or semi-group with unit) is a set M equipped with a binary
operation  : M  M ! M and a distinguished element u 2 M su h that
for all x; y; z 2 M ,
x  (y  z ) = (x  y)  z
and
ux=x=xu:
Equivalently, a monoid is a ategory with just one obje t. The arrows of
the ategory are the elements of the monoid. In parti ular, the identity

Draft of February 5, 2003


10 Categories

arrow is the distinguished element u. Composition of arrows is the binary


operation m  n of the monoid.
Monoids are very ommon. For example, for any set X , the set of fun tions
from X to X , written
homSets (X; X )
is a monoid under the operation of omposition. More generally, for any
obje t C in any ategory C, the set of arrows from C to C , written as
homC (C; C ), is a monoid under the omposition operation of C.
We have seen that ea h monoid may be regarded as a ategory. As
monoids are stru tured sets, there is also a ategory Mon whose obje ts
are monoids and whose arrows are fun tions that preserve the monoid
stru ture. That is, a homomorphism from a monoid M to a monoid N is
a fun tion h : M ! N su h that for all m; n 2 M :
h(m M n) = h(m) N h(n);
and
h(uM ) = uN
The reader should he k that a monoid homomorphism from M to N is
the same thing as a fun tor from M regarded as a ategory to N regarded
as a ategory. Indeed, ategories are generalized monoids, and fun tors
are generalized homomorphisms.

1.5 Isomorphisms
De nition 1.3. In any ategory C, an arrow f : A ! B is alled an isomor-
phism if there is an arrow g : B ! A in C su h that
g Æ f = 1A and f Æ g = 1B :
Sin e inverses are unique (proof!), we write g = f 1 . We say that A is isomor-
phi to B , written A 
= B , if there exists an isomorphism between them.
The de nition of isomorphism is our rst example of an abstra t, ategory
theoreti de nition of an important notion. It is abstra t in the sense that it
makes use only of the ategory theoreti notions, rather than some additional
information about the obje ts and arrows. It has the advantage over other
possible de nitions that it applies in any ategory. For example, one sometimes
de nes an isomorphism of sets (groups, et .) as a bije tive fun tion (resp. homo-
morphism), i.e. one that is \1-1 and onto". This is equivalent to our de nition
in some ases. But note that, for example in Pos, the ategory theoreti de ni-
tion gives the right notion, while there are \bije tive homomorphisms" between
non-isomorphi posets. Moreover, in many ases only the abstra t de nition
makes sense, e.g. in the ase of a monoid.

Draft of February 5, 2003


1.5 Isomorphisms 11

De nition 1.4. A group G is a monoid with an inverse g 1 for every element g.


Thus G is a ategory with one obje t, in whi h every arrow is an isomorphism.
For any set X , we have the group Aut(X ) of automorphisms (or \permuta-
tions") of X , i.e. isomorphisms f : X ! X . (Question: why is this losed under
\Æ"?) A group of permutations is a subgroup G  Aut(X ) for some set X , i.e.
a group of automorphisms of X . Thus G must satisfy
1. 1X 2 G
2. If g; g0 2 G, then g Æ g0 2 G
3. If g 2 G, then g 1 2 G
Theorem (Cayley). Every group G is isomorphi to a group of permutations.
Proof. (sket h)
1. De ne the Cayley representation G of G to be the following group of
permutations: the underlying set of G is just G, and for ea h g 2 G, we
have the permutation g, de ned for all h 2 G by:
g(h) = g  h
Che k that g = h implies g = h.
2. De ne homomorphisms i : G ! G by i(g) = g, and j : G ! G by j (g) = g.
3. Show that i Æ j = 1G and j Æ i = 1G.

Warning 1.5. Note the two di erent levels of isomorphisms that o ur in the
proof of Cayley's theorem. There are permutations of the set of elements of G,
whi h are isomorphisms in Sets, and there is the isomorphism between G and
G , whi h is in the ategory Groups of groups and group homomorphisms.
Cayley's theorem says that any abstra t group an be represented as a on-
rete group (i.e. a group of permutations). The theorem an be generalized to
show that any ategory an be represented as a on rete ategory.
Theorem 1.6. Every ategory C is isomorphi to a on rete one.1
Proof. (sket h) De ne the Cayley representation C  of C to be the following
on rete ategory:
 obje ts are sets of the form:
C = ff 2 Cj od(f ) = C g
for all C 2 C,
 arrows are fun tions
g : C ! D ;
for g : C ! D in C, de ned by g(f ) = g Æ f .

1 One should really require here that C is small ; see se tion 1.8 below.

Draft of February 5, 2003


12 Categories

1.6 Constru tions on ategories


Now that we have a sto k of ategories to work with, we onsider some on-
stru tions that produ e new ategories from old.
1. The produ t of two ategories C and D, written
CD
has obje ts of the form (C; D), for C 2 C and D 2 D, and arrows of the
form
(f; g) : (C; D) ! (C 0 ; D0 )
for f : C ! C 0 2 C and g : D ! D0 2 D. Composition and units are
de ned omponentwise; that is,
(f 0 ; g0 ) Æ (f; g) = (f 0 Æ f; g0 Æ g)
1(C;D) = (1C ; 1D )
There are two obvious proje tion fun tors :
1 2 >
C< CD D
de ned by 1 (C; D) = C and 1 (f; g) = f , and similarly for 2 .
The reader familiar with groups will re ognize that for groups G and H ,
the produ t ategory G  H is the usual (dire t) produ t of groups.
2. The opposite (or \dual") ategory Cop of a ategory C has the same
obje ts as C, and an arrow f : C ! D in Cop is an arrow f : D ! C in
C . That is Cop is just C with all of the arrows formally turned around.
It is onvenient to have a notation to distinguish an obje t (resp. arrow)
in C from the same one in Cop. Thus we may write
f : D ! C
in Cop for f :! D in C. With this notation we an de ne omposition
and units in Cop in terms of the orresponding operations in C, namely:
1C = 1C
f Æ g = g Æ f :
Thus a diagram in C:
f
A >B

g Æ f
g
R _
C
Draft of February 5, 2003
1.6 Constru tions on ategories 13

looks like this in Cop :


f
A < B
^
I

f Æ g 
g

C
Many \duality" theorems of mathemati s express the fa t that one ate-
gory is (a sub ategory of) the opposite of another. An example of this sort
whi h we'll prove later is that Sets is dual to the ategory of omplete,
atomi Boolean algebras.
3. The arrow ategory C! of a ategory C has the arrows of C as obje ts,
and an arrow g from f : A ! B to f 0 : A0 ! B 0 in C! is a \ ommutative
square":

g1 > 0
A A

f f0
_ _
B > B0
g2
where g1 and g2 are arrows in C. That is, su h an arrow is a pair of arrows
g = (g1 ; g2) in C su h that
g2 Æ f = f 0 Æ g1 :

The identity arrow 1f on an obje t f : A ! B is the pair (1A ; 1B ).


Composition of arrows is done omponentwise:
(h1 ; h2 ) Æ (g1 ; g2 ) = (h1 Æ g1; h2 Æ g2 ):
The reader should verify that this works out by drawing the appropriate
ommutative diagram.
Observe that there are two fun tors:
dom od >
C< C! D

4. The sli e ategory C=C of a ategory C over an obje t C 2 C has:


 obje ts: all arrows f 2 C su h that od(f ) = C ,

Draft of February 5, 2003


14 Categories

 arrows: g from f : X ! C to f 0 : X 0 ! C is an arrow g : X ! X 0 in


C su h that f 0 Æ g = f , as indi ated in:
g
X > X0

f f0
R
C
We leave it to the reader to work out the identity arrows and omposites.
There's an obvious fun tor U : C=C ! C that \forgets about C ". Can
you nd a fun tor F : C=C ! C! su h that dom ÆF = U ?
If P is a poset ategory and p 2 P, then
P=p 
= # (p) ;
the sli e ategory P=p is just the \prin iple ideal" # (p) of elements q 2 P
with q  p. We'll have more examples of sli e ategories soon.
The o-sli e ategory C=C of a ategory C under an obje t C of C has
as obje ts all arrows f of C su h that dom(f ) = C , and an arrow from
f : C ! X to f 0 : C ! X 0 is an arrow h : X ! X 0 su h that h Æ f = f 0 .
The reader should now arry out the rest of the de nition of the o-sli e
ategory by analogy with the de nition of the sli e ategory.
How an the osli e ategory be de ned in terms of the sli e ategory and
the opposite onstru tion?

Example 1.7. The ategory Sets of pointed sets onsists of sets A with a distin-
guished element a 2 A, and arrows f : (A; a) ! (B; b) are fun tions f : A ! B
that preserves the \points", f (a) = b. This is isomorphi to the osli e ategory,
Sets 
= 1nSets
of Sets \under" any singleton 1 = fg. Indeed, fun tions a : 1 ! A orrespond
uniquely to elements, a() = a 2 A, and arrows f : (A; a) ! (B; b) orrespond
exa tly to ommutative triangles:
a
1 > A

b
f
R _
B
Draft of February 5, 2003
1.7 Free ategories 15

1.7 Free ategories


Free monoid. Start with an \alphabet" A of \letters" (a set)
A = fa; b; ; : : : g:
A word over A is a nite sequen e of letters:
thisword; ategoriesarefun; asddjbnzzfj; : : :
We write \-" for the empty word. The \Kleene losure" of A is de ned to be
the set
A = fwords over Ag:
De ne a binary operation \" on A de ned for w; w0 2 A by w  w0 = ww0 .
Thus, \" is just on atenation. The operation \" is asso iative, and the empty
word \-" is a unit. Thus, A is a monoid { alled the free monoid on the set A.
The elements a 2 A an be regarded as words of length one, so we have a
fun tion
i : A ! A
de ned by i(a) = a, and alled the \insertion of generators". The elements of
A \generate" the free monoid, in the sense that every w 2 A is a -produ t of
a's.
Now what does \free" mean here? Any guesses?
One sometimes sees de nitions in \baby algebra" books along the following
lines:
A monoid M is free on a subset A of M if the following onditions hold.
1. Every element e 2 M an be written as a produ t of elements of A:
e = a 1  M : : :  M an ; ai 2 A :
2. No \non-trivial" relations hold in M , that is, if a1 : : : aj = a01 : : : a0k , then
this is required by the axioms for monoids.
The rst ondition is sometimes alled \no junk", while the se ond ondition
is sometimes alled \no noise". Thus, the free monoid on A is a monoid ontain-
ing A and having no junk and no noise. What do you think of this de nition of
a free monoid?
I would obje t to the referen e in the se ond ondition to \provability", or
something. This must be made more pre ise for this to su eed as a de nition.
In ategory theory, we give a pre ise de nition of \free" | apturing what is
meant in the above | whi h avoids su h vagueness.
First, every monoid N has an underlying set jN j, and every monoid homo-
morphism f : N ! M has an underlying fun tion jf j : jN j ! jM j. It is easy to

Draft of February 5, 2003


16 Categories

see that this is a fun tor, alled the \forgetful fun tor". The free monoid M (A)
on a set A is by de nition \the" monoid with the following so alled universal
mapping property, or UMP!
Universal Mapping Property of M (A)
There's a fun tion i : A ! jM (A)j, and given any monoid N and any fun tion
f : A ! jN j, there's a unique monoid homomorphism f : M (A) ! N su h that
jfj Æ i = f , all as indi ated in the following diagram:
in Mon:
f
M (A) ................. N
in Sets:

jM (A)j jf j > jN j

^

i
f
A

Proposition 1.8. (A ; ) has the UMP of the free monoid on A.
Proof. Given f : A ! jN j, de ne f : M (A) ! N by
f( ) = uN ; the unit of N

f(a1 : : : ai ) = f (a1 ) N : : : N f (ai ):


Then f is learly a homomorphism with
f(a) = f (a) for all a 2 A.
If g : M (A) ! N also satis es g(a) = f (a) for all a 2 A, then for all a1 : : : ai 2
A :
g(a1 : : : ai ) = g(a1 ) N : : : N g(ai )
= f (a1 ) N : : : N f (ai )
= f(a1 ) : : : f(ai )
= f(a1 : : : ai )
So, g = f, as required.
Think about why the above UMP aptures pre isely what is meant by \no
junk" and \no noise". We'll show later on that it hara terizes the free monoid
M (A) uniquely up to isomorphism.
Draft of February 5, 2003
1.7 Free ategories 17

Free ategory. Now, we want to do the same thing for ategories in gen-
eral (not just monoids). Instead of underlying sets, ategories have underlying
graphs, so let's review these rst.
A dire ted graph onsists of verti es and edges, ea h of whi h is dire ted, i.e.
ea h edge has a \sour e" and a \target" vertex.
z
A >B
^ ^

u
x y
R
C D
We draw graphs just like ategories, but there is no omposition of edges, and
there are no identities.
A graph thus onsists of two sets, E (edges) and V (verti es), and two
fun tions, s : E ! V (sour e) and t : E ! V (target).
Now, every graph G \generates" a ategory C(G), the free ategory on G. It
is de ned by taking the verti es of G as obje ts, and the paths in G as arrows,
where a path is a nite sequen e of edges e1 ; : : : ; en su h that t(ei ) = s(ei+1 ),
for all i = 1 : : : n. We'll write the arrows of C(G) in the form en en 1 : : : e1 .
Put
dom(en : : : e1 ) = s(e1 );

od(en : : : e1 ) = t(en );
and de ne omposition by on atenation:
en : : : e1 Æ e0m : : : e01 = en : : : e1 e0m : : : e01 :
For ea h vertex v, we have an \empty path" denoted 1v , whi h is to be the
identity arrow at v.
Note that if G has only one vertex, then C(G) is just the free monoid on the
set of edges of G. Also note that if G has only verti es (no edges), then C(G)
is the dis rete ategory on the set of verti es of G.
Later on, we'll have a general de nition of \free". For now, let us see that
C(G) has a universal mapping property.
First, de ne a \forgetful fun tor"
U : Cat ! Graphs
in the obvious way: the underlying graph of a ategory C as has edges the
obje ts of C, and as verti es the arrows, with s = dom and t = od. The a tion
of U on fun tors is equally lear, or at least it will be, on e we have de ned the
arrows in Graphs.

Draft of February 5, 2003


18 Categories

A homomorphism of graphs is of ourse a \fun tor without the onditions


on identities and omposition", i.e. a mapping of edges to edges and verti es to
verti es that preserves sour es and targets. We'll des ribe this from a slightly
di erent point of view, that will be useful later on. First, observe that we an
des ribe a ategory C with a diagram like this:
od
C2
Æ >C < i >C
1 0
>
dom
where C0 is the olle tion of obje ts of C, C1 the arrows, and C2 is the olle tion
f(f; g) 2 C1  C1 : od(f ) = dom(g)g.
Then a fun tor F : C ! D from C to another ategory D is a pair of
fun tions
F0 : C0 ! D0
F1 : C1 ! D1
su h that ea h square in the following diagram ommutes:
od >
C2
Æ > C1 < i C0
>
dom
F2 F1 F0
_ _ od > _
D2 > D1 < i D0
Æ >
dom
where F2 (f; g) = (F1 (f ); F1 (g)).
Now let us des ribe a homomorphism of graphs,
h:G!H:
We need a pair of fun tions h0 : G0 ! H0 , h1 : G1 ! H1 making the two
squares (on e with t's, on e with s's in the following diagram ommute:
t >
G1 > G0
s
h1 h0
_ t > _
H1 > H0
s
In these terms, we an easily des ribe the forgetful fun tor,
U : Cat ! Graphs
Draft of February 5, 2003
1.8 Foundations: large, small, and lo ally small 19

as sending the ategory:


od >
C2
Æ > C1 < i C0
>
dom
to the underlying graph:
od >
C1 > C0
dom
And similarly for fun tors, the e e t of U is des ribed by erasing some parts of
the diagrams (whi h is easier to demonstrate with halk!).
The free ategory on a graph has the following UMP:
Universal Mapping Property of C(G)
There is a graph homomorphism i : G ! jC(G)j, and given any ategory D and
any graph homomorphism h : G ! jDj, there is a unique fun tor h : C(G) ! D
with jh j Æ i = h.
in Cat:
h
C(G)) ................ D
in Graph:

jC(G)j jhj > jDj



^

i
h
G

1.8 Foundations: large, small, and lo ally small


Let us begin by distinguishing between:
ategori al foundations for mathemati s,
and:
mathemati al foundations for ategory theory.
As for the rst: one o asionally hears it said that ategory theory an be
used to provide foundations for mathemati s, as an alternative to set theory.
That is in fa t the ase, but it is not what we are up to here. In set theory,
one often begins with axioms and derives theorems, building up a universe
of mathemati al obje ts (namely sets), whi h in prin iple suÆ es for \all of

Draft of February 5, 2003


20 Categories

mathemati s". Don't get the idea that our pro edure here is similar, but with
ategories (or something) instead of sets. Our axiom that every arrow has a
domain and a odomain is not to be understood in the same way as set theory's
axiom that every set has a power set! The di eren e is that in set theory|
at least as usually on eived|the axioms are to be regarded as referring to
(or determining) a single universe of sets. In ategory theory, by ontrast, the
axioms are a de nition of something, namely of ategories. This is just like in
group theory or topology, where the axioms serve to de ne the obje ts under
investigation. These, in turn, are assumed to exist in some \ba kground" or
\foundational" system.
This brings us to the se ond point: we assume that our ategories are om-
prised of sets and fun tions, in one way or another, like most mathemati al
obje ts and modulo the remarks just made about the possibility of ategori al
foundations. But in ategory theory, we often run into diÆ ulties with set the-
ory as usually pra ti ed. Mostly these are questions of size; some ategories are
\too big" to be handled omfortably in onventional set theory. For example,
if we require that every ategory have a set of obje ts and a set of arrows, then
the \ ategory" Sets will fail to be a ategory, as will many other ategories that
we de nitely want to study.
There are various formal devi es for addressing these issues, and they are dis-
ussed in Ma Lane. For our purposes, at least for now, the following distin tion
suÆ es:
De nition 1.9. A ategory C is alled small if the olle tion C0 of obje ts of
C and the olle tion C1 of arrows of C are both sets. Otherwise, C is alled
large.
For example, all nite ategories are learly small, as is the ategory Sets n
of nite sets and fun tions. On the other hand, the ategory Pos of posets, the
ategory Groups of groups, and the ategory Sets of sets are all large. We let
Cat be the ategory of all small ategories, whi h itself is a large ategory. In
parti ular, then, Cat is not an obje t of itself, whi h may ome as a relief to
some of you.
This doesn't really solve all of our diÆ ulties; for if we assume large ate-
gories to always have at most a lass of obje ts and arrows, then already e.g.
the ategory of all fun tors from Groups to Sets (we'll de ne this \fun tor at-
egory" later) will not exists (too large), nor will many other natural examples.
So one needs a more elaborate theory of lasses, or something. We won't worry
about this; however, one very useful notion in this onne tion is the following:
De nition 1.10. A ategory C is alled lo ally small if for any obje ts X , Y
in C, the olle tion homC (X; Y ) = ff 2 C1 j f : X ! Y g is a set ( alled a
hom-set ).
Many of the large ategories we want to onsider are in fa t lo ally small.
Sets is lo ally small sin e homSets (X; Y ) = Y X , the set of all fun tions from
X to Y . Similarly, Pos, Top, and Groups are all lo ally small, and, of ourse,
any small ategory is lo ally small.

Draft of February 5, 2003


1.9 Exer ises 21

Warning 1.11. Don't onfuse small and on rete. To say that a ategory is
on rete is to say that the obje ts of the ategory are (stru tured) sets and the
arrows of the ategory are ( ertain) fun tions. To say that a ategory is small
is to say that the olle tion of all obje ts of the ategory is a set, as is the
olle tion of all arrows.
The set of real numbers, regarded as a poset ategory, is small but not
on rete. The ategory of posets is on rete but not small.

1.9 Exer ises


1. The obje ts of Rel are sets, and an arrow f : A ! B is a relation from A
to B , i.e. f  A  B . The identity relation fha; ai 2 A  Aj a 2 Ag is the
identity arrow on a set A. Composition in Rel is to be given by:
g Æ f = fha; i 2 A  C j 9b (ha; bi 2 f & hb; i 2 g)g
for f  A  B and g  B  C .
Show that Rel is a ategory.
2. Consider the following isomorphisms of ategories and determine whi h
hold.
(a) Rel = Relop
(b) Sets = Setsop
( ) For a set X with powerset P (X ), P (X ) 
= P (X )op (as poset ate-
gories)
3. (a) Show that in Sets, the isomorphisms are exa tly the bije tions.
(b) Show that in Monoids, the isomorphisms are exa tly the bije tive
homomorphisms.
( ) Show that in Posets, the isomorphisms are not the same as the
bije tive homomorphisms.
4. Constru t the \ o-sli e ategory" C=C of a ategory C under an obje ts
C from the sli e ategory C=C and the \dual ategory" operation op .
5. Show that every small ategory is isomorphi to a on rete one. (Hint:
Use the Cayley representation.)
6. Des ribe the free ategories on the following graphs:
(a)
e
a >b

Draft of February 5, 2003


22 Categories

(b)
e >b
a<
f
( )
e
a >b

g
f
R _

7. How many free ategories on graphs are there whi h have exa tly six
arrows? Draw the graphs that generate these ategories.
8. Show that the free monoid fun tor
M : Sets ! Mon
exists, by de ning its e e t
M (f ) : M (A) ! M (B )
on a fun tion f : A ! B to be
M (f )(a1 : : : ak ) = f (a1 ) : : : f (ak ); a1 ; : : : a k 2 A

9. Prove the UMP for free ategories on graphs:


Let C(G) be the free ategory on the graph G, and i : G ! U (C(G)) the
graph homomorphism taking verti es and edges to themselves, regarded
as obje ts and arrows in C(G). For any ategory D and graph homomor-
phism f : G ! U (D), there is a unique fun tor:
h : C(G) ! D
with:
U (h ) Æ i = h;
where U : Cat ! Graph is the underlying graph fun tor.

Draft of February 5, 2003


Chapter 2

Spe ial obje ts and arrows


Let me begin with some remarks about ategory-theoreti al de nitions. By this
I mean hara terizations of properties of obje ts and arrows in a ategory in
terms of other obje ts and arrows only, i.e. in the language of ategory theory.
Su h de nitions may be said to be abstra t, stru tural, operational, or external
(as opposed to internal). The idea is that obje ts and arrows are determined
by the role they play in the ategory, by their relations to other obje ts and
arrows, and not by what they \are", in the sense of some ba kground theory.
We'll see many more examples of this kind of thing later, for now we start with
some very simple ones. Let me all them abstra t hara terizations. We'll see
that one of the basi ways of giving su h abstra t hara terizations is via an
UMP.

2.1 Epis and monos


In Sets, a fun tion f : A ! B is alled:
inje tive if 8a; a0 2 A(a 6= a0 ) f (a) 6= f (a0 ))
surje tive if 8b 2 B 9a 2 A(f (a) = b)
We have the following abstra t hara terization of these properties:
De nition 2.1. In any ategory C, an arrow
f :A!B
is alled a:
monomorphism if given any g; h : C ! A, fg = fh implies g = h,
g > f
C > A >B
h

Draft of February 5, 2003


24 Spe ial obje ts and arrows

epimorphism if given any i; j : B ! D, if = jf implies i = j ,


f i >D
A >B >
j
We write f : A  B if f is a monomorphism, and we write f : A  B if f is
an epimorphism.
Proposition 2.2. A fun tion f : A ! B is mono just in ase it is inje tive.
Proof. Suppose f : A  B . Let a; a0 2 A su h that a 6= a0 , and let fxg be some
singleton set. Consider the fun tions
a; a0 : fxg ! A ;
where
a(x) = a; a0 (x) = a0 :
Sin e a 6= a0 , it follows, sin e f is a monomorphism, that f a 6= f a0 . Thus,
f (a) = (f a)(x) 6= (f a0 )(x) = f (a0 ). When e f is inje tive.
Conversely, if f is inje tive and g; h : C ! A are fun tions su h that g 6= h,
then for some 2 C , g( ) 6= h( ). Sin e f is inje tive, it follows that f (g( )) 6=
f (h( )), when e fg 6= fh.
Example 2.3. In many ategories of \stru tured sets", the monos are exa tly
the \inje tive homomorphisms". This is so e.g. for groups, ve tor spa es, and
posets.
Example 2.4. In a xed poset P, every arrow p  q is a mono. Why?
While the epis in Sets are exa tly the surje tive fun tions (exer ise!), epis in
other other ategories are not always surje tive homomorphisms, as the following
example shows.
Example 2.5. In the ategory Mon of monoids and monoid homomorphisms,
there is a moni homomorphism
N Z
where N is the additive monoid (N; +; 0) of natural numbers, and Z is the
additive monoid (Z; +; 0) if integers. We'll show that this map, given by the
in lusion N  Z of sets, is also epi in Mon by showing that the following holds:
Given any monoid homomorphisms
f; g : (Z; +; 0) ! (M; ; u) ;
if f jN = g jN , then f = g.
Note rst that:
f ( n) = f (( 1)1 + ( 1)2 + : : : + ( 1)n )
= f ( 1)1  f ( 1)2  : : :  f ( 1)n

Draft of February 5, 2003


2.2 Initial and terminal obje ts 25

and similarly for g. It therefore suÆ es to show that f ( 1) = g( 1). But


f ( 1) = f ( 1)  u
= f ( 1)  g(0)
= f ( 1)  g(1 1)
= f ( 1)  g(1)  g( 1)
= f ( 1)  f (1)  g( 1)
= f ( 1 + 1)  g( 1)
= f (0)  g( 1)
= u  g( 1)
= g( 1):
Remark 2.6. A morphism e is epi if and only if e \ an els on the right": xe =
ye ) x = y. Dually, m is mono if and only if m \ an els on the left": mx =
my ) x = y.
Proposition 2.7. Every iso is mono and epi.
Proof. Consider the following diagram:
x >B m >
A > C
y

1
e
R _
>E
D >
If m is an isomorphism with inverse e, then mx = my implies x = emx =
emy = y. Thus, m is moni . Similarly, e an els on the right, and thus e is
epi .
Moreover, in Sets the onverse holds: every mono-epi is iso. But this is not
in general true ( f. the example of monoids above). We'll return to this later.

2.2 Initial and terminal obje ts


We now onsider abstra t hara terizations of the empty set and the singleton
sets in the the ategory Sets.
De nition 2.8. In any ategory C, an obje t
0 is initial if for any obje t C there is a unique morphism
0!C ;

Draft of February 5, 2003


26 Spe ial obje ts and arrows

1 is terminal if for any obje t C there is a unique morphism


C !1:
Remark 2.9. As in the ase of monos and epis, there's a kind of \duality" in
these de nitions. Pre isely, a terminal obje t in C is exa tly an initial obje t
in Cop . We'll onsider this systemati ally later.
Proposition 2.10. Initial (terminal) obje ts are unique up to isomorphism.
Proof. In fa t, if C and C 0 are both initial (terminal), then there is a unique
isomorphism C ! C 0 .
Suppose that 0 and 00 are both initial obje ts, the folloing diagram makes it
lear that 0 and 00 are uniquely isomorphi .

u > 00
0
  1
10 0
v 0

R _ R
0 > 00
u
For terminal obje ts, apply the foregoing to Cop.
The de nition of an initial (terminal) obje t is a parti ularly simple UMP.
Example 2.11. 1. In Sets the empty set is initial, and any singleton set is
terminal (observe that Sets has one initial obje t and many terminal
obje ts).
2. In Cat the ategory 0 (no obje ts and no arrows) is initial, and the ate-
gory 1 (one obje t and its identity arrow) is terminal.
3. In Groups, the one element group is both initial and terminal (similarly
for the ategory of ve tor spa es and linear transformations, as well as the
ategory of monoids and monoid homomorphisms).
4. In the ategory of Boolean algebras, the two element Boolean algebra is
initial, and the one element Boolean algebra is terminal.
5. In the ategory of rings, the ring of integers is an initial obje t.
6. In a poset, an obje t is initial i it is the least element, and terminal i it
is the greatest element. Clearly, a ategory need not have either an initial
obje t or a terminal obje t, e.g. the poset (Z; ) has neither an initial
obje t nor a terminal obje t.
7. For any ategory C and any X 2 C, 1X : X ! X is an initial obje t in
X=C and is a terminal obje t in C=X .

Draft of February 5, 2003


2.3 Elements 27

2.3 Elements
Let's onsider maps into and out of initial and terminal obje ts. Clearly only
ertain of these will be of interest.
For example, in the ategory BA of Boolean algebras, the maps p : B ! 2
(with 2 the initial Boolean algebra) orrespond uniquely to the \ultra lters"
P  B , via P = p 1 (>), and p(b) = > i b 2 P . (Re all that P  B is a lter
if p; q 2 P ) p ^ q 2 P and p 2 P ^ p  q ) q 2 P: It's alled an ultra lter if it
is maximal without ? 2 P .)
For any set X , we have an isomorphism
X
= f1 ! X g = Sets(1; X )
(just take x() = x, for 1 = fg.
De nition 2.12. In any ategory with a terminal obje t, su h arrows
1!A
are alled global elements, or points, or onstants, or onstant elements of type
A.
Example 2.13. In Top and Pos, the elements of the underlying set jX j orre-
spond exa tly to arrows 1 ! X in the ategory. So we an re over the set from
the \points".
But be areful! In Mon, Grp, et ., how many points are there for some M ?
That is, how many arrows of the form
1!M
are there in su h ategories for a given obje t M ? Just one! Why? (Hint:
homomorphisms must preserve the unit.)
For su h ases as these, and quite generally, it's onvenient to introdu e the
devi e of generalized elements. These are arbitrary arrows
x:X!A
(any domain X ), whi h are regarded as generalized (or variable) elements, or
x f
terms of type A. We then have fx : X ! A! B for any f : A ! B .
Example 2.14. 1. Consider f; g : X ! Y in Pos: f = g i for all x : 1 ! X ,
(fx = gx). Thus, \posets have enough points" (to separate maps).
2. But in Mon, h; j : M ! N always have hx = jx for all x : 1 ! M (there's
just one su h point). So, \monoids don't have enough points".
3. But in any ategory C, and for any arrows f; g : C ! C 0 , we have f = g i
for all x : D ! C , (fx = gx). Thus, \any obje t has enough generalized
elements." (Why?)

Draft of February 5, 2003


28 Spe ial obje ts and arrows

In the de nition of monomorphism, for example, onsider


x > f
X > A >B
x0
The arrow f is moni i x 6= x0 ) f (x) 6= f (x0 ), i.e. i f is \inje tive on
generalized elements".
Similarly, in any ategory C, given a square whi h might ommute:
f
A >B

g
_ _
D > C

we have f = g i fx = gx for all generalized elements x : X ! A (just
take x = 1A : A ! A).
Example 2.15. Generalized elements an be used to reveal more stru ture than
do \ onstant elements", for example, on epi-monos. Consider the following
posets X and A, regarded as stru tured sets.
X = fx  y; x  z g;
A = fa  b  g
There is an order-preserving bije tion f : X ! A de ned by:
fx = a; fy = b; fz = :
It's easy to see that f is both moni and epi in the ategory Pos, but it's
learly not an iso.
One would like to say that X and A are \di erent stru tures", and their
being non-isomorphi says just this. But now, how to prove that they're not
isomorphi ? In general, this an be diÆ ult!
One way is to use \invariants", de ned in terms of generalized elements.
The onstant or global elements of X and A are the same, namely the three
elements of the sets. But onsider the 2-elements of ea h: X has 5 su h, and A
has 6. Sin e these numbers are invariants, the posets annot be isomorphi .
Indeed, we an de ne for any poset P the invariant
j hom(2; P )j
then if P 
= Q, it's easy to see
j hom(2; P )j = j hom(2; Q)j;
Draft of February 5, 2003
2.4 Splits 29

sin e the iso:


f >Q
P<
g
gives an iso:
f >
hom(2; P ) < hom(2; Q)
g
by omposition:
f (h) = fh

g(k) = gk;
for all h : 2 ! P and k : 2 ! Q.

2.4 Splits
We already noted that any iso is both moni and epi . More generally, if an
arrow
f :A!B
has a left inverse
g : B ! A; gf = 1A
then f must be mono and g epi, by a homework problem this week.
De nition 2.16. A split mono (epi) is an arrow with a left (right) inverse.
Terminology : Given arrows e : X ! A and s : A ! X su h that es = 1A , then
s is alled a se tion or splitting of e, and e is alled a retra tion of s. The obje t
A is alled a retra t of X .
Remark 2.17. Sin e fun tors preserve identities, they also preserve split epis and
split monos. Compare the example above in Mon where the forgetful fun tor
Mon ! Set
did not preserve the epi N ! Z.
Example 2.18. In Sets, every mono splits ex ept those of the form
;  A:
The ondition that every epi splits is the ategori al version of the axiom of
hoi e. Indeed, onsider an epi:
e:E X
Draft of February 5, 2003
30 Spe ial obje ts and arrows

We have the family of non-empty sets


Ex = e 1 fxg; x 2 X:
A splitting of e is exa tly a hoi e fun tion for this family (Ex )x2X , i.e. a fun tion
s : X ! E su h that es = 1X , sin e this means that s(x) 2 Ex for all x 2 X .
Conversely, given a family of non-empty sets,
(Ex )x2X
S
take E = x2X f(x; y) j y 2 Ex g and de ne the epi e : E  X by (x; y) 7! x. A
hoi e fun tion s for this family then determines a splitting of e.

2.5 Exer ises


1. Show that a fun tion between sets is surje tive if it is an epimorphism in
Sets.
2. (Inverses are unique) If an arrow f : A ! B has inverses g; g0 : B ! A (i.
e. g Æ f = 1A and f Æ g = 1B , and similarly for g0), then g = g0 .
3.
4. With regard to a ommutative triangle,
f
A >B

h
g
R _
C
in any ategory C, show:
(a) if f and g are isos (resp. monos, resp. epis), so is h;
(b) if h is moni , so is f ;
( ) if h is epi , so is g;
(d) (by example) if h is moni , g need not be.
5. Show that the following are equivalent for an arrow
f :A!B
in any ategory.
(a) f is an isomorphism;
(b) f is both a mono and a split epi;

Draft of February 5, 2003


2.5 Exer ises 31

( ) f is both a split mono and an epi;


(d) f is both a split mono and a split epi.
6. Show that a homomorphism h : G ! H of graphs is moni just if it is
inje tive on both edges and verti es.
7. Let A be a set. De ne an A-monoid to be a monoid M equipped with
a fun tion m : A ! U (M ) (to the underlying set of M ). A morphism
h : (M; m) ! (N; n) of A-monoids is to be a monoid homomorphism
h : M ! N su h that U (h) Æ m = n (a ommutative triangle). Together
with the evident identities and omposites, this de nes a ategory A Mon
of A-monoids.
Show that an initial obje t in A Mon is the same thing as a free monoid
M (A) on A. (Hint: ompare their respe tive UMPs.)

Draft of February 5, 2003


32 Spe ial obje ts and arrows

Draft of February 5, 2003


Chapter 3

Finite limits
Next we're going to see the ategori al de nition of a produ t of two obje ts in a
ategory. This was rst given by Ma Lane in 1950, and it's probably the earliest
example of ategory theory being used to de ne a fundemental mathemati al
notion.
By \de ne" here I mean an abstra t hara terization, in the sense already
used, in terms of obje ts and arrows in a ategory. And as before, we do this
by giving a universal mapping property, whi h determines the stru ture at issue
up to isomorphism, as usual in ategory theory. Later in this se tion, we'll have
several other examples of su h hara terizations.

3.1 Produ ts
Let's begin by onsidering produ ts of sets. Given sets A and B the artesian
produ t of A and B is the set of ordered pairs:

A  B = f(a; b) j a 2 A ^ b 2 Bg
Observe that there are \ oordinate proje tions":
1 2 >
A< AB B
with

1 (a; b) = a; 2 (a; b) = b:
And indeed, given any 2 A  B we have:

= (1 ; 2 ):
Draft of February 5, 2003
34 Finite limits

The situation is aptured on isely in the following diagram:


1.
...
... 
...  b
a ... (a;b) 
.... R
A< AB >B
1 2
Repla ing elements by generalized elements, we get the following de nition.
De nition 3.1. In any ategory C, a produ t diagram for the obje ts A and
B onsists of an obje t P and arrows

p1 p2 >
A< P B
satisfying the following UMP:
Given any diagram of the form:
x1 x2 >
A< X B
there exists a unique u : X ! P , making the diagram:

X
 x
x1 u 2
_ R
A< P > B
p1 p2
ommute, i.e. su h that x1 = p1 u and x2 = p2 u.
Remark 3.2. As in other UMPs, there are two parts
Existen e: There is some u : X ! U su h that x1 = p1 u and x2 = p2 u.
Uniqueness: Given any v : X ! U with x1 = p1 v and x2 = p2 v, then v = u.
Proposition 3.3. Produ ts are unique up to isomorphism.
Suppose
p1 p2 >
A< P B
and
q1 q2
A< Q >B

Draft of February 5, 2003


3.2 Examples 35

are produ ts of A and B . Then there is a unique i : P ! Q su h that


q1 Æ i = p1 and q2 Æ i = p2 . Similarly, there is a unique j : Q ! P su h that
p1 Æ j = q1 and p2 Æ j = q2 . Thus, p1 Æ j Æ i = p1 and p2 Æ j Æ i = p2 . Sin e
p1 Æ 1P = p1 and p2 Æ 1P = p2 , it follows from the uniqueness ondition that
j Æ i = 1P . Similarly, i Æ j = 1Q . Thus, i : P ! Q is an isomorphism.
If A and B have a produ t, we write
p1 p2 >
A< AB B
for one su h produ t. Then given X; x1 ; x2 as in the de nition, we write
hx1 ; x2 i for u : X ! A  B:
Note, however, that a pair of obje ts may have many di erent produ ts in a
ategory. For example, given a produ t A  B; p1 ; p2 , and any iso h : A  B ! Q,
the diagram Q; p1 Æ h; p2 Æ h is also a produ t of A and B .
Note that an arrow into a produ t
f :X !AB
is \the same thing" as a pair of arrows
f1 : X ! A; f2 : X ! B:
So we an essentially forget about su h arrows.
But if a ategory has su h produ ts, there is something to be said about
them, namely onsider arrows out of the produ t
g :AB !Y
Su h a g is a \fun tion in two variables" and is not redu ible to a pair of
fun tions, or something else more basi (and gives rise to the on ept of an
exponential Y B , via \ urrying").

3.2 Examples
Example 3.4. We have already had artesian produ ts of sets. Note that if we
hoose a di erent de nition of ordered pairs we get di erent sets
A  B and A 0 B
ea h of whi h is (part of) a produ t and so are isomorphi . E. g. we ould set
ha; bi = ffag; fa; bgg

ha; bi0 = ha; ha; bii


Draft of February 5, 2003
36 Finite limits

Example 3.5. Produ ts of \stru tured sets" (like monoids or groups) are often
produ ts of the underlying sets with omponentwise operations:
If G and H are groups, G  H an be onstru ted by taking the underlying
set of G  H to be the set fhg; hi j g 2 G ^ h 2 H g and de ning the binary
operation by
hg; hi  hg0 ; h0 i = hg  g0 ; h  h0 i
the unit by
u = huG ; uH i
and inverses by
ha; bi 1 = ha 1 ; b 1 i:
The proje tion homomorphisms GH ! G (or H ) are the evident ones hg; hi 7!
g (or h).
Example 3.6. Similarly, for ategories C and D, we already de ned the ategory
of pairs of obje ts and arrows
C  D:
Together with the evident proje tion fun tors, this is indeed a produ t in Cat
(when C and D are small).
Example 3.7. Let P be a poset and onsider a produ t of elements p; q 2 P .
We must have
pq p

pq q
and if any
x  p; and x  q
then
xpq :
Question: What is p  q ?
Answer: The greatest lower bound: p  q = p ^ q.
Example 3.8. Let's show that the produ t of two topologi al spa es X; Y is a
produ t in Top.
X p1 X  Y p!
2
Y
Re all that O(X  Y ) is generated by basi open sets of the form U  V where
U 2 O(X ); V 2 O(Y ): so every W 2 O(X  Y ) is a union of su h basi opens.
Draft of February 5, 2003
3.2 Examples 37

 Clearly p1 is ontinuous, sin e p1 1 U = U  1Y .


 Given any ontinuous f1 : Z ! X; f2 : Z ! Y; let f : Z ! X  Y be the
fun tion f = hf1 ; f2 i. We just need to see that f is ontinuous.
 S S
Given any W = i (Ui  Vi ) 2 O(X  Y ), f 1(W ) = i f 1 (Ui  Vi ), so
it suÆ es to show f 1(U  V ) is open. But
f 1 (U  V ) = f 1((U  1Y ) \ (1X  V ))
= f 1(U  1Y ) \ f 1 (1X  V )
= f 1 Æ p1 1 (U ) \ f 1 Æ p2 1 (V )
= (f1 ) 1 (U ) \ (f2 ) 1 (V )
where (f1 ) 1 (U ) and (f2 ) 1 (V ) are open, sin e f1 and f2 are ontinuous.
The following diagram on isely aptures the situation at hand:

O(Z )
^....
f1 1  ...  I
... f 1 f2 1
...
... 
O(X ) 1> O(X  Y ) < 1 O(Y )
p1 p2
Example 3.9. Consider the ategory of types of the (simply-typed) - al ulus.
Re all that the - al ulus onsists of:
 Types: A  B; A ! B; : : : (and some basi types)
 Terms: x; y; z; : : : : A (variables for ea h type A)
a : A; b : B; : : : (possibly some typed onstants)

ha; bi : A  B (a : A; b : B )
fst( ) : A ( : A  B )
snd( ) : B ( : A  B )
a : B ( : A ! B; a : A)
x:b : A ! B (x : A; b : B )
 Equations:
fst(ha; bi) = a
snd(ha; bi) = b
hfst( ); snd( )i) =
(x:b)a = b[a=x℄
x: x = (no x in )

Draft of February 5, 2003


38 Finite limits

The relation a  b (usually alled -equivalen e ) on terms is de ned to be


the equivalen e relation generated by the equations, and renaming of bound
variables:
x:b = y:b[y=x℄ (no y in b)
The ategory of types C() is now de ned as follows:
 obje ts: the types,
 arrows A ! B : losed terms : A ! B , identi ed if  0 ,
 identities: 1A = x:x (where x : A),
 omposition: Æ b = x: (bx).
Let's he k that this is a well-de ned ategory:
Unit laws:
Æ 1B = x( ((y:y)x)) = x( x) =
1C Æ = x((y:y)( x)) = x( x) =
Asso iativity:
Æ (b Æ a) = x( ((b Æ a)x))
= x( ((y(b(ay))x))
= x( (b(ax)))
= x(y( (by))(ax))
= x(( Æ b)(ax))
= ( Æ b) Æ a
This ategory has binary produ ts. Indeed, given types A and B , let:
p1 = z:fst(z ); p2 = z:snd(z ) (z : A  B )
And given a and b as in:
X.
...
... 
a ... (a; b
)b
...
_.
... R
A< AB >B
p1 p2
let:
(a; b) = x:hax; bxi

Draft of February 5, 2003


3.3 Categories with produ ts 39

Then:

p1 Æ (a; b) = x(p1 ((y:hay; byi)x))


= x(p1 hax; bxi)
= x(ax)
=a

Similarly, p2 Æ (a; b) = b.
Finally, if : X ! A  B also has:

p1 Æ = a; p2 Æ = b ;

then:

(a; b) = x:hax; bxi


= x:h(p1 Æ )x; (p2 Æ )xi
= x:h(y(p1 ( y)))x; (y(p2 ( y)))xi
= x:h(y((z:fst(z ))( y)))x; (y((z:snd(z ))( y)))xi
= x:hy(fst( y))x; y(snd( y))xi
= x:hfst( x); snd( x)i
= x:( x)
= :

3.3 Categories with produ ts


Let C be a ategory that has a produ t diagram for every pair of obje ts.
Suppose we have obje ts and arrows

p1 p2 > 0
A< A  A0 A

f f0
_ _
B< B  B0 > B0
q1 q2

with indi ated produ ts. Then we write

f  f 0 : A  A0 ! B  B 0
Draft of February 5, 2003
40 Finite limits

for f  f 0 = hf Æ p1 ; f 0 Æ p2 i. Thus, both squares in the following diagram


ommmute.
p p2 > 0
A < 1 A  A0 A
...
...
...
f ... f  f 0 f0
...
_ _. _
B< B  B0 > B0
q1 q2
In this way, if we hoose a produ t for ea h pair of obje ts, we get a fun tor
 : C  C ! C:
A ategory whi h has a produ t for every pair of obje ts is said to have
binary produ ts. We an also de ne ternary produ ts
ABC
with a similar UMP, and so on for any number of fa tors. It's lear, however,
that if a ategory has binary produ ts, then it has all nite produ ts with two
or more fa tors:
A  B  C = (A  B )  C
But also onsider:
A  (B  C )
How do we show that A  B is asso iative? Or is it? Indeed, we must have:
(A  B )  C 
= A  (B  C )
by the universal mapping property of ternary prode ts, but these obje ts need
not be identi al.
Observe that a terminal obje t is a \nullary" produ t (a produ t of no
obje ts):
Given no obje ts, there's an obje t 1 with no maps, and given any other obje t
X and no maps, there is a unique arrow
!:X!1
making nothing further ommute.
Similarly, any obje t A is A1 , the unary produ t of A with itself, and
1 = A0 :
De nition 3.10. A ategory is said to have all nite produ ts if it has a ter-
minal obje t and all binary produ ts.

Draft of February 5, 2003


3.4 Hom-sets 41

3.4 Hom-sets
Remark 3.11. In this subse tion, assume that all ategories are lo ally small.
Re all that in any ategory C, given obje ts A; B ,
hom(A; B ) = ff : A ! B j f 2 Cg:
Note that any arrow g : B ! B 0 in C indu es a fun tion
hom(A; g) : hom(A; B ) ! hom(A; B 0 )

(f : A ! B ) 7! (g Æ f : A ! B ! B 0 )
Thus hom(A; g) = g Æ f , one sometimes writes hom(A; g) = g .
Indeed, let us show that
hom(A; ) : C ! Sets
is a fun tor; alled the ( ovariant) representable fun tor of A.
We need to show that:
hom(A; 1X ) = 1hom(A;X )
and
hom(A; g Æ f ) = hom(A; g) Æ hom(A; f ) :
Taking an argument x : A ! X , we learly have
hom(A; 1X )(x) = 1X Æ x = x = 1hom(A;X ) (x)
and
hom(A; g Æ f )(x) = (g Æ f ) Æ x =

g Æ (f Æ x) = (hom(A; g) Æ hom(A; f ))(x):


We'll study su h representable fun tors mu h more arefully later in the ourse.
Now I just want to show you how one an use hom-sets to give another de nition
of produ ts.
An obje t P with arrows p1 : P ! A and p2 : P ! B is an element of the
set
hom(P; A)  hom(P; B ):
And similarly for any set X in pla e of P . Now, given any arrow
x : X ! P;
Draft of February 5, 2003
42 Finite limits

omposing with p1 and p2 gives arrows x1 = p1 Æ x : X ! A and x2 = p2 Æ x :


X ! B.

X
 x
x1 x 2
_ R
A< P > B
p1 p2
So we have a fun tion
hhom(X; p); hom(X; q)i : hom(X; P ) ! hom(X; A)  hom(X; B ) (3.1)

x7 ! hx1 ; x2 i
Proposition 3.12. A diagram
A p1 P !
p2
B
is a produ t for A and B i for every X 2 C, the fun tion (3.1) is an isomor-
phism,
hom(X; P ) 
= hom(X; A)  hom(X; B )
Proof. Examine the universal mapping property.
De nition 3.13. Let C, D be ategories with binary produ ts. A fun tor
F : C ! D is said to preserve produ ts if it take every produ t diagram:
A p1 A  B p!
2
B in C
to a produ t diagram:
F A F p1 F (A  B ) F!
p2
F B in D:
It follows that F preserves produ ts i
F (A  B ) 
= F A  F B ( anoni ally);
i.e. i the anoni al map
hF p1 ; F p2i : F (A  B ) ! F A  F B
is an iso.
For example, the fun tor U : Mon ! Sets preserves produ ts.

Draft of February 5, 2003


3.5 Duality 43

Corollary 3.14. For any obje t X in a ategory C with produ ts, the ovariant
representable fun tor
homC (X; ) : C ! Sets
preserves produ ts.
Proof. For any A; B 2 C, by the foregoing proposition:
homC (X; A  B ) 
= homC (X; A)  homC (X; B )

3.5 Duality
We've seen a few examples of de nitions and statements whi h exhibit a kind of
\duality", like initial/terminal obje t and epi/mono. We now want to onsider
this duality more systemati ally.
First, let's look again at the de nition of a ategory:
There are obje ts A; B; C; : : : , arrows f; g; h; : : : , and operations dom(f ), od(f ),
1A, g Æ f satisfying the axioms
f Æ 1dom(f ) = f; 1 od(f ) Æ f = f

dom(g Æ f ) = dom(f ); od(g Æ f ) = od(g)

h Æ (g Æ f ) = (h Æ g) Æ f
The operation \Æ" is only de ned where
dom(g) = od(f );
so this should prefa e ea h axiom where relevant.
Now, given any senten e  in the elementary language of ategory theory,
we an form the \dual statement"  by repla ing
g Æ f by f Æ g

od by dom

dom by od:
Suppose we have shown a statement  to entail one , then learly also
 `  . But now observe that the axioms for ategory theory are \self-dual",
in the sense that
CT = CT;

Draft of February 5, 2003


44 Finite limits

we therefore have the following duality prin iple :


if  ; then  :
Taking a more on eptual point of view, note that if  involves some di-
agram, then  involves the diagram obtained from it by reversing dire tion
and ompositions of arrows. Re alling the opposite ategory Cop of a ategory
C, we see that an interpretation of a statement  in C automati ally gives an
interpretation of  in Cop .
Now, sin e for every ategory C
(Cop )op = C (3.2)
the on eptual form of the duality prin iple results similarly:
C j= 

Cop j=  :
So if j=  then j= op , using (1).
Rather than talking about statements, we often also onsider the dual of a
property or de nition, like epimorphism. This dual property is arrived at by
reversing the order of omposition and the words \dom" and \ od". Equiva-
lently, it results from interpreting the original property in the opposite ate-
gory. (Warning : don't onfuse ategori al duality with logi al duality; we don't
hange any of the logi al onne tives, quanti ers, et ., but only the ategori al
operations of domain, odomain, and the order of omposition.)

3.6 Coprodu ts
Let's onsider the example of produ ts and see what the dual notion must be.
First, re all the de nition from last week:
De nition
z1 z2
3.15. A diagram A p1 P !
p2
B is a produ t of A and B if for any
A Z ! B there is a unique u : Z ! P with pi Æ u = zi , all as in
Z
 z
z1 u 2
_ R
A< P > B
p1 p2

Now what about the dual statement?

Draft of February 5, 2003


3.6 Coprodu ts 45

q1
A diagram A ! Q q2 B is a \dual-produ t " of A and B if for any A !
z1
Z z2 B
there is a unique u : Q ! Z with u Æ qi = zi , all as in:
Z
^
 I z
z1 u 2

A > Q< B
q1 q2
A tually, these are oprodu ts, the onvention is to use the pre x \ o-" to indi-
i1
ate the dual notion. We usually write A ! A + B i2 B for the oprodu t, and
[f; g℄ for u.
So a oprodu t of two obje ts is exa tly their produ t in the opposite ate-
gory. Of ourse, this immediatly gives lots of examples of oprodu ts. But what
about some more familiar ones?
Example 3.16. In Sets, the oprodu t A + B of two sets in their disjoint union
A + B = fha; 1i j a 2 Ag [ fhb; 2i j b 2 B g
with evident o-proje tions
i1(a) = ha; 1i; i2(b) = hb; 2i:
For given any f and g as in:
Z
^
 I g
f [f; g℄ 

A > A+B < B
i1 i2
we de ne
(f; g)(hx; Æi) = f (x) for Æ = 1
and
(f; g)(hx; Æi) = g(x) for Æ = 2
If also h Æ i1 = f and h Æ i2 = g, then for any hx; Æi 2 A + B , we must have
hhx; Æi = (f; g)hx; Æi:
as an be easily al ulated.

Draft of February 5, 2003


46 Finite limits

Note that in Sets, every nite set A is a oprodu t:


A= 1 + 1 + : : : + 1 (n-times)
for n = ard(A): In parti ular, we often write
2=1+1
for (any) two-element set.
Example 3.17. If M (A) and M (B ) are free monoids on sets A and B , then in
Mon
M (A) + M (B )  = M (A + B ):
One sees this dire tly by onsidering words over A + B , but more generally by
using the diagram
N
^
 I


M (A) > M (A + B ) < M (B )
The UMP of M (A); M (B ); M (A + B ) implies that the latter has the required
UMP of M (A) + M (B ).
Example 3.18. In Top the oprodu t of two spa es
X +Y
is their disjoint union with the topology. O(X + Y ) = O(X )  O(Y ). Note that
= 2X +Y 
P (X ) = 2X , so P (X + Y )  = 2X  2Y = P (X )  P (Y ).
Coprodu ts of posets are similarly onstru ted from the oprodu ts of the
underlying sets.
Example 3.19. In a xed poset P , what is a oprodu t of two elements p; q 2 P ?
We have
pp+q

q p+q
and if
pz

qz
then
p + q  z:
So p + q = p _ q is the join, or least upper bound, of p and q.

Draft of February 5, 2003


3.6 Coprodu ts 47

Example 3.20. Sum types in the lambda- al ulus are oprodu ts in the ategory
of types de ned in example ??.
Example 3.21. Coprodu t of monoids (also works for groups
A; B have a oprodu t:
F (jAj + jB j)= 
where the free algebra F (jAj + jB j) is strings (words) over the set jAj + jB j { the
elements of A and B { and the equivalen e relation is the least one ontaining
the following equations:
uA = ( ) = uB

(x; : : : ; a; a0 ; : : : ) = (x; : : : ; a  a0 ; : : : )

(y; : : : ; b; b0; : : : ) = (y; : : : ; b  b0 ; : : : ):


Multipli ation in the quotient is as expe ted
[x; : : : ; y℄  [x0 ; : : : ; y0 ℄ = [x; : : : ; y; x0 ; : : : ; y0 ℄
the oprodu t inje tions are:
a 7! [a℄; b 7! [b℄
The reader should verify that this really does give a oprodu t in the ategory
of monoids.
In Groups, this is alled the free produ t.
Example 3.22. For abelian groups A; B , the free produ t need not be abelean.
For this ase, there is a more simple presentation, however. Sin e any word
must have:
(a1 b1 b2 a2 : : : )  (a1 a2 : : : b1 b2 : : : )
we an take
A+B =AB
with in lusions
i : A ! A + B; i(a) = ha; uB i

j : B ! A + B; j (b) = huA ; bi:


f
Then given A ! X g B; we let (f; g) : A + B ! X be
(f; g)ha; bi = f (a) X g(b);
whi h an be seen to do the tri k.

Draft of February 5, 2003


48 Finite limits

Example 3.23. Just as with produ ts, one an onsider the empty oprodu t,
whi h is an initial obje t 0, as well as oprodu ts of several fa tors, and the
oprodu t of two arrows
f + f 0 : A + A0 ! B + B 0 :
All of these onstru tions follows simply by duality, that is by onsidering
the dual notions in the opposite ategory. Similarly, we have the following
proposition.
Proposition 3.24. Coprodu ts are unique up to isomorphism.
Proof. Use duality, and the fa t that the dual of \isomorphism" is \isomor-
phism".
In just the same way, one shows
Proposition 3.25. (A + B ) + C 
= A + (B + C )
Thus, in the future, it will suÆ e to introdu e new notions, and then simply
observe that the dual notions have analogous (but dual) properties. The next
se tion gives another example of this sort.

3.7 Equalizers
In this se tion, we onsider another abstra t hara terization, this time a gen-
eralization of the idea of the kernel of a homomorphism.
De nition 3.26. In any ategory C, given parallel arrows
f >B
A >
g
an equalizer of f and g onsists of E and e : E ! A, unique su h that
f Æe=gÆe:
That is, given z : Z ! A with f Æ z = g Æ z there is a unique u : Z ! E with
e Æ u = z all as in:
e > f >B
E. A >
^... g
...
.
.

u .. .
... z
..
Z
Let's onsider some simple examples.

Draft of February 5, 2003


3.7 Equalizers 49

Example 3.27. In Sets, take fun tions:


f >B
A >
g
The equalizer is the anoni al in lusion
i : fa 2 Ajfa = gag ,! A
Sin e if fh(z ) = gh(z ) for any h : Z ! A, then h(z ) 2 fa 2 Ajfa = gag for all
z 2 Z , when e 9h : Z ! fa 2 Ajfa = gag su h that i Æ h = h. Observe that h
is ne essarily unique, sin e i is mono.
Example 3.28. Note that every subset U  A is of this form. Let's put
2 = f>; ?g
and onsider the hara teristi fun tion
U : A ! 2
where
(
U (a) =
> a2U
? a 2= U
Then the following is learly an equalizer
>! >2
U > A >
U
where >! = >Æ! : U > 2: Thus
!! 1 !
U = fa 2 A j U (a) = >g
and for every
':A!2
we have a subset
U' = fa 2 A j '(a) = >g:
Now these operations U and U' are mutually inverse
UU = fa j U (a) = >g
= fa j a 2 U g
= U;

Draft of February 5, 2003


50 Finite limits

and given  : A ! 2,
(
U (a) =
> a 2 U
? a 2= U
(
=
> (a) = >
? (a) = ?
= (a)
Therefore, we have:
hom(A; 2) 
= P (A)
via the maps:
'
(A ! 2) 7 ! (U'  A)
(U  A) 7 ! (A !U 2):
The fa t that equalizers of fun tions are subsets is a spe ial ase of a more
general phenomenon:
Proposition 3.29. In any ategory, if e : E ! A is an equalizer then e is
moni .

e f >B
E > A >
^^ g

x y
z
Z
Suppose ex = ey. We want to show x = y. Put z = ex = ey. Then fz = fex =
gex = gz , so there's a unique u : Z ! E su h that eu = z . But from ex = z
and ey = z , it follows that x = u = y.

3.8 Coequalizers
Now let's onsider the notion dual to that of equalizer, namely oequalizer:
De nition 3.30. For any parallel arrows f; g : A ! B in a ategory C, a
oequalizer onsists of Q and q : B ! Q, universal with the property qf = qg,
as in
f > q >
A >B Q
g ...
 ...
... u
z .....
R _..
Z
Draft of February 5, 2003
3.8 Coequalizers 51

That is, if zf = zg, then there exists a unique u : Q ! Z su h that uq = z .


A oequalizer is a generalization of a quotient by an equivalen e relation.
First observe that we have the following by duality:
Proposition 3.31. If q : B ! Q is a oequalizer, then q is epi.
Sin e q is an equalizer in Cop , hen e moni by the last proposition, it is epi
in C.
Example 3.32. Let R  X  X be an equivalen e relation on a set X , and
onsider the diagram
r1 >
R >X
r2
where
i >
R 
X X

rk
pk
R
_
X
Then the anoni al proje tion  : X ! X=R de ned by x 7! [x℄ is a oequalizer
of r1 and r2 . For given an f : X ! Y as in:
r1 >  >
R >X X=R
r2

f
f
R _
Y
there exists an f su h that
 (x) = f (x)
f
just if f \respe ts R" in the sense that
(x; x0 ) 2 R ) f (x) = f (x0 ):
But this just says that fr1 = fr2 , sin e fr1 (x; x0 ) = f (x) and fr2 (x; x0 ) = f (x0 )
for all (x; x0 ) 2 R. Moreover, su h an f, if it exists, is ne essarily unique, sin e
 is an epimorphism.
Example 3.33. Presentations of Algebras
Consider the notion of a presentation of an algebra | say a monoid or group
| by generators and relations. For example, suppose we are given:

Draft of February 5, 2003


52 Finite limits

Generators: x; y; z
Relations: xy = z; y2 = 1
To build an algebra on these generators and satisfying these relations, start
with
F (3) = F (x; y; z )
and then \for e" the relation xy = z by taking a oequalizer of the maps:
xy > q >
F (1) > F (3) Q
z
We use the fa t that maps F (1) ! A orrespond to elements a 2 A by v 7! a,
where F (1) = F (v). Now similarly, for the equation y2 = 1, take the oequalizer:
q(y2 ) >
F (1) >Q > Q0
q(1)
These two steps an a tually be done simultaniously:
F (2) = F 1 + F 1
f >
F (2) > F (3)
g
where f = [xy; y2 ℄ and g = [z; 1℄. The oequalizer q : F (3) ! Q of f and g then
\for es" both equations to hold, in the sense that in Q we have:
q(x)q(y) = q(z ); q(y)2 = 1 :
Moreover, given any algebra A and any three elements a; b; 2 A su h that
ab = and b2 = 1, there is a unique homomorphism u : Q ! A su h that:
u(x) = a; u(y) = b; u(z ) = :
In this sense, Q is the universal algebra with three generators satisfying the
stipulated equations, whi h may be written suggestively in the form:
Q
= F (x; y; z )=(xy = z; y2 = 1)
Generally, given a nite presentation:
Generators: g1 ; : : : ; gm
Relations: l1 = r1 ; : : : ; ln = rn

Draft of February 5, 2003


3.8 Coequalizers 53

the algebra with that presentation is the oequalizer:


l >
F (m) > F (n) > Q = F (n)=(l = r)
r
where l = [l1 ; : : : ; lm ℄ and r = [r1 ; : : : ; rm ℄. Even more generally, any sets of
generators G and relations R give rise to an algebra in this way, by taking the
oequalizer:
F (R) > F (G) > F (G)=R
>

Draft of February 5, 2003


54 Finite limits

3.9 Exer ises


1. In any ategory with binary produ ts,
A  (B  C ) 
= (A  B )  C:
Q
2. For any index set I , de ne the produ t i2I Xi of I obje ts (Xi )i2I in
a ategory, by giving a universal mapping property generalizing that for
binary produ ts (the ase I = 2).
3. Given a ategory C with obje ts A and B , de ne the ategory CA;B to
have obje ts (X; x1 ; x2 ), where x1 : X ! A, x2 : X ! B , and with arrows
f : (X; x1 ; x2 ) ! (Y; y1; y2 ) being arrows f : X ! Y with y1 Æ f = x1 and
y2 Æ f = x2 .
Show that CA;B has a terminal obje t just in ase A and B have a produ t
in C.
4. In any ategory C with produ ts, de ne the graph of an arrow f : A ! B
to be the monomorphism:
(f ) = h1A ; f i : A  A  B
(why is this a mono?). Show for C = Sets that this determines (the
arrow part of) a fun tor : Sets ! Rel to the ategory Rel of relations,
de ned in Homework 1 (to get a subset of A  B , take the image of A
under (f )).
5. (a) In any ategory C, show that
A >C < B
1 2
is a oprodu t diagram just if for every obje t Z , the map
hom(C; Z ) ! hom(A; Z )  hom(B; Z )
f7 ! hf Æ 1 ; f Æ 2 i
is an isomorphism. If you do this by using duality, you may take the
orresponding fa t about produ ts as given.
(b) If you proved the rst part dire tly, prove the orresponding fa t
about produ ts by using duality.
6. * Show that the free monoid fun tor M preserves oprodu ts: for any sets
A; B :
M (A) + M (B ) 
= M (A + B ) ( anoni ally)
Do this by using the UMPs of the oprodu ts A + B and M (A) + M (B )
and of free monoids.

Draft of February 5, 2003


3.9 Exer ises 55

7. Show that the ategory of monoids has all equalizers and nite produ ts.
8. Show that the ategory Ab of abelian groups (xy = yx) has all equalizers.
9. * Show that the ategory of posets has all oequalizers.
10. Consider the ategory of sets.
(a) Given a fun tion f : A ! B , des ribe the equalizer of the fun tions
f Æ p1 ; f Æ p2 : A  A ! B as a (binary) relation on A, and show that
it is an equivalen e relation ( alled the kernel of f ).
(b) Given a relation R on a set A, des ribe the quotient q : A ! A=R as
a oequalizer.
( ) Show that the kernel of a quotient q : A ! A=R by an equivalen e
relation R is R itself.
(d) Using the foregoing, show that for any relation R on a set A, one
an onstru t the equivalen e relation \generated by R" (the least
equivalen e relation ontaining R) as the kernel of the quotient of A
by R.

Draft of February 5, 2003


56 Finite limits

Draft of February 5, 2003


Chapter 4

Groups and ategories


This le ture is devoted to some of the various onne tions between groups and
ategories. The idea is that if you already know the group theory then this
will give you some insight into the ategori al onstru tions we've learned so
far, and if you don't know it yet, then you'll learn it now as an appli ation of
ategory theory.
I'm going to fo us on three di erent aspe ts of the relationship between
ategories and groups:

1. groups in a ategory
2. the ategory of groups
3. groups as ategories

4.1 Groups in a ategory


Let C be a ategory with nite produ ts. We an de ne the notion of a group
in C, generalizing the usual notion of a group in Sets.
De nition 4.1. A group in C onsists of obje ts and arrows as so:
m > < i
GG G G
^
u

1
satisfying the following onditions:

Draft of February 5, 2003


58 Groups and ategories

1. m is asso iative

= 1  m>
(G  G)  G > G  (G  G) GG

m1 m
_ _
GG >G
m
2. u is a unit for m
G
hu!; 1Gi > G  G

h1G ; u!i  m
_ R _
GG > G
m
3. i is the inverse with respe t to m
 >
G GG

u! i  1G
_ _
G< GG
m
u
where u! = G !! 1 ! G.
De nition 4.2. A homomorphism h : G !H of groups in C onsists of an
arrow in C,
h:G!H;
su h that:
1. h preserves m:
h  h>
GG H H

m m
_ _
G > H
h

Draft of February 5, 2003


4.2 The ategory of groups 59

2. h preserves u
h
G >H
^

e
e
1
3. h preserves i
h
G >H
^ ^
i i

G >H
h

With the evident identities and omposites, we thus have a ategory of groups
in C, denoted:
Group(C)
Example 4.3.  Groups are groups in Sets.
 Topologi al Groups are groups in Top.

(partially) ordered groups are groups in Pos.
For example, the real numbers R are both a topologi al and an ordered group
(with respe t to both addition and multipli ation)
The point is { in logi al terms { that one an \model the theory of groups"
in any ategory with nite produ ts, not just Sets. Of ourse the same is true
for other theories { like monoids and rings { given by operations and equations.
And theories involving other logi al operations like quanti ers an be modeled
in ategories having more stru ture, as we'll see later.
Here we have a glimpse of so alled ategori al semanti s. From a logi al
point of view, su h semanti s an often be used for theories that are not omplete
with respe t to models in Sets, like intuitionisti logi .

4.2 The ategory of groups


Let
h:G!H
Draft of February 5, 2003
60 Groups and ategories

be a group homomorphism, and onsider the kernel, de ned by:


h
ker(h) = fg 2 Gjh(g) = ug > GH >
>
u
This learly makes the above an equalizer diagram. Here we write u : G ! H
for the onstant homomorphism
u
u! = G !! 1 ! H
Observe that ker(h) is a subgroup. Indeed, it is a normal subgroup, i.e. for any
k 2 ker(h)
gkg 1 2 ker(h) for all g 2 G.
Now if
N i G
is any normal subgroup, we an onstru t the oequalizer
i >G  >
N > G=N
u
sending g 2 G to u i g 2 N (\killing o N "), as follows: the elements of G=N
are the \ osets," i.e. equivalen e lasses of the form [g℄, where
g  h i g Æ h 1 2N :
(Prove that this is an equivalen e relation!) The multipli ation on G=N is given
by
[g ℄ Æ [g 0 ℄ = [g Æ g 0 ℄;
whi h is well de ned sin e N is normal (proof!).
Let's show that the diagram above really is a oequalizer. First, it's lear
that
 Æ i =  Æ u!;
sin e [n℄ = [u℄, be ause n Æ u = n. Suppose we have f : G ! H killing N , i.e.
f (n) = u for all n 2 N . We propose a \fa torization" f, as indi ated in:
h
G >H

. ...
.
. .

. . ... f
_ ..
G=N
Draft of February 5, 2003
4.2 The ategory of groups 61

de ned by:
f[g℄ = f (g):
This is well de ned if g  g0 implies f (g) = f (g0 ). But:
f (g) = f (g Æ (g0 ) 1 Æ g0 ) = f (g Æ (g0 ) 1 )f (g0 ) = f (n) Æ f (g0 ) = f (g0 ):
Clearly f is unique, sin e  is epi. Thus we've shown the following lassi al
Homomorphism Theorem for Groups :
Theorem 4.4. Every group homomorphism h : G ! H has a kernel ker(h) =
h 1 (u), whi h is a normal subgroup of G with the property that, for any normal
subgroup N  G:
N  ker(h)
i there is a (ne essarily unique) homomorphism h : G=N ! H with h Æ  = h,
as in:
h >
G H
.
. ...
..
 .
..... f
_ .
G=N
It just remains to show that if su h an h exists, then N  ker(h). But this
is lear sin e (N ) = f[u℄g. So h(n) = h  (n) = h([n℄) = 1H :
Finally, putting N = ker(h) in the theorem and taking [g℄; [g0℄ 2 G=ker(h),
h [g℄ = h [g0 ℄ ) h(g) = h(g0 )
) h(g(g0 ) 1 ) = u
) g(g0 ) 1 2 ker(h)
) g  g0
) [g ℄ = [g 0 ℄:
So h is moni . When e we have:
Corollary 4.5. Every group homomorphism h : G ! H fa tors as
h >
G H


h
_
G= ker h

with h : G=ker(h) ! im(h)  H an isomorphism to the image of h.
In parti ular, therefore, a homomorphism h is inje tive if and only if its
kernel is \trivial", in the sense that ker(h) = fug.

Draft of February 5, 2003


62 Groups and ategories

4.3 Categories as generalized groups


First, let's re all that a group is a ategory. In parti ular, a group is a ategory
with one obje t, in whi h every arrow is an iso.
If G and H are groups, regarded as ategories, then we an onsider arbitrary
fun tors
G ! H:
Convin e yourself that a fun tor between groups is the same thing as a group
homomorphism.
What I want to do now is generalize the foregoing notions of kernel of a
homomorphism, and quotient or fa tor group by a normal subgroup from groups
to arbitrary ategories, and then to prove the analogous homomorphism theorem
for ategories.
De nition 4.6. A ongruen e on a ategory C is an equivalen e relation on
arrows su h that
1. f  g ) dom(f ) = dom(g) and od(f ) = od(g),
f
 >
>
g
2. f  g ) bfa  bga for all arrows a : A ! X and b : Y ! B , where
dom(f ) = X = dom(g) and od(f ) = Y = od(g).

a f b
 > >
> >
g
Let  be a ongruen e on C, de ne a ategory C by:
(C )0 = C0
(C )1 = fhf; gijf  gg

1 C = h1C ; 1C i
hf ; g i Æ hf; gi = hf 0 f; g0 gi
0 0
One needs to he k that this omposition is well-de ned!
There are evident fun tors
p1 >
C >C
p2
We build the quotient ategory C=  as follows
(C= )0 = C0

Draft of February 5, 2003


4.3 Categories as generalized groups 63

(C= )1 = (C1 )= 


The arrows have the form [f ℄ where f 2 C1 , and we an put 1[C ℄ = [1C ℄, and
[g℄ Æ [f ℄ = [g Æ f ℄, as is easily he ked.
There is an evident proje tion fun tor  : C ! C= , and it makes the
following a oequalizer of ategories:
p1 >  >
C >C C= 
p2
This is proved mu h as for groups.
A homework problems shows how to use this onstru tion to make oequaliz-
ers for ( ertain) fun tors. Let us show how to use it to prove a \homomorphism
theorem for ategories". Suppose we have a fun tor
F : C ! D:
Then F determines a ongruen e F on C by setting:
f F g i dom(f ) = dom(g); od(f ) = od(g); F (f ) = F (g):
That this is a ongruen e is easily he ked.
Let is write:
ker(F ) = CF >C
>
for the ongruen e ategory, and all this the kernel ategory of F .
The quotient ategory,
C= F ;
has the expe ted UMP, namely:
Theorem 4.7. Every fun tor F : C ! D has a kernel ategory ker(F ); deter-
mined by a ongruen e F on C, su h that given any ongruen e  on C one
has:
f  g ) f F g
if and only if there is a fa torization F : C=  ! D, as in:
F
C > D
. 
....
.
 .... 
.. F
_ ..
C= 

Draft of February 5, 2003


64 Groups and ategories

Just as in the ase of groups, applying the theorem to the ase C = ker(F )
gives a fa torization theorem:
Corollary 4.8. Every fun tor fa tors as
F >
C D


F
_
C= ker(F )
where F is inje tive on homsets,

FA;B : hom(A; B ) hom(F A; F B ) for all A; B 2 C= ker(F )

4.4 Finitely presented ategories


Finally, let us onsider ategories presented by generators and relations.
We begin with the free ategory C(G) on some nite graph G, and then
onsider a nite set  of relations of the form
(g1 Æ : : : Æ gn ) = (g0 Æ : : : Æ g0 )
1 m
with all gi 2 G, and dom(gn ) = dom(gm 0 ) and od(g1 ) = od(g10 ). Then we
let  be the smallest ongruen e  on C su h that f  f 0 for ea h equation
g = g0 in .
Su h a ongruen e exists simply be ause the interse tion of a family of on-
gruen es is again a ongruen e. Thus, we have a notion of a nitely presented
ategory
C(G; )) = C(G)=  ;
analogous to that for groups. The UMP of F (G; ) is a trivial variant of that
already given for groups.
Spe i ally, in C(G; )) there is a \diagram of type G," i.e. a graph homo-
morphism) i : G ! jC(G; ))j, satisfying all the onditions i(g) = i(g0), for all
g = g0 2 . Moreover, given any ategory D with a diagram of type G, say
h : G ! jDj, that satis es all the onditions h(g) = h(g0 ), for all g = g0 2 ,
there is a unique fun tor h : C(G; )) ! D with jh j Æ i = h. The reader should
draw the asso iated diagram of graphs and ategories.
Just as in the ase of presentations of groups, one an des ribe the onstru -
tion of C(G; )) as a oequalizer for two fun tors.
Indeed, suppose we have arrows f; f 0 2 C. Take the least ongruen e  on
C with f  f 0 . Consider the diagram:
f > q >
C(2) >C C= 
f 0

Draft of February 5, 2003


4.4 Finitely presented ategories 65

where q is the anoni al fun tor to the quotient ategory. Then q is a oequalizer
of f and f 0 . To show this, take any d : C ! D with
df = df 0 :
x
Sin e C(2) is free on  ! , and f (x) = f and f 0 (x) = f 0 , we have:
d(f ) = d(f (x)) = d(f 0 (x)) = d(f 0 ):
Thus hf; f 0 i 2 ker(d), so  ker(d), (sin e  is minimal with f  f 0 ). So there
is a fun tor d : C= ! D su h that d = d Æ q, by the homomorphism theorem.
Example 4.9. The ategory with two uniquely isomorphi obje ts is not free on
any graph, sin e it's nite, but has \loops" ( y les). But it is nitely presented
with graph
f >B
A<
g
and relations
gf = 1A ; fg = 1B :
Similarly, there are nitely presented ategories with just one non-identity
arrow f :  !  and either
f Æ f = 1; or f Æ f = f
In the rst ase we have the group Z=2Z . In the se ond ase an \idempotent"
(but not a group).
Indeed, any of the y li groups
Zn 
= Z=Zn
o ur in this way, with the graph:
f
? >?

and the relation


f n = 1:

Draft of February 5, 2003


66 Groups and ategories

4.5 Exer ises


1. Regarding a group G as a ategory with one obje t and every arrow an
isomorphism, show that a ategori al ongruen e  on G is the same thing
as (the equivalen e relation on G determined by) a normal subgroup N 
G, i.e. show that the two kinds of things are in isomorphi orresponden e.
Show further that the quotient ategory G=  and the fa tor group G=N
oin ide. Con lude that the homomorphism theorem for groups is a spe ial
ase of the one for ategories.
2. Give four di erent presentations by generators and relations of the ate-
gory 3, pi tured:
1 >2


R _
3
Is 3 free?
3. Given a ongruen e  on a ategory C and arrows in C as pi tured below,

f >B
g >C
A > >
f0 g0
show that f  f 0 and g  g0 implies g Æ f  g0 Æ f 0 .
4. * Given fun tors F; G : C ! D su h that for all C 2 C, F C = GC , de ne
a ongruen e on D by the ondition:
f g i dom(f ) = dom(g)
& od(f ) = od(g)
& 8E; H : D ! E: HF = HG ) H (f ) = H (g)

Prove that this is a ongruen e.


Prove that C=  is the oequalizer of F and G.

Draft of February 5, 2003


Chapter 5

Limits and olimits


We shall brie y dis uss some topi s relating to the de nitions we already have {
rather than pushing on to new ones. This is partly in order to let you get used
to these ideas, but also be ause we'll need this material soon enough. After
that, and after a brief look at one more elementary notion, we shall go on to
what may be alled \higher ategory theory".

5.1 Subobje ts
We've seen that every sub set U  X of a set X o urs as an equalizer, and
that equalizers are moni . So it's natural to regard moni s as \generalized
subobje ts". That is, a moni in Groups we an think of as a subgroup, a
moni in Rings as a subring, and so on.
The general idea is that, given a moni
m:M X
in some ategory C of \gadgets" (stru tured sets), the image
m(M )  X
is a sub-gadget of X to whi h M is isomorphi via m,
m:M !  m(M ) :

Of ourse, this is a very rough and ready, intuitive motivation. One an also
think of M { more generally { as a \part" of X .
De nition 5.1. A subobje t of an obje t X in a ategory C is a mono
m:M  X:
Draft of February 5, 2003
68 Limits and olimits

Given subobje ts m; m0 of X , a morphism f : m ! m0 is an arrow in C=X


as in
f > 0
M M

m
m0
R _
X
Thus we have a ategory
SubC (X )
of subobje ts of X in C.
Remark 5.2. Sin e m0 is moni , there is at most one f as in the diagram above,
so that SubC (X ) is a preorder ategory. We all the relation
m  m0 i 9f : m ! m0
in lusion of subobje ts.
Moreover, we say that m and m0 are equivalent, written m  m0 , if and only
if they are isomorphi as subobje ts, i.e. m  m0 and m0  m. This holds just
if there are f and f 0 making both triangles below ommute
<
f0 0
M >M
f

m
m0
R _
X
But then observe that m = m f = mf f , and sin e m is moni , f 0f = 1M and
0 0
similarly ff 0 = 1M . So M 
0 = M 0 via f . Thus we see that equivalent subobje ts
have isomorphi domains.
We sometimes abuse notation and language, alling M the subobje t when
the mono m : M ! X is lear.
Note that if M  M 0 then the arrow f whi h makes this so in
f > 0
M M


R _
X
is also moni , so also M is a subobje t of M 0 . In fa t if i : M  X is a mono
then we get a fun tor
i : Sub(M ) ! Sub(X )
Draft of February 5, 2003
5.1 Subobje ts 69

de ned by omposition (sin e the omposite of monos is moni ).


In terms of generalized elements of an obje t X ,
z:Z!X
one an de ne a \lo al membership relation"
z 2X M

on these and subobje ts M m X by:


z 2X M i 9f : Z ! M su h that z = mf:
Sin e m is moni , if z fa tors through it then it does so uniquely. So this is
naturally a relation.
Example 5.3. An equalizer
f >B
E > A >
g
is a subobje t of A with the property
z 2A E i f (z ) = g(z )
Thus, we an think of E as the subobje t of elements z : Z ! A su h that
f (z ) = g(z ):
E = fz 2 Z j f (z ) = g(z )g  A:

In ategori al logi , we develop a way of making this intuition even more


pre ise, by giving a al ulus of su h subobje ts.
Remark 5.4. In some books on ategory theory, one passes from the preorder

SubC (X )
to the poset given by fa toring out the equivalen e relation \". Thus in su h
ases a subobje t is an equivalen e lass of monos under mutual in lusion.
In Sets, under this notion of subobje t, one then has:
SubSets (X ) 
= P (X )
i.e. every subobje t is represented by a unique subset. We shall use both notions
of subobje t, making lear when equivalen e lasses are intended.

Draft of February 5, 2003


70 Limits and olimits

5.2 Pullba ks
The notion of a pullba k, like that of a produ t, is one that omes up very
often in mathemati s and logi ; it is a generalized inverse image. But unlike
produ t, it is rarely re ognized as a ase of the general notion (ex ept by ategory
theorists).
Let's have the de nition rst:
De nition 5.5. In any ategory C, a pullba k of arrows f; g with od(f ) =
od(g)
B

g
_
A >C
f
onsists of arrows
P > B
p1
p1
_
A
su h that fp1 = gp2 , and universal with this property. I.e. given any z1 : Z ! A
and z2 : Z ! B with fz1 = gz2, there exists a unique
u:Z!P
with z1 = p1 u and z2 = p2 u.
Here's the pi ture:
Z
AAH....H.. HH
AA u .....HHzH2 HH
AA R. P HjH> B
z1 A p2
AA p g
AUA _ 1 _
A >C
f

Draft of February 5, 2003


5.2 Pullba ks 71

Remark 5.6. One often uses the produ t style notation


Z
AAHHHH
AhAz1; z2i HHHHH
AA RA C B HjH> B
AA p2
AA p1 g
AU _ _
A >C
f
Pullba ks are learly unique up to isomorphism sin e they're given by an
UMP. Here this means that given two pullba ks of a given pair of arrows, the
uniquely determined maps between the pullba ks are mutually inverse.
In terms of genralized elements, given any z 2 A C B , it an be written as
Z
AAHHHH
AA z  HHHHH
AA RA C B HjH> B
AA p2
AA p1 g
AU _ _
A >C
f
z = hz1 ; z2i with fz1 = gz2, uniquely. This makes
A C B = fhz1; z2 i 2 A  B j fz1 = fz2 g
look like a subobje t of A  B , determined as an equalizer of f Æ 1 abd g Æ 2 .
In fa t, this is so:
Proposition 5.7. In a ategory with produ ts and equalizers, given a orner of
arrows:
B

g
_
A > C
f
Draft of February 5, 2003
72 Limits and olimits

Consider the diagram


E
AAHHHH
AA e  HHpH2 HH
AA RA  B HHj> B
p1 A 2
AA  g
AAU _ 1 _
A >C
f
in whi h e is an equalizer of f1 and g2 and p1 = 1 e, p2 = 2 e. Then E; p1 ; p2
is a pullba k of f and g. Conversely, if E; p1 ; p2 are given as su h a pullba k,
then the arrow
e = hp1 ; p2 i : E ! A  B
is an equalizer of f1 and g2 .
Proof. Take
z2 >
Z B

z1
_
A
with fz1 = gz2. We have
hz1 ; z2 i : Z ! A  B
so
f1 hz1 ; z2 i = g2 hz1 ; z2 i:
Thus, there is a u : Z ! E to the equalizer with eu = hz1 ; z2 i then
p1 u = 1 eu = 1 hz1 ; z2i = z1
and
p2 u = 2 eu = 2 hz1 ; z2 i = z2 :
If also u0 : Z ! E has pi u0 = zi ; i = 1; 2, then
i eu0 = zi
so eu0 = hz1 ; z2 i = eu when e u0 = u sin e e in moni . The onverse similar.

Draft of February 5, 2003


5.2 Pullba ks 73

Corollary 5.8. If a ategory C has binary produ ts and equalizers, then it has
pullba ks.
The foregoing gives an expli it onstru tion of a pullba k in Sets as a subset
of the produ t:
fha; bi j fa = gbg = A C B ,! A  B
Example 5.9. In Sets, take a fun tion f : A ! B and a subset V  B . Let, as
usual,
f 1(V ) = fa 2 A j f (a) 2 V g  A
and onsider
f >
f 1(V ) V

j i
_ _
A >B
f
where i and j are the anoni al in lusions and f is the evident fa torization of
the restri tion of f to f 1 (V ) (sin e a 2 f 1 (V ) ) f (a) 2 V ).
This diagram is a pullba k (observe that z 2 f 1 (V ) , fz 2 V for all
z : Z ! A). Thus, the inverse image
f 1 (V )  A
is determined uniquely up to isomorphism as a pullba k.
As suggested by the previous example, we an use pullba ks to de ne inverse
images in ategories other than Sets. Indeed, onsider the following fa t: Given
a pullba k (in any ategory):
A B M >M

m0 m
_ _
A >B
f
if m moni , then m0 is moni . (Exer ise!)
Thus we see that, for xed f : A ! B , taking pullba ks indu es a map
f 1 : Sub(B ) ! Sub(A)
m 7! m0 :
We'll show that f 1
respe ts equivalen e of subobje ts:
M  N ) f 1 (M ) = f 1(N ) ;
by showing that f 1 is a fun tor; that will be our next goal.

Draft of February 5, 2003


74 Limits and olimits

5.3 Properties of pullba ks


We start with the following simple lemma, whi h seems to ome up all the time.
Lemma 5.10. (Two-pullba ks) Consider the ommmutative diagram below in
a ategory with pullba ks:
f0 > g0 >
F E D

h00 h0 h
_ _ _
A >B >C
f g
1. If the two squares are pullba ks, so is the outer re tangle. Thus,
A B (B C D) 
= A C D:

2. If the right square and the outer re tangle are pullba ks, so is the left
square.
Proof. Diagram hase.
Corollary 5.11. The pullba k of a ommutative triangle is a ommutative tri-
angle. Spe i ally, given a ommutative triangle as on the right end of the
following \prism diagram":

A0 > A
... h
... 0 
0 .. .
... 
R.. R
B0 > B
h

0
_ _
C0 >C
h
for any h : C 0 ! C , if one an form the pullba ks 0 and 0 as on the left end,
then there exists a unique 0 as indi ated, making the left end a ommutative
triangle, and the upper fa e a ommutative re tangle, and indeed a pullba k.
Proof. Apply the two-pullba ks lemma.

Draft of February 5, 2003


5.3 Properties of pullba ks 75

Proposition 5.12. Pullba k is a fun tor. I.e. for xed h : C 0 ! C in a ategory


C with pullba ks, there is a fun tor
h : C=C ! C=C 0
de ned by
(A !
C ) 7! (C 0 C A ! 0 0
C)
0
where is the pullba k of along h, and the e e t on an arrow : ! is
given by the foregoing orollary.
Proof. One must he k that
h (1X ) = 1h X


and
h (g Æ f ) = h (g) Æ h (f )
These an easily be veri ed by repeated appli ations of the two-pullbak s lemma.
E.g. for the rst ondition, onsider
A0 >A
h0
1A 0 1A
_ _
A0 > A
h0
0
_ _
C0 > C
h
if the lower square is a pullba k, then plainly so is the outer re tangle, when e
the upper square is, too, and we have:
h 1X = 1X = 1h X :
0 

Corollary 5.13. Let C be a ategory with pullba k. For any arrow f : A ! B


in C we have the following diagram of ategories and fun tor:
f 1
Sub(A) < Sub(B )

_ _
C=A < C=B
f
Draft of February 5, 2003
76 Limits and olimits

This ommutes simply be ause f 1 is de ned to be the restri tion of f  to the


sub ategory Sub(B ). Thus in parti ular, f 1 is fun torial:
 N ) f 1(M )  f 1 (N )
M
It follows that M  N ) f 1 (M )  f 1 (N ), so that f 1 is also de ned on
equivalen e lasses.
Example 5.14. Consider a pullba k in Sets:
f0 >
E B

g0 g
_ _
A >C
f
we saw that

E
hf 0 ; g0i> A  B f1 > C
>
g2
is an equalizer:
E = fha; bi j f (a) = g(b)g:
Now let B 
= 1, C 
=2= f>; ?g, and g = > : 1 ! 2. Then we have the
equalizer
f1 >
E > A1 >2
>2
and we an rephrase what we already know about subsets and equalizers in
terms of pullba ks. In short, we have a pullba k diagram:
!
U >1

>
_ _
A > 2
U
for ea h U  A and its unique hara teristi fun tion U : A ! 2. In other
words, the isomorphism
2A 
= P (A)
Draft of February 5, 2003
5.3 Properties of pullba ks 77

is mediated by the operation


f 7! f 1 (>) = fa j f (a) = >g
Now suppose we have some fun tion
:B!A
and we want to onsider the indu ed inverse image operation,
1 : P (A) ! P (B )
given by pullba k, as in the example above. Take some Uf  A and onsider
the two-pullba k diagram:
1 (Uf ) > Uf >1

>
_ _ _
B > A > 2
f
We then have (by the two-pullba ks lemma again):
1 (Uf ) = 1 (f 1 (>)) = (f ) 1 (>) = Uf :
Thus for any : B ! A the following square ommutes.

=
2A > P (A)

2 1

_ _
2B  > P (B )
=
Here the horizontal isos are the ones we've already onsidered, taken on e at A
and on e at B , the map
1 : P (A) ! P (B )
is the inverse image along : B ! A (i.e. pullba k), and 2 : 2A ! 2B is
pre omposition 2 (f ) = f Æ . In a situation like this, where one always has
squares like the one above, one says that the isomorphism
2A 
= P (A)
is natural in A, whi h is obviously a mu h stronger ondition than just being
isomorphi at ea h obje t A. We'll onsider su h \naturality" in a ouple of
weeks. In fa t it was one of the phenomena that originally gave rise to ategory
theory.

Draft of February 5, 2003


78 Limits and olimits

Example 5.15. Let I be an index set, and onsider an I -indexed family of sets:
(Ai )i2I
Given any fun tion : J ! I , there is a J -indexed family,
(A (j) )j2J ;
obtained by \reindexing along ". This reindexing an also be des ribed as
a pullba k. Spe i ally, for ea h set Ai take the onstant, i-valued fun tion
pi : Ai ! I , and onsider the indu ed map on the oprodu t,
a
p = [pi ℄ : Ai ! I :
i 2I
The reindexed family (A (j) )j2J an then be obtained by taking the pullba k
along , as indi ated in the following diagram:
a a
A (j) > Ai
j 2J i 2I
q p
_ _
J >I

where q is the indexing proje tion for (A (j) )j2J analogous to p. The reader
should work out the details as an instru tive exer ise.

5.4 Limits
We've already seen that the notions of produ t, equalizer, and pullba k are not
independent; the pre ise realtion is this:
Proposition 5.16. A ategory has nite produ ts and equalizers i it has pull-
ba ks and a terminal obje t.
The ) dire tion has already been done. As for the other dire tion, suppose
C has pullba ks and a terminal obje t 1.
1. A; B 2 C0 : A  B 
= A 1 B
AB > B

_ _
A > 1

Draft of February 5, 2003


5.4 Limits 79

2. f; g : A ! B , onsider the pullba k


h
E > B

e  = h1B ; 1B i
_ _
A > BB
hf; gi
Intuitively
E = fha; bi j hf; gi(a) = bg
where
hf; gi(a) = hfa; gai
(b) = hb; bi
So,
E = fha; bi j f (a) = b = g(a)g


= fa j f (a) = g(a)g
whi h is what we want. We want to show that
e > f >B
E A >
g
is an equalizer.
Binary produ ts, terminal obje t, pullba k, equalizer, are all spe ial ases
of the general notion of a limit, whi h we'll onsider now. First, we need some
de nitions:
De nition 5.17. Let J and C be ategories. A diagram of type J in C is a
fun tor
D : J ! C:
A one to a diagram D onsists of an obje t C and arrows
j : C ! Dj in C
one for ea h j 2 J0 , su h that for ea h 2 J1
:i!j
Draft of February 5, 2003
80 Limits and olimits

the triangle
C > Dj
j

i
D
_
Di
ommutes. We're thinking of the diagram D as a \pi ture of J in C". A mor-
phism of ones
# : (C; j ) ! (C 0 ; 0j )
is an arrow # in C making
#
C > C0
 0
j j
_ R
D
ommute. I. e. su h that
j = 0j Æ # 8j 2 J0 :
Thus we have an apparent ategory
Cone(D)
of ones to D.
De nition 5.18. A limit for a one D : J ! C is a terminal obje t in
Cone(D). A nite limit is a limit of nite type, i. e. of type J where J is
a nite ategory.
Example 5.19. Take J = f1:2g (i. e. the ategory with two obje ts and no non-
identity arrows). A diagram D : J ! C is a pair of obje ts D1 ; D2 2 C. A one
on D is an obje t of C equipped with arrows
1 2 >
D1 < C D2
And a limit of D is a terminal su h one, i. e. a produ t in C of D1 and D2
p1 p2 >
D1 < D1  D2 D2

Draft of February 5, 2003


5.4 Limits 81

Example 5.20. Take J to be the ategory



 >
>

A diagram of type J looks like
D >
D1 > D2
D
and a one is a pair of arrows
D >
D1 > D2
^ D

1
2
C
su h that
D 1 = 2

D 1 = 2
I. e. su h that D 1 = D 1 . A limit for D is therefore an equalizer for D ,
D .
Example 5.21. If J is empty, there's just one diagram D : J ! C, and a limit
for it is thus a terminal obje t in C.
Example 5.22. If J is


_
 > 
you an see that a limit for a diagram
B

g
_
A >C
f
of type J is just a pullba k of f and g.

Draft of February 5, 2003


82 Limits and olimits

Thus we've shown half of the following:


Proposition 5.23. A ategory has all nite limits i it has nite produ ts and
equalizers (resp. pullba ks and a terminal obje t by the last proposition).
Where a ategory C is said to have all nite limits if every diagram D : J !
C of nite type has a limit in C.
We need to show that any nite limit an be onstru ted from, say, nite
produ ts and equalizers: take a diagram of nite type
D : J ! C:
Consider the produ ts
Y Y
Di and Dj nite
i2J0 ( :i!j )2J1

We have the following arrows:


Y > Y
Di > Dj
i :i!j
Where
 =  od( )

= D Æ dom( ) :
And now we take the equalizer
e >Y  Y
E Di >> D od( )
i
And we laim that (E; ei = pi Æ e) (so e = hei i) is a limit for D. Let
( ) : C ! D
i
be some one to D. We have an arrow
Y
h i i : C ! Di
and it plainly suÆ es to show that
h i i = h i i
to get the desired arrow u : C ! E . Now learly:
h i i = h i i
Draft of February 5, 2003
5.5 Preservation of limits 83

i
 h i i =  h i i 8
But
 h i i = alpha h i i

=  od( ) h i i = j
and
 h i i = h i i

= D Æ dom( ) h i i = D Æ j
When e
h i i = h i i
, j = D Æ i 8 : i ! j
, ( i ) : C ! D
is a one.
The same proof yields the following:
Corollary 5.24. A ategory has all limits of some ardinality i it has all equal-
izers and produ ts of that ardinality, where C has limits (produ ts) of ardi-
nality  i C has a limit for every diagram D : J ! C where ard(J1 )   (in
the ase of produ ts, J is dis rete).
Remark 5.25. The theory of ones and limits dualizes to give that of o ones
and olimits. In this onne tion one has the the following dual theorem.
Theorem 5.26. (1) A ategory C has nite olimits i it has nite oprodu ts
and oequalizers i it as pushouts and an initial obje t. (2) C has all olimits
of size  i it has oequalizers and oprodu ts of size .

5.5 Preservation of limits


Now here's an appli ation of limits by produ ts and equalizers.
De nition 5.27. A fun tor F : C ! D is said to preserve limits of type J if
whenever (pj ) : limDj ! D is a limit for D : J ! C then (F pj ) : F ( ) ! F D
j 2J
is a limit for the diagram F D : J ! D. Brie y:
F (limDj ) 
= limF Dj :

Draft of February 5, 2003


84 Limits and olimits

Now let C be lo ally small and re all the representable fun tors
HomC (C; ) : C ! Sets
f
taking X ! Y to
f
Hom(C; X ) ! Hom(C; Y )


where f (g : C ! X ) = f Æ g.
Proposition 5.28. Representable fun tor preserve all limits.
It suÆ es to show that Hom(C; ) preserves produ ts and equalizers
 Suppose C has a 1.
HomC (C; 1) = f!C g = 1:

 Consider abinary produ t X  Y in C


Hom(C; X  Y ) 
= Hom(C; X )  Hom(C; Y )
we already know.
 Q
Arbitrary produ ts i2I Xi are similar
Y Y
HomC (C; Xi ) 
= HomC (C; Xi )
i i

 Let the equalizer in C be given


e f >Y
E >X >
g
onsider
e f>
Hom(C; E ) > Hom(C; X ) > Hom(C; Y )
g
Let h : C ! X 2 Hom(C; X ) su h that
f h = g h
then
fh = gh
so 9!hC
 ! E su h that eh = h. But h 2 Hom(C; E ) and e h = eh . So
e : Hom(C; E ) ! Hom(C; X ) is the equalizer of f and g .

Draft of February 5, 2003


5.6 Colimits 85

Corollary 5.29. Contravariant representable fun tors


Hom( ; C ) : Cop ! Sets
f
taking X ! Y to
f
Hom(X; C ) !

Hom(Y; C )
where f  (g : Y ! C ) = g Æ f map olimits in C to limits in Sets.
Example 5.30. Hom(X + Y; C ) 
= Hom(X; C )  Hom(Y; C ) and
X >Y > Q
>
implies
Hom(Q; C ) > Hom(X; C ) >> Hom(Y; C )
is an equalizer (proof by duality).

5.6 Colimits
Before dis ussing the nal elementary topi , exponentials, let us brie y dis uss
olimits, sin e we didn't really say mu h about them in the last se tion.
First, let me give you a pi ture of Pushouts in Sets: Suppose given two
maps:
g
A >C

f
_
B
We an onstru t the pushout of f and g like this. Start with the oprodu t
(disjoint sum):
B > B+C < C
and now identify those elements b 2 B and 2 C su h that, for some a 2 A
f (a) = b and g(a) = :
That is, we take the least equivalen e relation on B + C ontaining all pairs of
the form
hf (a); g(a)i; a 2 A:
Draft of February 5, 2003
86 Limits and olimits

Then we take the quotient to get the pushout:


 (C + B )= 
C +A B =
This onstru tion follows from dualizing the one for pullba ks by produ ts and
equalizers.
Next, I'd like to give you some example of a ertain kind of olimit ; a olimit,
as you've surely already surmised, is an initial obje t in the ategory of o ones
for a diagram
D : J ! C:
Here a o one from the base D onsists of an obje t C (the vertex) and arrows
j : Dj ! C for ea h j 2 J, su h that for all : i ! j in J:
j Æ D( ) = i
and a morphism of ones f : (C; ( j )) ! (C 0 ; (0 j )) is an arrow f : C ! C 0 in C
su h that f Æ j = 0 j for all j 2 J. An initial o one is the expe ted thing: one
that maps uniquely to any other o one from D.
We write su h a olimit in the form:
Dj > lim j 2J Dj
!
uj
Our rst example is what is sometimes alled a dire t limit of a sequen e of
algebrai obje ts, or models of some equational theory, let's say groups. A simi-
lar onstru tion will work for any sort of algebras (but non-equational onditions
on models are not always preseved by dire t limits).
Suppose we're given a sequen e
G0 > G1 > G2 > :::
g0 g1 g2
of groups and homomorphisms, and we want a \ olimiting" group G1 with
homomorphisms
un : Gn ! G1
satisfying un+1 Æ gn = un . Moreover, G1 should be \universal" with this
property. I think you an see the olimit setup here:
 the index ategory is (N; ) as a poset ategory,
g0 g1 g2
 the sequen G0 ! G1 ! G2 ! : : : is a diagram of type (N; ) in the
ategory Groups,
 the olimiting group is the olimit of the sequen e:
G1  ! n2NGn
= lim

Draft of February 5, 2003


5.6 Colimits 87

This group always exists, and an be onstru ted by the general re ipe for
olimits, given by dualizing the onstru tion of limits that we had last week.
Expli itly, we start with the oprodu t,
a
Gn
n2N
and then make some identi ations xn  ym , where xn 2 Gn and ym 2 Gm , to
ensure in parti ular that:
xn  gn (xn )
for all xn 2 Gn and gn : Gn ! Gn+1 .
This means that the elements of G1 are of the form
[xn ℄; xn 2 Gn
for all n, and [xn ℄ = [ym ℄ i for some k  m; n:
gn;k (xn ) = gm;k (ym ) ;
where, generally, if i  j , we de ne:
gi;j : Gi ! : : : ! Gj
by omposing onse utive g's as in gi;j = gj 1 Æ : : : Æ gi . The reader should he k
that this is indeed an equivalen e relation.
The operations on G1 are de ned by:
[x℄  [y℄ = [x0  y0 ℄
where x  x0 , y  y0 , and x0 ; y0 2 Gn for n suÆ iently large. The unit is just
[u0℄, and
[x℄ 1 = [x 1 ℄ :
One an easily he k that these operations are well-de ned, and determine a
group stru ture on G1 , whi h moreover makes all the evident fun tions:
ui : Gi ! G1 ;
de ned by x 7! [x℄, into homomorphisms.
The univerality of G1 and the un results from the fa t that the onstru tion
is essentially a olimit in Sets, equipped with an indu ed group stru ture. This
is a general phenomenon that we shall dis uss later, expressed by saying that
the forgetful fun tor U : Groups ! Sets \ reates !- olimits". We saw the
same situation in onstru ting produ ts.

Draft of February 5, 2003


88 Limits and olimits

Example 5.31. Cumulative hierar hy. Another example of this kind is the \ u-
mulative hierar hy" onstru tion en ountered in set theory. Here one sets e.g.
V0 = ;
and then puts:
Vn+1 = P (Vn )
There is a sequen e of in lusions:
V0  V1  V2  : : :  Vn  : : :
de ned indu tively by ;  V1 , and Vn  Vn+1 implies P (Vn )  P (Vn+1 ), sin e,
for any subset in lusion A  B , we have P (A)  P (B ) by omposition:
U A7 !U AB
Then the olimit of the sequen e is:
V! = lim
! n Vn ;
the umulative hierar hy of rank !. One an of ourse ontinue this onstru tion
through higher ordinals ! + 1; ! + 2; : : : .
One an also take V0 to be any set X , and modify the hierar hy a ordingly.
Then given any fun tion
f :X!Y
there's a map,
V! (f ) : V! (X ) ! V! (Y )
determined by the olimit des ription of V! . That is to say, the umulative
hierar hy is fun torial!
Example 5.32. !CPOs. Let us write ! = (N; ). An !CPO is a poset that
is \! omplete," meaning it has all olimits of type !. Given D an !CPO, a
diagram d : ! ! D is a hain of elements of D,
d0  d1  d2  : : :
and then we have a olimit d! = lim
! dn su h that
1. di  d! for all i 2 !
2. di  d for all i 2 ! ) d!  d.
A monotone map of !CPOs
h:D!E
Draft of February 5, 2003
5.6 Colimits 89

is alled ontinuous if it preserves olimits of type !:


h! > !
D! E

lim
! lim
!
_ _
D > E
h
i.e. h(lim
! dn = lim
! h(dn ).
One appli ation of these notions the following:
Proposition 5.33. If D is an !CPO with initial element 0 and
h:D!D
is ontinuous, then h has a xed point,
h(x) = x ;
whi h, moreover, is least among all xed points.
Proof. Consider the sequen e d : ! ! D, de ned by
d0 = 0
dn+1 = h(dn )
Sin e 0  d0 , repeated appli ation of h gives dn  dn+1 . Take d! = lim
! n2! dn ,
then
h(d! ) = h(lim
! n2! dn )
! n2! h(dn )
= lim
! n2! dn+1
= lim
= d!
Moreover, if x is also a xed point, h(x) = x, then
d0 = 0  x
d1 = h(0)  h(x) = x
::::::
::::::
dn  x
Thus, d!  x, sin e d! is a olimit.

Draft of February 5, 2003


90 Limits and olimits

Finally, here is an example of how ( o)limits depend on the ambient ategory:


we onsider olimits of posets and !CPOs, rather than in them.
Suppose we de ne the nite !CPOs:
!n = fk  n j k 2 !g
then we have ontinuous maps:
!0 ! !1 ! !2 ! : : :
In Pos, the olimit exists, and is !, by a onstru tion similar to the one we
just gave for groups. But ! is not !- omplete. The sequen e:
0  1  2  :::
has no limit. So the olimit of the !n in the ategory of !CPOs, if it exists,
must be di erent. In fa t it is ! + 1:
0  1  2  : : :  !:
Then any bounded sequen e has a olimit in the bounded part, and any un-
bounded one has ! as olimit

Draft of February 5, 2003


5.7 Exer ises 91

5.7 Exer ises


1. Show that an arrow m : M ! C in any ategory is moni if and only if
the diagram below is a pullba k.

1M >
M M

1M m
_ _
M >X
m
2. For any obje t A in a ategory C and any subobje ts M; N 2 SubC (A),
show M  N i for every generalized element z : Z ! A (arbitrary arrow
with odomain A):
z 2A M implies z 2A N:

3. Show that a pullba k of arrows


p2 >
A X B B

p1 g
_ _
A >X
f
in a ategory C is the same thing as their produ t in the sli e ategory
C=X .
4. Show that in any ategory, given a pullba k square
M0 >M

m0 m
_ _
A0 > A
f
if m is moni , then so is m0 .
5. (Equalizers by pullba ks and produ ts) Show that a ategory with pull-
ba ks and produ ts has equalizers as follows: given arrows f; g : A ! B ,
take the pullba k indi ated below, where  =< 1B ; 1B >:

Draft of February 5, 2003


92 Limits and olimits

E >B

e 
_ _
A > BB
< f; g >
Show that e : E ! A is the equalizer of f and g.
6. * (Partial maps) For any ategory C with pullba ks, de ne the ategory
Par(C) of partial maps in C as follows: the obje ts are the same as those
of C, but an arrow f : A ! B is a pair (jf j; Uf ) where Uf  A is a
subobje t (an equivalen e lass of monomorphisms) and jf j : Uf ! B
(take a suitably-de ned equivalen e lass of arrows), as indi ated in the
diagram:

Uf
jf j >B
_

_
A
Composition of (jf j; Uf ) : A ! B and (jgj; Ug ) : B ! C is given by taking
a pullba k and then omposing to get (jg Æ f j; jf j (Ug ), as suggested by
the follow diagram.

jf j (Ug ) > Ug
jg j
>C
_ _

_ _
Uf >B
_ jf j

_
A
Che k to see that this really does de ne a ategory.
7. (Pushouts)

Draft of February 5, 2003


5.7 Exer ises 93

(a) Dualize the de nition of a pullba k to de ne the \ opullba k" (usu-


ally alled the \pushout") of two arrows with ommon domain.
(b) Indi ate how to onstru t pushouts using oprodu ts and oequalizers
(proof \by duality").
8. Suppose the ategory C has limits of type I , for some index ategory I.
For diagrams F and G of type I in C, a morphism of diagrams  : F ! G
onsists of arrows i : F i ! Gi for ea h i 2 I su h that for ea h : i ! j
in I , one has j F ( ) = G( )i (a ommutative square). This makes
Diagrams(I; C) into a ategory ( he k this).
Show that taking the vertex-obje ts of limiting ones determines a fun tor:
lim I : Diagrams(I; C) ! C

9. Show that ontravariant representable fun tors hom( ; C ) send olimits


to limits.

Draft of February 5, 2003


94 Limits and olimits

Draft of February 5, 2003


Chapter 6

Exponentials
We have managed to unify most of the universal mapping properties we've seen
so far with the notion of limits (or olimits). Of ourse, the free algebras are
an ex eption to this. In fa t, it will turn out that there is a ommon sour e of
UMP's, but it lies somewhat deeper, in the notion of adjoints, whi h unify free
algebras, limits, and other universals of various kinds.
Next we're going to look at one more elementary universal stru ture, whi h
is also an example of a universal that's not a limit. This important stru ture
is alled an \exponential" and it an be thought of as a ategori al notion of a
\fun tion spa e". As we'll see it subsumes mu h more than just that, however.

6.1 Exponential in a ategory


Lets start by onsidering a fun tion of sets in two variables,
f (x; y) : A  B ! C
using variables x of type A and y of type B . If we now hold a 2 A xed, we
have a fun tion
f (a; y) : B ! C;
thus an element
f (a; y) 2 C B
of the set of all su h fun tions.
Letting a vary over A then gives a map, whi h I'll write like this:
f~ : A ! C B
de ned by
a 7! f (a; y):
Draft of February 5, 2003
96 Exponentials

The map f~ : A ! C B takes the \parameter" a to the fun tion fa (y) : B !


C . It's uniquely determined by the equation:
f~(a)(b) = f (a; b):
Indeed, any map:
 : A ! CB;
is uniquely of the form
 = f~
for some f : A  B ! C , for we an set
f (a; b) := (a)(b):
What all of this means, in sum, is that we have an isomorphism of sets:
Sets(A  B; C ) 
= Sets(A; C B ):
That is, there is a bije tion between fun tions of the form f : A  B ! C
and those of the form f~ : A ! C B . Moreover, this bije tion is mediated by a
ertain operation of evaluation, whi h we've indi ated in the foregoing by using
variables. In order to generalize the indi ated bije tion to other ategories, we're
going to need to make this evaluation operation expli it, too.
In Sets, it's the fun tion:
eval : C B  B ! C
de ned by
hg; bi 7! g(b);
i.e. eval(hg; bi) = g(b).
This eval fun tion has the following universal property : given any set A and
any fun tion,
f : A  B ! C;
there's a unique fun tion
f~ : A ! C B
su h that eval Æ (f~  1B ) = f , i.e.
eval(f~(a); b) = f (a; b):

Draft of February 5, 2003


6.1 Exponential in a ategory 97

Here's the diagram:


eval >
CB  B C
^

f~  1B
f
AB
(where f : A ! C B ).
You an read the last equation o from this diagram by taking a pair of
elements
ha; bi 2 A  B;
then
(f~  1B )(a; b) = hf(a); bi:
And so
eval(f~(a); b) = f (a; b)
just if the diagram ommutes.
Now the property just stated of the evaluation fun tion and the set C B of
fun tions B ! C is one that will make sense in any ategory having binary
produ ts.
So, in that form, we an use it to de ne the notion we seek:
De nition 6.1. Let the ategory C have binary produ ts. An exponential of
obje ts A and B of C onsists of an obje t
BA
and an arrow
 : BA  A ! B
su h that, for any obje t Z and arrow
f :Z A!B
there's a unique arrow
f~ : Z ! B A
su h that
 Æ (f~  1A ) = f;
Draft of February 5, 2003
98 Exponentials

all as in the diagram:


 >
BA  A B
^

f~  1A
f
Z A
(where f~ : Z ! B A ).
Here's some terminology:
  : B A  A ! B is alled evaluation.
 f~ : Z ! B A is alled the (exponential) transpose of f .
 Given an arrow
g : Z ! BA
we write
g := (g  1A) : Z  A ! B
and also all g the transpose of g. By the uniqueness lause of the de ni-
tion, then,
~g = g ;
and for any f : Z  A ! B ,
f~ = f :
Brie y, transposition of transposition is the identity.
Thus transposition provides the desired isomorphism:
homC (Z  A; B ) 
= homC (Z; B A )
where f 7! f~ and g 7! g.

6.2 Cartesian losed ategories


De nition 6.2. A ategory is alled artesian losed if it has all nite produ ts
and exponentials.
Example 6.3. We already have Sets, but also Setsfin is artesian losed, sin e
for nite sets M; N , the set of fun tions N M has ardinality
jN M j = jN jjM j ;
and so is also nite.

Draft of February 5, 2003


6.2 Cartesian losed ategories 99

Example 6.4. The ategory Pos of posets and monotone fun tions:
f :P !Q
with
p  p0 ) fp  fp0 :
Given posets P and Q, the poset P  Q has pairs hp; qi as elements and is
partially ordered by
hp; qi  hp0 ; q0 i i p  p0 and q  q0
with the evident proje tions
P P  Q ! Q:
P
For the exponential Q , we take the set of monotone fun tions
QP = ff : P ! Qjf monotone g;
ordered pointwise, i.e.:
f  g i 8p 2 P: fp  gp:
The evaluation
 : QP  P ! Q
and transposition
f~ : X ! QP
from
f :X P !Q
are the usual ones of the underlying fun tions. Thus one need only show that
they are monotone.
Given hf; pi  hf 0 ; p0 i in QP  P we have
hf; pi = f (p)
 f (p0 )
 f 0 (p0 )
= hf 0 ; p0 i
when e  is monotone. Now take f : X  P ! Q monotone and let x  x0 . We
need to show
f~(x)  f~(x0 ) in QP
so by de nition,
8p: f~(x)(p)  f~(x0 )(p)
but f~(x)(p) = f (x; p) and f~(x0 )(p) = f (x0 ; p) and x  x0 ) (x; p)  (x0 ; p) )
f (x; p)  f (x0 ; p).
Draft of February 5, 2003
100 Exponentials

Example 6.5. Now let's onsider what happens if we restri t to !-CPO's:


QP = ff : P ! Q j f monotone and !- ontinuousg:
Take  : QP  P ! Q and transposiiton as before. We need to he k that
1. QP is an !-CPO
2.  is !- ontinuous
3. f~ is !- ontinuous if f is.
We leave this as a homework exer ise!

6.3 Boolean and Heyting algebras


Example 6.6. A given Boolean algebra B , regarded as a poset ategory, has
nite produ ts 1 and a ^ b. We an also de ne the exponential by
ba = (a ) b) = (:a _ b)
with evaluation:
(a ) b) ^ a  b
This always holds sin e
(:a _ b) ^ a = (:a ^ a) _ (b ^ a) = b ^ a  b:
To show that this is indeed an exponential in B , we need to verify that if:
a^b
then
a  b ) :
Thus, if a ^ b  , then :b _ (a ^ b)  :b _ = b ) . But we also have
a  :b _ a  (:b _ a) ^ (:b _ b) = :b _ (a ^ b).
More generally, we have the following notion:
De nition 6.7. A Heyting Algebra is a poset with:
1. nite meets: > and p ^ q,
2. nite joins: ? and p _ q,
3. exponents: for ea h a; b, an element a ) b su h that
a ^ b  i a  b ) :

Draft of February 5, 2003


6.3 Boolean and Heyting algebras 101

The ondition on exponents a ) b is equivalent to the universal mapping


property in the ase of posets, as the reader an easily verify.
Every Heyting algebra is a distributive latti e, sin e we have:
(a _ b) ^  z i a_b )z
i a  ) z and b  ) z
i a ^  z and b ^  z
i (a ^ ) _ (b ^ )  z
Now pi k z = (a _ b) ^ , respe tively z = (a ^ ) _ (b ^ ).
One may well wonder whether all distributive latti es are Heyting algebras.
The answer is in general, no; but the omplete ones are:
De nition 6.8. A poset V is ( o) ompleteWif it is so as a ategory, thus if it has
all set-indexed meets i2I ai (resp. joins i2I ai ). For posets, ompleteness and
o ompletenes are equivalent (exer ise!). A latti e, Heyting algebra, Boolean
algebra, et . is alled omplete if it is so as a poset.
Proposition 6.9. A omplete latti e is a HA i it satis es the in nite distribu-
tive law:
_ _
a^( bi ) = (a ^ bi )
i i
Proof. One shows that HA implies distributivity just like in the nite ase. To
show that the in nite distributive law implies HA, set:
_
a)b= x:
x^ab
Then if
y^ab
W
W y  x^abWx = a ) b. And
then W onversely, if y  a ) b then y ^ a 
( x^ab x) ^ a = x^ab (x ^ a)  b = b.
Example 6.10. For any set A, the powerset P (A) is a ( omplete) Heyting algebra
(with unions and interse tions as joins and meets), sin e it satis es the in nite
distriutive law. More generally, the latti e of open sets of a topologi al spa e is
also a Heyting algebra, sin e the open sets are losed under nite interse tions
and arbitrary unions.
Of ourse, every Boolean algebra is a HA, with
a ) b = :a _ b:
But in general, a HA isn't boolean. Indeed, we an de ne:
:a = a ) 0
Draft of February 5, 2003
102 Exponentials

and then a  ::a, but not onversely. Moreover, the law:


1  a _ :a
does not hold in general. In fa t, the on ept of a Heyting algebra is the exa t
algebrai equivalent of the intuitionisti propositional al ulus, in the same sense
that Boolean algebras are an algebrai formulation of lassi al propositional
al ulus.
To make this more pre ise, we rst state the rules for of IPC in terms of
entailments p ` q, as follows:
1. ` is re exive and transitive
2. p`>
3. ?`p
4. p ` q and p ` r i p ` q ^ r
5. p ` r and q ` r i p _ q ` r
6. p ^ q ` r i p ` q ) r
Note that we have \evaluation" by re exivity and (6):
p)q`p)q
(p ) q) ^ p ` q
Thus we also have \modus ponens" by (4) and transitivity:
> ` p ) q and > ` p
> ` (p ) q) ^ p
>`q
Moreover, there are \proje tions":
p^q `p^q
p ^ q ` p (resp. q)
from whi h it follows easily that p a` > ^ p.
Let's derive the usual axioms for the positive intuitionisti al ulus, namely:
1. p ) p,
2. p ) (q ) p),
3. (p ) (q ) r)) ) ((p ) q) ) (p ) r)).

Draft of February 5, 2003


6.4 Properties of exponentials 103

The rst two are almost immediate.


p`p
>^p`p
>`p)p
and
p^q `p
p`q)p
> ^ p ` (q ) p)
> ` p ) (q ) p)
We leave the third one as an exer ise.
The positive fragment of IPC, involving only the logi al operations:
>; ^; )
orresponds exa tly to the notion of a artesian losed poset. It is then straight-
forward to add disjun tion on the logi al side, and joins on the algebrai side.
The exa t orresponden e an be stated in terms of mutually inverse onstru -
tions going ba k and forth between Heyting algebras and intuitionisti proposi-
tional al uli. We shall not pursue this in detail here, but merely indi ate one
dire tion:
Given any intuitionisti propositional al ulus L, onsisting of propositional
formulas over some set of variables, together with the rules of inferen e stated
above, plus perhaps some distinguished formulas as axioms, one an onstru t
from L a Heyting algebra HA(L) (\Lindenbaum-Tarski algebra") onsisting of
equivalen e lasses [p℄ of formulas p, where:
[p℄ = [q℄ i p a` q
The operations in HA(L) are indu ed in the obvious way by the logi al oper-
ations, e.g. [p℄ ^ [q℄ = [p ^ q℄, et . This algebra then has the property that a
formula p is provable in L just if [p℄ = 1. It follows that intuitionisti propo-
sitional al ulus is sound and omplete for models in Heyting algebras, a fa t
whi h we will not spell out in greater detail.

6.4 Properties of exponentials


Here we olle t up - sometimes without proof - some of the basi properties of
exponentials.
First, let us onsider, what is the transpose of evaluation?
 : BA  A ! B
Draft of February 5, 2003
104 Exponentials

It must be
~ : B A ! B A
su h that
(~  1A ) = 
i.e. making the following diagram ommmute:
 >
BA  A B
^

~  1A

BA  A
Sin e 1BA  1A = 1(BA A) learly has this property, we must have
~ = 1BA
and so  = (1BA .
Proposition 6.11. Exponentiation by a xed obje t A in a CCC is a fun tor.
Let's show that the operation
B 7! B A
on a CCC is fun torial. In Sets, given some
:B!C
we put:
A : BA ! C A
de ned by
f 7! Æ f;
I.e.
A
 Æ f = A (f )
f 
_ R
B > C

Draft of February 5, 2003
6.4 Properties of exponentials 105

This assignment is fun torial, be ause: for any : C ! D:


( Æ )A (f ) = Æ Æ f
= Æ A (f )
= A Æ A (f )
When e ( Æ )A = A Æ A . Also:
(1B )A (f ) = 1B Æ f
=f
= 1BA (f )
So (1B )A = 1BA .
In a general CCC then, given : B ! C , we de ne
A : BA ! C A
by
A := ( ~Æ ):
That is, we take the transpose of:

BA  A ! B! C;
giving
A = ~ : B A ! C A :
It's easier to see in the form:
 >
CA  A C
^ ^
A  1A

BA  A >

(where A : B A ! C A ). Now, learly
(1B )A = 1BA : B A ! B A
by examining:
BA  A >B
^ ^
1(BAA) = 1BA  1A 1B

BA  A >B

Draft of February 5, 2003
106 Exponentials

Quite similarly, given



B! C! D;
we have:
A Æ A = ( Æ )A :
This follows from onsidering the ommutative diagram:
 >
DA  A D
^ ^
A  1A

CA  A > C
^  ^
A  1A

BA  A > B

We use the fa t that:
( A  1A ) Æ ( A  1A) = (( A Æ A )  1A):
This suggests looking for another \universal" arrow, namely the transpose
of
1AB : A  B ! A  B
i.e.
1A~B : A ! (A  B )B :
It has the values in Sets:
~1AB (a)(b) = ha; bi:
One sometimes denotes this map
 := ~1AB ;
where, again (a)(b) = ha; bi. The map  lets us ompute f~ from
f : Z  A ! B;
namely, given f : Z  A ! B take
f A : (Z  A)A ! B A
Draft of February 5, 2003
6.5 Equational de nition 107

and pre ompose with  : Z ! (Z  A)A as in


fA > A
(Z  A)A B
^


f
Z
This gives the useful equation:
f~ = f A Æ  ;
whi h the reader should prove.

6.5 Equational de nition


We have the following useful des ription of CCCs:
A ategory C is a CCC i it has the following stru ture:
 A distinguished obje t 1, and an operation ! : Cobj ! Carr su h that for
all obje ts C
!(C ) : C ! 1
and for ea h arrow f : C ! 1
f =!(C ):
 For ea h pair of obje ts (A; B ), there are arrows
1 : A  B ! A and 2 : A  B ! B
and for ea h pair of of arrows f : Z ! A and g : Z ! B , there is an arrow
hf; gi : Z ! A  B
satisfying
p1 hf; gi = f
p2 hf; gi = g
hp1 h; p2 hi = h for all h : Z ! A  B
 For ea h pair of obje t (A; B ), there is an obje t B A , an arrow  : B A 
A ! B , and for all arrows f : Z  A ! B an arrow f~ : Z ! B A su h that
 Æ (f~  1A ) = f
and
( Æ (g  1A ) = g
for all g : Z ! B A where g  1A = hgp1 ; p2 i : Z  A ! B A  A.

Draft of February 5, 2003


108 Exponentials

6.6 - al ulus
We have seen that the notions of a CC poset with nits joins (i.e. Heyting
Algebras) and intuitionisti propositional al ulus are essentially the same:
HA  IPC
These are two di erent ways of des ribing equivalent stru tures, and ea h an
be re overed from the other.
We now want to onsider another orresponden e with logi , involving more
general CCC's, and equally pre ise. Namely,
CCC   Cal ulus:
These notions are also \equivalent," in a sense that we'll now sket (a more
detailed treatment an be found in the book by Lambek and S ott). They are
two di erent ways of presenting the same idea, namely a olle tion of obje ts
and fun tions with operations of pairing and transposition or urrying.
First, re all the (typed) - al ulus from hapter 3; it onsists of:
 Types: A  B; A ! B; : : : (and some basi types)
 Terms: x; y; z; : : : : A (variables for ea h type A)
a : A; b : B; : : : (possibly some typed onstants)
ha; bi : A  B (a : A; b : B )
fst( ) : A ( : A  B )
snd( ) : B ( : A  B )
a : B ( : A ! B; a : A)
x:b : A ! B (x : A; b : B )

 Equations:
fst(ha; bi) = a
snd(ha; bi) = b
hfst( ); snd( )i) =
(x:b)a = b[a=x℄
x: x = (no x in )

The ategory of types C() was de ned as follows:


 obje ts: the types,
 arrows A ! B : losed terms : A ! B , identi ed if  0 ,
 identities: 1A = x:x (where x : A),

Draft of February 5, 2003


6.6 - al ulus 109

 omposition: Æ b = x: (bx).


We've already seen that this is a well-de ned ategory, and that it has binary
produ ts. It's a simple matter to add a terminal obje t. Let's use the equational
hara terization of CCCs to show that it is CCC. Given any obje ts A; B , we
set B A = A ! B , the evaluation arrow is:
 = z: fst(z )snd(z ) : B A  A ! B ; (z : Z )
and for any arrow f : Z  A ! B , we take as the transpose:
f~ = zx: f hz; xi : Z ! B A ; (z : Z; x : A)
It is now a straightforward - al ulus al ulation to verify the two required
equations:
 Æ (f~  1A ) = f
( Æ (g  1A )) = g
Given a theory L in - al ulus (a set of basi types and terms, and a set of
equations), the CCC C(L) built from the - al ulus over L is the \free CCC on
a model of L," in a straight-forward sense, given the notion of a model of L in
a CCC C. Roughly speaking, a model is an assignment of the types and terms
of L to obje ts and arrows of C,
X basi types ; [X ℄ obje ts,
b : A ! B basi terms ; [b℄ : [A℄ ! [B℄ arrows,
in su h a way that all the - al ulus operations are taken to the orresponding
CCC ones, and all the equations are satis ed, in the sense that:
if a = b : A ! B; then [a℄ = [b℄ : [A℄ ! [B ℄:
The onstru tion has the property that if M = [ ℄M is any model in a CCC C,
then it arises uniquely from a CCC fun tor
[ ℄M : C(L) ! C
de ned by
x 7! [x℄M :
If [a℄ = [b℄ : X ! Y in C(L), then by the de nition of [x℄, a = b is provable
in L. Thus, with a bit more work, one an show:
Theorem 6.12 (CCC ompleteness). For any - al ulus L, and any terms
a; b in L,
L`a=b if for all models M in CCC's, [a℄M = [b℄M

Draft of February 5, 2003


110 Exponentials

This says that - al ulus is dedu tively omplete for models in CCC's. Sound-
ness follows similarly from the fa t that C(L) is \free". Note that this statement
is not true for models in Sets; indeed there are - al uli in whi h equations that
hold for all models in Sets are not provable (S ott's notion of a \re exive do-
main" is an example).
Finally, let's note that the notions of - al ulus and CCC are really \equiv-
alent", in the sense that any CCC C also gives rise to a - al ulus L(C), and
this onstru tion is essentially inverse to the one:
L ; C(L):
Namely, given a CCC C, de ne L(C) by:
Basi Types: Obje ts of C
Basi Terms: a : A ! B for ea h a : A ! B in C
Equations:
x:fst(x) = p1
x:snd(x) = p2
y:f (x; y) = f~(x)
g(f (x)) = (g Æ f )(x)
1A = y: y

This suÆ es to ensure that:


C(L) 
=C
and
L(C(L))  L:
The last equation is not really stri t, and sin e we don't have a good notion of
morphism for - al uli, it's not immediate what to all an \isomorphism." The
resulting al ulus is something like the \de nitional ompletion" of the original
one L.

6.7 Exer ises


1. Show that for all nite sets M and N ,
jN M j = jN jjM j ;
where jK j is the number of elements in the set K , while N M is the expo-
nential in the ategory of sets (the set of all fun tions f : M ! N ), and
nm is the usual exponentiation operation of arithmeti .
Draft of February 5, 2003
6.7 Exer ises 111

2. Show that for any three obje ts A; B; C in a artesian losed ategory,


there are isomorphisms:
(a) (A  B )C 
= AC  B C
(b) (AB )C 
= ABC
3. Determine the exponential transpose "~ of evaluation " : B A  A ! B (for
any obje ts in any CCC).
In Sets, determine the transpose ~1 of the identity 1 : A  B ! A  B . Also
determine the transpose of " Æ  : A  B A ! B , where  : A  B A ! B A  A
is the \twist" arrow  = hp2 ; p1 i.
4. Show that for any obje ts A; B in a artesian losed ategory, there is a
bije tive orresponden e between points of the exponential 1 ! B A and
arrows A ! B .
5. Show that the ategory of !CPOs is artesian losed, but that the ategory
of stri t !CPOs is not (the stri t !CPOs are the ones with initial obje t
?, and the ontinuous maps between them are supposed to preserve ?).
6. Show that in any artesian losed poset, the third law of positive intu-
itionisti propositional al ulus holds (in addition to the other two shown
in lass):
(p ) (q ) r)) ) ((p ) q) ) (p ) r))

7. * Prove that in a CCC C, exponentiation by a xed obje t C is a fun tor


expC : C ! C, where expC (A) = AC .

Draft of February 5, 2003


112 Exponentials

Draft of February 5, 2003


Chapter 7

Fun tors
We want to start now onsidering ategories and fun tors more systemati ally,
developing the \ ategory theory" of ategory theory, rather than of other math-
emati al obje ts, like groups, or formulas in a logi al system. Let me emphasize
that, while some of this may look like a lot of abstra t nonsense, the idea is that
when one has a parti ular appli ation at hand, the theory an be spe ialized
to that on rete ase (even though I won't always take the time to give you
examples of this).
Let's begin by reviewing what we know about the ategory Cat of ategories
and fun tors, tieing up some loose ends.

7.1 Category of ategories


We've already seen that Cat has:
 nite oprodu ts 0, C + D, et .
 nite produ ts 1, C  D, et .
And it is easy to see that there are all small oprodu ts and produ ts. We an
therefore show that it has all limits by onstru ting equalizers:
E F >D
E >C >
G
Indeed, let:
E0 = fC 2 C0 j F (C ) = G(C )g
E1 = ff 2 C1 j F (f ) = G(f )g
and let E : E ! C be the evident in lusion. Then this is plainly an equalizer,
as the reader an easily he k.

Draft of February 5, 2003


114 Fun tors

The ategory E is also an example of a sub ategory, i.e. a monomorphism


in Cat (remember that equalizers are monos). Usually, by a sub ategory of a
ategory C one means, more spe i ally, a olle tion U = (U0 ; U1 ) of some of
the obje ts and arrows of C, losed under the operations dom; od; id, and Æ.
There is then an evident in lusion fun tor
i:U!C
for any su h sub ategory U, and this i is learly moni .
There are various other properties of fun tors than mono and epi, whi h
turn out to be useful in Cat; let's x a fun tor F : C ! D for the following
de nitions.
De nition 7.1. The fun tor
F :C!D
is:
 inje tive on obje ts if F0 : C0 ! D0 is inje tive, it is surje tive on obje ts
if F0 is surje tive.
 Similarly F is inje tive resp. surje tive on arrows if F1 is inje tive resp.
surje tive.
F is faithful if for all A; B 2 C0 , the map
FA;B : homC (A; B ) ! homD (F A; F B )
de ned by f 7! F (f ) is inje tive.

Similarly, F is full if FA;B is always surje tive.
What's the di eren e between faithful and inje tive on arrows? Consider for
example the \ odiagonal fun tor" r : C + C ! C, as indi ated in the following:
C > C +C < C

1C
r
1C
R
_
C
r is faithful, but not inje tive on arrows.
A full sub ategory
UC
onsists of some obje ts of C and all of the arrows between them (thus satisfying
the losure onditions for a sub ategory). For example, the fun tor Setsfin 
Sets is full, but the forgetful fun tor Groups  Sets is not.
Here's another example of a non-full sub ategory, maybe less obvious.

Draft of February 5, 2003


7.1 Category of ategories 115

Example 7.2. Re all that every ategory C has an arrow ategory C2 whose
d
obje ts are arrows in C, and an arrow from C0 ! C1 to D0 ! D1 is a pair of
C arrows (f0 ; f1) satisfying:
f0 >
C0 D0

d
_ _
C1 > D1
f1
There are then evident fun tors dom; od : C2 ! C de ned on obje ts by

(C0 ! C1 ) 7! dom( ) = C0

(C0 ! C1 ) 7! od( ) = C1 ;
and similarly on arrows f : a ! b.
Now onsider a fun tor,
A:1!C
whi h is just an obje t A of C, and take the pullba k (whi h we know exists
sin e Cat has limits):
p2 > 2
C2A C

p1 od
_ _
1 >C
A
a
A moment's thought shows that C2A has obje ts of the form X ! A and an
f 0
arrow from a ! a is given by a ommutative square:
f
X > X0

a a0
_ _
A > A
1A
So C2A is (isomorphi to) the \sli e ategory" over A:
C2A 
= C=A;
Draft of February 5, 2003
116 Fun tors

onsisting of triangles over A. Why is p2 : C=A ! C2 moni ? It's the pullba k


of A : 1 ! C, and any arrow from a terminal obje t is moni . Why is it
(usually) not full? Taking obje ts X !a
A and X 0 !
a
A, an arrow f : a ! a0
0

f0 > 0
X X

a a0
_ _
A0 > A
f1
of C2 is in C=A if and only if f1 = 1A.

7.2 Representable fun tors


Let C be a lo ally small ategory, so there is always a set :
homC (C; C 0 ) 2 Sets:
Fixing C 2 C0 , we have the representable fun tor :
homC (C; ) : C ! Sets:
Re all that the representables are examples of stru ture preserving fun tors: if
X X Y !Y
is a produ t diagram in C, then
hom(C; X ) hom(C; X  Y ) ! hom(C; Y )
is a produ t diagram in Sets. Thus, by the uniqueness of produ ts up to
isomorphism, we have:
homC (C; X  Y ) 
= homC (C; X )  homC (C; Y ) :
De nition 7.3. A ontravariant fun tor from C to D is a fun tor
Cop ! D
Contravariant fun tors reverse the order of omposition and ex hange do-
mains and odomains. A good example of a ontravariant fun tor is provided
by the \other" representables:
homC ( ; C ) = homCop (C; ) : Cop ! Sets
Thus homC ( ; C ) takes
f :A!B
Draft of February 5, 2003
7.2 Representable fun tors 117

to
homC (f; C ) : homC (B; C ) ! homC (A; C ) ;
de ned for h : B ! C by
homC (f; C )(h) = h Æ f:
It follows from the foregoing that ontravariant representables take oprod-
u ts to produ ts:
homC (X + Y; C ) 
= homCop (C; X  Y )

= homCop (C; X )  homCop (C; Y )

= homC (X; C )  homC (Y; C )
Example 7.4. Given the boolean algebra 2 with the usual (truth-table) opera-
tions ^; _; :; 0; 1, for any set X , we an make
homSets (X; 2) = 2X
into a boolean algebra with the pointwise operations:
0(x) = 0
1(x) = 1
(f ^ g)(x) = f (x) ^ g(x)
et .
When we de ne the operations in this way in terms of those on 2 we see imme-
diately that hom(X; 2) is a boolean algebra too, and that
hom( ; 2) : Setsop ! BA
is a ontravariant fun tor, de ned by
f 2 Yf
(X ! Y ) 7! (2X ! 2 )
where 2f is the pre omposition map 2f = hom(f; 2). It is then almost immediate
that 2f is a boolean homomorphism; e.g., we have:
2f (h ^ g)(x) = [(h ^ g) Æ f ℄(x)
= (h ^ g)f (x)
= hf (x) ^ gf (x)
= 2f (h)(x) ^ 2f (g)(x)
= [2f (h) ^ 2f (g)℄(x):
Now observe that the isomorphism
2X 
= P (X ) ;
Draft of February 5, 2003
118 Fun tors

between fun tions  : X ! 2 and subsets  1 (1) = U  X , takes the boolean


operations in 2X to the subset operations interse tion, union, et . in P (X ):
U^ = U [ U
U1 = X
U0 = ;
et .
The boolean operations on P (X ) are thus inherited from those on 2, and P is
a ontravariant fun tor,
P : Setsop ! BA
where, for f : X ! Y , P (f ) : P (Y ) ! P (X ) is de ned for all V  Y by
V 7! f 1(V ). We therefore have a ommutative square:

=
2X > P (X )
^ ^
2f P (f ) (7.1)

2Y  > P (Y )
=
In parti ular, we see that the fun tion
f 1 = P (f ) : P (Y ) ! P (X )
is a boolean homomorphism.
The ommutative diagram (7.1) says something about the fun tors 2 =
hom( ; 2) and P , namely that they are isomorphi as fun tors, not just that
all of their values are isomorphi . This is also expressed by saying that they
are naturally isomorphi ; this is a spe ial ase of the general notion of a natural
transformation between fun tors, whi h is the topi of the next hapter.
Example 7.5. A similar situation o urs in topology; onsider the ring R of real
numbers and, for any spa e X , let
C (X ) = homTop (X; R)
denote the ring of real-valued, ontinuous fun tions on X ,
f :X!R
with the pointwise operations. Just as in the previous ase, if
h:Y !X
is ontinuous, we then get a homomorphism
h : C (X ) ! C (Y )
Draft of February 5, 2003
7.3 Stone representation 119

by pre omposing with h. The de nition of C (X ) as a representable fun tor


ensures that this \ring of real-valued fun tions" onstru tion is a fun tor
Topop ! Rings:

7.3 Stone representation


At the \other side," so to speak, of the example about powersets and boolean
algebras, we have the following very similar situation.
Example 7.6. Re all that an ultra lter in a boolean algebra B is a subset U of
B su h that
 12U
 x; y 2 U implies x ^ y 2 U
 x 2 U and x  y implies y 2 U
 U  U 0 and U 0 a lter implies U 0 = B (equivalently, for every x 2 B,
either x 2 U or :x 2 U )
We already know that:
Ult(B ) 
= homBA (B; 2)
In fa t, we now see that Ult(B ) is fun torial and ontravariant. Indeed, given
a boolean homomorphism h : B ! B 0 , let:
Ult(h) = h 1 : Ult(B 0 ) ! Ult(B )
Of ourse, we have to show that the inverse image h 1 (U )  B of an ultra lter
U  B 0 is an ultra lter. But sin e U = U 1 (1) for a (unique) U : B 0 ! 2, we
have
Ult(h)(U ) = h 1 (U 1 (1))
= (U Æ h) 1 (1)
whi h is therefore an ultra lter.
h
B > B0
...
. . ..
... U
...
R. _
2

Draft of February 5, 2003


120 Fun tors

Thus we have a ontravariant fun tor of ultra lters in a boolean algebra:


Ult : BAop ! Sets
as well as a ontravariant fun tor oming ba k:
P : Setsop ! BA
The onstru tions
Ult >
BAop < Sets
P
are not mutually inverse, sin e in general:
X 6= Ult(P (X )):
(But what if X is nite?) Instead, there is a more subtle relation between them,
whi h we'll onsider in more detail later; namely these are adjoint fun tors, and
we have here a spe ial ase of Stone duality.
For now, onsider the following observations. Let:
UF = Ult Æ P : Sets ! BAop ! Sets ;
thus:
UF (X ) = fU  P (X ) j U an ultra lter g
is a ovariant fun tor on Sets. Moreover, there is a map
 : X ! UF (X )
de ned by
x 7! Ux = fU  X j x 2 U g :
This map has a spe ial property, namely the following diagram always om-
mutes:

X X > UF (X )

f UF (f )
_ _
Y
Y
> UF (Y )
i.e. UF (f ) Æ X = Y Æ f .
This is so be ause in general:
UF (f )(U ) = fV  Y j f 1(v) 2 Ug;
Draft of February 5, 2003
7.3 Stone representation 121

so here we have:
(UF (f ) Æ X )(x) = UF (f )(Ux )
= fV  Y j f 1(V ) 2 Ux g
= fV  Y j x 2 f 1 (V )g
= fV  Y j fx 2 V g
= Ufx
= (Y Æ f )(x)
This is an instan e of a morphism between fun tors, namely
 : 1Sets ! UF ;
alled a natural transformation, whi h is to be our next topi .
Finally, observe that there is also a natural transformation at the \other
side" of this situation, namely in the ategory BA of boolean algebras, where
for every boolean algebra B there is a homomorphism:
B : B ! P (Ult(B ))
given by:
B (b) = fU 2 Ult(B ) j b 2 Ug
It is not hard to see that B is always inje tive (using the boolean prime ideal
theorem!). The boolean algebra P (Ult(B )), together with the homomorphism
B , is alled the Stone representation of B . It represents the arbitrary boolean
algebra B as an algebra of subsets.

Draft of February 5, 2003


122 Fun tors

7.4 Exer ises


1. Using the fa t that representable fun tors preserve nite limits, show that
for any sets A; B; C :
AB+C 
= AB  AC :

Con lude that for any sets A, B with power sets P (A), P (B ), et .:
P (A + B ) 
= P (A)  P (B ):

2. Complete the proof that the set U (X ) of ultra lters on a set X is ( ovari-
antly) fun torial. Is the fun tor U faithful?
3. Consider the forgetful fun tors:
Groups U! Monoids V! Sets

Say whether ea h is faithful, full, inje tive on obje ts, surje tive on obje ts.
4. * Make any poset (X; ) into a topologi al spa e by letting U  X be
open just if x 2 U and x  y implies y 2 U (U is \ losed upwards"). This
is alled the Alexandro topology on X . Show that it gives a fun tor
A : Pos ! Top
from posets and monotone maps to spa es and ontinuous maps by show-
ing that any monotone map of posets f : P ! Q is ontinuous with respe t
to this topology on P and Q (the inverse image of an open set must be
open).
Is A faithful? Is it full?
How would the situation hange if instead one took as open sets those
subsets that are losed downwards?
5. * Prove that every fun tor F : C ! D an be fa tored as
C E! E M! D
in the following two ways:
(a) E : C ! E is surje tive on obje ts and full, and M : E ! D is
faithful;
(b) E : C ! E surje tive on obje ts and M : E ! D is full and faithful.
When do the two fa torizations agree?

Draft of February 5, 2003


Chapter 8

Natural transformations
A natural transformation is a morphism of fun tors. That's right: for xed
ategories C and D we an regard the fun tors C ! D as the obje ts of a new
ategory, and the arrows between these obje ts are what we shall all natural
transformations. They are to be thought of as di erent ways of \relating"
fun tors to ea h other, in a sense that we'll now explain.

8.1 Naturality
Let's begin by onsidering a ertain kind of situation that often arises: we
have some onstru tion on a ategory C and some other onstru tion, and we
observe that these two onstru tions are related to ea h other in a way that
is independent of the obje ts and arrows of C. That is, the relation is really
between the onstru tions themselves. For a simple example, suppose C has
produ ts and onsider, for obje ts A; B; C 2 C,
(A  B )  C and A  (B  C ):
Regardless of what obje ts A; B , and C are, we have an isomorphism
h : (A  B )  C ! A  (B  C ):

What does it mean that this isomorphism doesn't really depend on the parti ular
obje ts A; B; C ? One way to explain it is this:
Given any f : A ! A0 , we get a ommutative square
hA>
(A  B )  C A  (B  C )

_ _
(A0  B )  C > A0  (B  C )
hA0
Draft of February 5, 2003
124 Natural transformations

So what we really have is an isomorphism between the onstru tions:


(  B )  C and (B  C );
without regard to what's in the argument-pla e of these.
Now, by a \ onstru tion" we just mean a fun tor, and by a \relation between
onstru tors" we mean a morphism of fun tors (whi h is what we are about to
de ne). In the example, it's an isomorphism:
(  B)  C 
=  (B  C )
For fun tors C ! C. In fa t, we an onsider the fun tors of three argu-
ments:
F =( 1 2)  3 : C3 ! C
and
1( 2 !C
G= 3
3) : C
and there is an analogous isomorphism
F
= G:
But an isomorphism is a spe ial morphism, so let's de ne the general notion
rst:
De nition 8.1. For ategories C; D and fun tors
F; G : C ! D;
a natural transformation from F to G, (# : F ! G), is a family of arrows in D
(#C : F C ! GC )C 2C0
su h that, for any f : C ! C 0 in C, the following ommutes:
#C >
FC GC

Ff Gf
_ _
F C0 > GC 0
#C 0

i.e. #C 0 Æ F (f ) = G(f ) Æ #C .
Given su h a natural transformation # : F ! G, the D-arrow #C : F C !
GC is alled the omponent of # at C .
If you think of a fun tor F : C ! D as pi ture of C in D, then you an think
of a natural transformation #C : F C ! GC as a \ ylinder" over the pi ture.

Draft of February 5, 2003


8.2 Examples 125

8.2 Examples
Example 8.2. Consider the free monoid M (X ) on a set X , and de ne a natural
transformation  : idSets ! UM , su h that ea h omponent X : X ! UM (X )
is given by the \insertion of generators" taking every element x to itself, on-
sidered as a word.

X X > UM (X )
...
...
f ... UM (f )
...
.
_ _...
Y > UM (Y )
Y
This is natural, be ause the homomorphism M (f ) on the free monoid M (X ) is
ompletely determined by what f does to the generators.
Example 8.3. Let C be a ategory with produ ts, A 2 C xed. A natural
transformation from the fun tor A  : C ! C to idC is given by taking the
omponent at C to be the se ond proje tion
2 : A  C ! C
From this sort of example, one an build up the isomorphism:
h : (A  B )  C !  A  (B  C )
For another su h example in more detail, onsider the fun tors:
 : C2 ! C
 : C2 ! C
where  is de ned by on obje ts by
A B = B  A ;
and on arrows by
 =  :
De ne a \twist" natural transformation t :  !   by
t(A;B)ha; bi = hb; ai:
To he k that
t
A  B (A;B) > B  A

 
_ _
A0  B 0 > B 0  A0
t(A0 ;B0 )
Draft of February 5, 2003
126 Natural transformations

ommutes, note that


(  )t(A;B) ha; bi = h b; ah
= t(A ;B ) h a; bi
0 0

= t(A ;B ) Æ (  )ha; bi
0 0

so t :  !  is natural. In fa t, ea h omponent t(A;B) is an isomorphism with


inverse t(B;A).
This is a ase of an isomorphism of fun tors.
De nition 8.4. The fun tor ategory Fun(C; D has
obje ts: fun tors F : C ! D,
arrows: natural transformations # : F ! G.
For ea h obje t F , 1F has omponents
(1F )C = 1F C : F C ! F C
# 
and the omposite of F ! G! H has omponents
( Æ #)C = C Æ #C :
De nition 8.5. A natural isomorphism is a natural transformation
#:F !G
whi h is an isomorphism in the ategory Fun(C; D)
Lemma 8.6. A natural transformation is a natural isomorphism i ea h om-
ponent is an isomorphism.
Proof. Exer ise!
In our rst example:
#A >
(A  B )  C A  (B  C )

(f  1B )  1C f  (1B  1C )
_ _
(A0  B )  C > A0  (B  C )
#A 0

where f : A ! A0 , we an say that the isomorphism


#A : (A  B )  C 
= A  (B  C )
is natural in A means that the fun tors
F (A) = (A  B )  C and G(A) = A  (B  C )
are naturally isomorphi .
Here's the lassi al example of a natural isomorphism:

Draft of February 5, 2003


8.2 Examples 127

Example 8.7. Consider the ategory


Ve t(R)
of real ve tor spa es and linear transformations,
f : V ! W:
Every ve tor spa e V has a dual spa e :
V  = Ve t(V; R) of linear transformations:
And every linear transformation
f :V !W
gives a dual linear transformation :
f  : W  ! V ;
de ned by f  (A) = A Æ f for A : W ! R. In brief ( ) = Ve t( ; R) :
Ve top ! Ve t is the ontravariant representable fun tor (endowed with ve tor
spa e stru ture).
Now, it is a well-known fa t in linear algebra that every nite dimensional
ve tor spa e is isomorphi to it's dual spa e
V = V ;
just for reasons of dimension. But there is no \natural" way to hoose su h an
isomorphism. On the other hand, the isomorphism
V = V 
an be hosen in a \natural" way, namely:
V :V ! V 
x 7! (evx : V  ! R)
where evx (A) = A(x), for A : V ! R. The informal \naturality" of the se ond
isomorphism above (and the non-naturality of the rst) an be interpreted as
meaning exa tly that the isomorphism
 : 1Ve t ! 
is a natural transformation. I.e. the following always ommutes
V > 
V V

f f 
_ _
W > W 
W
in Ve t (as the reader should he k!), while there is no su h naturality for V  .

Draft of February 5, 2003


128 Natural transformations

A similar situation o urs in Sets. Here we take 2 instead of R, and the


dual A of a set A then be omes
A = P (A) = Sets(A; 2)
while the dual of a map f : A ! B is the inverse image f  : P (B ) ! P (A).
Note that the evaluation orresponds to (the hara teristi fun tion of) the
membership relation on A  P (A):
 >
2A  A 2


= id
_ _
A  P (A) >2
2~
Transposing again gives a map:
A >
A P P (A) = A
^
 
 =
R
2P (A)
whi h is des ribed by:
A (a) = fU  A j a 2 U g:
In Sets, one always has A stri tly smaller than P (A), so A : A ! A is
never an isomorphism. Nonetheless,  : 1Sets !  is a natural transformation,
whi h the reader should prove.

8.3 Exponentials of ategories


We now wnat to show that Cat is artesian losed, by showing that any two
ategories C; D have an exponential DC . Of ourse, we'll take
DC = Fun(C; D);
for whi h we need to prove the required UMP. (By the way, this is the same as
Diag(C; D) as in the homework).
Proposition 8.8. Cat is a CCC, with
DC = Fun(C; D):

Draft of February 5, 2003


8.3 Exponentials of ategories 129

Before giving the proof, let's note the following. Sin e exponentials are
unique up to \isomorphism", this gives us a way to verify that we have the
\right' " de nition of a morphism of fun tors. The notion of a natural transfor-
mation is ompletely determined by the requirement that it makes the obje ts
Hom(C; D)
into an exponential ategory. This is an example of how ategory theory an
serve as a on eptual tool for dis overing new on epts.
Lemma 8.9 (Bifun tor lemma). A map of arrows and obje ts
F :AB!C
is a fun tor i
1. F is fun torial in ea h argument, i.e. F (A; ) and F ( ; B ) are fun tors
for all A 2 A0 and B 2 B0 .
2. F satis es the following \inter hange law": Given : A ! A0 2 A and
: B ! B 0 2 B,
F (A; )>
F (A; B ) F (A; B 0 )

F ( ; B ) F ( ; B 0 )
_ _
F (A0 ; B ) > F (A0 ; B 0 )
F (A0 ; )
ommutes, i.e. F (A0 ; ) Æ F ( ; B ) = F ( ; B 0 ) Æ F (A; ) in C.
Proof. (of Lemma) In A  B, in any arrow
h ; i : hA; B i ! hA0 ; B 0 i
fa tors as:
hA; B i h1A ; i > hA; B 0 i
h ; 1B i h ; 1B i0

_ _
hA0 ; B i h1 ; i> hA0 ; B 0 i:
A 0

So (1) and (2) are learly ne essary. To show that they are also suÆ ient, we
an de ne the (proposed) fun tor:
F (hA; B i) = F (A; B )
F (h ; i) = F (A0 ; ) Æ F ( ; B )

Draft of February 5, 2003


130 Natural transformations

The inter hange law, together with fun toriality in ea h argument, then ensures
that
F ( 0 ; 0 ) Æ F ( ; ) = F (h 0 ; 0 i Æ h ; i) ;
as the reader should he k, using the following diagram:
F (A; B )
 F ( ; )
F ( ; B ) 
_ R
F (A0 ; B ) > F (A0 ; B 0 )
... F (A0 ; )
...  F ( 0 ; 0 )
F ( 0 ; B ) ..... F ( ; B 0)
_..
...
_
R
> F (A00 ; B 0 )
F (A0 ; B ) .................... > F (A00 ; B 00 )
F (A00 ; ) F (A00 ; 0 )

Proof. (of Proposition) We need to show:


1.  = eval : Fun(C; D)  C ! D is fun torial.
2. For any ategory X and fun tor
F :XC!D
there is a fun tor
F~ : X ! Fun(C; D)
su h that  Æ (F~  1C ) = F .
3. Given any fun tor
G : X ! Fun(C; D)
one has ( Æ (G~ 1C )) = G.
(1) Using the bifun tor lemma, we show that  is fun torial:
Fix F : C ! D and onsider (F; ) = F : C ! D. This is learly
fun torial!
Next, x C 2 C0 and onsider ( ; C ) : Fun(C; D) ! D de ned by:
(# : F ! G) 7! (#C : F C ! GC )
This is also learly fun torial.

Draft of February 5, 2003


8.4 Fun tor ategories 131

For the inter hange law, onsider any # : F ! G 2 Fun(C; D) and (f : C !


C 0 ) 2 C we need the following to ommute:
#C>
ev(F; C ) ev(G; C )

F (f ) G(f )
_ _
ev(F; C 0 ) > ev(G; C 0 )
#C 0
But this holds be ause ev(F; C ) = F (C ) and # is a natural transformation.
The onditions (2) and (3) are now routine. E.g. for (2), given
F :XC!D
let
F : X ! Fun(C; D)
be de ned by:
F (X )(C ) = F (X; C ) :

8.4 Fun tor ategories


Example 8.10. Clearly C1 = C.
What about C2, where:
2=!
This is just the arrow ategory that we already know: C2 = C! .
Example 8.11. \Trans endental Dedu tion of Natural Transformations"
Given the possibility of fun tor ategories DC , we an determine what the ob-
je ts and arrows therein must be as follows:
Obje ts: these orrespond uniquely to fun tors of the form:
1 ! DC
and hen e to fun tors:
C!D
Arrows: these orrespond uniquely to fun tors of the form:
2 ! DC
Draft of February 5, 2003
132 Natural transformations

and hen e to fun tors:


2C! D
respe tively:
C ! D2
But a fun tor into the arrow ategory D2 is just a natural transformation
between two fun tors into D, as the reader an see by drawing a pi ture
of the fun tor's image in D.
Example 8.12. Consider the dis rete ategory
2 = f0; 1g
C2 
= C  C and similarly, for any set I :
Y
CI 
= C:
i2I
Example 8.13. Re all that a (dire ted) graph an be regarded as a pair of sets
and a pair of fun tions
t >
G1 > G0
s
where G1 is the set of edges, and G0 is the set of verti es.
A morphism of graphs h : G ! H is a pair of fun tions h1 and h0 su h that
h1 >
G1 H1

sG sH
_ _
G0 > H0
h0
and
h1 >
G1 H1

tG tH
_ _
G0 > H0
h0
both ommute.
Now onsider the ategory pi tured
 >
>

Draft of February 5, 2003


8.4 Fun tor ategories 133

with exa tly two obje ts and two parallel, non-identity arrows. A graph is then
just a fun tor
! Sets
and a homomorphism of graphs is a natural transformation of these fun tors.
Thus,
Graphs = Sets :
Example 8.14. Take the rst produ t proje tion,
CD !C
and transpose to get a fun tor, usually written:
 : C ! CD :
(C ) is the \ onstant C -valued fun tor":
 (C )(X ) = C for all X 2 D0 .
 (t) = 1C for all t 2 D1 .
and (f ) : (C ) ! (C 0 ) is the natural transformation, ea h omponent of
whi h is f .
Now suppose we have a fun tor
F :D!C
and a natural transformation
# : (C ) ! F :
Then all the omponents of # look like:
#D : C ! F (D)
sin e (C )(D) = C . Moreover, the usual square for natural transformations
be omes a triangle, sin e (C )(d) = 1C for all d : D ! D0 . Thus # is exa tly a
one to F . Similarly, a map of ones is just a natural transformation.
Example 8.15. Take posets P; Q and onsider the fun tor ategory,
QP :
The fun tors Q ! P , as we know, are just monotone maps, but what is a
natural transformation?
#:f !g
Draft of February 5, 2003
134 Natural transformations

For ea h p 2 P we must have


#p : fp  gp
and if p  q, then there must be a ommutative square involving fp; fq and
gp; gq, whi h however is automati . Thus the only ondition is that 8p: fp  gp,
i.e. f  g pointwise. Sin e this is just the usual ordering of the poset QP , the
exponential poset agrees with the fun tor ategory. Thus we have:
Proposition 8.16. The in lusion fun tor,
Pos ! Cat
preserves CCC stru ture.
What if we take the fun tor ategory of two groups G and H ,
H G;
do we get an exponential of groups?

8.5 Exer ises


1. Show that a natural transformation is a natural isomorphism just if ea h of
its omponents is an isomorphism. Is the same true for monomorphisms?
2. Show that a fun tor ategory DC has binary produ ts if D does ( onstru t
the produ t of two fun tors F and G \obje twise": (F  G)(C ) = F (C ) 
G(C )).
3. Show that the map of sets
A : A ! P P (A)
a7 ! fU  Aja 2 U g
is the omponent at A of a natural transformation  : 1Sets ! P P , where
P : Setsop ! Sets is the ( ontravariant) power-set fun tor.
4. Let C be a lo ally small ategory. Show that there is a fun tor
hom : Cop  C ! Sets
su h that for ea h obje t C of C,
hom(C; ) : C ! Sets
is the ovariant representable fun tor and
hom( ; C ) : Cop ! Sets
is the ontravariant one. (Hint: use the Bifun tor Lemma )

Draft of February 5, 2003


Chapter 9

Equivalen e of ategories
Before we start examining fun tor ategories in more detail, I want to onsider
one very spe ial appli ation of the idea of natural isomorphism. Consider rst
the following situation.
Example 9.1. Let Ordf be the ategory of nite ordinal numbers. Thus the
obje ts are the sets 0; 1; 2; : : : , where 0 = ; and n = f0; : : : ; n 1g, while the
arrows are all fun tions between these sets. Now suppose that for ea h nite
set A we sele t an ordinal jAj that is it's ardinal, so there is an isomorphism
jAj 
= A:
And the for ea h fun tion f : A ! B of nite sets we have a fun tion jf j by
ompleting the square:

=
A > jAj
f jf j
_ _
B 
=
> jB j:
THis gives a fun tor,
j j : Setsf ! ordf :
A tually, the maps above are in Setf , so we should also make the in lusion
fun tor,
i : ordf ! Setsf ;
expli it, and write
 ijAj;
#A : A !
Draft of February 5, 2003
136 Equivalen e of ategories

and
i(jf j) Æ #A = #B Æ f:
This says that we have a natural isomorphism:
# : 1Setsf !iÆj j
between two fun tors of the form:
Setsf ! Setsf :
On the other hand, if we take an ordinal and take it's ordinal, we get nothing
new:
ji( )j = 1Ordf : Ordf ! Ordf ;
sin e
ji(n)j = n and ji(f )j = f : n ! m:
In summary, then, we have a situation where two ategories are very similar;
but they are not the same, and they are not even isomorphi (why?).
This kind of orresponden e between two ategories is what is aptured by
the notion of equivalen e of ategories.

9.1 De nition of equivalen e


De nition 9.2. A fun tor
E:C!D
is an equivalen e of ategories if there exists a fun tor
C D:F
and natural isomorphisms
 F ÆE
:1C ! in CC ;
:1 ! E ÆF in DD :
D

 Su h an F is alled a pseudo-inverse of E .
 C and D are alled equivalent, written C = D.
First of all, observe that equivalen e of ategories is a generalization of iso-
morphism. Two ategories C; D are isomorphi if there are fun tors
F : C ! D and G : D ! C
Draft of February 5, 2003
9.1 De nition of equivalen e 137

su h that
1C = GF;
1D = F G:
In the ase of equivalen e C  = D, we repla e the identity natural transforma-
tions above by natural isomorphisms.
The point of this is that in ategory theory, we don't really are about iden-
tity of obje ts, but only isomorphism. So it's really equivalen e of ategories
that is the more useful notion of \similarity". Indeed, one an think of equiva-
len e as \isomorphism up to isomorphism".
In the example Setsf  = Ordf we see that every set is isomorphi to an
ordinal, and the maps between ordinals are just the maps between them as
sets :
1. for every set A, there's an n:
A
= i(n)

2. homOrdf (n; m) 
= homSetsf (i(n); i(m)), where i : Ordf ! Setsf .
In fa t, these onditions are hara teristi of equivalen es, as the following
proposition shows:
Proposition 9.3. The following onditions on a fun tor F : C ! D are equiv-
alent:
1. F is an equivalen e of ategories.
2. F is full and faithful, and \essentially surje tive" on obje ts: for every
D 2 D there's some C 2 C su h that F C  = D.
Proof. (1 implies 2) Take E : D ! C, and
 EF;
:1C !
:1 ! F E:
D
 EF (C ) and
In C, for any C , we then have C : C !
C >
C EF (C )

f EF (f )
_ _
C0 > EF (C 0 )
C 0

ommutes for any f : C ! C 0 .

Draft of February 5, 2003


138 Equivalen e of ategories

Thus, if F (f ) = F (f 0 ), then EF (f ) = EF (f 0 ), so f = f 0 . So F is faithful.


Note that by symmetry, E is also faithful.
Now take any arrow
h : F (C ) ! F (C 0 ) in D;
and onsider

=
C > EF (C )

f E (h)
_ _
C0  > EF (C 0 )
=
where f = ( C ) 0
1 Æ E (h) Æ Then we have also F (f ) : F (C ) ! F (C 0 ) and
C.

EF (f ) = E (h) : EF (C ) ! EF (C 0 )
by the square:
C >
C EF (C )

f EF (f )
_ _
C0 > EF (C 0 )
C 0

Sin e E is faithful, F (f ) = h. So F is also full.


Finally, for any obje t D 2 D, we have:
:1 !  FE
D

where
D : D 
= F E (D) where E (D) 2 C0 :
(2 implies 1) We need to de ne E : C D and
:1C ! EF;
:1 !  F E:
D

Sin e F is essentially surje tive, for ea h D 2 D0 we an pi k E (D) 2 C0 su h



that there's some D : DF E (D). That gives E on obje ts, and the proposed
omponents of : 1D ! F E .

Draft of February 5, 2003


9.2 Examples 139

Given h : D ! D0 in D, onsider:
D >
D F E (D)

h D 0 Æ h Æ D 1
_ _
D0 > F E (D0 )
D 0

Sin e F : C ! D is full and faithful, we an nd a unique arrow:


E (h) : E (D) ! E (D0 )
with F E (h) = D Æ h Æ D1 . It's easy to see that then E : D ! C is a fun tor,
0

and : 1D !  F E is a natural isomorphism. To nd : 1 ! EF , apply F


C
FC
to C ! EF (C ) to get F (C ) ! F EF (C ). Sin e F is full and faithful, the
preimage of F C is an isomorphism,
= F 1 ( ) : C !  EF (C );
C FC
whi h is easily seen to be natural, sin e is. That is:
C >
C EF (C )

f EF (f )
_ _
C0 > EF (C 0 )
C 0

ommutes i the following does:


F C >
FC F EF (C )

F (f ) F EF (f )
_ _
F C0 > F EF (C 0 )
F C 0

9.2 Examples
Example 9.4. Par is the ategory of sets and partial fun tions; we write these
arrows in Sets like this:
f :A+B
Draft of February 5, 2003
140 Equivalen e of ategories

where f : U ! B for some U  A. Identities in Par are the same as those in


f
Set, i.e. 1A is the total identity fun tion on A. The omposite of A  Uf !
g
B and B  Ug ! C is given as follows: Let U(gÆf ) := f 1(Ug )  A, then
g
f (U(gÆf ) )  Ug ! C , so g is de ned and we may put
f jU(gÆf )
g Æ f : A  U(gÆf ) ! Ug !g C:
This is indi ated in the diagram:

jf j 1 (Ug ) > Ug
jg j
> C
_ _

_ _
Uf > B
_ jf j

_
A
It's easy to see that omposition is asso iative and that identities are units.
The ategory of pointed sets,
Sets
has as obje ts, sets A equipped with a distinguished \point," i.e. pairs:
(A; a) with a 2 A :
Arrows are fun tions that preserve the point, i.e. an arrow f : (A; a) ! (B; b)
is a fun tion f : A ! B su h that f (a) = b.
Now we show:
Proposition 9.5. Par 
= Sets
The fun tors establishing the equivalen e are as follows:
F : Par ! Sets
is de ned on an obje t A by F (A) = (A [ fg; ) where  is a new point that
we add to A. We also write A = A [ fg. For arrows, given f : A + B ,
F (f ) : A ! B is
(
f (x) if x 2 Uf
f(x) =
 otherwise:

Draft of February 5, 2003


9.2 Examples 141

Clearly f (A ) = B , so in fa t f : A ! B as required.


Coming ba k:
G : Sets ! Par
is de ned on an obje t (A; a) by G(A; a) = A fag and for an arrow f : (A; a) !
(B; b),
G(f ) : A fag ! B fbg
is the partial fun tion de ned by G(f )(x) = f (x) whenever f (x) 6= b, where we
let UG(f ) = A f 1 (b).
Now F Æ G is the identity on Par, be ause we're just adding a new point
and then throwing it away. But G Æ F is only naturally isomorphi to 1Sets , 

sin e
(A; a) 
= ((A fag) [ fg; ) ;
but not \=" sin e a 6=  (that's identity of sets!) It still needs to be he ked,
of ourse, that F and G are fun torial, and that the omparison (A; a)  = ((A
fag) [ fg; ) is natural, but we leave these easy veri ations to the reader.
Example 9.6. A lass of examples of equivalen es of ategories are given by
what are alled \dualities". Often, lassi al duality theorems are not of the
form C  = Dop (mu h less C = Dop ), but rather C ' Dop , i.e. C is equivalent
to the dual of D. This is be ause the duality is established by a onstru tion
whi h returns the original thing only up to isomorphism, not on-the-nose. Here
is a simple example, whi h is a very spe ial ase of the far rea hing Stone-Duality
theorem:
Proposition 9.7. BAf ' (Setsf )op
Thus the ategory of nite boolean algebras is dual to the ategory of nite
sets; i.e. it's equivalent to the opposite.

Proof. The fun tors at issue here are the ontravariant powerset fun tor,
P : (Setsf )op ! BAf
on one side, and going ba k, the fun tor

f ) ! Setsf
A : (BAop
taking the \atoms," as follows
A(B) = fa 2 B j b < a ) b = 0g
Thus A(B) is the set of atoms in B.

Draft of February 5, 2003


142 Equivalen e of ategories

Lemma 9.8. For any nite boolean algebra B, there is an isomorphism between
atoms a in B and ultra lters U  B, given by
^
U 7! b;
b 2U
and
a 7!" (a) :
Proof. Exer ise!
Sin e we already know that the set of ultra lters Ult(B) is ( ontravariantly)
fun torial (it's represented by the boolean algebra 2!), we also have a ontravari-
ant fun tor of atoms A  = Ult. The expli it des ription of this fun tor is this: if
h : B ! B0 and a0 2 A(B0 ), then it follows from the lemma that there's a unique
atom a 2 B su h that a0  ha. So we an set A(h)(a0 ) := a, to get
A(h) : A(B0 ) ! A(B):
Of ourse one must still he k that this a pseudo-inverse for P : Setsf ! BAf .
The required natural isomorphisms are de ned as follows:
X : X ! A(P (X ))
B : B ! P (A(B))
One sees easily that the atoms in a nite powerset are just the singletons
fxg for x 2 X , thus X is learly an isomorphism. To see that B is also iso,
onsider the proposed inverse:
_
( X ) 1 (A) = a:
a2A
The isomorphism now follows easily from this lemma:
Lemma 9.9. For any nite boolean algebra B,
1. b =
Wfa 2 A(B)ja  bg
2. if a is an atom and a  b _ b0 , then a  b or a  b0 .
Proof. Routine.
Finally, one must he k that and really are natural transformations.
This is also left to the reader as an exer ise.
Finally, I'll just remark that the duality extends to one on all of Sets:
(Sets)op 
= aBA;
where a Boolean algebra B is omplete if every subset U  B has a join U 2 B,
W
and a omplete homomorphism preserves these joins, and B is atomi if every
b 2 B has a  b with a an atom.
Draft of February 5, 2003
9.2 Examples 143

Moreover, this is just the dis rete ase of the full Stone Duality Theorem,
whi h states an equivalen e between the ategory of all boolean algebras and
(the opposite of) a ertain ategory of topologi al spa es, alled \Stone spa es",
and all ontinuous maps between them.

Draft of February 5, 2003


144 Equivalen e of ategories

9.3 Exer ises


1. Let C = D be equivalent ategories and suppose that C has binary prod-
u ts. Show that D does, too.
2. What sorts of properties of ategories do not respe t equivalen e? Find
one that respe ts isomorphism, but not equivalen e.
3. A ategory is skeletal if isomorphi obje ts are always identi al. Show that
every ategory is equivalent to a skeletal sub ategory. (Every ategory has
a \skeleton".)
4. Complete the proof that Par 
= Sets .
5. Complete the proof that (Setsf )op 
= BAf .
6. Show that equivalen e of ategories is an equivalen e relation.

Draft of February 5, 2003


Chapter 10

The Yoneda lemma


Next we will prove a very useful te hni al lemma alled the Yoneda Lemma. It's
probably the single, most-used result in ategory theory. Indeed, it's amazing
how often it omes up; but let me warn you before we start that it's a bit
abstra t and forbidding the rst time you see it.

10.1 Categories of diagrams


We're going to be onsidering spe ial fun tor ategories of the form

SetsC

where C will be lo ally small. So the obje ts are set-valued fun tors,

P; Q : C ! Sets ;
(sometimes alled \diagrams on C"), and the arrows are natural transformations

; : P ! Q:
Remember that, for ea h obje t C 2 C, we an evaluate any ommutative
diagram,

P > Q



R _
R
Draft of February 5, 2003
146 The Yoneda lemma

in SetsC at any obje t C to get a ommutative diagram,


C >
PC QC

( )C
C
R _
RC
in Sets.
And moreover, naturality means that if we have any arrow f : C ! C 0 ,
we get a \ ylinder" over the diagram in Sets. One way of thinking about
su h fun tor ategories is suggested by onsidering the example where C is the
ategory pi tured:
1 >0;
>
and then a set-valued fun tor on C, P : C ! Sets is just a graph, and a natural
transformation, : P ! Q is a graph homomorphism. Thus, in this ase,
SetsC = Graphs:
This suggests regarding an arbitrary ategory of the form
SetsC
as a generalized \ ategory of stru tured sets", whi h an be a useful way of
thinking of su h fun tors, and diagrams of fun tors and natural transformations.
That is to say, one thinks of

P > Q



R _
R
in SetsC as a diagram of \stru tured sets" and \homomorphisms".

10.2 The Yoneda embedding


Among the obje ts of SetsC are the ( ovariant) representable fun tors
homC (C; ) : C ! Sets:
Observe that for ea h h : C ! C 0 in C, we have a natural tranformation
homC (h; ) : homC (C 0 ; ) ! homC (C; )

Draft of February 5, 2003


10.2 The Yoneda embedding 147

where the omponent at X is de ned by


(C 0 !
f Æh X ):
X ) 7! (C f!
So we have a ontravariant fun tor:
homC (?; ) : Cop ! SetsC
de ned by:
C 7! homC (C; ) :
And of ourse, this is just the exponential transpose of
homC : Cop  C ! Sets
whi h you just showed to be fun torial as homework.
If we transpose homC with respe t to its other argument, we get a ovariant
fun tor
op
homC (?: ) : C ! SetsC
from C to a ategory of ontravariant set-valued fun tors. What amounts to
the same thing, we an put
D = Cop
and apply the previous ase to D to get
op
C = Dop ! SetsD = SetsC :
op
We'll write y : C ! SetsC for this fun tor, i.e. y(C ) = homC ( ; C ) for every
C 2 C0 , and y(f ) = homC ( ; f ) for every f 2 C1 .
More formally:
op
De nition 10.1. The Yoneda embedding is the fun tor y : C ! SetsC taking
C 2 C0 to the ontravariant representable fun tor homC ( ; C ) on C, and taking
f : C ! C 0 2 C1 to the natural transformation homC ( ; f ) : C( ; C ) !
homC ( ; C 0 ).
A fun tor F : C ! D is alled an embedding if it's full and faithful and
inje tive on obje ts. We'll show that y really is an embedding: this is a orollary
of the Yoneda Lemma.
Thus the Yoneda embedding \represents" every (lo ally small) ategory C as
a ategory of set-valued fun tors and natural transformations on some ategory.
(This explains the term \representable" fun tor.) One should think of y as a
representation of C.
Compared to the Cayley representation that you did as homework in the op
beginning of the semester, this one is full : any map : yC ! yC 0 in SetsC
omes from a unique map a : C ! C 0 in C as ya = .
In this sense, we've represented the obje ts and arrows of C as \stru tured
sets" and \homomorphisms," as it were.

Draft of February 5, 2003


148 The Yoneda lemma

10.3 The Yoneda lemma


Proposition
op
10.2. Let C be lo ally small. For any obje t C 2 C, and fun tor
F 2 SetsC , there's an isomorphism
hom(yC; F ) 
= F C;
whi h, moreover, is natural in both F and C . Here:
1. the hom is homSetsCop ,
2. naturality in F means that, given any # : F ! F 0 , the following diagram
ommutes:

=>
hom(yC; F ) FC

hom(yC; #) #C
_ _
hom(yC; F 0 )  > F 0C
=
3. naturality in C means that, given any h : C ! C 0 , the following diagram
ommutes:

=
hom(yC; F ) > FC
^ ^
hom(yh; F ) Fh

hom(yC 0 ; F )  > FC 0
=
Proof. We want an isomorphism
=
 = C;F : hom(yC; F ) ! F C;
let C;F (#) := #C (1C ) =: x# 2 F C , where # : yC ! F , and so #C : C(C; C ) !
F C and #C (1C ) 2 F C .
Conversely, given a 2 F C we de ne #a : yC ! F as follows. Given C 0 , we
need (#a )C : hom(C 0 ; C ) ! F C 0 . De ne (#a )C : hom(C; C 0 ) ! F C 0 by
0 0

(h : C 0 ! C ) 7! F (h)(a):
To show that #a is natural, given any f : C 00 ! C 0 , we need this to ommute:
(# )
hom(C 00 ; C ) a C > F C 00
00

^ ^
hom(f; C ) F (f )

hom(C 0 ; C ) > F C0
(#a )C 0

Draft of February 5, 2003


10.3 The Yoneda lemma 149

So we al ulate for any h 2 yC (C 0 ):


(#a )C 00 Æ hom(f; C )(h) = (#a )C (h Æ f ) 00

= F (hf )(a)
= F (f )F (h)(a)
= F (f )(#a )C (h):
0

So #a is indeed natural.
Now to show that #a and x# are mutually inverse, let's al ulate:
#x# for a given # : yC ! F:
First, we have (#(x#) : (h : C 0 ! C ) = F (h)(#C (1C )), but sin e # is natural,
#C >
yC (C ) FC

yC (h) Fh
_ _
yC (C 0 ) > F C0
#C 0

ommutes. So, ontinuing,


(#(x#) )C = #C Æ yC (h)(1C )
0 0

= #C (h): 0

Therefore #(x#) = #.
Going the other way around: for a 2 F C we have:
x#A = (#a )C (1C )
= F (1C )(a)
= 1F C (a)
= a:
Thus hom(yC; F ) = F C , as required.
The naturality laims are also easy: given  : F ! F 0 , taking # 2 hom(yC; F ),
and hasing around
C;F >
(yC; F ) FC

(yC; ) C
_ _
(yC; F 0 ) > F 0C
C;F 0

Draft of February 5, 2003


150 The Yoneda lemma

we get:
C (x# ) = C (#C (1C ))
= (#)C (1C )
= x(#)
= C;F ((yC; )(#)):
0

For naturality in C , take some f : C 0 ! C , we have


C yf (#) = C (# Æ yf )
0 0

= (# Æ yf )C (1C )0 0

= #C ((yf )C (1C ))
0 0 0

= #C (f )(#C (f Æ 1C ))
0 0 0

= #C (1C Æ f )
0

= #C yC (f )(1C )
0

= F (f )#C (1C )
= F (f )C (#):
Æ (yf ) = F (f ) Æ C , and the proof is omplete.
Therefore, C 0

op
Proposition 10.3. The Yoneda embedding y : C ! SetsC is full and faith-
ful.
Proof.
homC (C; C 0 ) = yC 0 (C ) 
= homSetsCop (yC; yC 0 ) ;
and the isomorphism is indu ed by y, sin e it takes (h : C ! C 0 ) 2 yC 0 (C ) to
the natural transformation #h : yC ! yC 0 given by:
(#h )C (f : C 00 ! C ) = yC 0 (f )(h)
00

= C(f; C 0 )(h)
=hÆf
= (yh)C (f ): 00

So #h = y(h).
Remark 10.4. Note the following:
 If C is small. SetsCop is lo ally small, and so hom(yC; P ) in SetsC is
op

always a set.
 If C is lo ally small, SetsCop need not be lo ally small. In this ase, the
Yoneda Lemma tells us that hom(yC; P ) is always a set.
 If C is not lo ally small, y : C ! SetsCop won't even be de ned, so the
Yoneda Lemma does not apply.

Draft of February 5, 2003


10.4 Appli ations 151

10.4 Appli ations


The most frequent appli ation of the Yoneda Lemma is of the form: given
obje tsop A; B in a ategory C, show that A  = B by showing yA = yB in
SetsC . This results form the following exer ise :
Let F : C ! D be full and faithful. For any obje ts A; B 2 Cop :
A
= B in C i F A 
= F B in D:
A typi al appli ation is this: if the ategory C has produ ts and exponen-
tials, then:
(AB )C = A(BC )
We just need to show y((AB )C ) 
= y(A(BC ) . For any X 2 C0 we have,
C(X; (AB )C ) 
= C(X  C; AB )

= C(X  C  B; A)

= C(X; A(BC )
(using C(X  Y; Z ) 
= C(Y  X; Z )).
Remark 10.5. You need not show that these isomorphisms are natural, but
that's easy too.
Let's do one more example of this kind.
Proposition 10.6. If the artesian losed ategory C has oprodu ts, then it's
distributive:
A  (B + C ) 
= (A  B ) + (A  C ):
Proof.
C(A  (B + C ); X ) 
= C(B + C; X A)

= C(B; X A)  C(C; X A )

= C(B  A; X )  C(C  A; X )

= C((B  A) + (C  A); X )

= C((A  B ) + (A  C ); X ):

10.5 Limits in diagram ategories


De nition 10.7. A ategory E is omplete if it has all small limits: that is, for
any small ategory J and fun tor F : J ! E there's a limit L = lim j2J F j in E
and  : L ! F in E J , universal from E .

Draft of February 5, 2003


152 The Yoneda lemma

Here the onstant fun tor  : E ! E J is the transposed proje tion EJ ! E .
It provides a onvenient way of organizing ones and there arrows.
op
Proposition 10.8. For any lo ally small ategory C, the fun tor ategory SetsC
is omplete. Moreover, the evaluation fun tors
op
evC : SetsC ! Sets
preserve all limits.
op
Proof. Suppose we have J small
op
and F : J ! SetsC . The limit of F , if it
C
exists, is an obje t in Sets , hen e a fun tor,

(lim i2J Fi ) : Cop ! Sets:


By the Yoneda Lemma, if we had su h a fun tor, we'd have
(lim Fi )(C ) 
= hom(yC; lim Fi ):
But:
hom(yC; lim Fi ) 
= lim hom(yC; Fi ) taken in Sets

= lim Fi (C ) taken in Sets
where the rst isomorphism is be ause representable fun tors preserve limits,
and the se ond is Yoneda again. Thus, we are ompelled to de ne:
(lim i2J Fi )(C ) = lim i2J (Fi C );
that is, as the pointwise limit of the fun tors Fi .
The reader should work out how lim Fi a ts on C-arrows, and what the
universal one is.

The notion of o ompleteness is dual: you should know the following fa t,


but I won't take the time to prove it.
op
Proposition 10.9. For lo ally small C, the fun tor ategory SetsC is o om-
plete, and olimits are omputed pointwise.
The latter means that the evaluation fun tors,
op
evC : SetsC ! Sets
! Fi .
always preserve olimits lim

Draft of February 5, 2003


10.6 Exponentials 153

10.6 Exponentials
op
Finally, let's onsider exponentials in SetsC . Suppose we have fun tors P; Q
and we want QP . If it were known to exist, we ould ompute it's value at any
obje t C 2 C by Yoneda:
QP (C ) 
= hom(yC; QP )
but if it's supposed to be an exponential, then we must have:
hom(yC; QP ) = hom(yC  P; Q);
and this latter set does exist. Thus, we an de ne
QP (C ) = hom(yC  P; Q)
and
QP (h : C 0 ! C ) = hom(yh  1P ; Q) :
This is learly a ontravariant fun tor on C. Of ourse, one must still he k
that it gives an exponential:
Proposition 10.10. For any Q; P; X ,
Hom(X; QP )  = Hom(X  P; Q)
naturally in X .
Proof. We need two lemmas, the proofs of whi h are deferred:
Lemma 10.11. Any fun tor F : Cop ! Sets is a olimit of representables,
F ! i yCi :
= lim
Lemma 10.12. For any fun tor A : Cop ! Sets and family (yCi )i of repre-
sentables, there is a (natural) isomorphism:
! i yCi 
A  lim ! i (A  yCi ) :
= lim
Given these lemmas, we then have natural isomorphisms:
hom(F; QP ) 
= hom(lim P
! yCi ; Q )

= hom(lim! yCi  P; Q)

= hom(lim!(yCi  P ); Q)

= lim hom(yCi  P; Q)

= lim hom(yCi ; QP )

= hom(lim! yC
P
i; Q )

= hom(F; QP )

Draft of February 5, 2003


154 The Yoneda lemma

10.7 Exer ises


1. If F : C ! D is full and faithful, then C 
= C 0 i F C 
= F C0.
2. Let C be a lo ally small, artesian losed ategory. Use the Yoneda em-
bedding to show that for any obje ts A; B; C in C:
(A  B )C 
= AC  B C
( f. Problem ??, hapter ??). If C also has binary oprodu ts, show that
also:
A(B+C ) 
= AB  AC
op
3. For any lo ally small ategory C, the fun tor ategory SetsC has binary
produ ts F  G, and these are omputed pointwise:
(F  G)(C ) 
= F C  GC
for all C 2 C0 .
4. Let C be a lo ally small ategory with binary produ ts, and show that
the Yoneda embedding
y : C ! SetsC
op

preserves them. (Hint: this involves only a few lines of al ulation.)


5. Show that the forgetful fun tor
U : Mon ! Sets
is representable (i.e. that it is naturally isomorphi to a fun tor of the
form hom(M; ) for a suitable monoid M ). Con lude that U preserves all
limits.
6. * Complete the proof of the Yoneda Lemma by showing that the isomor-
phism
Hom(yC; F ) 
= FC
de ned in the notes is indeed natural in F .

Draft of February 5, 2003


Chapter 11

Adjoints
Let me begin with a provo ative laim, whi h you should keep in mind and
evaluate when we've nished this topi . The laim is that adjointness is a topi
of fundamental logi al and mathemati al importan e.
It's ertainly one of the most important on epts in ategory theory. And
many of the most striking appli ations of ategory theory in mathemati s and
logi involve adjoints. Moreover, it's a on ept that's invible without the lens
of ategory theory.
Let me point out one onsequen e of this laim: if it's true, then adjointness
gives us an example of an important and fundamental logi al and mathemati al
notion whi h at the same time is a very high level on ept. That is, it is not
stated in \elementary" terms, like the notions of set elementhood and equiva-
len e relation. Thus it provides a ounter-example to the ommonly held view
in logi that that all important notions must be \logi ally simple".

11.1 De nition
Let's begin by re alling the situation of free monoids: every monoid M has an
underlying set U (M ), and every set X has a free monoid F (X ) and a fun tion

iX : X ! UF (X )

with the UMP:


For every monoid M and every f : X ! U (M ) there's a unique hf : F (X ) !
M su h that f = Uf Æ iX , as indi ated in the diagram:
Draft of February 5, 2003
156 Adjoints

f
F (X ) ...................> M
U (f)>
U (F (X )) U (M )
^

iX
f
X
Consider the following map:
 : homMon(F (X ); M ) ! homSets (X; U (M ))
de ned by
f 7! U (f) Æ iX :
The UMP above says exa tly that  is an isomorphism,
Mon(F X; M ) 
= Sets(X; UM ) : (11.1)
Moreover the isomorphism is natural in both X and M , in a straightforward
sense that I'll spell out soon { it follows from the fa t that iX is the omponent
at X of a natural transformation:
i : 1Sets ! U Æ F:
The bije tion (11.1) an also be written s hemati ally as a 2-way rule :
F (X ) >M
X > U (M )

where one gets from an arrow g of the upper form to one (f ) of the lower form
by the re ipe:
(g) = U (g) Æ iX :
We pattern our preliminary de nition of adjun tion on this situation, as
follows. It's preliminary be ause later on a slightly di erent (but equivalent)
de nition will emerge as more onvenient.
De nition 11.1. An adjun tion between ategories C and D onsists of fun -
tors
F :C< >D:U

Draft of February 5, 2003


11.1 De nition 157

and a natural transformation


 : 1C ! U Æ F
su h that:
(*) For any C 2 C, D 2 D, and f : C ! U (D), there exists a unique g : F C !
D su h that:
f = U (g) Æ C ;
as indi ated in:
g
F (D) ....................> D
U (g)>
U (F (D)) U (D)
^

C
f
C
Terminology and notation:
F is alled the left adjoint of U , U is alled the right adjoint of F , and 
is alled the unit of the adjun tion.
 One sometimes writes F a U for \F is left and U right adjoint" { i.e. if
there is an  su h that (F; U; ) is an adjun tion.
 The statement (*) is the UMP of .
Note that situation F a U is a generalization of equivalen e of ategories,
and a pseudo-inverse is an adjoint. But in that ase, it is the relation between
ategories that one is interested in. Here, one is more on erned with the relation
between fun tors, i.e. not the relation on ategories \there exists an adjun tion"
but rather \this fun tor has (or is) an adjoint".
Suppose we have an adjun tion,
U
C< >D
F
and take C 2 C, D 2 D and onsider the operation:
 : D(F C; D) ! C(C; UD)
given by (f ) = U (f ) Æ C . Sin e, by the UMP of , every f : C ! UD is (g)
for a unique g, just as in our example we see that  is an isomorphism:
homD (F C; D) 
= homC (C; UD) ; (11.2)

Draft of February 5, 2003


158 Adjoints

whi h an also be displayed as the two-way rule:


F (C ) >D
C > U (D)
Example 11.2. Consider the fun tor:
:C!CC
de ned on obje ts by
C 7! (C; C )
and on arrows by
f 0 (f;f )
(C ! C ) 7! ((C; C ) ! (C 0 ; C 0 )):
What would it mean for this fun tor to have a right adjoint? We would need a
fun tor R : C  C ! C su h that for all C 2 C and (X; Y ) 2 C  C, there is a
bije tion:
C > hX; Y i
C > R(X; Y )
i.e. we need:
homC (C; R(X; Y ))  = homCC (C; (X; Y ))

= homC (C; X )  homC (C; Y )
Therefore we must have R(X; Y )  = X  Y , suggesting that  is left adjoint to
the produ t fun tor ,
a
The ounit  must have the form C : C ! C  C , so we propose the \diagonal
arrow" C = h1C ; 1C i, and we need to he k the UMP indi ated in:
(f1 ; f2 )
(C; C ) ................> (X; Y )
f1  f2>
C C X Y
^

C
f
C
Indeed, given any f : C ! X  Y , we have unique f1 and f2 with f = hf1 ; f2 i,
for whi h we then have:
(f1  f2 ) Æ C = hf1 1 ; f2 2 iC
= hf1 1 C ; f2 2 C i
= hf1 ; f2i
=f

Draft of February 5, 2003


11.2 Hom-set de nition 159

11.2 Hom-set de nition


The following proposition shows that the isomorphism (11.2) is natural in both
C and D.
Proposition 11.3. The following are equivalent for fun tors,
U
C< >D
F
1. There's a natural transformation
 : 1C ! U Æ F
that has the UMP of the unit. I.e. F a U.
2. There's a natural isomorphism
 : homD (F C; D) 
= homC (C; UD):
Moreover, if either exists, then the two are related by the formulas:
(g) = U (g) Æ C ;
C = (1F C ):
Proof. (1 implies 2) The re ipe for , given  is just the one stated, and we have
already shown it to be an isomorphism, given the UMP of the unit. We leave
naturality as an exer ise.
(2 implies 1) We're given a bije tion ,
F (C ) >D
C > U (D)
for ea h C; D, presumed natural in C and D, in the following sense:
Given the situation:
g >
F (C ) D

g

R _
D0
there are two ways to get an arrow of the form C ! UD0 , namely:
(g) >
C UD

( g)
U
R _
UD0
Draft of February 5, 2003
160 Adjoints

Naturality in D means that this diagram ommutes:


( Æ g) = U Æ (g)
Dually, naturality in C means that given:
C
 f

_
0
R
C > UD
f
the following ommutes:
FC
 f
F 
_
0
R
FC >D
f
That is:
(f Æ ) = (f ) Æ ;
1.
where we are writing =  Given su h a  we want, a natural transformation
 : 1C ! U Æ F
that has the UMP of the unit. To nd
C : C ! UF C;
just put 1F C : F C ! F C in the adjoint s hema to get
1
F C FC > F C

C > UF C
C
That is:
C =df (1F C ):
To see that  is a natural transformation, we need to he k that the following
ommutes:
C > UF C 0
C 0

UF
_ _
C0 > UD
C
Draft of February 5, 2003
11.2 Hom-set de nition 161

Applying = 1 to both omposites:


(UF Æ C ) = F Æ 1F C
0 0

= F
= 1F C Æ F
= (C Æ )
Finally, to see that  has the required UMP of the unit, it learly suÆ es to
show that for all g : F C ! D, we have
(g) = U (g) Æ C :
sin e we're assuming that  is iso. But:
Ug Æ C = Ug Æ (1F C )
= (g Æ 1F C )
= (g):

The se ond ondition in the proposition is symmetri , indeed the la k of


symmetry in the rst ondition implies that we also have following:
Corollary 11.4. Under the same onditions as the proposition, the following
are equivalent.
1. D(F C; D) 
= C(C; UD) naturally in C and D.
2. There's a natural transformation
:F ÆU !D
having the following UMP: for any C; D and g : F (C ) !D there's a
unique f : C ! UD su h that g = D Æ F (f ).
Moreover, the two are related by the equations:
 1 (f ) = D Æ F (f )
D =  1 (1UD ):
Proof. Duality.
We take the symmtri form given in the proposition as our \oÆ ial" de ni-
tion of an adjun tion:
De nition 11.5. An adjun tion onsists of fun tors
F :C< >D:U
and a natural isomorphism:
 : homD (F C; D) 
= homC (C; UD) : :

Draft of February 5, 2003


162 Adjoints

This de nition has the advantage of being symmetri in F and U . The unit
 : 1C ! U Æ F and the ounit  : F Æ U ! 1D are uniquely determined as:
C = (1F C )
D = (1UD )

11.3 Examples of adjoints


Example 11.6. Suppose C has binary produ ts and take a xed obje t A 2 C,
and onsider the produ t fun tor
A:C!C
de ned on obje ts by
X 7! X  A
and on arrows by
(C ! C ) 7! (C  A h!
h 0 1A 0
C  A):
Question: When does  A have a right adjoint?
We would need a fun tor
U :C!C
su h that for all X; Y 2 C, the is a natural bije tion:
X A >Y
X > U (Y )
So let's try de ning U by
U (Y ) = Y A
on obje ts, and
g 0 A
U (Y ! Y ) = Y A g! (Y 0 )A
on arrows. Putting U (Y ) for X in the adjoint s hema gives the ounit:
 >
YAA Y
Y A > Y A:
1
This is an adjun tion if  has the following UMP: for any f : X  A ! Y , there's
a unique f : X ! Y A su h that f =  Æ (f  1A). This is exa tly the UMP of
the exponential! Thus we have an adjun tion:
X  A a Y A:

Draft of February 5, 2003


11.3 Examples of adjoints 163

Example 11.7. Here's a more simple example. Consider the unique fun tor
!:C!1
and ask, when does ! have a right adjoint? This would be an obje t U : 1 ! C
su h that for any C 2 C
!C > 
C > U ()

Thus, U would be terminal in C. I.e. ! has a right adjoint i C has a terminal


obje t. What do you think a left adjoint would be?
This last example gives a lear instan e of the following general proposition:
Proposition 11.8. Given a fun tor F : C ! D and fun tors U:U 0 : D ! C
su h that
F a U and F a U 0 ;
 U 0.
we have U =
Proof. (The easy way!) For any D 2 D, C 2 C:
C(C; UD) 
= D(F C; D) Natural

= C(C; U 0 D) Natural
implies (by Yoneda) UD  = U 0 D, but this isomorphism is natural in D, again
by adjointness.
This proposition implies that one an use the ondition of being right or left
adjoint to a given fun tor to de ne (uniquely hara terize up to isomorphism)
a new fun tor. This sort of hara terization, like universal mapping properties,
determines an obje t or onstru tion \intrinsi ally", in terms of its relation to
some other given, perhaps parti ularly simple onstru tion. Many important
onstru tions turn out to be adjoints.
For example, what do you suppose would be a left adjoint to  in the
example:
:C!CC;
where (C ) = (C; C ), and we had  a  ? It would hav e to satisfy:

L(X; Y ) >C
(X; Y ) > (C; C )
Thus it would be the oprodu t L(X; Y ) = X + Y , and indeed one has:
+ a  a :

Draft of February 5, 2003


164 Adjoints

Now note that C  C = C2 and  is then the onstant fun tor. Let's repla e
2 by any small ategory I, and onsider possible adjoints to
 : C ! CI :
One has:
 a lim
!a:
lim
What are the units and ounits of these adjun tions?
Example 11.9. Polynomial Rings: Let R be a ommutative ring, (Z if you like)
and onsider the ring R[x℄ of polynomials in one indeterminate x with oeÆ-
ients in R. So the elements of R[x℄ look like
r0 + r1 x + r2 x2 + : : : + rn xn :
There's an evident homomorphism  : R ! R[x℄, that has the following UMP:
Given any ring A, homomorphism : R ! A, and element a 2 A, there's a
unique homomorphism
a : R[x℄ ! A
su h that a (x) = a and a  = .

a >
R[x℄ A
^



R
Namely: \formal evaluation at a"
a (r(x)) =  (a=x):
De ne Rings to be the ategory of \pointed" rings.
The UMP says exa tly that the forgetful fun tor
U : Rings ! Rings
has the fun tor [x℄ : Rings ! Rings as a left adjoint, and  : R ! R[x℄ is the
unit of the adjun tion. The reader who knows something about rings should
work out the details of this example.

Draft of February 5, 2003


11.4 Order adjoints 165

11.4 Order adjoints


Let P; Q be preordered sets, i.e. ategories in whi h there is at most one arrow
x ! y between any two obje ts:
x  y i 9 : x ! y:
Suppose we have adjoint fun tors
F
P< >Q F aU
U
then Q(F a; x) 
= P (a; Ux) omes to the ondition F a  x i a  Ux
Thus we have order preserving maps F; U su h that
F a  x i a  Ux ;
when e the unit gives:
a  UF a
is universal among all a  Ux.
Su h a set-up on preordered sets is sometimes alled a Galios onne tion
Example 11.10. An example is the interior operation on subsets of a topologi al
spa e:
O(X ) in
! P (X ) a P (X ) int
! O(X )
sin e
U  A P (X )
:
U  int(A) O(X )
The ounit is int(A)  A.
\Closure" also gives an example, with the unit being
A  A:

Example 11.11. Another example in your homework is the adjun tion indu ed
by any fun tion f : A ! B
f 1
P (A) <
> P (B )
im(f )
with im(f ) a f 1 as indi ated by
im(f )(U )  V
:
U  f 1 (V )
Draft of February 5, 2003
166 Adjoints

f 1 : P (B ) ! P (A) also has a right adjoint, given by


f (U ) = fb 2 B j f 1(b)  U g
as you an easily he k for yourself. Indeed, if f is ontinuous, then im(f ) need
not exist (on open sets), but f always does:
f 1
O(A) <
> O(B )
f
Example 11.12. Suppose we have a poset P , then P has meets i for all p; q 2 P ,
there's an element p ^ q 2 P satisfying the isomorphism:
r p^q
:
r  p and r  q
Similarly, P has joins if there's an element p _ q 2 P su h that:
p_q r
:
p  r and q  r
The impli ation q ) r in a Heyting algebra is hara terized as an exponential
by the ondition:
p^q r
:
pq)r
Finally, > and ? are determined by the onditions:
p  > (terminal obje t)
and
?  p (initial obje t)
When we de ne :p =df p ) ?, we get the rule:
q  :p
:
p  :q
In this way, the entire propositional al ulus an be formulated in terms of
adjoints.
I emphasize that the \adjoint rules" just given are ompletely suÆ ient for
these operations: they an serve as the rules of inferen e for a logi al al ulus of
\sequents" p  q (usually written p ` q instead), whi h is equivalent to the usual
intuitionisti propositional al ulus. Finally, lassi al (boolean) propositional
al ulus results from adding the rule:
::p ` p :
Draft of February 5, 2003
11.5 Quanti ers as adjoints 167

11.5 Quanti ers as adjoints


Traditionally, the main obsta le to the further development of algebrai logi
has been the treatment of the quanti ers. Categori al logi solves this problem
beautifully with the re ognition (due to F.W. Lawvere in the 1960s) that they
are adjoint fun tors.
Let L be a rst-order language and de ne, for any list of distin t variables
x = x1 ; : : : ; xn , the set of formulas with at most those variables free:
Form(x) = f(x) j  has at most x free g:
Then Form(x) is a preorder under the entailment relation of rst-order logi ,
(x) ` (x):
Now let y not be in the list x, and note that we have the trivial operation:
 : Form(x) ! Form(x; y)
whi h is just a matter of observing that y annot be free in (x). Of ourse, 
is a fun tor sin e,
(x) ` (x) in Form(x)
implies
(x) `  (x) in Form(x; y):
Now onsider the map 8y : Form(x; y) ! Form(x). We laim that this is right
adjoint to ,
a8
Indeed, the usual rules of universal introdu tion and elimination imply that the
following (derived) two-way rule of inferen e holds:
(x) ` (x; y) Form(x; y)
(x) ` 8y: (x; y) Form(x)
Observe that this rule, saying that the operation 8y whi h binds the variable
y, is right adjoint to the trivial operation , also takes are of the usual \book-
keeping" side- onditions of the quanti er rules.
The unit of the adjun tion is the usual 8 axiom
8y: (x; y) ` (x; y):
It's now natural to ask about the other quanti er; and indeed we have a
further adjun tion:
9aa8
Draft of February 5, 2003
168 Adjoints

sin e the following two-way rule also holds:


9y: (x; y) ` (x) :
(x; y) ` (x)
You an he k for yourself that it a tually follows from this that 9y and 8y are
fun tors.
The adjoint rules just given an be used in pla e of the ustomary intro-
du tion and elimination rules to give a omplete system of dedu tion for quan-
ti ational logi . Many typi al laws of predi ate logi are just simple formal
manipulations of adjoints. For example:
) `)
( ) ) ^  `
8y:(( ) ) ^ ) ` 8y:
8y:( ) ) ^ 8y: ` 8y:
8y:( ) ) ` 8y: ) 8y:
` 8y( ) ) ) (8y: ) 8y: )
where in the third line we have used the fa t, to be proved soon, that right
adjoints preserve limits to infer that:
8y:(( ) ) ^ ) = 8y:( ) ) ^ 8y:
The idea of quanti ers as adjoints gives rise to the following geometri in-
terpretation : Take any L stru ture M and onsider a formula (x) in at most
one variable x. It determines a subset,
[(x)℄ = fm 2 M j M j= (m)g  M :
Similarly, a formula in several variables determines a subset of the artesian
produ t
[ (x1 ; : : : ; xn )℄M = fhm1 ; : : : ; mn j M j= (m1 ; : : : ; mn )g  M n :
Let's take two variables x; y and onsider the e e t of the  operation on
these subsets. We have:
 : P (M ) ! P (M  M )
where [(x)℄ = [(x)℄.
Expli itly, given [(x)℄ 2 P (M ), we have:
[(x)℄ = f(m1 ; m2 ) 2 M  M j M j= (m1 )g =  1 ([(x)℄)

where  : M  M ! M is the rst proje tion. Thus:


= 1
Draft of February 5, 2003
11.5 Quanti ers as adjoints 169

Similarly, the existential quanti er an be regarded as an operation on sub-


sets:
9 : P (M  M ) ! P (M )
where 9[ (x; y)℄ = [9y: (x; y)℄.
Spe i ally, given [ (x; y)℄  M  M , we have
[9y: (x; y)℄ = fm j for some y; M j= (m; y)g
= im()[ (x; y)℄
Therefore:
9 = im() ;
and you an a tually \see" the adjun tion,
9y: (x; y) ` (x) , (x; y) ` (x)
It's essentially the same one we onsidered before,
im() a  1

on subsets, with image left adjoint to inverse image, taken along the rst pro-
je tion  : M  M ! M .
Finally, the universal quanti er an also be regarded as an operation of the
form:
8 : P (M  M ) ! P (M )
where 8[ (x; y)℄ = [8y: (x; y)℄.
Indeed, given [ (x; y)℄  M  M , we have:
[8y: (x; y)℄ = fm j for all y; M j= (m; y)g
= fm j  1 fmg  [ (x; y)℄g
=  ([ (x; y)℄)  M:
When e
8 = 
Again, one an see the adjun tion,
(x)  (x; y) , (x)  8y: (x; y)
by onsidering the orresponding operations indu ed on subsets.
That on ludes the basi examples, we now onsider one of the fundamental
properties of adjoints: preservation of limits. We then turn to the question of
their existen e.

Draft of February 5, 2003


170 Adjoints

11.6 RAPL
In the previous se tion we had a string of three adjoints:
9aa8
and its easy to nd other su h strings. For example, there's a string of 4 adjoints
between Cat and Sets,
V aF aU aR
where U : Cat ! Sets is the forgetful fun tor to the set of obje ts,
U (C) = C0 :
An obvious question in this kind of situation is \are there more?" That is,
given a fun tor, does it have an adjoint? A useful ne essary ondition whi h
shows that e.g. the strings above stop is the following proposition, whi h is also
important in it's own right.
Proposition 11.13. Right adjoints preserve limits ( remember: \RAPL"!), and
left adjoints preserve olimits.
Proof. Here's the easy way: suppose we are given a diagram C : I ! C su h
that the limit lim Ci exists in C, and we are given an adjun tion:
F
D< >C F aU
U
Then for any X 2 D, we have:
homD (X; U (lim Ci )) 
= homC (F X; lim Ci )

= lim homC (F X; Ci )

= lim homD (X; UCi )

= homD (X; lim UCi )
when e (by Yoneda), we have the required isomorphism U (lim Ci )  = lim UCi .
It follows immediately by duality that left adjoints preserve olimits.
It is illuminating to work out what the above argument \really means" in a
parti ular ase, say binary produ ts.
Re all
op
that I still owe you a proof of the following fa t (from the proof that
C
Sets has exponentials):
(lim i yCi )  P 
= lim i (yCi  P )
op
yCi ; P 2 SetsC . But the indi ated olimits and produ ts in \presheaves"
where op
C
Sets are omputed obje twise, so this holds just if the analogous distribu-
tivity law,
(lim i Xi )  Y 
= lim i (Xi  Y )
Draft of February 5, 2003
11.6 RAPL 171

holds in Sets. This latter we now have, sin e the fun tor ( )  Y is left adjoint
to ( )Y , and so ( )  Y preserves olimits.
It also follows for the propositional al ulus that e.g.:
p ) (a ^ b) a` (p ) a) ^ (p ) b)
and
(a _ b) ^ p a` (a ^ p) _ (b ^ p):
Similarly, for the quanti ers e.g. one has:
8x((x) ^ (x)) a` 8x(x) ^ 8x (x):
Sin e this does not hold for 9x, it annot be a right adjoint. Similarly
9x((x) _ (x)) a` 9x(x) _ 9x (x):
And, as above, 8x annot be a left adjoint, sin e it does not have this property.
The proposition gives an extremely important and useful property of ad-
joints. If one wants to show e.g. that a given fun tor preserves all limits, some-
times the easiest way to do so is to show that it has a left adjoint.
For example, the free a forgetful adjun tion between sets and groups tells
us that the limit of any diagram of groups has as an underlying set the limit
of the diagram of underlying sets. And you may re all a homework exer ise in
whi h you showed (\by hand") that a oprodu t of free monoids is given by the
free monoid on the oprodu t of their sets:
F (A) + F (B ) 
= F (A + B ):
One more example: the forgetful fun tor,
U : C=C ! C
preserves all olimits, and it has a right adjoint i C has binary produ ts with
C . But when does U have a left adjoint?

Draft of February 5, 2003


172 Adjoints

11.7 Adjoint fun tor theorem


The question we now want to onsider systemati ally is, when does a fun tor
have an adjoint? First, onsider the question, when does a fun tor of the form
C ! Sets have a left adjoint?
Observe here that if U : C ! Sets has F a U , then U is representable
U = hom(1; UC ) 
= hom(F 1; ), sin e U (C )  = hom(F 1; C ).
An apparently weaker ne essary ondition than representability is preserva-
tion of limits: suppose that C is omplete and U : C ! Sets preserves limits,
and we ask whether U has a left adjoint. The Adjoint Fun tor Theorem (AFT)
gives a ne essary and suÆ ient ondition for this.
Theorem 11.14 (Freyd). Let C be lo ally small and omplete. Given a fun -
tor
U :C!X
the following are equivalent
1. U has a left adjoint
2. U preserves limits, and for ea h X 2 X U satis es the following solution
set ondition:
There exists a set of obje ts (Ci )i2I in C su h that for any C 2 C and
f : X ! UC , there exists an i 2 I and an arrow  : Ci ! C , and a
f : X ! UCi su h that
f = U () Æ f:

That is, \every arrow X ! UC fa tors through an obje t in the solution
set."
Note that if (1) holds and we have F a U , then fF X g is itself a solution set
for X , sin e we always have
f >
X UC
^


U (f)
R
UF X
where f : F X ! C . I'm not going to prove the onverse here (see Ma Lane),
but the examples will give you an idea of how it goes.
It is essential that the I in the theorem be a set (not a proper lass), otherwise
we ould just let C0 (all obje ts of C) be the solution \set". Also, the theorem
doesn't help if C is not omplete; however in the ase of small, omplete C, we
an learly drop the solution set ondition entirely.

Draft of February 5, 2003


11.7 Adjoint fun tor theorem 173

It follows from the adjoint fun tor theorem that if C is small and omplete,
then the only fun tors U : C ! Sets that have left adjoints are the representa-
bles. However, this is a somewhat weaker statement than it appears to be, in
light of the following fa t:
Proposition 11.15. If C is small and omplete, then C is a preorder.
Proof. Take C; C 0 2 C with hom(C; C 0 )  2. Let J be any set, and take
Y
C0 in C:
J
Consider
Y Y
hom(C; C 0) 
= hom(C; C 0 ) 
= hom(C; C 0 )J :
J J
Q
So, for the ardinalities we have j hom(C; J C 0 )j = j hom(Q
C; C 0 )jjJ j  2jJ j, for
any set J . On the other hand, learly jC1 j  j hom(C; J C 0 )j. So taking
J = C1 gives a ontradi tion.
Let's rst onsider the AFT in ase P and Q are omplete preorders; it gives
the following.
Proposition 11.16. For omplete preordered sets P; Q, a monotone fun tion
V
fV : P ! Q has a left adjoint i it is ontinuous, in the sense that f ( pi ) =
i f (pi ).
Indeed, given f (^pi ) = ^i f (pi ), we an let
^
g(q) =df fp j q  fpg:
Then for any p 2 P , q 2 Q:
g(q)  p implies ^ ffp0 j q  fp0 g  fp
so q  fp.
While, onversely:
q  fp implies ^ fp0 j q  fp0 g  p
so g(q)  p. When e
g a f:
The proof of the AFT is essentially a generalization of this argument to the
(signi antly more ompli ated!) ase of a ategory that's not just a preorder.
An appli ation of the AFT is that any equational theory T gives rise to an
adjun tion
F aU
Draft of February 5, 2003
174 Adjoints

with
U : Mod(T ) ! Sets forgetful
and F , therefore, \free" (we de ne free to mean left adjoint to forgetful!). Rather
than stating the general proposition, it will be useful to do an example.
Example 11.17. Let T be the theory with one onstant and one unary operation
(no axioms). A T -model is a set M with the stru ture
a f
1! M! M:
A homomorphism of T -models h : M ! N is de ned in the usual way; a
fun tion h that preserves the element and the operation. We have an evident
forgetful fun tor
U : Mod(T ) ! Sets;
whi h plainly preserves produ ts and equalizers (hen e all limits). So we just
need to he k the solution set onditions:
Let X be any set and take a fun tion
h : X ! M:
The image h(X )  M generates a T -model as follows: take
hh(X )i = ff n(z ) j n 2 N; z = a _ z = h(x) for some x 2 X g:
Then
fM
M > M
^ ^

hh(X )i f > hh(X )i


hh(X )i
, where fhh(X )i is the restri tion of f to hh(X )i. Thus we have a T -homomorphism:
hh(X )i ! M And plainly there is a fa torization h0
X > hh(X )i
h0

h
R _
M
Now observe that, given X , the ardinality jhh(X )ij is bounded, i.e. for suÆ-
iently large  (independently of h and M ):
jhh(X )ij  (= (jX j + 1)  !0 )
Draft of February 5, 2003
11.7 Adjoint fun tor theorem 175

Thus, taking one representative N of ea h isomorphism lass of T models with


ardinality at most , we get a solution set for X and U .
Therefore: there exists a free fun tor
F : Sets ! Mod(T ):
A similar argument works with any equational theory T .
Let's onsider the parti ular free model F 0 in Mod(T ). This is an initial
obje t, sin e left adjoints preserve olimits. It follows that F 0 is a natural
numbers obje t (in Sets), in the following sense:
De nition 11.18. Let C be a ategory with a terminal obje t 1. A natural
numbers obje t is a stru ture of the form
0 s
1! N! N in C
a f
whi h is initial. That is, given any 1 ! X ! X in C there's a unique
 : N ! X su h that
a >X
f >X
1
^ ^

0
 
R
N >N
s
In other words, given some \starting point" a 2 X and an operation x 7! f (x)
on X , we an build up  : N ! X re ursively by the equations:
(0) = a
(s(n)) = f ((n)) 8n 2 N
It's easy to show that any NNO in Sets is isomorphi to N with the anoni al
stru ture (homework!). This we have a hara terization of the natural numbers,
up to isomorphism, in terms of the UMP of re ursive de nitions. The de nition
of an NNO is equivalent to the usual logi al de nition of N using the Peano
axioms in Sets, but also makes sense in many ategories where the Peano axioms
don't `make any sense.
If N 1 exists in a ategory C, then it's an NNO (together with the obvious
stru ture maps). Conversely, however, if N`is an NNO in a ategory C, then it
need not be so that C has the oprodu t ( N 1).
Example 11.19. Let X be a topologi al spa e. We want to have a ompa t
Hausdor spa e and a ontinuous
 : X ! X^
Draft of February 5, 2003
176 Adjoints

su h that given any ompa t Hausdor spa e K and ontinuous


f :X!K
there's a unique f : X^ ! K su h that f = f Æ . Thus, we're looking for a left
adjoint
( ^ ) : Top ! CptHaus
to the in lusion i : CptHaus ! Top.
First note that CptHaus is omplete, and i preserves limits. This follows
from the Ty hono theorem, and the fa t that you an he k for yourself that
i preserves equalizers:
e f
E > K >
> K0
g
where E with the subspa e topology is ompa t Hausdor .
Thus we just need to he k the solution set ondition. I.e. we need to nd a
set of ompa t Hausdor spa es
fKi j i 2 I g
su h that any f : X ! K fa tors through some Ki . To do that, rst note that
we may as well assume that F X is dense in K , sin e we an take the losure of
it in K
 K
fX
and get a ompa t Hausdor spa e.
Now onsider the map
L : K ! P OX
with L(y) = fU  X open j y 2 fU g
Sin e f is dense in K , L(y) 6= ;. If y 6= y0 , take y 2 V and y0 2 V with
V ^ V 0 = ;.
We now laim that f 1(V ) 2 L(y) and f 1 (V ) 2= L(y0). Then L(y) 6= L(y0 ),
so L is inje tive
L : K ! P O(X ):
Thus we an take the set of all topologies on subsets of P O(X ) that are ompa t
Hausdor to get a solution set.
For the laim, rst
f 1 2= L(y0 ) , y0 2= ff  1V :
but y0 2 V 0 ) y0 2= (V 0 )  V  ff 1V .
Draft of February 5, 2003
11.7 Adjoint fun tor theorem 177

Next, for f 1 V 2 L(y) we need y 2 ff 1 V . Take U 2 L(y) (whi h is 6= ;),


 , put U 0 = U [ f 1V . Now, by Frobenious:
so y 2 fU
fU 0 = f (U [ f 1V ) = fU [ V ()
Thus y 2 fU  [ V . But also fU 0  V so fU 0  ff 1(V )  V
 0 = fU [ V = fU
( ounit of f a f ) thus y 2 ff 1V as laimed.
1
While we're at it, we might as well prove the following, whi h was used n
the proof above.
Proposition 11.20 (Frobenious Formula). For f : X ! Y , and U  X ,
V Y:
f (U [ f 1V ) = fU [ V:
Proof. First: f (U [ f 1 V )  fU [ V if U [ f 1 V  f 1 (fU [ V ) = f 1fU [
f 1V if U  f 1 fU , unit of f a f 1 . Then: fU [ V  f (U [ f 1 V ) as follows,
take any W  Y ,
f (U [ f 1V )  W
U [ f 1V  f 1W
U  f 1V ) f 1W
= f 1 (V ) W )
fU  V ) W
fU [ V  W:
So we're done by Yoneda.

Draft of February 5, 2003


178 Adjoints

11.8 Exer ises


1. Show that every monoid M admits a surje tion from a free monoid F (X ) !
M , by onsidering the ounit of the free a forgetful adjun tion.
2. What is the unit of the produ t a exponential adjun tion (say, in Sets)?
3. Let 2 be any two-element set and onsider the \diagonal fun tor"
 : C ! C2
for any ategory C, i.e. the exponential transpose of the rst produ t
proje tion
C  2 ! C:
 has a right (resp. left) adjoint if and only if C has binary produ ts
(resp. oprodu tes).
Now let C = Sets and repla e 2 with an arbitrary small ategory J.
Determine both left and right adjoints for  : Sets ! SetsJ . (Hint: Sets
is omplete and o omplete.)
4. Given a fun tion f : A ! B between sets, show that the dire t image
operation im(f ) : P (A) ! P (B ) is left adjoint to the inverse image f 1 :
P (B ) ! P (A).
5. Show that the ontravariant powerset fun tor P : Setsop ! Sets is self-
adjoint.
6. * Given an obje t C in a ategory C when does the evident forgetful
fun tor from the sli e ategory C=C ,
U : C=C ! C
have a right adjoint? What about a left adjoint?
7. Let P be the ategory of propositions (i.e. the preorder ategory asso i-
ated to the propositional al ulus, say with ountably many propositional
variables p; q; r; : : : ; and a unique arrow p ! q if and only if p ` q). Show
that for any xed obje t p, there is a fun tor
^ p : P ! P;
and that this fun tor has a right adjoint. What is the ounit of the ad-
jun tion? (When) does ^ p have a left adjoint?

Draft of February 5, 2003


Chapter 12

Monads
We begin with yet a third hara terization of adjoints, whi h has the advantage
of being entirely equational.

12.1 The triangle identities


Given an adjun tion,
F :C< >D:U

with unit and ounit,


 :1C ! UF
 :F U ! 1D
we an take any f : F C ! D to (f ) = U (f ) Æ C , and for any g : C ! UD we
have  1 (g) = D Æ F (g) giving the isomorphism:
homD (F C; D) 
= homC (C; UD) :
Now put 1UD : UD ! UD in pla e of g : C ! UD in the foregoing. We
know  1 (1UD ) = D , when e
1UD = (D )
= U (D ) Æ UD
And similarly, (1F C ) = C , so
1F C =  1 (C )
= F C Æ F (C )

Draft of February 5, 2003


180 Monads

Thus the diagrams below ommute.


1UD
UD > UD
 
UD UD
R
UF UD
1F C
FC > FC
 
F C F C
R
F UF C
Indeed, one has the equations of natural transformations:
U Æ U = 1U
F Æ F  = 1 F :
These are alled the \triangle identities".
Proposition 12.1. Given ategories, fun tors, and natural transformations
F :C< >D:U

 : 1C ! U Æ F
 : F Æ U ! 1D
one has F a U with unit  and ounit  i the triangle identities hold.
Proof. We have already shown one dire tion. For the other, we just need a
natural isomorphism,
 : homD (F C; D) 
= homC (C; UD) :
As above, we put:
(f : F C ! D) = U (f ) Æ C ;
#(g : C ! UD) = D Æ F (g) :
Then we he k that these are mutually inverse:
(#(g)) = (D Æ F (g))
= U (D ) Æ UF (g) Æ C
= U (D ) Æ UD Æ g
=g:

Draft of February 5, 2003


12.2 Monads and adjoints 181

Similarly,
#((f )) = #(U (f ) Æ C )
= D Æ F U (f ) Æ F C
= f Æ F C Æ F C
=f :

The triangle identities have the virtue of being entirely \algebrai " { no
quanti ers, limits, in nite onditions, et . Thus anything de ned by adjoints:
free groups, produ t spa es, quanti ers, : : : an be de ned equationally. This
is not only a matter of on eptual simpli ation, it also has important onse-
quen es for the existen e and properties of the stru tures that are so determined,
but that is beyond the s ope of this ourse.

12.2 Monads and adjoints


Next onsider an adjun tion F a U and the omposite fun tor
U Æ F : C ! D ! C:
Given any ategory C and endofun tor
T : C ! C;
one an ask:
Question: When is T = U Æ F for some adjoint fun tors F a U to and from
another ategory D?
Thus we seek ne essary and suÆ ient onditions on the given endofun tor
T : C ! C, for re overing a ategory D and adjun tion F a U . Of ourse, not
every T arises so, and we'll see that even if T = U Æ F for some D and F a U ,
we an't always re over that adjun tion.
First, suppose we have D and F a U and T is the omposite fun tor T =
U Æ F . We have then a natural transformation,
:1!T :
And from the ounit  at F C ,
F C : F UF C ! F C ;
we have UF C : UF UF C ! UF C whi h we'll all:
 : T 2 ! T:
Draft of February 5, 2003
182 Monads

In general, then, as a rst step toward answering our question, if T arises from
an adjun tion, then it should have su h a stru ture  : 1 ! T and  : T 2 ! T .
Let's see what an be said about (T; ; ). First of all, the triangle equalities
give us the following ommutative diagrams:
T > 2
T3 T

T 
_ _
T2 >T


T > 2 < T 
T T T

=

=
R _
T
The reader should prove as an exer ise that these three equations hold.
De nition 12.2. A monad on a ategory C onsists of an endofun tor T :
C ! C, and natural transformations  : 1C ! T , and  : T 2 ! T satisfying
the ommutative diagrams above, i.e.:
 Æ T =  Æ T 
 Æ T = 1 =  Æ T 
Note the formal analogy to the de nition of a monoid. For this reason, the
equations are alled the asso iativity and unit laws, respe tively.
We've now already shown the following:
Proposition 12.3. Every adjoint pair F a U gives rise to a monad with
T =U ÆF
 the unit
 = UF :
Example 12.4. Let P be a poset. A monad on P is a monotone fun tion T :
P ! P with x  T x and T 2x  T x. But then T 2 = T x, so T is idempotent.
Su h a T is sometimes alled a losure operation and written p, sin e a ts like
a losure on the subsets of a topologi al spa e.
In this ase, we are able to re over an adjun tion from the monad. First,
let K = im(T ) (the xed-points of T ), and let i : K ! P . Writing t for the

Draft of February 5, 2003


12.3 Algebras for a monad 183

fa torization of T ,
T
P >P

t
i
_
K
we then have:
p  ik implies tp  tik = k
tp  k implies p  T p = itp  ik
So indeed: t a i.
Example 12.5. Consider the ovariant powerset fun tor P : Sets ! Sets where
for f : X ! Y , P (f ) : P X ! P Y is de ned by taking images. Let X : X !
P X be the singleton operation
S x 7! fxg, and let X : P 2(X ) ! P (X )(A) be the
union operation, X (A) = A. The reader should verify that these operations
are in fa t natural, and that this is a monad on Sets.
Thus monads an, and often do, arise without evident adjun tions being
present. In fa t, the notion of a monad originally did o ur independently of
adjun tions; they are also known as \triples", and \standard onstru tions".
Despite this, the question, when does and endofun tor T arise from an adjun -
tion, has the answer: just if it's the fun tor part of a monad.

12.3 Algebras for a monad


Proposition 12.6. Every monad arises from an adjun tion. That is, given a
monad (T; ; ), there exists an adjun tion F a U ,  : 1 ! F ,  : F U ! 1 su h
that
T =U ÆF
=
 = UF :
Proof. We'll rst onsider the important ategory,
CT = T -algebras,
also alled the Eilenberg-Moore ategory of T . This will be our \D", the se ond
ategory in the adjun tion. Then we'll nd suitable fun tors,
U :CT ! C
F : C ! CT ;

Draft of February 5, 2003


184 Monads

and nally the required natural transformations for the unit and ounit.

To start, CT has as obje ts (\T -algebras") arrows in C of the form T A ! A,
su h that:
Æ T = Æ A
Æ A = 1A

The arrows of CT ,
h : (A; ) ! (B; )
are simply arrows h : A ! B in C, su h that:
Æ h = Æ Th :
It's obvious that C really is a ategory, with the evident \Æ" and \id".
T
Now de ne fun tors,
U : CT ! C
(A; ) 7! A
and
F : C ! CT
C 7! (T C; C )
Given h : C ! C 0 , we have:
T 2h > 2 0
T 2C T C

C C 0

_ _
TC > T C0
Th
sin e  is natural, so we an put:
F h = T h : (T C; C ) ! (T C 0 ; C )
0

to get an arrow in CT ; that is, at least on e we know the following:


Claim: (T C; C ) is a T -algebra.
We need to he k the equations for T -algebras:
T C > 2
T 3C T C

T C 
_ _
T 2C > TC

Draft of February 5, 2003
12.3 Algebras for a monad 185

T C > 2
TC T C

 C
R _
T C:
But these ome dire tly from the de nition of a monad.
Now we've de ned the ategory CT and the fun tors
F > T
C< C ;
U
and we want to show that F a U . Of ourse, we'll he k the triangle identities!
First we need unit and ounit:
 : 1C ! U Æ F
 : F Æ U ! 1CT
Given C 2 C, we have:
UF (C ) = U (T C; C ) = T C ;
so we an take  =  : 1C ! U Æ F as expe ted.
Given (A; ) 2 CT ,
F U (A; ) = (T A; A )
and the de nition of a T -algebra makes this diagram:
T >
T 2A TA

A
_ _
TA > A

into a morphism (A; ) : (T A; A ) ! (A; ) in CT . Thus we're setting:
(A; ) :=
And  is natural by the de nition of a morphism of T -algebras, as follows: Given
h : (A; ) ! (B; ), we need
h Æ (A; ) = (B; ) Æ T h
but that's h Æ = Æ T h, whi h holds sin e h is a T -algebra homomorphism.
Finally, the triangle-identities now read as follows:

Draft of February 5, 2003


186 Monads

1. For (A; ) a T -algebra:


U (A; ) > U (A; )
 
U (A; ) U(A; )
R
UF U (A; )
whi h amounts to:
A > A
 
A
R
TA
whi h holds sin e (A; ) is T -algebra.
2. For any C 2 C:
FC > FC
 
F C F C
R
F UF C
whi h is:
TC > TC
 
T C C
R
T 2C
whi h holds by one of the unit laws for T .
Finally, note that we indeed have:
T =U ÆF
 = unit of F a U :
And for the multipli ation,
 = UF;
we have, for any C 2 C,
C = UF C = U(T C;C ) = UC = C :
So  =  and we're done; the adjun tion F a U via  and  gives rise to the
monad (T; ; ).

Draft of February 5, 2003


12.3 Algebras for a monad 187

Example 12.7. Take the free monoid adjun tion


F : Sets < > Mon : U
The monad on Sets is then
T : Sets ! Sets ;
where for any set X , T (X ) = UF (X ) = \strings over X " . The unit  : X !
T X is the usual \string of length one" operation, but what is the multipli ation?
 : T 2X ! T X
Here T 2X is the set of strings of strings:
[x11 ; x12 ; : : : ; x1n ℄; [x21 ; x22 ; : : : ; x2n ℄; : : : [xm1 ; xm2 ; : : : ; xmn ℄;
and  of su h a string of strings is the string of the elements [x11 ; : : : ; xmn ℄.
Now, what is a T -algebra?
: TA ! A
It's a map from strings over A to elements of A, su h that:
[ a℄ = a
and
(([: : : ℄; [: : : ℄; : : : [: : : ℄)) = ( [: : : ℄; [: : : ℄; : : : ; [: : : ℄):
If we start with a monoid, then we an get a T -algebra  : T M ! M by
[m1 ; : : : ; mn ℄ = m1  : : :  mn , whi h learly satis es the required ondition. It
turns out that every T -algebra is of this form for a unique monoid (exer ise!).
We've given onstru tions ba k and forth between adjun tions and monads,
and we know that if we start with a monad T : C ! C, and then take
F T : CT < > C : U T ;
then T = U T Æ F T . Thus every monoid arises from an adjun tion. But are
U T ; F T ; CT unique with this property?
In general, the answer is no. There may be many di erent ategories D and
adjun tions F a U : D ! C, all giving the same monad on C. If we start with
one su h pair and onstru t CT we then get a omparison fun tor  : D ! CT
with
UT Æ  = U
 Æ F = FT

Draft of February 5, 2003


188 Monads

In fa t,  is unique with this property. A fun tor U : D ! C is alled monadi


if it has a left adjoint F a U , su h that this omparison fun tor
 > T
D C
(T = UF ) is an equivalen e of ategories.
Typi al examples are the \algebrai " ategories arising as ategories of mod-
els for equational theories. An example of a right adjoint that is not monadi
is the forgetful fun tor
U : Top ! Sets;
It's left adjoint is the dis rete-spa e fun tor.
Monadi fun tors have a ri h and interesting theory.

Draft of February 5, 2003


12.4 Exer ises 189

12.4 Exer ises


1. Let T be the equational theory with one onstant symbol and one unary
fun tion symbol (no axioms). In any ategory with a terminal obje t, a
natural numbers obje t (NNO) is just an initial T-model. Show that
(N ; 0 2 N ; n + 1 : N ! N)
is a NNO in Sets, and that any NNO is uniquely isomorphi to it (as a
T-model).
2. Let C be a ategory and T : C ! C an endofun tor. A T -algebra onsists
of an obje t A and an arrow a : T A ! A in C. A morphism h : (a; A) !
(b; B ) of T-algebras is a C-morphism h : A ! B su h that ha = bT (h).
Let C be a ategory with a terminal obje t 1 and binary oprodu ts.
Let T : C ! C be the evident fun tor with obje t-part C 7! C + 1 for
all obje ts C of C. Show (easily) that the ategories of T -algebras and
T-models (T as above) are equivalent:
T -Alg ' T-Mod:
Con lude that an initial T -algebra is a NNO.
3. (\Lambek's Lemma") Show that for any endofun tor T : C ! C, if
i : T I ! I is an initial T -algebra, then i is an isomorphism.
Hint : Consider a diagram of the following form, with suitable arrows.
TI > T 2I > TI

i Ti
_ _ _
I TI > >I
Con lude that for any NNO N in any ategory, there is an isomorphism
N +1 = N.
4. Assume given ategories C and D and adjoint fun tors
F :CD:U
with unit  : 1C ! UF and ounit  : F U ! 1D . Show that every D
in D determines a T = UF algebra U : UF UD ! UD, and that there
is a fun tor D ! T -Alg whi h, moreover, ommutes with the \forgetful"
fun tors U : D ! C and od : T -Alg ! C.
5. Show that (P; s; [) is a monad on Sets, where:

Draft of February 5, 2003


190 Monads

 P : Sets ! Sets is the ovariant powerset fun tor, whi h takes ea h


fun tion f : X ! Y to the image mapping
P (f ) = im(f ) : P (X ) ! P (Y );
 for ea h set X , the omponent sX : X ! P (X ) is the singleton
mapping, with
sX (x) = fxg  X
for ea h x 2 X ;
 for ea h set X , the omponent [X : P P (X ) ! P (X ) is the union
operation, with
[X ( ) = fx 2 X j 9U 2 : x 2 U g  X
for ea h  P (X ).
6. Consider the free a forgetful adjun tion
F : Sets < > Mon : U
between sets and monoids, and let (T; T ; T ) be the asso iated monad
on Sets. Show that any T -algebra : T A ! A for this monad omes
from a monoid stru ture on A (exhibit the monoid multipli ation and
unit element).

Draft of February 5, 2003

Você também pode gostar