# Four-coloring infinite graphs

The four-color theorem states that every planar loopless graph can be four colored. That is, there is an assignment to each vertex of one of four distinct “colors” such that adjacent vertices are assigned distinct colors. The case of finite graphs was proved by Appel and Haken in 1976 with computer assistance (with some errors corrected in 1989), and in 2005 Werner and Gonthier formalized a proof of the theorem inside the Coq proof assistant.

A remarkable fact is that the case of infinite graphs follows from the finite case as a matter of pure logic. All you need to extend to infinite graphs is the fact that subgraphs of planar graphs are planar! This was originally proved by De Bruijn and Erdős in 1951.

In this post, we’ll go through a few ways of organizing the ideas for four coloring infinite graphs. It should be said that they are all highly non-constructive. While there might be some comparison to a limiting process, it would be at the level of colorings themselves — the limit does not descend to the level of the individual edges being colored, since the color assignments to an edge do not necessarily eventually stabilize in any way.

## 1. With model theory

There is a straightforward way to encode the four coloring problem using first-order logic, and then the infinite case follows immediately from the Compactness theorem. But first, we need a few definitions.

A *signature* consists of a collection of abstract sets called *domains* and a collection of abstract relations on these domains of any arity. By convention, unary relations are known as *predicates*.
A *theory* for a signature is a collection of first-order sentences, where the quantifiers range over domains.^{[1]}
The theory might include sentences that imply certain relations are functions, in such a case we will write $y=f(x)$ rather than, say, assert that $f(x,y)$ is true.
A *model* for a theory is an assignment of concrete sets and relations for the signature that satisfy the theory.

The **Compactness Theorem** states that if every finite subset of a theory has a model, then the whole theory has a model. The argument here is surprisingly straightforward, which we will sketch because it’s kind of cool. Let $T$ be the theory, and let $\mathcal{F}T$ denote the set of all finite subsets of $T$. By assumption, each $I\in \mathcal{F}T$ has a model ${M}_{I}$. We construct a filter on $\mathcal{F}T$ (that is, on the poset $\mathcal{P}(\mathcal{F}T)$ of all subsets of $\mathcal{F}T$) generated by elements of the form

^{[2]}the ultraproduct $M=\left(\prod _{I\in \mathcal{F}T}{M}_{I}\right)/U$ is a model for $T$. (By definition, $\varphi \in T$ is true in $M$ iff ${B}_{\varphi}\in U$.)

Ok, so how do we apply the compactness theorem? Let $G$ be a loopless planar graph with vertex set $V(G)$. Define a signature with domains $V$ and $C$ and a function $f:V\to C$. For each $v\in V(G)$, throw in constants ${n}_{v}\in V$ (i.e., nullary functions ${n}_{v}:()\to V$). Define a theory $T$ by having, for each edge $(v,w)\in E(G)$, the axiom $f({n}_{v})\ne f({n}_{w})$, and add in the additional axiom that $C$ has at most four elements.^{[3]}

Each finite subset of $T$ corresponds to some finite subgraph of $G$. Since finite subgraphs are, by assumption, four-colorable, the finite subset has a corresponding model. Hence, the compactness theorem says there is a model for $T$ itself. The domain $V$ in this model might have no relation to $V(G)$ (and in fact the ultraproduct construction will have constructed an absurdly large four-colored graph), but we may use the nullary functions to get a handle on things, since we may color $v\in V(G)$ by the color $f({n}_{v})$. Since we had the axiom that $C$ have at most four colors, we are done!

**Remark.** Except for the assertion that $C$ have at most four elements, none of the axioms really involve quantifiers (there are some hidden in the function applications, but by using four mutually exclusive proposition variables per vertex these could be eliminated). It would suffice to use the compactness theorem for propositional logic rather than the full compactness theorem for first-order logic.

## 2. With ultrafilters

The compactness theorem is worthwhile to know, but it can be illuminating to expand things out to see how the pieces fit together. Luxemburg^{[4]} essentially gave this argument in 1962.

