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 (c) 2025 Nailin Guan. All rights reserved. |
| 3 | Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | Authors: Nailin Guan |
| 5 | This file has been modified. |
| 6 | -/ |
| 7 | import Mathlib.Algebra.Category.Grp.Zero |
| 8 | import OAI.AlgebraicGeometry.AbelianModuli.HilbertConstruction.Finite.ModuleExt |
| 9 | import OAI.AlgebraicGeometry.AbelianModuli.HilbertConstruction.Module.ProjectiveDimension |
| 10 | import Mathlib.Algebra.Homology.DerivedCategory.Ext.Linear |
| 11 | import Mathlib.RingTheory.LocalRing.Module |
| 12 | import OAI.AlgebraicGeometry.AbelianModuli.HilbertConstruction.Scalar.RegularCategory |
| 13 | import OAI.AlgebraicGeometry.AbelianModuli.HilbertConstruction.Regular.SequenceBasic |
| 14 | |
| 15 | /-! # Sequence Projective Dimension -/ |
| 16 | |
| 17 | namespace OAI.AlgebraicGeometry.AbelianModuli.HilbertConstruction.Regular.SequenceProjectiveDimension |
| 18 | |
| 19 | noncomputable section |
| 20 | |
| 21 | open _root_.ModuleCat |
| 22 | |
| 23 | /- Adapted to HilbertConstruction-local declarations and default elaboration settings. |
| 24 | The projective dimension computation uses the same regular-sequence definition. -/ |
| 25 | |
| 26 | universe v u |
| 27 | |
| 28 | variable {R : Type u} [CommRing R] [Small.{v} R] |
| 29 | |
| 30 | open _root_.CategoryTheory Abelian IsLocalRing _root_.Module |
| 31 | |
| 32 | private theorem nontrivialQuotSMul {R : Type*} [CommRing R] [IsLocalRing R] |
| 33 | (M : Type*) [AddCommGroup M] [Module R M] [Module.Finite R M] [Nontrivial M] |
| 34 | {x : R} (hx : x ∈ maximalIdeal R) : Nontrivial (QuotSMulTop x M) := by |
| 35 | apply Submodule.Quotient.nontrivial_iff.mpr (Ne.symm _) |
| 36 | exact Submodule.top_ne_pointwise_smul_of_mem_jacobson_annihilator |
| 37 | (maximalIdeal_le_jacobson _ hx) |
| 38 | |
| 39 | namespace ModuleCat |
| 40 | |
| 41 | section |
| 42 | |
| 43 | variable [IsNoetherianRing R] |
| 44 | |
| 45 | lemma hasProjectiveDimensionLT_of_forall_finite (M : ModuleCat.{v} R) [Module.Finite R M] (n : ℕ) |
| 46 | (h : ∀ L : ModuleCat.{v} R, Module.Finite R L → Subsingleton (Ext M L n)) : |
| 47 | HilbertConstruction.Projective.DimensionBasic.HasProjectiveDimensionLT M n := by |
| 48 | induction n generalizing M with |
| 49 | | zero => |
| 50 | have : Subsingleton (M ⟶ M) := Ext.homEquiv₀.subsingleton_congr.mp (h M ‹_›) |
| 51 | have : Limits.IsZero M := (Limits.IsZero.iff_id_eq_zero M).mpr (Subsingleton.eq_zero (𝟙 M)) |
| 52 | exact HilbertConstruction.Projective.DimensionBasic.Limits.IsZero.hasProjectiveDimensionLT_zero this |
| 53 | | succ n hn => |
| 54 | rcases Module.exists_finite_presentation R M with ⟨_, _, _, _, _, f, surjf⟩ |
| 55 | let S : ShortComplex (ModuleCat.{v} R) := f.shortComplexKer |
| 56 | have hS : S.ShortExact := LinearMap.shortExact_shortComplexKer surjf |
| 57 | match n with |
| 58 | | 0 => |
| 59 | simp only [zero_add, ← HilbertConstruction.Projective.DimensionBasic.projective_iff_hasProjectiveDimensionLT_one] |
| 60 | have : Subsingleton (Ext M S.X₁ 1) := h S.X₁ inferInstance |
| 61 | rcases Ext.covariant_sequence_exact₃ M hS (Ext.mk₀ (𝟙 M)) (zero_add 1) |
| 62 | (Subsingleton.eq_zero _) with ⟨f', hf'⟩ |
| 63 | rcases (Ext.mk₀_bijective M S.X₂).2 f' with ⟨f, hf⟩ |
| 64 | rw [← hf, Ext.mk₀_comp_mk₀, (Ext.mk₀_bijective _ _).1.eq_iff] at hf' |
| 65 | exact (Retract.mk f S.g hf').projective |
| 66 | | n + 1 => |
| 67 | rw [HilbertConstruction.Projective.DimensionBasic.ShortComplex.ShortExact.hasProjectiveDimensionLT_X₃_iff hS n inferInstance] |
| 68 | have (L : ModuleCat.{v} R) : Subsingleton (Ext S.X₁ L (n + 1)) ↔ |
| 69 | Subsingleton (Ext M L (n + 2)) := by |
| 70 | have (m : ℕ) : Subsingleton (Ext S.X₂ L (m + 1)) := Ext.subsingleton_of_projective S.X₂ L m |
| 71 | have isi : IsIso (AddCommGrpCat.ofHom (hS.extClass.precomp L (add_comm 1 _))) := |
| 72 | (Ext.contravariantSequence_exact hS L (n + 1) (n + 2) |
| 73 | (add_comm 1 _)).isIso_map' 1 (by decide) |
| 74 | ((AddCommGrpCat.of _).isZero_of_subsingleton.eq_zero_of_src _) |
| 75 | ((AddCommGrpCat.of _).isZero_of_subsingleton.eq_zero_of_tgt _) |
| 76 | exact (asIso (AddCommGrpCat.ofHom (hS.extClass.precomp L |
| 77 | (add_comm 1 _)))).addCommGroupIsoToAddEquiv.subsingleton_congr |
| 78 | apply hn S.X₁ |
| 79 | simpa [this] using h |
| 80 | |
| 81 | end |
| 82 | |
| 83 | variable [IsLocalRing R] [IsNoetherianRing R] |
| 84 | |
| 85 | lemma projectiveDimension_quotSMulTop_eq_succ_of_isSMulRegular (M : ModuleCat.{v} R) |
| 86 | [Module.Finite R M] (x : R) (reg : IsSMulRegular M x) (mem : x ∈ maximalIdeal R) : |
| 87 | HilbertConstruction.Projective.DimensionBasic.projectiveDimension (ModuleCat.of R (QuotSMulTop x M)) = HilbertConstruction.Projective.DimensionBasic.projectiveDimension M + 1 := by |
| 88 | have sub : Subsingleton M ↔ Subsingleton (QuotSMulTop x M) := by |
| 89 | refine ⟨fun h ↦ inferInstance, fun h ↦ ?_⟩ |
| 90 | contrapose! h |
| 91 | exact (nontrivialQuotSMul M mem) |
| 92 | have aux (n : ℕ) : HilbertConstruction.Projective.DimensionBasic.projectiveDimension (ModuleCat.of R (QuotSMulTop x M)) ≤ n ↔ |
| 93 | HilbertConstruction.Projective.DimensionBasic.projectiveDimension M + 1 ≤ n := by |
| 94 | match n with |
| 95 | | 0 => |
| 96 | rw [HilbertConstruction.Projective.DimensionBasic.projectiveDimension_le_iff] |
| 97 | simp only [HilbertConstruction.Projective.DimensionBasic.HasProjectiveDimensionLE, zero_add, ← HilbertConstruction.Projective.DimensionBasic.projective_iff_hasProjectiveDimensionLT_one, |
| 98 | CharP.cast_eq_zero, ENat.WithBot.add_one_le_zero_iff, HilbertConstruction.Projective.DimensionBasic.projectiveDimension_eq_bot_iff, |
| 99 | ModuleCat.isZero_iff_subsingleton, sub, ← HilbertConstruction.Module.CategoryProjectives.IsProjective.iff_projective] |
| 100 | refine ⟨fun h ↦ ?_, fun h ↦ Projective.of_free⟩ |
| 101 | have : Module.Free R (QuotSMulTop x M) := Module.free_of_flat_of_isLocalRing |
| 102 | by_contra! ntr |
| 103 | have := QuotSMulTop.mem_annihilator M x |
| 104 | simp only [annihilator_eq_bot.mpr inferInstance, Submodule.mem_bot] at this |
| 105 | simp only [this, IsSMulRegular.zero_iff_subsingleton] at reg |
| 106 | absurd not_subsingleton_iff_nontrivial.mpr ntr |
| 107 | infer_instance |
| 108 | | n + 1 => |
| 109 | nth_rw 2 [← Nat.cast_one, Nat.cast_add] |
| 110 | simp only [ENat.WithBot.add_le_add_natCast_right_iff, HilbertConstruction.Projective.DimensionBasic.projectiveDimension_le_iff] |
| 111 | let S := Scalar.RegularCategory.ModuleCat.smulShortComplex M x |
| 112 | have hS : S.ShortExact := Scalar.RegularCategory.IsSMulRegular.smulShortComplex_shortExact reg |
| 113 | refine ⟨fun h ↦ ?_, fun h ↦ HilbertConstruction.Projective.DimensionBasic.ShortComplex.ShortExact.hasProjectiveDimensionLT_X₃ hS (n + 1) h |
| 114 | (HilbertConstruction.Projective.DimensionBasic.hasProjectiveDimensionLT_of_ge M (n + 1) (n + 2) (Nat.le_add_right _ 1))⟩ |
| 115 | apply hasProjectiveDimensionLT_of_forall_finite |
| 116 | intro L _ |
| 117 | have zero := HilbertConstruction.Projective.DimensionBasic.HasProjectiveDimensionLT.subsingleton (ModuleCat.of R (QuotSMulTop x M)) |
| 118 | (n + 2) _ (le_refl _) L |
| 119 | have exac := Ext.contravariant_sequence_exact₁' hS L (n + 1) (n + 2) (add_comm 1 (n + 1)) |
| 120 | have epi := exac.epi_f ((@AddCommGrpCat.isZero_of_subsingleton _ zero).eq_zero_of_tgt _) |
| 121 | have : S.f = x • 𝟙 M := rfl |
| 122 | simp only [S, this, AddCommGrpCat.epi_iff_surjective, AddCommGrpCat.hom_ofHom] at epi |
| 123 | by_contra! ntr |
| 124 | have : x ∈ (Module.annihilator R (Ext M L (n + 1))).jacobson := |
| 125 | (IsLocalRing.maximalIdeal_le_jacobson _) mem |
| 126 | absurd Submodule.top_ne_pointwise_smul_of_mem_jacobson_annihilator this |
| 127 | rw [eq_comm, eq_top_iff] |
| 128 | intro y hy |
| 129 | rcases epi y with ⟨z, hz⟩ |
| 130 | change Ext M L (n + 1) at z |
| 131 | simp only [Scalar.RegularCategory.ModuleCat.smulShortComplex, Ext.mk₀_smul] at hz |
| 132 | change (x • Ext.mk₀ (𝟙 M)).comp z (zero_add (n + 1)) = y at hz |
| 133 | rw [Ext.smul_comp, Ext.mk₀_id_comp] at hz |
| 134 | simpa [← hz] using Submodule.smul_mem_pointwise_smul z x (⊤ : Submodule R (Ext M L (n + 1))) trivial |
| 135 | refine eq_of_forall_ge_iff (fun N ↦ ?_) |
| 136 | induction N with |
| 137 | | bot => |
| 138 | simpa [HilbertConstruction.Projective.DimensionBasic.projectiveDimension_eq_bot_iff, ModuleCat.isZero_iff_subsingleton] using sub.symm |
| 139 | | coe N => |
| 140 | induction N with |
| 141 | | top => simp |
| 142 | | coe n => simpa using aux n |
| 143 | |
| 144 | lemma projectiveDimension_quotient_eq_add_length_of_isWeaklyRegular (M : ModuleCat.{v} R) |
| 145 | [Nontrivial M] [Module.Finite R M] (rs : List R) (reg : SequenceBasic.RingTheory.Sequence.IsWeaklyRegular M rs) |
| 146 | (mem : ∀ r ∈ rs, r ∈ maximalIdeal R) : |
| 147 | HilbertConstruction.Projective.DimensionBasic.projectiveDimension (ModuleCat.of R (M ⧸ SequenceBasic.Ideal.ofList rs • (⊤ : Submodule R M))) = |
| 148 | HilbertConstruction.Projective.DimensionBasic.projectiveDimension M + rs.length := by |
| 149 | generalize len : rs.length = n |
| 150 | induction n generalizing M rs with |
| 151 | | zero => |
| 152 | rw [List.length_eq_zero_iff.mp len, SequenceBasic.Ideal.ofList_nil, Submodule.bot_smul] |
| 153 | simpa using HilbertConstruction.Projective.DimensionBasic.projectiveDimension_eq_of_iso (Submodule.quotEquivOfEqBot ⊥ rfl).toModuleIso |
| 154 | | succ n hn => |
| 155 | match rs with |
| 156 | | [] => simp at len |
| 157 | | x :: rs' => |
| 158 | simp only [List.mem_cons, forall_eq_or_imp] at mem |
| 159 | simp only [SequenceBasic.RingTheory.Sequence.isWeaklyRegular_cons_iff] at reg |
| 160 | have := nontrivialQuotSMul M mem.1 |
| 161 | simp only [List.length_cons, Nat.add_right_cancel_iff] at len |
| 162 | rw [Nat.cast_add, Nat.cast_one, HilbertConstruction.Projective.DimensionBasic.projectiveDimension_eq_of_iso |
| 163 | (SequenceBasic.Submodule.quotOfListConsSMulTopEquivQuotSMulTopInner M x rs').toModuleIso, add_comm _ 1, |
| 164 | ← add_assoc, ← projectiveDimension_quotSMulTop_eq_succ_of_isSMulRegular M x reg.1 mem.1, |
| 165 | ← hn (ModuleCat.of R (QuotSMulTop x M)) rs' reg.2 mem.2 len] |
| 166 | |
| 167 | lemma projectiveDimension_quotient_eq_length (rs : List R) (reg : SequenceBasic.RingTheory.Sequence.IsRegular R rs) : |
| 168 | HilbertConstruction.Projective.DimensionBasic.projectiveDimension (ModuleCat.of R (Shrink.{v} (R ⧸ SequenceBasic.Ideal.ofList rs))) = rs.length := by |
| 169 | have mem_max : ∀ x ∈ rs, x ∈ maximalIdeal R := by |
| 170 | intro x hx |
| 171 | apply IsLocalRing.le_maximalIdeal reg.2.symm |
| 172 | simpa using (Ideal.mem_span x).mpr fun p a ↦ a hx |
| 173 | let e : (Shrink.{v} (R ⧸ SequenceBasic.Ideal.ofList rs)) ≃ₗ[R] |
| 174 | (Shrink.{v} R) ⧸ SequenceBasic.Ideal.ofList rs • (⊤ : Submodule R (Shrink.{v} R)) := |
| 175 | ((Shrink.linearEquiv R _).trans (Submodule.Quotient.equiv _ _ (Shrink.linearEquiv R R).symm (by |
| 176 | nth_rw 1 [← (SequenceBasic.Ideal.ofList rs).mul_top, ← smul_eq_mul, Submodule.map_smul''] |
| 177 | simp ))) |
| 178 | rw [HilbertConstruction.Projective.DimensionBasic.projectiveDimension_eq_of_iso e.toModuleIso, |
| 179 | projectiveDimension_quotient_eq_add_length_of_isWeaklyRegular (ModuleCat.of R (Shrink.{v} R)) rs |
| 180 | ((SequenceBasic.LinearEquiv.isWeaklyRegular_congr (Shrink.linearEquiv R R) rs).mpr reg.1) mem_max, |
| 181 | HilbertConstruction.Module.ProjectiveDimension.ModuleCat.projectiveDimension_eq_zero_of_projective, zero_add] |
| 182 | |
| 183 | end ModuleCat |
| 184 | |
| 185 | end |
| 186 | |
| 187 | end OAI.AlgebraicGeometry.AbelianModuli.HilbertConstruction.Regular.SequenceProjectiveDimension |