# Concrete examples of 2-categories

I've been reading some of John Baez's work on 2-categories (eg here) and have been trying to visualize some of the constructions he gives.

I'm interested in coming up with 'concrete' examples of 2-categories. As an example of what I don't mean, I know that the category Cat forms a 2-category, where the objects are small categories, the morphisms are functors and the 2-morphisms are natural transformations. But this is too abstract for me - given that categorical constructs are what I'm having trouble understanding, it doesn't help me much to give an example from category theory!

One thought I had is that you might be able to view a group as a 2-category. Taking the perspective that a group is a category with one object where the morphisms are the symmetries of the object, you should then be able to construct a 2-category by saying that the 2-morphisms are the inner automorphisms of the group. An interesting question is then what the compositional structure of the 2-morphisms is.

To be really concrete, consider the group $D_3$. Here the object is an equilateral triangle, and there are six morphisms $e$, $r$, $r^2$, $m$, $mr$ and $mr^2$ where $e$ is the identity, $r$ is rotation by $2\pi/3$ and $m$ is reflection in one of the axes of symmetry, and the others are the obvious compositions of these.

Then the 2-morphisms are the functions $\phi_g$ given by $\phi_g(h)=ghg^{-1}$. For this example, the 2-morphisms have the structure of the underlying group $D_3$, but clearly this isn't always the case (e.g. for any abelian group the 2-morphisms have the structure of the trivial group). I haven't worked through many of the details, but it seems like there might be the grain of an interesting line of thought here.

So my questions are:

1. Is viewing groups as 2-categories an interesting thing to do, i.e. does it give you any new perspectives that make previously esoteric facts about groups 'obvious', or at least special cases of results in 2-categories?

2. What other 'concrete' examples of 2-categories are there?

-
Qiaochu Yuan has another example of 2-category using groups, or a single group. If you take a group $G$ as object, morphisms its endomorphisms, and 2-morphisms from $f$ to $g$ conjugations by an element $x$ of $G$ which send $f$ to $g$, i.e. $xf(y)x^{-1}=f(y)$ for all $y\in G$. You may take any class of groups and morphisms between them to form a category this way. This construction comes from seeing groups as categories, homorphisms as functors, then "commuting" elements are natural transformations. This must make a group a 3-category in some sense. –  plm May 22 '12 at 10:49
It occured to me as I was writing the above that since the automorphisms of G form a group Aut(G), you should be able to form a 3-category by considering Aut(Aut(G)), and n-categories by forming Aut$^n$(G) etc. I don't know if there are 'interesting' cases of this though (i.e. cases where Aut$^n$(G) is not isomorphic to G for all n, and where Aut$^n$(G) is not the trivial group for all n>N for some N) or if it would be more (or less) interesting to consider Inn(G) instead of Aut(G). –  Chris Taylor May 22 '12 at 10:52
The link: qchu.wordpress.com/2012/02/06/… . The point of this construction is that it yields a purely categorical formulation of the center $Z(G)$ of $G$: the group of endomorphisms of the identity id$_G$. For a general 2-category the set of endomorphisms is only a monoid under vertical 2-composition. Horizontal composition coincides with the vertical one on $Z(G)$, see the blog post. This formalizes the Eckman-Hilton argument and is a major application of the construction. –  plm May 22 '12 at 10:53
I don't understand your example built on a group: are you saying that the 2-morphisms between two 1-morphisms (i.e., group elements) $h$ and $k$ are the inner automorphisms $\phi_g$ such that $\phi_g(h) = k$? If so, how do you plan to compose two of them? The ordinary composition does not satisfy that $\phi_g \circ \phi_{g'} (h) = k$. –  Omar Antolín-Camarena May 22 '12 at 14:41
Sorry, my comment was nonsense. The two kinds of composition you need are: vertical, composing $\phi_{g_1} : h_1 \to h_2$ with $\phi_{g_2} : h_2 \to h_3$ to get a 2-morphism $h_1 \to h_3$, and horizontal, composing a $\phi_{g_1} : h_1 \to h_2$ and a $\phi_{g_2} : k_1 \to k_2$ to get a 2-morphism $h_1 k_1 \to h_2 k_2$. Ordinary composition of functions would work for horizontal composition since $\phi_{g_2} \circ \phi_{g_1} (h_1) = \phi_{g_2}(h_2) = h_3$, but not for horizontal composition: $\phi_{g_2}(\phi_{g_1}(h_1k_1)) = \phi_{g_2}(h_2) \phi_{g_2}(\phi_{g_1}(k_1))$ and then you're stuck. –  Omar Antolín-Camarena May 22 '12 at 15:10