Recall that an *ultrafilter* $U$ on the poset $\mathcal{P}X$ of subsets of a set $X$ is a subset of $\mathcal{P}X$ satisfying the following axioms:

- If $A,B\in U$, then $A\cap B\in U$.
- If $A\subseteq B\subseteq X$ and $A\in U$, then $B\in U$.
- $\mathrm{\varnothing}\notin U$.
- If $A\subseteq X$, then either $A\in U$ or $X-A\in U$.

A use of (ultra)filters in topology is generalized limits. An (ultra)filter $U$ on a topological space $X$ is said to converge to a point $x\in X$ if for all open sets $V\subseteq X$ containing $x$ then $V\in U$. The ultrafilter convergence theorem states that (1) $X$ is compact iff every ultrafilter converges to at least one point and (2) $X$ is Hausdorff iff every ultrafilter converges to at most one point.

**Example.** Given an index set $J$, consider the space $X=\{0,1{\}}^{J}$ with the product topology, which is compact by Tychonoff’s compactness theorem. For every finite subset $I\subseteq J$, the set

**Example.** Let $M$ be a manifold and $C(M)$ the $\mathbb{R}$-algebra of continuous functions $M\to \mathbb{R}$. If $\mathfrak{m}\subset C(M)$ is a maximal ideal, then consider the collection of sets ${f}^{-1}(0)$ for $f\in \mathfrak{m}$. Since $\mathfrak{m}\ne C(M)$, we know none of these is the empty set. And, for $f,g\in \mathfrak{m}$, one can construction a function $h\in \mathfrak{m}$ with ${f}^{-1}(0)\cap {g}^{-1}(0)={h}^{-1}(0)$ since manifolds have bump functions. Hence, the collection extends to an ultrafilter. If $M$ is compact, then the ultrafilter has a limit point $a\in M$ and thus $\mathfrak{m}$ is principal and generated by the function $x\mapsto x-a$, and hence the quotient map $C(M)\to C(M)/\mathfrak{m}$ is equivalent to the evaluation map $f\mapsto f(a)$.

Gottschalk’s argument^{[5]} for colorings of infinite graphs uses compactness. It is somewhat overkill to use ultrafilters here, but it doesn’t hurt to use the language. Given a loopless graph $G$ and a finite set $C$ of colors such that every finite subgraph of $G$ is $C$-colorable, let $X={C}^{V(G)}$ be the set of all assignments of colors to vertices of $G$, endowed with the product topology. For each finite subset $I\subseteq E(G)$, define ${X}_{I}\subseteq X$ to be the set of all points $x\in X$ such that ${x}_{v}\ne {x}_{w}$ for every edge $(v,w)\in I$. These are open subsets, and the collection of all of them satisfies the finite intersection property. Since finite subgraphs of $G$ are all $C$-colorable, then none of the ${X}_{I}$’s are empty, hence there is an ultrafilter containing them. The ultrafilter convergence theorem implies there is a unique point $x\in X$ that the ultrafilter converges to, and one can check it is a proper $C$-coloring of $G$. (Without ultrafilters, one may use the fact that these ${X}_{I}$ sets are closed and have the finite intersection property, hence their intersection is nonempty.)

For the rest of this section, we’ll go for a direct proof that sort of combines Gottschalk’s approach and ultraproducts and expands out the definitions.

