Erdős-Gyárfás Balanced Five-Colorings
Hai Xia, Stefan Szeider
math.CO
Oct 17, 2026 · v1
cs.DM
TL;DR
A Lean 4 proof, using Mathlib's Turán theorem, formalizes the reduction of the r=5 Erdős–Gyárfás conjecture to an extremal lemma on one color class.
Abstract
A coloring of the edges of a complete graph with $r$ colors is balanced if the edges among any $r+1$ vertices use all $r$ colors. Erdős and Gyárfás (1999) conjectured that for all $r\ge3$ the complete graph $K_{r^2+1}$ has no balanced $r$-coloring. They proved the conjecture for $r=3$ and $r=4$. We prove the conjecture for $r=5$, the first new case settled in over two decades. There is no balanced $5$-coloring of $K_{26}$, and since $K_{25}$ has one, $K_{25}$ is the largest complete graph admitting a balanced $5$-coloring. We design a reduce–dispatch–enumerate workflow, where every machine step produces an artifact that can be independently checked. First, we use a machine-checked (Lean 4) proof to reduce the conjecture to a single extremal statement about the color class with the fewest edges: no graph on $26$ vertices has between $55$ and $65$ edges while every $6$ of its vertices span between $1$ and $11$ edges. We then search on the sparse class instead of its dense complement, which makes enumeration up to isomorphism feasible. With classical stability theorems for $K_6$-free graphs, we dispatch the five near-extremal edge counts analytically. For the exhaustive enumeration on the remaining six edge counts, we design efficient encodings with SAT modulo symmetries and parallel cube-and-conquer. We also certify all eleven edge counts: each of the $12{,}296$ subproblems carries a clausal refutation checked by the independent verifier drat-trim, and all $273{,}503{,}938$ symmetry-breaking clauses are also validated against the vertex permutations that justify them.
Problem
Erdős and Gyárfás conjectured that K_{r^2+1} has no balanced r-coloring for r≥3, where every r+1 vertices span edges of all r colors. Only the cases r=3 and r=4 were known, both from 1999.
Approach
A reduction formalized in Lean 4 turns the conjecture into a Main Lemma about the sparsest color class. The Lean proof covers the balance-implied properties, isomorphism invariance, and the 55–65 edge bound, with the lower bound derived from Mathlib's Turán theorem. Edge counts 55–59 are handled analytically with stability theorems for K6-free graphs. Counts 60–65 are settled by exhaustive enumeration using SAT modulo symmetries and cube-and-conquer, with DRAT refutations checked by drat-trim and symmetry-breaking clauses validated by witness checks.
Results
K_26 has no balanced 5-coloring, so K_25 is the largest complete graph admitting one. All 12,296 subproblems carry checked refutations, and all 273,503,938 symmetry-breaking clauses are validated.
| e | cells | emitted | sat. (L) | DRAT (GB) |
|---|
| 62 | 1 | 2,455 | 0 | 1.3 |
| 63 | 4,096 | 26,521 | 0 | 1,296 |
| 64 | 4,096 | 238,420 | 0 | 1,760 |
| 65 | 4,096 | 2,605,003 | 0 | 2,484 |
Enumeration results for searched edge counts