In order to understand $2$-categories, you really have to understand the prototype $\mathsf{Cat}$ of small categories. Objects are categories, morphisms are functors, and $2$-morphisms are natural transformations. Another prototype, which is closely related to that, is the $2$-category $\mathsf{Top}$ (which is actually an $(\infty,1)$-category). Objects are topological spaces, morphisms are continuous maps, and $2$-morphisms are homotopies between continuous maps (as Omar remarks, one has to be careful here to get associativity of $2$-morphisms; there are various solutions). Many basics about $2$-categories are adapted (starting with the notation, for example "$2$-cells" instead of $2$-morphisms) to these prototypes.

There are many interesting subcategories of $\mathsf{Cat}$ or variations thereof. The category of monoids $\mathsf{Mon}$ is a a full subcategory of $\mathrm{Cat}$, consisting of categories with just one object. An object is a monoid, a morphisms is a homomorphism of monoids, and a $2$-morphism between homomorphisms $f,g : M \to N$ is some element $n \in N$ such that $f(m) n = n g(m)$ for all $m \in M$. If $M,N$ are groups, this means that $f,g$ are conjugated to each other. So this comes close to your example, but I don't think that a single group may be regarded as a $2$-category.

Something similar happens for the category $\mathsf{Ring}$ of rings: Although usually considered as a $1$-category, it is actually a $2$-category when we regard it as a full subcategory of the category if linear categories (namely those with just one object). The description of $2$-morphisms is as above.

Rings categorify to cocomplete tensor categories, which also constitute a $2$-category (morphisms: cocontinuous tensor functors, $2$-morphisms: tensor natural transformations). The $2$-category of (algebraic) stacks is another important example. It is related because to every stack $\mathcal{X}$ one can associate a cocomplete tensor category $\mathrm{Qcoh}(\mathcal{X})$ of quasi-coherent sheaves, and it turns out that $\mathrm{Qcoh}(-)$ is fully faithful in many situations (see here).

As you can see, most examples are optained by variations of $\mathsf{Cat}$. Apart from that:

Every $1$-category can be regarded as a $2$-category by introducing only identities as $2$-morphisms. And a $2$-category with just one object is just a monoidal category, and there are plenty examples of them. So similar to the point of view "category = monoid with many objects" we have "$2$-category = monoidal category with many objects".

Finally, another very basic example of a $2$-category is the category of spans: Objects are sets (or objects from another nice category), a morphism from $A$ to $B$ is a set $C$ together with maps $A \leftarrow C \rightarrow B$. These are composed via pullbacks. And a $2$-morphism from a span $A \leftarrow C \rightarrow B$ to another span $A \leftarrow C' \rightarrow B$ is a morphism $C \to C'$ such that the obvious "diamond" diagram commutes. Actually you have to take isomorphism-classes of spans so that associativity is satisfied.

-
Thanks Martin. Do you mean that a single group can't be regarded as a 2-category, or that it can't usefully be regarded as a 2-category? If the former, I'd be interested to know why. For example, does one of the 2-category axioms fail? If the latter, then is it because Aut(G) or Inn(G) can be shown to always have some non-interesting relationship with G (so nothing new is gained by studying them - this case seems very unlikely) or is it something deeper? –  Chris Taylor May 22 '12 at 11:02
Minor correction: in the 2-category Top, the 2-morphisms should be homotopy classes of homotopies to get associativity. Alternatively you could use Moore style homotopies (i.e., on intervals of arbitrary length, and the lengths add when you compose homotopies), but then you wouldn't get a (2,1)-category. –  Omar Antolín-Camarena May 22 '12 at 14:44
Another correction about Top: it's not an $(\infty,0)$-category, only an $(\infty,1)$-category (it's not true that an arbitrary continuous map has a homotopy inverse). –  Omar Antolín-Camarena May 22 '12 at 14:47

Omar's construction using central elements is a special case of something I describe in this post here. $\newcommand{\id}{\textrm{id}}$

In Cartan and Eilenberg there are several instances of squares which "anticommute", that is, we have $h \circ f = - k \circ g$ instead of $h \circ f = k \circ g$. I was wondering if we could make this into an instance of a square commuting "up to a specified 2-morphism" and it turned out the answer was yes.

