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.RepresentationTheory.Weil.Local.Gaussian |
| 2 | import Mathlib.Analysis.Fourier.FiniteAbelian.PontryaginDuality |
| 3 | import Mathlib.NumberTheory.GaussSum |
| 4 | |
| 5 | /-! # Finite Quadratic -/ |
| 6 | |
| 7 | namespace OAI.RepresentationTheory.Weil.Local.FiniteQuadratic.Construction |
| 8 | |
| 9 | noncomputable section |
| 10 | |
| 11 | /-! Quadratic characters on finite additive groups, for the local Gaussian phase. -/ |
| 12 | |
| 13 | open scoped Classical ComplexConjugate |
| 14 | |
| 15 | structure QuadraticCharacter (A : Type*) [AddCommGroup A] where |
| 16 | toFun : A → ℂ |
| 17 | polar : AddChar A (AddChar A ℂ) |
| 18 | map_zero : toFun 0 = 1 |
| 19 | map_neg : ∀ x, toFun (-x) = toFun x |
| 20 | map_add : ∀ x y, toFun (x + y) = toFun x * toFun y * polar x y |
| 21 | norm_eq_one : ∀ x, ‖toFun x‖ = 1 |
| 22 | |
| 23 | namespace QuadraticCharacter |
| 24 | |
| 25 | variable {A : Type*} [AddCommGroup A] |
| 26 | |
| 27 | instance : CoeFun (QuadraticCharacter A) (fun _ => A → ℂ) := ⟨toFun⟩ |
| 28 | |
| 29 | theorem ne_zero (q : QuadraticCharacter A) (x : A) : q x ≠ 0 := by |
| 30 | apply norm_ne_zero_iff.mp |
| 31 | rw [q.norm_eq_one] |
| 32 | exact one_ne_zero |
| 33 | |
| 34 | theorem polar_symmetric (q : QuadraticCharacter A) (x y : A) : q.polar x y = q.polar y x := by |
| 35 | apply mul_left_cancel₀ (mul_ne_zero (q.ne_zero x) (q.ne_zero y)) |
| 36 | rw [← q.map_add, mul_comm (q x) (q y), ← q.map_add, add_comm] |
| 37 | |
| 38 | theorem polar_self (q : QuadraticCharacter A) (x : A) : q.polar x x = q x ^ 2 := by |
| 39 | have h := q.map_add x (-x) |
| 40 | rw [add_neg_cancel, q.map_zero, q.map_neg, (q.polar x).map_neg_eq_inv] at h |
| 41 | have hne : q.polar x x ≠ 0 := ((q.polar x).val_isUnit x).ne_zero |
| 42 | have h' := congrArg (fun z : ℂ => z * q.polar x x) h |
| 43 | simpa only [one_mul, mul_assoc, inv_mul_cancel₀ hne, mul_one, pow_two] using h' |
| 44 | |
| 45 | theorem map_nsmul (q : QuadraticCharacter A) (n : ℕ) (x : A) : |
| 46 | q (n • x) = q x ^ (n ^ 2) := by |
| 47 | induction n with |
| 48 | | zero => simp [q.map_zero] |
| 49 | | succ n ih => |
| 50 | rw [add_nsmul, one_nsmul, q.map_add, ih, q.polar.map_nsmul_eq_pow] |
| 51 | simp only [AddChar.pow_apply, q.polar_self] |
| 52 | rw [← pow_mul, ← pow_succ, ← pow_add] |
| 53 | congr 1 |
| 54 | ring |
| 55 | |
| 56 | def Nondegenerate (q : QuadraticCharacter A) : Prop := ∀ x, q.polar x = 1 → x = 0 |
| 57 | |
| 58 | def gauss [Fintype A] (q : QuadraticCharacter A) : ℂ := ∑ x, q x |
| 59 | |
| 60 | theorem mul_conj_self (q : QuadraticCharacter A) (x : A) : q x * conj (q x) = 1 := by |
| 61 | rw [Complex.mul_conj, Complex.normSq_eq_norm_sq, q.norm_eq_one] |
| 62 | norm_num |
| 63 | |
| 64 | theorem gauss_mul_conj [Fintype A] (q : QuadraticCharacter A) (hq : q.Nondegenerate) : |
| 65 | q.gauss * conj q.gauss = (Fintype.card A : ℂ) := by |
| 66 | have hshift (y : A) : (∑ x, q (x + y)) = ∑ x, q x := |
| 67 | Equiv.sum_comp (Equiv.addRight y) q |
| 68 | have hsum (x : A) : (∑ y, q.polar x y) = if x = 0 then (Fintype.card A : ℂ) else 0 := by |
| 69 | by_cases hx : x = 0 |
| 70 | · subst x |
| 71 | simp [q.polar.map_zero_eq_one] |
| 72 | · have hp : q.polar x ≠ 1 := fun h => hx (hq x h) |
| 73 | simp only [ite_eq_right hx] |
| 74 | exact AddChar.sum_eq_zero_of_ne_one hp |
| 75 | calc |
| 76 | _ = ∑ y, (∑ x, q (x + y)) * conj (q y) := by |
| 77 | simp only [hshift, ← Finset.mul_sum, ← map_sum, QuadraticCharacter.gauss] |
| 78 | _ = ∑ x, q x * ∑ y, q.polar x y := by |
| 79 | simp_rw [Finset.sum_mul] |
| 80 | rw [Finset.sum_comm] |
| 81 | apply Finset.sum_congr rfl |
| 82 | intro x _ |
| 83 | rw [Finset.mul_sum] |
| 84 | apply Finset.sum_congr rfl |
| 85 | intro y _ |
| 86 | rw [q.map_add] |
| 87 | calc |
| 88 | _ = (q x * q.polar x y) * (q y * conj (q y)) := by ring |
| 89 | _ = _ := by rw [q.mul_conj_self, mul_one] |
| 90 | _ = _ := by simp [hsum, q.map_zero] |
| 91 | |
| 92 | theorem gauss_norm_sq [Fintype A] (q : QuadraticCharacter A) (hq : q.Nondegenerate) : |
| 93 | ‖q.gauss‖ ^ 2 = (Fintype.card A : ℝ) := by |
| 94 | have h := q.gauss_mul_conj hq |
| 95 | rw [Complex.mul_conj, Complex.normSq_eq_norm_sq] at h |
| 96 | exact_mod_cast h |
| 97 | |
| 98 | theorem gauss_ne_zero [Fintype A] (q : QuadraticCharacter A) (hq : q.Nondegenerate) : |
| 99 | q.gauss ≠ 0 := by |
| 100 | intro h |
| 101 | have hs := q.gauss_norm_sq hq |
| 102 | rw [h, norm_zero, zero_pow (by decide)] at hs |
| 103 | exact (Nat.cast_ne_zero.mpr Fintype.card_ne_zero) hs.symm |
| 104 | |
| 105 | end QuadraticCharacter |
| 106 | |
| 107 | end |
| 108 | |
| 109 | end OAI.RepresentationTheory.Weil.Local.FiniteQuadratic.Construction |