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.RingTheory.Ideal.Height |
| 20 | |
| 21 | import Mathlib.Algebra.MvPolynomial.Monad |
| 22 | import Mathlib.Data.List.Indexes |
| 23 | import Mathlib.RingTheory.Ideal.HasGoingUp |
| 24 | import Mathlib.RingTheory.KrullDimension.Field |
| 25 | import Mathlib.RingTheory.KrullDimension.Polynomial |
| 26 | |
| 27 | namespace OAI.Algebra.Foundations.PolynomialCatenaryT |
| 28 | |
| 29 | /-! |
| 30 | # Dimension formulas for polynomial rings |
| 31 | |
| 32 | This file develops dimension results for prime quotients of polynomial rings over a field. |
| 33 | |
| 34 | ## Provenance |
| 35 | |
| 36 | The `Triangular` namespace below (from `namespace Triangular` to `end Triangular`) reproduces, |
| 37 | essentially character for character, the `equivT` section (lines 58-170) of Mathlib's |
| 38 | `Mathlib/RingTheory/NoetherNormalization.lean`, added to Mathlib in |
| 39 | `leanprover-community/mathlib4#18247`, whose copyright header reads "Copyright (c) 2025 Sihan Su. |
| 40 | All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: |
| 41 | Riccardo Brasca, Sihan Su, Wan Lin, Xiaoyang Su". Relative to that section the copy drops |
| 42 | `private`, rewrites or drops the docstrings, and renames two identifiers: `T_leadingcoeff_isUnit` |
| 43 | to `T_leadingCoeff_isUnit`, and the local hypothesis `coeff` to `coeff_eq`. It exists only because |
| 44 | those declarations are `private` upstream and hence cannot be imported; of them only `Triangular.T` |
| 45 | and `Triangular.T_leadingCoeff_isUnit` are used below, in |
| 46 | `MvPolynomial.height_add_ringKrullDim_quotient_eq_fin`. Mathlib pull request |
| 47 | `leanprover-community/mathlib4#43700` makes those two declarations public; once it lands and the |
| 48 | Mathlib dependency is bumped, this block should be deleted and the upstream declarations used |
| 49 | instead. |
| 50 | -/ |
| 51 | |
| 52 | section |
| 53 | |
| 54 | open _root_.Ideal _root_.Polynomial _root_.MvPolynomial Nat _root_.RingHom List |
| 55 | |
| 56 | namespace PolynomialCatenary |
| 57 | |
| 58 | variable {R S : Type*} [CommRing R] [CommRing S] [Nontrivial R] [Nontrivial S] |
| 59 | [Algebra R S] |
| 60 | |
| 61 | /-- An injective integral extension preserves Krull dimension. -/ |
| 62 | theorem ringKrullDim_eq_of_isIntegral_of_injective |
| 63 | [Algebra.IsIntegral R S] (hinj : Function.Injective (algebraMap R S)) : |
| 64 | ringKrullDim S = ringKrullDim R := by |
| 65 | let : FaithfulSMul R S := (faithfulSMul_iff_algebraMap_injective R S).mpr hinj |
| 66 | rw [ringKrullDim, ringKrullDim, Order.krullDim_eq_iSup_length, |
| 67 | Order.krullDim_eq_iSup_length] |
| 68 | apply le_antisymm |
| 69 | · refine WithBot.coe_le_coe.mpr (iSup_le fun l ↦ ?_) |
| 70 | let mono : StrictMono (PrimeSpectrum.comap (algebraMap R S)) := fun _ _ h ↦ |
| 71 | Ideal.IsIntegral.under_lt_under h |
| 72 | rw [← LTSeries.map_length l _ mono] |
| 73 | exact le_iSup (fun p ↦ (p.length : ℕ∞)) (l.map _ mono) |
| 74 | · refine WithBot.coe_le_coe.mpr (iSup_le fun l ↦ ?_) |
| 75 | obtain ⟨P, hP⟩ := Algebra.IsIntegral.comap_surjective R S l.head |
| 76 | have : P.asIdeal.LiesOver l.head.asIdeal := ⟨by |
| 77 | simpa [PrimeSpectrum.ext_iff] using hP.symm⟩ |
| 78 | obtain ⟨L, hlen, -, -⟩ := Ideal.exists_ltSeries_of_hasGoingUp l P.asIdeal |
| 79 | exact le_iSup_of_le L (by simp [hlen]) |
| 80 | |
| 81 | /-- A prime polynomial ideal that contains a monic polynomial is maximal when its contraction is |
| 82 | maximal. -/ |
| 83 | theorem Polynomial.isMaximal_of_monic_mem_of_comap_isMaximal |
| 84 | {R : Type*} [CommRing R] (P : Ideal (Polynomial R)) [P.IsPrime] |
| 85 | (g : Polynomial R) (hg : Polynomial.Monic g) (hgP : g ∈ P) |
| 86 | (hP : (P.comap Polynomial.C).IsMaximal) : |
| 87 | P.IsMaximal := by |
| 88 | let f : R →+* (Polynomial R ⧸ P) := (Ideal.Quotient.mk P).comp Polynomial.C |
| 89 | have hf : f.IsIntegral := hg.quotient_isIntegral hgP |
| 90 | have hbot : (⊥ : Ideal (Polynomial R ⧸ P)).IsMaximal := by |
| 91 | apply Ideal.isMaximal_of_isIntegral_of_isMaximal_comap f hf ⊥ |
| 92 | convert hP using 1 |
| 93 | ext x |
| 94 | simp only [Ideal.mem_comap, RingHom.coe_comp, Function.comp_apply, Ideal.mem_bot, f] |
| 95 | exact Ideal.Quotient.eq_zero_iff_mem |
| 96 | exact (Ideal.bot_quotient_isMaximal_iff P).mp hbot |
| 97 | |
| 98 | attribute [local instance] Polynomial.algebra Polynomial.isLocalization in |
| 99 | /-- A monic equation supplies the missing height-one step over the contraction of a prime |
| 100 | polynomial ideal. -/ |
| 101 | theorem Polynomial.height_eq_comap_height_add_one_of_monic_mem |
| 102 | {R : Type*} [CommRing R] [IsNoetherianRing R] |
| 103 | (P : Ideal (Polynomial R)) [P.IsPrime] |
| 104 | (g : Polynomial R) (hg : Polynomial.Monic g) (hgP : g ∈ P) : |
| 105 | P.height = (P.comap Polynomial.C).height + 1 := by |
| 106 | let p := P.comap Polynomial.C |
| 107 | let Rₚ := Localization.AtPrime p |
| 108 | set p' : Ideal Rₚ := p.map (algebraMap R Rₚ) with p'_def |
| 109 | have hp' : p'.IsMaximal := by |
| 110 | rw [p'_def, Localization.AtPrime.map_eq_maximalIdeal] |
| 111 | exact IsLocalRing.maximalIdeal.isMaximal Rₚ |
| 112 | let P' : Ideal (Polynomial Rₚ) := P.map (algebraMap (Polynomial R) (Polynomial Rₚ)) |
| 113 | have disj : Disjoint (p.primeCompl.map Polynomial.C : Set (Polynomial R)) P := by |
| 114 | simpa [p] using! Set.disjoint_image_left.mpr |
| 115 | (Set.disjoint_compl_left_iff_subset.mpr (fun _ a ↦ a)) |
| 116 | let : P'.IsPrime := IsLocalization.isPrime_of_isPrime_disjoint _ _ P inferInstance disj |
| 117 | let : P.LiesOver p := ⟨rfl⟩ |
| 118 | have hP'over : P'.LiesOver p' := |
| 119 | IsLocalization.liesOver_of_isPrime_of_disjoint p.primeCompl _ _ disj |
| 120 | let : P'.LiesOver p' := hP'over |
| 121 | have hgP' : g.map (algebraMap R Rₚ) ∈ P' := by |
| 122 | change algebraMap (Polynomial R) (Polynomial Rₚ) g ∈ P' |
| 123 | exact Ideal.mem_map_of_mem _ hgP |
| 124 | have hP'max : P'.IsMaximal := |
| 125 | _root_.OAI.Algebra.Foundations.PolynomialCatenaryT.PolynomialCatenary.Polynomial.isMaximal_of_monic_mem_of_comap_isMaximal P' |
| 126 | (g.map (algebraMap R Rₚ)) (hg.map _) hgP' (by |
| 127 | have heq : P'.comap Polynomial.C = p' := by |
| 128 | calc |
| 129 | P'.comap Polynomial.C = P'.under Rₚ := by |
| 130 | rw [Ideal.under_def, Polynomial.algebraMap_eq] |
| 131 | _ = p' := hP'over.over.symm |
| 132 | exact heq ▸ hp') |
| 133 | let : P'.IsMaximal := hP'max |
| 134 | have eq1 : p.height = p'.height := by |
| 135 | rw [p'_def, IsLocalization.height_map_of_disjoint p.primeCompl] |
| 136 | exact Disjoint.symm <| Set.disjoint_left.mpr fun _ a b ↦ b a |
| 137 | have eq2 : P.height = P'.height := by |
| 138 | rw [IsLocalization.height_map_of_disjoint (Submonoid.map Polynomial.C p.primeCompl) _ disj] |
| 139 | rw [show P.comap Polynomial.C = p from rfl, eq1, eq2] |
| 140 | exact Polynomial.height_eq_height_add_one p' P' |
| 141 | |
| 142 | -- See the "Provenance" paragraph in the module docstring: this namespace is copied from Mathlib. |
| 143 | namespace Triangular |
| 144 | |
| 145 | variable {k : Type*} [Field k] {n : ℕ} (f : MvPolynomial (Fin (n + 1)) k) |
| 146 | variable (v w : Fin (n + 1) →₀ ℕ) |
| 147 | |
| 148 | local notation3 "up" => 2 + f.totalDegree |
| 149 | |
| 150 | variable {f v} in |
| 151 | lemma lt_up (vlt : ∀ i, v i < up) : ∀ l ∈ ofFn v, l < up := by |
| 152 | grind |
| 153 | |
| 154 | local notation3 "r" => fun (i : Fin (n + 1)) ↦ up ^ i.1 |
| 155 | |
| 156 | /-- The triangular change of variables used in Noether normalization. -/ |
| 157 | noncomputable abbrev T1 (c : k) : |
| 158 | MvPolynomial (Fin (n + 1)) k →ₐ[k] MvPolynomial (Fin (n + 1)) k := |
| 159 | aeval fun i ↦ if i = 0 then X 0 else X i + c • X 0 ^ r i |
| 160 | |
| 161 | lemma t1_comp_t1_neg (c : k) : (T1 f c).comp (T1 f (-c)) = AlgHom.id _ _ := by |
| 162 | rw [comp_aeval, ← MvPolynomial.aeval_X_left] |
| 163 | ext i v |
| 164 | cases i using Fin.cases <;> simp |
| 165 | |
| 166 | /-- The triangular automorphism attached to a nonzero polynomial. -/ |
| 167 | noncomputable abbrev T := AlgEquiv.ofAlgHom (T1 f 1) (T1 f (-1)) |
| 168 | (t1_comp_t1_neg f 1) (by simpa using t1_comp_t1_neg f (-1)) |
| 169 | |
| 170 | lemma sum_r_mul_ne (vlt : ∀ i, v i < up) (wlt : ∀ i, w i < up) (ne : v ≠ w) : |
| 171 | ∑ x : Fin (n + 1), r x * v x ≠ ∑ x : Fin (n + 1), r x * w x := by |
| 172 | intro h |
| 173 | refine ne <| Finsupp.ext <| congrFun <| ofFn_inj.mp ?_ |
| 174 | apply ofDigits_inj_of_len_eq (Nat.lt_add_right f.totalDegree one_lt_two) |
| 175 | (by simp) (lt_up vlt) (lt_up wlt) |
| 176 | simpa only [ofDigits_eq_sum_mapIdx, mapIdx_eq_ofFn, get_ofFn, length_ofFn, |
| 177 | Fin.val_cast, mul_comm, sum_ofFn] using! h |
| 178 | |
| 179 | lemma degreeOf_zero_t {a : k} (ha : a ≠ 0) : ((T f) (monomial v a)).degreeOf 0 = |
| 180 | ∑ i : Fin (n + 1), r i * v i := by |
| 181 | rw [← natDegree_finSuccEquiv, monomial_eq, Finsupp.prod_pow v fun a ↦ X a] |
| 182 | simp only [Fin.prod_univ_succ, Fin.sum_univ_succ, map_mul, map_prod, map_pow, |
| 183 | AlgEquiv.ofAlgHom_apply, MvPolynomial.aeval_C, MvPolynomial.aeval_X, ite_eq_left, Fin.succ_ne_zero, |
| 184 | ite_false, one_smul, map_add, finSuccEquiv_X_zero, finSuccEquiv_X_succ, algebraMap_eq] |
| 185 | have h (i : Fin n) : |
| 186 | (Polynomial.C (X (R := k) i) + Polynomial.X ^ r i.succ) ^ v i.succ ≠ 0 := |
| 187 | pow_ne_zero (v i.succ) (leadingCoeff_ne_zero.mp <| by simp [add_comm, leadingCoeff_X_pow_add_C]) |
| 188 | rw [natDegree_mul (by simp [ha]) (mul_ne_zero (by simp) (Finset.prod_ne_zero_iff.mpr |
| 189 | (fun i _ ↦ h i))), natDegree_mul (by simp) (Finset.prod_ne_zero_iff.mpr (fun i _ ↦ h i)), |
| 190 | natDegree_prod _ _ (fun i _ ↦ h i), natDegree_finSuccEquiv, degreeOf_C] |
| 191 | simpa only [natDegree_pow, zero_add, natDegree_X, mul_one, Fin.val_zero, pow_zero, one_mul, |
| 192 | add_right_inj] using Finset.sum_congr rfl (fun i _ ↦ by |
| 193 | rw [add_comm (Polynomial.C _), natDegree_X_pow_add_C, mul_comm]) |
| 194 | |
| 195 | /-- Distinct supported monomials acquire distinct degrees in the distinguished variable. -/ |
| 196 | lemma degreeOf_t_ne_of_ne (hv : v ∈ f.support) (hw : w ∈ f.support) (ne : v ≠ w) : |
| 197 | (T f <| monomial v <| f.coeff v).degreeOf 0 ≠ |
| 198 | (T f <| monomial w <| f.coeff w).degreeOf 0 := by |
| 199 | rw [degreeOf_zero_t _ _ <| mem_support_iff.mp hv, |
| 200 | degreeOf_zero_t _ _ <| mem_support_iff.mp hw] |
| 201 | refine sum_r_mul_ne f v w (fun i ↦ ?_) (fun i ↦ ?_) ne <;> |
| 202 | exact lt_of_le_of_lt ((monomial_le_degreeOf i ‹_›).trans (degreeOf_le_totalDegree f i)) |
| 203 | (by lia) |
| 204 | |
| 205 | lemma leadingCoeff_finSuccEquiv_t : |
| 206 | (finSuccEquiv k n ((T f) ((monomial v) (f.coeff v)))).leadingCoeff = |
| 207 | algebraMap k _ (f.coeff v) := by |
| 208 | rw [monomial_eq, Finsupp.prod_fintype] |
| 209 | · simp only [map_mul, map_prod, leadingCoeff_mul, leadingCoeff_prod] |
| 210 | rw [AlgEquiv.ofAlgHom_apply, algHom_C, algebraMap_eq, finSuccEquiv_apply, |
| 211 | eval₂Hom_C, coe_comp] |
| 212 | simp only [AlgEquiv.ofAlgHom_apply, Function.comp_apply, leadingCoeff_C, map_pow, |
| 213 | leadingCoeff_pow, algebraMap_eq] |
| 214 | have : ∀ j, ((finSuccEquiv k n) ((T1 f) 1 (X j))).leadingCoeff = 1 := fun j ↦ by |
| 215 | by_cases h : j = 0 |
| 216 | · simp [h, finSuccEquiv_apply] |
| 217 | · simp only [aeval_eq_bind₁, bind₁_X_right, ite_eq_right h, one_smul, map_add, map_pow] |
| 218 | obtain ⟨i, rfl⟩ := Fin.exists_succ_eq.mpr h |
| 219 | simp [finSuccEquiv_X_succ, finSuccEquiv_X_zero, add_comm] |
| 220 | simp only [this, one_pow, Finset.prod_const_one, mul_one] |
| 221 | exact fun i ↦ pow_zero _ |
| 222 | |
| 223 | /-- The transformed polynomial has unit leading coefficient in the distinguished variable. -/ |
| 224 | lemma T_leadingCoeff_isUnit (fne : f ≠ 0) : |
| 225 | IsUnit (finSuccEquiv k n (T f f)).leadingCoeff := by |
| 226 | obtain ⟨v, vin, vs⟩ := Finset.exists_max_image f.support |
| 227 | (fun v ↦ (T f ((monomial v) (f.coeff v))).degreeOf 0) (support_nonempty.mpr fne) |
| 228 | set h := fun w ↦ (MvPolynomial.monomial w) (f.coeff w) |
| 229 | simp only [← natDegree_finSuccEquiv] at vs |
| 230 | replace vs : ∀ x ∈ f.support \ {v}, (finSuccEquiv k n ((T f) (h x))).degree < |
| 231 | (finSuccEquiv k n ((T f) (h v))).degree := by |
| 232 | intro x hx |
| 233 | obtain ⟨h1, h2⟩ := Finset.mem_sdiff.mp hx |
| 234 | apply degree_lt_degree <| lt_of_le_of_ne (vs x h1) ?_ |
| 235 | simpa only [natDegree_finSuccEquiv] |
| 236 | using degreeOf_t_ne_of_ne f _ _ h1 vin <| ne_of_not_mem_cons h2 |
| 237 | have coeff_eq : |
| 238 | (finSuccEquiv k n ((T f) (h v + ∑ x ∈ f.support \ {v}, h x))).leadingCoeff = |
| 239 | (finSuccEquiv k n ((T f) (h v))).leadingCoeff := by |
| 240 | simp only [map_add, map_sum] |
| 241 | rw [add_comm] |
| 242 | apply leadingCoeff_add_of_degree_lt <| (lt_of_le_of_lt <| degree_sum_le _ _) ?_ |
| 243 | have h2 : h v ≠ 0 := by simpa [h] using mem_support_iff.mp vin |
| 244 | replace h2 : (finSuccEquiv k n ((T f) (h v))) ≠ 0 := fun eq ↦ h2 <| |
| 245 | by simpa only [map_eq_zero_iff _ (AlgEquiv.injective _)] using eq |
| 246 | exact (Finset.sup_lt_iff <| Ne.bot_lt (fun x ↦ h2 <| degree_eq_bot.mp x)).mpr vs |
| 247 | nth_rw 2 [← f.support_sum_monomial_coeff] |
| 248 | rw [Finset.sum_eq_add_sum_sdiff_singleton_of_mem vin h] |
| 249 | rw [leadingCoeff_finSuccEquiv_t] at coeff_eq |
| 250 | simpa only [coeff_eq, algebraMap_eq] using |
| 251 | (mem_support_iff.mp vin).isUnit.map MvPolynomial.C |
| 252 | |
| 253 | end Triangular |
| 254 | |
| 255 | variable {k : Type*} [Field k] |
| 256 | |
| 257 | /-- For every prime ideal in a polynomial ring over a field, its height plus the dimension of its |
| 258 | quotient is the number of variables. -/ |
| 259 | theorem MvPolynomial.height_add_ringKrullDim_quotient_eq_fin {n : ℕ} |
| 260 | (P : Ideal (MvPolynomial (Fin n) k)) [P.IsPrime] : |
| 261 | P.height + ringKrullDim (MvPolynomial (Fin n) k ⧸ P) = n := by |
| 262 | induction n with |
| 263 | | zero => |
| 264 | let e := MvPolynomial.isEmptyRingEquiv k (Fin 0) |
| 265 | have hmap : P.map e = ⊥ := Ideal.eq_bot_of_prime (P.map e) |
| 266 | have hP : P = ⊥ := (Ideal.map_eq_bot_iff_of_injective e.injective).mp hmap |
| 267 | subst P |
| 268 | rw [Ideal.height_bot, WithBot.coe_zero, zero_add, |
| 269 | ringKrullDim_eq_of_ringEquiv (RingEquiv.quotientBot _), |
| 270 | ringKrullDim_eq_of_ringEquiv e] |
| 271 | exact ringKrullDim_eq_zero_of_field k |
| 272 | | succ n ih => |
| 273 | by_cases hP : P = ⊥ |
| 274 | · subst P |
| 275 | rw [Ideal.height_bot, WithBot.coe_zero, zero_add, |
| 276 | ringKrullDim_eq_of_ringEquiv (RingEquiv.quotientBot _), |
| 277 | MvPolynomial.ringKrullDim_of_isNoetherianRing, |
| 278 | ringKrullDim_eq_zero_of_field k] |
| 279 | simp |
| 280 | · obtain ⟨f, hfP, hfne⟩ := Submodule.exists_mem_ne_zero_of_ne_bot hP |
| 281 | let e₁ := _root_.OAI.Algebra.Foundations.PolynomialCatenaryT.PolynomialCatenary.Triangular.T f |
| 282 | let P₁ : Ideal (MvPolynomial (Fin (n + 1)) k) := P.map e₁ |
| 283 | have : P₁.IsPrime := Ideal.map_isPrime_of_equiv e₁ |
| 284 | let e₂ := MvPolynomial.finSuccEquiv k n |
| 285 | let Q : Ideal (Polynomial (MvPolynomial (Fin n) k)) := P₁.map e₂ |
| 286 | have : Q.IsPrime := Ideal.map_isPrime_of_equiv e₂ |
| 287 | obtain hunit := _root_.OAI.Algebra.Foundations.PolynomialCatenaryT.PolynomialCatenary.Triangular.T_leadingCoeff_isUnit f hfne |
| 288 | let g : Polynomial (MvPolynomial (Fin n) k) := hunit.unit⁻¹ • e₂ (e₁ f) |
| 289 | have hgmonic : g.Monic := |
| 290 | Polynomial.monic_of_isUnit_leadingCoeff_inv_smul hunit |
| 291 | have hgf : g ∈ Q := |
| 292 | Submodule.smul_of_tower_mem Q hunit.unit⁻¹.val |
| 293 | (Ideal.mem_map_of_mem e₂ (Ideal.mem_map_of_mem e₁ hfP)) |
| 294 | let q : Ideal (MvPolynomial (Fin n) k) := Q.comap Polynomial.C |
| 295 | have : q.IsPrime := Ideal.IsPrime.comap Polynomial.C |
| 296 | have hheightQ : Q.height = q.height + 1 := |
| 297 | _root_.OAI.Algebra.Foundations.PolynomialCatenaryT.PolynomialCatenary.Polynomial.height_eq_comap_height_add_one_of_monic_mem Q g hgmonic hgf |
| 298 | have hind : q.height + ringKrullDim (MvPolynomial (Fin n) k ⧸ q) = n := ih q |
| 299 | let : Algebra.IsIntegral (MvPolynomial (Fin n) k) |
| 300 | (Polynomial (MvPolynomial (Fin n) k) ⧸ Q) := |
| 301 | ⟨(Polynomial.monic_of_isUnit_leadingCoeff_inv_smul hunit).quotient_isIntegral hgf⟩ |
| 302 | let : Algebra (MvPolynomial (Fin n) k ⧸ q) |
| 303 | (Polynomial (MvPolynomial (Fin n) k) ⧸ Q) := |
| 304 | Ideal.Quotient.algebraQuotientOfLEComap le_rfl |
| 305 | let : Algebra.IsIntegral (MvPolynomial (Fin n) k ⧸ q) |
| 306 | (Polynomial (MvPolynomial (Fin n) k) ⧸ Q) := |
| 307 | ⟨(isIntegral_quotientMap_iff (f := Polynomial.C) (I := Q)).mpr |
| 308 | Algebra.IsIntegral.isIntegral⟩ |
| 309 | have hdimQ : ringKrullDim (Polynomial (MvPolynomial (Fin n) k) ⧸ Q) = |
| 310 | ringKrullDim (MvPolynomial (Fin n) k ⧸ q) := |
| 311 | ringKrullDim_eq_of_isIntegral_of_injective |
| 312 | (R := MvPolynomial (Fin n) k ⧸ q) |
| 313 | (S := Polynomial (MvPolynomial (Fin n) k) ⧸ Q) |
| 314 | (Ideal.quotientMap_injective (I := Q) (f := Polynomial.C)) |
| 315 | let quotientEquiv₁ : |
| 316 | (MvPolynomial (Fin (n + 1)) k ⧸ P) ≃+* |
| 317 | (MvPolynomial (Fin (n + 1)) k ⧸ P₁) := |
| 318 | Ideal.quotientEquiv P P₁ e₁.toRingEquiv rfl |
| 319 | let quotientEquiv₂ : |
| 320 | (MvPolynomial (Fin (n + 1)) k ⧸ P₁) ≃+* |
| 321 | (Polynomial (MvPolynomial (Fin n) k) ⧸ Q) := |
| 322 | Ideal.quotientEquiv P₁ Q e₂.toRingEquiv rfl |
| 323 | have hheightP : P.height = Q.height := by |
| 324 | calc |
| 325 | P.height = P₁.height := (e₁.toRingEquiv.height_map P).symm |
| 326 | _ = Q.height := (e₂.toRingEquiv.height_map P₁).symm |
| 327 | have hdimP : ringKrullDim (MvPolynomial (Fin (n + 1)) k ⧸ P) = |
| 328 | ringKrullDim (Polynomial (MvPolynomial (Fin n) k) ⧸ Q) := by |
| 329 | calc |
| 330 | _ = ringKrullDim (MvPolynomial (Fin (n + 1)) k ⧸ P₁) := |
| 331 | ringKrullDim_eq_of_ringEquiv quotientEquiv₁ |
| 332 | _ = _ := ringKrullDim_eq_of_ringEquiv quotientEquiv₂ |
| 333 | rw [hheightP, hheightQ, hdimP, hdimQ, WithBot.coe_add, WithBot.coe_one] |
| 334 | calc |
| 335 | (q.height : WithBot ℕ∞) + 1 + ringKrullDim (MvPolynomial (Fin n) k ⧸ q) = |
| 336 | ((q.height : WithBot ℕ∞) + |
| 337 | ringKrullDim (MvPolynomial (Fin n) k ⧸ q)) + 1 := by ac_rfl |
| 338 | _ = (n : WithBot ℕ∞) + 1 := congrArg (· + 1) hind |
| 339 | _ = ((n + 1 : ℕ) : WithBot ℕ∞) := by norm_num |
| 340 | |
| 341 | /-- If a prime ideal in a polynomial ring in `n` variables has height `p`, then its quotient has |
| 342 | Krull dimension `n - p`. -/ |
| 343 | theorem MvPolynomial.ringKrullDim_quotient_eq_fin_sub_of_height_eq {n p : ℕ} |
| 344 | (P : Ideal (MvPolynomial (Fin n) k)) [P.IsPrime] (hp : P.height = p) : |
| 345 | ringKrullDim (MvPolynomial (Fin n) k ⧸ P) = n - p := by |
| 346 | have h := _root_.OAI.Algebra.Foundations.PolynomialCatenaryT.PolynomialCatenary.MvPolynomial.height_add_ringKrullDim_quotient_eq_fin P |
| 347 | rw [hp] at h |
| 348 | obtain ⟨a, b, ha, hb, hab⟩ := WithBot.add_eq_coe.mp h |
| 349 | have ha' : a = (p : ℕ∞) := WithBot.coe_injective ha |
| 350 | subst a |
| 351 | have hbtop : b ≠ ⊤ := by |
| 352 | intro htop |
| 353 | rw [htop, add_top] at hab |
| 354 | exact ENat.top_ne_natCast n hab |
| 355 | lift b to ℕ using hbtop with m |
| 356 | have hpm : p + m = n := mod_cast hab |
| 357 | rw [← hb, WithBot.coe_natCast] |
| 358 | congr |
| 359 | lia |
| 360 | |
| 361 | end PolynomialCatenary |
| 362 | |
| 363 | end |
| 364 | |
| 365 | end OAI.Algebra.Foundations.PolynomialCatenaryT |