The purpose of this post is to establish some basic language of categories. This can be read independently of the ongoing series on representation theory, although concepts and results from this post will be used in the representation theory series. So with respect to the representation theory series, one can think of this post (and the follow-up posts) as the analog of an appendix.

The notions of category theory can be encountered in many different mathematical contexts. To illustrate the concepts, a range of examples will be given, but I will go quickly over standard examples – For common examples in greater detail and multitude, see the references below. It is not necessary to know the background of every single example to grasp the concepts.

To readers who wish to read a more detailed introduction, I recommend Tom Leinster’s “Basic Category Theory” (available as a free pdf, but also published in book form) or in case you know German Martin Brandenburg’s “Einführung in die Kategorientheorie”. If you simply cannot get enough, Francis Bourceux’ three-volume Handbook of Categorical Algebra is the right place to get lost in the realm of categories and functors.

The views expressed on category theory are naturally (no pun intended) my own highly subjective ones and others may differ, especially those with a categorical disapproval of categorical things.

## Introduction

The meta-mathematical notions of category theory provide a unifying framework for a lot of different mathematical theories. (Merely having a framework, however, can’t always replace delving into the specifics of the particular objects that one is interested in.) We can not only translate statements into categorical language, but we can also use categorical language to make things precise that might otherwise be vague, e.g. what it means for two different kinds of mathematical structures to be “equivalent” or what it means for a map to be “natural”.

THe basic objects of category theory are categories. One should think of a category as a big directed graph in which objects are represented by nodes and morphisms are represented by arrows and where we have a special operation called composition that takes two consecutive arrows and produces a third arrow representing going along one arrow first and then along the other one.

Compared with set theory, which can be called “materialistic”, in the sense that it is about what objects actually are made out of, category theory can be considered “behavioristic”, in the sense that it’s more about how objects behave, i.e. relate to each other. Relations between objects are conceptualized by the arrows also known as morphisms. But for morphisms, just like for the objects themselves, it’s more about how they relate each other and less about what they actually represent. The relations between morphisms are given by composition.

From a linguistic point of view, category theory is purely syntax, whereas semantics come into play only in the interpretation of particular examples.

Thinking categorically, we can economize on routine verifications by doing them in the utmost generality. More importantly, category theory can expose formal similarities between seemingly disconnected phenomena. These analogies might only become apparent through the high level of abstraction category-theoretic concepts provide, allowing one to transfer intuition, techniques and concepts in ways not available otherwise, at least not as easily or as precisely-defined.

Peter Freyd wrote once that “Perhaps the purpose of categorical algebra is to show that which is trivial is trivially trivial.”

Peter May commented: “I prefer an update of that quote: ‘ Perhaps the purpose of categorical algebra is to show that which is formal is formally formal’. It is by now abundantly clear that mathematics can be formal without being trivial.”

Now then! After this informal introduction, let us delve into the formal details of why that which is formal is formally formal.

## Categories

**Definition C1.1 **A category consists of the following data:

- A class of objects
- For every pair of objects , a set of morphisms
- For every triple of objects , a map called composition and denoted by

Such that the following conditions hold:

- For any object , there exists an identity such that for all objects and all morphisms we have and
- Composition is associative, that means for all objects and , we have
- unless and

**Remark** The last condition is just a technical one that is not very interesting and is mostly omitted from verifications that things are categories. You can always replace the Hom-sets by disjoint copies by set-theoretic juggling, so it’s not much of an issue. The advantage of this convention is that source and target of a morphism are uniquely determined.

**Example C1.2 **We can form the category of sets , where is the class of all sets and for , is the set of all maps from to and the composition of morphisms is just the usual composition of maps. Many other examples (but not all of them) can be formed as “subcategories” of this example in the sense that the objects are sets with additional structure and morphisms are mappings which preserve that structure in some way, such as topological spaces and continuous maps or algebraic structures of a specific type and homomorphisms or smooth manifolds and smooth maps or complex manifolds and holomorphic maps or varieties over an algebraically closed fields and regular maps etc.

**Example C1.3** There is another category with the class of all sets as objects, but with more morphisms. Recall that a mapping is a particular kind of relation. is the category consisting of all sets as objects, and for two objects , is the set of all relations from to , i.e. subsets . Given three sets and relations , we can form the composite relation . (If and are functions, this reduces to regular function composition.) With this composition, satisfies the axioms for a category.

