20

What is a proof that graph 3-colorability is not definable in first order logic? Where did it first appear?

  • 2
    It is worth pointing out that 3-colorability is not first order definable over the family of finite graphs (I do not not know who first proved it, perhaps it was Yuri Gurevich). This failure of undefinability is a well-known result in the area of finite model theory, where the compactness theorem and ultraproducts are no longer available, instead Ehrenfeucht-Fraisse games are the tools of the trade. It is also known that 3-colorability on finite graphs is NP-complete. – Ali Enayat Jul 08 '23 at 16:30
  • 1
    PS to my earlier comment: I see that Emil Jeřábek, in one of his comments to Joel Hamkins' answer below, outlines a proof of the nonexpressibility of 3-colorability over the family of finite graphs. – Ali Enayat Jul 08 '23 at 16:45

2 Answers2

25

Here is one way to do it.

2-colorability case. First let's warm up with the 2-colorability case. Notice that odd-length cycles are not 2-colorable, since the colors have to alternate as you go around the cycle, but then since it is odd length, when you get back to the starting point the parity is wrong. So take a nonprincipal ultraproduct of all finite odd-length cycles. The ultraproduct consists of nodes all of degree 2, but contains no finite cycles at all. So the ultraproduct is 2-colorable, even though none of the factors is 2-colorable, which would violate the Łoś theorem if 2-colorability were expressible.

3-colorability. For 3-colorability, now, we can do something similar. Instead of cycles, consider finite bands made of triangles like this. enter image description here Each triangle will use three different colors, and so if the whole thing was three colorable, then A will get the same color as C, and the same as E, G, I, K etc.

Now, we loop this band around to the starting point, like a giant fastening his belt. If we identify L and K with A and B, for example, then it would not be 3-colorable, since we said A must have the same color as K and different from B.

More generally, using any odd number of steps will mean that the fastened looped belt will not be 3-colorable. This is just like the 2-color case where odd cycles are not 2-colorable.

But now we can proceed as before. Take an ultraproduct of longer and longer such odd-length finite looped belts. None is 3-colorable, but the ultraproduct consists entirely of infinite belts only (since locally it looks like any big looped belt does, but since the finite looped belts grow in size, it never loops back). So the ultraproduct is 3-colorable, but no factor is.

So 3-colorability is not expressible in first-order graph theory.

Alternative argument using bicycle wheels. Emil points out in the comments that one can also use odd-length cycles with a center vertex adjacent to all nodes on the cycle, like a bicycle wheel with an odd number of spokes, and this may be a simpler way of proceeding. These are not 3-colorable, but the ultraproduct of larger and larger such wheels will consist of infinite $\mathbb{Z}$-chains attached to a center vertex, and these are 3-colorable. So 3-colorability is not expressible.

$n$-colorability. The previous idea generalizes to $n$-colorability for every finite $n\geq 2$, just by adding more nodes connected to all the earlier nodes.