Let $\mathbb{C}$ be a (small) category. We attach to every parallel pair of 1-morphisms $f, g : X \to Y$ the set of all natural transformations $\alpha : \id_\mathbb{C} \Rightarrow \id_\mathbb{C}$ such that $g = \alpha_Y \circ f$. The vertical composition is obvious, and if we have another parallel pair $h, k : Y \to Z$ and a 2-morphism $\beta : h \Rightarrow k$, the horizontal composition of $\alpha$ and $\beta$ is just $\beta \circ \alpha$, since $k \circ g = (\beta_Z \circ h) \circ (\alpha_Y \circ f) = (\beta_Z \circ \alpha_Z) \circ (h \circ f)$, by naturality of $\alpha$. This yields a (strict) 2-category structure on $\mathbb{C}$. Note that we have to remember which natural transformation is needed to make the triangle commute in order to have a well-defined horizontal composition.

In the specific case of $\mathbb{C} = R\text{-Mod}$, the set (class?) of natural transformations $\id_\mathbb{C} \Rightarrow \id_\mathbb{C}$ include the scalar action of $R$, so in particular the anticommutative squares of Cartan and Eilenberg can be regarded as a square commuting up to a 2-morphism.

$\newcommand{\profto}{\nrightarrow}$ My current favourite example of a bicategory (i.e. a weak 2-category) is the bicategory $\mathfrak{Span}$ of spans of sets. The objects are sets, and the 1-morphisms $M : A \profto B$ are arbitrary pairs of maps $(s : M \to A, t : M \to B)$. Composition is given by fibre products: if $N : B \profto C$ is another span, then their composite $N \circ M : A \profto C$ is given by $M \times_B N$ and the obvious projections down to $A$ and $C$. A 2-morphism between spans is just an ordinary map of sets that commutes with the structural maps.

Why is $\mathfrak{Span}$ interesting? Because a monad in $\mathfrak{Span}$ is the exactly the same thing as a (small) 1-category! (I think the "natural" notion of homomorphism that arises this way is that of a profunctor rather than a functor, but that should be considered a feature rather than a bug.)

One easy way to "strictify" $\mathfrak{Span}$ is to look at a certain more familiar subcategory: the 2-category $\mathfrak{Rel}$, whose objects are sets and whose 1-morphisms are relations. (The composition of relations is the usual one: if $R : A \profto B$ and $S : B \profto C$ are relations, then $c \mathrel{(S \circ R)} a$ if and only if the is some $b$ such that $c \mathrel{S} b$ and $b \mathrel{R} a$.) A 2-morphism between two relations is just the inclusion of the underlying graphs.

Morally, $\mathfrak{Rel}$ is the 0-dimensional analogue of the bicategory $\mathfrak{Prof}$ of categories and profunctors, and it is a way of "enlarging" the ordinary 1-category $\textbf{Set}$. We have the following remarkable fact: a relation $F : A \profto B$ has a right adjoint if and only if $F$ is a functional relation. So not only is $\textbf{Set}$ faithfully embedded in $\mathfrak{Rel}$, we also have a way of recognising when a morphism comes from $\textbf{Set}$!

Finally, some unsolicited advice: 2-category theory is impenetrable even if you are familiar with ordinary category theory. I firmly believe that one must have an excellent grasp of ordinary category theory before moving on to the higher-dimensional stuff. Just as ordinary category theory depends heavily on our intuitions about $\textbf{Set}$ as a 1-category, 2-category theory depends heavily on our intuitions about $\mathfrak{Cat}$ as a 2-category – and that intuition can only be built by studying 1-categories.

