Stafford38/Geometry/DVRParameterSmoothness.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Mathlib.RingTheory.Smooth.Fiber
3 public import Mathlib.RingTheory.Flat.TorsionFree
4 public import Mathlib.RingTheory.Polynomial.Ideal
5 public import Mathlib.RingTheory.Unramified.LocalRing
6 public import Mathlib.FieldTheory.Minpoly.Field
7 public import Mathlib.FieldTheory.Perfect
8 public import Mathlib.RingTheory.Jacobson.Ring
9 public import Mathlib.RingTheory.LocalRing.ResidueField.Ideal
10 public import Mathlib.RingTheory.AlgebraicIndependent.Transcendental
11 public import Stafford38.Geometry.AsymptoticDivisorExistence
12 public import Stafford38.Geometry.RelativeCoefficientDVRPlace
13 
14 @[expose] public section
15 
16 set_option autoImplicit false
17 
18 namespace Stafford38.Geometry.DVRParameterSmoothness
19 
20 open IsLocalRing
21 open Polynomial
22 
23 universe u v
24 
25 /-- A nonzero algebraic element of a local domain over a field is a unit:
26 its minimal polynomial has nonzero constant coefficient, which expresses a
27 unit as a multiple of the element. -/
28 theorem not_isAlgebraic_of_nonzero_mem_maximalIdeal
29     {E : Type u} {S : Type v} [Field E] [CommRing S] [IsDomain S]
30     [Algebra E S] [IsLocalRing S] {x : S}
31     (hx0 : x ≠ 0) (hxM : x ∈ maximalIdeal S) : ¬ IsAlgebraic E x := by
32   intro halg
33   have hInt : IsIntegral E x := (isAlgebraic_iff_isIntegral).mp halg
34   let f : Polynomial E := minpoly E x
35   have hf0 : f.coeff 0 ≠ 0 := minpoly.coeff_zero_ne_zero hInt hx0
36   have hroot : Polynomial.aeval x f = 0 := minpoly.aeval E x
37   have hprod : x * Polynomial.eval₂ (algebraMap E S) x f.divX =
38       - algebraMap E S (f.coeff 0) := by
39     have hrootEval : Polynomial.eval₂ (algebraMap E S) x f = 0 := by
40       simpa only [Polynomial.aeval_def] using hroot
41     have hEq : f = Polynomial.X * f.divX + Polynomial.C (f.coeff 0) :=
42       (Polynomial.X_mul_divX_add f).symm
43     have hrootExpanded : Polynomial.eval₂ (algebraMap E S) x
44         (Polynomial.X * f.divX + Polynomial.C (f.coeff 0)) = 0 := by
45       rw [← hEq]
46       exact hrootEval
47     rw [Polynomial.eval₂_add, Polynomial.eval₂_mul, Polynomial.eval₂_X,
48       Polynomial.eval₂_C] at hrootExpanded
49     exact eq_neg_iff_add_eq_zero.mpr hrootExpanded
50   have hcunit : IsUnit (algebraMap E S (f.coeff 0)) :=
51     (isUnit_iff_ne_zero.mpr hf0).map (algebraMap E S)
52   have hnegunit : IsUnit (-algebraMap E S (f.coeff 0)) := hcunit.neg
53   rcases hnegunit with ⟨u, hu⟩
54   have hxi : x * (Polynomial.eval₂ (algebraMap E S) x f.divX * ↑u⁻¹) = 1 := by
55     rw [← mul_assoc, hprod, ← hu]
56     simp
57   have hix : (Polynomial.eval₂ (algebraMap E S) x f.divX * ↑u⁻¹) * x = 1 := by
58     rw [mul_comm _ x]
59     exact hxi
60   have hxunit : IsUnit x := ⟨⟨x, Polynomial.eval₂ (algebraMap E S) x f.divX * ↑u⁻¹,
61     hxi, hix⟩, rfl⟩
62   exact (IsLocalRing.notMem_maximalIdeal).mpr hxunit hxM
63 
64 
65 /-- At a maximal point of a finite-type algebra over a perfect field, the
66 residue extension is finite and therefore separable. -/
67 theorem residueField_isSeparable_of_maximal_finiteType
68     {E : Type u} {S : Type v} [Field E] [PerfectField E]
69     [CommRing S] [Algebra E S] [Algebra.FiniteType E S]
70     (p : Ideal S) [p.IsPrime] [p.IsMaximal] :
71     Algebra.IsSeparable E p.ResidueField := by
72   letI : Algebra.FiniteType E p.ResidueField :=
73     Algebra.FiniteType.of_surjective (IsScalarTower.toAlgHom E S p.ResidueField)
74       (Ideal.algebraMap_residueField_surjective p)
75   have hfin : Module.Finite E p.ResidueField :=
76     finite_of_finite_type_of_isJacobsonRing E p.ResidueField
77   letI : Module.Finite E p.ResidueField := hfin
78   letI : Algebra.IsAlgebraic E p.ResidueField :=
79     Algebra.isAlgebraic_def.mpr fun x => IsAlgebraic.of_finite E x
80   exact Algebra.IsAlgebraic.isSeparable_of_perfectField
81 
82 /-- A finite-type curve is smooth at a DVR point when a nonzero global
83 parameter cuts out the local maximal ideal and the residue extension is
84 separable. Injectivity of the polynomial parameter map is proved from the
85 local parameter: a nonzero element of the local maximal ideal cannot be
86 algebraic over the coefficient field. -/
87 theorem isEtaleAt_of_polynomial_uniformizer
88     {E : Type u} {S : Type v}
89     [Field E] [CommRing S] [IsDomain S]
90     [Algebra E S] [Algebra (Polynomial E) S]
91     [IsScalarTower E (Polynomial E) S]
92     [Algebra.FiniteType E S]
93     (p : Ideal S) [p.IsPrime]
94     (hX0 : algebraMap (Polynomial E) S Polynomial.X ≠ 0)
95     (hparam : (Stafford38.Geometry.AsymptoticDivisorExistence.coordinateZeroPrime E).map
96         (algebraMap (Polynomial E) (Localization.AtPrime p)) =
97           maximalIdeal (Localization.AtPrime p))
98     (hsepE : Algebra.IsSeparable E p.ResidueField) :
99     Algebra.IsEtaleAt (Polynomial E) p := by
100   let A := Polynomial E
101   let x : S := algebraMap A S Polynomial.X
102   let xloc : Localization.AtPrime p := algebraMap S (Localization.AtPrime p) x
103   have hXloc : algebraMap A (Localization.AtPrime p) Polynomial.X ∈
104       maximalIdeal (Localization.AtPrime p) := by
105     rw [← hparam]
106     apply Ideal.mem_map_of_mem
107     change Polynomial.X ∈ Ideal.span {Polynomial.X}
108     exact Ideal.subset_span (Set.mem_singleton _)
109   have hmapX : algebraMap A (Localization.AtPrime p) Polynomial.X = xloc := by
110     change algebraMap A (Localization.AtPrime p) Polynomial.X =
111       algebraMap S (Localization.AtPrime p) (algebraMap A S Polynomial.X)
112     exact (IsScalarTower.algebraMap_apply A S (Localization.AtPrime p) Polynomial.X).symm
113   have hXlocMem : xloc ∈ maximalIdeal (Localization.AtPrime p) := by
114     rw [← hmapX]
115     exact hXloc
116   have hlocalizeInjective : Function.Injective (algebraMap S (Localization.AtPrime p)) :=
117     IsLocalization.injective (Localization.AtPrime p) p.primeCompl_le_nonZeroDivisors
118   have hxloc0 : xloc ≠ 0 := by
119     intro h
120     apply hX0
121     apply hlocalizeInjective
122     simpa [xloc, x] using h
123   have htrans : Transcendental E xloc := by
124     change ¬ IsAlgebraic E xloc
125     exact not_isAlgebraic_of_nonzero_mem_maximalIdeal hxloc0 hXlocMem
126   have hlocalAeInjective : Function.Injective (Polynomial.aeval xloc :
127       Polynomial E →ₐ[E] Localization.AtPrime p) :=
128     (transcendental_iff_injective).mp htrans
129   have hlocalAlg : IsScalarTower.toAlgHom E A (Localization.AtPrime p) =
130       Polynomial.aeval xloc := by
131     apply Polynomial.algHom_ext
132     rw [IsScalarTower.toAlgHom_apply, Polynomial.aeval_X]
133     exact hmapX
134   have hinj : Function.Injective (algebraMap A S) := by
135     intro f g hfg
136     have hcomp := congrArg (algebraMap S (Localization.AtPrime p)) hfg
137     have hcomp' : algebraMap A (Localization.AtPrime p) f =
138         algebraMap A (Localization.AtPrime p) g := by
139       simpa only [IsScalarTower.algebraMap_apply A S (Localization.AtPrime p)] using hcomp
140     have hEval : (Polynomial.aeval xloc) f = (Polynomial.aeval xloc) g := by
141       rw [← hlocalAlg]
142       exact hcomp'
143     exact hlocalAeInjective hEval
144   have hp0max :
145       (Stafford38.Geometry.AsymptoticDivisorExistence.coordinateZeroPrime E).IsMaximal := by
146     change (Ideal.span {(Polynomial.X : Polynomial E)}).IsMaximal
147     exact PrincipalIdealRing.isMaximal_of_irreducible Polynomial.irreducible_X
148   have hcontract :
149       Stafford38.Geometry.AsymptoticDivisorExistence.coordinateZeroPrime E ≤
150         p.comap (algebraMap (Polynomial E) S) := by
151     intro r hr
152     have hm : algebraMap (Polynomial E) (Localization.AtPrime p) r ∈
153         maximalIdeal (Localization.AtPrime p) := by
154       rw [← hparam]
155       exact Ideal.mem_map_of_mem _ hr
156     have htower : algebraMap (Polynomial E) (Localization.AtPrime p) r =
157         algebraMap S (Localization.AtPrime p) (algebraMap (Polynomial E) S r) :=
158       (IsScalarTower.algebraMap_apply (Polynomial E) S (Localization.AtPrime p) r).symm
159     rw [htower] at hm
160     exact (IsLocalization.AtPrime.to_map_mem_maximal_iff
161       (Localization.AtPrime p) p (algebraMap (Polynomial E) S r)).mp hm
162   have hcomapPrime :
163       (p.comap (algebraMap (Polynomial E) S)).IsPrime := Ideal.comap_isPrime _ p
164   have hcomapNe : p.comap (algebraMap (Polynomial E) S) ≠ ⊤ := hcomapPrime.ne_top
165   have hcomapEq :
166       Stafford38.Geometry.AsymptoticDivisorExistence.coordinateZeroPrime E =
167         p.comap (algebraMap (Polynomial E) S) := hp0max.eq_of_le hcomapNe hcontract
168   letI : p.LiesOver
169       (Stafford38.Geometry.AsymptoticDivisorExistence.coordinateZeroPrime E) := ⟨hcomapEq⟩
170   have hfiniteA : Algebra.FiniteType A S :=
171     Algebra.FiniteType.of_restrictScalars_finiteType E A S
172   letI : Algebra.FiniteType A S := hfiniteA
173   letI : Algebra.FinitePresentation A S :=
174     Algebra.FinitePresentation.of_finiteType.mp hfiniteA
175   have htorsion : Module.IsTorsionFree A S := by
176     rw [Module.isTorsionFree_iff_smul_eq_zero]
177     intro r x hrx
178     rw [Algebra.smul_def] at hrx
179     rcases mul_eq_zero.mp hrx with hr | hx
180     · exact Or.inl (hinj (by simpa using hr))
181     · exact Or.inr hx
182   letI : Module.IsTorsionFree A S := htorsion
183   have hflat : Module.Flat A S := by
184     rw [Module.Flat.flat_iff_torsion_eq_bot_of_isBezout]
185     exact Submodule.isTorsionFree_iff_torsion_eq_bot.mp htorsion
186   letI : Module.Flat A S := hflat
187   letI : Algebra
188     (Localization.AtPrime
189       (Stafford38.Geometry.AsymptoticDivisorExistence.coordinateZeroPrime E))
190     (Localization.AtPrime p) :=
191       Localization.AtPrime.algebraOfLiesOver
192         (Stafford38.Geometry.AsymptoticDivisorExistence.coordinateZeroPrime E) p
193   letI : Localization.AtPrime.IsLiesOverAlgebra
194     (Stafford38.Geometry.AsymptoticDivisorExistence.coordinateZeroPrime E) p := inferInstance
195   have hsep : Algebra.IsSeparable
196       (Stafford38.Geometry.AsymptoticDivisorExistence.coordinateZeroPrime E).ResidueField
197       p.ResidueField := by
198     let e := (Stafford38.Geometry.RelativeCoefficientDVR.coordinateResidueEquiv E).symm
199     have hcompat :
200         RingHom.comp
201           (algebraMap
202           (Stafford38.Geometry.AsymptoticDivisorExistence.coordinateZeroPrime E).ResidueField
203             p.ResidueField)
204           e.toRingHom =
205         RingHom.comp (RingEquiv.refl _).toRingHom (algebraMap E p.ResidueField) := by
206       ext x
207       change algebraMap
208           (Stafford38.Geometry.AsymptoticDivisorExistence.coordinateZeroPrime E).ResidueField
209           p.ResidueField (e x) = algebraMap E p.ResidueField x
210       have hx : e x = algebraMap E
211           (Stafford38.Geometry.AsymptoticDivisorExistence.coordinateZeroPrime E).ResidueField x := by
212         apply (Stafford38.Geometry.RelativeCoefficientDVR.coordinateResidueEquiv E).injective
213         simp [e]
214       rw [hx]
215       exact (IsScalarTower.algebraMap_apply E
216         (Stafford38.Geometry.AsymptoticDivisorExistence.coordinateZeroPrime E).ResidueField
217         p.ResidueField x).symm
218     exact Algebra.IsSeparable.of_equiv_equiv e
219       (RingEquiv.refl _) hcompat
220   letI : Algebra.IsSeparable
221     (Stafford38.Geometry.AsymptoticDivisorExistence.coordinateZeroPrime E).ResidueField
222     p.ResidueField := hsep
223   have hunram : Algebra.IsUnramifiedAt A p := by
224     rw [Algebra.isUnramifiedAt_iff_map_eq A
225       (Stafford38.Geometry.AsymptoticDivisorExistence.coordinateZeroPrime E) p]
226     exact ⟨hsep, hparam⟩
227   letI : Algebra.IsUnramifiedAt A p := hunram
228   have hetale : Algebra.IsEtaleAt A p :=
229     Algebra.IsEtaleAt.of_isUnramifiedAt_of_flat p
230   exact hetale
231 
232 /-- Explicit spelling of `IsEtaleAt` as the corresponding local formal-etale
233 map. It preserves the coefficient variable used by the uniformizer. -/
234 theorem formallyEtale_localization_of_polynomial_uniformizer
235     {E : Type u} {S : Type v}
236     [Field E] [CommRing S] [IsDomain S]
237     [Algebra E S] [Algebra (Polynomial E) S]
238     [IsScalarTower E (Polynomial E) S]
239     [Algebra.FiniteType E S]
240     (p : Ideal S) [p.IsPrime]
241     (hX0 : algebraMap (Polynomial E) S Polynomial.X ≠ 0)
242     (hparam : (Stafford38.Geometry.AsymptoticDivisorExistence.coordinateZeroPrime E).map
243         (algebraMap (Polynomial E) (Localization.AtPrime p)) =
244           maximalIdeal (Localization.AtPrime p))
245     (hsepE : Algebra.IsSeparable E p.ResidueField) :
246     Algebra.FormallyEtale (Polynomial E) (Localization.AtPrime p) :=
247   isEtaleAt_of_polynomial_uniformizer p hX0 hparam hsepE
248 
249 /-- Smoothness follows by composing the polynomial algebra's formal smoothness
250 with the local formal-etale map. -/
251 theorem isSmoothAt_of_polynomial_uniformizer
252     {E : Type u} {S : Type v}
253     [Field E] [CommRing S] [IsDomain S]
254     [Algebra E S] [Algebra (Polynomial E) S]
255     [IsScalarTower E (Polynomial E) S]
256     [Algebra.FiniteType E S]
257     (p : Ideal S) [p.IsPrime]
258     (hX0 : algebraMap (Polynomial E) S Polynomial.X ≠ 0)
259     (hparam : (Stafford38.Geometry.AsymptoticDivisorExistence.coordinateZeroPrime E).map
260         (algebraMap (Polynomial E) (Localization.AtPrime p)) =
261           maximalIdeal (Localization.AtPrime p))
262     (hsepE : Algebra.IsSeparable E p.ResidueField) :
263     Algebra.IsSmoothAt E p := by
264   letI : Algebra.FormallyEtale (Polynomial E) (Localization.AtPrime p) :=
265     formallyEtale_localization_of_polynomial_uniformizer p hX0 hparam hsepE
266   have hpoly : Algebra.FormallySmooth E (Polynomial E) := inferInstance
267   exact Algebra.FormallySmooth.comp E (Polynomial E) (Localization.AtPrime p)
268 
269 /-- Version requiring only that the divisor point be maximal over a perfect
270 coefficient field; residue separability is then supplied by Zariski's lemma. -/
271 theorem isEtaleAt_of_polynomial_uniformizer_of_maximal
272     {E : Type u} {S : Type v}
273     [Field E] [PerfectField E] [CommRing S] [IsDomain S]
274     [Algebra E S] [Algebra (Polynomial E) S]
275     [IsScalarTower E (Polynomial E) S]
276     [Algebra.FiniteType E S]
277     (p : Ideal S) [p.IsPrime] [p.IsMaximal]
278     (hX0 : algebraMap (Polynomial E) S Polynomial.X ≠ 0)
279     (hparam : (Stafford38.Geometry.AsymptoticDivisorExistence.coordinateZeroPrime E).map
280         (algebraMap (Polynomial E) (Localization.AtPrime p)) =
281           maximalIdeal (Localization.AtPrime p)) :
282     Algebra.IsEtaleAt (Polynomial E) p :=
283   isEtaleAt_of_polynomial_uniformizer p hX0 hparam
284     (residueField_isSeparable_of_maximal_finiteType p)
285 
286 /-- Smoothness follows for maximal points over a perfect coefficient field. -/
287 theorem isSmoothAt_of_polynomial_uniformizer_of_maximal
288     {E : Type u} {S : Type v}
289     [Field E] [PerfectField E] [CommRing S] [IsDomain S]
290     [Algebra E S] [Algebra (Polynomial E) S]
291     [IsScalarTower E (Polynomial E) S]
292     [Algebra.FiniteType E S]
293     (p : Ideal S) [p.IsPrime] [p.IsMaximal]
294     (hX0 : algebraMap (Polynomial E) S Polynomial.X ≠ 0)
295     (hparam : (Stafford38.Geometry.AsymptoticDivisorExistence.coordinateZeroPrime E).map
296         (algebraMap (Polynomial E) (Localization.AtPrime p)) =
297           maximalIdeal (Localization.AtPrime p)) :
298     Algebra.IsSmoothAt E p :=
299   isSmoothAt_of_polynomial_uniformizer p hX0 hparam
300     (residueField_isSeparable_of_maximal_finiteType p)
301 
302 
303 end Stafford38.Geometry.DVRParameterSmoothness
304