Category theory has revolutionized mathematics, first as a tool in algebraic topology and since then as an extremely successful unifying language for most, if not all, of mathematics (well, sort of, if we disregard analysis, which we will).
The success of category theory underlines that mathematics is not about mere arithmetic, it is about structure, and in particular structure-preserving maps. A generalization of these structure preserving maps, called morphisms, is central in category theory. If this sounds rather abstract, then that is because, well, it is. But with abstractness comes generality. And not only that, it can simplify some rather cumbersome proofs to near trivialities.
In order to make sense of what we are talking about, we of course need to know what categories, morphisms, functors and natural transformations are, but knowing that without knowing why we should even care, given the level of abstractness we are dealing with, category theory will seem rather pointless.
It is often said that to study category theory, no prerequisites are required. While this is technically true, I would not consider such a statement being made in good faith. Without a rather comprehensive mathematical background with the corresponding training in thinking abstractly, not to mention knowledge in which areas of mathematics it is used, it will likely seem like an entirely useless exercise in futility.
So, why do we care?
The notion of a category encodes a class of some mathematical object and a structure preserving arrow or morphisms, we shall make this more concrete later. A defining condition of being a category, is that there must be a well-behaved notion of composition of morphisms that corresponds to the notion of composition of functions. Mathematicians like to come up with structure preserving maps between mathematical objects, like continuous maps between topological space or group homomorphisms between groups, so it should not come as a surprise that there are also a notion of maps between categories, a functor. But as a category not only consists of its objects, but also of its arrows, a functor, like other structure preserving maps, needs to meet certain conditions. And indeed, there are even maps between functors, called natural transformations.
These constructions that are outlined above, enable us to relate mathematical obejcts that are, at first glance, very different. In algebraic topology, to each topological space we can assign a group
, called the fundamental group, which will be our first example of a functor from the category of topological spaces to the category of groups. We denote this functor by
. Now again, you may ask, why do we care? This is a totally legitimate question. As a basic example, note that above we wrote that functors not only map objects from one category to another, but also its morphisms. The morphisms of
are continuous maps between topological spaces, say a continuous map
from the topological space
to the topological space
. The morphisms of the category of groups are, not surprisingly, group homomorphisms. This means that
should be a group homomorphism, and indeed it is. An elementary result in category theory says that functors preserve isomorphisms. In the example if
is an isomorphism (which corresponds to homeomorphisms in
), then
is an isomorphism as well, where the isomorphisms in
are group isomorphisms. This yields a way for us to use group theory to disprove that two topological spaces are homeomorphic. If given two topopical spaces
and
, the task of disproving that they are homeomorphic, if we are lucky, can be as simple as showing that there are no group isomorphisms between the groups
and
. This can make what is often a rather difficult and laborious task, relatively simple and straightforward. However if we get two fundamental groups that are isomorphic, then we are nowhere.
What is a category?
A category consists of a collection of objects
and for all objects
a collection of morphisms
(which may be empty) whose elements are denoted
, such that,
- For or all objects
there is a unique morphism
such that for all morphisms
we have
and morphisms
we have
.
- For all objects
and morphisms
and
there is a map, a binary operation,
, such that
.
- For all morphisms
,
and
we have
.
For simplicity, from now on we will write to denote that
is an object of the category
.
So, this looks like, and is, a rather abstract definition. But as hinted above, the power of category theory largely comes from its abstraction.
You might have noticed that the notation for morphisms and the binary operation , and the conditions it must satisfy, looks rather a lot like what is used elsewhere in mathematics for functions and composition. This is by no means an accident and
is, in fact, called composition. The notion of morphisms and their composition is, however, much more general than that of functions between sets with extra structure. It is true that morphisms often represent structure-preserving maps between the objects of a given category whose underlying objects are sets. For example, the morphisms of the category of Abelian groups,
, are group homomorphisms, in the category of unital rings,
, they are unit-preserving ring homomorphisms. In the category of sets,
, the morphisms are simply the functions of sets, and the morphisms of the category of topological spaces are continuous functions between topological spaces.
It is important to note, that it is not true in general, that all morphisms represents maps. A simple example of this is if we regard a partially ordered set as a category with objects the elements of
and for
, we have a morphism
if and only if
. It is a nice little exercise to show that this is indeed a category.
A special type of morphism which we have also mentioned previously, is an isomorphism which is a morphism in a category
where there exsists a morphism
such that
and
and in which case we denote
and we can write
.
What is a functor?
We have alluded to what a functor is, namely a map between two categories
and
which maps all objects
to
, and all morphisms
of
to morphisms
of
. However, if
is contravariant we have
. A functor needs to satisfy two further requirements, however:
- For all morphisms
and
in
, we must have
or if
is contravariant,
.
- For all identity morphisms
of
we must have
.
Satisfying the requirements of being a functor is often referred as being “functorial”.
Digression: Commutative diagrams
Before we get to natural transformations, we first need to know what a commutative diagram is. If we have morphisms and
, a way to write the satement
, is, that the diagram
commutes. The intuition of a commutative diagram is that it does not matter if one follows the compositions from to
to
along
or from
to
along
. Similarly we have, that saying that the diagram
commutes, is the same as the statement .
Commutative diagrams is a highly effective way of visualizing complex compositions of morphisms and their relationships.
What are Natural Transformations?
A natural transformation is, among other things, a morphism between functors, in the category of functors between two functors and
. We denote a natural transformation from a functor
to
by, for example,
, using the arrow
do disambiguate it from a a functor between categories.
To define natural transformations formally, let be two functors. A natural transformation
is a family of morphisms
in
such that for all objects
there exists morphisms
, and for all morphisms
in
, the diagram
commutes.
Good things come to those who wait…
We have so far discussed and defined the most basic constructions in category theory. Using these, we shall in later posts dive deeper into what (some) mathematicians is calles abstract nonsense, i.e. category theory.