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 | /- |
| 2 | Copyright 2026 The Formal Conjectures Authors. |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | This file has been modified. |
| 16 | -/ |
| 17 | import Mathlib.Algebra.Homology.Homotopy |
| 18 | import Mathlib.Algebra.Homology.ShortComplex.ModuleCat |
| 19 | import OAI.LinearAlgebra.Foundations.QuotientBasic |
| 20 | import OAI.LinearAlgebra.Foundations.DualDefs |
| 21 | import Mathlib.LinearAlgebra.Dual.Lemmas |
| 22 | |
| 23 | /-! # Linear Dual -/ |
| 24 | |
| 25 | namespace OAI.Algebra.Homology.LinearDual |
| 26 | |
| 27 | noncomputable section |
| 28 | |
| 29 | open _root_.CategoryTheory |
| 30 | open _root_.CategoryTheory.ShortComplex |
| 31 | open _root_.HomologicalComplex |
| 32 | |
| 33 | /-! |
| 34 | # The linear dual of a complex of modules |
| 35 | |
| 36 | Applying the dual degreewise turns a nonnegatively graded chain complex into a cochain complex, |
| 37 | whose degree-`n` short complex is the reversed dual of the original one. Duality is |
| 38 | contravariantly functorial for maps, isomorphisms, chain homotopies and chain-homotopy |
| 39 | equivalences, so all of these transport to the dual cochain complex. That much holds over a |
| 40 | commutative ring. |
| 41 | |
| 42 | Over a field the homology of the reversed dual is canonically the dual of the homology, with no |
| 43 | finite-dimensionality hypothesis: this is `linearDualHomologyEquiv`. Over a ring the comparison |
| 44 | map `dualHomologyComparisonExplicit` still exists but need not be bijective. Each namespace below |
| 45 | is split into a `CommRing` section and a `Field` section accordingly. |
| 46 | -/ |
| 47 | |
| 48 | open Limits |
| 49 | |
| 50 | universe u |
| 51 | |
| 52 | namespace CategoryTheory.ShortComplex |
| 53 | |
| 54 | section CommRing |
| 55 | variable {R : Type u} [CommRing R] |
| 56 | |
| 57 | attribute [local implicit_reducible] ShortComplex.moduleCatMk ShortComplex.moduleCatLeftHomologyData |
| 58 | |
| 59 | /-- Let `R` be a commutative ring and `S` a sequence `A → B → C` of `R`-modules with zero composite. |
| 60 | Its reversed dual is the sequence `Hom_R(C,R) → Hom_R(B,R) → Hom_R(A,R)`, whose maps precompose |
| 61 | with those of `S`. -/ |
| 62 | abbrev linearDual (S : ShortComplex (ModuleCat.{u} R)) : |
| 63 | ShortComplex (ModuleCat.{u} R) := |
| 64 | ShortComplex.moduleCatMk S.g.hom.dualMap S.f.hom.dualMap (by ext; simp) |
| 65 | |
| 66 | /-- Let `R` be a commutative ring and `A → B → C` a sequence of modules with zero composite. A |
| 67 | functional on `B` vanishing on the image of `A` restricts to cycles and descends to `ker(B → |
| 68 | C)/im(A → B)`. This is the resulting linear map from dual cycles to functionals on homology. -/ |
| 69 | @[simps] |
| 70 | def dualCycleToHomologyFunctional (S : ShortComplex (ModuleCat.{u} R)) : |
| 71 | LinearMap.ker S.f.hom.dualMap →ₗ[R] |
| 72 | Module.Dual R S.moduleCatLeftHomologyData.H where |
| 73 | toFun φ := (LinearMap.range S.moduleCatToCycles).liftQ |
| 74 | (φ.1.comp (LinearMap.ker S.g.hom).subtype) (by |
| 75 | rintro _ ⟨x, rfl⟩ |
| 76 | have := LinearMap.congr_fun (LinearMap.mem_ker.1 φ.2) x |
| 77 | simp only [LinearMap.dualMap_apply, LinearMap.zero_apply] at this |
| 78 | simpa [moduleCatToCycles, S.f.hom.codRestrict_apply S.g.hom.ker (h := moduleCat_zero_apply S)]) |
| 79 | map_add' φ ψ := by |
| 80 | generalize_proofs |
| 81 | simp [LinearMap.add_comp, OAI.LinearAlgebra.Foundations.QuotientBasic.Submodule.liftQ_add S.moduleCatToCycles.range, *] |
| 82 | map_smul' a φ := by |
| 83 | generalize_proofs |
| 84 | simp [LinearMap.smul_comp, OAI.LinearAlgebra.Foundations.QuotientBasic.Submodule.liftQ_smul S.moduleCatToCycles.range, *] |
| 85 | |
| 86 | lemma dualCycleToHomologyFunctional_vanishes_on_boundaries |
| 87 | (S : ShortComplex (ModuleCat.{u} R)) : |
| 88 | LinearMap.range ((linearDual S).moduleCatToCycles) ≤ |
| 89 | LinearMap.ker (dualCycleToHomologyFunctional S) := by |
| 90 | rintro _ ⟨(ψ : Module.Dual R S.X₃), rfl⟩ |
| 91 | simp [dualCycleToHomologyFunctional] |
| 92 | ext z |
| 93 | induction z using Submodule.Quotient.induction_on with |
| 94 | | H z => simp [moduleCatToCycles, S.g.hom.dualMap_apply] |
| 95 | |
| 96 | /-- Let `R` be a commutative ring and `S = (A → B → C)` a sequence of modules with zero composite. |
| 97 | This linear map from the homology of the reversed dual to `Hom_R(H(S), R)` pairs the class of a |
| 98 | functional `φ` with the class of a cycle `z` by `φ(z)`, using quotient modules for both homology |
| 99 | groups. -/ |
| 100 | def dualHomologyComparisonExplicit (S : ShortComplex (ModuleCat.{u} R)) : |
| 101 | (linearDual S).moduleCatLeftHomologyData.H →ₗ[R] |
| 102 | Module.Dual R S.moduleCatLeftHomologyData.H := |
| 103 | (LinearMap.range (linearDual S).moduleCatToCycles).liftQ |
| 104 | (dualCycleToHomologyFunctional S) |
| 105 | (dualCycleToHomologyFunctional_vanishes_on_boundaries S) |
| 106 | |
| 107 | @[simp] |
| 108 | lemma dualHomologyComparisonExplicit_mk_apply_mk |
| 109 | (S : ShortComplex (ModuleCat.{u} R)) |
| 110 | (φ : LinearMap.ker S.f.hom.dualMap) (z : LinearMap.ker S.g.hom) : |
| 111 | (dualHomologyComparisonExplicit S) (Submodule.Quotient.mk φ) |
| 112 | (Submodule.Quotient.mk z) = φ.1 z.1 := |
| 113 | rfl |
| 114 | |
| 115 | end CommRing |
| 116 | |
| 117 | variable {R : Type u} [Field R] |
| 118 | |
| 119 | attribute [local implicit_reducible] ShortComplex.moduleCatMk ShortComplex.moduleCatLeftHomologyData |
| 120 | |
| 121 | lemma dualHomologyComparisonExplicit_surjective |
| 122 | (S : ShortComplex (ModuleCat.{u} R)) : |
| 123 | Function.Surjective (dualHomologyComparisonExplicit S) := by |
| 124 | intro α |
| 125 | let φ : Module.Dual R S.X₂ := |
| 126 | Subspace.dualLift (LinearMap.ker S.g.hom) <| α.comp (LinearMap.range S.moduleCatToCycles).mkQ |
| 127 | have hφ : φ ∈ LinearMap.ker S.f.hom.dualMap := LinearMap.mem_ker.2 <| LinearMap.ext fun x ↦ by |
| 128 | simpa [φ, Subspace.dualLift_of_mem (LinearMap.mem_ker.2 <| S.moduleCat_zero_apply x)] using! |
| 129 | congr(α $((Submodule.Quotient.mk_eq_zero _).2 <| S.moduleCatToCycles.mem_range_self x)) |
| 130 | refine ⟨Submodule.Quotient.mk ⟨φ, hφ⟩, ?_⟩ |
| 131 | ext z |
| 132 | induction z using Submodule.Quotient.induction_on with |
| 133 | | _ z => simp +zetaDelta [Submodule.mkQ_apply _] |
| 134 | |
| 135 | lemma dualHomologyComparisonExplicit_injective |
| 136 | (S : ShortComplex (ModuleCat.{u} R)) : |
| 137 | Function.Injective (dualHomologyComparisonExplicit S) := by |
| 138 | intro a b hab |
| 139 | induction a using Submodule.Quotient.induction_on with |
| 140 | | _ φ => |
| 141 | induction b using Submodule.Quotient.induction_on with |
| 142 | | _ ψ => |
| 143 | rw [Submodule.Quotient.eq] |
| 144 | have hzero : (dualCycleToHomologyFunctional S) (φ - ψ) = 0 := |
| 145 | ((dualCycleToHomologyFunctional S).map_sub φ ψ).trans (sub_eq_zero.2 hab) |
| 146 | have hv : (φ - ψ).1 ∈ (LinearMap.ker S.g.hom).dualAnnihilator := by |
| 147 | rw [Submodule.mem_dualAnnihilator] |
| 148 | intro z hz |
| 149 | exact LinearMap.congr_fun hzero (Submodule.Quotient.mk ⟨z, hz⟩) |
| 150 | rw [← LinearMap.range_dualMap_eq_dualAnnihilator_ker] at hv |
| 151 | obtain ⟨η, hη⟩ := hv |
| 152 | exact ⟨η, Subtype.ext hη⟩ |
| 153 | |
| 154 | /-- Let `R` be a field and `S = (A → B → C)` a sequence of vector spaces with zero composite. |
| 155 | Evaluation of a dual cocycle on a cycle gives this linear equivalence `H(S*) ≃ Hom_R(H(S), R)`, |
| 156 | where `S*` is the reversed dual sequence. It holds without a finite-dimensionality assumption. -/ |
| 157 | def linearDualHomologyEquiv (S : ShortComplex (ModuleCat.{u} R)) : |
| 158 | (linearDual S).homology ≃ₗ[R] Module.Dual R S.homology := |
| 159 | (linearDual S).moduleCatHomologyIso.toLinearEquiv.trans <| |
| 160 | (LinearEquiv.ofBijective (dualHomologyComparisonExplicit S) |
| 161 | ⟨(dualHomologyComparisonExplicit_injective S), |
| 162 | (dualHomologyComparisonExplicit_surjective S)⟩).trans <| |
| 163 | S.moduleCatHomologyIso.toLinearEquiv.dualMap |
| 164 | |
| 165 | end CategoryTheory.ShortComplex |
| 166 | |
| 167 | namespace HomologicalComplex |
| 168 | |
| 169 | section CommRing |
| 170 | variable {R : Type u} [CommRing R] |
| 171 | |
| 172 | /-- Let `R` be a commutative ring and `K` a chain complex of `R`-modules in nonnegative degrees. Its |
| 173 | dual cochain complex has `Hom_R(K_n, R)` in degree `n`, with coboundary `φ ↦ φ ∘ ∂`, where `∂: |
| 174 | K_{n+1} → K_n` is the boundary of `K`. -/ |
| 175 | @[implicit_reducible, simps -isSimp X d] |
| 176 | def linearDualCochainComplex (K : ChainComplex (ModuleCat.{u} R) ℕ) : |
| 177 | CochainComplex (ModuleCat.{u} R) ℕ where |
| 178 | X n := ModuleCat.of R (Module.Dual R (K.X n)) |
| 179 | d i j := ModuleCat.ofHom (K.d j i).hom.dualMap |
| 180 | shape i j := by simp +contextual |
| 181 | d_comp_d' i j k h1 h2 := by |
| 182 | simp [← ModuleCat.ofHom_comp, LinearMap.dualMap_comp_dualMap, ← ModuleCat.hom_comp] |
| 183 | |
| 184 | attribute [simp] HomologicalComplex.linearDualCochainComplex_X |
| 185 | |
| 186 | @[simp] |
| 187 | lemma linearDualCochainComplex_d_succ (K : ChainComplex (ModuleCat.{u} R) ℕ) (n : ℕ) : |
| 188 | ((linearDualCochainComplex K)).d n (n + 1) = |
| 189 | ModuleCat.ofHom (K.d (n + 1) n).hom.dualMap := rfl |
| 190 | |
| 191 | attribute [local implicit_reducible] shortComplexFunctor' shortComplexFunctor |
| 192 | /-- Let `R` be a commutative ring and `K` a nonnegative chain complex of `R`-modules. For each `n`, |
| 193 | this identifies the three terms around degree `n` in the dual cochain complex with the reversed |
| 194 | linear duals of the three terms around `n` in `K`, including the adjacent differentials. -/ |
| 195 | @[implicit_reducible] |
| 196 | def linearDualCochainComplexScIso (K : ChainComplex (ModuleCat.{u} R) ℕ) (n : ℕ) : |
| 197 | (linearDualCochainComplex K).sc n ≅ (CategoryTheory.ShortComplex.linearDual (K.sc n)) := |
| 198 | have hprev : (ComplexShape.up ℕ).prev n = (ComplexShape.down ℕ).next n := by cases n <;> simp |
| 199 | have hnext : (ComplexShape.up ℕ).next n = (ComplexShape.down ℕ).prev n := by simp |
| 200 | (linearDualCochainComplex K).isoSc' (c := ComplexShape.up ℕ) _ _ _ hprev hnext --≪≫ |
| 201 | |
| 202 | variable {K L M : ChainComplex (ModuleCat.{u} R) ℕ} |
| 203 | |
| 204 | /-- Let `R` be a commutative ring and `f: K → L` a map of nonnegative chain complexes of |
| 205 | `R`-modules. This map of dual cochain complexes `L* → K*` sends a degree-`n` functional `φ` to |
| 206 | `φ ∘ f_n`. -/ |
| 207 | @[implicit_reducible, simps f] |
| 208 | def linearDualMap (f : K ⟶ L) : |
| 209 | (linearDualCochainComplex L) ⟶ (linearDualCochainComplex K) where |
| 210 | f n := ModuleCat.ofHom (f.f n).hom.dualMap |
| 211 | comm' _ _ _ := by |
| 212 | rw [linearDualCochainComplex_d, linearDualCochainComplex_d, ← ModuleCat.ofHom_comp, |
| 213 | LinearMap.dualMap_comp_dualMap, ← ModuleCat.hom_comp, ← ModuleCat.ofHom_comp, |
| 214 | LinearMap.dualMap_comp_dualMap, ← ModuleCat.hom_comp, f.comm] |
| 215 | |
| 216 | @[simp] |
| 217 | lemma linearDualMap_id (K : ChainComplex (ModuleCat.{u} R) ℕ) : |
| 218 | linearDualMap (𝟙 K) = 𝟙 (linearDualCochainComplex K) := |
| 219 | rfl |
| 220 | |
| 221 | @[simp] |
| 222 | lemma linearDualMap_comp (f : K ⟶ L) (g : L ⟶ M) : |
| 223 | linearDualMap (f ≫ g) = linearDualMap g ≫ linearDualMap f := |
| 224 | rfl |
| 225 | |
| 226 | /-- Let `R` be a commutative ring and `e: K ≅ L` an isomorphism of nonnegative chain complexes of |
| 227 | `R`-modules. Precomposition with `e` gives this isomorphism of dual cochain complexes `L* ≅ K*`, |
| 228 | with inverse given by precomposition with `e⁻¹`. -/ |
| 229 | @[implicit_reducible] |
| 230 | def linearDualIso (e : K ≅ L) : |
| 231 | (linearDualCochainComplex L) ≅ (linearDualCochainComplex K) where |
| 232 | hom := linearDualMap e.hom |
| 233 | inv := linearDualMap e.inv |
| 234 | hom_inv_id := by rw [← linearDualMap_comp, e.inv_hom_id, linearDualMap_id] |
| 235 | inv_hom_id := by rw [← linearDualMap_comp, e.hom_inv_id, linearDualMap_id] |
| 236 | |
| 237 | end CommRing |
| 238 | |
| 239 | variable {R : Type u} [Field R] |
| 240 | |
| 241 | /-- Let `R` be a field and `K` a nonnegative chain complex of `R`-vector spaces. Evaluation of |
| 242 | cocycles on cycles gives this linear equivalence `H^n(Hom_R(K,R)) ≃ Hom_R(H_n(K), R)`. It |
| 243 | requires no finite-dimensionality assumption. -/ |
| 244 | def linearDualHomologyEquiv (K : ChainComplex (ModuleCat.{u} R) ℕ) (n : ℕ) : |
| 245 | (linearDualCochainComplex K).homology n ≃ₗ[R] Module.Dual R (K.homology n) := |
| 246 | (ShortComplex.homologyMapIso (linearDualCochainComplexScIso K n)).toLinearEquiv.trans |
| 247 | (CategoryTheory.ShortComplex.linearDualHomologyEquiv (K.sc n)) |
| 248 | |
| 249 | end HomologicalComplex |
| 250 | |
| 251 | end |
| 252 | |
| 253 | end OAI.Algebra.Homology.LinearDual |