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) 2024 Joël Riou. All rights reserved. |
| 3 | Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | Authors: Joël Riou, Nailin Guan |
| 5 | This file has been modified. |
| 6 | -/ |
| 7 | import Mathlib.Algebra.Homology.DerivedCategory.Ext.EnoughInjectives |
| 8 | import Mathlib.Algebra.Homology.DerivedCategory.Ext.EnoughProjectives |
| 9 | import Mathlib.CategoryTheory.Abelian.Exact |
| 10 | import Mathlib.Data.ENat.Lattice |
| 11 | |
| 12 | /-! # Dimension Basic -/ |
| 13 | |
| 14 | namespace OAI.AlgebraicGeometry.AbelianModuli.HilbertConstruction.Projective.DimensionBasic |
| 15 | |
| 16 | /-! |
| 17 | # Projective dimension |
| 18 | |
| 19 | In an abelian category `C`, we shall say that `X: C` has projective dimension `< n` |
| 20 | if all `Ext X Y i` vanish when `n ≤ i`. This defines a type class |
| 21 | `HasProjectiveDimensionLT X n`. We also define a type class |
| 22 | `HasProjectiveDimensionLE X n` as an abbreviation for |
| 23 | `HasProjectiveDimensionLT X (n + 1)`. |
| 24 | (Note that the fact that `X` is a zero object is equivalent to the condition |
| 25 | `HasProjectiveDimensionLT X 0`, but this cannot be expressed in terms of |
| 26 | `HasProjectiveDimensionLE`.) |
| 27 | |
| 28 | We also define the projective dimension in `WithBot ℕ∞` as `projectiveDimension`, |
| 29 | `projectiveDimension X = ⊥` iff `X` is zero and behaves as expected on non-negative values. |
| 30 | |
| 31 | -/ |
| 32 | |
| 33 | universe w v u |
| 34 | |
| 35 | section |
| 36 | |
| 37 | open _root_.CategoryTheory _root_.CategoryTheory.Abelian _root_.CategoryTheory.Limits |
| 38 | |
| 39 | open ZeroObject |
| 40 | |
| 41 | variable {C : Type u} [Category.{v} C] [Abelian C] |
| 42 | |
| 43 | /-- An object `X` in an abelian category has projective dimension `< n` if |
| 44 | all `Ext X Y i` vanish when `n ≤ i`. See also `HasProjectiveDimensionLE`. |
| 45 | (Do not use the `subsingleton'` field directly. Use the constructor |
| 46 | `HasProjectiveDimensionLT.mk`, and the lemmas `hasProjectiveDimensionLT_iff` and |
| 47 | `Ext.eq_zero_of_hasProjectiveDimensionLT`.) -/ |
| 48 | class HasProjectiveDimensionLT (X : C) (n : ℕ) : Prop where mk' :: |
| 49 | subsingleton' (i : ℕ) (hi : n ≤ i) ⦃Y : C⦄ : |
| 50 | let := HasExt.standard C |
| 51 | Subsingleton (Ext.{max u v} X Y i) |
| 52 | |
| 53 | /-- An object `X` in an abelian category has projective dimension `≤ n` if |
| 54 | all `Ext X Y i` vanish when `n + 1 ≤ i` -/ |
| 55 | abbrev HasProjectiveDimensionLE (X : C) (n : ℕ) : Prop := |
| 56 | HasProjectiveDimensionLT X (n + 1) |
| 57 | |
| 58 | namespace HasProjectiveDimensionLT |
| 59 | |
| 60 | variable [HasExt.{w} C] (X : C) (n : ℕ) |
| 61 | |
| 62 | lemma subsingleton [hX : HasProjectiveDimensionLT X n] (i : ℕ) (hi : n ≤ i) (Y : C) : |
| 63 | Subsingleton (Ext.{w} X Y i) := by |
| 64 | let := HasExt.standard C |
| 65 | have := hX.subsingleton' i hi |
| 66 | exact Ext.chgUniv.{w, max u v}.symm.subsingleton |
| 67 | |
| 68 | variable {X n} in |
| 69 | lemma mk (hX : ∀ (i : ℕ) (_ : n ≤ i) ⦃Y : C⦄, ∀ (e : Ext X Y i), e = 0) : |
| 70 | HasProjectiveDimensionLT X n where |
| 71 | subsingleton' i hi Y := by |
| 72 | have : Subsingleton (Ext X Y i) := ⟨fun e₁ e₂ ↦ by simp only [hX i hi]⟩ |
| 73 | let := HasExt.standard C |
| 74 | exact Ext.chgUniv.{max u v, w}.symm.subsingleton |
| 75 | |
| 76 | end HasProjectiveDimensionLT |
| 77 | |
| 78 | lemma Abelian.Ext.eq_zero_of_hasProjectiveDimensionLT [HasExt.{w} C] |
| 79 | {X Y : C} {i : ℕ} (e : Ext X Y i) (n : ℕ) [HasProjectiveDimensionLT X n] |
| 80 | (hi : n ≤ i) : e = 0 := |
| 81 | (HasProjectiveDimensionLT.subsingleton X n i hi Y).elim _ _ |
| 82 | |
| 83 | section |
| 84 | |
| 85 | variable (X : C) (n : ℕ) |
| 86 | |
| 87 | lemma hasProjectiveDimensionLT_iff [HasExt.{w} C] : |
| 88 | HasProjectiveDimensionLT X n ↔ |
| 89 | ∀ (i : ℕ) (_ : n ≤ i) ⦃Y : C⦄, ∀ (e : Ext X Y i), e = 0 := |
| 90 | ⟨fun _ _ hi _ e ↦ DimensionBasic.Abelian.Ext.eq_zero_of_hasProjectiveDimensionLT e n hi, |
| 91 | HasProjectiveDimensionLT.mk⟩ |
| 92 | |
| 93 | variable {X} in |
| 94 | lemma Limits.IsZero.hasProjectiveDimensionLT_zero (hX : IsZero X) : |
| 95 | HasProjectiveDimensionLT X 0 := by |
| 96 | let := HasExt.standard C |
| 97 | rw [hasProjectiveDimensionLT_iff] |
| 98 | intro i hi Y e |
| 99 | rw [← e.mk₀_id_comp, hX.eq_of_src (𝟙 X) 0, Ext.mk₀_zero, Ext.zero_comp] |
| 100 | |
| 101 | instance : HasProjectiveDimensionLT (0 : C) 0 := |
| 102 | DimensionBasic.Limits.IsZero.hasProjectiveDimensionLT_zero (isZero_zero C) |
| 103 | |
| 104 | lemma isZero_of_hasProjectiveDimensionLT_zero [HasProjectiveDimensionLT X 0] : IsZero X := by |
| 105 | let := HasExt.standard C |
| 106 | rw [IsZero.iff_id_eq_zero] |
| 107 | apply Ext.homEquiv₀.symm.injective |
| 108 | simpa only [Ext.homEquiv₀_symm_apply, Ext.mk₀_zero] |
| 109 | using DimensionBasic.Abelian.Ext.eq_zero_of_hasProjectiveDimensionLT _ 0 (by rfl) |
| 110 | |
| 111 | lemma hasProjectiveDimensionLT_zero_iff_isZero : HasProjectiveDimensionLT X 0 ↔ IsZero X := |
| 112 | ⟨fun _ ↦ isZero_of_hasProjectiveDimensionLT_zero X, |
| 113 | fun h ↦ DimensionBasic.Limits.IsZero.hasProjectiveDimensionLT_zero h⟩ |
| 114 | |
| 115 | lemma hasProjectiveDimensionLT_of_ge (m : ℕ) (h : n ≤ m) |
| 116 | [HasProjectiveDimensionLT X n] : |
| 117 | HasProjectiveDimensionLT X m := by |
| 118 | let := HasExt.standard C |
| 119 | rw [hasProjectiveDimensionLT_iff] |
| 120 | intro i hi Y e |
| 121 | exact DimensionBasic.Abelian.Ext.eq_zero_of_hasProjectiveDimensionLT e n (by lia) |
| 122 | |
| 123 | instance [HasProjectiveDimensionLT X n] (k : ℕ) : |
| 124 | HasProjectiveDimensionLT X (n + k) := |
| 125 | hasProjectiveDimensionLT_of_ge X n (n + k) (by lia) |
| 126 | |
| 127 | instance [HasProjectiveDimensionLT X n] (k : ℕ) : |
| 128 | HasProjectiveDimensionLT X (k + n) := |
| 129 | hasProjectiveDimensionLT_of_ge X n (k + n) (by lia) |
| 130 | |
| 131 | instance [HasProjectiveDimensionLT X n] : |
| 132 | HasProjectiveDimensionLT X n.succ := |
| 133 | inferInstanceAs (HasProjectiveDimensionLT X (n + 1)) |
| 134 | |
| 135 | instance [Projective X] : HasProjectiveDimensionLT X 1 := by |
| 136 | let := HasExt.standard C |
| 137 | rw [hasProjectiveDimensionLT_iff] |
| 138 | intro i hi Y e |
| 139 | obtain _ | i := i |
| 140 | · simp at hi |
| 141 | · exact e.eq_zero_of_projective |
| 142 | |
| 143 | variable {X} in |
| 144 | lemma projective_iff_subsingleton_ext_one [HasExt.{w} C] : |
| 145 | Projective X ↔ ∀ ⦃Y : C⦄, Subsingleton (Ext X Y 1) := by |
| 146 | refine ⟨fun h ↦ HasProjectiveDimensionLT.subsingleton X 1 1 (by rfl), |
| 147 | fun h ↦ ⟨fun f g _ ↦ ?_⟩⟩ |
| 148 | have : Epi (ShortComplex.kernelSequence g).g := by |
| 149 | change Epi g |
| 150 | infer_instance |
| 151 | obtain ⟨φ, hφ⟩ := |
| 152 | Ext.covariant_sequence_exact₃ _ { exact := ShortComplex.kernelSequence_exact g } |
| 153 | (Ext.mk₀ f) (zero_add 1) (by subsingleton) |
| 154 | obtain ⟨φ, rfl⟩ := Ext.homEquiv₀.symm.surjective φ |
| 155 | exact ⟨φ, Ext.homEquiv₀.symm.injective ((Ext.mk₀_comp_mk₀ φ g).symm.trans hφ)⟩ |
| 156 | |
| 157 | variable {X} in |
| 158 | lemma projective_iff_hasProjectiveDimensionLT_one : |
| 159 | Projective X ↔ HasProjectiveDimensionLT X 1 := by |
| 160 | let := HasExt.standard C |
| 161 | exact ⟨fun _ ↦ inferInstance, fun _ ↦ projective_iff_subsingleton_ext_one.2 |
| 162 | (HasProjectiveDimensionLT.subsingleton X 1 1 (by rfl))⟩ |
| 163 | |
| 164 | lemma projective_iff_hasProjectiveDimensionLE_zero : Projective X ↔ HasProjectiveDimensionLE X 0 := |
| 165 | projective_iff_hasProjectiveDimensionLT_one |
| 166 | |
| 167 | instance (priority := low) [HasProjectiveDimensionLT X 1] : Projective X := |
| 168 | projective_iff_hasProjectiveDimensionLT_one.mpr ‹_› |
| 169 | |
| 170 | end |
| 171 | |
| 172 | lemma Retract.hasProjectiveDimensionLT {X Y : C} (h : Retract X Y) (n : ℕ) |
| 173 | [HasProjectiveDimensionLT Y n] : |
| 174 | HasProjectiveDimensionLT X n := by |
| 175 | let := HasExt.standard C |
| 176 | rw [hasProjectiveDimensionLT_iff] |
| 177 | intro i hi T x |
| 178 | rw [← x.mk₀_id_comp, ← h.retract, ← Ext.mk₀_comp_mk₀, |
| 179 | Ext.comp_assoc_of_second_deg_zero, |
| 180 | DimensionBasic.Abelian.Ext.eq_zero_of_hasProjectiveDimensionLT |
| 181 | ((Ext.mk₀ h.r).comp x (zero_add i)) n hi, |
| 182 | Ext.comp_zero] |
| 183 | |
| 184 | lemma hasProjectiveDimensionLT_of_iso {X X' : C} (e : X ≅ X') (n : ℕ) |
| 185 | [HasProjectiveDimensionLT X n] : |
| 186 | HasProjectiveDimensionLT X' n := |
| 187 | DimensionBasic.Retract.hasProjectiveDimensionLT e.symm.retract n |
| 188 | |
| 189 | namespace ShortComplex.ShortExact |
| 190 | open _root_.CategoryTheory.ShortComplex |
| 191 | |
| 192 | open _root_.CategoryTheory.ShortComplex.ShortExact |
| 193 | |
| 194 | variable {S : ShortComplex C} (hS : S.ShortExact) (n : ℕ) |
| 195 | include hS |
| 196 | |
| 197 | -- In the following lemmas, the parameters `HasProjectiveDimensionLT` are |
| 198 | -- explicit as it is unlikely we may infer them, unless the short complex `S` |
| 199 | -- was declared reducible |
| 200 | |
| 201 | lemma hasProjectiveDimensionLT_X₂ (h₁ : HasProjectiveDimensionLT S.X₁ n) |
| 202 | (h₃ : HasProjectiveDimensionLT S.X₃ n) : |
| 203 | HasProjectiveDimensionLT S.X₂ n := by |
| 204 | let := HasExt.standard C |
| 205 | rw [hasProjectiveDimensionLT_iff] |
| 206 | intro i hi Y x₂ |
| 207 | obtain ⟨x₃, rfl⟩ := Ext.contravariant_sequence_exact₂ hS _ x₂ |
| 208 | (DimensionBasic.Abelian.Ext.eq_zero_of_hasProjectiveDimensionLT _ n hi) |
| 209 | rw [DimensionBasic.Abelian.Ext.eq_zero_of_hasProjectiveDimensionLT x₃ n hi, Ext.comp_zero] |
| 210 | |
| 211 | lemma hasProjectiveDimensionLT_X₃ (h₁ : HasProjectiveDimensionLT S.X₁ n) |
| 212 | (h₂ : HasProjectiveDimensionLT S.X₂ (n + 1)) : |
| 213 | HasProjectiveDimensionLT S.X₃ (n + 1) := by |
| 214 | let := HasExt.standard C |
| 215 | rw [hasProjectiveDimensionLT_iff] |
| 216 | rintro (_ | i) hi Y x₃ |
| 217 | · simp at hi |
| 218 | · obtain ⟨x₁, rfl⟩ := Ext.contravariant_sequence_exact₃ hS _ x₃ |
| 219 | (DimensionBasic.Abelian.Ext.eq_zero_of_hasProjectiveDimensionLT _ (n + 1) hi) (add_comm _ _) |
| 220 | rw [DimensionBasic.Abelian.Ext.eq_zero_of_hasProjectiveDimensionLT x₁ n (by lia), Ext.comp_zero] |
| 221 | |
| 222 | lemma hasProjectiveDimensionLT_X₁ (h₂ : HasProjectiveDimensionLT S.X₂ n) |
| 223 | (h₃ : HasProjectiveDimensionLT S.X₃ (n + 1)) : |
| 224 | HasProjectiveDimensionLT S.X₁ n := by |
| 225 | let := HasExt.standard C |
| 226 | rw [hasProjectiveDimensionLT_iff] |
| 227 | intro i hi Y x₁ |
| 228 | obtain ⟨x₂, rfl⟩ := Ext.contravariant_sequence_exact₁ hS _ x₁ (add_comm _ _) |
| 229 | (DimensionBasic.Abelian.Ext.eq_zero_of_hasProjectiveDimensionLT _ (n + 1) (by lia)) |
| 230 | rw [DimensionBasic.Abelian.Ext.eq_zero_of_hasProjectiveDimensionLT x₂ n (by lia), Ext.comp_zero] |
| 231 | |
| 232 | lemma hasProjectiveDimensionLT_X₃_iff (n : ℕ) (h₂ : Projective S.X₂) : |
| 233 | HasProjectiveDimensionLT S.X₃ (n + 2) ↔ HasProjectiveDimensionLT S.X₁ (n + 1) := |
| 234 | ⟨fun _ ↦ hasProjectiveDimensionLT_X₁ |
| 235 | hS (n + 1) inferInstance inferInstance, |
| 236 | fun _ ↦ hasProjectiveDimensionLT_X₃ |
| 237 | hS (n + 1) inferInstance inferInstance⟩ |
| 238 | |
| 239 | end ShortComplex.ShortExact |
| 240 | |
| 241 | instance (X Y : C) (n : ℕ) [HasProjectiveDimensionLT X n] [HasProjectiveDimensionLT Y n] : |
| 242 | HasProjectiveDimensionLT (X ⊞ Y) n := |
| 243 | DimensionBasic.ShortComplex.ShortExact.hasProjectiveDimensionLT_X₂ |
| 244 | (ShortComplex.Splitting.ofHasBinaryBiproduct X Y).shortExact n ‹_› ‹_› |
| 245 | |
| 246 | lemma hasProjectiveDimensionLT_of_enoughInjectives [HasExt.{w} C] [EnoughInjectives C] (X : C) |
| 247 | (n : ℕ) (hX : ∀ Y : C, Subsingleton (Ext X Y n)) : HasProjectiveDimensionLT X n := by |
| 248 | suffices ∀ ⦃d : ℕ⦄ ⦃Y : C⦄ (e : Ext X Y d) (k : ℕ), d = n + k → e = 0 from |
| 249 | HasProjectiveDimensionLT.mk (fun i hi Y e ↦ by |
| 250 | obtain ⟨k, rfl⟩ := Nat.exists_eq_add_of_le hi |
| 251 | exact this e k rfl) |
| 252 | intro d Y e k hd |
| 253 | induction k generalizing d Y with |
| 254 | | zero => |
| 255 | obtain rfl : d = n := by simpa using hd |
| 256 | subsingleton |
| 257 | | succ k hk => |
| 258 | let ⟨p⟩ := EnoughInjectives.presentation Y |
| 259 | have h : (ShortComplex.mk _ _ (cokernel.condition p.f)).ShortExact := |
| 260 | { exact := ShortComplex.cokernelSequence_exact p.f } |
| 261 | have hd : n + k + 1 = d := by lia |
| 262 | obtain ⟨x, rfl⟩ := Ext.covariant_sequence_exact₁ X h e |
| 263 | (by subst hd; apply Ext.eq_zero_of_injective) hd |
| 264 | simp [hk x rfl] |
| 265 | |
| 266 | end |
| 267 | |
| 268 | open _root_.CategoryTheory _root_.CategoryTheory.Abelian _root_.CategoryTheory.Limits |
| 269 | |
| 270 | variable {C : Type u} [Category.{v, u} C] [Abelian C] |
| 271 | |
| 272 | /-- The projective dimension of an object in an abelian category. -/ |
| 273 | noncomputable def projectiveDimension (X : C) : WithBot ℕ∞ := |
| 274 | sInf {n : WithBot ℕ∞ | ∀ (i : ℕ), n < i → HasProjectiveDimensionLT X i} |
| 275 | |
| 276 | lemma projectiveDimension_eq_of_iso {X Y : C} (e : X ≅ Y) : |
| 277 | projectiveDimension X = projectiveDimension Y := by |
| 278 | simp only [projectiveDimension] |
| 279 | congr! 5 |
| 280 | exact ⟨fun h ↦ hasProjectiveDimensionLT_of_iso e _, |
| 281 | fun h ↦ hasProjectiveDimensionLT_of_iso e.symm _⟩ |
| 282 | |
| 283 | lemma Retract.projectiveDimension_le {X Y : C} (h : Retract X Y) : |
| 284 | projectiveDimension X ≤ projectiveDimension Y := |
| 285 | sInf_le_sInf_of_subset_insert_top (fun n hn ↦ by |
| 286 | simp only [Set.mem_ofPred_eq, not_top_lt, IsEmpty.forall_iff, implies_true, |
| 287 | Set.insert_eq_of_mem] at hn ⊢ |
| 288 | intro i hi |
| 289 | have := hn i hi |
| 290 | exact DimensionBasic.Retract.hasProjectiveDimensionLT h i) |
| 291 | |
| 292 | lemma projectiveDimension_lt_iff {X : C} {n : ℕ} : |
| 293 | projectiveDimension X < n ↔ HasProjectiveDimensionLT X n := by |
| 294 | refine ⟨fun h ↦ ?_, fun h ↦ sInf_lt_iff.2 ?_⟩ |
| 295 | · have : projectiveDimension X ∈ _ := csInf_mem ⟨⊤, by simp⟩ |
| 296 | simp only [Set.mem_ofPred_eq] at this |
| 297 | exact this _ h |
| 298 | · obtain _ | n := n |
| 299 | · exact ⟨⊥, fun _ _ ↦ hasProjectiveDimensionLT_of_ge _ 0 _ (by simp), by decide⟩ |
| 300 | · exact ⟨n, fun i hi ↦ hasProjectiveDimensionLT_of_ge _ (n + 1) _ (by simpa using hi), |
| 301 | by simp [ENat.WithBot.lt_add_one_iff]⟩ |
| 302 | |
| 303 | lemma projectiveDimension_le_iff (X : C) (n : ℕ) : |
| 304 | projectiveDimension X ≤ n ↔ HasProjectiveDimensionLE X n := by |
| 305 | simp [← projectiveDimension_lt_iff, ← ENat.WithBot.lt_add_one_iff] |
| 306 | |
| 307 | lemma projectiveDimension_ge_iff (X : C) (n : ℕ) : |
| 308 | n ≤ projectiveDimension X ↔ ¬ HasProjectiveDimensionLT X n := by |
| 309 | contrapose!; exact projectiveDimension_lt_iff |
| 310 | |
| 311 | lemma projectiveDimension_eq_bot_iff (X : C) : |
| 312 | projectiveDimension X = ⊥ ↔ Limits.IsZero X := by |
| 313 | rw [← hasProjectiveDimensionLT_zero_iff_isZero, ← projectiveDimension_lt_iff, |
| 314 | Nat.cast_zero, ← WithBot.lt_coe_bot, bot_eq_zero', WithBot.coe_zero] |
| 315 | |
| 316 | lemma projectiveDimension_ne_top_iff (X : C) : |
| 317 | projectiveDimension X ≠ ⊤ ↔ ∃ n, HasProjectiveDimensionLE X n := by |
| 318 | generalize hd : projectiveDimension X = d |
| 319 | induction d with |
| 320 | | bot => |
| 321 | simp only [ne_eq, bot_ne_top, not_false_eq_true, true_iff] |
| 322 | exact ⟨0, by simp [← projectiveDimension_le_iff, hd]⟩ |
| 323 | | coe d => |
| 324 | induction d with |
| 325 | | top => |
| 326 | by_contra! |
| 327 | simp only [WithBot.coe_top, ne_eq, not_true_eq_false, false_and, true_and, false_or] at this |
| 328 | obtain ⟨n, hn⟩ := this |
| 329 | rw [← projectiveDimension_le_iff, hd, WithBot.coe_top, top_le_iff] at hn |
| 330 | exact ENat.natCast_ne_top _ ((WithBot.coe_eq_coe).1 hn) |
| 331 | | coe d => |
| 332 | simp only [ne_eq, WithBot.coe_eq_top, ENat.natCast_ne_top, not_false_eq_true, true_iff] |
| 333 | exact ⟨d, by simpa only [← projectiveDimension_le_iff] using! hd.le⟩ |
| 334 | |
| 335 | lemma projectiveDimension_eq_zero_iff (X : C) : |
| 336 | projectiveDimension X = 0 ↔ Projective X ∧ ¬ Limits.IsZero X := by |
| 337 | rw [← projectiveDimension_eq_bot_iff, projective_iff_hasProjectiveDimensionLE_zero, |
| 338 | ← projectiveDimension_le_iff, ← WithBot.lt_zero_iff_eq_bot, not_lt, Nat.cast_zero, |
| 339 | le_antisymm_iff] |
| 340 | |
| 341 | end OAI.AlgebraicGeometry.AbelianModuli.HilbertConstruction.Projective.DimensionBasic |