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.AlgebraicTopology.Cohomology.Singular.ChainRepresentatives |
| 2 | import Mathlib.LinearAlgebra.Basis.VectorSpace |
| 3 | import Mathlib.Algebra.Module.Projective |
| 4 | import Mathlib.Algebra.Homology.Homotopy |
| 5 | |
| 6 | /-! # Chain Splitting D -/ |
| 7 | |
| 8 | namespace OAI.AlgebraicTopology.Kunneth.ChainSplittingD |
| 9 | |
| 10 | noncomputable section |
| 11 | |
| 12 | /-! |
| 13 | Linear splittings for the algebraic part of Kunneth. The splittings are chosen |
| 14 | using the projectivity of vector spaces; no homology or Künneth assertion |
| 15 | is assumed. |
| 16 | -/ |
| 17 | |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open _root_.CategoryTheory _root_.CategoryTheory.Limits |
| 21 | open OAI.AlgebraicTopology.Cohomology.Singular.ChainRepresentatives |
| 22 | |
| 23 | namespace Construction.ChainSplitting |
| 24 | |
| 25 | variable {k : Type} [Field k] |
| 26 | variable (C : ChainComplex (ModuleCat.{0} k) ℕ) |
| 27 | |
| 28 | /-- Choose cycle representatives linearly for all homology classes. -/ |
| 29 | def representatives (n : ℕ) : C.homology n →ₗ[k] Cohomology.Singular.ChainRepresentatives.chainCycles C n := |
| 30 | Classical.choose ((Cohomology.Singular.ChainRepresentatives.chainClass C n).exists_rightInverse_of_surjective |
| 31 | (LinearMap.range_eq_top.mpr (Cohomology.Singular.ChainRepresentatives.chainClass_surjective C n))) |
| 32 | |
| 33 | @[simp] |
| 34 | theorem class_representatives (n : ℕ) (a : C.homology n) : |
| 35 | Cohomology.Singular.ChainRepresentatives.chainClass C n (representatives C n a) = a := |
| 36 | LinearMap.congr_fun |
| 37 | (Classical.choose_spec ((Cohomology.Singular.ChainRepresentatives.chainClass C n).exists_rightInverse_of_surjective |
| 38 | (LinearMap.range_eq_top.mpr (Cohomology.Singular.ChainRepresentatives.chainClass_surjective C n)))) a |
| 39 | |
| 40 | /-- Extend the identity of the cycle subspace to a linear retraction. -/ |
| 41 | def cycleRetraction (n : ℕ) : C.X n →ₗ[k] Cohomology.Singular.ChainRepresentatives.chainCycles C n := |
| 42 | (Cohomology.Singular.ChainRepresentatives.chainCycles C n).subtype.leftInverse |
| 43 | |
| 44 | @[simp] |
| 45 | theorem cycleRetraction_cycle (n : ℕ) (z : Cohomology.Singular.ChainRepresentatives.chainCycles C n) : |
| 46 | cycleRetraction C n z.val = z := |
| 47 | LinearMap.leftInverse_apply_of_inj (Cohomology.Singular.ChainRepresentatives.chainCycles C n).ker_subtype z |
| 48 | |
| 49 | /-- The homology groups regarded as a chain complex with zero differential. -/ |
| 50 | abbrev homologyComplex : ChainComplex (ModuleCat.{0} k) ℕ where |
| 51 | X n := C.homology n |
| 52 | d _ _ := 0 |
| 53 | shape _ _ _ := rfl |
| 54 | d_comp_d' _ _ _ _ _ := zero_comp |
| 55 | |
| 56 | /-- Include the chosen homology representatives into the original complex. -/ |
| 57 | def inclusion : homologyComplex C ⟶ C where |
| 58 | f n := ModuleCat.ofHom ((Cohomology.Singular.ChainRepresentatives.chainCycles C n).subtype.comp (representatives C n)) |
| 59 | comm' i j _ := by |
| 60 | rw [show (homologyComplex C).d i j = 0 from rfl, zero_comp] |
| 61 | apply ModuleCat.hom_ext |
| 62 | apply LinearMap.ext |
| 63 | intro a |
| 64 | change (C.d i j) (representatives C i a).val = 0 |
| 65 | exact Cohomology.Singular.ChainRepresentatives.chainCycle_d_eq_zero C i j (representatives C i a) |
| 66 | |
| 67 | /-- Project a chain onto cycles, then take its homology class. -/ |
| 68 | def projection : C ⟶ homologyComplex C where |
| 69 | f n := ModuleCat.ofHom ((Cohomology.Singular.ChainRepresentatives.chainClass C n).comp (cycleRetraction C n)) |
| 70 | comm' i j _ := by |
| 71 | apply ModuleCat.hom_ext |
| 72 | apply LinearMap.ext |
| 73 | intro x |
| 74 | change 0 = Cohomology.Singular.ChainRepresentatives.chainClass C j (cycleRetraction C j ((C.d i j) x)) |
| 75 | have hcycle : (C.d i j) x ∈ Cohomology.Singular.ChainRepresentatives.chainCycles C j := by |
| 76 | change (C.d j ((ComplexShape.down ℕ).next j)) ((C.d i j) x) = 0 |
| 77 | exact ConcreteCategory.congr_hom (C.d_comp_d i j _) x |
| 78 | let z : Cohomology.Singular.ChainRepresentatives.chainCycles C j := ⟨(C.d i j) x, hcycle⟩ |
| 79 | have hz : cycleRetraction C j ((C.d i j) x) = z := |
| 80 | cycleRetraction_cycle C j z |
| 81 | rw [hz] |
| 82 | symm |
| 83 | apply (Cohomology.Singular.ChainRepresentatives.chainClass_eq_zero_iff C j z).mpr |
| 84 | have hij : i = j + 1 := ‹(ComplexShape.down ℕ).Rel i j›.symm |
| 85 | subst i |
| 86 | apply (Cohomology.Singular.ChainRepresentatives.chainClass_eq_zero_iff C j z).mp |
| 87 | apply (Cohomology.Singular.ChainRepresentatives.chainClass_eq_zero_iff_exists C j z).mpr |
| 88 | exact ⟨x, rfl⟩ |
| 89 | |
| 90 | @[simp] |
| 91 | theorem inclusion_projection : inclusion C ≫ projection C = 𝟙 (homologyComplex C) := by |
| 92 | apply HomologicalComplex.hom_ext |
| 93 | intro n |
| 94 | apply ModuleCat.hom_ext |
| 95 | apply LinearMap.ext |
| 96 | intro a |
| 97 | change Cohomology.Singular.ChainRepresentatives.chainClass C n |
| 98 | (cycleRetraction C n (representatives C n a).val) = a |
| 99 | rw [cycleRetraction_cycle, class_representatives] |
| 100 | |
| 101 | /-- Remove the chosen homology component of a chain. -/ |
| 102 | def remainder : C ⟶ C := 𝟙 C - projection C ≫ inclusion C |
| 103 | |
| 104 | @[simp] |
| 105 | theorem remainder_projection : remainder C ≫ projection C = 0 := by |
| 106 | simp [remainder, Category.assoc, inclusion_projection] |
| 107 | |
| 108 | /-- The kernel of the projection, equipped with its induced differential. -/ |
| 109 | abbrev acyclicPart : ChainComplex (ModuleCat.{0} k) ℕ where |
| 110 | X n := ModuleCat.of k (LinearMap.ker ((projection C).f n).hom) |
| 111 | d i j := ModuleCat.ofHom |
| 112 | (((C.d i j).hom.comp (LinearMap.ker ((projection C).f i).hom).subtype).codRestrict |
| 113 | (LinearMap.ker ((projection C).f j).hom) (by |
| 114 | intro x |
| 115 | change (projection C).f j ((C.d i j) x.val) = 0 |
| 116 | have h := ConcreteCategory.congr_hom ((projection C).comm i j) x.val |
| 117 | simpa only [homologyComplex, ModuleCat.hom_comp, LinearMap.comp_apply, |
| 118 | ModuleCat.hom_zero, LinearMap.zero_apply] using h.symm)) |
| 119 | shape i j hij := by |
| 120 | apply ModuleCat.hom_ext |
| 121 | apply LinearMap.ext |
| 122 | intro x |
| 123 | apply Subtype.ext |
| 124 | change (C.d i j) x.val = 0 |
| 125 | rw [C.shape i j hij] |
| 126 | rfl |
| 127 | d_comp_d' i j l _ _ := by |
| 128 | apply ModuleCat.hom_ext |
| 129 | apply LinearMap.ext |
| 130 | intro x |
| 131 | apply Subtype.ext |
| 132 | exact ConcreteCategory.congr_hom (C.d_comp_d i j l) x.val |
| 133 | |
| 134 | /-- Include the acyclic part in the original complex. -/ |
| 135 | def acyclicInclusion : acyclicPart C ⟶ C where |
| 136 | f n := ModuleCat.ofHom (LinearMap.ker ((projection C).f n).hom).subtype |
| 137 | comm' _ _ _ := rfl |
| 138 | |
| 139 | /-- Project a chain onto the kernel by removing its homology representative. -/ |
| 140 | def acyclicProjection : C ⟶ acyclicPart C where |
| 141 | f n := ModuleCat.ofHom (((remainder C).f n).hom.codRestrict |
| 142 | (LinearMap.ker ((projection C).f n).hom) (by |
| 143 | intro x |
| 144 | exact ConcreteCategory.congr_hom |
| 145 | (HomologicalComplex.congr_hom (remainder_projection C) n) x)) |
| 146 | comm' i j _ := by |
| 147 | apply ModuleCat.hom_ext |
| 148 | apply LinearMap.ext |
| 149 | intro x |
| 150 | apply Subtype.ext |
| 151 | exact ConcreteCategory.congr_hom ((remainder C).comm i j) x |
| 152 | |
| 153 | @[simp] |
| 154 | theorem acyclicProjection_inclusion : |
| 155 | acyclicProjection C ≫ acyclicInclusion C = remainder C := rfl |
| 156 | |
| 157 | @[simp] |
| 158 | theorem remainder_on_kernel (n : ℕ) |
| 159 | (x : LinearMap.ker ((projection C).f n).hom) : |
| 160 | (remainder C).f n x.val = x.val := by |
| 161 | change x.val - (inclusion C).f n ((projection C).f n x.val) = x.val |
| 162 | rw [show (projection C).f n x.val = 0 from x.property, map_zero, sub_zero] |
| 163 | |
| 164 | /-- Every cycle in the kernel is a boundary in that kernel. -/ |
| 165 | theorem acyclicPart_cycle_is_boundary (n : ℕ) |
| 166 | (x : Cohomology.Singular.ChainRepresentatives.chainCycles (acyclicPart C) n) : |
| 167 | ∃ y : (acyclicPart C).X (n + 1), |
| 168 | (acyclicPart C).d (n + 1) n y = x.val := by |
| 169 | have hx : x.val.val ∈ Cohomology.Singular.ChainRepresentatives.chainCycles C n := by |
| 170 | change (C.d n ((ComplexShape.down ℕ).next n)) x.val.val = 0 |
| 171 | exact congrArg Subtype.val x.property |
| 172 | let z : Cohomology.Singular.ChainRepresentatives.chainCycles C n := ⟨x.val.val, hx⟩ |
| 173 | have hz : Cohomology.Singular.ChainRepresentatives.chainClass C n z = 0 := by |
| 174 | have hp := x.val.property |
| 175 | change Cohomology.Singular.ChainRepresentatives.chainClass C n (cycleRetraction C n z.val) = 0 at hp |
| 176 | rwa [cycleRetraction_cycle] at hp |
| 177 | obtain ⟨y, hy⟩ := (Cohomology.Singular.ChainRepresentatives.chainClass_eq_zero_iff_exists C n z).mp hz |
| 178 | refine ⟨(acyclicProjection C).f (n + 1) y, ?_⟩ |
| 179 | apply Subtype.ext |
| 180 | change (C.d (n + 1) n) ((remainder C).f (n + 1) y) = x.val.val |
| 181 | have hcomm := ConcreteCategory.congr_hom ((remainder C).comm (n + 1) n) y |
| 182 | change (C.d (n + 1) n) ((remainder C).f (n + 1) y) = |
| 183 | (remainder C).f n ((C.d (n + 1) n) y) at hcomm |
| 184 | exact hcomm.trans ((congrArg ((remainder C).f n) hy).trans |
| 185 | (remainder_on_kernel C n x.val)) |
| 186 | |
| 187 | /-- A linear choice of preimage for every vector in a differential's range. -/ |
| 188 | def boundaryRangeSection (n : ℕ) : |
| 189 | LinearMap.range (C.d (n + 1) n).hom →ₗ[k] C.X (n + 1) := |
| 190 | Classical.choose ((C.d (n + 1) n).hom.rangeRestrict.exists_rightInverse_of_surjective |
| 191 | (C.d (n + 1) n).hom.range_rangeRestrict) |
| 192 | |
| 193 | @[simp] |
| 194 | theorem boundaryRangeSection_d (n : ℕ) |
| 195 | (z : LinearMap.range (C.d (n + 1) n).hom) : |
| 196 | (C.d (n + 1) n) (boundaryRangeSection C n z) = z.val := |
| 197 | congrArg Subtype.val (LinearMap.congr_fun |
| 198 | (Classical.choose_spec |
| 199 | ((C.d (n + 1) n).hom.rangeRestrict.exists_rightInverse_of_surjective |
| 200 | (C.d (n + 1) n).hom.range_rangeRestrict)) z) |
| 201 | |
| 202 | section Acyclic |
| 203 | |
| 204 | variable (hfill : ∀ (n : ℕ) (z : Cohomology.Singular.ChainRepresentatives.chainCycles C n), |
| 205 | ∃ b : C.X (n + 1), (C.d (n + 1) n) b = z.val) |
| 206 | |
| 207 | /-- Exactness over a field supplies a linear filling operator on cycles. -/ |
| 208 | def fillCycles (n : ℕ) : Cohomology.Singular.ChainRepresentatives.chainCycles C n →ₗ[k] C.X (n + 1) := |
| 209 | (boundaryRangeSection C n).comp |
| 210 | ((Cohomology.Singular.ChainRepresentatives.chainCycles C n).subtype.codRestrict |
| 211 | (LinearMap.range (C.d (n + 1) n).hom) (hfill n)) |
| 212 | |
| 213 | @[simp] |
| 214 | theorem fillCycles_d (n : ℕ) (z : Cohomology.Singular.ChainRepresentatives.chainCycles C n) : |
| 215 | (C.d (n + 1) n) (fillCycles C hfill n z) = z.val := |
| 216 | boundaryRangeSection_d C n _ |
| 217 | |
| 218 | /-- Fill a linear family of cycles, preserving linearity in its parameter. -/ |
| 219 | def fillCycleMap {V : ModuleCat.{0} k} (n : ℕ) (f : V ⟶ C.X n) |
| 220 | (hf : f ≫ C.d n ((ComplexShape.down ℕ).next n) = 0) : |
| 221 | V ⟶ C.X (n + 1) := |
| 222 | ModuleCat.ofHom ((fillCycles C hfill n).comp |
| 223 | (f.hom.codRestrict (Cohomology.Singular.ChainRepresentatives.chainCycles C n) (by |
| 224 | intro x |
| 225 | exact ConcreteCategory.congr_hom hf x))) |
| 226 | |
| 227 | @[reassoc (attr := simp)] |
| 228 | theorem fillCycleMap_comp {V : ModuleCat.{0} k} (n : ℕ) (f : V ⟶ C.X n) |
| 229 | (hf : f ≫ C.d n ((ComplexShape.down ℕ).next n) = 0) : |
| 230 | fillCycleMap C hfill n f hf ≫ C.d (n + 1) n = f := by |
| 231 | apply ModuleCat.hom_ext |
| 232 | apply LinearMap.ext |
| 233 | intro x |
| 234 | exact fillCycles_d C hfill n _ |
| 235 | |
| 236 | /-- A chain map into an acyclic complex of vector spaces is null-homotopic. -/ |
| 237 | def nullhomotopy {P : ChainComplex (ModuleCat.{0} k) ℕ} (e : P ⟶ C) : |
| 238 | Homotopy e 0 := by |
| 239 | let hzero : e.f 0 ≫ C.d 0 ((ComplexShape.down ℕ).next 0) = 0 := by |
| 240 | rw [C.shape 0 _ (Nat.succ_ne_zero _), comp_zero] |
| 241 | let h0 := fillCycleMap C hfill 0 (e.f 0) hzero |
| 242 | have h0eq : h0 ≫ C.d 1 0 = e.f 0 := fillCycleMap_comp C hfill 0 _ _ |
| 243 | have hclosed : (e.f 1 - P.d 1 0 ≫ h0) ≫ |
| 244 | C.d 1 ((ComplexShape.down ℕ).next 1) = 0 := by |
| 245 | rw [ChainComplex.next_nat_succ] |
| 246 | rw [Preadditive.sub_comp, Category.assoc, h0eq, e.comm 1 0, sub_self] |
| 247 | let h1 := fillCycleMap C hfill 1 (e.f 1 - P.d 1 0 ≫ h0) hclosed |
| 248 | have h1eq : h1 ≫ C.d 2 1 = e.f 1 - P.d 1 0 ≫ h0 := |
| 249 | fillCycleMap_comp C hfill 1 _ _ |
| 250 | refine Homotopy.mkInductive e h0 h0eq.symm h1 ?_ ?_ |
| 251 | · rw [h1eq] |
| 252 | abel |
| 253 | · intro n p |
| 254 | rcases p with ⟨u, v, hp⟩ |
| 255 | let a := e.f (n + 2) - P.d (n + 2) (n + 1) ≫ v |
| 256 | have ha : a ≫ C.d (n + 2) ((ComplexShape.down ℕ).next (n + 2)) = 0 := by |
| 257 | rw [ChainComplex.next_nat_succ] |
| 258 | dsimp only [a] |
| 259 | rw [Preadditive.sub_comp, e.comm (n + 2) (n + 1), hp, |
| 260 | Preadditive.comp_add] |
| 261 | simp only [← Category.assoc, P.d_comp_d, zero_comp, zero_add, sub_self] |
| 262 | refine ⟨fillCycleMap C hfill (n + 2) a ha, ?_⟩ |
| 263 | rw [fillCycleMap_comp] |
| 264 | dsimp only [a] |
| 265 | abel |
| 266 | |
| 267 | end Acyclic |
| 268 | |
| 269 | /-- The homology-free part contracts, and its contraction gives a homotopy |
| 270 | between the identity and projection onto homology representatives. -/ |
| 271 | def identityProjectionHomotopy : Homotopy (𝟙 C) (projection C ≫ inclusion C) := by |
| 272 | have h := nullhomotopy (acyclicPart C) (acyclicPart_cycle_is_boundary C) |
| 273 | (𝟙 (acyclicPart C)) |
| 274 | have hc := (h.compLeft (acyclicProjection C)).compRight (acyclicInclusion C) |
| 275 | have hr : Homotopy (remainder C) 0 := by simpa using hc |
| 276 | exact Homotopy.equivSubZero.symm hr |
| 277 | |
| 278 | /-- Every chain complex of vector spaces is homotopy equivalent to its |
| 279 | homology with zero differential. -/ |
| 280 | def homologyHomotopyEquiv : HomotopyEquiv (homologyComplex C) C where |
| 281 | hom := inclusion C |
| 282 | inv := projection C |
| 283 | homotopyHomInvId := Homotopy.ofEq (inclusion_projection C) |
| 284 | homotopyInvHomId := (identityProjectionHomotopy C).symm |
| 285 | |
| 286 | end Construction.ChainSplitting |
| 287 | |
| 288 | end |
| 289 | |
| 290 | end OAI.AlgebraicTopology.Kunneth.ChainSplittingD |