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 | /- |
| 2 | Copyright (c) 2026 Bhavik Mehta. All rights reserved. |
| 3 | Released under the GNU General Public License version 3.0 as described in the file LICENSE. |
| 4 | Authors: Bhavik Mehta |
| 5 | -/ |
| 6 | module |
| 7 | |
| 8 | public import ECCompute.Theory.Model |
| 9 | public import ECCompute.Soundness.Fold |
| 10 | |
| 11 | /-! |
| 12 | # Soundness of the point-on-curve check |
| 13 | |
| 14 | `checkPoint_iff` and `checkPoints_iff` show that the kernel checks |
| 15 | `ECCompute.checkPoint` and `ECCompute.checkPoints` (from `Kernel`) hold exactly when the |
| 16 | point, respectively every point in a list, satisfies the affine Weierstrass equation of the short |
| 17 | model `curveQ a₂ a₄ a₆`. |
| 18 | -/ |
| 19 | |
| 20 | namespace ECCompute |
| 21 | |
| 22 | open WeierstrassCurve |
| 23 | |
| 24 | variable {a₂ a₄ a₆ : ℤ} |
| 25 | |
| 26 | /-- `checkPoint a₂ a₄ a₆ x y` holds iff `(x, y)` satisfies the affine Weierstrass equation of |
| 27 | the short model `curveQ a₂ a₄ a₆`. -/ |
| 28 | theorem checkPoint_iff {x y : ℚ} : |
| 29 | checkPoint a₂ a₄ a₆ x y ↔ (curveQ a₂ a₄ a₆).toAffine.Equation x y := by |
| 30 | have hD : (x.den : ℚ) ^ 3 * (y.den : ℚ) ^ 2 ≠ 0 := by positivity |
| 31 | simp only [checkPoint, Int.beq'_eq, ← Int.cast_inj (α := ℚ), Int.mul_def, Int.cast_mul, |
| 32 | Int.add_def, Int.cast_add, baseChange, curve, Affine.equation_iff] |
| 33 | grind [Rat.mul_den_eq_num, Int.cast_natCast, map_a₁, map_a₂, map_a₃, map_a₄, map_a₆, eq_intCast] |
| 34 | |
| 35 | /-- `checkPoints` holds iff every listed point satisfies the short-model equation. -/ |
| 36 | public theorem checkPoints_iff {pts : List (ℚ × ℚ)} : |
| 37 | checkPoints a₂ a₄ a₆ pts ↔ ∀ p ∈ pts, (curveQ a₂ a₄ a₆).toAffine.Equation p.1 p.2 := by |
| 38 | grind [checkPoints, checkPoint_iff] |
| 39 | |
| 40 | end ECCompute |