Skip to content

Commit 9196e9f

Browse files
chrisflavThmoas-Guanmbkybky
committed
feat(RingTheory/KrullDimension): dimension of polynomial ring (leanprover-community#27542)
We show that for a Noetherian ring `R`, `dim R[X] = dim R + 1`. Co-authored by: Sihan Su <ssh@stu.pku.edu.cn> Co-authored by: Yi Song <sif4delta0@mail.ustc.edu.cn> Co-authored-by: Thmoas-Guan <150537269+Thmoas-Guan@users.noreply.github.com> Co-authored-by: Yongle Hu <140475041+mbkybky@users.noreply.github.com> Co-authored-by: Nailin Guan <150537269+Thmoas-Guan@users.noreply.github.com>
1 parent 2c8f930 commit 9196e9f

4 files changed

Lines changed: 144 additions & 3 deletions

File tree

Mathlib/Order/KrullDimension.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,14 @@ lemma coheight_ne_zero {x : α} : coheight x ≠ 0 ↔ ¬ IsMax x := coheight_eq
460460

461461
@[simp] lemma coheight_top (α : Type*) [Preorder α] [OrderTop α] : coheight (⊤ : α) = 0 := by simp
462462

463+
lemma height_pos_of_bot_lt {x : α} [OrderBot α] (h : ⊥ < x) : 0 < height x := by
464+
rw [height_pos]
465+
grind [not_isMin_iff]
466+
467+
lemma coheight_pos_of_lt_top {x : α} [OrderTop α] (h : x < ⊤) : 0 < coheight x := by
468+
rw [coheight_pos]
469+
grind [not_isMax_iff]
470+
463471
lemma coe_lt_height_iff {x : α} {n : ℕ} (hfin : height x < ⊤) :
464472
n < height x ↔ ∃ y < x, height y = n where
465473
mp h := by

Mathlib/RingTheory/Ideal/Height.lean

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,18 @@ theorem IsLocalization.AtPrime.ringKrullDim_eq_height (I : Ideal R) [I.IsPrime]
340340
← IsLocalization.AtPrime.comap_maximalIdeal A I,
341341
Ideal.height_eq_primeHeight]
342342

