Goal of this repo. Build a verified, reproducible computational framework for unit-distance graphs in the plane, then attempt — and honestly report on — the construction of a unit-distance graph with chromatic number 7.
- What was asked: construct a unit-distance graph (UDG) with χ = 7, which would prove χ(ℝ²) ≥ 7 and combine with the Isbell 7-coloring (χ(ℝ²) ≤ 7) to fully solve Hadwiger–Nelson.
- What is currently known (May 2026): 5 ≤ χ(ℝ²) ≤ 7. The lower bound 5 is due to Aubrey de Grey (2018, 1581-vertex UDG). No UDG with χ ≥ 6 is known. A UDG with χ = 7 would resolve a famous open problem and is almost certainly not constructible by a few thousand lines of search code.
- What this repo does now:
- Implements
UnitDistanceGraph, an exact-by-tolerance UDG class. - Implements a SAT-based exact χ oracle (PySAT, with selectable solvers).
- Reproduces the Moser spindle (n=7, m=11) and verifies χ = 4 by SAT (3-coloring is UNSAT, 4-coloring is SAT).
- Produces and verifies the Isbell 7-coloring of the plane geometrically — proving χ(ℝ²) ≤ 7 within this framework.
- Reconstructs de Grey's published 1581-vertex graph exactly at the published vertex counts (S=39, S_a=397, Y=791, G=1581), verifies every edge is unit-distance, and verifies 5-colorability. The non-4-colorability theorem is de Grey's published result; the direct SAT proof is not yet fast enough in this simple encoding.
- Adds physics-inspired diagnostics: Hoffman spectral bounds, independence pressure, and zero-temperature Potts-model annealing.
- Runs structured searches (iterated spindling, Minkowski sums, lattice rotations, random unions) plus cyclotomic/quasicrystal hybrids across 54 total candidates.
- Implements
- What it found: The independent searches still max out at χ = 4. The faithful de Grey reconstruction gives the known χ = 5 lower-bound object, but no χ ≥ 6 or χ = 7 graph was found.
| Statement | How it's verified | File |
|---|---|---|
| Moser spindle has 7 vertices, 11 unit-distance edges | distance check | tests/test_landmarks.py::test_moser_spindle_structure |
| Moser spindle is not 3-colorable | SAT (UNSAT) | tests/test_landmarks.py::test_moser_spindle_chromatic_4 |
| Moser spindle is 4-colorable | SAT (SAT, returns coloring) | same |
| Triangular-lattice patch is 3-colorable, not 2-colorable | SAT both directions | tests/test_landmarks.py::test_triangular_lattice_chi_3 |
| Isbell hexagonal 7-coloring has same-color points strictly farther than 1 apart | direct geometric check (min excess > 1.5) | tests/test_isbell.py |
| de Grey construction has published counts 39, 397, 791, 1581 | construction test | tests/test_degrey.py::test_degrey_published_vertex_counts |
| de Grey 1581 graph has all edges at unit distance | distance check | tests/test_degrey.py::test_degrey_edges_are_unit_distance |
| de Grey 1581 graph is 5-colorable | SAT (Kissat, returns coloring) | tests/test_degrey.py::test_degrey_is_5_colorable |
Run pytest tests/ -v to re-verify.
The Hadwiger–Nelson problem has resisted exactly two kinds of attack:
- Coloring side (upper bound). Isbell (1950) showed χ(ℝ²) ≤ 7 by exhibiting an explicit 7-coloring with hexagonal tiles of diameter < 1. No improvement to 6 is known. To prove χ(ℝ²) ≤ 6 one would need an explicit 6-coloring, which has been actively sought for 75 years.
- Graph side (lower bound). Until 2018, only χ ≥ 4 was known (Moser spindle, 1961). De Grey's 1581-vertex graph proved χ ≥ 5 in 2018. Polymath16 reduced this to ~510 vertices. No UDG with χ ≥ 6 exists in the literature. Constructing one is the current research frontier.
To get χ = 7 from the graph side we would need a UDG that is simultaneously: (a) provably not 6-colorable (much harder than not-5-colorable), (b) embeddable in ℝ² with all unit-distance edges realized exactly.
Naive amplifications (Minkowski sums, rotational unions of spindles) all plateau at χ = 4 in our experiments — consistent with what one expects from the literature.
Output from python scripts/run_search.py:
=== Family A: iterated Moser spindling ===
Moser spindle n= 7 m= 11 chi = 4
Moser spindled^1 n= 13 m= 22 chi = 4
Moser spindled^2 n= 25 m= 44 chi = 4
=== Family B: Minkowski amplification ===
Moser + Moser n= 26 m= 69 chi = 4
Moser + L1 n= 35 m= 107 chi = 4
L2 + Moser n= 87 m= 311 chi = 4
... (12 entries, all chi = 3 or 4)
=== Family C: Lattice rotations ===
L2 U R_θ(L2) for θ in {π/7, 2π/7, arccos(5/6)} -> all chi = 3 or 4
=== Family D: Random rotational unions of Moser ===
6 trials, n in [7, 25], all chi = 4
Largest certified χ across all 29 candidates: 4 (the Moser spindle bound).
Second-generation output from python scripts/run_second_generation.py:
cyclotomic m=5 r=3 n= 211 m= 600 chi=3
cyclotomic m=12 r=3 n= 253 m= 972 chi=3
cyclotomic m=5 r=2 union Moser n= 66 m= 141 chi=4
cyclotomic m=5 r=2 + Moser n= 375 m= 1371 chi=4
cyclotomic m=10 r=2 + Moser n= 375 m= 1371 chi=4
mixed root systems m=5,7 n= 169 m= 322 chi=3
Largest SAT-certified χ from these 25 physics/quasicrystal candidates: 4. Some Minkowski/cyclotomic hybrids leave positive residual energy under 4-state Potts annealing even though SAT finds a 4-coloring; these are useful stress tests, not lower-bound proofs.
de Grey reconstruction:
S n=39 m=18
S_a n=397 m=1974
Y n=791 m=3938
G n=1581 m=7877
The graph matches the published 1581-vertex construction and is 5-colorable by SAT in this repo. A direct non-4 SAT proof with the current direct encoding ran longer than three minutes and was stopped; reproducing Heule/Polymath-style proof speed is now the next engineering target.
figures/01_moser_spindle.png— Moser spindle with optimal 4-coloring.figures/02_triangular_lattice.png— Triangular-lattice patch, χ = 3.figures/03_isbell_7coloring.png— Isbell 7-coloring of the plane.figures/04_state_of_the_problem.png— Combined lower/upper-bound view.figures/05_minkowski_moser_L1.png— Moser ⊕ L₁ Minkowski sum (χ = 4).
hadwigerNelson/
├── README.md # this file
├── requirements.txt
├── venv/ # python 3.11 virtualenv
├── src/
│ ├── unit_distance_graph.py # UDG class, exact tolerance, transformations
│ ├── chromatic.py # SAT-based k-colorability and χ oracle
│ ├── degrey.py # de Grey's 1581-vertex construction
│ ├── diagnostics.py # spectral / independence / Potts diagnostics
│ ├── cyclotomic.py # quasicrystal-inspired point generators
│ ├── critical.py # SAT-guided vertex reduction
│ ├── known_graphs.py # Moser spindle, Golomb, lattice, Isbell
│ ├── de_grey_attempt.py # heuristic Minkowski/rotation experiments
│ ├── search.py # 4 search families + measurement harness
│ └── visualize.py # matplotlib drawing for graphs and colorings
├── tests/
│ ├── test_degrey.py # verifies de Grey counts, unit edges, 5-coloring
│ ├── test_landmarks.py # verifies Moser spindle, lattice, etc.
│ ├── test_second_generation.py
│ └── test_isbell.py # verifies Isbell 7-coloring is sound
├── scripts/
│ ├── run_search.py # runs the search pipeline -> results/
│ ├── run_second_generation.py
│ ├── run_angle_sweep.py # angle sweep for de_grey_attempt
│ └── make_figures.py # renders figures/*.png
├── results/ # search_results.json
└── figures/ # PNG output
python3.11 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pytest tests/ -v # 19 tests pass
python scripts/run_search.py # prints search table, writes results/
python scripts/run_second_generation.py
python scripts/make_figures.py # renders figures/For anyone wanting to push further, the realistic next steps are:
- Faster de Grey non-4 certificate. The 1581-vertex construction is now implemented. The next step is a stronger SAT workflow: symmetry breaking, assumptions, proof logging, and unsat-core extraction to reproduce the known non-4 certificate quickly.
- Polymath16 reductions. Reproduce the smaller (~510 vertex) χ = 5 UDGs from Heule and the Polymath project; these are SAT-driven minimizations of de Grey's graph.
- Search for χ = 6. This is open. The natural attack: build large Minkowski iterates of de Grey's M graph and apply SAT-based vertex-reduction to find critical subgraphs. No success has been reported. A negative result (a 6-coloring of the plane) would be even more interesting.
- Search for χ = 7. Currently believed by some experts to be impossible (i.e., χ(ℝ²) might be 5 or 6, not 7). Either resolution would be a significant theorem.
- Hadwiger, H. (1945). Ungelöste Probleme.
- Moser, L., Moser, W. (1961). Solution to Problem 10, Canad. Math. Bull.
- Isbell, J. (~1950, unpublished; cited in Soifer). The hexagonal 7-coloring.
- de Grey, A. (2018). The chromatic number of the plane is at least 5. Geombinatorics 28(1).
- Polymath project D.H.J. (2018–2019). Wiki summary.
- Soifer, A. The Mathematical Coloring Book, Springer (2008).
The original pipeline above is a SAT-only / random-search monoculture. The
companion document CRITIQUE.md names six standard tools from
linear programming, semidefinite programming, constraint programming,
algebraic number theory, finite-field combinatorics, and Fourier analysis
that the existing code does not use, implements each one as a small module
(src/fractional_chromatic.py, src/lovasz_theta.py, the
build_symmetry_broken_cnf extension in src/chromatic.py,
src/algebraic_angles.py, src/modp_udg.py, src/measurable.py), and
documents concrete numerical wins on the existing landmarks. Highlights:
- The fractional chromatic number of the Moser spindle is exactly 7/2;
the Hoffman bound used by
src/diagnostics.pyonly reports 2.71. - The Lovász ϑ function pinches the same instance into the standard sandwich (\omega \le \vartheta(\bar G) \le \chi_f \le \chi), giving 3 ≤ 3.197 ≤ 3.5 ≤ 4 — a 4-deep filter where the original pipeline has 2.
- The symmetry-broken SAT encoding proves de Grey's 1581-vertex graph is not 4-colourable in ~421 seconds end-to-end, where the README says the raw encoding "ran longer than three minutes and was stopped".
- The mod-p unit-distance Cayley graph (G_{11}) reaches (\chi = 5) in 121 vertices — 13× smaller than de Grey's Euclidean witness.
Run python scripts/run_other_fields.py to reproduce the numbers, and
pytest tests/test_other_fields.py -v to verify the 21 supporting tests.
