Stafford38/Geometry/RetainedDVRPlace.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Stafford38.Geometry.RelativeFractionFieldTransport
3 public import Mathlib.RingTheory.LocalRing.ResidueField.Ideal
4 public import Mathlib.RingTheory.Polynomial.Quotient
5 public import Mathlib.RingTheory.Trace.Quotient
6 public import Mathlib.RingTheory.Finiteness.Quotient
7 
8 @[expose] public section
9 
10 /-!
11 # A retained source-DVR place
12 
13 This file retains the local map from the source DVR in the divisorial
14 construction and proves finiteness of the induced residue extension. It does
15 not construct a relative coefficient-field map, residue separability, an
16 inverse limit, or a power-series chart.
17 -/
18 
19 namespace Stafford38.Geometry.RetainedDVR
20 
21 open IsLocalRing
22 open Stafford38.Geometry.AsymptoticDivisorExistence
23 open Stafford38.Geometry.RelativeDivisorialTower
24 open Stafford38.Geometry.RelativeFractionFieldTransport
25 
26 noncomputable section
27 
28 set_option maxHeartbeats 800000
29 set_option synthInstance.maxHeartbeats 100000
30 
31 universe u v w
32 
33 def ResidueExtensionFinite
34     {A V : Type*} [CommRing A] [IsLocalRing A]
35     [CommRing V] [IsLocalRing V] (factor : A →+* V)
36     (hlocal : IsLocalHom factor) : Prop := by
37   letI : Algebra A V := factor.toAlgebra
38   letI : IsLocalHom (algebraMap A V) := hlocal
39   exact Module.Finite (ResidueField A) (ResidueField V)
40 
41 /-- A divisorial place retaining its local source-DVR map. -/
42 structure RetainedDVRPlace
43     (A : Type u) [CommRing A] [IsDomain A] [IsLocalRing A]
44     {L : Type w} [Field L] [Algebra A L] (a : A) where
45   valuation : ValuationSubring L
46   isDiscrete : IsDiscreteValuationRing valuation.toSubring
47   parameter : valuation.toSubring
48   parameter_eq : (parameter : L) = algebraMap A L a
49   parameter_ne : parameter ≠ 0
50   parameter_nonunit : ¬IsUnit parameter
51   factor : A →+* valuation.toSubring
52   factor_commutes :
53     valuation.toSubring.subtype.comp factor = algebraMap A L
54   factor_isLocal : IsLocalHom factor
55   residue_finite : ResidueExtensionFinite factor factor_isLocal
56 
57 /-- Localization at the lying-over prime retains a local map from the source
58 DVR, and its residue field is finite over the source residue field. -/
59 theorem exists_retainedDVRPlace
60     {A : Type u} {F : Type v} {L : Type w}
61     [CommRing A] [IsDomain A] [IsDiscreteValuationRing A]
62     [Field F] [Algebra A F] [IsFractionRing A F]
63     [Field L] [Algebra A L] [Algebra F L] [IsScalarTower A F L]
64     [FiniteDimensional F L] [Algebra.IsSeparable F L]
65     (a : A) (ha_ne : a ≠ 0) (ha_nonunit : ¬IsUnit a) :
66     Nonempty (RetainedDVRPlace A (L := L) a) := by
67   let C : Type w := integralClosure A L
68   letI : IsDedekindDomain C := integralClosure.isDedekindDomain A F L
69   letI : IsFractionRing C L :=
70     IsIntegralClosure.isFractionRing_of_finite_extension A F L C
71   have hinjAL : Function.Injective (algebraMap A L) := by
72     rw [IsScalarTower.algebraMap_eq A F L]
73     exact (algebraMap F L).injective.comp (IsFractionRing.injective A F)
74   have hinjAC : Function.Injective (algebraMap A C) := by
75     intro x y hxy
76     apply hinjAL
77     calc
78       algebraMap A L x = algebraMap C L (algebraMap A C x) :=
79         (IsScalarTower.algebraMap_apply A C L x).symm
80       _ = algebraMap C L (algebraMap A C y) := congrArg (algebraMap C L) hxy
81       _ = algebraMap A L y := IsScalarTower.algebraMap_apply A C L y
82   let m := maximalIdeal A
83   have hm_ne : m ≠ ⊥ := IsDiscreteValuationRing.not_a_field A
84   letI : m.IsPrime := (maximalIdeal.isMaximal A).isPrime
85   have hker : RingHom.ker (algebraMap A C) ≤ m := by
86     rw [(RingHom.injective_iff_ker_eq_bot _).mp hinjAC]
87     exact bot_le
88   obtain ⟨Q, hQprime, hQcomap⟩ :=
89     Ideal.exists_ideal_over_prime_of_isIntegral_of_isDomain
90       (R := A) (S := C) m hker
91   letI : Q.IsPrime := hQprime
92   have hQ_ne : Q ≠ ⊥ := by
93     intro hQ
94     apply hm_ne
95     calc
96       m = Q.comap (algebraMap A C) := hQcomap.symm
97       _ = (⊥ : Ideal C).comap (algebraMap A C) := by rw [hQ]
98       _ = RingHom.ker (algebraMap A C) :=
99         (RingHom.ker_eq_comap_bot (algebraMap A C)).symm
100       _ = ⊥ := (RingHom.injective_iff_ker_eq_bot _).mp hinjAC
101   have hQmax : Q.IsMaximal := by
102     apply Ideal.isMaximal_of_isIntegral_of_isMaximal_under (R := A) Q
103     rw [hQcomap]
104     exact maximalIdeal.isMaximal A
105   letI : Q.IsMaximal := hQmax
106   let RQ : Type w := Localization.subalgebra.ofField L Q.primeCompl
107     Q.primeCompl_le_nonZeroDivisors
108   letI : IsDiscreteValuationRing RQ :=
109     IsLocalization.AtPrime.isDiscreteValuationRing_of_dedekind_domain
110       C hQ_ne RQ
111   let Rsub : Subring L :=
112     (Localization.subalgebra.ofField L Q.primeCompl
113       Q.primeCompl_le_nonZeroDivisors).toSubring
114   have hmem : ∀ y : L, y ∈ Rsub ∨ y⁻¹ ∈ Rsub := by
115     intro y
116     obtain ⟨r, hr | hr⟩ :=
117       (ValuationRing.isFractionRing_iff.mp
118         (inferInstance : IsFractionRing RQ L)).1 y
119     · left; rw [hr]; exact r.property
120     · right; rw [hr]; exact r.property
121   let V : ValuationSubring L := ValuationSubring.ofSubring Rsub hmem
122   have hVdvr : IsDiscreteValuationRing V.toSubring := by
123     change IsDiscreteValuationRing RQ
124     infer_instance
125   letI : IsScalarTower A C RQ :=
126     IsScalarTower.of_algebraMap_eq fun _ ↦ rfl
127   letI : IsScalarTower A RQ L :=
128     IsScalarTower.of_algebraMap_eq fun _ ↦ rfl
129   let factor : A →+* RQ := algebraMap A RQ
130   have hfactor : V.toSubring.subtype.comp factor = algebraMap A L := by
131     ext r
132     exact IsScalarTower.algebraMap_apply A RQ L r
133   have hfactorLocal : IsLocalHom factor := by
134     refine ⟨fun r hr ↦ ?_⟩
135     by_contra hru
136     have hrm : r ∈ m := by
137       rw [mem_maximalIdeal]
138       exact hru
139     have hfactor_mem : factor r ∈ maximalIdeal RQ := by
140       change algebraMap C RQ (algebraMap A C r) ∈ maximalIdeal RQ
141       rw [IsLocalization.AtPrime.to_map_mem_maximal_iff RQ Q]
142       change r ∈ Q.comap (algebraMap A C)
143       change r ∈ Q.under A
144       rw [hQcomap]
145       exact hrm
146     exact (mem_nonunits_iff.mp hfactor_mem) hr
147   let aC : C := algebraMap A C a
148   have haC_mem : aC ∈ Q := by
149     have ha : a ∈ Q.comap (algebraMap A C) := by
150       change a ∈ Q.under A
151       rw [hQcomap, mem_maximalIdeal]
152       exact ha_nonunit
153     simpa only [Ideal.mem_comap, aC] using ha
154   let aRQ : RQ := algebraMap C RQ aC
155   have haRQ_mem : aRQ ∈ maximalIdeal RQ :=
156     (IsLocalization.AtPrime.to_map_mem_maximal_iff RQ Q aC).2 haC_mem
157   have haRQ_nonunit : ¬IsUnit aRQ := mem_nonunits_iff.mp haRQ_mem
158   have haRQ_eq : (aRQ : L) = algebraMap A L a := by
159     change algebraMap C L (algebraMap A C a) = algebraMap A L a
160     exact IsScalarTower.algebraMap_apply A C L a
161   have haRQ_ne : aRQ ≠ 0 := by
162     intro ha0
163     apply ha_ne
164     apply hinjAL
165     calc
166       algebraMap A L a = (aRQ : L) := haRQ_eq.symm
167       _ = ((0 : RQ) : L) := congrArg ((↑) : RQ → L) ha0
168       _ = algebraMap A L 0 := by simp
169   letI : Algebra A RQ := factor.toAlgebra
170   letI : IsLocalHom (algebraMap A RQ) := hfactorLocal
171   letI : IsNoetherian A C := IsIntegralClosure.isNoetherian A F L C
172   letI : Module.Finite A C := inferInstance
173   letI : Q.LiesOver m := ⟨hQcomap.symm⟩
174   letI : Module.Finite (A ⧸ m) (C ⧸ Q) := inferInstance
175   let sourceResidue : (A ⧸ m) ≃+* ResidueField A :=
176     (Ideal.quotEquivOfEq (@IsLocalRing.ker_residue A _ _).symm).trans
177       (RingHom.quotientKerEquivOfSurjective
178         (f := residue A) residue_surjective)
179   let targetResidue : (C ⧸ Q) ≃+* ResidueField RQ :=
180     (IsLocalization.AtPrime.equivQuotMaximalIdeal Q RQ).toRingEquiv.trans
181       ((Ideal.quotEquivOfEq (@IsLocalRing.ker_residue RQ _ _).symm).trans
182         (RingHom.quotientKerEquivOfSurjective
183           (f := residue RQ) residue_surjective))
184   have hcompat :
185       RingHom.comp (algebraMap (ResidueField A) (ResidueField RQ))
186           sourceResidue.toRingHom =
187         RingHom.comp targetResidue.toRingHom
188           (algebraMap (A ⧸ m) (C ⧸ Q)) := by
189     ext r
190     change residue RQ (factor r) = residue RQ (factor r)
191     rfl
192   have hfinite : Module.Finite (ResidueField A) (ResidueField RQ) :=
193     Module.Finite.of_equiv_equiv sourceResidue targetResidue hcompat
194   exact ⟨{
195     valuation := V
196     isDiscrete := hVdvr
197     parameter := aRQ
198     parameter_eq := haRQ_eq
199     parameter_ne := haRQ_ne
200     parameter_nonunit := haRQ_nonunit
201     factor := factor
202     factor_commutes := hfactor
203     factor_isLocal := hfactorLocal
204     residue_finite := hfinite
205   }⟩
206 
207 end
208 
209 end Stafford38.Geometry.RetainedDVR
210