Mathematics / Formalization Note / Combinatorics & Graph Theory

Alspach's Conjecture in Lean 4: Machine-Checked Components of the Bryant-Horsley-Pettersson Proof

Proved both hypotheses of sturdy4days's long-cycle reduction (PRs #54401, #54408). Closed the transfer hypotheses R1.H2 and R2.H2 of the odd and even trees with own reductions and leaf proofs. Stated the Bryant-Horsley-Pettersson simultaneous odd/even induction as the reductions R1.H3.R1 (under TheWaler's R1) and R2.H3.R2 (under sturdy4days's R2), and proved the even base orders n <= 14, all Theorem 3 leaves, the odd-tree Lemma 5 subtree and most of the odd-order Lemma 4 subtree. The even-tree Lemma 4 and Lemma 5 files are mostly copies of the odd-tree files. Further submissions target the remaining Lemma 4 and Lemma 5 nodes.

Author
Ali Uyar
Scope
Modular suite
Status
Partly merged on Left to Solve
Original theorem
Alspach's conjecture (B. Alspach, 1981), proved by D. Bryant, D. Horsley and W. Pettersson, Proc. London Math. Soc. 108 (2014), 1153-1192 (arXiv:1204.3709). This is a formalization of a known theorem.
Statement source
Left to Solve (FormalConjectures / OMA statements)
Source
github.com/aliuyar1234/lean4-landmark-formalizations/tree/main/01-alspach-conjecture

Machine-checked in Lean 4 ✓ Partly merged on Left to Solve; the open pull requests are awaiting its checker. Synced daily (2026-12-04).

Summary

Alspach's conjecture (1981), proved by Bryant, Horsley and Pettersson (2014), states that K_n for odd n, and K_n minus a perfect matching for even n, decompose into cycles of any prescribed lengths between 3 and n that sum to the number of edges. This work formalizes the Bryant-Horsley-Pettersson proof in Lean 4 inside the Left to Solve proof trees for the three formal-conjectures statements: the odd case, the even case (for an arbitrary perfect matching) and a long-cycle special case (odd n, all lengths at least (n+5)/2). It proves the two hypotheses that close the long-cycle case through sturdy4days's reduction; states the simultaneous odd/even induction as reductions in both trees; and proves the transfer steps, Theorem 3 for both parities, the even base orders n <= 14 with kernel-checked certificates, the odd-tree Lemma 5 subtree and most of the odd-order Lemma 4 subtree. The odd and even roots are not yet closed on Left to Solve: the Lemma 4 subtrees (and, in the even tree, Lemma 5) still have open nodes. The 152 archived files total 354,659 lines, but most of that is repeated shared code and odd-to-even copies; the archive holds about 47,800 distinct non-blank lines.

Context

The proof of Alspach's conjecture is a long case analysis with computer-checked small cases. This work puts the transfer theorem, the base cases, Theorem 3 and the Lemma 5 constructions under the Lean kernel node by node, and the proof tree shows exactly what remains on Left to Solve (parts of Lemma 4, and of Lemma 5 in the even tree).

Root problems on Left to Solve

  • LTS AlspachConjecture.alspach_conjecture not closed on Left to Solve (27/80 steps solved)
  • LTS AlspachConjecture.alspach_conjecture.variants.even not closed on Left to Solve (17/45 steps solved)
  • LTS AlspachConjecture.alspach_conjecture.variants.long_cycles closed; credited to @sturdy4days, with aliuyar1234 as contributor

Credits

Mathematics: B. Alspach (conjecture), P. Balister (n <= 14), D. Bryant and D. Horsley (ancestor-list reduction, long cycles), D. Bryant, D. Horsley and W. Pettersson (proof). Left to Solve tree contributors as recorded by Left to Solve: TheWaler (odd top-level reduction R1), Deldor14 (odd R1.H1, PR #4844), sturdy4days (even top-level reduction R2; long-cycle reduction R2, PR #20586, recorded as the long-cycle solution with aliuyar1234 as contributor), linche89 (even R2.H1, PR #24327), b-ionut-r (odd base orders, PRs #63648 and #69340), fullstackzach (PRs #71825 and #83146), tharunekam (PR #133884), abjiang22 (PR #135899), MattGaiser (PR #95184). Four of the author's PRs (#63729, #69598, #71967, #83385) were closed because those contributors' proofs of the same nodes merged first. Adapted code: the even base-order files state 'The hex-encoded cycle verifier, bitmap packing, subset-sum bitset splitting, and screened library verification architecture are adapted from @Deldor14's odd-order proof (AlspachConjecture.alspach_conjecture.R1.H1)'; the transport lemmas iso_decomposition, matching_iso and matchings_complements_iso are taken from sturdy4days's variants.even.R2 reduction module (not recorded in the file headers). Lean proofs produced with AI coding agents operated by the author (PR bodies: t3-code, Antigravity + Codex, codex + claude-code; model gpt-6.2-astra).

Pull request ledger (157)

  • #49165 AlspachConjecture.alspach_conjecture.R1.H2.R1 merged
  • #52798 AlspachConjecture.alspach_conjecture.R1.H3.R1 merged
  • #52804 AlspachConjecture.alspach_conjecture.variants.even.R2.H2.R1 merged
  • #53533 AlspachConjecture.alspach_conjecture.R1.H2.R1.H1 merged
  • #53540 AlspachConjecture.alspach_conjecture.R1.H2.R1.H2 merged
  • #54401 AlspachConjecture.alspach_conjecture.variants.long_cycles.R2.H1 merged
  • #54408 AlspachConjecture.alspach_conjecture.variants.long_cycles.R2.H2 merged
  • #55463 AlspachConjecture.alspach_conjecture.variants.even.R2.H3.R2 merged
  • #57392 AlspachConjecture.alspach_conjecture.R1.H3.R1.H1.R1 merged
  • #57403 AlspachConjecture.alspach_conjecture.R1.H3.R1.H2.R1 merged
  • #57415 AlspachConjecture.alspach_conjecture.R1.H3.R1.H3.R1 merged
  • #57420 AlspachConjecture.alspach_conjecture.R1.H3.R1.H4.R1 merged
  • #57622 AlspachConjecture.alspach_conjecture.variants.even.R2.H2.R1.H1 merged
  • #57629 AlspachConjecture.alspach_conjecture.variants.even.R2.H2.R1.H2 merged
  • #62002 AlspachConjecture.alspach_conjecture.variants.even.R2.H3.R2.H1.R1 merged
  • #62103 AlspachConjecture.alspach_conjecture.variants.even.R2.H3.R2.H2.R1 merged
  • #62265 AlspachConjecture.alspach_conjecture.variants.even.R2.H3.R2.H3.R1 merged
  • #62401 AlspachConjecture.alspach_conjecture.variants.even.R2.H3.R2.H4.R1 merged
  • #63738 AlspachConjecture.alspach_conjecture.R1.H3.R1.H1.R1.H2 merged
  • #63751 AlspachConjecture.alspach_conjecture.R1.H3.R1.H2.R1.H1 merged
  • + 137 additional PRs recorded in MANIFEST.json on GitHub.

Cite

@misc{uyar2026_alspach_conjecture_lean4,
  author    = {Uyar, Ali},
  title     = {Alspach's Conjecture in Lean 4: Machine-Checked Components of the Bryant-Horsley-Pettersson Proof},
  year      = {2026},
  url       = {https://aliuyar.dev/math/alspach-conjecture-lean4/},
  note      = {Lean 4 formalization technical note (Alspach's conjecture (B. Alspach, 1981), proved by D. Bryant, D. Horsley and W. Pettersson, Proc. London Math. Soc. 108 (2014), 1153-1192 (arXiv:1204.3709). This is a formalization of a known theorem.). Code: https://github.com/aliuyar1234/lean4-landmark-formalizations/tree/main/01-alspach-conjecture}
}