# 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. The theory might include sentences that imply certain relations are functions, in such a case we will write $y=f\left(x\right)$ rather than, say, assert that $f\left(x,y\right)$ 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}\left(\mathcal{F}T\right)$ of all subsets of $\mathcal{F}T$) generated by elements of the form

${A}_{I}:=\left\{J\in \mathcal{F}T:I\subseteq J\right\}\in \mathcal{P}\left(\mathcal{F}T\right)$ for all $I\in \mathcal{F}T$. These elements satisfy the finite intersection property since ${A}_{I}\cap {A}_{J}={A}_{I\cup J}$ for all $I,J\in \mathcal{F}T$, so the resulting filter is proper. By Zorn’s lemma, the filter extends to an ultrafilter $U$ on $\mathcal{F}T$ (ultrafilters are defined in the next section). For $\varphi \in T$, we have Since ${A}_{\left\{\varphi \right\}}\in U$, then ${B}_{\varphi }\in U$ as well. Thus, by Łoś’s theorem 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\left(G\right)$. Define a signature with domains $V$ and $C$ and a function $f:V\to C$. For each $v\in V\left(G\right)$, throw in constants ${n}_{v}\in V$ (i.e., nullary functions ${n}_{v}:\left(\right)\to V$). Define a theory $T$ by having, for each edge $\left(v,w\right)\in E\left(G\right)$, the axiom $f\left({n}_{v}\right)\ne f\left({n}_{w}\right)$, and add in the additional axiom that $C$ has at most four elements.

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\left(G\right)$ (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\left(G\right)$ by the color $f\left({n}_{v}\right)$. 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 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:

1. If $A,B\in U$, then $A\cap B\in U$.
2. If $A\subseteq B\subseteq X$ and $A\in U$, then $B\in U$.
3. $\mathrm{\varnothing }\notin U$.
4. If $A\subseteq X$, then either $A\in U$ or $X-A\in U$.
An ultrafilter is a consistent choice of what are the “big” subsets of $X$. The intersection of big subsets is big, the superset of a big subset is big, the empty set is not big, and every set or its complement is big. One can check the intersection of a big set and a small set is small. In other words, there is a homomorphism from $\left(\mathcal{P}X,\cup ,\cap \right)$ to the boolean lattice $\left(\left\{0,1\right\},\vee ,\wedge \right)$.

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=\left\{0,1{\right\}}^{J}$ with the product topology, which is compact by Tychonoff’s compactness theorem. For every finite subset $I\subseteq J$, the set

is an open. Furthermore, for every pair of finite subsets ${I}_{1},{I}_{2}\subseteq J$, we have ${V}_{{I}_{1}}\cap {V}_{{I}_{2}}={V}_{{I}_{1}\cup {I}_{2}}$, so the collection satisfies the finite intersection property. Collections that do not contain the empty set and that satisfy the finite intersection property extend to an ultrafilter; let $U$ be such an ultrafilter on $\mathcal{P}X$ extending this collection. Hence, by the ultrafilter convergence theorem, there is unique point $x\in X$ that $U$ converges to since the product of Hausdorff spaces is Hausdorff. This point is just the all-ones point $\left(1{\right)}_{i\in J}$.

Example. Let $M$ be a manifold and $C\left(M\right)$ the $\mathbb{R}$-algebra of continuous functions $M\to \mathbb{R}$. If $\mathfrak{m}\subset C\left(M\right)$ is a maximal ideal, then consider the collection of sets ${f}^{-1}\left(0\right)$ for $f\in \mathfrak{m}$. Since $\mathfrak{m}\ne C\left(M\right)$, 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}\left(0\right)\cap {g}^{-1}\left(0\right)={h}^{-1}\left(0\right)$ 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↦x-a$, and hence the quotient map $C\left(M\right)\to C\left(M\right)/\mathfrak{m}$ is equivalent to the evaluation map $f↦f\left(a\right)$.