Omitting ultraproducts. One can cast all the arguments via compactness instead of ultraproducts. For example, if 2-colorability were expressible, then write down the theory saying that the graph is not 2-colorable, every node has degree 2, and (as a scheme) there are no finite cycles of any particular size. This theory is finitely satisfiable, in sufficiently large odd-length cycles, but it is not satisfiable, since any model of the whole theory will consist of disjoint $\mathbb{Z}$-chains of adjacent nodes, and these are all 2-colorable. Contradiction. Similar compactness arguments work in the other cases in place of the ultraproduct.

  • 1
    Since the ultrapower of odd-sized bands and the ultrapower of even-sized bands are the same, this actually shows that no first-order sentence defines 3-colourability on finite graphs. – Emil Jeřábek Jul 07 '23 at 21:07
  • Yes, I agree. Even when restricting to finite graphs, we cannot express it. – Joel David Hamkins Jul 07 '23 at 21:12
  • 4
    Btw, a perhaps easier way of going from 2-colourability to 3-colourability is to take the cycles and just add an extra vertex adjacent to all vertices of the cycle. This also generalizes to $k$-colourability for any constant $k\ge2$. – Emil Jeřábek Jul 07 '23 at 21:15
  • 3
    I see, bicycle wheels with an odd number of spokes! And that idea will generalize to every finite $n$. – Joel David Hamkins Jul 07 '23 at 21:17
  • 1
    Ah, yes, wheels. I couldn’t remember what the official name was. – Emil Jeřábek Jul 07 '23 at 21:19
  • 2
    +1, but a quibble: "ultrapower" should be "ultraproduct". – Andreas Blass Jul 08 '23 at 11:42
  • Thanks! I have fixed it. – Joel David Hamkins Jul 08 '23 at 12:53
  • Sorry I know this should be obvious but I am not sure I understand. Given the fact that we are working with finite graphs, but the ultraproduct is made up of infinite graphs, how do we reach the conclusion of the argument? – H.C Manu Jul 19 '23 at 20:19
  • @H.CManu If you refer to Emil's observation, it goes like this: the ultrapower of my bands of odd-length and the ultrapower of the even-sized bands both consist of continuum many $\mathbb{Z}$-chains sequences of my Giant's belt, so they are isomorphic as infinite graphs. But if 3-colorability were expressible for finite graphs, the even-sized factors would all satisfy the assertion, but the odd-sized factor not. So the ultrapower would satisfy it in the even case but not the odd case, contradicting that the two ultrapowers are isomorphic. – Joel David Hamkins Jul 19 '23 at 20:34
  • 1
    Oo, that's a clever little argument, thanks for the calrification @JoelDavidHamkins. – H.C Manu Jul 19 '23 at 20:37
6

It’s worth noting that Joel’s great answer says that $n$-colorability is not definable by a single sentence of first-order logic. However, it is definable by a first-order theory.. That is, for each $n \in \omega$, there is a first-order theory $T_n$ in the language of graphs so $G\vDash T_n$ iff there is a proper $n$-coloring of $G$.

I can’t actually write down the axioms of $T_n$, but you can show it exists by the Keisler-Shelah(?) characterization of elementary classes: a class of $\tau$-structures $\mathbb{K}$ is an elementary class iff it is closed under isomorphisms, ultraproducts, and ultraroots. We define $\mathbb{K}_n$ to be the class of $n$-colorable graphs. Then $G \in \mathbb{K}_n$ iff it has an expansion to add disjoint predicates $R_i, i<n$ with no two adjacent vertices in the same predicate. Crucially, these extra axioms are universal!

  • Closed under isomorphism.
  • Ultraproducts commute with expansion, so we can take the ultraproduct of the expansions to get the expansion of the ultraproduct. Since the extra axioms are first-order, the ultraproduct is also $n$-colorable.
  • Let $G$ be a graph and $\prod G/U \in \mathbb{K}_n$ and $\left(\prod G/U\right)^+$ is the expansion. Since the new axioms are universal, they are inherited by any substructure. Since the expansion is all relations, the expansion of $G$ is a substructure of $\left(\prod G/U\right)^+$. \end{itemize} So there is some theory, but I don’t know a better way to write it down besides $T_n = \text{Th}(\mathbb{K}_n)$.

This is a specific instance of the following general principle (which I assume is folklore):

Theorem Let $T_0$ be a first-order theory in the language $\tau_0$. Let $\tau_1$ be a relational language and a $T_1$ be a universal first-order theory in the language $\tau_0 \cup \tau_1$. Then $$PC(T_0 \cup T_1, \tau_0) = \left\{ M \upharpoonright \tau_0 : M \vDash T_0 \cup T_1\right\}$$ is an elementary class.

For instance, this shows that the class of orderable graphs is also an elementary class.

8bc3 457f
  • 137
Will Boney
  • 508
  • 2
  • 7
  • 7
    It’s actually quite easy to write down explicit axioms of $T_n$: it will consist of the universal sentences expressing “I do not contain a copy of $G$” for each finite graph $G$ that is not $n$-colourable. This follows immediately from the compactness theorem, no need to use Keisler–Shelah. – Emil Jeřábek Jul 22 '23 at 06:22