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.RingTheory.Localization.Free |
| 2 | import Mathlib.RingTheory.Localization.FractionRing |
| 3 | import Mathlib.RingTheory.Flat.Basic |
| 4 | import Mathlib.RingTheory.TensorProduct.IsBaseChangeFree |
| 5 | import Mathlib.LinearAlgebra.Basis.VectorSpace |
| 6 | import Mathlib.AlgebraicGeometry.Morphisms.Flat |
| 7 | import Mathlib.RingTheory.KrullDimension.Zero |
| 8 | import Mathlib.RingTheory.LocalProperties.Reduced |
| 9 | import Mathlib.RingTheory.Spectrum.Prime.FreeLocus |
| 10 | |
| 11 | /-! # Generic Flatness -/ |
| 12 | |
| 13 | namespace OAI.ArithmeticGeometry.OrdinaryLocus.Openness.GenericFlatness.Construction |
| 14 | |
| 15 | noncomputable section |
| 16 | |
| 17 | /-! The generic-flatness step for finite morphisms in the Openness development. -/ |
| 18 | |
| 19 | open scoped TensorProduct |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | /-- At a minimal prime of a reduced ring, every localized module is free |
| 24 | because the local ring is a field. -/ |
| 25 | theorem minimalPrime_mem_freeLocus |
| 26 | (R M : Type*) [CommRing R] [IsReduced R] |
| 27 | [AddCommGroup M] [Module R M] |
| 28 | (q : Ideal R) (hq : q ∈ minimalPrimes R) : |
| 29 | (⟨q, hq.1.1⟩ : PrimeSpectrum R) ∈ Module.freeLocus R M := by |
| 30 | have : q.IsPrime := hq.1.1 |
| 31 | have : Ring.KrullDimLE 0 (Localization.AtPrime q) := |
| 32 | Ring.KrullDimLE.of_isLocalization q hq _ |
| 33 | let : Field (Localization.AtPrime q) := |
| 34 | Ring.KrullDimLE.isField_of_isReduced.toField |
| 35 | change Module.Free (Localization.AtPrime q) (LocalizedModule q.primeCompl M) |
| 36 | infer_instance |
| 37 | |
| 38 | /-- The free locus is dense over a reduced base. Finite presentation will |
| 39 | add openness, yielding the generic-flatness neighborhood. -/ |
| 40 | theorem dense_freeLocus_of_reduced |
| 41 | (R M : Type*) [CommRing R] [IsReduced R] |
| 42 | [AddCommGroup M] [Module R M] : Dense (Module.freeLocus R M) := by |
| 43 | intro p |
| 44 | obtain ⟨q, hq, hqp⟩ := Ideal.exists_minimalPrimes_le |
| 45 | (I := (⊥ : Ideal R)) (J := p.asIdeal) bot_le |
| 46 | let q' : PrimeSpectrum R := ⟨q, hq.1.1⟩ |
| 47 | have hspec : q' ⤳ p := (PrimeSpectrum.le_iff_specializes q' p).mp hqp |
| 48 | exact hspec.mem_closed isClosed_closure |
| 49 | (subset_closure (minimalPrime_mem_freeLocus R M q hq)) |
| 50 | |
| 51 | /-- A finitely presented module over a reduced ring is locally free on |
| 52 | a dense open subset of the spectrum. -/ |
| 53 | theorem dense_open_freeLocus_of_reduced |
| 54 | (R M : Type*) [CommRing R] [IsReduced R] |
| 55 | [AddCommGroup M] [Module R M] [Module.FinitePresentation R M] : |
| 56 | IsOpen (Module.freeLocus R M) ∧ Dense (Module.freeLocus R M) := |
| 57 | ⟨Module.isOpen_freeLocus, dense_freeLocus_of_reduced R M⟩ |
| 58 | |
| 59 | /-- A finitely presented module over a domain is free after inverting |
| 60 | one nonzero element. -/ |
| 61 | theorem exists_nonzero_free_localization |
| 62 | (R M : Type*) [CommRing R] [IsDomain R] |
| 63 | [AddCommGroup M] [Module R M] [Module.FinitePresentation R M] : |
| 64 | ∃ r : R, r ≠ 0 ∧ |
| 65 | Module.Free (Localization.Away r) (LocalizedModule.Away r M) := by |
| 66 | let K := FractionRing R |
| 67 | let f : M →ₗ[R] K ⊗[R] M := TensorProduct.mk R K M 1 |
| 68 | have : IsLocalizedModule (nonZeroDivisors R) f := by |
| 69 | dsimp [f, K] |
| 70 | infer_instance |
| 71 | have : Module.Free K (K ⊗[R] M) := by |
| 72 | change Module.Free (FractionRing R) (FractionRing R ⊗[R] M) |
| 73 | infer_instance |
| 74 | obtain ⟨r, hr, hfree, _⟩ := |
| 75 | Module.FinitePresentation.exists_free_localizedModule_powers |
| 76 | (nonZeroDivisors R) f K |
| 77 | exact ⟨r, mem_nonZeroDivisors_iff_ne_zero.mp hr, hfree⟩ |
| 78 | |
| 79 | /-- The resulting principal open has a flat localized module. -/ |
| 80 | theorem exists_nonzero_flat_localization |
| 81 | (R M : Type*) [CommRing R] [IsDomain R] |
| 82 | [AddCommGroup M] [Module R M] [Module.FinitePresentation R M] : |
| 83 | ∃ r : R, r ≠ 0 ∧ |
| 84 | Module.Flat (Localization.Away r) (LocalizedModule.Away r M) := by |
| 85 | obtain ⟨r, hr, hfree⟩ := exists_nonzero_free_localization R M |
| 86 | have : Module.Free (Localization.Away r) (LocalizedModule.Away r M) := hfree |
| 87 | exact ⟨r, hr, inferInstance⟩ |
| 88 | |
| 89 | /-- The same generic-flatness statement in the tensor-product model of base change. -/ |
| 90 | theorem exists_nonzero_flat_tensorLocalization |
| 91 | (R M : Type*) [CommRing R] [IsDomain R] |
| 92 | [AddCommGroup M] [Module R M] [Module.FinitePresentation R M] : |
| 93 | ∃ r : R, r ≠ 0 ∧ |
| 94 | Module.Flat (Localization.Away r) (Localization.Away r ⊗[R] M) := by |
| 95 | obtain ⟨r, hr, hflat⟩ := exists_nonzero_flat_localization R M |
| 96 | have : Module.Flat (Localization.Away r) (LocalizedModule.Away r M) := hflat |
| 97 | let e := (IsLocalizedModule.isBaseChange (Submonoid.powers r) (Localization.Away r) |
| 98 | (LocalizedModule.mkLinearMap (Submonoid.powers r) M)).equiv |
| 99 | exact ⟨r, hr, Module.Flat.of_linearEquiv e⟩ |
| 100 | |
| 101 | /-- A finite-presentation algebra module over a domain has a flat affine |
| 102 | base change over a nonempty principal open. -/ |
| 103 | theorem exists_nonzero_flat_affine_baseChange |
| 104 | (R B : Type u) [CommRing R] [IsDomain R] [CommRing B] [Algebra R B] |
| 105 | [Module.FinitePresentation R B] : |
| 106 | ∃ r : R, r ≠ 0 ∧ |
| 107 | AlgebraicGeometry.Flat |
| 108 | (AlgebraicGeometry.Spec.map (CommRingCat.ofHom |
| 109 | (algebraMap (Localization.Away r) (Localization.Away r ⊗[R] B)))) := by |
| 110 | obtain ⟨r, hr, hflat⟩ := exists_nonzero_flat_tensorLocalization R B |
| 111 | have : Module.Flat (Localization.Away r) (Localization.Away r ⊗[R] B) := hflat |
| 112 | refine ⟨r, hr, AlgebraicGeometry.Flat.SpecMap_iff.mpr ?_⟩ |
| 113 | exact (RingHom.flat_algebraMap_iff).mpr inferInstance |
| 114 | |
| 115 | /-- Generic flatness over a nonzero reduced ring, without requiring the |
| 116 | base to be irreducible. The localization is explicitly nontrivial. -/ |
| 117 | theorem exists_nontrivial_flat_affine_baseChange_of_reduced |
| 118 | (R B : Type u) [CommRing R] [IsReduced R] [Nontrivial R] |
| 119 | [CommRing B] [Algebra R B] [Module.FinitePresentation R B] : |
| 120 | ∃ r : R, Nontrivial (Localization.Away r) ∧ |
| 121 | AlgebraicGeometry.Flat |
| 122 | (AlgebraicGeometry.Spec.map (CommRingCat.ofHom |
| 123 | (algebraMap (Localization.Away r) (Localization.Away r ⊗[R] B)))) := by |
| 124 | have : Nonempty (PrimeSpectrum R) := PrimeSpectrum.nonempty_iff_nontrivial.mpr inferInstance |
| 125 | obtain ⟨q, hq⟩ := (dense_freeLocus_of_reduced R B).nonempty |
| 126 | have : Module.Free (Localization.AtPrime q.asIdeal) |
| 127 | (LocalizedModule q.asIdeal.primeCompl B) := hq |
| 128 | obtain ⟨r, hr, hfree, _⟩ := |
| 129 | Module.FinitePresentation.exists_free_localizedModule_powers |
| 130 | q.asIdeal.primeCompl (LocalizedModule.mkLinearMap q.asIdeal.primeCompl B) |
| 131 | (Localization.AtPrime q.asIdeal) |
| 132 | let φ : Localization.Away r →+* Localization.AtPrime q.asIdeal := |
| 133 | IsLocalization.map (M := Submonoid.powers r) (T := q.asIdeal.primeCompl) |
| 134 | (Localization.AtPrime q.asIdeal) (RingHom.id R) (Submonoid.powers_le.mpr hr) |
| 135 | have : Module.Free (Localization.Away r) (LocalizedModule.Away r B) := hfree |
| 136 | let e := (IsLocalizedModule.isBaseChange (Submonoid.powers r) (Localization.Away r) |
| 137 | (LocalizedModule.mkLinearMap (Submonoid.powers r) B)).equiv |
| 138 | have : Module.Flat (Localization.Away r) (Localization.Away r ⊗[R] B) := |
| 139 | Module.Flat.of_linearEquiv e |
| 140 | exact ⟨r, φ.domain_nontrivial, |
| 141 | AlgebraicGeometry.Flat.SpecMap_iff.mpr (RingHom.flat_algebraMap_iff.mpr inferInstance)⟩ |
| 142 | |
| 143 | end |
| 144 | |
| 145 | end OAI.ArithmeticGeometry.OrdinaryLocus.Openness.GenericFlatness.Construction |