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.QuadraticCancellationEq |
| 2 | |
| 3 | /-! # Quaternion Norm Symmetry -/ |
| 4 | |
| 5 | namespace OAI.AlgebraicGeometry.AbelianModuli.ReferenceFamily.QuaternionNormSymmetry.PositiveQuaternionNorm |
| 6 | |
| 7 | noncomputable section |
| 8 | |
| 9 | section |
| 10 | |
| 11 | /-! Elementary norm identities for the positive rational quaternion |
| 12 | form with coefficients `1, 1, d, d`. -/ |
| 13 | |
| 14 | open OAI.AlgebraicGeometry.AbelianModuli.ReferenceFamily.QuadraticCancellationEq.QuadraticCancellation QuadraticMap |
| 15 | |
| 16 | abbrev Vector := (ℚ × ℚ) × (ℚ × ℚ) |
| 17 | |
| 18 | def two (c : ℚ) : QuadraticForm ℚ (ℚ × ℚ) := (QuadraticCancellationEq.QuadraticCancellation.scalar c).prod (QuadraticCancellationEq.QuadraticCancellation.scalar c) |
| 19 | |
| 20 | def form (d : ℚ) : QuadraticForm ℚ Vector := (two 1).prod (two d) |
| 21 | |
| 22 | @[simp] theorem two_apply (c : ℚ) (x : ℚ × ℚ) : |
| 23 | two c x = c * (x.1 ^ 2 + x.2 ^ 2) := by |
| 24 | simp only [two, prod_apply, QuadraticCancellationEq.QuadraticCancellation.scalar_apply] |
| 25 | ring |
| 26 | |
| 27 | @[simp] theorem form_apply (d : ℚ) (x : Vector) : |
| 28 | form d x = x.1.1 ^ 2 + x.1.2 ^ 2 + d * (x.2.1 ^ 2 + x.2.2 ^ 2) := by |
| 29 | simp [form] |
| 30 | |
| 31 | def Represents (d a : ℚ) : Prop := ∃ x : Vector, form d x = a |
| 32 | |
| 33 | theorem form_nonneg {d : ℚ} (hd : 0 < d) (x : Vector) : 0 ≤ form d x := by |
| 34 | rw [form_apply] |
| 35 | positivity |
| 36 | |
| 37 | theorem form_eq_zero_iff {d : ℚ} (hd : 0 < d) (x : Vector) : |
| 38 | form d x = 0 ↔ x = 0 := by |
| 39 | constructor |
| 40 | · intro hx |
| 41 | rw [form_apply] at hx |
| 42 | have hu : 0 ≤ x.1.1 ^ 2 + x.1.2 ^ 2 := by positivity |
| 43 | have hv : 0 ≤ x.2.1 ^ 2 + x.2.2 ^ 2 := by positivity |
| 44 | have hv0 : x.2.1 ^ 2 + x.2.2 ^ 2 = 0 := by nlinarith |
| 45 | have hu0 : x.1.1 ^ 2 + x.1.2 ^ 2 = 0 := by nlinarith |
| 46 | have h0 : x.1.1 = 0 := by nlinarith [sq_nonneg x.1.2] |
| 47 | have h1 : x.1.2 = 0 := by nlinarith [sq_nonneg x.1.1] |
| 48 | have h2 : x.2.1 = 0 := by nlinarith [sq_nonneg x.2.2] |
| 49 | have h3 : x.2.2 = 0 := by nlinarith [sq_nonneg x.2.1] |
| 50 | exact Prod.ext (Prod.ext h0 h1) (Prod.ext h2 h3) |
| 51 | · rintro rfl |
| 52 | exact (form d).map_zero |
| 53 | |
| 54 | def multiply (d : ℚ) (u v : Vector) : Vector := |
| 55 | ((u.1.1 * v.1.1 - u.1.2 * v.1.2 - d * u.2.1 * v.2.1 - d * u.2.2 * v.2.2, |
| 56 | u.1.1 * v.1.2 + u.1.2 * v.1.1 + d * u.2.1 * v.2.2 - d * u.2.2 * v.2.1), |
| 57 | (u.1.1 * v.2.1 - u.1.2 * v.2.2 + u.2.1 * v.1.1 + u.2.2 * v.1.2, |
| 58 | u.1.1 * v.2.2 + u.1.2 * v.2.1 - u.2.1 * v.1.2 + u.2.2 * v.1.1)) |
| 59 | |
| 60 | theorem form_multiply (d : ℚ) (u v : Vector) : |
| 61 | form d (multiply d u v) = form d u * form d v := by |
| 62 | simp only [form_apply, multiply] |
| 63 | ring |
| 64 | |
| 65 | def multiplyLinear (d : ℚ) (u : Vector) : Vector →ₗ[ℚ] Vector where |
| 66 | toFun := multiply d u |
| 67 | map_add' x y := by |
| 68 | ext <;> simp only [multiply, Prod.fst_add, Prod.snd_add] <;> ring |
| 69 | map_smul' a x := by |
| 70 | ext <;> dsimp [multiply] <;> ring |
| 71 | |
| 72 | theorem multiplyLinear_injective {d : ℚ} (hd : 0 < d) (u : Vector) |
| 73 | (hu : form d u ≠ 0) : Function.Injective (multiplyLinear d u) := by |
| 74 | apply (LinearMap.ker_eq_bot).mp |
| 75 | rw [LinearMap.ker_eq_bot'] |
| 76 | intro v hv |
| 77 | apply (form_eq_zero_iff hd v).mp |
| 78 | have h := form_multiply d u v |
| 79 | change multiply d u v = 0 at hv |
| 80 | rw [hv, (form d).map_zero] at h |
| 81 | exact (mul_eq_zero.mp h.symm).resolve_left hu |
| 82 | |
| 83 | theorem represents_one (d : ℚ) : Represents d 1 := by |
| 84 | exact ⟨((1, 0), (0, 0)), by simp⟩ |
| 85 | |
| 86 | theorem represents_two (d : ℚ) : Represents d 2 := by |
| 87 | exact ⟨((1, 1), (0, 0)), by norm_num⟩ |
| 88 | |
| 89 | theorem represents_self (d : ℚ) : Represents d d := by |
| 90 | exact ⟨((0, 0), (1, 0)), by simp⟩ |
| 91 | |
| 92 | theorem Represents.mul {d a b : ℚ} (ha : Represents d a) (hb : Represents d b) : |
| 93 | Represents d (a * b) := by |
| 94 | obtain ⟨u, hu⟩ := ha |
| 95 | obtain ⟨v, hv⟩ := hb |
| 96 | exact ⟨multiply d u v, by rw [form_multiply, hu, hv]⟩ |
| 97 | |
| 98 | theorem Represents.inv {d a : ℚ} (ha : Represents d a) (ha0 : a ≠ 0) : |
| 99 | Represents d a⁻¹ := by |
| 100 | obtain ⟨u, hu⟩ := ha |
| 101 | refine ⟨a⁻¹ • u, ?_⟩ |
| 102 | rw [(form d).map_smul, hu, smul_eq_mul] |
| 103 | field_simp |
| 104 | |
| 105 | theorem Represents.div {d a b : ℚ} (ha : Represents d a) (hb : Represents d b) |
| 106 | (hb0 : b ≠ 0) : Represents d (a / b) := by |
| 107 | simpa only [div_eq_mul_inv] using ha.mul (hb.inv hb0) |
| 108 | |
| 109 | theorem rational_four_squares (a : ℚ) (ha : 0 < a) : Represents 1 a := by |
| 110 | obtain ⟨w, x, y, z, h⟩ := Nat.sum_four_squares (a.num.natAbs * a.den) |
| 111 | have hn : (a.num.natAbs : ℚ) = a.num := by |
| 112 | have h := congrArg (fun n : ℤ => (n : ℚ)) |
| 113 | (Int.natAbs_of_nonneg (Rat.num_nonneg.mpr ha.le)) |
| 114 | simpa only [Int.cast_natCast] using h |
| 115 | have h' : (w : ℚ)^2 + (x : ℚ)^2 + (y : ℚ)^2 + (z : ℚ)^2 = |
| 116 | (a.num : ℚ) * a.den := by |
| 117 | have hc := congrArg (fun n : ℕ => (n : ℚ)) h |
| 118 | push_cast at hc |
| 119 | simpa only [hn] using hc |
| 120 | have hd : (a.den : ℚ) ≠ 0 := by exact_mod_cast a.den_ne_zero |
| 121 | refine ⟨(a.den : ℚ)⁻¹ • (((w : ℚ), (x : ℚ)), ((y : ℚ), (z : ℚ))), ?_⟩ |
| 122 | rw [(form 1).map_smul, smul_eq_mul, form_apply] |
| 123 | simp only [one_mul] |
| 124 | rw [← add_assoc, h'] |
| 125 | conv_rhs => rw [← a.num_div_den] |
| 126 | field_simp |
| 127 | |
| 128 | /-- The split norm comparison detects represented scalars. -/ |
| 129 | def doubled (d a : ℚ) : QuadraticForm ℚ (Vector × Vector) := |
| 130 | (form d).prod ((-a) • form d) |
| 131 | |
| 132 | theorem represents_iff_doubled_isotropic {d a : ℚ} (hd : 0 < d) : |
| 133 | Represents d a ↔ ∃ x : Vector × Vector, x ≠ 0 ∧ doubled d a x = 0 := by |
| 134 | constructor |
| 135 | · rintro ⟨u, hu⟩ |
| 136 | refine ⟨(u, ((1, 0), (0, 0))), ?_, ?_⟩ |
| 137 | · intro hz |
| 138 | have h := congrArg (fun x : Vector × Vector => x.2.1.1) hz |
| 139 | norm_num at h |
| 140 | · simp [doubled, hu] |
| 141 | · rintro ⟨⟨u, v⟩, hx, h⟩ |
| 142 | have hnorm : form d u = a * form d v := by |
| 143 | simpa only [doubled, prod_apply, smul_apply, smul_eq_mul, neg_mul, |
| 144 | ← sub_eq_add_neg, sub_eq_zero] using h |
| 145 | have hv : form d v ≠ 0 := by |
| 146 | intro hv |
| 147 | have hv0 := (form_eq_zero_iff hd v).mp hv |
| 148 | have hu0 := (form_eq_zero_iff hd u).mp (by rw [hnorm, hv, mul_zero]) |
| 149 | exact hx (Prod.ext hu0 hv0) |
| 150 | have hr := (show Represents d (form d u) from ⟨u, rfl⟩).div |
| 151 | (show Represents d (form d v) from ⟨v, rfl⟩) hv |
| 152 | simpa only [hnorm, mul_div_cancel_right₀ _ hv] using hr |
| 153 | |
| 154 | end |
| 155 | |
| 156 | /-! Symmetry of positive rational quaternion norm representation. Four |
| 157 | equal positive squares are isometric after any positive rescaling, by |
| 158 | Lagrange's theorem and quaternion multiplication. Explicit hyperbolic |
| 159 | coordinate changes then reduce the comparison to quadratic cancellation. -/ |
| 160 | |
| 161 | open QuadraticMap OAI.AlgebraicGeometry.AbelianModuli.ReferenceFamily.QuadraticCancellationEq.QuadraticCancellation |
| 162 | |
| 163 | private def assoc {U V W : Type*} |
| 164 | [AddCommGroup U] [Module ℚ U] [AddCommGroup V] [Module ℚ V] |
| 165 | [AddCommGroup W] [Module ℚ W] |
| 166 | (Q : QuadraticForm ℚ U) (R : QuadraticForm ℚ V) (S : QuadraticForm ℚ W) : |
| 167 | ((Q.prod R).prod S).IsometryEquiv (Q.prod (R.prod S)) where |
| 168 | toLinearEquiv := LinearEquiv.prodAssoc ℚ U V W |
| 169 | map_app' _ := (add_assoc _ _ _).symm |
| 170 | |
| 171 | private theorem cancel_right {U V : Type*} |
| 172 | [AddCommGroup U] [Module ℚ U] [AddCommGroup V] [Module ℚ V] |
| 173 | (Q : QuadraticForm ℚ U) (R : QuadraticForm ℚ V) (c : ℚ) (hc : c ≠ 0) |
| 174 | (h : (Q.prod (QuadraticCancellationEq.QuadraticCancellation.scalar c)).Equivalent (R.prod (QuadraticCancellationEq.QuadraticCancellation.scalar c))) : Q.Equivalent R := by |
| 175 | apply QuadraticCancellationEq.QuadraticCancellation.cancel_scalar Q R c hc |
| 176 | exact (show ((QuadraticCancellationEq.QuadraticCancellation.scalar c).prod Q).Equivalent (Q.prod (QuadraticCancellationEq.QuadraticCancellation.scalar c)) from |
| 177 | ⟨IsometryEquiv.prodComm _ _⟩).trans |
| 178 | (h.trans ⟨IsometryEquiv.prodComm _ _⟩) |
| 179 | |
| 180 | private theorem cancel_two_right {U V : Type*} |
| 181 | [AddCommGroup U] [Module ℚ U] [AddCommGroup V] [Module ℚ V] |
| 182 | (Q : QuadraticForm ℚ U) (R : QuadraticForm ℚ V) (c : ℚ) (hc : c ≠ 0) |
| 183 | (h : (Q.prod (two c)).Equivalent (R.prod (two c))) : Q.Equivalent R := by |
| 184 | have h' : ((Q.prod (QuadraticCancellationEq.QuadraticCancellation.scalar c)).prod (QuadraticCancellationEq.QuadraticCancellation.scalar c)).Equivalent |
| 185 | ((R.prod (QuadraticCancellationEq.QuadraticCancellation.scalar c)).prod (QuadraticCancellationEq.QuadraticCancellation.scalar c)) := |
| 186 | (show ((Q.prod (QuadraticCancellationEq.QuadraticCancellation.scalar c)).prod (QuadraticCancellationEq.QuadraticCancellation.scalar c)).Equivalent |
| 187 | (Q.prod (two c)) from ⟨assoc Q (QuadraticCancellationEq.QuadraticCancellation.scalar c) (QuadraticCancellationEq.QuadraticCancellation.scalar c)⟩).trans |
| 188 | (h.trans ⟨(assoc R (QuadraticCancellationEq.QuadraticCancellation.scalar c) (QuadraticCancellationEq.QuadraticCancellation.scalar c)).symm⟩) |
| 189 | exact cancel_right Q R c hc (cancel_right _ _ c hc h') |
| 190 | |
| 191 | private def four (c : ℚ) : QuadraticForm ℚ Vector := (two c).prod (two c) |
| 192 | |
| 193 | private theorem four_apply (c : ℚ) (x : Vector) : four c x = c * form 1 x := by |
| 194 | simp only [four, prod_apply, two_apply, form_apply, one_mul] |
| 195 | ring |
| 196 | |
| 197 | private theorem cancel_four_right {U V : Type*} |
| 198 | [AddCommGroup U] [Module ℚ U] [AddCommGroup V] [Module ℚ V] |
| 199 | (Q : QuadraticForm ℚ U) (R : QuadraticForm ℚ V) (c : ℚ) (hc : c ≠ 0) |
| 200 | (h : (Q.prod (four c)).Equivalent (R.prod (four c))) : Q.Equivalent R := by |
| 201 | have h' : ((Q.prod (two c)).prod (two c)).Equivalent |
| 202 | ((R.prod (two c)).prod (two c)) := |
| 203 | (show ((Q.prod (two c)).prod (two c)).Equivalent |
| 204 | (Q.prod (four c)) from ⟨assoc Q (two c) (two c)⟩).trans |
| 205 | (h.trans ⟨(assoc R (two c) (two c)).symm⟩) |
| 206 | exact cancel_two_right Q R c hc (cancel_two_right _ _ c hc h') |
| 207 | |
| 208 | private theorem four_equivalent (c d : ℚ) (hc : 0 < c) (hd : 0 < d) : |
| 209 | (four c).Equivalent (four d) := by |
| 210 | obtain ⟨u, hu⟩ := rational_four_squares (c / d) (div_pos hc hd) |
| 211 | have hu0 : form 1 u ≠ 0 := by rw [hu]; exact (div_pos hc hd).ne' |
| 212 | let e := LinearEquiv.ofInjectiveEndo (multiplyLinear 1 u) |
| 213 | (multiplyLinear_injective (by norm_num) u hu0) |
| 214 | refine ⟨{ toLinearEquiv := e, map_app' := ?_ }⟩ |
| 215 | intro x |
| 216 | change four d (multiply 1 u x) = four c x |
| 217 | rw [four_apply, form_multiply, hu, four_apply] |
| 218 | field_simp |
| 219 | |
| 220 | private def hyperbolic (c : ℚ) : QuadraticForm ℚ Vector := |
| 221 | (two c).prod (two (-c)) |
| 222 | |
| 223 | private def hyperbolicMap (c d : ℚ) (x : Vector) : Vector := |
| 224 | ((((c / d + 1) / 2) * x.1.1 + ((c / d - 1) / 2) * x.2.1, |
| 225 | ((c / d + 1) / 2) * x.1.2 + ((c / d - 1) / 2) * x.2.2), |
| 226 | (((c / d - 1) / 2) * x.1.1 + ((c / d + 1) / 2) * x.2.1, |
| 227 | ((c / d - 1) / 2) * x.1.2 + ((c / d + 1) / 2) * x.2.2)) |
| 228 | |
| 229 | private def hyperbolicEquiv (c d : ℚ) (hc : c ≠ 0) (hd : d ≠ 0) : |
| 230 | (hyperbolic c).IsometryEquiv (hyperbolic d) where |
| 231 | toFun := hyperbolicMap c d |
| 232 | invFun := hyperbolicMap d c |
| 233 | left_inv x := by |
| 234 | ext <;> dsimp [hyperbolicMap] <;> field_simp [hc, hd] <;> ring |
| 235 | right_inv x := by |
| 236 | ext <;> dsimp [hyperbolicMap] <;> field_simp [hc, hd] <;> ring |
| 237 | map_add' x y := by |
| 238 | ext <;> dsimp [hyperbolicMap] <;> ring |
| 239 | map_smul' a x := by |
| 240 | ext <;> dsimp [hyperbolicMap] <;> ring |
| 241 | map_app' x := by |
| 242 | simp only [hyperbolic, prod_apply, two_apply, hyperbolicMap] |
| 243 | field_simp [hd] |
| 244 | ring |
| 245 | |
| 246 | private def canonical (d a : ℚ) : QuadraticForm ℚ (Vector × Vector) := |
| 247 | ((two 1).prod (two d)).prod ((two (-a)).prod (two (-a * d))) |
| 248 | |
| 249 | private def core (d a : ℚ) : QuadraticForm ℚ (Vector × Vector) := |
| 250 | ((two 1).prod (two d)).prod ((two a).prod (two (-a * d))) |
| 251 | |
| 252 | private def doubledCanonical (d a : ℚ) : |
| 253 | (doubled d a).IsometryEquiv (canonical d a) where |
| 254 | toLinearEquiv := LinearEquiv.refl ℚ _ |
| 255 | map_app' x := by |
| 256 | change canonical d a x = doubled d a x |
| 257 | simp only [doubled, canonical, prod_apply, two_apply, form_apply, smul_apply, |
| 258 | smul_eq_mul, one_mul] |
| 259 | ring |
| 260 | |
| 261 | private def exchangeLeft : ((Vector × Vector) × Vector) ≃ₗ[ℚ] |
| 262 | ((Vector × Vector) × Vector) where |
| 263 | toFun x := (((x.1.1.1, x.1.1.2), (x.2.1, x.1.2.2)), (x.1.2.1, x.2.2)) |
| 264 | invFun x := (((x.1.1.1, x.1.1.2), (x.2.1, x.1.2.2)), (x.1.2.1, x.2.2)) |
| 265 | left_inv _ := rfl |
| 266 | right_inv _ := rfl |
| 267 | map_add' _ _ := rfl |
| 268 | map_smul' _ _ := rfl |
| 269 | |
| 270 | private def exchangeRight : ((Vector × Vector) × Vector) ≃ₗ[ℚ] |
| 271 | ((Vector × Vector) × Vector) where |
| 272 | toFun x := (((x.1.1.1, x.2.1), (x.1.1.2, x.1.2.2)), (x.1.2.1, x.2.2)) |
| 273 | invFun x := (((x.1.1.1, x.1.2.1), (x.2.1, x.1.2.2)), (x.1.1.2, x.2.2)) |
| 274 | left_inv _ := rfl |
| 275 | right_inv _ := rfl |
| 276 | map_add' _ _ := rfl |
| 277 | map_smul' _ _ := rfl |
| 278 | |
| 279 | private def stableLeft (d a : ℚ) : |
| 280 | ((canonical d a).prod (four a)).IsometryEquiv |
| 281 | ((core d a).prod (hyperbolic (-a))) where |
| 282 | toLinearEquiv := exchangeLeft |
| 283 | map_app' x := by |
| 284 | change (core d a).prod (hyperbolic (-a)) |
| 285 | (((x.1.1.1, x.1.1.2), (x.2.1, x.1.2.2)), (x.1.2.1, x.2.2)) = _ |
| 286 | simp only [canonical, core, four, hyperbolic, prod_apply, two_apply] |
| 287 | ring |
| 288 | |
| 289 | private def stableRight (d a : ℚ) : |
| 290 | ((canonical a d).prod (four d)).IsometryEquiv |
| 291 | ((core d a).prod (hyperbolic (-d))) where |
| 292 | toLinearEquiv := exchangeRight |
| 293 | map_app' x := by |
| 294 | change (core d a).prod (hyperbolic (-d)) |
| 295 | (((x.1.1.1, x.2.1), (x.1.1.2, x.1.2.2)), (x.1.2.1, x.2.2)) = _ |
| 296 | simp only [canonical, core, four, hyperbolic, prod_apply, two_apply] |
| 297 | ring |
| 298 | |
| 299 | theorem doubled_equivalent_swap (d a : ℚ) (hd : 0 < d) (ha : 0 < a) : |
| 300 | (doubled d a).Equivalent (doubled a d) := by |
| 301 | have hstable : ((canonical d a).prod (four a)).Equivalent |
| 302 | ((canonical a d).prod (four d)) := |
| 303 | ⟨(stableLeft d a).trans |
| 304 | (((QuadraticMap.IsometryEquiv.refl (core d a)).prod |
| 305 | (hyperbolicEquiv (-a) (-d) (neg_ne_zero.mpr ha.ne') |
| 306 | (neg_ne_zero.mpr hd.ne'))).trans (stableRight d a).symm)⟩ |
| 307 | have hsame := hstable.trans |
| 308 | ((Equivalent.refl (canonical a d)).prod (four_equivalent d a hd ha)) |
| 309 | have hc := cancel_four_right (canonical d a) (canonical a d) a ha.ne' hsame |
| 310 | exact (show (doubled d a).Equivalent (canonical d a) from |
| 311 | ⟨doubledCanonical d a⟩).trans (hc.trans ⟨(doubledCanonical a d).symm⟩) |
| 312 | |
| 313 | theorem represents_swap {d a : ℚ} (hd : 0 < d) (ha : 0 < a) : |
| 314 | Represents d a ↔ Represents a d := by |
| 315 | obtain ⟨e⟩ := doubled_equivalent_swap d a hd ha |
| 316 | rw [represents_iff_doubled_isotropic hd, represents_iff_doubled_isotropic ha] |
| 317 | constructor |
| 318 | · rintro ⟨x, hx, hq⟩ |
| 319 | exact ⟨e x, fun he => hx (e.injective (he.trans (map_zero e).symm)), |
| 320 | (e.map_app x).trans hq⟩ |
| 321 | · rintro ⟨x, hx, hq⟩ |
| 322 | exact ⟨e.symm x, fun he => hx (e.symm.injective (he.trans (map_zero e.symm).symm)), |
| 323 | (e.symm.map_app x).trans hq⟩ |
| 324 | |
| 325 | end |
| 326 | |
| 327 | end OAI.AlgebraicGeometry.AbelianModuli.ReferenceFamily.QuaternionNormSymmetry.PositiveQuaternionNorm |