Stafford38/Geometry/NormalizationHeightOne.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Mathlib.RingTheory.NoetherNormalization
3 public import Mathlib.RingTheory.Ideal.KrullsHeightTheorem
4 public import Mathlib.RingTheory.DedekindDomain.IntegralClosure
5 public import Mathlib.RingTheory.DedekindDomain.Dvr
6 
7 @[expose] public section
8 
9 /-!
10 # Normalization and height-one local rings
11 
12 A finite-type domain over a characteristic-zero field has finite normalization
13 in its own fraction field. The proof uses Noether normalization to a polynomial
14 ring, applies Mathlib's integral-closure finiteness there, and restricts scalars
15 back to the domain.
16 
17 In a Noetherian domain, a nonzero nonunit has a minimal prime of height one.
18 For a Noetherian integrally closed domain, localization at a height-one prime
19 is a discrete valuation ring, without any global dimension restriction.
20 Contraction along an integral extension gives the height bound used to compare
21 the normalization center with its affine-chart center.
22 -/
23 
24 namespace Stafford38.Geometry.NormalizationHeightOne
25 
26 open scoped nonZeroDivisors
27 
28 attribute [local instance] FractionRing.liftAlgebra
29 
30 set_option linter.style.haveILetI false
31 set_option maxHeartbeats 1000000
32 
33 universe u
34 
35 /-- Noether's finiteness theorem for the normalization of a finitely generated
36 domain over a field of characteristic zero, in abstract `IsIntegralClosure`
37 form. -/
38 theorem finite_normalization_of_fg_domain
39     (k R : Type u) [Field k] [CharZero k] [CommRing R] [IsDomain R] [Algebra k R]
40     [Algebra.FiniteType k R]
41     (C : Type u) [CommRing C] [Algebra R C] [Algebra C (FractionRing R)]
42     [IsScalarTower R C (FractionRing R)] [IsIntegralClosure C R (FractionRing R)] :
43     Module.Finite R C := by
44   classical
45   obtain ⟨s, g, hinj, hfin⟩ := exists_finite_inj_algHom_of_fg k R
46   letI : Algebra (MvPolynomial (Fin s) k) R := g.toRingHom.toAlgebra
47   haveI : Module.Finite (MvPolynomial (Fin s) k) R := hfin
48   haveI : FaithfulSMul (MvPolynomial (Fin s) k) R :=
49     (faithfulSMul_iff_algebraMap_injective (MvPolynomial (Fin s) k) R).mpr hinj
50   haveI : Algebra.IsIntegral (MvPolynomial (Fin s) k) R := inferInstance
51   letI : Algebra (MvPolynomial (Fin s) k) C :=
52     ((algebraMap R C).comp (algebraMap (MvPolynomial (Fin s) k) R)).toAlgebra
53   haveI hARC : IsScalarTower (MvPolynomial (Fin s) k) R C :=
54     IsScalarTower.of_algebraMap_eq fun _ => rfl
55   haveI : IsScalarTower (MvPolynomial (Fin s) k) C (FractionRing R) := by
56     refine IsScalarTower.of_algebraMap_eq fun x => ?_
57     rw [IsScalarTower.algebraMap_apply (MvPolynomial (Fin s) k) R (FractionRing R),
58       IsScalarTower.algebraMap_apply (MvPolynomial (Fin s) k) R C,
59       IsScalarTower.algebraMap_apply R C (FractionRing R)]
60   haveI : IsIntegralClosure C (MvPolynomial (Fin s) k) (FractionRing R) := by
61     refine ⟨IsIntegralClosure.algebraMap_injective C R (FractionRing R), fun {x} => ?_⟩
62     constructor
63     · intro hx
64       exact IsIntegralClosure.isIntegral_iff.mp
65         (IsIntegral.tower_top (R := MvPolynomial (Fin s) k) (A := R) hx)
66     · rintro ⟨y, rfl⟩
67       exact isIntegral_trans (R := MvPolynomial (Fin s) k) (A := R) _
68         (IsIntegralClosure.isIntegral R (FractionRing R) y).algebraMap
69   haveI : Module.Finite (MvPolynomial (Fin s) k) C :=
70     IsIntegralClosure.finite (MvPolynomial (Fin s) k) (FractionRing (MvPolynomial (Fin s) k))
71       (FractionRing R) C
72   exact Module.Finite.of_restrictScalars_finite (MvPolynomial (Fin s) k) R C
73 
74 /-- A nonzero nonunit of a Noetherian domain has a minimal prime of height
75 exactly one.  This is the zero divisor of the paper construction. -/
76 theorem exists_height_one_minimal_prime
77     {B : Type*} [CommRing B] [IsDomain B] [IsNoetherianRing B] {x : B}
78     (hx0 : x ≠ 0) (hxu : ¬ IsUnit x) :
79     ∃ p : Ideal B, p ∈ (Ideal.span {x}).minimalPrimes ∧ p.height = 1 := by
80   obtain ⟨p, hp⟩ := (Ideal.span {x}).nonempty_minimalPrimes (by simpa using hxu)
81   have := hp.isPrime
82   refine ⟨p, hp, le_antisymm
83     (Ideal.height_le_one_of_isPrincipal_of_mem_minimalPrimes _ _ hp) ?_⟩
84   have hne : p ≠ ⊥ := fun e ↦
85     hx0 (by simpa [e, Ideal.span_singleton_eq_bot] using hp.1.2)
86   rw [Order.one_le_iff_ne_zero]
87   simpa [Ideal.height_eq_zero_iff_eq_bot] using hne
88 
89 /-- The localization of a Noetherian integrally closed domain at a height-one
90 prime is a discrete valuation ring.  No global dimension hypothesis is used, so
91 this applies on a component of dimension greater than one. -/
92 theorem isDiscreteValuationRing_localization_of_height_eq_one
93     {A : Type*} [CommRing A] [IsDomain A] [IsNoetherianRing A] [IsIntegrallyClosed A]
94     (p : Ideal A) [p.IsPrime] (h : p.height = 1) :
95     IsDiscreteValuationRing (Localization.AtPrime p) := by
96   have hpb : p ≠ ⊥ := Ideal.ne_bot_of_height_eq_one h
97   have : IsLocalRing (Localization.AtPrime p) := IsLocalization.AtPrime.isLocalRing _ p
98   have : IsNoetherianRing (Localization.AtPrime p) :=
99     IsLocalization.isNoetherianRing p.primeCompl _ ‹_›
100   have : IsIntegrallyClosed (Localization.AtPrime p) :=
101     isIntegrallyClosed_of_isLocalization _ p.primeCompl p.primeCompl_le_nonZeroDivisors
102   have hnf : ¬ IsField (Localization.AtPrime p) := IsLocalization.AtPrime.not_isField A hpb _
103   have hkd : Ring.KrullDimLE 1 (Localization.AtPrime p) := by
104     rw [Ring.krullDimLE_iff,
105       IsLocalization.AtPrime.ringKrullDim_eq_height p (Localization.AtPrime p), h]
106     norm_num
107   have h3 : IsIntegrallyClosed (Localization.AtPrime p) ∧
108       ∃! P : Ideal (Localization.AtPrime p), P ≠ ⊥ ∧ P.IsPrime := by
109     refine ⟨‹_›, IsLocalRing.maximalIdeal _,
110       ⟨IsLocalRing.isField_iff_maximalIdeal_eq.not.mp hnf, inferInstance⟩, ?_⟩
111     rintro P ⟨hPb, hPp⟩
112     exact IsLocalRing.eq_maximalIdeal (hPp.isMaximal_of_ne_bot hPb)
113   exact ((IsDiscreteValuationRing.TFAE (Localization.AtPrime p) hnf).out 4 1).mp h3
114 
115 /-- Contraction along an integral extension does not lower height. -/
116 theorem height_le_height_under_of_isIntegral
117     {R A : Type*} [CommRing R] [CommRing A] [Algebra R A] [Algebra.IsIntegral R A]
118     (P : Ideal A) [P.IsPrime] : P.height ≤ (Ideal.under R P).height := by
119   have hs : StrictMono (PrimeSpectrum.comap (algebraMap R A)) := fun x y hxy ↦
120     Ideal.IsIntegral.comap_lt_comap (I := x.asIdeal) (J := y.asIdeal) hxy
121   have h := Order.height_le_height_apply_of_strictMono _ hs (⟨P, ‹_›⟩ : PrimeSpectrum A)
122   rwa [← PrimeSpectrum.height_eq_orderHeight (⟨P, ‹_›⟩ : PrimeSpectrum A),
123     ← PrimeSpectrum.height_eq_orderHeight
124       (PrimeSpectrum.comap (algebraMap R A) (⟨P, ‹_›⟩ : PrimeSpectrum A))] at h
125 
126 #print axioms finite_normalization_of_fg_domain
127 #print axioms exists_height_one_minimal_prime
128 #print axioms isDiscreteValuationRing_localization_of_height_eq_one
129 #print axioms height_le_height_under_of_isIntegral
130 
131 end Stafford38.Geometry.NormalizationHeightOne
132