It had always seemed to me that category theory provided no useful perspective on graph theory. But yesterday I learned a small fact that caused me to slightly revise that opinion. It’s that colourings of graphs — which seem to be a major source of questions in graph theory — are simply homomorphisms into a complete graph.

I’ll explain this, and I’ll describe a conjecture that Tom Hirschowitz told me about yesterday: for graphs G G and H H ,

The chromatic number of G × H G \times H is the minimum of the chromatic numbers of G G and H H .

It’s amazing that something so basic is unknown!

For this post, a graph is a finite set equipped with a symmetric, irreflexive binary relation. The elements of the finite set V V are called the “vertices”, the relation is usually called E E , and rather than saying that two vertices are related, we say that there is an “edge” between them. Concretely, then, “graph” means a finite undirected graph without loops (that being the “irreflexive” part) or multiple edges.

For instance, for each natural number n n , the complete graph K n K_n has vertex-set { 1 , … , n } \{1, \ldots, n\} and an edge between i i and j j whenever i ≠ j i

eq j .

A homomorphism of graphs is what you’d imagine. That is, given graphs G = ( V , E ) G = (V, E) and G ′ = ( V ′ , E ′ ) G' = (V', E') , a homomorphism G → G ′ G \to G' is a map of sets f : V → V ′ f\colon V \to V' such that for x , y ∈ V x, y \in V ,

( x , y ) ∈ E ⇒ ( f ( x ) , f ( y ) ) ∈ E ′ . (x, y) \in E \implies (f(x), f(y)) \in E'.

This gives us a category of graphs.

Graph theorists know a lot about colourings. By definition, a colouring of a graph G G by n n colours, or an n n -colouring of G G for short, is a way of painting each vertex one of n n colours in such a way that no two vertices of the same colour have an edge between them.

Here’s the small fact I learned yesterday (from Wikipedia):

A n n -colouring of a graph G G is the same thing as a homomorphism G → K n G \to K_n .

Why? Well, writing G = ( V , E ) G = (V, E) , a homomorphism G → K n G \to K_n is a map of sets f : V → { 1 , … n } f\colon V \to \{1, \ldots n\} such that if x , y ∈ V x, y \in V have an edge between them then the vertices f ( x ) f(x) and f ( y ) f(y) of K n K_n have an edge between them. But every pair ( i , j ) (i, j) of vertices of K n K_n is joined by an edge except when i = j i = j . So a homomorphism G → K n G \to K_n is a map of sets f : V → { 1 , … , n } f\colon V \to \{1, \ldots, n\} such that if x x and y y are joined by an edge then f ( x ) ≠ f ( y ) f(x)

eq f(y) . That’s exactly an n n -colouring.

This fact makes it obvious that colouring is functorial: given a homomorphism f : G → H f\colon G \to H , every n n -colouring of H H gives rise to an n n -colouring of G G . (Simply compose the maps G → H → K n G \to H \to K_n .) Concretely, we paint each vertex x x of G G the same colour as f ( x ) f(x) .

Every graph can be n n -coloured for sufficiently large n n : just paint all the vertices different colours. The chromatic number χ ( G ) \chi(G) of G G is the smallest n n for which there exists an n n -colouring of G G .

The functoriality of colouring means that χ ( G ) ≤ χ ( H ) \chi(G) \leq \chi(H) whenever there is a homomorphism G → H G \to H . Categorically put, χ \chi is a functor χ : Graph → ( ℕ , ≤ ) . \chi \colon Graph \to (\mathbb{N}, \leq).

Here ( ℕ , ≤ ) (\mathbb{N}, \leq) is the poset ℕ \mathbb{N} regarded as a category: it has one object for each natural number, there is one map m → n m \to n when m ≤ n m \leq n , and there are no maps m → n m \to n when m > n m \gt n .

The very famous four-colour theorem states that the chromatic number of a planar graph is at most four. For a long time it was only a conjecture. But there’s another fundamental conjecture about chromatic numbers — perhaps even more fundamental, as it doesn’t refer to the geometric notion of planarity. Tom Hirschowitz mentioned it to me by email yesterday; he’d just heard it from Stéphan Thomassé. Here goes.

The category of graphs has binary products, defined in the expected way: given graphs G = ( V , E ) G = (V, E) and H = ( W , F ) H = (W, F) , the vertex-set of G × H G \times H is V × W V \times W , and there’s an edge between ( v , w ) (v, w) and ( v ′ , w ′ ) (v', w') if and only if there are an edge between v v and v ′ v' and an edge between w w and w ′ w' . The projections G × H → G G \times H \to G and G × H → H G \times H \to H are what you’d expect.

Now, the fact that there are any homomorphisms G × H → G G \times H \to G implies that χ ( G × H ) ≤ χ ( G ) \chi(G \times H) \leq \chi(G) . The same goes for H H . So:

χ ( G × H ) ≤ min { χ ( G ) , χ ( H ) } \chi(G \times H) \leq \min\{ \chi(G), \chi(H) \} for all graphs G G and H H .

The conjecture is that this is an equality:

Conjecture (Hedetniemi, 1966) χ ( G × H ) = min { χ ( G ) , χ ( H ) } \chi(G \times H) = \min \{ \chi(G), \chi(H)\} for all graphs G G and H H .

It’s known to be true for various classes of G G s and H H s, and I guess people have had their computers check it in millions of special cases. As I only learned about it yesterday, I know almost nothing more — only what I’ve read on Wikipedia and this page by Stéphan Thomassé. But presumably a question this basic, open since 1966, has attracted a lot of attention.