Gottschalk’s argument 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\left(G\right)}$ be the set of all assignments of colors to vertices of $G$, endowed with the product topology. For each finite subset $I\subseteq E\left(G\right)$, 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 $\left(v,w\right)\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\left(H\right)=V\left(G\right)$ and $E\left(H\right)$ is finite). By assumption, each $H\in \mathcal{F}G$ has a proper four coloring, hence there is a function ${f}_{H}:V\left(G\right)\to 4$ such that ${f}_{H}\left(v\right)\ne {f}_{H}\left(w\right)$ for every edge $\left(v,w\right)\in E\left(H\right)$. Consider the collection of sets of the form ${A}_{H}=\left\{{H}^{\prime }\in \mathcal{F}G:H\subseteq {H}^{\prime }\right\}$. 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}\left(\mathcal{F}G\right)$. Now we use the ultrafilter to “vote” on the coloring of $G$ itself in the following way.

For $v\in V\left(G\right)$, consider the function ${F}_{v}:\mathcal{F}G\to 4$ defined by ${F}_{v}\left(H\right)={f}_{H}\left(v\right)$, and let $C\left(v\right)$ denote the set of colors $c\in 4$ such that ${F}_{v}^{-1}\left(c\right)\in U$. That is, $C\left(v\right)$ 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\left(v\right)$ is nonempty. If it were empty, then for each $c\in 4$ we would have $\mathcal{F}G-{F}_{v}^{-1}\left(c\right)\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}\left(i\right)\right)=\left\{H\in \mathcal{F}G:{f}_{H}\left(v\right)\notin 4\right\}=\mathrm{\varnothing },$ and $U$ does not contain the empty set! A second fact is that $C\left(v\right)$ has at most one element. For $c,{c}^{\prime }\in C\left(v\right)$, then we have ${F}_{v}^{-1}\left(c\right)\cap {F}_{v}^{-1}\left({c}^{\prime }\right)\in U$. This intersection consists of all those graphs $H\in \mathcal{F}G$ such that ${f}_{H}\left(v\right)=c$ and ${f}_{H}\left(v\right)={c}^{\prime }$, hence $c={c}^{\prime }$ since the intersection is nonempty. Therefore, $|C\left(v\right)|=1$ for each $v\in V\left(G\right)$. Define $f:V\left(G\right)\to 4$ by letting $f\left(v\right)$ be the sole element of $C\left(v\right)$ for each $v$, which is to say $f$ is defined by the relation ${F}_{v}^{-1}\left(f\left(v\right)\right)\in U$ for each $v\in V\left(G\right)$.

What is left is to show that $f$ defines a proper coloring. Let $\left(v,w\right)\in E\left(G\right)$ be an edge, and suppose it were the case that $c=f\left(v\right)=f\left(w\right)$. Let $H\in \mathcal{F}G$ be the graph with $E\left(H\right)=\left\{\left(v,w\right)\right\}$. Consider the intersection

Since each ${f}_{{H}^{\prime }}$ is a proper coloring, this set is empty. But, this is an intersection of three elements of $U$, so it would be an element of $U$ as well! Therefore $f$ must be a proper coloring, and we are done.

Remark. Define $F:\mathcal{F}G\to {4}^{V\left(G\right)}$ by $f\left(H\right)={f}_{H}$. Maps of sets carry ultrafilters to ultrafilters, which in particular means that ${F}_{\ast }U=\left\{A\subseteq {4}^{V\left(G\right)}:{F}^{-1}\left(A\right)\in U\right\}$ is an ultrafilter on ${4}^{V\left(G\right)}$. Since ${4}^{V\left(G\right)}$ 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\left(G\right)\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, 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 iff $y={f}_{n}\left(x\right)$ for $y\in {S}_{n}$ and $x\in {S}_{n+1}$. We may interpret Kőnig’s lemma as saying the inverse limit ${\underset{←}{\mathrm{lim}}}_{n}{S}_{n}$ is nonempty. Note that this is true even without each ${f}_{n}$ being surjective.

Nash-Williams 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\left(G\right)$ with ${V}_{n}⊊{V}_{n+1}$ for each $n\ge 1$ such that $V\left(G\right)=\bigcup _{n}{V}_{n}$. Let ${G}_{n}=G\left[{V}_{n}\right]$ 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}\left({x}_{n+1}\right)={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!

 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.
 Pronounced “Wash’s theorem.”
 For example, “for all $a,b,c,d,e\in C$, then $a=b$ or $a=c$ or ... or $d=e$.”
 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.
 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.
 Thanks to Scott Kovach for debugging this part of the argument.
 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.