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

| 1 | # What upstream says |
| 2 | |
| 3 | This project starts from [b-mehta/EllipticCurveRank](https://github.com/b-mehta/EllipticCurveRank) at `9cb92e9a7ddf28666d89cb221a89fb35de75b4d3` (2026-11-27). Its README at that commit follows, unchanged, with its headings two levels down; `README.md` here is this project's. Upstream has no AGENTS.md. |
| 4 | |
| 5 | ## README.md |
| 6 | |
| 7 | ### ECCompute |
| 8 | |
| 9 | Certified lower bounds on the Mordell-Weil rank of elliptic curves over `ℚ`, in Lean 4 on top of |
| 10 | mathlib. |
| 11 | |
| 12 | For a Weierstrass curve `E/ℚ` and an integer `ρ`, ECCompute produces a term of `HasRankGE E ρ`: |
| 13 | `E(ℚ)` contains a finitely generated subgroup of rank at least `ρ`. Every check reduces in the Lean |
| 14 | kernel via `Lean.reflBoolTrue`. |
| 15 | |
| 16 | The headline result is |
| 17 | [curve 302](https://elliptic-rank.icarm.cloud/curve/302) of the ICARM Elliptic Curve Rank |
| 18 | Leaderboard, at rank at least `31` (the curve's attribution is on the linked page): |
| 19 | |
| 20 | ```lean |
| 21 | def curve302 : WeierstrassCurve ℚ := |
| 22 | ⟨1, 1, 1, -1284727764113567728281797636015784768866707681415849262157224232063, |
| 23 | 560368321454261339256859338901915312332769858684945406858043869199456710681989058863306170127006181⟩ |
| 24 | |
| 25 | theorem curve302_hasRankGE_31 : HasRankGE curve302 31 := by |
| 26 | unfold curve302 |
| 27 | certify_curve torsion 31 "data/curve302.txt" "data/curve302-labels.txt" |
| 28 | ``` |
| 29 | |
| 30 | The points and labels are read from `data/`. |
| 31 | |
| 32 | #### How it works |
| 33 | |
| 34 | `HasRankGE E ρ` says the Mordell-Weil group `E(ℚ)` contains a finitely generated `ℤ`-submodule of |
| 35 | free rank at least `ρ`. The rank of a subgroup bounds the rank of the whole group, so this is |
| 36 | exactly `rank E(ℚ) ≥ ρ`. Phrasing the bound through a subgroup means a proof needs only `ρ` |
| 37 | explicit independent points, not the theorem that `E(ℚ)` is itself finitely generated (Mordell-Weil), |
| 38 | which mathlib does not have. |
| 39 | |
| 40 | To exhibit such a subgroup we take `ρ` points from the leaderboard and show they are independent. |
| 41 | The tool for this is a descent map, due to Cremona. Fix a prime `p` and a root `θ` of the curve's |
| 42 | cubic modulo `p`. Sending a point `P = (x, y)` to `0` when `x − θ` is a square modulo `p`, and to |
| 43 | `1` when it is not, defines a group homomorphism `E(ℚ) → 𝔽₂`. Several choices of `(p, θ)` combine |
| 44 | into one homomorphism `E(ℚ) → 𝔽₂^k`. Points whose images are linearly independent are themselves |
| 45 | independent, so the rank is at least `ρ` (minus a small 2-torsion correction). Independence of the |
| 46 | `ρ` image vectors comes down to inverting one matrix over `𝔽₂`. |
| 47 | |
| 48 | A certificate is that precomputed data: the points, the matrix and its inverse, and the torsion |
| 49 | bound. `certify_curve` rechecks it inside the Lean kernel, so nothing outside Lean's core is |
| 50 | trusted. |
| 51 | |
| 52 | #### Layout |
| 53 | |
| 54 | * `ECCompute/Theory/` - the descent character and the rank-bound argument. |
| 55 | * `ECCompute/Soundness/` - the `Bool`-valued checkers the kernel reduces (matrix inverse over `𝔽₂`, |
| 56 | primality, 2-torsion, points on the curve). |
| 57 | * `ECCompute/Kernel.lean` - the raw kernel-reducible `Bool` folds the checkers run on. |
| 58 | * `ECCompute/Certificate.lean`, `ECCompute/MainTheorem.lean`, `ECCompute/Tactic/` - the certificate |
| 59 | type, the assembled rank bound `hasRankGE_of_certificate`, and the `certify_curve` tactic. |
| 60 | * `ForMathlib/` - lemmas destined upstream (2-torsion, `padicValInt`, rational denominators). |
| 61 | * `data/` - the points and labels each certificate reads. |
| 62 | |
| 63 | The certified curves live in a separate `Curves` library, so building the core theory does not |
| 64 | recompile them: |
| 65 | |
| 66 | * `Curves/` - certified curves, named by their id on the |
| 67 | [ICARM Elliptic Curve Rank Leaderboard](https://elliptic-rank.icarm.cloud/): high-rank curves |
| 68 | spanning rank `20` to `31` (Nagao, Fermigier, Martin-McMillen, Elkies, Elkies-Klagsbrun, and |
| 69 | curve `302` at rank `31`). |
| 70 | |
| 71 | #### Building |
| 72 | |
| 73 | The project uses a pinned mathlib. After cloning, fetch the cache once, then build the core theory: |
| 74 | |
| 75 | ``` |
| 76 | lake exe cache get |
| 77 | lake build |
| 78 | ``` |
| 79 | |
| 80 | `lake build` compiles the theory and the `certify_curve` tactic. The certified curves are their own |
| 81 | library; build them with |
| 82 | |
| 83 | ``` |
| 84 | lake build Curves |
| 85 | ``` |
| 86 | |
| 87 | #### Acknowledgements |
| 88 | |
| 89 | The descent method is Section 2 of J. E. Cremona, *On the computation of Mordell-Weil and 2-Selmer |
| 90 | groups of elliptic curves*, [filter.pdf](https://johncremona.github.io/papers/filter.pdf). |
| 91 | |
| 92 | Much of this work was done at the [Lean for the LMFDB](https://multramate.github.io/lean-lmfdb/) |
| 93 | workshop, funded by [Scalable Theorem Proving via Mathematical Databases](https://www.renaissancephilanthropy.org/scalable-theorem-proving) |
| 94 | through the AI for Math Fund (Renaissance Philanthropy, founding donor XTX Markets). |