Intuitively (as Wikipedia says) the meaning of the conjecture is that G × H G \times H has no sneakily economical colourings. In other words, if your aim is to colour G × H G \times H with as few colourings as possible, you can’t improve on the following strategy: either colour G G minimally and then declare the colour of ( x , y ) ∈ G × H (x, y) \in G \times H to be the colour of x ∈ G x \in G , or do the same with the roles of G G and H H reversed.

Categorically, the conjecture can be expressed as follows:

Conjecture (Hedetniemi) The functor χ : Graph → ( ℕ , ≤ ) \chi: Graph \to (\mathbb{N}, \leq) preserves binary products.

That’s just because binary products in the category ( ℕ , ≤ ) (\mathbb{N}, \leq) are minima.

Postscript: Perturbing the definition

In what I wrote above, I tried to stick closely to what I understand to be graph theorists’ conventions, except of course that some things are phrased in categorical language. I don’t know nearly enough graph theory to challenge the wisdom of those conventions.

However, I can’t help wondering whether things would become cleaner if we allowed our graphs to have loops. Formally, a graph-with-loops is a finite set equipped with a symmetric binary relation. Thus, what we’re calling a “graph” is a special sort of graph-with-loops: it’s a graph-with-loops with no loops! Formally, it’s a graph-with-loops in which the relation is irreflexive.

Homomorphisms of graphs-with-loops are defined just as for ordinary graphs, and products are described in the same way too. Thus, Graph Graph is a full subcategory of Graph L Graph_\text{L} , the category of graphs-with-loops, and the inclusion preserves binary products.

Why allow loops? The reasons are aesthetic.

First, the irreflexivity condition tastes strange on a category theorist’s tongue. We’re suspicious of negatives.

Second, the category of graphs has the strange feature of possessing binary products but not a terminal object. This is “fixed” (if you think it’s a problem) by passing to the category of graphs-with-loops, in which the terminal object is the graph consisting of a vertex and a single loop on it.

Third, there’s a general rule, discussed at the Café before (though I can’t find it now) and possibly due to Grothendieck:

A good category containing some bad objects is preferable to a bad category containing only good objects.

I’m not keen on the words “good” and “bad” in mathematics, but I understand the intent. For instance, the rule tells us to work with the category of schemes rather than the category of varieties. The category of varieties is “bad” in lacking certain colimits, for example; but from the traditional point of view, some schemes are “bad”. Similarly, it suggests that categories of smooth spaces are preferable to categories of manifolds.

In our present situation, the presence of loops might be thought to make a graph “bad”, but allowing such graphs makes the category good.

One way in which a graph containing loops is “bad” is that it has no colourings at all. If a vertex x x has a loop on it, then there’s an edge between x x and x x , so there’s no colour you can give it. Thus, the chromatic number of a graph containing one or more loops should be taken to be ∞ \infty . Chromatic number therefore defines a functor

χ : Graph L → ℕ ∪ { ∞ } . \chi\colon Graph_\text{L} \to \mathbb{N} \cup \{\infty\}.

The category ℕ ∪ { ∞ } \mathbb{N} \cup \{\infty\} is also “better” than ℕ \mathbb{N} : unlike ℕ \mathbb{N} , it has a terminal object (greatest element), ∞ \infty . Since 1 1 , the terminal graph-with-loops, contains a loop, we have χ ( 1 ) = ∞ \chi(1) = \infty . That is, χ \chi preserves terminal objects. So it preserves binary products if and only if it preserves all finite products.

Actually, there’s something funny going on. A loop in a graph G G is a homomorphism 1 → G 1 \to G . In categories of spaces, a map from the terminal object to a space X X is often called a point of X X . So, loops are points. This means that the graphs without loops — the “good” graphs — are exactly the graphs without points! What’s funny is that in some categories of spaces, such as the category of locales, the nontrivial spaces with no points at all tend to be seen as rather exotic. (For example, there’s the locale of surjections ℕ → ℝ \mathbb{N} \to \mathbb{R} , which is nontrivial but has no points.)

Hedetniemi’s conjecture is straightforward when G G or H H contains a loop. For if G G contains a loop then we have a homomorphism 1 → G 1 \to G , which induces another homomorphism

H ≅ 1 × H → G × H . H \cong 1 \times H \to G \times H.

So χ ( H ) ≤ χ ( G × H ) \chi(H) \leq \chi(G \times H) . (Concretely, if G G contains a loop on a vertex x x then { x } × H ⊆ G × H \{x\} \times H \subseteq G \times H is an isomorphic copy of H H contained in G × H G \times H .) But we also know that χ ( G × H ) ≤ χ ( H ) \chi(G \times H) \leq \chi(H) ; so χ ( G × H ) = χ ( H ) \chi(G \times H) = \chi(H) . Since χ ( G ) = ∞ \chi(G) = \infty , this is exactly what Hedetniemi’s conjecture predicts.

So the conjecture can equivalently be reformulated as:

Conjecture (Hedetniemi) The functor χ : Graph L → ℕ ∪ { ∞ } \chi\colon Graph_\text{L} \to \mathbb{N} \cup \{\infty\} preserves finite products.

At first glance this looks harder than the previous versions, since Graph L Graph_\text{L} is a larger category and we’re asking for the preservation of terminal objects as well as binary products. But the observations above show that it’s actually equivalent.