**Example C1.4** In the previous examples for categories, the objects were given by the class of all sets. But there’s also the possibility to fix a particular set and consider as a category in the following way: and the only morphisms are the identity morphisms required by the definition of categories. Due to the striking similarity with discrete topological spaces (compare for instance the set of morphisms if and if with the discrete metric), this construction is called the discrete category on the set .

**Example C1.5 **Instead of only allowing for the minimum amount of morphisms, we can take a set and consider such categories with as their class of objects that have at most one morphism between two objects. In such a case, the only interesting information is whether there is a morphism between two objects or not. Consequently, such a category corresponds to a relation . But the requirements for compositions and identities force a relation to have some properties if it is supposed to define a category in this manner: the existence of identity morphisms in the supposed category is equivalent to the relation being reflexive and the existence of compositions translates to transivity. A reflexive and transitive relation is called “preorder”. For instance, all equivalence relations and all partial orderings are preorders. An example of a preorder that is neither can be formed by taking a ring, say, an integral domain such as and considering the divisibility relation on elements of . Here the failure to be a partial order is due to the existence of non-trivial units and the failure to be an equivalence relation is to due the existence of non-invertible elements.

**Definition C1.6 **Speaking of invertible things, just like for an element in a ring, we can define when a morphism in a category is invertible. Let a morphism in a category. Then is called invertible, or an isomorphism, if there is a morphism such that and . If there is such a morphism, then and are called isomorphic. Note that the notations and , albeit reminiscent of the situation in the category , don’t necessarily refer to mappings or function composition, but to the particular morphisms and composition in an arbitrary category.

**Example C1.7 **Other than restricting the size of morphisms as in example C1.5, one can also restrict the size of the class of objects. For this, let’s consider categories with only one object. In general, if we consider composition as a function on *all* morphisms of a category, it is only partially defined, since source and target need to match up correctly. But this doesn’t arise if we have only one object. Let be a category with one object and let . Then composition is a (totally defined) mapping , i.e. a binary operation.

The existence of the identity implies that is a unit with respect to this binary operation and the associativity of the composition implies that the binary operation is, well, associative. Thus composition makes into a monoid.

Conversely, given a monoid , we can turn into a one-object category by taking a proxy object with no particular meaning, setting and defining the composition via the monoid operation. These constructions are inverse to each other, such that monoids correspond to one-object categories.

A particular frequently occuring and much beloved class of monoids consists of groups, i.e. monoids in which every element is invertible. By a pleasant convergence of terminology, an element in a monoid being invertible (in the classical sense) is the same as being an invertible morphism if we consider the monoid as a one-object category. Thus we can say that a monoid is a group if and only if every morphism is an isomorphism. This leads to the following notion:

## Groupoids

**Definition C1.8** A groupoid is a category such that every morphism is an isomorphism.

If we think of groups as encoding the symmetries of one object, then groupoids can capture the symmetries of a configuration with many objects.

**Example C1.9 **Let be a preorder on a set , then we can form a category from these data as described in example C1.8. One can ask when one obtains groupoid in this way. It turns out that the corresponding category is a groupoid if and only if is symmetric, i.e. an equivalence relation.

**Remark **From this observation we can extract an intuition for general groupoids: a groupoid is like a set with an equivalence relation, except that two objects can be equivalent in more than one way and we’re keeping track of different ways of being equivalent. From this viewpoint a group, being a one-object groupoid, is like the various ways a particular object is equivalent to itself, following the narrative that groups encode the symmetries of an object.

**Example C1.10** Let be a group acting on a set , then one can form a groupoid encoding the group action as follows: Let be the category having elements from as its objects and for every and , there’s a morphism , such that is in bijection with . This groupoid played an important role in a previous post.

**Example C1.11** Let be any category. Then there is a maximal subcategory that is a groupoid: simply take the subcategory of with the same objects as and all the isomorphisms of as morphisms. This is called the core of the category and it is a groupoid. If has only one object, i.e. is a monoid, then the core of is just the group of invertible elements, also known as units.

As an exercise, one can check that the categories and (cf. C1.2 and C1.3) have the same core, i.e. any invertible relation is already a function and in fact a bijection.

**Example C1.12 **Let be a topological space. Then the fundamental groupoid has as its objects all elements of . For , consists of all homotopy classes of paths from to . Composition is given by concatenation of paths. contains important homotopy-theoretic information about , such as the path-components and the fundamental group of each path-component. For more information on this very geometric construction and groupoids in algebraic topology, I heartily recommend Ronald Brown’s “Topology and Groupoids”.

This concludes the first part of the mini-series on introductory categories. Next time we’ll look into functors.