The purpose of this post is to establish some basic language of categories. This can be read independently of the currently 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. Therefore, to illustrate the concepts, a broad range of examples will be given. It is not necessary to know the background of every single example to grasp the concepts.

For readers who wish to read a more detailed introduction, I recommend Tom Leinster’s “Basic Category Theory” (also published in book form) or, in case you know German, Martin Brandenburg’s “Einführung in die Kategorientheorie”. If you can’t 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 mathematics. (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”.

Thinking categorically, we can economize on routine verifications that are basically the same in many different forms by being allowed to do them in the utmost generality. More importantly, category theory can expose some 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’s delve into the formal details of why that which is formal is formally formal.

## Categories

**Definition C1.1 **A category consits 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 (This is just a technical conidtion 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 some 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.4** 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.7** 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.8 **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.9 **Speaking of invertible things, just like for an element in a ring, we can define when a morphism in a category is invertible. Let some morphism in a category. Then is called invertible, or an isomorphism, if there is some morphism such that and $f \circ g = \mathrm{id}_Y$. 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.10 **Other than restricting the size of morphisms as in example C1.8, 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 and setting and define the composition via the monoid operation. These constructions are inverse to each other, such that monoids correspond to one-object category.

A particular frequently occuring and much beloved class of monoids consits of groups, i.e. monoids in which every element is invertible. By a pleasant convergence of terminology, being invertible in a monoid (in the classical sense) is the same as being an isomorphism 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.11** A groupoid is a category such that every morphism is an isomorphism.

If we think of a group as encoding the symmetries of an object, then groupoids can encode the symmetries of many objects.

**Example C1.12 **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. 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 symmetries.

**Example C1.14** 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.15 **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 . 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.