Let $G$ be a loopless planar graph, and let $\mathcal{F}G$ denote the set of all spanning subgraphs $H\subseteq G$ with finitely many edges (that is, $V(H)=V(G)$ and $E(H)$ is finite). By assumption, each $H\in \mathcal{F}G$ has a proper four coloring, hence there is a function ${f}_{H}:V(G)\to 4$ such that ${f}_{H}(v)\ne {f}_{H}(w)$ for every edge $(v,w)\in E(H)$. Consider the collection of sets of the form ${A}_{H}=\{{H}^{\prime}\in \mathcal{F}G:H\subseteq {H}^{\prime}\}$. This collection satisfies the finite intersection property since ${A}_{H}\cap {A}_{{H}^{\prime}}={A}_{H\cup {H}^{\prime}}$ for each pair $H,{H}^{\prime}\in \mathcal{F}G$. Since each ${A}_{H}$ is nonempty, this collection extends to an ultrafilter $U$ on $\mathcal{P}(\mathcal{F}G)$. Now we use the ultrafilter to “vote” on the coloring of $G$ itself in the following way.

For $v\in V(G)$, consider the function ${F}_{v}:\mathcal{F}G\to 4$ defined by ${F}_{v}(H)={f}_{H}(v)$, and let $C(v)$ denote the set of colors $c\in 4$ such that ${F}_{v}^{-1}(c)\in U$. That is, $C(v)$ is the set of colors for which a “majority” of the spanning subgraphs chose that color for that vertex. A first fact is that $C(v)$ is nonempty. If it were empty, then for each $c\in 4$ we would have $\mathcal{F}G-{F}_{v}^{-1}(c)\in U$, and hence the intersection of all these complements would be in $U$. But

$$\bigcap _{i\in 4}\left(\mathcal{F}G-{F}_{v}^{-1}(i)\right)=\{H\in \mathcal{F}G:{f}_{H}(v)\notin 4\}=\mathrm{\varnothing},$$ and $U$ does not contain the empty set! A second fact is that $C(v)$ has at most one element. For $c,{c}^{\prime}\in C(v)$, then we have ${F}_{v}^{-1}(c)\cap {F}_{v}^{-1}({c}^{\prime})\in U$. This intersection consists of all those graphs $H\in \mathcal{F}G$ such that ${f}_{H}(v)=c$ and ${f}_{H}(v)={c}^{\prime}$, hence $c={c}^{\prime}$ since the intersection is nonempty. Therefore, $|C(v)|=1$ for each $v\in V(G)$. Define $f:V(G)\to 4$ by letting $f(v)$ be the sole element of $C(v)$ for each $v$, which is to say $f$ is defined by the relation ${F}_{v}^{-1}(f(v))\in U$ for each $v\in V(G)$.What is left is to show that $f$ defines a proper coloring.^{[6]} Let $(v,w)\in E(G)$ be an edge, and suppose it were the case that $c=f(v)=f(w)$. Let $H\in \mathcal{F}G$ be the graph with $E(H)=\{(v,w)\}$. Consider the intersection

**Remark.** Define $F:\mathcal{F}G\to {4}^{V(G)}$ by $f(H)={f}_{H}$. Maps of sets carry ultrafilters to ultrafilters, which in particular means that ${F}_{\ast}U=\{A\subseteq {4}^{V(G)}:{F}^{-1}(A)\in U\}$ is an ultrafilter on ${4}^{V(G)}$. Since ${4}^{V(G)}$ is compact Hausdorff, there is a unique *$U$-limit* of $F$ (that is, a limit point of ${F}_{\ast}U$), and it was the $f$ we constructed from before. With $\mathcal{P}G$ denoting the set of all spanning subgraphs of $G$, then we may endow it with the product topology using the correspondence that a spanning subgraph is a function $E(G)\to 2$. The subspace $\mathcal{F}G\subset \mathcal{P}G$ is dense, and $U$ converges to $G\in \mathcal{P}G$, which is outside $\mathcal{F}G$. Extending $U$ to be an ultrafilter on $\mathcal{P}G$, it is a principal ultrafilter generated by $G$, and the limit of a function with respect to a principal ultrafilter is the image of the generator.

## 3. By Kőnig’s lemma

