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 |
| 2 | |
| 3 | /-! # Commuting -/ |
| 4 | |
| 5 | namespace OAI.LinearAlgebra.Endomorphisms.Commuting.Construction |
| 6 | |
| 7 | /-! |
| 8 | # Commuting: commuting endomorphisms |
| 9 | |
| 10 | This file proves the specification independently of `Statements.Commuting`. |
| 11 | The index type of the commuting family is arbitrary. |
| 12 | -/ |
| 13 | |
| 14 | open _root_.Module |
| 15 | open scoped IsMulCommutative |
| 16 | |
| 17 | variable {K V ι : Type*} [Field K] [IsAlgClosed K] |
| 18 | [AddCommGroup V] [Module K V] [FiniteDimensional K V] |
| 19 | |
| 20 | def jointGenEigenspace (T : ι → Module.End K V) (χ : ι → K) : Submodule K V := |
| 21 | ⨅ i : ι, (T i).genEigenspace (χ i) ⊤ |
| 22 | |
| 23 | omit [IsAlgClosed K] [FiniteDimensional K V] in |
| 24 | theorem joint_independent (T : ι → Module.End K V) |
| 25 | (hcomm : ∀ i j, Commute (T i) (T j)) : |
| 26 | iSupIndep (fun χ : ι → K => jointGenEigenspace T χ) := by |
| 27 | exact Module.End.independent_iInf_maxGenEigenspace_of_forall_mapsTo T |
| 28 | (fun i j => Module.End.mapsTo_maxGenEigenspace_of_comm (hcomm j i).eq) |
| 29 | |
| 30 | theorem joint_spans (T : ι → Module.End K V) |
| 31 | (hcomm : ∀ i j, Commute (T i) (T j)) : |
| 32 | (⨆ χ : ι → K, jointGenEigenspace T χ) = ⊤ := by |
| 33 | exact Module.End.iSup_iInf_maxGenEigenspace_eq_top_of_iSup_maxGenEigenspace_eq_top_of_commute |
| 34 | T (fun i j _ => hcomm i j) (fun i => (T i).iSup_maxGenEigenspace_eq_top) |
| 35 | |
| 36 | omit [IsAlgClosed K] in |
| 37 | theorem joint_finite (T : ι → Module.End K V) |
| 38 | (hcomm : ∀ i j, Commute (T i) (T j)) : |
| 39 | Set.Finite {χ : ι → K | jointGenEigenspace T χ ≠ ⊥} := |
| 40 | Submodule.finite_ne_bot_of_iSupIndep (joint_independent T hcomm) |
| 41 | |
| 42 | omit [IsAlgClosed K] [FiniteDimensional K V] in |
| 43 | theorem exists_polynomial_evaluation (T : ι → Module.End K V) |
| 44 | (hcomm : ∀ i j, Commute (T i) (T j)) : |
| 45 | ∃ ev : MvPolynomial ι K →ₐ[K] Module.End K V, |
| 46 | ∀ i, ev (MvPolynomial.X i) = T i := by |
| 47 | let A := Algebra.adjoin K (Set.range T) |
| 48 | have : IsMulCommutative A := Algebra.isMulCommutative_adjoin K (by |
| 49 | rintro _ ⟨i, rfl⟩ _ ⟨j, rfl⟩ |
| 50 | exact fun _ => hcomm i j) |
| 51 | let t : ι → A := fun i => ⟨T i, Algebra.subset_adjoin ⟨i, rfl⟩⟩ |
| 52 | exact ⟨A.val.comp (MvPolynomial.aeval t), fun i => by simp [t]⟩ |
| 53 | |
| 54 | theorem exists_common_eigenvector [Nontrivial V] |
| 55 | (T : ι → Module.End K V) |
| 56 | (hcomm : ∀ i j, Commute (T i) (T j)) : |
| 57 | ∃ (χ : ι → K) (v : V), v ≠ 0 ∧ ∀ i, T i v = χ i • v := by |
| 58 | classical |
| 59 | generalize hn : finrank K V = n |
| 60 | induction n using Nat.strong_induction_on generalizing V with |
| 61 | | h n ih => |
| 62 | by_cases hall : ∀ i, ∃ μ : K, (T i).eigenspace μ = ⊤ |
| 63 | · choose χ hχ using hall |
| 64 | obtain ⟨v, hv⟩ := exists_ne (0 : V) |
| 65 | refine ⟨χ, v, hv, fun i => ?_⟩ |
| 66 | exact (Module.End.mem_eigenspace_iff.mp (hχ i ▸ Submodule.mem_top)) |
| 67 | · push Not at hall |
| 68 | obtain ⟨i, hi⟩ := hall |
| 69 | obtain ⟨μ, hμ⟩ := (T i).exists_eigenvalue |
| 70 | let W := (T i).eigenspace μ |
| 71 | have hW : W ≠ ⊥ := hμ |
| 72 | have : Nontrivial W := Submodule.nontrivial_iff_ne_bot.mpr hW |
| 73 | have hinv (j : ι) : Set.MapsTo (T j) W W := |
| 74 | Module.End.mapsTo_genEigenspace_of_comm (hcomm i j).eq μ 1 |
| 75 | let S : ι → Module.End K W := fun j => (T j).restrict (hinv j) |
| 76 | have hS (j k : ι) : Commute (S j) (S k) := by |
| 77 | ext v |
| 78 | exact DFunLike.congr_fun (hcomm j k).eq (v : V) |
| 79 | have hdim : finrank K W < n := hn ▸ Submodule.finrank_lt (hi μ) |
| 80 | obtain ⟨χ, v, hv, he⟩ := ih (finrank K W) hdim S hS rfl |
| 81 | refine ⟨χ, v, ?_, fun j => congrArg Subtype.val (he j)⟩ |
| 82 | intro hv0 |
| 83 | exact hv (Subtype.ext hv0) |
| 84 | |
| 85 | omit [IsAlgClosed K] [FiniteDimensional K V] in |
| 86 | theorem joint_invariant (T : ι → Module.End K V) |
| 87 | (hcomm : ∀ i j, Commute (T i) (T j)) (χ : ι → K) (i : ι) : |
| 88 | Set.MapsTo (T i) (jointGenEigenspace T χ) (jointGenEigenspace T χ) := by |
| 89 | intro v hv |
| 90 | change v ∈ ⨅ j, (T j).genEigenspace (χ j) ⊤ at hv |
| 91 | change T i v ∈ ⨅ j, (T j).genEigenspace (χ j) ⊤ |
| 92 | simp only [Submodule.mem_iInf] at hv ⊢ |
| 93 | exact fun j => Module.End.mapsTo_maxGenEigenspace_of_comm (hcomm j i) (χ j) (hv j) |
| 94 | |
| 95 | theorem exists_joint_eigenvector (T : ι → Module.End K V) |
| 96 | (hcomm : ∀ i j, Commute (T i) (T j)) (χ : ι → K) |
| 97 | (hχ : jointGenEigenspace T χ ≠ ⊥) : |
| 98 | ∃ v : V, v ≠ 0 ∧ ∀ i, T i v = χ i • v := by |
| 99 | let W := jointGenEigenspace T χ |
| 100 | have : Nontrivial W := Submodule.nontrivial_iff_ne_bot.mpr hχ |
| 101 | let S : ι → Module.End K W := fun i => (T i).restrict (joint_invariant T hcomm χ i) |
| 102 | have hS (i j : ι) : Commute (S i) (S j) := by |
| 103 | ext v |
| 104 | exact DFunLike.congr_fun (hcomm i j).eq (v : V) |
| 105 | obtain ⟨η, v, hv, he⟩ := exists_common_eigenvector S hS |
| 106 | have hv0 : (v : V) ≠ 0 := fun h => hv (Subtype.ext h) |
| 107 | have hη (i : ι) : η i = χ i := by |
| 108 | by_contra hne |
| 109 | have hd := (T i).disjoint_genEigenspace hne 1 ⊤ |
| 110 | have hmem : (v : V) ∈ (T i).eigenspace (η i) ⊓ (T i).genEigenspace (χ i) ⊤ := |
| 111 | ⟨Module.End.mem_eigenspace_iff.mpr (congrArg Subtype.val (he i)), |
| 112 | (Submodule.mem_iInf _).mp v.property i⟩ |
| 113 | rw [hd.eq_bot, Submodule.mem_bot] at hmem |
| 114 | exact hv0 hmem |
| 115 | exact ⟨v, hv0, fun i => hη i ▸ congrArg Subtype.val (he i)⟩ |
| 116 | |
| 117 | omit [IsAlgClosed K] [FiniteDimensional K V] in |
| 118 | theorem polynomial_on_eigenvector |
| 119 | (ev : MvPolynomial ι K →ₐ[K] Module.End K V) |
| 120 | (χ : ι → K) (v : V) |
| 121 | (he : ∀ i, ev (MvPolynomial.X i) v = χ i • v) |
| 122 | (p : MvPolynomial ι K) : |
| 123 | ev p v = MvPolynomial.eval χ p • v := by |
| 124 | induction p using MvPolynomial.induction_on with |
| 125 | | C a => simp |
| 126 | | add p q hp hq => simp [map_add, hp, hq, add_smul] |
| 127 | | mul_X p i hp => |
| 128 | simp [map_mul, Module.End.mul_apply, he, hp, smul_smul, mul_comm] |
| 129 | |
| 130 | theorem polynomial_relation_on_joint_eigenvalues |
| 131 | (T : ι → Module.End K V) |
| 132 | (hcomm : ∀ i j, Commute (T i) (T j)) |
| 133 | (ev : MvPolynomial ι K →ₐ[K] Module.End K V) |
| 134 | (hev : ∀ i, ev (MvPolynomial.X i) = T i) |
| 135 | (χ : ι → K) (p : MvPolynomial ι K) |
| 136 | (hχ : jointGenEigenspace T χ ≠ ⊥) (hp : ev p = 0) : |
| 137 | MvPolynomial.eval χ p = 0 := by |
| 138 | obtain ⟨v, hv, he⟩ := exists_joint_eigenvector T hcomm χ hχ |
| 139 | have h := polynomial_on_eigenvector ev χ v (fun i => hev i ▸ he i) p |
| 140 | rw [hp, LinearMap.zero_apply] at h |
| 141 | exact (smul_eq_zero.mp h.symm).resolve_right hv |
| 142 | |
| 143 | omit [IsAlgClosed K] [FiniteDimensional K V] in |
| 144 | theorem extending_basis_repr_castSucc {n : ℕ} {W : Submodule K V} |
| 145 | (b : Basis (Fin n) K W) (B : Basis (Fin (n + 1)) K V) |
| 146 | (hb : ∀ j, B j.castSucc = (b j : V)) (v : W) (r : Fin n) : |
| 147 | B.repr (v : V) r.castSucc = b.repr v r := by |
| 148 | classical |
| 149 | have h : (B.coord r.castSucc).comp W.subtype = b.coord r := by |
| 150 | apply b.ext |
| 151 | intro j |
| 152 | rw [LinearMap.comp_apply, Basis.coord_apply, Submodule.subtype_apply, ← hb j, |
| 153 | Basis.coord_apply] |
| 154 | simp only [Basis.repr_self, Finsupp.single_apply, Fin.castSucc_inj] |
| 155 | exact DFunLike.congr_fun h v |
| 156 | |
| 157 | omit [IsAlgClosed K] [FiniteDimensional K V] in |
| 158 | theorem extending_basis_repr_last {n : ℕ} {W : Submodule K V} |
| 159 | (b : Basis (Fin n) K W) (B : Basis (Fin (n + 1)) K V) |
| 160 | (hb : ∀ j, B j.castSucc = (b j : V)) (v : W) : |
| 161 | B.repr (v : V) (Fin.last n) = 0 := by |
| 162 | classical |
| 163 | have h : (B.coord (Fin.last n)).comp W.subtype = 0 := by |
| 164 | apply b.ext |
| 165 | intro j |
| 166 | rw [LinearMap.comp_apply, Basis.coord_apply, Submodule.subtype_apply, ← hb j] |
| 167 | simp |
| 168 | exact DFunLike.congr_fun h v |
| 169 | |
| 170 | theorem exists_triangular_basis_aux (T : ι → Module.End K V) |
| 171 | (hcomm : ∀ i j, Commute (T i) (T j)) : |
| 172 | ∃ (m : ℕ) (b : Basis (Fin m) K V), |
| 173 | ∀ i (r c : Fin m), c < r → b.repr (T i (b c)) r = 0 := by |
| 174 | classical |
| 175 | generalize hn : finrank K V = n |
| 176 | induction n using Nat.strong_induction_on generalizing V with |
| 177 | | h n ih => |
| 178 | cases subsingleton_or_nontrivial V with |
| 179 | | inl h => |
| 180 | exact ⟨0, Basis.empty V, fun _ r => Fin.elim0 r⟩ |
| 181 | | inr h => |
| 182 | let D : ι → Module.End K (Dual K V) := fun i => (T i).dualMap |
| 183 | have hD (i j : ι) : Commute (D i) (D j) := by |
| 184 | ext φ v |
| 185 | exact congrArg φ (DFunLike.congr_fun (hcomm j i).eq v) |
| 186 | obtain ⟨χ, φ, hφ, he⟩ := exists_common_eigenvector D hD |
| 187 | obtain ⟨y, hy⟩ := LinearMap.surjective hφ (1 : K) |
| 188 | let W := LinearMap.ker φ |
| 189 | have hinv (i : ι) : Set.MapsTo (T i) W W := by |
| 190 | intro v hv |
| 191 | change φ (T i v) = 0 |
| 192 | have h := congrArg (fun ψ : Dual K V => ψ v) (he i) |
| 193 | change φ (T i v) = χ i * φ v at h |
| 194 | rw [h, show φ v = 0 from hv, mul_zero] |
| 195 | let S : ι → Module.End K W := fun i => (T i).restrict (hinv i) |
| 196 | have hS (i j : ι) : Commute (S i) (S j) := by |
| 197 | ext v |
| 198 | exact DFunLike.congr_fun (hcomm i j).eq (v : V) |
| 199 | have hdim : finrank K W < n := by |
| 200 | have hd := Module.Dual.finrank_ker_add_one_of_ne_zero hφ |
| 201 | change finrank K W + 1 = finrank K V at hd |
| 202 | omega |
| 203 | obtain ⟨m, b, hb⟩ := ih (finrank K W) hdim S hS rfl |
| 204 | have hli (a : K) (x : V) (hx : x ∈ W) (ha : a • y + x = 0) : a = 0 := by |
| 205 | have h := congrArg φ ha |
| 206 | simpa [map_add, map_smul, hy, show φ x = 0 from hx] using h |
| 207 | have hsp (z : V) : ∃ a : K, z + a • y ∈ W := by |
| 208 | refine ⟨-φ z, ?_⟩ |
| 209 | change φ (z + (-φ z) • y) = 0 |
| 210 | simp [hy] |
| 211 | let B := b.mkFinSnoc y hli hsp |
| 212 | have hB (j : Fin m) : B j.castSucc = (b j : V) := by |
| 213 | simp [B, Basis.coe_mkFinSnoc] |
| 214 | refine ⟨m + 1, B, ?_⟩ |
| 215 | intro i r c |
| 216 | refine Fin.lastCases ?_ (fun r' => ?_) r |
| 217 | · refine Fin.lastCases ?_ (fun c' => ?_) c |
| 218 | · intro hcr |
| 219 | exact False.elim (lt_irrefl _ hcr) |
| 220 | · intro _ |
| 221 | rw [hB] |
| 222 | exact extending_basis_repr_last b B hB (S i (b c')) |
| 223 | · refine Fin.lastCases ?_ (fun c' => ?_) c |
| 224 | · intro hcr |
| 225 | exact False.elim (not_lt_of_ge (Fin.le_last _) hcr) |
| 226 | · intro hcr |
| 227 | rw [hB] |
| 228 | change B.repr ((S i (b c') : W) : V) r'.castSucc = 0 |
| 229 | rw [extending_basis_repr_castSucc b B hB (S i (b c')) r'] |
| 230 | exact hb i r' c' hcr |
| 231 | |
| 232 | theorem exists_triangular_basis (T : ι → Module.End K V) |
| 233 | (hcomm : ∀ i j, Commute (T i) (T j)) : |
| 234 | ∃ b : Basis (Fin (finrank K V)) K V, |
| 235 | ∀ i (r c : Fin (finrank K V)), c < r → b.repr (T i (b c)) r = 0 := by |
| 236 | obtain ⟨m, b, hb⟩ := exists_triangular_basis_aux T hcomm |
| 237 | have hm : finrank K V = m := by simpa using finrank_eq_card_basis b |
| 238 | subst m |
| 239 | exact ⟨b, hb⟩ |
| 240 | |
| 241 | /-- Commuting, with precisely the natural hypotheses and all conclusions of the specification. -/ |
| 242 | theorem commuting_family_structure |
| 243 | (T : ι → Module.End K V) |
| 244 | (hcomm : ∀ i j, Commute (T i) (T j)) : |
| 245 | ∃ ev : MvPolynomial ι K →ₐ[K] Module.End K V, |
| 246 | (∀ i, ev (MvPolynomial.X i) = T i) ∧ |
| 247 | (∃ b : Module.Basis (Fin (Module.finrank K V)) K V, |
| 248 | ∀ i (r c : Fin (Module.finrank K V)), |
| 249 | c < r → b.repr (T i (b c)) r = 0) ∧ |
| 250 | Set.Finite {χ : ι → K | jointGenEigenspace T χ ≠ ⊥} ∧ |
| 251 | iSupIndep (fun χ : ι → K => jointGenEigenspace T χ) ∧ |
| 252 | (⨆ χ : ι → K, jointGenEigenspace T χ) = ⊤ ∧ |
| 253 | (∀ (χ : ι → K) (p : MvPolynomial ι K), |
| 254 | jointGenEigenspace T χ ≠ ⊥ → |
| 255 | ev p = 0 → MvPolynomial.eval χ p = 0) := by |
| 256 | obtain ⟨ev, hev⟩ := exists_polynomial_evaluation T hcomm |
| 257 | exact ⟨ev, hev, exists_triangular_basis T hcomm, joint_finite T hcomm, |
| 258 | joint_independent T hcomm, joint_spans T hcomm, |
| 259 | fun χ p hχ hp => polynomial_relation_on_joint_eigenvalues T hcomm ev hev χ p hχ hp⟩ |
| 260 | |
| 261 | end OAI.LinearAlgebra.Endomorphisms.Commuting.Construction |