Category Theory
Category Theory
Introduction
It is often the case that similar concepts and theorems appear in different forms in different
branches of mathematics. For instance, in the context of group theory, two groups are called
isomorphic if there is a bijection between them that preserves the group structure; a similar
idea appears in topology, where two topological spaces are said to be homeomorphic if there is a
homeomorphism between them, i.e. a continuous bijection whose inverse is also continuous. As
another example, the Cartesian product of two sets and the direct product of two groups share
many of the same properties.
Category theory aims to describe these similarities in a more general setting, by allowing us
to remove ourselves from the actual mathematical entities involved and concentrate on the way
they interrelate with each other. We ignore the internal structure of the objects (as they are
known) and instead focus on the functions between them, which we call arrows (or morphisms).
At its highest level, the degree of abstraction can sometimes become extreme, earning category
theory the nickname generalised abstract nonsense, even among its initiators [15]; hence the
title of this essay.
We first define a category:
Definition 1.1. A category C is a collection Ob C of objects A, B, C, . . . , together with a
collection MorC (A, B) of maps f, g, h, . . . for each pair A, B of objects in Ob C, which we call
arrows (or morphisms), such that the following conditions are satisfied:
For every arrow f in C we can assign an object dom f , its domain, and an object cod f , its
codomain. If f MorC (A, B) we say dom f = A and cod f = B and we write f : A B.
For any pair of arrows f and g with cod f = dom g there is a composite arrow gf : dom f
cod g such that the following associative law holds for all arrows f : A B, g : B C and
h : C D, where A, B, C, D are (not necessarily distinct) objects in C:
h (g f ) = (h g) f.
For every object A in C there is an identity arrow idA : A A such that for all objects
A, B in C and all arrows f : A B we have f idA = f = idB f .
(If A Ob C then we may sometimes refer loosely to A as an object in C. In some cases it is
useful to call A a C-object to avoid confusion when more than one category is being discussed. Similarly,
if f MorC (A, B) for some A, B Ob C then we call f a C-arrow.)
1.1
Diagrams
Category theory makes substantial use of so-called commutative diagrams and many of the concepts
relating to categories are expressed most clearly using them; in fact, the technique of diagram chasing
can make many category theoretical proofs appear trivial. A diagram is a collection of nodes and edges
which we label with objects and arrows (in a consistent way, so that, for instance, if f : A B is an
arrow from an object A to an object B then we may label the edge between two nodes A and B as f .)
A diagram may have many different edges between any two nodes, or none at all.
A diagram is said to commute if, for every pair of vertices A and B, the same result is achieved
regardless of which path from A to B we choose to take. For example, the diagram
/B
@@
@ g
h @@
A@
@
?B@
~~ @@@f
~
@@
~~
@
~~
/C
A
g
f g
Associativity:
/B
@@
@@
@@hg
g
@
@@
gf @@
@
/D
C
A@
@
Identity:
/B
@@
@@
@g
@@ idB @@@
f
@
@
/C
B
A@
@
1.2
Examples of Categories
Now that we have defined a category, let us look at some examples. (Further examples can be found in
almost any textbook on category theory, for instance Mac Lane [8], Pierce [13], Pareigis [12], Mitchell
[11], Arbib and Manes [2], Herrlich and Strecker [7], Bucur and Deleanu [4] and many others.)
Perhaps the most obvious candidate for a category is the collection Set with sets as objects and
set functions as arrows. The category axioms are easily satisfied, as shown below.
An object in Set is a set and an arrow f : A B in Set is a function f from A to B.
For a function f : A B we have dom f = A and cod f = B and write f MorC (A, B).
The composition of two arrows f, g in Set with cod f = dom g is just the normal set-theoretic
composition of functions, defined by (f g)(x) = f (g(x)) for every x dom g, and composition
is associative.
For each set A the identity function idA has dom idA = cod idA = A and clearly f idA = f
and g = idA g for any functions f : A B and g : C A.
(There is an important subtlety to be aware of in our definition of arrows in Set: namely, codomains
matter! The arrow x 7 x2 : R R in Set is distinct from the arrow x 7 x2 : R R+ , where R+ is the
set of non-negative real numbers. In other words, each function on sets correponds to many different
arrows in Set.)
The astute reader may have noticed an apparent conflict between this example and our
original definition of a category, which talked about such things as a collections of objects.
However, we are not defining sets in terms of categories here, so there is no circularity in our
definitions and the set-theoretic definition of a category given above is mainly a convenience.
Mac Lane [8] actually first defines a metacategory as anything satisfying the axioms of definition
1.1 and a category as any interpretation of this within set theory. Categories can in fact be defined
in a purely algebraic way, as in the original paper on category theory [6]. (For a discussion of
the various alternative definitions of a category see Marquis [9].)
It is worth noting that a naive set-theoritic formulation of category theory can, however, give
rise to certain difficulties relating to the apparent problem of talking about arbitrary collections
of objects like sets. Russells Paradox1 shows us that we cannot just talk about notions such as
the sets of all sets without leading to contradictions. To avoid such paradoxes we adopt the
approach of axiomatic set theory, wherein sets are an example of a more general object called
classes. If a class X is an element of some other class then X is called a set. Otherwise X is
called a proper class. The set of all sets is actually a proper class.2
Here is another example of a category based on a familiar mathematical concept.
The collection of vector spaces over a field K and the linear maps between these vector
spaces form respectively the objects and arrows a category VectK . Verification of the
axioms requires a little more work than for Set, namely showing that the composition of
linear maps is actually another linear map, but is not difficult.
There is any number of similar categories, whose objects are some kinds of sets with structure and whose arrows are the structure-preserving maps between these objects. We list some
possibilities:
Groups and group homomorphisms between groups form a category Grp.
Rings and ring homomorphisms between rings form a category Rng.
Topological spaces and continuous maps between topological spaces form a category Top.
There are many more examples, some of which require more mathematics than this essay assumes3 , as well as many which can be formed from more basic categories by imposing more
1 In 1901 Bertrand Russell announced the following contradiction that arises in naive set theory. Consider the
set of all sets that do not contain themselves:
M = {A | A
/ A}
Is M M ? If yes, then it must satisfy the property that it does not contain itself, contradicting the fact that it
does. If no, then M
/ M , which because of the definition of M implies that M M , another contradiction.
2 We say a category C is small if both its collections of objects and arrows are sets. If for any two objects A and
B the collection MorC (A, B) of arrows from A to B is a set, then C is locally small. This is different from asking
that the collection of all arrows in C be a set. Otherwise we say C is large. It turns out that some theorems
from category theory only apply to small categories, but the foundational issues can become quite complex for
more information see McLarty [10], Ch. 12.
3 For instance, Mod , the category of (right-)modules over a ring R, Diff , the category of differentiable
R
manifolds and smooth maps and HoTop, the category of topological spaces with equivalence classes of homotopic
functions as arrows. The last of these is an important example of a category whose arrows are not just structurepreserving maps [9].
1.3
So far all our examples have been cases of what are known as concrete categories, based
on collections of familiar mathematical objects and the appropriate structure-preserving maps
between them.
However, as mentioned earlier, it is entirely possible to talk about completely abstract categories where the objects and arrows do not correspond to any particular mathematical objects;
we simply require that the axioms of definition 1.1 are satisfied.
Examples.
1. The category 0 is the empty category with no objects and no arrows.
2. The category 1 has one object. The only arrow is the identity arrow, which by convention
we do not draw:
3. The category 2 has two objects and one non-identity arrow between these objects:
4. The category 3 has three objects with the non-identity arrows arranged in a triangle as
shown below:
/
@
@@
?
@@
@@
Note that there is only one way in which the arrows could be arranged for the axioms of
definition 1.1 to be satisfied.
There is a third type of category that we will consider, where we think of single mathematical
objects as categories in their own right. This is perfectly valid, as long as we define our objects,
arrows and composition in such a way that the axioms of definition 1.1 are satisfied. This
abstractness is typical of the category theoretic approach; the more we generalise, the more of
the bigger picture we see.
4 When it is obvious from context, the category of Xs and Y s is used to refer to the category whose objects
are Xs and whose arrows are Y s between Xs.
5 A topological space T has the Hausdorff property if any two distinct points of T can be contained inside
disjoint open sets. In particular, every metric space has the Hausdorff property: simply take open balls around
each point with radius equal to half the distance between them.
Examples.
1. We give the following definition:
Definition 1.2. A preorder is an ordered pair (P, 6P ) consisting of a set P and a binary
relation 6P defined on P satisfying
Reflexivity: For all p P , p 6P p;
Transitivity: For all p, q, r P , p 6P q and q 6P r = p 6P r.
If (P, 6P ) satisfies a third condition
Antisymmetry: For all p, q P , p 6P q and q 6P p = p = q.
then we call (P, 6P ) a partially ordered set (or poset for short).
We can show that the collection of all partially ordered sets together with order-preserving
mappings6 form a category Poset, as mentioned earlier, but we can also do something else
interesting:
An individual poset can be considered as a category whose objects are the elements of the
poset. We draw an arrow between two objects p and q if p 6P q. If this is not the case,
we draw no arrow between them.
Composition of arrows is guaranteed by transitivity and is associative; the existence of identity arrows for each object corresponds to the axiom of reflexivity. Note that antisymmetry
is not actually needed, so in fact any preorder can be considered as a category.
2. We give another definition:
Definition 1.3. A monoid is an ordered triple (M, , e) consisting of a set M , a binary
operation : M M M and a distinguished element e M satisfying
Associativity: For all x, y, z M , x (y z) = (x y) z;
Identity: For all x M , x e = e x = x.
Notice that a monoid is a group where elements do not necessarily have an inverse. Alternatively, a monoid can be thought of as a semigroup7 that has an identity element; in
particular a semigroup may be empty, while a monoid may not [14].
It is clear that there is a category Mon where the objects are monoids and the arrows are
monoid homomorphisms8 , but this is not all.
We can consider a monoid as a category with one object. The arrows in this category
represent the elements of the monoid; composition of arrows corresponds to the binary
operation and is associative, as required, and the identity arrow corresponds to the
identity element e.
6 A map f : P P is order-preserving or monotone if p 6
1
2
P1 q = f (p) 6P2 f (q) for all p, q P1 , where 6P1
and 6P2 are the binary relations on P1 and P2 , respectively. For example, if S is a set and P(S) = {A | A S} is
its power set, then the map f : P(S) N, where f (A) = |A|, is order-preserving, since A1 A2 = |A1 | 6 |A2 |.
(This example is taken from Arbib and Manes [2].)
7 A semigroup (G, ) is defined here to be a set G together with a binary operation : G G G that is
associative, i.e. a (b c) = (a b) c for all a, b, c G.
8 A monoid homomorphism is a map : M M such that for every a, b M we have (a b) = (a) ? (b),
1
2
1
where and ? are the binary operations in M1 and M2 , respectively.
3. As an example of the notion of a category used in a more philosophical setting, we note that
we can consider any deductive logical system T as a category whose objects are formulae
(or theorems) and whose arrows are proofs, provided we have some notion of equivalence
of proofs. The categorical operations correspond to the allowed logical deductions. See
Marquis [9], for more information.
1.4
Given a category C or a pair of categories C and D one may wonder if there are ways to derive
other categories. There are in fact many, and we give some abstract examples, which will become
more relevant later.
Definition 1.4. A category B is a subcategory of a category C if Ob B Ob C, for each pair
of objects A and B MorB (A, B) MorC (A, B) and composite and identity arrows in B and C
coincide.
Definition 1.5. The dual (or opposite) category of a category C, which we write as Cop is the
category whose objects are the objects of C, but whose arrows are the arrows of C with domain
and codomain reversed. That is, an arrow f : A B of C appears as an arrow f op : B A in
Cop . This definition will be very important later.
Definition 1.6. Given a pair of categories C and D, the product category C D has as objects
ordered pairs (C, D) where C is a C-object and D is a D-object, and, as arrows, ordered pairs
(f, g), where f is a C-arrow and g is a D-arrow. We define
(f, g) (h, i) = (f h, g i)
and
Definition 1.7. For a category C the category of arrows over C, written C , has C-arrows
as objects. That is, every arrow f : A B in C is an object in C , hence each arrow in C
must have C-arrows as its domain and codomain. We define a C -arrow from f : A B to
f 0 : A0 B 0 to be an ordered pair (a, b) of C-arrows a : A A0 and b : B B 0 such that
f 0 a = b f , illustrated in the commutative diagram below:
A
f0
B
/ A0
/ B0
Constructions in categories
One of the main aims of category theory is to describe systems of mathematical objects not by
their internal structure but by the relationships between them. For example, consider the empty
set as an object of Set. This set has the unique property that for any other set A there is
precisely one function from to A, namely the empty function; in fact, the empty set is an
example of a more general categorical construction called an initial object.
There are many possible constructions that we could identify, and we will not list them all,
but we introduce some of the more fundamental ones below.
2.1
Definition 2.1. An object A in a category C is called a terminal object if for every object B in
C there is exactly one arrow from B to A.
Example. In Set the terminal objects are the singleton sets {x}. For any set B the only function
from B to {x} is the function that sends b to x for every b B.
Example. A deductive system considered as a category has no terminal objects, as no theorem
can be proved in only one way. If a theorem T can be proved assuming T 0 , then it can be proved
assuming T 0 and any other theorem U , provided that U does not contradict T .
Definition 2.2. An object A in a category C is called an initial object if for every object B in
C there is exactly one arrow from A to B.
Example. In Set the only initial object is the empty set, as we have already seen. For each set
B the empty function is the only function from to B.
Example. Consider the vector space {0} of the category Vect (where we omit the subscript
indicating the field). This is a terminal object, since it contains only one element, and so for
any vector space V in Vect the constant map v 7 0 for every v V is the only arrow from V
to {0}. But {0} is also an initial object, since every linear map from {0} must fix 0 and hence
there is only one linear map from {0} to V for any vector space V in Vect.
We call any object that is both initial and terminal a zero object, because of this example.
Many familiar categories contain zero objects, including Grp.
(Sometimes arrows to a terminal object or from an initial object are marked with an exclamation
mark to indicate their uniqueness, as shown below.)
A
/B
Note that the definition of an initial object is exactly the same as the definition of a terminal
object, but with the arrows reversed. This is an example of an important concept in category
theory called duality.
2.2
Duality
The principle of duality is a very important concept in category theory. Recall definition 1.5 in
which we defined the dual category Cop of a given category C and observe that every category
op
is the dual of its dual: C = (Cop) .
Definition 2.3 (Duality Principle). Let W be any construct defined for some category C. Then
the dual of W , usually called co-W , is the construct defined for the category C by defining W
in Cop and reversing the arrows.
The point of this is that it allows us to form dual statements to any definitions and theorems
we want to talk about, simply by reversing the arrows in our diagrams. So the concept of an
initial object is actually dual to that of a terminal object; every terminal object in a category C
is an initial object in the dual category Cop . Furthermore, if a theorem holds in C then its dual
holds in Cop . An important corollary of this is that if a theorem holds in every category then so
does its dual.
2.3
(We adopt the widely accepted convention that a diagram commutes if any two paths between two objects
given the same result, provided at least one path consists of more than one arrow. So the diagram above
on its own means that f g = f h, but not that g = h.)
In the same way that initial objects are the categorical dual to terminal objects, epimorphisms are dual to monomorphisms. An epimorphism is a co-monomorphism; in other words, an
epimorphism in C is a monomorphism in Cop and since (Cop )op = C a monomorphism is also a
co-epimorphism.
Definition 2.6. An arrow f : A B is an isomorphism if there exists an arrow k : B A such
that
k f = idA and f k = idB
If there is an isomorphism between two objects A and B we write A
= B.
Example. As hinted at in the introduction, isomorphisms in Set are bijections (which will be
proved in section 2.5), in Grp they are group isomorphisms and in Top they are homeomorphisms.
Often two or more categorical constructions (in the widest sense) can be considered to be
essentially the same. We say two objects are unique up to isomorphism if there is unique
isomorphism between them. For example
Lemma 2.7. Terminal objects are unique up to isomorphism. That is, for any two terminal
objects there is a unique isomorphism between them.
Proof. Let T and T 0 be two terminal objects in a category C. Since T is terminal there is a
unique arrow u : T 0 T and similarly there is a unique u0 : T T 0 , since T 0 is terminal. But
this uniqueness implies that u0 u = idT and u u0 = idT 0 , so u is a unique isomorphism with
inverse u0 (and vice versa).
Applying the duality principle to lemma 2.7 gives us the following for free, since an initial
object in C is just a terminal object in Cop .
The single non-identity arrow f is a monomorphism, since there is only one arrow, the identity
of its domain, that can be composed with it on the left. Similarly f is an epimorphism, since
only the identity arrow of its codomain can compose with it on the right. But f is not an
isomorphism, for there is no arrow k such that f k and k f are the identity arrows of f s
domain and codomain, respectively.
In the next section we will take a quick detour into so-called generalised elements in order
to describe necessary and sufficient conditions for an arrow to be an isomorphism. In some
categories all epic monomorphisms are indeed isomorphisms; such categories are called balanced.
In fact, many familiar categories are balanced, including Set (see section 2.5), but notably the
category of categories, which we will discuss later, is not balanced.
2.4
Generalised elements
(This section is based heavily on [10], Ch. 1. The notation may be non-standard.)
Definition 2.9. (McLarty [10], p. 17) We call an arrow x : T A a generalised element of A,
at stage of definition T , and write x T A. Furthermore, if there is an arrow f : A B we can
express the fact that f x : T B by writing f (x) T B.
If A is terminal then there is a one-to-one correspondence between the elements of an object
B and the arrows x : A B. In this case x A B is called a global element of B. While this is
not immediately obvious in generality, it can easily be seen to be true for the category Set.
Generalised elements allow us to formulate the concept of a monomorphism in a familiar way:
Lemma 2.10. Let f : A B and suppose x, y T A. Then f is a monomorphism if and only
if f (x) = f (y) = x = y. That is, monomorphisms are injective on generalised elements and
the converse.
Proof. x, y T A means precisely that there are arrows x, y : T A. As f is monic, f x =
f y = x = y. The converse is similar.
Unfortunately, there is no similar description of epimorphisms in terms of their actions of
generalised elements ([10], p. 17), so we proceed with a new definition.
9
A _?
??
??
x ??
/B
?
~
~
~
~~y
~~
A_
g
/B
~>
~
~
~~
~~ idB
(=) Conversely, suppose that such a g exists. Then for any y T B the element g(y) T A has
f (g(y)) = y, i.e. f g = idB .
A _o
f
g
g(y)
/
?B
~
~
~
~~y
~~
When f g = idB as above, we say that g is a right inverse for f and that f is a left inverse
for g. Right inverses are not unique. Every arrow f with a right inverse g is an epimorphism
since
h f = k f = h f g = k f g = h = k
Theorem 2.13. An arrow is an isomorphism if and only if it is both injective and surjective on
generalised elements; that is, if and only if it is both a monomorphism and a split epimorphism.
Proof. (=) Since every isomorphism f has a both-sided inverse f 1 , all isomorphisms are split
epic. Every isomorphism is also monic since
f h = f k = f 1 f h = f 1 f k = h = k.
(=) Suppose f is monic and split epic and consider a right inverse g of f . Then
f idA = f = (f g) f = f (g f ) = g f = idA ,
as f is monic. So f is an isomorphism with inverse g.
10
2.5
Having seen many examples of categories in section 1.2 consisting of a certain type of mathematical domain as objects with relevant maps (or classes of maps) between these domains as arrows,
it is natural to ask if we can form a category of categories, whose objects are categories and
whose arrows are the appropriate structure-preserving map between categories.
Foundational issues stop us from forming a category of all categories (see e.g. Mac Lane [8] or
Cameron [5]), but it is possible to form a category Cat of all small categories (recall subsection
1.2). The arrows in Cat are called functors, and are defined below.
11
3.1
Examples of functors
Example. For each category C there is an identity functor idC : C C that maps each object
to itself each arrow to itself.
Example. A relatively straightforward example of a functor in Set is the power set operator
P : Set Set, taking each set X to its power set, the set of all its subsets. P(X) and each
arrow f : X Y to the arrow P(f ) : P(X) P(Y ) which sends a subset A X to B = f (A),
the image of f restricted to A.
Example. Consider a monoid (M, , e) in the category Mon. If, for a moment, we ignore the
fact that this monoid includes an associative binary operation and an identity element then we
can just associate (M, , e) with the underlying set M ; similarly, we can ignore the fact that the
arrows in Mon are monoid homomorphisms and consider them simply as set functions between
the underlying sets of our monoids.
The functor U : Mon Set which takes each monoid (M, , e) to its underlying set M
and each monoid homomorphism to the corresponding set function is called the forgetful functor
from Mon to Set as it simply forgets the structure of the objects and arrows in its domain.
Similarly there are forgetful functors from Grp to Set, from Top to Set, from AbGrp to Grp,
from Met to Haus, and so on.
Example. If D is a subcategory of C then there is an inclusion functor i : D C which takes
every D-object to itself considered as an object of C, and every D-arrow f : A B to the
same arrow considered as a C-arrow. For example, there are inclusion functors from Mon to
Grp, from Top to Met, and from Vect to NLinSp, the category of normed linear spaces and
bounded linear transformations.
Example. The functor : C C C (where C C is the product category of definition 1.6)
which takes each C-object C to the C C-object (C, C) and each C-arrow f : A B to the
arrow (f, f ) : (A, A) (B, B) is called the diagonal functor.
The above examples illustrate just a few possible functors. In general there are many different
functors between any two given categories.
3.2
Natural transformations
There is a natural relationship between the identity functor idSet : Set Set and the power
set functor P : Set Set. For each set X consider the set function X : X P(X) sending
each x X to the singleton set {x}, which is a subset of X, i.e. an element of P(X). For
any sets X and Y and any function f : X Y we get the same result if we consider a set X,
map each element to the corresponding singleton set and then apply a restriction of f to each of
these subsets of X as if we first apply f to the set X and then map each each of the elements in
9 A contravariant functor F : C D that takes every C-object A to a D-object F (A) and every C-arrow
f : A B to a D-arrow F (f ) : F (B) F (A). That is, it swaps the domain and codomain of the arrows it
maps. In other words, a contravariant functor F : C D is just a covariant functor F : Cop D. We will not
be concerned with the distinction between covariant and contravariant functors in this essay.
12
the image f (X) to their corresponding singletons; in other words, P(f ) X = Y idSet (f ),
illustrated in the following commutative diagram:
idSet (X)
idSet (f )
/ idSet (Y )
P(X)
/ P(Y )
P(f )
This can be simplified by remembering that the image of any set X or any set function f : X Y
under the identity functor idSet is simply itself.
X
P(X)
/Y
Y
P(f )
/ P(Y )
The above diagrams commute for any pair of sets X and Y , and we say that the collection of
maps Xi : X P(X), indexed over the objects Xi of Set, is a natural transformation. We
write : idSet P.
Now we give the general definition.
Definition 3.2. A natural transformation between two functors F , G : C D is a family of
maps, indexed over the collection of objects of C, such that
F (A)
F (f )
G (A)
/ F (A)
B
G (f )
/ G (B)
algebraic structures [9]. Eilenberg and Mac Lane [6] published the original paper on category
theory in order to describe the natural transformations between such functors; the notions of a
functor and of a category were effectively auxiliary ones.
An advanced concept that is central to category theory is that of an adjoint functor, introduced by Daniel Kan over ten years after the initial publication of the original paper by Eilenberg
and Mac Lane [6]. In some sense, an adjoint is like a conceptual inverse to a functor. For example
(taken from [9]), the functor from Set to Grp that takes a set to the so-called free group generated from it (very loosely, the group created from a set with no constraints other than the fact
that the result must be a group) is an adjoint functor to the forgetful functor U : Grp Set.
The amazing thing about adjoint functors is that they appear in so many different ways. In
particular, a remarkable number of constructions in mathematics arise as adjoints to certain
forgetful functors, which despite appearing on the surface to be very straightforward, turn out to
be particularly useful [9]. The apparently fundamental notions of limits and colimits in section
4 are also actually specific instances of adjoint functors.
Universal constructions
The constructions we have seen so far terminal and initial objects, monomorphisms and epimorphisms share a similar property. This section introduces three more important categorical
constructions (products, equalisers and pullbacks) as well as their duals constructions (coproducts, coequalisers and pushouts). These constructions all consist of an object X together with
arrows maybe only one from (or to, in the case of the dual constructions) X satisfying
certain conditions, and with the property that if any other object X 0 and arrows satisfy these
conditions then there is a unique arrow from X 0 to X (from X to X 0 ). Such a construction is
said to be universal.
4.1
Definition 4.1. A product of two objects A and B consists of an object P together with arrows
1 : P A and 2 : P B (called projections) such that for any other object C and arrows
p1 : C A and p2 : C B there is a unique arrow hp1 , p2 i : C P , as shown in the following
diagram:
C
~ @@@ p
p1 ~~
@@2
@@
~~
~
~
A _@ hp1 ,p2 i
B
?
@@
~~
@@
~
~~
1 @@
~~ 2
P
There may be many different product objects for a given pair A and B, or none at all. If
we pick a particular representative object as our product, it is often denoted A B by analogy
with the Cartesian product in Set, which is the manifestation of the categorical product in that
category (see following example). It is important to remember that this choice is not unique:
for instance, in Set, the set B A with the projections 2 : B A A and 1 : B A B
is just as good as product for A and B. However, in proposition 4.3 we will show that any
two product objects satisfying definition 4.1 are isomorphic, i.e. they are essentially the same
in categorical terms. Note also that we do not really need to state what the product object P
14
is; it is determined by the arrows 1 and 2 . So we may think of a product as an ordered pair
(1 : P A, 2 : P B).
Reversing the arrows we obtain the definition of a coproduct, the dual of the categorical
product:
Definition 4.2. A coproduct of two objects A and B is a pair of arrows (1 : A Q, 2 : B Q),
called injections, such that for any other object C and arrows q1 : A C and q2 : B C there
is a unique arrow [q1 , q2 ] : Q C, as shown in the following diagram:
? CO _@@
@@q2
~~
~
@@
~
~
@
~~
q1
[q1 ,q2 ]
A?
B
??
??
1 ??
2
Q
Since these arrows are unique, we must have h1 , 2 ih10 , 20 i = idP and h10 , 20 ih1 , 2 i = idP 0 ,
so P
= P 0.
Example. Consider two sets A and B in the category Set. The Cartesian product A B is
also their categorical product with 1 : A B A and 2 : A B B the usual projections:
1 : (a, b) 7 a
2 : (a, b) 7 b
Given any other set C and functions p1 : C A and p2 : C B, there is a unique function
hh, ki : C A B defined by
hh, ki : c 7 (h(c), k(c))
whose first an second components are the values of h and k applied to c, respectively10 . Then
i hp1 , p2 i = pi for i = 1, 2 as required.
Example. The coproduct of two sets A and B corresponds to their disjoint union
A ] B = (A {0}) (B {1})
10 The notation hh, ki is likely to have arisen from the convention, which I have chosen not to use, of writing
ordered pairs in angle brackets, so that hh, ki : c 7 hh(c), k(c)i.)
15
and 2 : b 7 (b, 1)
Given any other set C and functions q1 : A C, q2 : B C, the unique function [q1 , q2 ] : A]B
C that makes the diagram commute is defined
[q1 , q2 ] : (a, 0) 7 q1 (a)
hfi iiI
Y
iI
Ai
C;
;;
;; fi
;;
;;
/ Ai
It is clear to see that definition 4.1 is just the specific case of this definition when I = {1, 2}.
Example. Consider a poset (P, 6) as a category. Recall that we draw an arrow from p to q if
p 6 q. The product of two objects p and q is an object r such that r 6 p, r 6 q and, whenever
11 Associativity of ? follows from the associativity of and ; if e and e
G
H are the identities of (G, ) and (H, )
take eGH = (eG , eH ) as the identity of (G H, ?); the inverse of (g, h) (G H, ?) is (g 1 , h1 ), where g 1
and h1 are the inverses of g and h in (G, ) and (H, ), respectively.
12 ((g, h) ? (g 0 , h0 )) = (g g 0 , h h0 ) = g g 0 = (g, h) (g 0 , h0 ) and similarly for .
1
1
1
1
2
16
In other words, r is a lower bound for p and q, and furthermore it is the largest possible lower
bound: all other lower bounds are smaller (or equal). So in a poset considered as a category the
product of two objects is their minimum. The categorical product of an arbitrary collection of
objects in a poset considered as a category is their greatest lower bound.
Similarly, the coproduct of two objects in a poset considered as a category is their maximum,
an the coproduct of an arbitrary collection is their least upper bound.
We can also define product arrows between product objects:
Definition 4.5. If A B and C D are two product objects then for each pair of arrows
f : A C and g : B D the product arrow f g : A B C D is the arrow hf 1 , g 2 i.
Ao
4.2
f g
Co
/B
AB
C D
10
/D
20
/A
F
XO
//
e0
X0
//
/X
k0
17
' 0
X
The following examples show how equalisers and coequalisers manifest themselves in Set.
Example. (Adapted from Arbib and Manes [2], pp. 2122.) Equalisers in Set give us an idea
of where the term equaliser comes from. Suppose that X is a set and we have two functions
q1 , q 2 : X Y .
Proposition 4.8. The equaliser e : E X of q1 and q2 is the inclusion map e : E X, sending
each x E to itself considered as an element of X, where
E = {x X | q1 (x) = q2 (x)}
Proof. By definition of E we have that q1 e(x) = q2 e(x) for every x E, hence
E
/X
q1
q2
//
: x 7 e0 (x)
which works because our supposition tells that every element x E 0 satisfies q1 e0 (x) = q2 e0 (x),
and so e0 (x) E.
q1
e /
//
X
Y
EO
F
q2
E0
e0
Any other map in place of would differ on some elements x E 0 , but e(x) = x for all x E
so must be unique. Hence e = eq(q1 , q2 ).
Example. (Adapted from Arbib and Manes [2], pp. 1620.) In Set the concept of a coequaliser
is related to that of an equivalence relation. Before proposing exactly how they are related we
briefly run through some terminology.
Recall that an equivalence relation is a binary relation that is reflexive, symmetric and transitive. That is, for all x, y, z, we have
x x,
x y y x and x y, y z = x z
If is an equivalence relation on a set X we define the set E X X, which we will also refer
to as the equivalence relation, by
E = {(x, y) X X | x y}
and for each x X we call the set
[x]E = {y X | (x, y) E}
the equivalence class of x (with respect to X). The set of distinct equivalence classes is called
the quotient set of X (with respect to E) and is written X/E.
We associate with each element x X the equivalence class containing x by the function
E : X X/E
E : x 7 [x]E
18
which we call the canonical onto map. Since the equivalence classes partition X/E, this function
is clearly surjective (hence the name).
Notice that given any relation R on a set X (i.e. any subset of X X, not necessarily an
equivalence relation), we can define projections
pi : R X
pi : (x1 , x2 ) 7 xi
p2
// X
/ X/R
(
B
Since R is surjective must be unique, for if it were not then any distinct arrow would have to
differ from on some elements of X/R, but this is not possible. Hence R is a coequaliser of p1
and p2 .
4.3
19
j
k
f0
g0
A
"
/B
g
/C
The definition of the dual notion, a pushout, can be found by reversing the arrows, since a
co-pullback, i.e. a pushout, in a category C is simply a pullback in Cop .
A pullback can be thought of as a sort of constrained product, where the additional constraint
is the fact that we must have f g 0 = g f 0 [13]. Pullbacks are actually extremely useful
constructions in many fields including algebraic geometry, but we will not go into details here.
4.4
In this section we give a small number of examples of theorems involving some of the constructions
introduced in the previous sections to give the reader an idea of how they interrelate with one
another.
Theorem 4.11. Every equaliser is a monomorphism.
Proof. Let p1 , p2 : A B and let e : X A be an equaliser of p1 and p2 , so that p1 e = p2 e:
e
/A
p1
p2
//
q2
X0
e0
20
to get
e
XO
/A
G
p1
p2
//
idA
As e is an equaliser of p1 and p2 there is a unique arrow k : A X such that idA = ek. Looking
at the arrow idA : A A in the opposite direction we see that idX = k (idA e) = k e. Hence
e is an isomorphism, with inverse k.
The dual of this statement tells us that every monic coequaliser is also an isomorphism.
The two theorems above show that the notion of an equaliser is stronger than that of a
monomorphisms (and similarly for the duals). As we saw in section 2.3, for an arrow to be an
isomorphism, there are cases where being a monomorphism and an epimorphism is not enough;
however, being an equaliser and an epimorphism is always sufficient.
Theorem 4.13. The pullback of a monomorphism is also a monomorphism.
Proof. Suppose there are arrows f , g, f 0 and g 0 such that f g 0 = g f 0 and that f is monic:
g0
P
f0
/A
f
B
/C
g0
h
f0
!
B
/A
f
/C
But this diagram is a pullback, and so there is a unique arrow : X P which makes everything
commute. Hence p1 = p2 = , i.e. f 0 is monic.
4.5
Many of the above constructions terminal and initial objects, products and coproducts,
equalisers and coequalisers, pullbacks and pushouts turn out to be specific cases of the more
general ideas of limits and colimits. In order to define these we first give a preliminary definition.
Definition 4.14. A cone for a diagram D in a category C is a C-object X and a family of
arrows {fi : X Di } indexed over all the objects in D such that for each arrow g : Di Dj in
21
Di
XA
AA f
AA j
AA
A
/ Dj
g
Definition 4.15. A limit for a diagram D in a category C is a cone {fi : X Di } such that
whenever {fi0 : X 0 Di } is another cone for D then there is a unique arrow k : X 0 X making
the following diagram commute for each object Di in D:
k
X0 B
BB
BB
B
fi0 BB
Di
/X
}
}
fi }
}
}}
~}}
The dual notions of a cocone and a colimit are found by reversing the arrows.
In other words, if we consider the cones for a diagram as objects of a category, then the limits
are the terminals objects in this category and are unique (up to isomorphism) because terminal
objects are (see lemma 2.7). Similarly, colimits are the initial objects in the category of cocones.
Examples.
1. Let C be any category and let D be the diagram
A
with two objects and no arrows. A cone for this diagram is an object X and two arrows f
and g such that
Ao
/B
p2
// B
A cone for this diagram is an object X together with arrows f and g such that
X
~ @@@ g
~
@@
~
@@
~~
@
~
p1
~~
// B
A
f
p2
/A
F
p1
p2
// B
X0
f0
Concluding remarks
23
therein for the philosophical implications of employing category theory, where objects and arrows
are defined entirely abstractly, as a foundation for mathematics.
In any case, category theory provides an incredibly versatile framework in which complex
mathematical ideas can be more easily expressed and understood, as well as a theory which is
fascinating as a field in its own right. I aim to have shown that by abstracting the important
properties of similar mathematical constructions in different contexts, general categorical ideas
allow the underlying structure of many different ideas to been seen more clearly.
Jonathan Elliott, February 2007
Note The following list includes all the works I have consulted while writing this essay. Not all
of them are cited directly, but I have included all those I feel have influenced my understanding
on the ideas presented here.
References
1. PlanetMath, 2007. URL http://planetmath.org.
2. Michael A. Arbib and Ernest G. Manes. Arrows, Structures and Functors The Categorical
Imperative. Academic Press, Inc., 1975.
3. Steve Awodey. Category Theory. Oxford Logic Guides. OUP, 2006.
4. Ion Bucur and Aristide Deleanu. Introduction to the Theory of Categories and Functors.
John Wiley & Sons, Ltd., 1968.
5. Peter J. Cameron. Sets, Logic and Categories. Springer, 1999.
6. Samuel Eilenberg and Saunders Mac Lane. General Theory of Natural Equivalences. Transactions of the American Mathematical Society, 58:231294, 1945.
7. Horst Herrlich and George E. Strecker. Category Theory An Introduction. Allyn and
Bacon, Inc., Boston, 1973.
8. Saunders Mac Lane. Categories for the Working Mathematician. Springer, 1971.
9. Jean-Pierre Marquis. Category Theory, The Stanford Encyclopedia of Philosophy, 2006.
URL http://plato.stanford.edu/entries/category-theory.
10. Colin McLarty. Elementary Categories, Elementary Toposes. Clarendon Press, Oxford,
1995.
11. Barry Mitchell. Theory of Categories. Academic Press, Inc., 1965.
12. Bodo Pareigis. Categories and Functors. Academic Press, Inc., 1970.
13. Benjamin C. Pierce. Basic Category Theory for Computer Scientists. The MIT Press, 1991.
14. Eric W. Weisstein. Mathworld A Wolfram Web Resource, 2007. URL http://mathworld.
wolfram.com.
15. Wikipedia. Wikipedia, The Free Encyclopedia, 2007. URL http://en.wikipedia.org.
24