import Mathlib.Tactic.Ringimport Mathlib.Data.ZMod.Basic/-!# Round 13: second descent on the cubics of the unit case* `disc_F`: the binary cubic `F = f u³ + 3e u²v + 3fC uv² + eC v³` has discriminant `-108·C·(e² - Cf²)²`, i.e.`-108 C` for a unit `e + f√C` of norm `±1`. With the classical formula for the Jacobian of `F(u,v) = λw³`(`y² = x³ + 16·disc(F)·λ²`), the cubics `F = ±C^{r'} w³` are 3-coverings of `E_{-27 C^r}`, `r = 2r' + 1`.* `norm_alpha`: the descent map `(x, y) ↦ y - √D` lands in elements of norm `x³`.* `root_rule`: for `C ≡ 2 (mod 3)`, the condition `φ(C^r) = -1` (`C^r ≡ 5, 7 mod 9`) of the root-number formulareads `C ≡ 2 (mod 9)` for `r = 5` and `C ≡ 5 (mod 9)` for `r = 1`.-/namespace BealSecondDescent/-- Discriminant of `a x³ + b x² y + c x y² + d y³` with `a = f`, `b = 3e`, `c = 3fC`, `d = eC`. -/theorem disc_F (e f C : ℤ) :(3 * e) ^ 2 * (3 * f * C) ^ 2 - 4 * f * (3 * f * C) ^ 3 - 4 * (3 * e) ^ 3 * (e * C)- 27 * f ^ 2 * (e * C) ^ 2 + 18 * f * (3 * e) * (3 * f * C) * (e * C)= -108 * C * (e ^ 2 - C * f ^ 2) ^ 2 := byring/-- `N(y - √D) = y² - D = x³` on `y² = x³ + D`. -/theorem norm_alpha (x y D : ℤ) (h : y ^ 2 = x ^ 3 + D) : y ^ 2 - D = x ^ 3 := byrw [h]; ring/-- The root-number condition modulo 9 for `C ≡ 2 (mod 3)`. -/theorem root_rule : ∀ C : ZMod 9, (C = 2 ∨ C = 5 ∨ C = 8) →(((C ^ 5 = 5 ∨ C ^ 5 = 7) ↔ C = 2) ∧ ((C = 5 ∨ C = 7) ↔ C = 5)) := bydecideend BealSecondDescent#print axioms BealSecondDescent.disc_F#print axioms BealSecondDescent.root_rule