343+
lemma IsLocalization.height_map_of_disjoint {S : Type*} [CommRing S] [Algebra R S] (M : Submonoid R)
344+
[IsLocalization M S] (p : Ideal R) [p.IsPrime] (h : Disjoint (M : Set R) (p : Set R)) :
345+
(p.map <| algebraMap R S).height = p.height := by
346+
let P := p.map (algebraMap R S)
347+
have : P.IsPrime := isPrime_of_isPrime_disjoint M S p ‹_› h
348+
have := isLocalization_isLocalization_atPrime_isLocalization (M := M) (Localization.AtPrime P) P
349+
simp_rw [P, comap_map_of_isPrime_disjoint M S p _ h] at this
350+
have := ringKrullDim_eq_of_ringEquiv (IsLocalization.algEquiv p.primeCompl
351+
(Localization.AtPrime P) (Localization.AtPrime p)).toRingEquiv
352+
rw [AtPrime.ringKrullDim_eq_height P, AtPrime.ringKrullDim_eq_height p] at this
353+
exact WithBot.coe_eq_coe.mp this
354+
343355
lemma mem_minimalPrimes_of_primeHeight_eq_height {I J : Ideal R} [J.IsPrime] (e : I ≤ J)
344356
(e' : J.primeHeight = I.height) [J.FiniteHeight] : J ∈ I.minimalPrimes := by
345357
rw [← J.height_eq_primeHeight] at e'

Mathlib/RingTheory/KrullDimension/Polynomial.lean

Lines changed: 98 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
/-
22
Copyright (c) 2025 Jingting Wang. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
4-
Authors: Jingting Wang
4+
Authors: Jingting Wang, Sihan Su, Yi Song, Christian Merten
55
-/
66
module
77

88
public import Mathlib.Algebra.Polynomial.FieldDivision
99
public import Mathlib.RingTheory.KrullDimension.PID
1010
public import Mathlib.RingTheory.LocalRing.ResidueField.Fiber
11+
public import Mathlib.RingTheory.Ideal.KrullsHeightTheorem
12+
public import Mathlib.RingTheory.KrullDimension.NonZeroDivisors
1113

1214
/-!
1315
# Krull dimension of polynomial ring
1416
15-
This file proves properties of the krull dimension of the polynomial ring over a commutative ring
17+
This file proves properties of the Krull dimension of the polynomial ring over a commutative ring
1618
1719
## Main results
1820
19-
* `Polynomial.ringKrullDim_le`: the krull dimension of the polynomial ring over a commutative ring
21+
* `Polynomial.ringKrullDim_le`: the Krull dimension of the polynomial ring over a commutative ring
2022
`R` is less than `2 * (ringKrullDim R) + 1`.
23+
For noetherian rings:
24+
* `Polynomial.ringKrullDim_of_isNoetherianRing`: the Krull dimension of `R[X]` is `dim R + 1`.
25+
* `MvPolynomial.ringKrullDim_of_isNoetherianRing`: the Krull dimension of `R[X₁, ..., Xₙ]` is
26+
`dim R + n`.
2127
-/
2228

2329
public section
@@ -32,3 +38,92 @@ theorem Polynomial.ringKrullDim_le {R : Type*} [CommRing R] :
3238
← ringKrullDim_eq_of_ringEquiv (polyEquivTensor R (p.asIdeal.ResidueField)).toRingEquiv,
3339
← Ring.krullDimLE_iff]
3440
infer_instance
41+
42+
variable {R : Type*} [CommRing R] [IsNoetherianRing R]
43+
44+
namespace Polynomial
45+
46+
open Ideal IsLocalization
47+
48+
/--
49+
Let `p` be a maximal ideal of `A`. If `P` is a maximal ideal of `A[X]` lying above `p`,
50+
then `ht(P) = ht(p) + 1`.
51+
See `Polynomial.height_eq_height_add_one` for the more general version that does not assume `p` is
52+
maximal.
53+
-/
54+
private lemma height_eq_height_add_one_of_isMaximal (p : Ideal R) [p.IsMaximal] (P : Ideal R[X])
55+
[P.IsMaximal] [P.LiesOver p] : P.height = p.height + 1 := by
56+
let _ : Field (R ⧸ p) := Quotient.field p
57+
suffices h : (P.map (Ideal.Quotient.mk (Ideal.map (algebraMap R R[X]) p))).height = 1 by
58+
rw [height_eq_height_add_of_liesOver_of_hasGoingDown p, h]
59+
let e : (R[X] ⧸ (p.map C)) ≃+* (R ⧸ p)[X] := (polynomialQuotientEquivQuotientPolynomial p).symm
60+
let P' : Ideal (R ⧸ p)[X] := Ideal.map e <| P.map (Ideal.Quotient.mk <| p.map (algebraMap R R[X]))
61+
have : (P.map (Ideal.Quotient.mk <| p.map (algebraMap R R[X]))).IsMaximal := by
62+
refine .map_of_surjective_of_ker_le Quotient.mk_surjective ?_
63+
rw [mk_ker, LiesOver.over (P := P) (p := p)]
64+
exact map_comap_le
65+
have : P'.IsMaximal := map_isMaximal_of_equiv e
66+
have : P'.height = 1 := IsPrincipalIdealRing.height_eq_one_of_isMaximal P' polynomial_not_isField
67+
rwa [← e.height_map <| P.map (Ideal.Quotient.mk <| p.map (algebraMap R R[X]))]
68+
69+
/-- Let `p` be a maximal ideal of `R`. Then the height of `p[X]` equals the height of `p`. -/
70+
lemma height_map_C (p : Ideal R) [p.IsMaximal] : (p.map C).height = p.height := by
71+
have : (p.map C).LiesOver p := ⟨IsMaximal.eq_of_le inferInstance IsPrime.ne_top' le_comap_map⟩
72+
simp [height_eq_height_add_of_liesOver_of_hasGoingDown p]
73+
74+
attribute [local instance] Polynomial.algebra Polynomial.isLocalization in
75+
/-- Let `p` be a prime ideal of `R`. If `P` is a maximal ideal of `R[X]` lying over `p`,
76+
`ht(P) = ht(p) + 1`. -/
77+
lemma height_eq_height_add_one (p : Ideal R)
78+
(P : Ideal R[X]) [P.IsMaximal] [P.LiesOver p] :
79+
P.height = p.height + 1 := by
80+
have : p.IsPrime := by rw [P.over_def p]; infer_instance
81+
let Rₚ := Localization.AtPrime p
82+
set p' : Ideal Rₚ := p.map (algebraMap R Rₚ) with p'_def
83+
have : p'.IsMaximal := by
84+
rw [p'_def, Localization.AtPrime.map_eq_maximalIdeal]
85+
exact IsLocalRing.maximalIdeal.isMaximal Rₚ
86+
let P' : Ideal Rₚ[X] := P.map (algebraMap R[X] Rₚ[X])
87+
have disj : Disjoint (p.primeCompl.map C : Set R[X]) P := by
88+
refine Set.disjoint_left.mpr fun a ⟨b, hb⟩ ha ↦ hb.1 ?_
89+
rwa [SetLike.mem_coe, LiesOver.over (P := P) (p := p), mem_comap, algebraMap_eq, hb.2]
90+
have eq := comap_map_of_isPrime_disjoint _ Rₚ[X] P ‹P.IsMaximal›.isPrime disj
91+
have : (comap (algebraMap R[X] Rₚ[X]) P').IsMaximal := eq.symm ▸ ‹P.IsMaximal›
92+
have : P'.IsMaximal := .of_isLocalization_of_disjoint (p.primeCompl.map C)
93+
have : P'.LiesOver p' := liesOver_of_isPrime_of_disjoint p.primeCompl _ _ disj
94+
have eq1 : p.height = p'.height := by
95+
rw [height_map_of_disjoint p.primeCompl]
96+
exact Disjoint.symm <| Set.disjoint_left.mpr fun _ a b ↦ b a
97+
have eq2 : P.height = P'.height := by
98+
rw [height_map_of_disjoint (Submonoid.map C <| p.primeCompl) _ disj]
99+
rw [eq1, eq2]
100+
apply height_eq_height_add_one_of_isMaximal p' P'
101+
102+
/-- If `R` is Noetherian, `dim R[X] = dim R + 1`. -/
103+
@[simp]
104+
lemma ringKrullDim_of_isNoetherianRing : ringKrullDim R[X] = ringKrullDim R + 1 := by
105+
refine le_antisymm ?_ ?_
106+
· nontriviality R[X]
107+
refine (ringKrullDim_le_iff_isMaximal_height_le (ringKrullDim R + 1)).mpr fun M hM ↦ ?_
108+
rw [height_eq_height_add_one (M.under R) M, WithBot.coe_add, WithBot.coe_one]
109+
gcongr
110+
exact Ideal.height_le_ringKrullDim_of_ne_top Ideal.IsPrime.ne_top'
111+
· exact ringKrullDim_succ_le_ringKrullDim_polynomial
112+
113+
end Polynomial
114+
115+
/-- If `R` is Noetherian, `dim R[X₁, ..., Xₙ] = dim R + n`. -/
116+
@[simp]
117+
lemma MvPolynomial.ringKrullDim_of_isNoetherianRing {ι : Type*} [Finite ι] :
118+
ringKrullDim (MvPolynomial ι R) = ringKrullDim R + Nat.card ι := by
119+
induction ι using Finite.induction_empty_option with
120+
| of_equiv e H =>
121+
convert ← H using 1
122+
· exact ringKrullDim_eq_of_ringEquiv (renameEquiv _ e).toRingEquiv
123+
· rw [Nat.card_congr e]
124+
| h_empty => simp
125+
| h_option IH =>
126+
simp only [Nat.card_eq_fintype_card, Fintype.card_option, Nat.cast_add, Nat.cast_one,
127+
← add_assoc] at IH ⊢
128+
rw [ringKrullDim_eq_of_ringEquiv (MvPolynomial.optionEquivLeft _ _).toRingEquiv,
129+
Polynomial.ringKrullDim_of_isNoetherianRing, IH]

Mathlib/RingTheory/Localization/AtPrime/Basic.lean

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,32 @@ lemma IsLocalization.subsingleton_primeSpectrum_of_mem_minimalPrimes
346346
(minimalPrimes_eq_minimals (R := R) ▸ hp).eq_of_le i.1.2 i.2
347347
(IsLocalization.AtPrime.primeSpectrumOrderIso S p).subsingleton
348348

349+
open Ideal in
350+
/-- If `R'` (resp. `S'`) is the localization of `R` (resp. `S`) and
351+
`P` lies over `p` then the image of `P` in `S'` lies over the image of `p` in `R'`. -/
352+
lemma IsLocalization.liesOver_of_isPrime_of_disjoint {R' S' : Type*}
353+
(M : Submonoid R) (T : Submonoid S)
354+
[CommSemiring R'] [CommSemiring S'] [Algebra R R'] [Algebra S S'] [Algebra R' S']
355+
[Algebra R S'] [IsScalarTower R S S'] [IsScalarTower R R' S']
356+
[IsLocalization M R'] [IsLocalization T S']
357+
(p : Ideal R) {P : Ideal S} [P.IsPrime] [P.LiesOver p]
358+
(disj : Disjoint (T : Set S) (P : Set S)) :
359+
(P.map (algebraMap S S')).LiesOver (p.map (algebraMap R R')) := by
360+
suffices h : Ideal.map (algebraMap R R') (under R (under R' (P.map (algebraMap S S')))) =
361+
Ideal.map (algebraMap R R') p by exact ⟨by rw [← h, IsLocalization.map_comap (M := M)]⟩
362+
rw [under_under, ← under_under (B := S), under_def, under_def,
363+
IsLocalization.comap_map_of_isPrime_disjoint (M := T) _ _ ‹_› disj,
364+
LiesOver.over (P := P) (p := p)]
365+
366+
lemma Ideal.IsMaximal.of_isLocalization_of_disjoint [IsLocalization M S] {J : Ideal S}
367+
[(Ideal.comap (algebraMap R S) J).IsMaximal] : J.IsMaximal := by
368+
obtain ⟨m, maxm, hm⟩ := exists_le_maximal J <| by
369+
rintro rfl
370+
exact Ideal.IsMaximal.ne_top ‹_› (by simp)
371+
apply comap_mono (f := algebraMap R S) at hm
372+
rwa [← IsLocalization.map_comap M S J, IsMaximal.eq_of_le ‹_› (IsPrime.under R m).ne_top hm,
373+
Ideal.under_def, IsLocalization.map_comap M S m]
374+
349375
end
350376

351377
namespace IsLocalization.AtPrime

0 commit comments

Comments
 (0)