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 Mathlib.Data.Fintype.EquivFin |
| 2 | import Mathlib.GroupTheory.Perm.Sign |
| 3 | import Mathlib.Logic.Relation |
| 4 | import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise |
| 5 | |
| 6 | /-! # Sign Switch -/ |
| 7 | |
| 8 | namespace OAI.AlgebraicGeometry.ComplexMultiplication.SignSwitch.CM |
| 9 | |
| 10 | /-! |
| 11 | # The finite sign-switch reduction for CM tensors |
| 12 | |
| 13 | This is the combinatorial step in Section 2 of |
| 14 | `/docs/hodge_cm_claimed_result.tex`. A coordinate indexes a conjugate |
| 15 | pair of embeddings; `true` and `false` denote the two possible Hodge signs |
| 16 | on the chosen representative. The sign on its conjugate is forced to be |
| 17 | the opposite one. |
| 18 | |
| 19 | The results in this file concern sign patterns only. In particular, they |
| 20 | do not assume or assert that a switch is realized by an algebraic cycle. |
| 21 | -/ |
| 22 | |
| 23 | variable {ι κ : Type*} |
| 24 | |
| 25 | /-- A CM sign pattern on representatives of conjugate embedding pairs. -/ |
| 26 | abbrev SignPattern (ι : Type*) := ι → Bool |
| 27 | |
| 28 | /-- A finite family of weight-one sign patterns, indexed by tensor slots. -/ |
| 29 | abbrev SignFamily (κ ι : Type*) := κ → SignPattern ι |
| 30 | |
| 31 | /-- The integer signs used in the manuscript. -/ |
| 32 | def signValue (b : Bool) : ℤ := if b then 1 else -1 |
| 33 | |
| 34 | @[simp] |
| 35 | theorem signValue_not (b : Bool) : signValue (!b) = -signValue b := by |
| 36 | cases b <;> rfl |
| 37 | |
| 38 | /-- Recover the odd sign function on both members of each conjugate pair. -/ |
| 39 | def oddExtension (v : SignPattern ι) (e : ι × Bool) : ℤ := |
| 40 | if e.2 then -signValue (v e.1) else signValue (v e.1) |
| 41 | |
| 42 | /-- The extension changes sign under the conjugation involution. -/ |
| 43 | theorem oddExtension_conjugate (v : SignPattern ι) (e : ι × Bool) : |
| 44 | oddExtension v (e.1, !e.2) = -oddExtension v e := by |
| 45 | rcases e with ⟨t, b⟩ |
| 46 | cases b <;> simp [oddExtension] |
| 47 | |
| 48 | /-- Reindex the slots at a single embedding coordinate. -/ |
| 49 | def permuteAt [DecidableEq ι] (v : SignFamily κ ι) (t : ι) |
| 50 | (π : Equiv.Perm κ) : SignFamily κ ι := |
| 51 | fun i u => if u = t then v (π i) u else v i u |
| 52 | |
| 53 | /-- Exchange two slot signs at one coordinate, leaving all other entries fixed. -/ |
| 54 | def CoordinateSwitch [DecidableEq ι] [DecidableEq κ] |
| 55 | (v w : SignFamily κ ι) : Prop := |
| 56 | ∃ (t : ι) (a b : κ), w = permuteAt v t (Equiv.swap a b) |
| 57 | |
| 58 | /-- A finite sequence of coordinate switches, including the empty sequence. -/ |
| 59 | abbrev SwitchChain [DecidableEq ι] [DecidableEq κ] := |
| 60 | Relation.ReflTransGen (CoordinateSwitch (ι := ι) (κ := κ)) |
| 61 | |
| 62 | /-- Each coordinate exchange is a four-factor identity: only two whole sign |
| 63 | patterns change, and their pointwise sum is preserved. -/ |
| 64 | theorem CoordinateSwitch.pair_identity [DecidableEq ι] [DecidableEq κ] |
| 65 | {v w : SignFamily κ ι} (h : CoordinateSwitch v w) : |
| 66 | ∃ a b : κ, |
| 67 | (∀ i, i ≠ a → i ≠ b → w i = v i) ∧ |
| 68 | ∀ t, signValue (v a t) + signValue (v b t) = |
| 69 | signValue (w a t) + signValue (w b t) := by |
| 70 | obtain ⟨u, a, b, rfl⟩ := h |
| 71 | refine ⟨a, b, ?_, ?_⟩ |
| 72 | · intro i hia hib |
| 73 | funext t |
| 74 | simp [permuteAt, Equiv.swap_apply_of_ne_of_ne hia hib] |
| 75 | · intro t |
| 76 | by_cases ht : t = u |
| 77 | · simp [permuteAt, ht, add_comm] |
| 78 | · simp [permuteAt, ht] |
| 79 | |
| 80 | variable [Fintype κ] [DecidableEq ι] [DecidableEq κ] |
| 81 | |
| 82 | /-- The number of slots carrying a specified sign at a coordinate. -/ |
| 83 | def signCount (v : SignFamily κ ι) (t : ι) (b : Bool) : ℕ := |
| 84 | Fintype.card {i : κ // v i t = b} |
| 85 | |
| 86 | /-- Balance means equality of the two sign multisets at each coordinate. -/ |
| 87 | def Balanced (v w : SignFamily κ ι) : Prop := |
| 88 | ∀ (t : ι) (b : Bool), signCount v t b = signCount w t b |
| 89 | |
| 90 | /-- The signed Hodge weight at an embedding coordinate. -/ |
| 91 | def signSum (v : SignFamily κ ι) (t : ι) : ℤ := |
| 92 | ∑ i, signValue (v i t) |
| 93 | |
| 94 | omit [DecidableEq ι] [DecidableEq κ] in |
| 95 | theorem signCount_true_add_false (v : SignFamily κ ι) (t : ι) : |
| 96 | signCount v t true + signCount v t false = Fintype.card κ := by |
| 97 | simpa [signCount, Fintype.card_subtype, Bool.not_eq_true] using |
| 98 | (Finset.card_filter_add_card_filter_not (s := Finset.univ) (fun i => v i t = true)) |
| 99 | |
| 100 | omit [DecidableEq ι] [DecidableEq κ] in |
| 101 | theorem signSum_eq_counts (v : SignFamily κ ι) (t : ι) : |
| 102 | signSum v t = (signCount v t true : ℤ) - (signCount v t false : ℤ) := by |
| 103 | classical |
| 104 | simp [signSum, signValue, Finset.sum_ite, signCount, Fintype.card_subtype, |
| 105 | Bool.not_eq_true, sub_eq_add_neg] |
| 106 | |
| 107 | omit [DecidableEq ι] [DecidableEq κ] in |
| 108 | /-- For equally many tensor slots, equality of signed sums is precisely balance. -/ |
| 109 | theorem balanced_iff_signSum_eq (v w : SignFamily κ ι) : |
| 110 | Balanced v w ↔ ∀ t, signSum v t = signSum w t := by |
| 111 | constructor |
| 112 | · intro h t |
| 113 | simp only [signSum_eq_counts, h t true, h t false] |
| 114 | · intro h t b |
| 115 | have hv := signCount_true_add_false v t |
| 116 | have hw := signCount_true_add_false w t |
| 117 | have hs := h t |
| 118 | rw [signSum_eq_counts, signSum_eq_counts] at hs |
| 119 | cases b <;> omega |
| 120 | |
| 121 | omit [DecidableEq κ] in |
| 122 | theorem signSum_permuteAt (v : SignFamily κ ι) (t u : ι) (π : Equiv.Perm κ) : |
| 123 | signSum (permuteAt v t π) u = signSum v u := by |
| 124 | by_cases hu : u = t |
| 125 | · simpa [signSum, permuteAt, hu] using |
| 126 | Equiv.sum_comp π (fun i => signValue (v i t)) |
| 127 | · simp [signSum, permuteAt, hu] |
| 128 | |
| 129 | theorem CoordinateSwitch.signSum_eq {v w : SignFamily κ ι} |
| 130 | (h : CoordinateSwitch v w) (t : ι) : signSum v t = signSum w t := by |
| 131 | obtain ⟨u, a, b, rfl⟩ := h |
| 132 | exact (signSum_permuteAt v u t (Equiv.swap a b)).symm |
| 133 | |
| 134 | theorem SwitchChain.signSum_eq {v w : SignFamily κ ι} |
| 135 | (h : SwitchChain v w) (t : ι) : signSum v t = signSum w t := by |
| 136 | induction h with |
| 137 | | refl => rfl |
| 138 | | tail _ hstep ih => exact ih.trans (hstep.signSum_eq t) |
| 139 | |
| 140 | theorem switchChain_permuteAt (v : SignFamily κ ι) (t : ι) (π : Equiv.Perm κ) : |
| 141 | SwitchChain v (permuteAt v t π) := by |
| 142 | induction π using Equiv.Perm.swap_induction_on' with |
| 143 | | one => |
| 144 | have h : permuteAt v t 1 = v := by |
| 145 | funext i u |
| 146 | simp [permuteAt] |
| 147 | rw [h] |
| 148 | | mul_swap π a b _ ih => |
| 149 | have h : permuteAt v t (π * Equiv.swap a b) = |
| 150 | permuteAt (permuteAt v t π) t (Equiv.swap a b) := by |
| 151 | funext i u |
| 152 | by_cases hu : u = t <;> simp [permuteAt, hu, Equiv.Perm.mul_apply] |
| 153 | rw [h] |
| 154 | exact ih.tail ⟨t, a, b, rfl⟩ |
| 155 | |
| 156 | /-- Reindex any specified finite set of coordinates independently. -/ |
| 157 | def permuteOn (v : SignFamily κ ι) (s : Finset ι) |
| 158 | (π : ι → Equiv.Perm κ) : SignFamily κ ι := |
| 159 | fun i t => if t ∈ s then v (π t i) t else v i t |
| 160 | |
| 161 | theorem switchChain_permuteOn (v : SignFamily κ ι) (s : Finset ι) |
| 162 | (π : ι → Equiv.Perm κ) : SwitchChain v (permuteOn v s π) := by |
| 163 | induction s using Finset.induction_on with |
| 164 | | empty => |
| 165 | have h : permuteOn v ∅ π = v := by |
| 166 | funext i t |
| 167 | simp [permuteOn] |
| 168 | rw [h] |
| 169 | | @insert t s ht ih => |
| 170 | have h : permuteOn v (insert t s) π = |
| 171 | permuteAt (permuteOn v s π) t (π t) := by |
| 172 | funext i u |
| 173 | by_cases hu : u = t |
| 174 | · subst u |
| 175 | simp [permuteOn, permuteAt, ht] |
| 176 | · simp [permuteOn, permuteAt, hu] |
| 177 | rw [h] |
| 178 | exact ih.trans (switchChain_permuteAt _ _ _) |
| 179 | |
| 180 | omit [DecidableEq ι] [DecidableEq κ] in |
| 181 | /-- Equal coordinate multisets can be matched by coordinatewise slot permutations. -/ |
| 182 | theorem Balanced.exists_permutations {v w : SignFamily κ ι} (h : Balanced v w) : |
| 183 | ∃ π : ι → Equiv.Perm κ, ∀ (i : κ) (t : ι), v (π t i) t = w i t := by |
| 184 | let e (t : ι) (b : Bool) : {i : κ // w i t = b} ≃ {i : κ // v i t = b} := |
| 185 | Fintype.equivOfCardEq (h t b).symm |
| 186 | exact ⟨fun t => Equiv.ofFiberEquiv (e t), |
| 187 | fun i t => Equiv.ofFiberEquiv_map (e t) i⟩ |
| 188 | |
| 189 | /-- The finite combinatorial reduction in the manuscript: every balanced pair of |
| 190 | families is connected by swaps of two slots at one embedding coordinate. -/ |
| 191 | theorem Balanced.switchChain [Fintype ι] {v w : SignFamily κ ι} (h : Balanced v w) : |
| 192 | SwitchChain v w := by |
| 193 | obtain ⟨π, hπ⟩ := h.exists_permutations |
| 194 | have heq : permuteOn v Finset.univ π = w := by |
| 195 | funext i t |
| 196 | simpa [permuteOn] using hπ i t |
| 197 | rw [← heq] |
| 198 | exact switchChain_permuteOn v Finset.univ π |
| 199 | |
| 200 | /-- The signed-sum formulation used for the CM tensor reduction. -/ |
| 201 | theorem switchChain_of_signSum_eq [Fintype ι] {v w : SignFamily κ ι} |
| 202 | (h : ∀ t, signSum v t = signSum w t) : SwitchChain v w := |
| 203 | ((balanced_iff_signSum_eq v w).mpr h).switchChain |
| 204 | |
| 205 | /-- The reduction is exact: switches connect precisely the balanced sign families. -/ |
| 206 | theorem switchChain_iff_balanced [Fintype ι] (v w : SignFamily κ ι) : |
| 207 | SwitchChain v w ↔ Balanced v w := by |
| 208 | constructor |
| 209 | · intro h |
| 210 | exact (balanced_iff_signSum_eq v w).mpr h.signSum_eq |
| 211 | · exact Balanced.switchChain |
| 212 | |
| 213 | end OAI.AlgebraicGeometry.ComplexMultiplication.SignSwitch.CM |