Stafford38/Geometry/ActualDivisorUniformizerNumerator.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Stafford38.Geometry.DVRUniformizerNumerator
3 
4 @[expose] public section
5 
6 set_option autoImplicit false
7 
8 noncomputable section
9 
10 namespace Stafford38.Geometry.ActualDivisorUniformizerNumerator
11 
12 open IsLocalRing
13 
14 universe u
15 
16 /-- Transport the numerator of a prescribed uniformizer across an actual
17 local-ring equivalence. The denominator remains explicit, so the numerator is
18 known to map to that uniformizer times a unit. -/
19 theorem exists_numerator_of_local_equiv_with_span
20     {B V : Type u} [CommRing B] [IsDomain B] [CommRing V]
21     (P : Ideal B) [P.IsPrime]
22     [IsDiscreteValuationRing (Localization.AtPrime P)]
23     (e : Localization.AtPrime P ≃+* V)
24     (π : V) (hπ : Irreducible π) :
25     ∃ a : B, ∃ b : P.primeCompl,
26       a ≠ 0 ∧ a ∈ P ∧
27       IsLocalization.mk' (Localization.AtPrime P) a b = e.symm π ∧
28       Ideal.span {algebraMap B (Localization.AtPrime P) a} =
29         maximalIdeal (Localization.AtPrime P) ∧
30       IsUnit (e (algebraMap B (Localization.AtPrime P) (b : B))) ∧
31       e (algebraMap B (Localization.AtPrime P) a) =
32         π * e (algebraMap B (Localization.AtPrime P) (b : B)) := by
33   let πP : Localization.AtPrime P := e.symm π
34   have hπP : Irreducible πP := hπ.map e.symm
35   obtain ⟨a, b, ha0, haP, hrep, hspan⟩ :=
36     Stafford38.Geometry.DVRUniformizerNumerator.exists_numerator_of_dvr_localization_of_irreducible
37       P πP hπP
38   have hbunit : IsUnit (algebraMap B (Localization.AtPrime P) (b : B)) :=
39     IsLocalization.map_units (Localization.AtPrime P) b
40   have hmapa : algebraMap B (Localization.AtPrime P) a =
41       πP * algebraMap B (Localization.AtPrime P) (b : B) := by
42     calc
43       algebraMap B (Localization.AtPrime P) a =
44           IsLocalization.mk' (Localization.AtPrime P) a b *
45             algebraMap B (Localization.AtPrime P) (b : B) :=
46         (IsLocalization.mk'_spec (Localization.AtPrime P) a b).symm
47       _ = πP * algebraMap B (Localization.AtPrime P) (b : B) := by rw [hrep]
48   refine ⟨a, b, ha0, haP, hrep, hspan, ?_, ?_⟩
49   · exact IsUnit.map e.toMonoidHom hbunit
50   · calc
51       e (algebraMap B (Localization.AtPrime P) a) =
52           e (πP * algebraMap B (Localization.AtPrime P) (b : B)) :=
53         congrArg e hmapa
54       _ = π * e (algebraMap B (Localization.AtPrime P) (b : B)) := by
55         simp [πP]
56 
57 /-- Backwards-compatible projection of the local numerator data without its
58 maximal-ideal generator identity. -/
59 theorem exists_numerator_of_local_equiv
60     {B V : Type u} [CommRing B] [IsDomain B] [CommRing V]
61     (P : Ideal B) [P.IsPrime]
62     [IsDiscreteValuationRing (Localization.AtPrime P)]
63     (e : Localization.AtPrime P ≃+* V)
64     (π : V) (hπ : Irreducible π) :
65     ∃ a : B, ∃ b : P.primeCompl,
66       a ≠ 0 ∧ a ∈ P ∧
67       IsLocalization.mk' (Localization.AtPrime P) a b = e.symm π ∧
68       IsUnit (e (algebraMap B (Localization.AtPrime P) (b : B))) ∧
69       e (algebraMap B (Localization.AtPrime P) a) =
70         π * e (algebraMap B (Localization.AtPrime P) (b : B)) := by
71   obtain ⟨a, b, ha0, haP, hrep, _hspan, hden, hfactor⟩ :=
72     exists_numerator_of_local_equiv_with_span P e π hπ
73   exact ⟨a, b, ha0, haP, hrep, hden, hfactor⟩
74 
75 /-- Replace a local uniformizer by its global numerator in two power
76 factorizations. The unit correction is explicit and is transported back
77 through the local equivalence. -/
78 theorem transfer_two_unit_power_factorizations
79     {B V : Type u} [CommRing B] [CommRing V]
80     (P : Ideal B) [P.IsPrime]
81     (e : Localization.AtPrime P ≃+* V)
82     (s q₀ q₁ : B) (π : V) (d : Vˣ)
83     (n₀ n₁ : ℕ) (v₀ v₁ : V)
84     (hs : e (algebraMap B (Localization.AtPrime P) s) = π * d)
85     (h₀ : e (algebraMap B (Localization.AtPrime P) q₀) = π ^ n₀ * v₀)
86     (h₁ : e (algebraMap B (Localization.AtPrime P) q₁) = π ^ n₁ * v₁)
87     (hv₀ : IsUnit v₀) (hv₁ : IsUnit v₁) :
88     ∃ u₀ u₁ : Localization.AtPrime P,
89       IsUnit u₀ ∧ IsUnit u₁ ∧
90       algebraMap B (Localization.AtPrime P) q₀ =
91         (algebraMap B (Localization.AtPrime P) s) ^ n₀ * u₀ ∧
92       algebraMap B (Localization.AtPrime P) q₁ =
93         (algebraMap B (Localization.AtPrime P) s) ^ n₁ * u₁ := by
94   let u₀V : V := v₀ * ((d⁻¹ : Vˣ) : V) ^ n₀
95   let u₁V : V := v₁ * ((d⁻¹ : Vˣ) : V) ^ n₁
96   have hu₀V : IsUnit u₀V := hv₀.mul ((Units.isUnit (d⁻¹ : Vˣ)).pow n₀)
97   have hu₁V : IsUnit u₁V := hv₁.mul ((Units.isUnit (d⁻¹ : Vˣ)).pow n₁)
98   let u₀ : Localization.AtPrime P := e.symm u₀V
99   let u₁ : Localization.AtPrime P := e.symm u₁V
100   have hu₀ : IsUnit u₀ := IsUnit.map e.symm.toMonoidHom hu₀V
101   have hu₁ : IsUnit u₁ := IsUnit.map e.symm.toMonoidHom hu₁V
102   have hdCancel₀ : (d : V) ^ n₀ * ((d⁻¹ : Vˣ) : V) ^ n₀ = 1 := by
103     rw [← mul_pow]
104     simp
105   have hdCancel₁ : (d : V) ^ n₁ * ((d⁻¹ : Vˣ) : V) ^ n₁ = 1 := by
106     rw [← mul_pow]
107     simp
108   have hcancel₀ : π ^ n₀ * v₀ = (π * d) ^ n₀ * u₀V := by
109     calc
110       π ^ n₀ * v₀ = π ^ n₀ * (v₀ * 1) := by simp
111       _ = π ^ n₀ * (v₀ *
112           ((d : V) ^ n₀ * ((d⁻¹ : Vˣ) : V) ^ n₀)) := by
113         rw [hdCancel₀]
114       _ = π ^ n₀ * (d : V) ^ n₀ *
115           (v₀ * ((d⁻¹ : Vˣ) : V) ^ n₀) := by ring
116       _ = (π * d) ^ n₀ * u₀V := by
117         rw [mul_pow]
118   have hcancel₁ : π ^ n₁ * v₁ = (π * d) ^ n₁ * u₁V := by
119     calc
120       π ^ n₁ * v₁ = π ^ n₁ * (v₁ * 1) := by simp
121       _ = π ^ n₁ * (v₁ *
122           ((d : V) ^ n₁ * ((d⁻¹ : Vˣ) : V) ^ n₁)) := by
123         rw [hdCancel₁]
124       _ = π ^ n₁ * (d : V) ^ n₁ *
125           (v₁ * ((d⁻¹ : Vˣ) : V) ^ n₁) := by ring
126       _ = (π * d) ^ n₁ * u₁V := by
127         rw [mul_pow]
128   refine ⟨u₀, u₁, hu₀, hu₁, ?_, ?_⟩
129   · apply e.injective
130     calc
131       e (algebraMap B (Localization.AtPrime P) q₀) = π ^ n₀ * v₀ := h₀
132       _ = (π * d) ^ n₀ * u₀V := hcancel₀
133       _ = e ((algebraMap B (Localization.AtPrime P) s) ^ n₀ * u₀) := by
134         simp [hs, u₀, u₀V]
135   · apply e.injective
136     calc
137       e (algebraMap B (Localization.AtPrime P) q₁) = π ^ n₁ * v₁ := h₁
138       _ = (π * d) ^ n₁ * u₁V := hcancel₁
139       _ = e ((algebraMap B (Localization.AtPrime P) s) ^ n₁ * u₁) := by
140         simp [hs, u₁, u₁V]
141 
142 /-- Actual numerator plus the transferred q₀/q₁ order factorizations. The
143 only input about the numerator is the equivalence of the given local ring with
144 the DVR; no numerator or unit-power conclusion is assumed. -/
145 theorem exists_numerator_with_two_unit_power_factorizations_and_span
146     {B V : Type u} [CommRing B] [IsDomain B] [CommRing V]
147     (P : Ideal B) [P.IsPrime]
148     [IsDiscreteValuationRing (Localization.AtPrime P)]
149     (e : Localization.AtPrime P ≃+* V)
150     (π : V) (hπ : Irreducible π)
151     (q₀ q₁ : B) (n₀ n₁ : ℕ) (v₀ v₁ : V)
152     (h₀ : e (algebraMap B (Localization.AtPrime P) q₀) = π ^ n₀ * v₀)
153     (h₁ : e (algebraMap B (Localization.AtPrime P) q₁) = π ^ n₁ * v₁)
154     (hv₀ : IsUnit v₀) (hv₁ : IsUnit v₁) :
155     ∃ s : B, ∃ b : P.primeCompl, ∃ u₀ u₁ : Localization.AtPrime P,
156       s ≠ 0 ∧ s ∈ P ∧
157       IsLocalization.mk' (Localization.AtPrime P) s b = e.symm π ∧
158       Ideal.span {algebraMap B (Localization.AtPrime P) s} =
159         maximalIdeal (Localization.AtPrime P) ∧
160       IsUnit u₀ ∧ IsUnit u₁ ∧
161       algebraMap B (Localization.AtPrime P) q₀ =
162         (algebraMap B (Localization.AtPrime P) s) ^ n₀ * u₀ ∧
163       algebraMap B (Localization.AtPrime P) q₁ =
164         (algebraMap B (Localization.AtPrime P) s) ^ n₁ * u₁ := by
165   obtain ⟨s, b, hs0, hsP, hmk, hspan, hden, hfactor⟩ :=
166     exists_numerator_of_local_equiv_with_span P e π hπ
167   let d : Vˣ := hden.unit
168   obtain ⟨u₀, u₁, hu₀, hu₁, hq₀, hq₁⟩ :=
169     transfer_two_unit_power_factorizations P e s q₀ q₁ π
170       d
171       n₀ n₁ v₀ v₁ hfactor h₀ h₁ hv₀ hv₁
172   exact ⟨s, b, u₀, u₁, hs0, hsP, hmk, hspan, hu₀, hu₁, hq₀, hq₁⟩
173 
174 /-- Backwards-compatible projection omitting the maximal-ideal identity. -/
175 theorem exists_numerator_with_two_unit_power_factorizations
176     {B V : Type u} [CommRing B] [IsDomain B] [CommRing V]
177     (P : Ideal B) [P.IsPrime]
178     [IsDiscreteValuationRing (Localization.AtPrime P)]
179     (e : Localization.AtPrime P ≃+* V)
180     (π : V) (hπ : Irreducible π)
181     (q₀ q₁ : B) (n₀ n₁ : ℕ) (v₀ v₁ : V)
182     (h₀ : e (algebraMap B (Localization.AtPrime P) q₀) = π ^ n₀ * v₀)
183     (h₁ : e (algebraMap B (Localization.AtPrime P) q₁) = π ^ n₁ * v₁)
184     (hv₀ : IsUnit v₀) (hv₁ : IsUnit v₁) :
185     ∃ s : B, ∃ b : P.primeCompl, ∃ u₀ u₁ : Localization.AtPrime P,
186       s ≠ 0 ∧ s ∈ P ∧
187       IsLocalization.mk' (Localization.AtPrime P) s b = e.symm π ∧
188       IsUnit u₀ ∧ IsUnit u₁ ∧
189       algebraMap B (Localization.AtPrime P) q₀ =
190         (algebraMap B (Localization.AtPrime P) s) ^ n₀ * u₀ ∧
191       algebraMap B (Localization.AtPrime P) q₁ =
192         (algebraMap B (Localization.AtPrime P) s) ^ n₁ * u₁ := by
193   obtain ⟨s, b, u₀, u₁, hs0, hsP, hmk, _hspan, hu₀, hu₁, hq₀, hq₁⟩ :=
194     exists_numerator_with_two_unit_power_factorizations_and_span
195       P e π hπ q₀ q₁ n₀ n₁ v₀ v₁ h₀ h₁ hv₀ hv₁
196   exact ⟨s, b, u₀, u₁, hs0, hsP, hmk, hu₀, hu₁, hq₀, hq₁⟩
197 
198 end Stafford38.Geometry.ActualDivisorUniformizerNumerator
199