Hodge conjecture: the CM case in Lean, read and discussed
OpenAI's Lean proof of the Hodge conjecture for CM abelian varieties: rerun it, read its statement, and keep the open questions with their sources. The conjecture is open

| 1 | import OAI.AlgebraicGeometry.AbelianModuli.ReferenceFamily.QuaternionNormSymmetry |
| 2 | |
| 3 | /-! # Quaternion Norm Universality -/ |
| 4 | |
| 5 | namespace OAI.AlgebraicGeometry.AbelianModuli.ReferenceFamily.QuaternionNormUniversality.PositiveQuaternionNorm |
| 6 | |
| 7 | noncomputable section |
| 8 | |
| 9 | /-! Every positive rational is represented by `1, 1, d, d` when `d` is |
| 10 | positive. The proof descends on the sum of two positive integers, using |
| 11 | norm symmetry, a bounded two-square congruence, and norm multiplication. |
| 12 | The final step clears rational denominators by squares. -/ |
| 13 | |
| 14 | private theorem small_prime_multiple (d p : ℕ) (hd : 0 < d) |
| 15 | (hp : p.Prime) (hp2 : p ≠ 2) (hdp : d ≤ p) : |
| 16 | ∃ x y m : ℕ, 0 < m ∧ m < p ∧ x^2 + y^2 + d = m * p := by |
| 17 | let : Fact p.Prime := ⟨hp⟩ |
| 18 | obtain ⟨x, y, hx, hy, hxy⟩ := Nat.sq_add_sq_zmodEq p (-(d : ℤ)) |
| 19 | obtain ⟨m, hm⟩ := Int.modEq_iff_dvd.mp hxy.symm |
| 20 | rw [sub_neg_eq_add, mul_comm] at hm |
| 21 | have hm0 : 0 < m := by |
| 22 | apply pos_of_mul_pos_left (b := (p : ℤ)) |
| 23 | · rw [← hm] |
| 24 | have hd' : (0 : ℤ) < d := by exact_mod_cast hd |
| 25 | positivity |
| 26 | · exact Nat.cast_nonneg p |
| 27 | lift m to ℕ using hm0.le |
| 28 | have hmeq : x^2 + y^2 + d = m * p := by exact_mod_cast hm |
| 29 | have hp3 : 3 ≤ p := by have := hp.two_le; omega |
| 30 | have hx2 : 2 * x ≤ p := (Nat.mul_le_mul_left 2 hx).trans (Nat.mul_div_le p 2) |
| 31 | have hy2 : 2 * y ≤ p := (Nat.mul_le_mul_left 2 hy).trans (Nat.mul_div_le p 2) |
| 32 | have hxx := Nat.pow_le_pow_left hx2 2 |
| 33 | have hyy := Nat.pow_le_pow_left hy2 2 |
| 34 | refine ⟨x, y, m, by exact_mod_cast hm0, ?_, hmeq⟩ |
| 35 | by_contra hmp |
| 36 | have hp_le_m : p ≤ m := Nat.le_of_not_gt hmp |
| 37 | have hprod := Nat.mul_le_mul_right p hp_le_m |
| 38 | have hp_square := Nat.mul_le_mul_right p hp3 |
| 39 | nlinarith |
| 40 | |
| 41 | private theorem ordered_nat_represents (d a : ℕ) (hd : 0 < d) (ha : 0 < a) |
| 42 | (hda : d ≤ a) |
| 43 | (hsmall : ∀ d' a' : ℕ, d' + a' < d + a → 0 < d' → 0 < a' → |
| 44 | QuaternionNormSymmetry.PositiveQuaternionNorm.Represents (d' : ℚ) (a' : ℚ)) : QuaternionNormSymmetry.PositiveQuaternionNorm.Represents (d : ℚ) (a : ℚ) := by |
| 45 | by_cases ha1 : a = 1 |
| 46 | · subst a |
| 47 | simpa using QuaternionNormSymmetry.PositiveQuaternionNorm.represents_one (d : ℚ) |
| 48 | by_cases hp : a.Prime |
| 49 | · by_cases ha2 : a = 2 |
| 50 | · subst a |
| 51 | simpa using QuaternionNormSymmetry.PositiveQuaternionNorm.represents_two (d : ℚ) |
| 52 | obtain ⟨x, y, m, hm0, hma, hmeq⟩ := small_prime_multiple d a hd hp ha2 hda |
| 53 | have hm := hsmall d m (by omega) hd hm0 |
| 54 | have hmne : (m : ℚ) ≠ 0 := by exact_mod_cast hm0.ne' |
| 55 | have hmaRep : QuaternionNormSymmetry.PositiveQuaternionNorm.Represents (d : ℚ) ((m : ℚ) * a) := by |
| 56 | refine ⟨(((x : ℚ), (y : ℚ)), (1, 0)), ?_⟩ |
| 57 | simp only [QuaternionNormSymmetry.PositiveQuaternionNorm.form_apply, one_pow, zero_pow (by decide : 2 ≠ 0), add_zero, mul_one] |
| 58 | exact_mod_cast hmeq |
| 59 | have hquot := hmaRep.div hm hmne |
| 60 | simpa only [mul_div_cancel_left₀ _ hmne] using hquot |
| 61 | · obtain ⟨u, v, hua, hva, huv⟩ := |
| 62 | (Nat.not_prime_iff_exists_mul_eq (by omega : 2 ≤ a)).mp hp |
| 63 | have hpos : 0 < u * v := by rw [huv]; exact ha |
| 64 | have hu0 : 0 < u := Nat.pos_of_ne_zero (fun hz => by simp [hz] at hpos) |
| 65 | have hv0 : 0 < v := Nat.pos_of_ne_zero (fun hz => by simp [hz] at hpos) |
| 66 | have hu := hsmall d u (by omega) hd hu0 |
| 67 | have hv := hsmall d v (by omega) hd hv0 |
| 68 | simpa only [← Nat.cast_mul, huv] using hu.mul hv |
| 69 | |
| 70 | private theorem nat_represents_aux (n : ℕ) : |
| 71 | ∀ d a : ℕ, d + a = n → 0 < d → 0 < a → QuaternionNormSymmetry.PositiveQuaternionNorm.Represents (d : ℚ) (a : ℚ) := by |
| 72 | induction n using Nat.strong_induction_on with |
| 73 | | h n ih => |
| 74 | intro d a hn hd ha |
| 75 | have hs (d' a' : ℕ) (hlt : d' + a' < d + a) (hd' : 0 < d') (ha' : 0 < a') : |
| 76 | QuaternionNormSymmetry.PositiveQuaternionNorm.Represents (d' : ℚ) (a' : ℚ) := |
| 77 | ih (d' + a') (by omega) d' a' rfl hd' ha' |
| 78 | rcases le_total d a with hda | had |
| 79 | · exact ordered_nat_represents d a hd ha hda hs |
| 80 | · apply (QuaternionNormSymmetry.PositiveQuaternionNorm.represents_swap (by exact_mod_cast hd) (by exact_mod_cast ha)).mpr |
| 81 | apply ordered_nat_represents a d ha hd had |
| 82 | intro d' a' hlt hd' ha' |
| 83 | exact hs d' a' (by omega) hd' ha' |
| 84 | |
| 85 | theorem nat_represents (d a : ℕ) (hd : 0 < d) (ha : 0 < a) : |
| 86 | QuaternionNormSymmetry.PositiveQuaternionNorm.Represents (d : ℚ) (a : ℚ) := nat_represents_aux (d + a) d a rfl hd ha |
| 87 | |
| 88 | private theorem positive_integer_square_multiple (a : ℚ) (ha : 0 < a) : |
| 89 | ∃ n : ℕ, ∃ c : ℚ, 0 < n ∧ 0 < c ∧ (n : ℚ) = a * c^2 := by |
| 90 | have hnum : 0 < a.num := Rat.num_pos.mpr ha |
| 91 | have habs : (a.num.natAbs : ℚ) = a.num := by |
| 92 | have h := congrArg (fun n : ℤ => (n : ℚ)) (Int.natAbs_of_nonneg hnum.le) |
| 93 | simpa only [Int.cast_natCast] using h |
| 94 | refine ⟨a.num.natAbs * a.den, a.den, ?_, ?_, ?_⟩ |
| 95 | · exact Nat.mul_pos (Int.natAbs_pos.mpr (ne_of_gt hnum)) a.den_pos |
| 96 | · exact_mod_cast a.den_pos |
| 97 | · push_cast |
| 98 | rw [habs] |
| 99 | conv_rhs => |
| 100 | arg 1 |
| 101 | rw [← a.num_div_den] |
| 102 | field_simp |
| 103 | |
| 104 | theorem positive_rational_represents (d a : ℚ) (hd : 0 < d) (ha : 0 < a) : |
| 105 | QuaternionNormSymmetry.PositiveQuaternionNorm.Represents d a := by |
| 106 | obtain ⟨D, c, hD, hc, hDc⟩ := positive_integer_square_multiple d hd |
| 107 | obtain ⟨A, e, hA, he, hAe⟩ := positive_integer_square_multiple a ha |
| 108 | obtain ⟨u, hu⟩ := nat_represents D A hD hA |
| 109 | let v : QuaternionNormSymmetry.PositiveQuaternionNorm.Vector := (u.1, (c * u.2.1, c * u.2.2)) |
| 110 | have hv : QuaternionNormSymmetry.PositiveQuaternionNorm.form d v = QuaternionNormSymmetry.PositiveQuaternionNorm.form (D : ℚ) u := by |
| 111 | simp only [QuaternionNormSymmetry.PositiveQuaternionNorm.form_apply, v, hDc] |
| 112 | ring |
| 113 | refine ⟨e⁻¹ • v, ?_⟩ |
| 114 | rw [(QuaternionNormSymmetry.PositiveQuaternionNorm.form d).map_smul, smul_eq_mul, hv, hu, hAe] |
| 115 | field_simp |
| 116 | |
| 117 | theorem exists_weighted_four_squares (d a : ℚ) (hd : 0 < d) (ha : 0 < a) : |
| 118 | ∃ x₁ x₂ y₁ y₂ : ℚ, x₁^2 + x₂^2 + d * (y₁^2 + y₂^2) = a := by |
| 119 | obtain ⟨u, hu⟩ := positive_rational_represents d a hd ha |
| 120 | exact ⟨u.1.1, u.1.2, u.2.1, u.2.2, (QuaternionNormSymmetry.PositiveQuaternionNorm.form_apply d u).symm.trans hu⟩ |
| 121 | |
| 122 | end |
| 123 | |
| 124 | end OAI.AlgebraicGeometry.AbelianModuli.ReferenceFamily.QuaternionNormUniversality.PositiveQuaternionNorm |