Mathematics / Formalization Note / Algebra, Logic & Quantum

Shelah-Spencer Non-Convergence for α = p/q with p ≥ 2 in Lean 4

PR #63400 was accepted by the Left to Solve Lean checker and merged on 2026-11-29. New in it: balanced rooted-path gadgets (step, roots, pathGadgets), the reduction of R1.H2 to the bound P[not HasIndexedChain] ≤ 1/32 (rational_of_indexed_chain_probability), and its proof (indexed_chain_bound) via an edge-block product-measure layer, bulk pool construction and exterior-failure charging. Graph measure, formula builders and tower framework are adapted from mattdorman's PR #37374, as stated in the file header. With mattdorman's unit-fraction branch R1.H1 (α = 1/q, PR #37374), this closed the root ShelahSpencerZeroOneLaw.zeroOne_rational, which Left to Solve credits to treybeathard-jpg (via the reduction R1) with contributors aliuyar1234 and mattdorman.

Author
Ali Uyar
DOI
10.5281/zenodo.24765129
Scope
Modular suite
Status
Merged on Left to Solve
Original theorem
Zero-one laws for sparse random graphs (Saharon Shelah and Joel Spencer, Journal of the American Mathematical Society 1 (1988), 97-115, DOI 10.1090/S0894-0347-1988-0924703-8); only the rational non-convergence half, branch α = p/q with p ≥ 2, via the R1 reduction.
Statement source
Left to Solve (FormalConjectures / OMA statements)
Source
github.com/aliuyar1234/lean4-landmark-formalizations/tree/main/08-shelah-spencer-zero-one-law

Machine-checked in Lean 4 ✓ Accepted and merged on Left to Solve.

Summary

Saharon Shelah and Joel Spencer (J. Amer. Math. Soc. 1, 1988) proved that G(n, n^(-α)) satisfies the first-order zero-one law for irrational α in (0, 1), while for every rational α in (0, 1) some first-order sentence has non-convergent probability. On Left to Solve, the rational half was split by treybeathard-jpg's reduction R1 into a unit-fraction branch H1 (α = 1/q) and a non-unit branch H2 (α = p/q, 2 ≤ p < q, coprime). This 12,282-line Lean 4 file (PR #63400) proves H2: definable parameterized linear orders with full subset membership whose size modulo 100 oscillates, with probability at least 3/4 along two subsequences of n. Since an ordinary path cannot balance α = p/q, the proof builds balanced rooted-path gadgets and controls them in the sparse random graph by an edge-block product measure, a bulk pool construction and exterior-failure charging, ending in the bound P[no indexed chain] ≤ 1/32. Through R1 this yields non-convergence for every such α, and together with mattdorman's proof of H1 it closed the root. Part of the code (graph measure, formula builders, tower framework) is adapted from mattdorman's PR #37374, and the line count includes it.

Context

The Shelah-Spencer theorem connects finite model theory and probabilistic combinatorics. For α = p/q with p ≥ 2, ordinary paths cannot balance the edge probability, so the proof needs balanced rooted-path gadgets and multi-scale probabilistic bounds on sparse random graphs; this file carries all of that through in Lean 4.

Root problems on Left to Solve

  • LTS ShelahSpencerZeroOneLaw.zeroOne_rational closed; credited to @treybeathard-jpg, with aliuyar1234 as contributor

Credits

Theorem: Saharon Shelah and Joel Spencer (1988). Reduction R1 splitting the root into H1/H2: treybeathard-jpg (open-math-agents PR #26924); Left to Solve credits the root solution to treybeathard-jpg with contributors aliuyar1234 and mattdorman. Unit-fraction branch R1.H1: mattdorman (PR #37374). The Lean file header states: 'Graph measure, formulas and tower adapted from @mattdorman, PR #37374 (Apache-2.0).' The PR body records no other third-party credit. Lean proof produced with the AI coding agent t3-code (model gpt-6.2-astra) operated by Ali Uyar.

Pull request ledger (1)

  • #63400 ShelahSpencerZeroOneLaw.zeroOne_rational.R1.H2 merged

Cite

@misc{uyar2026_shelah_spencer_zero_one_law_lean4,
  author    = {Uyar, Ali},
  title     = {Shelah-Spencer Non-Convergence for α = p/q with p ≥ 2 in Lean 4},
  year      = {2026},
  publisher = {Zenodo},
  doi       = {10.5281/zenodo.24765129},
  url       = {https://doi.org/10.5281/zenodo.24765129},
  note      = {Lean 4 formalization technical note (Zero-one laws for sparse random graphs (Saharon Shelah and Joel Spencer, Journal of the American Mathematical Society 1 (1988), 97-115, DOI 10.1090/S0894-0347-1988-0924703-8); only the rational non-convergence half, branch α = p/q with p ≥ 2, via the R1 reduction.). Code: https://github.com/aliuyar1234/lean4-landmark-formalizations/tree/main/08-shelah-spencer-zero-one-law}
}