-
Chris's construction is not a special case of the construction you describe, as far as I can tell (and in fact, I don't think Chris's construction can be made to work). But the construction of a 2-category from a group (using the center of the group) that I described in a comment to the question is a special case of this construction: if you regard a group $G$ as a category with one object, a natural transformation between two functors (i.e. two group homomorphisms) $\phi$ and $\psi$ is a group element $g$ such that $\phi(x) = g^{-1} \psi(x) g$ for all $x \in G$. (to be cont'd). –  Omar Antolín-Camarena May 22 '12 at 19:59
@Omar: Ah, yes, that's true. I mistakenly thought the endomorphisms on the identity functor would be the group endomorphisms. –  Zhen Lin May 22 '12 at 20:01
(cont'd) So in particular, natural transformations $\id_G \Rightarrow \id_G$, correspond to elements of the center of $G$. Then, your construction has as 2-morphisms $g \Rightarrow h$ the elements $a$ of the center such that $g = ah$. –  Omar Antolín-Camarena May 22 '12 at 20:02
For $R$-Mod, aren't the natural transformations $\alpha : \id \Rightarrow \id$ just the scalars? Let's figure out $\alpha_M(x)$ for some arbitrary $x \in M \in R$-Mod. Let $f : R \to M$ be the morphism $f(r) = rx$. By naturality $\alpha_M(x) = \alpha_M(f(1)) = f(\alpha_R(1)) = \alpha_R(1) x$, so that $\alpha$ is just multiplication by the scalar $\alpha_R(1)$. –  Omar Antolín-Camarena May 22 '12 at 20:17

Taking the perspective that a group is a category with one object where the morphisms are the symmetries of the object, you should then be able to construct a 2-category by saying that the 2-morphisms are the inner automorphisms of the group.

I don't think this works. More precisely, I don't see a natural candidate for horizontal composition.

I wrote this blog post partially as an introduction to 2-categories. I give a few examples, but not too many, so here are examples (some taken from the post and some not):

• Various subcategories of $\text{Cat}$. For example, $\text{Mon}$ (monoids) or $\text{Pos}$ (posets).
• For any topological space $X$, there is a 2-category $\Pi_2(X)$, the fundamental 2-groupoid of $X$, whose objects are the points of $X$, whose morphisms are the continuous paths in $X$, and whose 2-morphisms are the homotopy classes of homotopies between paths in $X$.
• Just as a category with one object is a monoid, a 2-category with one object is a (strict) monoidal category $(M, \otimes)$. Important examples include any category with products as well as the category of representations of a group, Lie algebra, bialgebra...
• For any monoidal category $V$, various subcategories of $V\text{-Cat}$. For example, if $V = \text{Ab}$, then one can take the 2-category of rings (closely analogous to the case of monoids).
• (An appropriate skeleton of) the bicategory of bimodules. This construction generalizes considerably.

I sometimes talk about "the" 2-category of logical propositions. The morphisms are proofs of one proposition from another, and the 2-morphisms are ways of turning one proof into another (I do not have a precise idea of what this ought to mean).

-
The homotopy type theorists are trying to work out something which, in a certain light, can be interpreted as an $(\infty, 1)$-category of propositions and proofs. –  Zhen Lin May 22 '12 at 17:45
Do you mean that you don't see a natural candidate for horizontal composition? As Omar said in the comments above, it looks as though regular function composition works fine for vertical composition. –  Chris Taylor May 22 '12 at 18:51
@Chris: I guess one of us is mixing up vertical and horizontal composition, but I don't think it's me. Do we agree that horizontal composition is composition along objects and that ordinary composition of inner automorphisms suffices for this? –  Qiaochu Yuan May 22 '12 at 19:21
Really? Huh. In this Baez article he refers to that as vertical composition, and it reads to me as though the Wikipedia article does too. I must be more confused than I thought. –  Chris Taylor May 22 '12 at 19:38
@Chris: aha! Okay. I am the one who is confused. My apologies. –  Qiaochu Yuan May 22 '12 at 19:40

This is probably not concrete enough, but one of my favorite examples of a 2-category is the category of rings, bimodules, and bimodule homomorphisms.

The reason I find this interesting is partly because it collects the 'algebra' of modules and tensor products together into one structure, and partly because it turns out to be 2-equivalent to the 2-category of module categories, adjunctions, and natural transformations.

It's similar to why my favorite example of a 1-category is the (arrow-only) category of matrices -- i.e. matrix 'algebra'.

-
You mean "cocontinous functors" instead of "localization functors". –  Martin Brandenburg May 23 '12 at 6:23
Ah, you're right, the localizations are the adjunctions with exact left adjoints. I'll fix it. –  Hurkyl May 23 '12 at 8:51

I have not had the time to read the details of your example, but the idea should be correct. Another example is a crossed module. This is a category object in the category of groups. There is a paper by Baez and Lauda that describe 2-groups, and you can re-interpret these as 2-categories. See the references therein.

My favorite example of a 2-category is (for obvious reasons) the category of 2-tangles. The objects are points, the morphisms are tangle diagrams and the 2-morphisms are surface diagrams that interpolate between the tangle diagrams. The relations among the 2-morphisms are the movie moves, but caution needs to be taken here.

I understand that there are algebraic versions of 2-braids given by Rouquier and others.

A good exercise is to determine that a braided monoidal category is a 2-category.

-
Thanks Scott. I've just read your answer to the question 'How do you do mathematics?' and your notion that the best thing to do is understand the simple things in as much detail as possible is exactly what I'm trying to do here. In particular, I find that spending time working out all the details of the simplest non-trivial example often pays off many times over. Thanks for the help! –  Chris Taylor May 22 '12 at 10:14