Lean / Reader
Lean reader

BealThueReduction.lean

39 lines4 declarationsno sorryimports Mathlib.Tactic.Ring
  1. import Mathlib.Tactic.Ring
  2. /-!
  3. # Round 12: the unit case as a cubic Thue–Mahler equation
  4. Elements `a + b√d` are pairs `(a, b)` with `(a, b)(a', b') = (aa' + dbb', ab' + a'b)`. For `δ = e + f√d` and
  5. `γ = u + v√d`, the `√d`-coefficient of `δγ³` is the binary cubic form
  6. `F(u, v) = f u³ + 3e u²v + 3fd uv² + ed v³`, and the rational part is `e u³ + 3fd u²v + 3ed uv² + fd² v³`.
  7. -/
  8. namespace BealThueReduction
  9. /-- Multiplication in `ℤ[√d]` on pairs. -/
  10. def mul (d : ℤ) (x y : ℤ × ℤ) : ℤ × ℤ := (x.1 * y.1 + d * x.2 * y.2, x.1 * y.2 + x.2 * y.1)
  11. /-- The coordinates of `(e + f√d)(u + v√d)³`. -/
  12. theorem unit_times_cube (d e f u v : ℤ) :
  13. mul d (e, f) (mul d (u, v) (mul d (u, v) (u, v))) =
  14. (e * u ^ 3 + 3 * f * d * u ^ 2 * v + 3 * e * d * u * v ^ 2 + f * d ^ 2 * v ^ 3,
  15. f * u ^ 3 + 3 * e * u ^ 2 * v + 3 * f * d * u * v ^ 2 + e * d * v ^ 3) := by
  16. simp only [mul, Prod.mk.injEq]
  17. constructor <;> ring
  18. /-- The cube itself (`δ = 1`): `(u + v√d)³ = (u³ + 3duv², 3u²v + dv³)`. -/
  19. theorem cube (d u v : ℤ) :
  20. mul d (u, v) (mul d (u, v) (u, v)) = (u ^ 3 + 3 * d * u * v ^ 2, 3 * u ^ 2 * v + d * v ^ 3) := by
  21. simp only [mul, Prod.mk.injEq]
  22. constructor <;> ring
  23. /-- The norm is multiplicative on pairs: `N(xy) = N(x)N(y)` with `N(a, b) = a² - db²`. -/
  24. theorem norm_mul (d : ℤ) (x y : ℤ × ℤ) :
  25. (mul d x y).1 ^ 2 - d * (mul d x y).2 ^ 2 = (x.1 ^ 2 - d * x.2 ^ 2) * (y.1 ^ 2 - d * y.2 ^ 2) := by
  26. simp only [mul]
  27. ring
  28. end BealThueReduction
  29. #print axioms BealThueReduction.unit_times_cube