Escolar Documentos
Profissional Documentos
Cultura Documentos
Steve Awodey
Copyright
2002, Steve Awodey
ii
11 Adjoints 155
11.1 Denition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
11.2 Hom-set denition . . . . . . . . . . . . . . . . . . . . . . . . . . 159
11.3 Examples of adjoints . . . . . . . . . . . . . . . . . . . . . . . . . 162
11.4 Order adjoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
11.5 Quantiers 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
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
denition 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.
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.
To be expli
it, this means that f is dened 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:
Unit:
f Æ 1A = f = 1B Æ f
for all f : A ! B .
A
ategory is anything that satises this denition { 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
Setsn
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? innite? 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 dened
on them,
topologi
al spa
es and
ontinuous mappings,
dierentiable manifolds and smooth mappings,
graphs and graph homomorphisms,
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:
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 innitely 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.
Denition 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 dening 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.
1.5 Isomorphisms
Denition 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 denition of isomorphism is our rst example of an abstra
t,
ategory
theoreti
denition 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 denitions that it applies in any
ategory. For example, one sometimes
denes 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 denition
in some
ases. But note that, for example in Pos, the
ategory theoreti
deni-
tion gives the right notion, while there are \bije
tive homomorphisms" between
non-isomorphi
posets. Moreover, in many
ases only the abstra
t denition
makes sense, e.g. in the
ase of a monoid.
Warning 1.5. Note the two dierent 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) Dene 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, dened by g(f ) = g Æ f .
1 One should really require here that C is small ; see se tion 1.8 below.
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 :
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
see that this is a fun
tor,
alled the \forgetful fun
tor". The free monoid M (A)
on a set A is by denition \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, dene f : M (A) ! N by
f( ) = uN ; the unit of N
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 dened 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 dene
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 denition of \free". For now, let us see that
C(G) has a universal mapping property.
First, dene 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 dened the
arrows in Graphs.
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 dieren
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 denition of something, namely of
ategories. This is just like in
group theory or topology, where the axioms serve to dene 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 denitely 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:
Denition 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 Setsn
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 dene 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:
Denition 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.
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.
(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 dening its ee
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
u > 00
0
1
10 0
v 0
R _ R
0 > 00
u
For terminal obje
ts, apply the foregoing to Cop.
The denition 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 .
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 \ultralters"
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 ultralter 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.
Denition 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?)
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 dened 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 \dierent 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", dened 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 dene 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
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.
Denition 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
Finite limits
Next we're going to see the
ategori
al denition 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 dene a fundemental mathemati
al
notion.
By \dene" 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
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
3.2 Examples
Example 3.4. We have already had
artesian produ
ts of sets. Note that if we
hoose a dierent denition of ordered pairs we get dierent 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
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 dening 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 dened 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
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
)
Then:
Similarly, p2 Æ (a; b) = b.
Finally, if
: X ! A B also has:
p1 Æ = a; p2 Æ = b ;
then:
p1 p2 > 0
A< A A0 A
f f0
_ _
B< B B0 > B0
q1 q2
f f 0 : A A0 ! B B 0
Draft of February 5, 2003
40 Finite limits
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 =
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.
Denition 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.
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 denitions 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 denition 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
h Æ (g Æ f ) = (h Æ g) Æ f
The operation \Æ" is only dened 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;
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 denition, 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, quantiers, 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 denition from last week:
Denition
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
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 prex \
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 dene
(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.
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.
Example 3.20. Sum types in the lambda-
al
ulus are
oprodu
ts in the
ategory
of types dened 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 ; : : : )
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.
Denition 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.
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:
Denition 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
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
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.
1. groups in a
ategory
2. the
ategory of groups
3. groups as
ategories
1
satisfying the following
onditions:
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.
Denition 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
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 quantiers
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
.
. ...
.
. .
. . ... f
_ ..
G=N
Draft of February 5, 2003
4.2 The
ategory of groups 61
dened by:
f[g℄ = f (g):
This is well dened 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.
a f b
> >
> >
g
Let be a
ongruen
e on C, dene 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-dened!
There are evident fun
tors
p1 >
C >C
p2
We build the quotient
ategory C= as follows
(C= )0 = C0
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 )
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
? >?
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 , dene
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)
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 .
Denition 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
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.
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 denition rst:
Denition 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
g
_
A > C
f
Draft of February 5, 2003
72 Limits and
olimits
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.
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 dene 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.
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.
and
h (g Æ f ) = h (g) Æ h (f )
These
an easily be veried 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
_ _
C=A < C=B
f
Draft of February 5, 2003
76 Limits and
olimits
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
>
_ _ _
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.
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
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
denitions:
Denition 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.
Denition 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
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.
= 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 .
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:
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
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 dene:
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 dened 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-dened, and determine a
group stru
ture on G1 , whi
h moreover makes all the evident fun
tions:
ui : Gi ! G1 ;
dened 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.
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 : : :
dened 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
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, dened 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.
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:
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 >:
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, dene 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-dened 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 dene a
ategory.
7. (Pushouts)
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.
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 denition,
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
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
dened 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
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
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 denition 107
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 dierent 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 dierent 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
)
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, dene 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
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.
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 dened 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
f0 > 0
X X
a a0
_ _
A0 > A
f1
of C2 is in C=A if and only if f1 = 1A.
to
homC (f; C ) : homC (B; C ) ! homC (A; C ) ;
dened 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 dene 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, dened 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
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
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.
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 ultralters 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?
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 dierent 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
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.
8.2 Examples
Example 8.2. Consider the free monoid M (X ) on a set X , and dene 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 dened by on obje
ts by
A B = B A ;
and on arrows by
= :
Dene 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
= t(A ;B ) Æ ( )ha; bi
0 0
(f 1B ) 1C f (1B 1C )
_ _
(A0 B ) C > A0 (B C )
#A 0
f f
_ _
W > W
W
in Ve
t (as the reader should
he
k!), while there is no su
h naturality for V .
= 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.
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' " denition 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 satises 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 dene the (proposed) fun
tor:
F (hA; B i) = F (A; B )
F (h; i) = F (A0 ; ) Æ F (; B )
The inter
hange law, together with fun
toriality in ea
h argument, then ensures
that
F (0 ; 0 ) Æ F (; ) = F (h0 ; 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 )
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 dened by:
F (X )(C ) = F (X; C ) :
sG sH
_ _
G0 > H0
h0
and
h1 >
G1 H1
tG tH
_ _
G0 > H0
h0
both
ommute.
Now
onsider the
ategory pi
tured
>
>
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
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.
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 Denition 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
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
where
D : D
= F E (D) where E (D) 2 C0 :
(2 implies 1) We need to dene E : C D and
:1C ! EF;
:1 ! F E:
D
Given h : D ! D0 in D,
onsider:
D >
D F E (D)
h D 0 Æ h Æ D 1
_ _
D0 > F E (D0 )
D 0
f EF (f )
_ _
C0 > EF (C 0 )
C 0
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
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 dened 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:
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.
Lemma 9.8. For any nite boolean algebra B, there is an isomorphism between
atoms a in B and ultralters 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 ultralters 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 dened 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.
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
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 dene #a : yC ! F as follows. Given C 0 , we
need (#a )C : hom(C 0 ; C ) ! F C 0 . Dene (#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
= 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
= #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
we get:
C (x# ) = C (#C (1C ))
= (#)C (1C )
= x(#)
= C;F ((yC; )(#)):
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 dened, so the
Yoneda Lemma does not apply.
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,
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 dene
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 )
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 Denition
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 )
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 ))
dened 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 denition of adjun
tion on this situation, as
follows. It's preliminary be
ause later on a slightly dierent (but equivalent)
denition will emerge as more
onvenient.
Denition 11.1. An adjun
tion between
ategories C and D
onsists of fun
-
tors
F :C< >D:U
UF
_ _
C0 > UD
C
Draft of February 5, 2003
11.2 Hom-set denition 161
= 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):
This denition 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 )
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 ()
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 :
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):
Dene 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.
on subsets, with image left adjoint to inverse image, taken along the rst pro-
je
tion : M M ! M .
Finally, the universal quantier
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.
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 quantiers 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?
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 dene 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 dened 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
^ ^
Monads
We begin with yet a third
hara
terization of adjoints, whi
h has the advantage
of being entirely equational.
: 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:
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
quantiers, limits, innite
onditions, et
. Thus anything dened by adjoints:
free groups, produ
t spa
es, quantiers, : : :
an be dened 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.
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.
Denition 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 denition 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
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 dened 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.
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 dene 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
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 denition of a monad.
Now we've dened 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 denition 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 denition 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:
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: