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 | |
| 16 | This file has been modified. |
| 17 | -/ |
| 18 | |
| 19 | import Mathlib.Basic.Complex.Basic |
| 20 | import Mathlib.RingTheory.Ideal.Height |
| 21 | import Mathlib.RingTheory.QuasiFinite.Basic |
| 22 | import Mathlib.RingTheory.RingHom.StandardSmooth |
| 23 | |
| 24 | import Mathlib.RingTheory.KrullDimension.Field |
| 25 | import Mathlib.RingTheory.KrullDimension.Polynomial |
| 26 | import Mathlib.RingTheory.Unramified.LocalStructure |
| 27 | |
| 28 | namespace OAI.Algebra.RingTheory.SmoothKrullDimension |
| 29 | |
| 30 | open _root_.Algebra |
| 31 | open _root_.MvPolynomial |
| 32 | open _root_.RingHom |
| 33 | |
| 34 | /-! |
| 35 | # Krull dimension along a quasi-finite or standard smooth ring map |
| 36 | |
| 37 | A quasi-finite algebra has no room for a strictly larger chain of primes than its base, so the |
| 38 | comparison map on prime spectra is strictly monotone and the Krull dimension does not grow. When |
| 39 | the algebra is also flat, the height of a prime is the height of the prime below it. |
| 40 | |
| 41 | A standard smooth ring map of relative dimension `d` factors through a polynomial ring in `d` |
| 42 | variables, which bounds the Krull dimension of the target by that of the source plus `d`. Over a |
| 43 | field in which every maximal ideal of a finitely generated algebra has residue field the field |
| 44 | itself — a Jacobson-ring argument, applied here to `ℂ` — the bound is an equality. |
| 45 | -/ |
| 46 | |
| 47 | noncomputable section |
| 48 | |
| 49 | open _root_.CategoryTheory _root_.Topology |
| 50 | |
| 51 | section |
| 52 | |
| 53 | variable {R S : Type*} [CommRing R] [CommRing S] [Algebra R S] |
| 54 | |
| 55 | /-- Contraction of prime ideals is strictly monotone for a quasi-finite algebra. -/ |
| 56 | lemma QuasiFinite.strictMono_primeSpectrumComap [QuasiFinite R S] : |
| 57 | StrictMono (PrimeSpectrum.comap (algebraMap R S)) := by |
| 58 | intro P Q hPQ |
| 59 | have hle : P.asIdeal.under R ≤ Q.asIdeal.under R := Ideal.comap_mono hPQ.le |
| 60 | refine lt_of_le_of_ne hle ?_ |
| 61 | intro heq |
| 62 | have heq' : P.asIdeal.under R = Q.asIdeal.under R := by |
| 63 | simpa [Ideal.under] using congrArg PrimeSpectrum.asIdeal heq |
| 64 | have hPQeq : P.asIdeal = Q.asIdeal := |
| 65 | QuasiFinite.eq_of_le_of_under_eq (R := R) P.asIdeal Q.asIdeal hPQ.le heq' |
| 66 | exact hPQ.ne (PrimeSpectrum.ext hPQeq) |
| 67 | |
| 68 | /-- A quasi-finite algebra cannot have larger Krull dimension than its base. -/ |
| 69 | lemma QuasiFinite.ringKrullDim_le [QuasiFinite R S] : |
| 70 | ringKrullDim S ≤ ringKrullDim R := by |
| 71 | rw [ringKrullDim, ringKrullDim] |
| 72 | exact Order.krullDim_le_of_strictMono _ _root_.OAI.Algebra.RingTheory.SmoothKrullDimension.QuasiFinite.strictMono_primeSpectrumComap |
| 73 | |
| 74 | /-- A flat quasi-finite algebra preserves the height of every prime under contraction. -/ |
| 75 | lemma QuasiFinite.height_eq_height_under [QuasiFinite R S] [Module.Flat R S] |
| 76 | (P : Ideal S) [P.IsPrime] : |
| 77 | P.height = (P.under R).height := by |
| 78 | calc |
| 79 | P.height = Order.height (⟨P, inferInstance⟩ : PrimeSpectrum S) := |
| 80 | PrimeSpectrum.height_eq_orderHeight (⟨P, inferInstance⟩ : PrimeSpectrum S) |
| 81 | _ = Order.height |
| 82 | (PrimeSpectrum.comap (algebraMap R S) (⟨P, inferInstance⟩ : PrimeSpectrum S)) := by |
| 83 | apply Order.height_eq_of_strictMono (PrimeSpectrum.comap (algebraMap R S)) |
| 84 | _root_.OAI.Algebra.RingTheory.SmoothKrullDimension.QuasiFinite.strictMono_primeSpectrumComap |
| 85 | intro Q p hp |
| 86 | have hp' : p.asIdeal < Q.asIdeal.under R := by |
| 87 | have hp'' : p.asIdeal < |
| 88 | (PrimeSpectrum.comap (algebraMap R S) Q).asIdeal := hp |
| 89 | simpa only [PrimeSpectrum.comap_asIdeal] using hp'' |
| 90 | obtain ⟨Q', hQ'Q, hQ'prime, hQ'over⟩ := |
| 91 | Q.asIdeal.exists_ideal_lt_liesOver_of_lt |
| 92 | (R := R) (p := p.asIdeal) (q := Q.asIdeal.under R) hp' |
| 93 | refine ⟨⟨Q', hQ'prime⟩, hQ'Q, ?_⟩ |
| 94 | apply PrimeSpectrum.ext |
| 95 | simpa [Ideal.under] using hQ'over.over.symm |
| 96 | _ = (P.under R).height := by |
| 97 | rw [show (P.under R) = |
| 98 | (PrimeSpectrum.comap (algebraMap R S) |
| 99 | (⟨P, inferInstance⟩ : PrimeSpectrum S)).asIdeal from rfl] |
| 100 | exact (PrimeSpectrum.height_eq_orderHeight |
| 101 | (PrimeSpectrum.comap (algebraMap R S) |
| 102 | (⟨P, inferInstance⟩ : PrimeSpectrum S))).symm |
| 103 | |
| 104 | end |
| 105 | |
| 106 | namespace RingHom |
| 107 | open _root_.RingHom |
| 108 | |
| 109 | variable {R S : Type*} [CommRing R] [CommRing S] |
| 110 | |
| 111 | /-- The contraction of a maximal ideal along a finite-type map from a Jacobson ring is maximal. -/ |
| 112 | lemma FiniteType.isMaximal_comap_of_isJacobsonRing [IsJacobsonRing R] {f : R →+* S} |
| 113 | (hf : f.FiniteType) (P : Ideal S) [P.IsMaximal] : (P.comap f).IsMaximal := by |
| 114 | let K := S ⧸ P |
| 115 | let q : S →+* K := Ideal.Quotient.mk P |
| 116 | let : Field K := Ideal.Quotient.field P |
| 117 | have hft : (q.comp f).FiniteType := hf.comp_surjective Ideal.Quotient.mk_surjective |
| 118 | have hfin : (q.comp f).Finite := |
| 119 | RingHom.finite_iff_finiteType_of_isJacobsonRing.mpr hft |
| 120 | have hmax : ((⊥ : Ideal K).comap (q.comp f)).IsMaximal := |
| 121 | Ideal.isMaximal_comap_of_isIntegral_of_isMaximal (q.comp f) hfin.to_isIntegral ⊥ |
| 122 | change (((⊥ : Ideal K).comap q).comap f).IsMaximal at hmax |
| 123 | have hq : (⊥ : Ideal K).comap q = P := by |
| 124 | rw [← RingHom.ker_eq_comap_bot, Ideal.mk_ker] |
| 125 | rwa [hq] at hmax |
| 126 | |
| 127 | /-- A standard-smooth algebra of relative dimension `d` has Krull dimension at most the |
| 128 | dimension of the base plus `d`. -/ |
| 129 | lemma IsStandardSmoothOfRelativeDimension.ringKrullDim_le_add {f : R →+* S} {d : ℕ} |
| 130 | [IsNoetherianRing R] |
| 131 | (hf : f.IsStandardSmoothOfRelativeDimension d) : |
| 132 | ringKrullDim S ≤ ringKrullDim R + d := by |
| 133 | obtain ⟨g, _, hg⟩ := hf.exists_etale_mvPolynomial |
| 134 | let : Algebra (MvPolynomial (Fin d) R) S := g.toAlgebra |
| 135 | let : Algebra.Etale (MvPolynomial (Fin d) R) S := |
| 136 | RingHom.etale_algebraMap.mp hg |
| 137 | calc |
| 138 | ringKrullDim S ≤ ringKrullDim (MvPolynomial (Fin d) R) := |
| 139 | _root_.OAI.Algebra.RingTheory.SmoothKrullDimension.QuasiFinite.ringKrullDim_le |
| 140 | _ = ringKrullDim R + d := by |
| 141 | simp |
| 142 | |
| 143 | /-- A standard-smooth complex algebra of relative dimension `d` has Krull dimension at most |
| 144 | `d`. -/ |
| 145 | lemma IsStandardSmoothOfRelativeDimension.ringKrullDim_le_complex {S : Type*} [CommRing S] |
| 146 | {f : ℂ →+* S} {d : ℕ} (hf : f.IsStandardSmoothOfRelativeDimension d) : |
| 147 | ringKrullDim S ≤ d := by |
| 148 | simpa only [ringKrullDim_eq_zero_of_field, WithBot.coe_zero, zero_add] using |
| 149 | (_root_.OAI.Algebra.RingTheory.SmoothKrullDimension.RingHom.IsStandardSmoothOfRelativeDimension.ringKrullDim_le_add hf) |
| 150 | |
| 151 | end RingHom |
| 152 | |
| 153 | namespace MvPolynomial |
| 154 | open _root_.MvPolynomial |
| 155 | |
| 156 | /-- Every maximal ideal of a polynomial ring in `d` variables over a field has height `d`. -/ |
| 157 | lemma height_eq_fin_of_isMaximal (K : Type*) [Field K] (d : ℕ) |
| 158 | (P : Ideal (MvPolynomial (Fin d) K)) [P.IsMaximal] : P.height = d := by |
| 159 | induction d with |
| 160 | | zero => |
| 161 | have hle : (↑P.height : WithBot ℕ∞) ≤ |
| 162 | ringKrullDim (MvPolynomial (Fin 0) K) := |
| 163 | Ideal.height_le_ringKrullDim_of_ne_top Ideal.IsPrime.ne_top' |
| 164 | simp only [MvPolynomial.ringKrullDim_of_isNoetherianRing, |
| 165 | ringKrullDim_eq_zero_of_field, ENat.card_eq_coe_fintype_card, Fintype.card_fin, |
| 166 | Nat.cast_zero, WithBot.coe_zero, zero_add] at hle |
| 167 | exact le_antisymm (WithBot.coe_le_coe.mp hle) bot_le |
| 168 | | succ n ih => |
| 169 | let e : MvPolynomial (Fin (n + 1)) K ≃+* Polynomial (MvPolynomial (Fin n) K) := |
| 170 | (MvPolynomial.finSuccEquiv K n).toRingEquiv |
| 171 | let Q : Ideal (Polynomial (MvPolynomial (Fin n) K)) := P.map e |
| 172 | let : Q.IsMaximal := Ideal.map_isMaximal_of_equiv e |
| 173 | have hunder : (Q.under (MvPolynomial (Fin n) K)).IsMaximal := by |
| 174 | change (Q.comap (Polynomial.C : MvPolynomial (Fin n) K →+* |
| 175 | Polynomial (MvPolynomial (Fin n) K))).IsMaximal |
| 176 | exact Polynomial.isMaximal_comap_C_of_isJacobsonRing |
| 177 | (R := MvPolynomial (Fin n) K) Q |
| 178 | calc |
| 179 | P.height = Q.height := (RingEquiv.height_map e P).symm |
| 180 | _ = (Q.under (MvPolynomial (Fin n) K)).height + 1 := |
| 181 | Polynomial.height_eq_height_add_one _ Q |
| 182 | _ = n + 1 := by rw [ih (Q.under (MvPolynomial (Fin n) K))] |
| 183 | |
| 184 | end MvPolynomial |
| 185 | |
| 186 | namespace RingHom |
| 187 | open _root_.RingHom |
| 188 | |
| 189 | /-- A nonzero standard-smooth complex algebra of relative dimension `d` has Krull dimension |
| 190 | exactly `d`. |
| 191 | |
| 192 | This global equality does not by itself give the pointwise catenary dimension formula. -/ |
| 193 | lemma IsStandardSmoothOfRelativeDimension.ringKrullDim_eq_complex {S : Type*} [CommRing S] |
| 194 | [Nontrivial S] {f : ℂ →+* S} {d : ℕ} |
| 195 | (hf : f.IsStandardSmoothOfRelativeDimension d) : ringKrullDim S = d := by |
| 196 | obtain ⟨g, _, hg⟩ := hf.exists_etale_mvPolynomial |
| 197 | let : Algebra (MvPolynomial (Fin d) ℂ) S := g.toAlgebra |
| 198 | let : Algebra.Etale (MvPolynomial (Fin d) ℂ) S := |
| 199 | RingHom.etale_algebraMap.mp hg |
| 200 | obtain ⟨P, hP⟩ := Ideal.exists_maximal S |
| 201 | let : P.IsMaximal := hP |
| 202 | have hfiniteType : (algebraMap (MvPolynomial (Fin d) ℂ) S).FiniteType := |
| 203 | RingHom.finiteType_algebraMap.mpr inferInstance |
| 204 | have hunder : (P.under (MvPolynomial (Fin d) ℂ)).IsMaximal := |
| 205 | (_root_.OAI.Algebra.RingTheory.SmoothKrullDimension.RingHom.FiniteType.isMaximal_comap_of_isJacobsonRing hfiniteType) P |
| 206 | have hheight : P.height = d := by |
| 207 | rw [_root_.OAI.Algebra.RingTheory.SmoothKrullDimension.QuasiFinite.height_eq_height_under (R := MvPolynomial (Fin d) ℂ)] |
| 208 | exact _root_.OAI.Algebra.RingTheory.SmoothKrullDimension.MvPolynomial.height_eq_fin_of_isMaximal ℂ d |
| 209 | (P.under (MvPolynomial (Fin d) ℂ)) |
| 210 | apply le_antisymm (_root_.OAI.Algebra.RingTheory.SmoothKrullDimension.RingHom.IsStandardSmoothOfRelativeDimension.ringKrullDim_le_complex hf) |
| 211 | change (↑(d : ℕ∞) : WithBot ℕ∞) ≤ ringKrullDim S |
| 212 | have hlower : (↑P.height : WithBot ℕ∞) ≤ ringKrullDim S := |
| 213 | Ideal.height_le_ringKrullDim_of_ne_top Ideal.IsPrime.ne_top' |
| 214 | rwa [← hheight] |
| 215 | |
| 216 | end RingHom |
| 217 | |
| 218 | end |
| 219 | |
| 220 | end OAI.Algebra.RingTheory.SmoothKrullDimension |