# What is the definition of a 2-graph?

A normal category is built on the simple notion of a graph defined with two functions and two types

$$s, t: Arrows \to Vertices$$

Add to that a notion of a path and equations between paths and one gets the notion of a category. Indeed it is well known that every Graph gives rise the Free Category of that graph.

But what about 2-categories? Those have morphisms between morphisms, so it seemed to me that a simple graph as above won't do. (Or I could not understand the magic reasoning that would get me there)

So I asked what structure would play the same role on Twitter and Eugenia Cheng answered that

Yes, you need 2-cells ---s,t---> arrows ---s,t---> vertices. ie a 2-graph.

So that's a good concise answer for Twitter, and it gave me confidence that I had asked a good question. But I could not find much about 2-graphs online. It is clearly the right answer as the ncatlab page on strict 2-categories mentions them, but then links to a page with a definition of globular sets which is completely opaque to me.

Can anyone perhaps develop the point made by Eugenia, and perhaps point to a resource that describes 2-graphs in more detail? I would have expected some document to show how one builds paths on 2-graphs to get a 2-category, the way it is done with simple categories.

Since they don't have composition, $$2$$-graphs are much easier to describe than $$2$$-categories. You have a set of $$0$$-morphisms (objects), for any two objects, you have a set of 1-morphisms between them, and for any two parallel $$1$$-morphisms, you have a set of 2-morphisms between them.

That's it. As you can imagine, this is pretty easy to generalize to $$n$$-graphs or $$\infty$$-graphs, which are more commonly called globular sets. However, in that context, you often consider all of the $$k$$-morphisms as being in one set. That means that you need some extra data about the source and target of each. This turns out to be easier to work with, since it means that a globular set is just a functor from a particular category (whose objects are natural numbers) to the category of sets.

• This was both an interesting question as well as an interesting answer. Jan 23, 2020 at 21:50

While it is possible to freely generate a 2-category from a 2-graph in the sense described by Eugenia and SCappella, this is not the most powerful notion of "free on a..." that goes with a 2-category. For instance, suppose one wants to construct the 2-category "freely generated by an adjunction." Well, first one should give two objects $$x,y$$, and two 1-morphisms $$f:x\to y$$ and $$g:y\to x$$. Next, one needs 2-morphisms $$\eta:1_x\to g\circ f$$ and $$\varepsilon:f\circ g\to 1_y$$. But here we have identities and compositions, so we have no apparent way to freely generate this 2-category from a 2-graph.

However, it is freely generated by a computad. A computad is the generalization of a 2-graph in which the source and target of a 2-edge may lie in the 1-category freely generated by a given 1-graph. This allows the introduction of generating 2-cells whose domain and codomain are not among the generating 1-cells, as is actually the case with all four 1-cells associated to $$\eta$$ and $$\varepsilon$$ above.

Now we can finish our construction of the free adjunction $$\mathcal A$$ by freely generating a 2-category from our computad, then taking a quotient by imposing the triangle identities. Then for any 2-category $$\mathcal K$$ equipped with a choice of an adjunction, there is a unique 2-functor $$\mathcal A\to \mathcal K$$ mapping the generating adjunction in $$\mathcal A$$ to the chosen adjunction in $$\mathcal K$$.

• Thanks for the answer. I will keep coming back to it over time, as I get more understanding of the concepts involved (especially a computad). Jan 24, 2020 at 9:54