One version of Kőnig’s lemma is that, given an infinite sequence ${S}_{1},{S}_{2},{S}_{3},\dots $ of disjoint non-empty finite sets along with a relation $<$ on $\bigcup _{i}{S}_{i}$ such that for every $x\in {S}_{n+1}$ there is a $y\in {S}_{n}$ with $y<x$, then there exists an infinite sequence ${x}_{1},{x}_{2},{x}_{3},\dots $ such that ${x}_{n}\in {S}_{n}$ for each $n$ with ${x}_{1}<{x}_{2}<{x}_{3}<\cdots $.

For example, given functions ${f}_{n}:{S}_{n+1}\to {S}_{n}$ for each $n$, we could define $y<x$ iff $y={f}_{n}(x)$ for $y\in {S}_{n}$ and $x\in {S}_{n+1}$. We may interpret Kőnig’s lemma as saying the inverse limit ${\underleftarrow{\mathrm{lim}}}_{n}{S}_{n}$ is nonempty. Note that this is true even without each ${f}_{n}$ being surjective.

Nash-Williams^{[7]} points out how Kőnig’s lemma implies a version of infinite graph coloring in the case of a loopless planar graph $G$ with a **countably infinite** vertex set.

Since there are countably many vertices, we may define $n$-element subsets ${V}_{n}\subset V(G)$ with ${V}_{n}\u228a{V}_{n+1}$ for each $n\ge 1$ such that $V(G)=\bigcup _{n}{V}_{n}$. Let ${G}_{n}=G[{V}_{n}]$ be the subgraph of $G$ that is induced by the vertex set ${V}_{n}$; recall this means ${G}_{n}$ has all the edges of $G$ that are incident only to vertices from ${V}_{n}$. Let ${S}_{n}$ consist of all vertex colorings ${V}_{n}\to 4$ that are proper colorings for ${G}_{n}$. Since ${G}_{n}$ is a planar finite graph, ${S}_{n}$ is nonempty.

There is a function ${f}_{n}:{S}_{n+1}\to {S}_{n}$ defined by restricting the vertex coloring from ${G}_{n+1}$ to ${G}_{n}$. Hence, by Kőnig’s lemma there is a sequence ${x}_{1},{x}_{2},{x}_{3},\dots $ with ${x}_{n}\in {S}_{n}$ for each $n$ and ${f}_{n}({x}_{n+1})={x}_{n}$. For any given vertex $v\in G$, there is an $n$ with $v\in {V}_{n}$. We may color $v$ according to ${x}_{n}$. We color all of $G$ in this way.

This must be a proper coloring because every pair of adjacent vertices is contained in some ${V}_{n}$ for a large enough $n$, and ${V}_{n}$ contains the edge between them.

The fact the inverse limit is non-empty in no way gives an effective algorithm. While each extension of the graph might be four-colorable, you might not be able to extend the four coloring itself, and it might change dramatically. All Kőnig’s lemma promises is that, with infinite foresight, you could make the right coloring decisions!

^{[1]}This has been mildly generalized from the usual definition where there are no domains. You can represent distinct domains in the usual formulation by having mutually exclusive predicates that test domain membership.

^{[2]}Pronounced “Wash’s theorem.”

^{[3]}For example, “for all $a,b,c,d,e\in C$, then $a=b$ or $a=c$ or ... or $d=e$.”

^{[4]}Luxemburg, W. A. J. (1962), “A remark on a paper by N. G. de Bruijn and P. Erdős”, Indagationes Mathematicae, 24: 343–345, doi:10.1016/S1385-7258(62)50033-4, MR 0140435.

^{[5]}Gottschalk, W. H. (1951), “Choice functions and Tychonoff’s theorem”, Proceedings of the American Mathematical Society, 2 (1): 172, doi:10.2307/2032641, JSTOR 2032641, MR 0040376.

^{[6]}Thanks to Scott Kovach for debugging this part of the argument.

^{[7]}Nash-Williams, C. St. J. A. (1967), “Infinite graphs—a survey”, Journal of Combinatorial Theory, 3 (3): 286–301, doi:10.1016/s0021-9800(67)80077-2, MR 0214501.