Stafford38/Geometry/DivisorialBoundaryExtension.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Stafford38.Geometry.AsymptoticDivisorExistence
3 public import Mathlib.RingTheory.DedekindDomain.IntegralClosure
4 public import Mathlib.RingTheory.DedekindDomain.Dvr
5 public import Mathlib.RingTheory.DedekindDomain.Instances
6 public import Mathlib.RingTheory.Ideal.Over
7 public import Mathlib.RingTheory.Localization.AsSubring
8 
9 @[expose] public section
10 
11 /-!
12 # Discrete boundary places in finite extensions
13 
14 This module constructs a discrete valuation subring above the maximal ideal
15 when the ambient field is a finite separable extension of a DVR fraction
16 field. It realizes the local ring inside the ambient field and retains the
17 selected nonzero nonunit. `RelativeDivisorialTower` and
18 `RelativeRetainedBoundaryPlace` assemble this step for a finitely generated
19 characteristic-zero field and a prescribed transcendental coordinate.
20 -/
21 
22 namespace Stafford38.Geometry.DivisorialBoundaryExtension
23 
24 open IsLocalRing
25 open Stafford38.Geometry.AsymptoticDivisorExistence
26 
27 noncomputable section
28 
29 universe u v w z
30 
31 attribute [-instance] instAlgebraAtPrimeFractionRing
32 
33 /-- A finite separable extension of the fraction field of a DVR has a
34 discrete valuation subring above the maximal ideal.
35 
36 The output is embedded in `L`.  The element `a` is carried to a nonzero
37 nonunit of this valuation subring, and its underlying element of `L` is the
38 original image of `a`. -/
39 theorem exists_discreteValuationSubring_over_maximalIdeal
40     {A : Type u} {F : Type v} {L : Type w}
41     [CommRing A] [IsDomain A] [IsDiscreteValuationRing A]
42     [Field F] [Algebra A F] [IsFractionRing A F]
43     [Field L] [Algebra A L] [Algebra F L] [IsScalarTower A F L]
44     [FiniteDimensional F L] [Algebra.IsSeparable F L]
45     (a : A) (ha_ne : a ≠ 0) (ha_nonunit : ¬IsUnit a) :
46     ∃ V : ValuationSubring L,
47       IsDiscreteValuationRing V.toSubring ∧
48       ∃ aV : V.toSubring,
49         (aV : L) = algebraMap A L a ∧
50         aV ≠ 0 ∧ ¬IsUnit aV := by
51   let C : Type w := integralClosure A L
52   letI : IsDedekindDomain C :=
53     integralClosure.isDedekindDomain A F L
54   letI : IsFractionRing C L :=
55     IsIntegralClosure.isFractionRing_of_finite_extension A F L C
56   have hinjAL : Function.Injective (algebraMap A L) := by
57     rw [IsScalarTower.algebraMap_eq A F L]
58     exact (algebraMap F L).injective.comp (IsFractionRing.injective A F)
59   have hinjAC : Function.Injective (algebraMap A C) := by
60     intro x y hxy
61     apply hinjAL
62     calc
63       algebraMap A L x = algebraMap C L (algebraMap A C x) :=
64         (IsScalarTower.algebraMap_apply A C L x).symm
65       _ = algebraMap C L (algebraMap A C y) := congrArg (algebraMap C L) hxy
66       _ = algebraMap A L y := IsScalarTower.algebraMap_apply A C L y
67   have hm_ne : maximalIdeal A ≠ ⊥ :=
68     IsDiscreteValuationRing.not_a_field A
69   letI : (maximalIdeal A).IsPrime := (maximalIdeal.isMaximal A).isPrime
70   have hker : RingHom.ker (algebraMap A C) ≤ maximalIdeal A := by
71     rw [(RingHom.injective_iff_ker_eq_bot _).mp
72       hinjAC]
73     exact bot_le
74   obtain ⟨Q, hQprime, hQcomap⟩ :=
75     Ideal.exists_ideal_over_prime_of_isIntegral_of_isDomain
76       (R := A) (S := C) (maximalIdeal A) hker
77   letI : Q.IsPrime := hQprime
78   have hQ_ne : Q ≠ ⊥ := by
79     intro hQ
80     apply hm_ne
81     calc
82       maximalIdeal A = Q.comap (algebraMap A C) := hQcomap.symm
83       _ = (⊥ : Ideal C).comap (algebraMap A C) := by rw [hQ]
84       _ = RingHom.ker (algebraMap A C) :=
85         (RingHom.ker_eq_comap_bot (algebraMap A C)).symm
86       _ = ⊥ := (RingHom.injective_iff_ker_eq_bot _).mp
87         hinjAC
88   let RQ : Type w :=
89     Localization.subalgebra.ofField L Q.primeCompl
90       Q.primeCompl_le_nonZeroDivisors
91   letI : IsDiscreteValuationRing RQ :=
92     IsLocalization.AtPrime.isDiscreteValuationRing_of_dedekind_domain
93       C hQ_ne RQ
94   let Rsub : Subring L :=
95     (Localization.subalgebra.ofField L Q.primeCompl
96       Q.primeCompl_le_nonZeroDivisors).toSubring
97   have hmem : ∀ x : L, x ∈ Rsub ∨ x⁻¹ ∈ Rsub := by
98     intro x
99     have hfrac : IsFractionRing RQ L := inferInstance
100     obtain ⟨r, hr | hr⟩ :=
101       (ValuationRing.isFractionRing_iff.mp hfrac).1 x
102     · left
103       change x ∈ (Localization.subalgebra.ofField L Q.primeCompl
104         Q.primeCompl_le_nonZeroDivisors).toSubring
105       rw [hr]
106       exact r.property
107     · right
108       change x⁻¹ ∈ (Localization.subalgebra.ofField L Q.primeCompl
109         Q.primeCompl_le_nonZeroDivisors).toSubring
110       rw [hr]
111       exact r.property
112   let V : ValuationSubring L := ValuationSubring.ofSubring Rsub hmem
113   have hVdvr : IsDiscreteValuationRing V.toSubring := by
114     change IsDiscreteValuationRing RQ
115     infer_instance
116   let aC : C := algebraMap A C a
117   have haC_mem : aC ∈ Q := by
118     have ha : a ∈ Q.comap (algebraMap A C) := by
119       change a ∈ Q.under A
120       rw [hQcomap, mem_maximalIdeal]
121       exact ha_nonunit
122     simpa only [Ideal.mem_comap, aC] using ha
123   let aRQ : RQ := algebraMap C RQ aC
124   have haRQ_mem : aRQ ∈ maximalIdeal RQ := by
125     exact (IsLocalization.AtPrime.to_map_mem_maximal_iff RQ Q aC).2 haC_mem
126   have haRQ_nonunit : ¬IsUnit aRQ := by
127     exact mem_nonunits_iff.mp haRQ_mem
128   have haRQ_eq : (aRQ : L) = algebraMap A L a := by
129     change algebraMap C L (algebraMap A C a) = algebraMap A L a
130     exact IsScalarTower.algebraMap_apply A C L a
131   have haRQ_ne : aRQ ≠ 0 := by
132     intro ha0
133     apply ha_ne
134     apply hinjAL
135     calc
136       algebraMap A L a = (aRQ : L) := haRQ_eq.symm
137       _ = ((0 : RQ) : L) := congrArg ((↑) : RQ → L) ha0
138       _ = algebraMap A L 0 := by simp
139   refine ⟨V, hVdvr, aRQ, haRQ_eq, haRQ_ne, ?_⟩
140   exact haRQ_nonunit
141 
142 /-- Characteristic-zero form.  Finite extensions are automatically
143 separable, so no separability hypothesis is exposed to the caller. -/
144 theorem exists_discreteValuationSubring_over_maximalIdeal_of_charZero
145     {A : Type u} {F : Type v} {L : Type w}
146     [CommRing A] [IsDomain A] [IsDiscreteValuationRing A]
147     [Field F] [CharZero F] [Algebra A F] [IsFractionRing A F]
148     [Field L] [Algebra A L] [Algebra F L] [IsScalarTower A F L]
149     [FiniteDimensional F L]
150     (a : A) (ha_ne : a ≠ 0) (ha_nonunit : ¬IsUnit a) :
151     ∃ V : ValuationSubring L,
152       IsDiscreteValuationRing V.toSubring ∧
153       ∃ aV : V.toSubring,
154         (aV : L) = algebraMap A L a ∧
155         aV ≠ 0 ∧ ¬IsUnit aV := by
156   letI : Algebra.IsSeparable F L := inferInstance
157   exact exists_discreteValuationSubring_over_maximalIdeal
158     (A := A) (F := F) (L := L) a ha_ne ha_nonunit
159 
160 /-- Specialization to the coordinate-zero DVR.  If the ambient field is a
161 finite separable extension of the fraction field of `k[X]_(X)`, compatibly
162 with `X ↦ x`, then the previously conditional `DiscreteBoundaryRefinement`
163 exists unconditionally. -/
164 theorem exists_discreteBoundaryRefinement_of_finiteExtension
165     (k : Type u) [Field k]
166     {K : Type w} [Field K] [Algebra k K]
167     (x : K)
168     [Algebra (CoordinateZeroLocalRing k) K]
169     [Algebra (FractionRing (CoordinateZeroLocalRing k)) K]
170     [IsScalarTower (CoordinateZeroLocalRing k)
171       (FractionRing (CoordinateZeroLocalRing k)) K]
172     [FiniteDimensional (FractionRing (CoordinateZeroLocalRing k)) K]
173     [Algebra.IsSeparable (FractionRing (CoordinateZeroLocalRing k)) K]
174     (hcoordinate :
175       algebraMap (CoordinateZeroLocalRing k) K
176         (algebraMap (Polynomial k) (CoordinateZeroLocalRing k)
177           (Polynomial.X : Polynomial k)) = x) :
178     Nonempty (DiscreteBoundaryRefinement k x) := by
179   let R := CoordinateZeroLocalRing k
180   let q : R := algebraMap (Polynomial k) R Polynomial.X
181   have hq_ne : q ≠ 0 := by
182     intro hq
183     apply Polynomial.X_ne_zero (R := k)
184     apply IsLocalization.injective R
185       (coordinateZeroPrime k).primeCompl_le_nonZeroDivisors
186     simpa only [q, map_zero] using hq
187   have hq_nonunit : ¬IsUnit q := by
188     rw [← mem_nonunits_iff, ← mem_maximalIdeal]
189     exact (IsLocalization.AtPrime.to_map_mem_maximal_iff
190       R (coordinateZeroPrime k) Polynomial.X).2
191         (Ideal.mem_span_singleton_self Polynomial.X)
192   obtain ⟨V, hVdvr, qV, hqV, hqV_ne, hqV_nonunit⟩ :=
193     exists_discreteValuationSubring_over_maximalIdeal
194       (A := R) (F := FractionRing R) (L := K) q hq_ne hq_nonunit
195   exact ⟨{
196     valuation := V
197     isDiscrete := hVdvr
198     coordinate := qV
199     coordinate_eq := hqV.trans hcoordinate
200     coordinate_ne := hqV_ne
201     coordinate_nonunit := hqV_nonunit
202   }⟩
203 
204 /-- Relative-function-field form.  The coefficient field `E` used to build
205 the `X`-adic DVR may differ from the original ground field `k`.  This is the
206 form needed after adjoining the other members of a transcendence basis:
207 once `K` is finite separable over `E(x)`, the output is still a boundary
208 refinement indexed by the original ground field. -/
209 theorem exists_discreteBoundaryRefinement_of_relativeFiniteExtension
210     (k : Type z) (E : Type u) [Field k] [Field E]
211     {K : Type w} [Field K] [Algebra k K] [Algebra E K]
212     (x : K)
213     [Algebra (CoordinateZeroLocalRing E) K]
214     [Algebra (FractionRing (CoordinateZeroLocalRing E)) K]
215     [IsScalarTower (CoordinateZeroLocalRing E)
216       (FractionRing (CoordinateZeroLocalRing E)) K]
217     [FiniteDimensional (FractionRing (CoordinateZeroLocalRing E)) K]
218     [Algebra.IsSeparable (FractionRing (CoordinateZeroLocalRing E)) K]
219     (hcoordinate :
220       algebraMap (CoordinateZeroLocalRing E) K
221         (algebraMap (Polynomial E) (CoordinateZeroLocalRing E)
222           (Polynomial.X : Polynomial E)) = x) :
223     Nonempty (DiscreteBoundaryRefinement k x) := by
224   obtain ⟨D⟩ :=
225     exists_discreteBoundaryRefinement_of_finiteExtension E x hcoordinate
226   exact ⟨{
227     valuation := D.valuation
228     isDiscrete := D.isDiscrete
229     coordinate := D.coordinate
230     coordinate_eq := D.coordinate_eq
231     coordinate_ne := D.coordinate_ne
232     coordinate_nonunit := D.coordinate_nonunit
233   }⟩
234 
235 /-- Characteristic-zero specialization of the coordinate theorem. -/
236 theorem exists_discreteBoundaryRefinement_of_finiteExtension_of_charZero
237     (k : Type u) [Field k] [CharZero k]
238     {K : Type w} [Field K] [Algebra k K]
239     (x : K)
240     [Algebra (CoordinateZeroLocalRing k) K]
241     [Algebra (FractionRing (CoordinateZeroLocalRing k)) K]
242     [IsScalarTower (CoordinateZeroLocalRing k)
243       (FractionRing (CoordinateZeroLocalRing k)) K]
244     [FiniteDimensional (FractionRing (CoordinateZeroLocalRing k)) K]
245     (hcoordinate :
246       algebraMap (CoordinateZeroLocalRing k) K
247         (algebraMap (Polynomial k) (CoordinateZeroLocalRing k)
248           (Polynomial.X : Polynomial k)) = x) :
249     Nonempty (DiscreteBoundaryRefinement k x) := by
250   letI : CharZero (CoordinateZeroLocalRing k) :=
251     charZero_of_injective_algebraMap
252       (algebraMap k (CoordinateZeroLocalRing k)).injective
253   letI : CharZero (FractionRing (CoordinateZeroLocalRing k)) :=
254     IsFractionRing.charZero_of_isFractionRing (CoordinateZeroLocalRing k)
255   letI : Algebra.IsIntegral
256       (FractionRing (CoordinateZeroLocalRing k)) K :=
257     ⟨fun y ↦ (IsAlgebraic.of_finite
258       (FractionRing (CoordinateZeroLocalRing k)) y).isIntegral⟩
259   letI : Algebra.IsSeparable
260       (FractionRing (CoordinateZeroLocalRing k)) K := inferInstance
261   exact exists_discreteBoundaryRefinement_of_finiteExtension
262     k x hcoordinate
263 
264 /-- Characteristic-zero relative-function-field form. -/
265 theorem exists_discreteBoundaryRefinement_of_relativeFiniteExtension_of_charZero
266     (k : Type z) (E : Type u) [Field k] [Field E] [CharZero E]
267     {K : Type w} [Field K] [Algebra k K] [Algebra E K]
268     (x : K)
269     [Algebra (CoordinateZeroLocalRing E) K]
270     [Algebra (FractionRing (CoordinateZeroLocalRing E)) K]
271     [IsScalarTower (CoordinateZeroLocalRing E)
272       (FractionRing (CoordinateZeroLocalRing E)) K]
273     [FiniteDimensional (FractionRing (CoordinateZeroLocalRing E)) K]
274     (hcoordinate :
275       algebraMap (CoordinateZeroLocalRing E) K
276         (algebraMap (Polynomial E) (CoordinateZeroLocalRing E)
277           (Polynomial.X : Polynomial E)) = x) :
278     Nonempty (DiscreteBoundaryRefinement k x) := by
279   obtain ⟨D⟩ :=
280     exists_discreteBoundaryRefinement_of_finiteExtension_of_charZero
281       E x hcoordinate
282   exact ⟨{
283     valuation := D.valuation
284     isDiscrete := D.isDiscrete
285     coordinate := D.coordinate
286     coordinate_eq := D.coordinate_eq
287     coordinate_ne := D.coordinate_ne
288     coordinate_nonunit := D.coordinate_nonunit
289   }⟩
290 
291 #print axioms exists_discreteValuationSubring_over_maximalIdeal
292 #print axioms exists_discreteValuationSubring_over_maximalIdeal_of_charZero
293 #print axioms exists_discreteBoundaryRefinement_of_finiteExtension
294 #print axioms exists_discreteBoundaryRefinement_of_relativeFiniteExtension
295 #print axioms exists_discreteBoundaryRefinement_of_finiteExtension_of_charZero
296 #print axioms exists_discreteBoundaryRefinement_of_relativeFiniteExtension_of_charZero
297 
298 attribute [instance] instAlgebraAtPrimeFractionRing
299 
300 end
301 
302 end Stafford38.Geometry.DivisorialBoundaryExtension
303