Birch and Swinnerton-Dyer: certified ranks in Lean
ECCompute: Lean that certifies rank lower bounds for 480 elliptic curves, up to rank ≥ 31. Certify more, rerun it, read what 2026 claimed about BSD

Merge main into maintainer-statement
Browse filesCo-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
+1 −0 ECCompute.lean View file
| @@ -3,6 +3,7 @@ module -- shake: keep-all --deprecated_module: ignore | ||
| 3 | 3 | public import ECCompute.Certificate |
| 4 | 4 | public import ECCompute.ForLean |
| 5 | 5 | public import ECCompute.ForMathlib.ModuleTorsionQuotient |
| 6 | +public import ECCompute.ForMathlib.RankFinrankBridge | |
| 6 | 7 | public import ECCompute.ForMathlib.RatDenom |
| 7 | 8 | public import ECCompute.ForMathlib.TwoTorsion |
| 8 | 9 | public import ECCompute.ForMathlib.VariableChangePoint |
+41 −0 ECCompute/ForMathlib/RankFinrankBridge.lean added View file
| @@ -0,0 +1,41 @@ | ||
| 1 | +/- | |
| 2 | +Copyright (c) 2026 the ECCompute authors. All rights reserved. | |
| 3 | +Released under the GNU General Public License version 3.0 as described in the file LICENSE. | |
| 4 | +-/ | |
| 5 | +module | |
| 6 | + | |
| 7 | +public import ECCompute.MainTheorem | |
| 8 | + | |
| 9 | +/-! | |
| 10 | +# `HasRankGE` and `Module.finrank` | |
| 11 | + | |
| 12 | +`HasRankGE W n` says that `W(ℚ)` has a finitely generated `ℤ`-submodule of free rank at least `n`. | |
| 13 | +Other formal statements write "rank at least `n`" as `n ≤ Module.finrank ℤ W.toAffine.Point`. | |
| 14 | +This file proves the two bridges between the two forms, keeping the Mordell–Weil finiteness of | |
| 15 | +`W(ℚ)` as a hypothesis. | |
| 16 | +-/ | |
| 17 | + | |
| 18 | +namespace ECCompute | |
| 19 | + | |
| 20 | +open WeierstrassCurve Module | |
| 21 | + | |
| 22 | +/-- If `W(ℚ)` contains a finitely generated submodule of free rank at least `n`, then the | |
| 23 | +`ℤ`-rank of `W(ℚ)` is at least `n`. The finiteness of `W(ℚ)` is the Mordell–Weil theorem and is | |
| 24 | +kept as a hypothesis. -/ | |
| 25 | +public theorem le_finrank_of_hasRankGE (W : WeierstrassCurve ℚ) {n : ℕ} | |
| 26 | + (h : HasRankGE W n) (hfin : Module.Finite ℤ W.toAffine.Point) : | |
| 27 | + n ≤ Module.finrank ℤ W.toAffine.Point := by | |
| 28 | + obtain ⟨H, _, hn⟩ := h | |
| 29 | + exact hn.trans (@Submodule.finrank_le ℤ W.toAffine.Point _ _ _ _ hfin H) | |
| 30 | + | |
| 31 | +/-- If the `ℤ`-rank of `W(ℚ)` is at least `n`, then `W` has rank at least `n` in the sense of | |
| 32 | +`HasRankGE`. The finiteness of `W(ℚ)` is the Mordell–Weil theorem and is kept as a hypothesis. -/ | |
| 33 | +public theorem hasRankGE_of_le_finrank (W : WeierstrassCurve ℚ) {n : ℕ} | |
| 34 | + (hfin : Module.Finite ℤ W.toAffine.Point) | |
| 35 | + (h : n ≤ Module.finrank ℤ W.toAffine.Point) : | |
| 36 | + HasRankGE W n := by | |
| 37 | + refine ⟨⊤, ?_, ?_⟩ | |
| 38 | + · exact Module.Finite.iff_fg.mpr (Module.finite_def.mp hfin) | |
| 39 | + · simpa using h | |
| 40 | + | |
| 41 | +end ECCompute | |
+2 −0 ECCompute/Soundness/Labels.lean View file
| @@ -49,6 +49,8 @@ theorem fval_iff (hp : 1 < p) : | ||
| 49 | 49 | /-- `discrIntK a₂ a₄ a₆` equals the integer discriminant `discrInt a₂ a₄ a₆`. -/ |
| 50 | 50 | theorem discrIntK_eq : discrIntK a₂ a₄ a₆ = discrInt a₂ a₄ a₆ := by grind [discrIntK, discrInt] |
| 51 | 51 | |
| 52 | +/-- For a nonempty coefficient list, the modular evaluation step adds the residue of the | |
| 53 | +constant coefficient `c` to `r` times the tail evaluation, then reduces the sum modulo `ℓ`. -/ | |
| 52 | 54 | @[simp, grind =] theorem polyModK_cons {c : ℕ} {cs : List ℕ} {ℓ r : ℕ} : |
| 53 | 55 | polyModK (c :: cs) ℓ r = (c % ℓ + r * polyModK cs ℓ r) % ℓ := rfl |
| 54 | 56 | |
+1 −0 KNOWN.md View file
| @@ -15,6 +15,7 @@ What is established about this problem, one fact a line, each with where it come | ||
| 15 | 15 | |
| 16 | 16 | ## Mind |
| 17 | 17 | |
| 18 | +- `build` and `challenge` report success with "Nothing to check yet" on both solution routes' heads, which hold no lakefile.toml or Lean file, so their success says nothing about the route's content while `rank` scored 2389 and 3 there (commit 2c9b66e, commit 15cf201). | |
| 18 | 19 | - The starting point is b-mehta/EllipticCurveRank at 9cb92e9a7ddf28666d89cb221a89fb35de75b4d3 (2026-11-27): 511 Lean files, about 26,000 lines (31 files of theory and tactic, 480 curve files), 960 data files, on Lean v4.36.0 with Mathlib fc4f59e5 (tag v4.36.0). Licence GPL-3.0. |
| 19 | 20 | - The Comparator challenge (`Statement.lean`, `Challenge.lean`, `Solution.lean`, `PrintAxioms.lean`, `comparator.json`) and the three `lean_lib`s in `lakefile.toml` are this project's, not upstream's. `Statement.lean` copies `ECCompute.HasRankGE` and the 480 curve literals; `Solution.lean` proves each `EllipticRank.curveNNN_hasRankGE_k` as `ECCompute.curveNNN_hasRankGE_k`, which typechecks because the terms are the same. |
| 20 | 21 | - 2026-12-01, with the pins above on a 256-core machine: `lake build ECCompute Curves` 1 min 38 s after the Mathlib cache (101 CPU-minutes), no warnings; `lake build`, `lake build Challenge` (480 sorry warnings, by design) and `lake env lean PrintAxioms.lean` pass, and all 480 theorems depend on `propext`, `Classical.choice` and `Quot.sound` only. Comparator was not run there (no `bwrap`); the `build` check is the first to run it. |
+14 −0 routes/trial-ben-codex-docstrings/README.md added View file
| @@ -0,0 +1,14 @@ | ||
| 1 | +--- | |
| 2 | +issue: 15 | |
| 3 | +status: done | |
| 4 | +--- | |
| 5 | + | |
| 6 | +# Checker docstrings | |
| 7 | + | |
| 8 | +This route covers Labels.lean, one of the six files listed in P-1. | |
| 9 | + | |
| 10 | +## Next | |
| 11 | + | |
| 12 | +Review the docstring for `polyModK_cons`. To reproduce the local check, run | |
| 13 | +`python3 checks/challenge.py .` from the repository root. The local challenge passed. | |
| 14 | +Shoal runs the Lean build and Comparator checks. | |
+31 −0 routes/trial-cai-claude-s13-bridge/README.md added View file
| @@ -0,0 +1,31 @@ | ||
| 1 | +--- | |
| 2 | +issue: 33 | |
| 3 | +status: working | |
| 4 | +--- | |
| 5 | +# trial-cai-claude-s13-bridge | |
| 6 | + | |
| 7 | +S-13: `HasRankGE` against `Module.finrank`: prove the two bridges. | |
| 8 | + | |
| 9 | +## What I change | |
| 10 | + | |
| 11 | +- New file `ECCompute/ForMathlib/RankFinrankBridge.lean` with the two directions: | |
| 12 | + - `le_finrank_of_hasRankGE`: `HasRankGE W n` (plus `Module.Finite ℤ W.toAffine.Point` | |
| 13 | + supplied to `Submodule.finrank_le`) gives `n ≤ Module.finrank ℤ W.toAffine.Point`. | |
| 14 | + - `hasRankGE_of_le_finrank`: `Module.Finite ℤ W.toAffine.Point` and | |
| 15 | + `n ≤ Module.finrank ℤ W.toAffine.Point` give `HasRankGE W n`, by taking `⊤`. | |
| 16 | +- `ECCompute.lean` imports the new module so `lake build ECCompute` compiles it. | |
| 17 | + | |
| 18 | +Both keep `Module.Finite ℤ W.toAffine.Point` as a hypothesis: that is the Mordell–Weil theorem, | |
| 19 | +which Mathlib does not have. | |
| 20 | + | |
| 21 | +## Test-first record | |
| 22 | + | |
| 23 | +- First push (`3938702`) stated both theorems with `sorry`; the site's `challenge` check returned | |
| 24 | + `FAILED: ECCompute/ForMathlib/RankFinrankBridge.lean:28 uses sorry`, as expected for a stub. | |
| 25 | +- Then the proofs were filled in; locally `lake build ECCompute.ForMathlib.RankFinrankBridge` and | |
| 26 | + `lake build ECCompute` pass with no warnings, and `python3 checks/challenge.py .` ends with | |
| 27 | + `ok: 4 challenge files and the build configuration as approved; 516 Lean files, …`. | |
| 28 | + | |
| 29 | +## Next | |
| 30 | + | |
| 31 | +Read the two verdicts on the final commit and open the pull request. | |