The Lean verification bundle — machine-checked claims
Every claim in the Principia articles carrying the Lean label is machine-checked in Lean 4 + mathlib. The complete sources are distributed here — the bundle, how to check it, the ledger of theorems, and the bundles in preparation.
Related: Taking stock of novelty (the sorting of results) / What remains / certificates for k=4 / certificates for Lovász
The bundle
| File | shioriproofs-src.tar.gz (about 147 KB) |
| sha256 | f553b6d0d0f93eaaa3c3842e5a3588d29e5187d4c2624cb13fdc28c70780d444 |
| Contents | 74 files of Shioriproofs/*.lean (8,826 lines in total), plus the entry point of the check including ChkAll.lean, lakefile.toml, lake-manifest.json (dependencies pinned), lean-toolchain, verify.sh (decides the degree of parallelism from the machine's RAM and runs the whole check in one command), and a README |
| Environment | Lean 4 (leanprover/lean4:v4.33.1) plus mathlib. Versions are pinned by the manifest. 8 GB of RAM or more is recommended (some of the proofs shut a computation of over 3 GB into the kernel in a single file) |
| Scope | Erdős #169 for k=3 (28 theorems) and Collatz (7). The 19 files for k=4 are in a separate store, distributed as a complete environment that contains this bundle. The other bundles are in preparation |
The contents and sha256 of this bundle are fixed. New theorems are distributed as separate bundles (§04).
How to check it
tar -xzf shioriproofs-src.tar.gz cd shioriproofs ./verify.sh
verify.sh decides the degree of parallelism from the machine's RAM and CPU count, runs lake exe cache get (mathlib's prebuilt cache) and lake build Shioriproofs.ChkAll, retries the same command if it falls over (up to 6 times), and finally summarises the axiom output and the counts of sorryAx and Lean.ofReduceBool. By hand, it comes to the same as this:
# parallelism: 1 for 3 GB of RAM, 4–6 for 16 GB lake exe cache get LEAN_NUM_THREADS=1 lake build Shioriproofs.ChkAll
ChkAll.lean is nothing but a list of #print axioms for the 27 headline theorems. Building it prints the axioms each theorem depends on. [propext, Classical.choice, Quot.sound] are the three standard axioms of Lean / mathlib, and neither sorryAx (an unproved hole) nor Lean.ofReduceBool (native_decide) appears for any of the 27.
Why the parallelism is limited. A single proof uses up to 1.5–2 GB of memory. Lake's default builds as many files at once as there are CPUs, so on a 3 GB machine four at once fall into swap and neither fail nor progress. Lake 5 has no -j, so LEAN_NUM_THREADS is used instead. Lake resumes from where it left off.
The ledger — what is in the bundle
The full name of each theorem (with namespace) and the file and line where its proof is written. An empty axiom column means the three standard axioms.
Erdős problem #169 (28 theorems, 20 of them headline)
| Theorem | Location | Axioms |
|---|---|---|
Shiori845.erdos169_lower_record | Erdos845.lean:79 | |
Shiori845.erdos169_lower_sharp | Erdos845.lean:87 | |
Shiori844.setA_apfree_and_beats_record | Erdos844.lean:270 | |
Shiori844.setA_apfree | Erdos844.lean:256 | |
Shiori730.lemma1_nonaveraging | Erdos730.lean:203 | |
Shiori844.Blk_apfree | Erdos844a.lean:152 | |
Shiori712.apfree_iUnion_of_separated | Erdos712.lean:45 | |
Shiori774.all_steps_maxelt | Erdos774.lean:533 | |
Shiori793.chain_verified | Erdos793.lean:163 | none (kernel computation only) |
Shiori793.all_steps_separated | Erdos793.lean:191 | |
Shiori800.Z0_apfree | Erdos800.lean:305 | |
Shiori838.setA_lower | Erdos838.lean:160 | |
| 110 levels (rate criterion), 84 levels (window-separated Bellman), reinforcement of the 100 levels | ||
Shiori1105.setA110_apfree_and_beats_record | Erdos1105y.lean:62 | |
Shiori1105.setA110_lower | Erdos1105z.lean:72 | |
Shiori1105.wins110_from_steps | Erdos1105z.lean:128 | none (kernel computation only) |
Shiori959.erdos169_lower_record_939 | Erdos959.lean:93 | |
Shiori959.setA939_apfree_and_lower | Erdos959.lean:80 | |
Shiori939.setA939_lower | Erdos939.lean:66 | |
Shiori1106.wins100_from_steps | Erdos1106.lean:64 | none (kernel computation only) |
Shiori1106.t_agree100 | Erdos1106.lean:53 | none (kernel computation only) |
Shiori814.record_3_00849 | Erdos815d.lean:28 | |
Shiori707.apfree_iUnion_of_label | Erdos707.lean:38 | propext, Quot.sound |
Shiori707.apfree_mixed_ratio | Erdos707.lean:99 | |
Shiori861.step_M1_apfree_blk | Erdos861.lean:41 | |
Shiori861.step_M2_apfree_blk | Erdos861.lean:50 | |
Shiori861.step_M3_apfree_blk | Erdos861.lean:58 | |
Shiori862.le_hiJ | Erdos862.lean:64 | |
Shiori862.totHiD_le | Erdos862.lean:110 | |
Two names do not match their file names — Shiori844.Blk_apfree is in Erdos844a.lean and Shiori814.record_3_00849 in Erdos815d.lean. Erdos834c.lean also holds a primed theorem record_3_00849'; ChkAll looks at the unprimed one. Part of the 110-level lower bound (Erdos1105c) peaks at 9.34 GiB RSS and will not build on a 3 GB machine. The lower bound inside Lean for the 84 levels is 3.0085385 (not the Python bracket 3.008538522178).
The Collatz conjecture (7 theorems)
| Theorem | Location | Axioms |
|---|---|---|
Shiori.qcrit_not_int_of_three_le | QCrit.lean:44 | |
Shiori.qcrit_eq_three | QCrit.lean:41 | propext only |
Shiori737.min_over_six_classes | Collatz737.lean:99 | |
Shiori737.m4_ge_three_halves_m7 | Collatz737.lean:89 | |
Shiori716.necessary_rate | Collatz716.lean:187 | |
Shiori702.syracuse_sign_conjugation | Collatz702.lean:141 | propext, Quot.sound |
Shiori751.c_three_pattern_fails | Collatz751.lean:187 |
Bundles in preparation — theorem names and axiom status
Theorems machine-checked outside the bundle of §01. Each group is being prepared for distribution in a store of its own — the URL and sha256 will be written here when it is placed. The count under "axiom output" is the number of declarations that the group's Chk*.lean lists with #print axioms; all of them use at most the three standard axioms, with no sorryAx and no Lean.ofReduceBool. Only groups whose axiom output is at hand are listed with a count; the others are marked "not yet on file".
| Bundle | Main theorems and statements | Files | Axiom output | Distribution |
|---|---|---|---|---|
| #169, k=4 | Shiori1112.setA4_apfree_and_beats_walker — a 4-AP-free set with reciprocal sum above 4.439753369254541 / Shiori1109.lemma2_four, core_strong — the nesting lemma for k-AP-free sets | Erdos1109, Erdos1112{c,h,k,k1,k2,k3,kd,p,t0..t4,w,y,z}, Chk1109, Chk1112 | 15 and 15 | distributed (shioriproofs-k4-src.tar.gz) |
| Cubic bipartite graphs with deficiency 2 | Shiori1161.G30_def2, Shiori1193.G30b_def2, G30c_def2 — 30 vertices, cubic, bipartite, connected, with a cycle of length 28, no cycle longer than 28, not Hamiltonian (three classes) / Shiori1193.G20_def6 — 20 vertices, cubic, bipartite, connected, circumference 14, not Hamiltonian | Erdos1161{a..e}, Erdos1193{a..j}, Chk1161, Chk1193 | 14 and 20 | in preparation |
| Hamiltonian cycles of GP(n,3) | Shiori1202.gp3_dvd_hc_odd — for odd n ≥ 7, n ∣ #HC(GP(n,3)) (no hypothesis) / Shiori1168.GP{7,9,11,13,15}_hc_card — #HC = 7, 9, 11, 26, 75 / Shiori1173.GP{n}_dvd_rot — n ∣ #HC from the free action of the rotation (n = 7–15) / parts: Shiori1195.* (rotation, quotient, winding numbers, sign of a permutation), Shiori1197.* (block structure, covering), Shiori1199.* (the counting framework, conditional main theorem), Shiori1202.* (local structure of darts, descent, first-return map) | Erdos1168{a..n,z}, Erdos1173{a..f}, Erdos1195{a..f}, Erdos1197{a..f}, Erdos1199{a..e}, Erdos1202{a..m}, Chk1168–Chk1202 | 21, 24, 41, 42, 30, 30 | in preparation |
| Hadwiger–Nelson | Shiori1183.fGe_10_3, fGe_14_4 — a unit-distance graph on 10 vertices with independence number ≤ 3, and one on 14 with ≤ 4 / Shiori1192.hn_lower_family — f(2k) ≥ 7k, f(2k+1) ≥ 7k+3 / Shiori1178.hn11_no_realiz — the 117 candidates on 11 vertices are not realisable in the plane / Shiori1185.hn16_no_realiz — the 2,100 candidates on 16 vertices are not realisable / Shiori1189.hn10_no_realiz, hn10_no_realiz2 — the 296 + 103 ten-vertex subgraphs are not realisable | Erdos1178{a..m,z}, Erdos1183{a,b,c,z}, Erdos1185{a,b,c00..c15,m,p,x,z}, Erdos1189{a,c00..c09,m,x00..x04,y,z}, Erdos1192{a,b,z}, Chk1178–Chk1192 | 26, 23, 27, 22, 31 | in preparation |
| Collatz, the sign of 1/3 | Collatz1139.no_three_consecutive_descents — in the model ek+1 − ek = vk+1 − gk (v ≥ 1), three consecutive descents never occur / asymmetry_negative — (3·log₂3 − 5)/4 < 0 / three_cA_lt_five — 3·log₂3 < 5 | Collatz1139 | not yet on file | in preparation |
Notes for a third-party build (bundles in preparation). These have been built only on the machine where the proofs were written (15 GiB of RAM). Build one file at a time (building a Chk* in one go lets lake run the heavy files in parallel, which falls over even with 15 GB). Peak RSS is about 11.8 GiB (the GP(n,3) counts), about 10 GiB for the def = 2 group, and about 6.7 GB for the general-n group of GP(n,3). Allow 12 GB of RAM or more. The certificates are "the shape of a tree and integer bounds only"; the boxes are computed by Lean.
Record of re-runs
For the bundle of §01, a writer other than the one who wrote the proofs ran lake build Shioriproofs.ChkAll on the same sources and confirmed:
- the build completed with 0 errors (3,036 jobs)
- the axiom output of all 27 theorems matches the ledger above
- 0 occurrences of
sorryAx, 0 ofLean.ofReduceBool(nonative_decide)
The bundle itself (the tar.gz) was also run from scratch by the official procedure (./verify.sh) on a separate machine with 3 GB of RAM, 2 cores and 4 threads, and completed — the 31 modules ChkAll depends on built with 0 errors and 0 out-of-memory events in 9 hours 13 minutes, and the axiom output of the 27 headline theorems matches the ledger. The slow parts are specific modules that shut a 5–6 GB computation into the kernel with decide, each taking 2–3 hours. This is the basis for recommending 8 GB or more. A subsequent ./verify.sh --all built the remaining modules that ChkAll does not depend on, confirming that every module of the bundle produces its olean (a little over 13 hours in all from scratch).
These are re-runs on a single machine, not a replication across hardware. Replication in another environment is exactly what this distribution is for — if your results differ, please say so via Contact.
One failure on the side of checking also turned up while preparing this distribution. The axiom list was at first counted by the string "depends on axioms", giving 26 theorems. There are 27 — Shiori793.chain_verified alone uses no axioms at all, and its output is the different phrase "does not depend on any axioms", so it slipped through the counting check. The strongest theorem of all was invisible to a check that counts axioms. When you write a check, try to fool it.
What is machine-checked, and what is not
| Claim | Inside Lean | Outside Lean |
|---|---|---|
| #169, the record 3.0085385 for k=3 | That the set is 3-AP-free with reciprocal sum above 3.0085385, and that this exceeds the 1984 record 3.00849 (one theorem) | The reading of "3.00849" in the 1984 paper (truncated or rounded; for which set) |
| #169, the record 4.4397535 for k=4 | That the set is 4-AP-free with reciprocal sum above 4.439753369254541 | The value of the reciprocal sum of Walker's set itself (exact integer arithmetic in Python, width 10⁻³²); that the head equals the truncation (only the subset and the lower bound) |
| Cubic bipartite graphs with deficiency 2 | That the three graphs on 30 vertices and the one on 20 are graphs of the stated kind | Minimality (none on ≤ 28, none on ≤ 18), "exactly three classes", uniqueness on 20 — exhaustive enumeration (computation) |
| Divisibility for GP(n,3) | n ∣ #HC for every odd n ≥ 7; the values for n = 7–15 | Nothing (the values 102 and 152 for n = 17, 19 are computation only and are not needed for the theorem) |
| Hadwiger–Nelson, f(3) = 10 and f(4) ∈ {14,15} | The witnesses for the lower bounds; the non-realisability of the 117 / 2,100 / 296 + 103 candidates | That the enumeration of candidates is exhaustive; the isomorphism tests; the derivation of the minimum degree (computation) |
| Collatz, the sign of 1/3 | The inequality 3·log₂3 < 5 and the forbidden word and sign that follow from it (axiom output not yet on file) | The premises of the model (v follows the Terras distribution and is independent of g) — known ingredients and measurement |
A machine check guarantees that the conclusion follows from the proposition as written. Whether the proposition says what was intended, and whether it is new, the machine does not say. That sorting is in Taking stock of novelty.