Lean / Reader
Lean reader

BealCubeDescent.lean

95 lines9 declarationsno sorry
  1. import Mathlib.Tactic.Ring
  2. import Mathlib.Tactic.Linarith
  3. import Mathlib.Data.ZMod.Basic
  4. /-!
  5. # Round 8: the elementary steps of Theorem A (A³ = B⁴ + bⁿ, factorization in ℚ(√-b))
  6. Theorem A (paper on `A³ = B⁴ + bⁿ`): for squarefree `b ≥ 2` with `b ≢ 7 (mod 8)`, `3 ∤ b` and `3 ∤ h(ℚ(√-b))`, there
  7. is no solution with `gcd(B, b) = 1` for odd `n ≥ 3`. The class-group step and Darmon–Merel are cited; this file checks
  8. the algebraic identities and the congruence obstructions used in the proof.
  9. -/
  10. namespace BealCubeDescent
  11. /-- `(u + v√-b)³ = X + Y√-b` with `X = u(u² - 3bv²)`, `Y = v(3u² - bv²)`; its norm is the cube of the norm of
  12. `u + v√-b`. -/
  13. theorem cube_norm (u v b : ℤ) :
  14. (u * (u ^ 2 - 3 * b * v ^ 2)) ^ 2 + b * (v * (3 * u ^ 2 - b * v ^ 2)) ^ 2 = (u ^ 2 + b * v ^ 2) ^ 3 := by
  15. ring
  16. /-- Integral case: from `3u² - bⁿ = ε` the coordinate `X = u(u² - 3bⁿ)` equals `u(3ε - 8u²)`. -/
  17. theorem endgame_identity (u P ε : ℤ) (h : 3 * u ^ 2 - P = ε) :
  18. u * (u ^ 2 - 3 * P) = u * (3 * ε - 8 * u ^ 2) := by
  19. have hP : P = 3 * u ^ 2 - ε := by linarith
  20. subst hP
  21. ring
  22. /-- Half-integral case (`b ≡ 3 mod 8`): from `3u² - bⁿ = 8δ`, `u(u² - 3bⁿ) = 8·u(3δ - u²)`. -/
  23. theorem half_identity (u P δ : ℤ) (h : 3 * u ^ 2 - P = 8 * δ) :
  24. u * (u ^ 2 - 3 * P) = 8 * (u * (3 * δ - u ^ 2)) := by
  25. have hP : P = 3 * u ^ 2 - 8 * δ := by linarith
  26. subst hP
  27. ring
  28. /-- `8s⁴ + 3` is never a square (mod 8). -/
  29. theorem not_sq_8_plus (s t : ℤ) : t ^ 2 ≠ 8 * s ^ 4 + 3 := by
  30. intro h
  31. have h8 := congrArg (fun z : ℤ => (z : ZMod 8)) h
  32. push_cast at h8
  33. generalize (t : ZMod 8) = a at h8
  34. generalize (s : ZMod 8) = c at h8
  35. revert a c
  36. decide
  37. /-- `8s⁴ - 3` is never a square (mod 8). -/
  38. theorem not_sq_8_minus (s t : ℤ) : t ^ 2 ≠ 8 * s ^ 4 - 3 := by
  39. intro h
  40. have h8 := congrArg (fun z : ℤ => (z : ZMod 8)) h
  41. push_cast at h8
  42. generalize (t : ZMod 8) = a at h8
  43. generalize (s : ZMod 8) = c at h8
  44. revert a c
  45. decide
  46. /-- `24s⁴ - 1` is never a square (mod 3). -/
  47. theorem not_sq_24_minus (s t : ℤ) : t ^ 2 ≠ 24 * s ^ 4 - 1 := by
  48. intro h
  49. have h3 := congrArg (fun z : ℤ => (z : ZMod 3)) h
  50. push_cast at h3
  51. generalize (t : ZMod 3) = a at h3
  52. generalize (s : ZMod 3) = c at h3
  53. revert a c
  54. decide
  55. /-- `s⁴ - t² ≠ 3` (mod 8): the half-integral case with `3 ∤ w`, `δ = 1`. -/
  56. theorem not_diff_3 (s t : ℤ) : s ^ 4 - t ^ 2 ≠ 3 := by
  57. intro h
  58. have h8 := congrArg (fun z : ℤ => (z : ZMod 8)) h
  59. push_cast at h8
  60. generalize (t : ZMod 8) = a at h8
  61. generalize (s : ZMod 8) = c at h8
  62. revert a c
  63. decide
  64. /-- The two equations of the case `3 | w`, integral: `t² = 24s⁴ + 1` and `bⁿ = 27s⁴ + 1` give `(3t)² - 1 = 8bⁿ`. -/
  65. theorem three_case_identity (s t P : ℤ) (ht : t ^ 2 = 24 * s ^ 4 + 1) (hP : P = 27 * s ^ 4 + 1) :
  66. (3 * t - 1) * (3 * t + 1) = 8 * P := by
  67. subst hP
  68. have e : (3 * t - 1) * (3 * t + 1) = 9 * t ^ 2 - 1 := by ring
  69. rw [e, ht]
  70. ring
  71. /-- Half-integral, `3 | w`: `t² = 3s⁴ + 1` and `bⁿ = 27s⁴ + 8` give `(3t - 1)(3t + 1) = bⁿ`. -/
  72. theorem three_case_identity_half (s t P : ℤ) (ht : t ^ 2 = 3 * s ^ 4 + 1) (hP : P = 27 * s ^ 4 + 8) :
  73. (3 * t - 1) * (3 * t + 1) = P := by
  74. subst hP
  75. have e : (3 * t - 1) * (3 * t + 1) = 9 * t ^ 2 - 1 := by ring
  76. rw [e, ht]
  77. ring
  78. end BealCubeDescent
  79. #print axioms BealCubeDescent.not_sq_8_plus
  80. #print axioms BealCubeDescent.three_case_identity