Stafford38/Geometry/A0ChartGeneratorCoordinates.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Stafford38.Geometry.A0ChartFormalEtale
3 
4 @[expose] public section
5 
6 set_option autoImplicit false
7 set_option maxHeartbeats 2400000
8 
9 noncomputable section
10 namespace Stafford38.Geometry.A0ChartGeneratorCoordinates
11 
12 open Stafford38.Geometry.ProjectiveChartSameFieldOverlap
13 open Stafford38.Geometry.A0ChartFormalEtale
14 open Stafford38.Geometry.EtaleGenericOpenTransport
15 open Stafford38.Geometry.AffineComponentCoordinateSplit
16 open Stafford38.Geometry.ComponentFunctionFieldBoundary
17 
18 universe u v w
19 
20 private theorem selectedChartAwayEquiv_base
21     {k : Type u} [Field k] {m : ℕ}
22     {Q : Type v} [CommRing Q] [Algebra k Q]
23     (P : PrimeSpectrum (MvPolynomial (Fin m) k)) (j : Fin m)
24     (hsel : SelectedAffineChartQuotient (k := k) P j ≃ₐ[k] Q)
25     (x : SelectedAffineChartQuotient (k := k) P j) :
26     selectedChartAwayEquivOfQuotientEquiv P j hsel
27       (algebraMap (SelectedAffineChartQuotient (k := k) P j)
28         (SelectedAffineChartLocalization (k := k) P j) x) =
29       algebraMap Q (Localization.Away (hsel (selectedAffineChartDenominator P j)))
30         (hsel x) := by
31   let R := SelectedAffineChartQuotient (k := k) P j
32   let S := SelectedAffineChartLocalization (k := k) P j
33   let T := Localization.Away (hsel (selectedAffineChartDenominator P j))
34   let M := Submonoid.powers (selectedAffineChartDenominator P j)
35   let N := Submonoid.powers (hsel (selectedAffineChartDenominator P j))
36   letI : IsLocalization M S := Localization.isLocalization
37   letI : IsLocalization.Away
38       (hsel.toRingEquiv.toRingHom (selectedAffineChartDenominator P j)) T :=
39     Localization.isLocalization
40   have hmap : Submonoid.map hsel M = N := by
41     simp [M, N, Submonoid.map_powers]
42   change IsLocalization.algEquivOfAlgEquiv
43       (S := S) (Q := T) (h := hsel) hmap
44     (algebraMap R S x) = algebraMap Q T (hsel x)
45   exact IsLocalization.algEquivOfAlgEquiv_eq
46     (S := S) (Q := T) (h := hsel) hmap x
47 
48 private theorem selectedChartAwayEquiv_invSelf
49     {k : Type u} [Field k] {m : ℕ}
50     {Q : Type v} [CommRing Q] [Algebra k Q]
51     (P : PrimeSpectrum (MvPolynomial (Fin m) k)) (j : Fin m)
52     (hsel : SelectedAffineChartQuotient (k := k) P j ≃ₐ[k] Q) :
53     selectedChartAwayEquivOfQuotientEquiv P j hsel
54       (IsLocalization.Away.invSelf (selectedAffineChartDenominator P j)) =
55       IsLocalization.Away.invSelf (hsel (selectedAffineChartDenominator P j)) := by
56   let R := SelectedAffineChartQuotient (k := k) P j
57   let S := SelectedAffineChartLocalization (k := k) P j
58   let T := Localization.Away (hsel (selectedAffineChartDenominator P j))
59   let M := Submonoid.powers (selectedAffineChartDenominator P j)
60   let N := Submonoid.powers (hsel (selectedAffineChartDenominator P j))
61   letI : IsLocalization M S := Localization.isLocalization
62   letI : IsLocalization.Away
63       (hsel.toRingEquiv.toRingHom (selectedAffineChartDenominator P j)) T :=
64     Localization.isLocalization
65   have hmap : Submonoid.map hsel M = N := by
66     simp [M, N, Submonoid.map_powers]
67   let E := selectedChartAwayEquivOfQuotientEquiv P j hsel
68   have hbase := selectedChartAwayEquiv_base P j hsel
69     (selectedAffineChartDenominator P j)
70   have hprod :
71       algebraMap Q T (hsel (selectedAffineChartDenominator P j)) *
72           E (IsLocalization.Away.invSelf (selectedAffineChartDenominator P j)) = 1 := by
73     calc
74       _ = E (algebraMap R S (selectedAffineChartDenominator P j)) *
75           E (IsLocalization.Away.invSelf (selectedAffineChartDenominator P j)) := by
76             rw [hbase]
77       _ = E (algebraMap R S (selectedAffineChartDenominator P j) *
78           IsLocalization.Away.invSelf (selectedAffineChartDenominator P j)) := by
79             rw [← map_mul]
80       _ = E 1 := by rw [IsLocalization.Away.mul_invSelf]
81       _ = 1 := map_one _
82   calc
83     E (IsLocalization.Away.invSelf (selectedAffineChartDenominator P j)) =
84         1 * E (IsLocalization.Away.invSelf (selectedAffineChartDenominator P j)) := by simp
85     _ = (algebraMap Q T (hsel (selectedAffineChartDenominator P j)) *
86         IsLocalization.Away.invSelf (hsel (selectedAffineChartDenominator P j))) *
87         E (IsLocalization.Away.invSelf (selectedAffineChartDenominator P j)) := by
88           rw [IsLocalization.Away.mul_invSelf]
89     _ = IsLocalization.Away.invSelf (hsel (selectedAffineChartDenominator P j)) *
90         (algebraMap Q T (hsel (selectedAffineChartDenominator P j)) *
91           E (IsLocalization.Away.invSelf (selectedAffineChartDenominator P j))) := by ac_rfl
92     _ = IsLocalization.Away.invSelf (hsel (selectedAffineChartDenominator P j)) * 1 := by
93           rw [hprod]
94     _ = IsLocalization.Away.invSelf (hsel (selectedAffineChartDenominator P j)) := by simp
95 
96 /-- The original affine variable in the common open is the selected chart
97 coordinate divided by the selected chart's distinguished denominator.  This
98 is the multiplicative identity before any map to the valuation ring or field. -/
99 theorem originalGenerator_commonOpen_identity
100     {k : Type u} [Field k] {m : ℕ}
101     {Q : Type v} [CommRing Q] [Algebra k Q]
102     {B : Type w} [CommRing B] [Algebra Q B]
103     (P : PrimeSpectrum (MvPolynomial (Fin m) k)) (j i : Fin m)
104     (hij : i ≠ j) (hxj : componentCoordinate P j ≠ 0)
105     (hsel : SelectedAffineChartQuotient (k := k) P j ≃ₐ[k] Q)
106     (M : Ideal B) [M.IsPrime] (f : Q)
107     (e : Localization.Away f ≃ₐ[Q]
108       Localization.Away (algebraMap Q B f)) :
109     let g := hsel (selectedAffineChartDenominator P j)
110     let Cq := genericOpenRing M f e
111     let C := genericOpenExtraAwayB M f e g
112     letI : Semiring C := (inferInstance : CommSemiring C).toSemiring
113     letI : Algebra Q Cq := inferInstance
114     letI : Algebra Cq C := inferInstance
115     letI : Algebra Q C := Algebra.compHom C (algebraMap Q Cq)
116     algebraMap Cq C
117         (algebraMap Q Cq
118           (hsel (selectedAffineChartVariableClass P j i hij))) =
119       algebraMap Cq C (algebraMap Q Cq g) *
120         originalAffineChartToCommonOpen P j hxj hsel M f e
121           (Ideal.Quotient.mk P.asIdeal (MvPolynomial.X i)) := by
122   dsimp
123   let g := hsel (selectedAffineChartDenominator P j)
124   let Cq := genericOpenRing M f e
125   let C := genericOpenExtraAwayB M f e g
126   let A₀ := OriginalAffineChartQuotient (k := k) P
127   let S := OriginalAffineChartLocalization (k := k) P j
128   let T := Localization.Away g
129   letI : Semiring C := (inferInstance : CommSemiring C).toSemiring
130   letI : Algebra Q Cq := inferInstance
131   letI : Algebra Cq C := inferInstance
132   letI : Algebra Q C := Algebra.compHom C (algebraMap Q Cq)
133   have hz : genericOpenBMap M f e (algebraMap Q B g) = algebraMap Q Cq g :=
134     genericOpenBMap_base_eq M f e g
135   letI : IsLocalization.Away (algebraMap Q Cq g) C := by
136     rw [← hz]
137     infer_instance
138   let h : S ≃ₐ[k] T :=
139     (originalAffineChartOverlapEquiv P j hxj).trans
140       (selectedChartAwayEquivOfQuotientEquiv P j hsel)
141   let ψ : T →+* C := IsLocalization.Away.map
142     (S := T) (Q := C) (algebraMap Q Cq) g
143   have hXi :
144       originalAffineChartToCommonOpen P j hxj hsel M f e
145         (Ideal.Quotient.mk P.asIdeal (MvPolynomial.X i)) =
146       ψ (algebraMap Q T
147         (hsel (selectedAffineChartVariableClass P j i hij)) *
148         IsLocalization.Away.invSelf g) := by
149     change ψ (h (algebraMap A₀ S
150       (Ideal.Quotient.mk P.asIdeal (MvPolynomial.X i)))) = _
151     have hov : h (algebraMap A₀ S
152         (Ideal.Quotient.mk P.asIdeal (MvPolynomial.X i))) =
153       algebraMap Q T
154         (hsel (selectedAffineChartVariableClass P j i hij)) *
155           IsLocalization.Away.invSelf g := by
156       change selectedChartAwayEquivOfQuotientEquiv P j hsel
157         ((originalAffineChartOverlapEquiv P j hxj)
158           (algebraMap A₀ S
159             (Ideal.Quotient.mk P.asIdeal (MvPolynomial.X i)))) = _
160       rw [originalAffineChartOverlapEquiv_Xi P j i hij hxj]
161       rw [map_mul, selectedChartAwayEquiv_base, selectedChartAwayEquiv_invSelf]
162     rw [hov]
163   have hψv :
164       ψ (algebraMap Q T
165         (hsel (selectedAffineChartVariableClass P j i hij))) =
166       algebraMap Cq C (algebraMap Q Cq
167         (hsel (selectedAffineChartVariableClass P j i hij))) := by
168     simp [ψ, IsLocalization.Away.map, IsLocalization.map_mk']
169   have hψg : ψ (algebraMap Q T g) = algebraMap Cq C (algebraMap Q Cq g) := by
170     simp [ψ, IsLocalization.Away.map, IsLocalization.map_mk']
171   have hmul :
172       algebraMap Q T g *
173           (algebraMap Q T (hsel (selectedAffineChartVariableClass P j i hij)) *
174             IsLocalization.Away.invSelf g) =
175         algebraMap Q T (hsel (selectedAffineChartVariableClass P j i hij)) := by
176     calc
177       _ = (algebraMap Q T g * IsLocalization.Away.invSelf g) *
178           algebraMap Q T (hsel (selectedAffineChartVariableClass P j i hij)) := by ac_rfl
179       _ = algebraMap Q T (hsel (selectedAffineChartVariableClass P j i hij)) := by
180         simp [IsLocalization.Away.mul_invSelf]
181   calc
182     algebraMap Cq C (algebraMap Q Cq
183         (hsel (selectedAffineChartVariableClass P j i hij))) =
184       ψ (algebraMap Q T
185         (hsel (selectedAffineChartVariableClass P j i hij))) := hψv.symm
186     _ = ψ (algebraMap Q T g) *
187         ψ (algebraMap Q T
188           (hsel (selectedAffineChartVariableClass P j i hij)) *
189           IsLocalization.Away.invSelf g) := by
190       rw [← map_mul]
191       exact congrArg ψ hmul.symm
192     _ = algebraMap Cq C (algebraMap Q Cq g) *
193         originalAffineChartToCommonOpen P j hxj hsel M f e
194           (Ideal.Quotient.mk P.asIdeal (MvPolynomial.X i)) := by
195       rw [hψg, hXi]
196 
197 /-- The selected projective coordinate times the original affine generator
198 is one on the common open. -/
199 theorem selectedGenerator_commonOpen_product
200     {k : Type u} [Field k] {m : ℕ}
201     {Q : Type v} [CommRing Q] [Algebra k Q]
202     {B : Type w} [CommRing B] [Algebra Q B]
203     (P : PrimeSpectrum (MvPolynomial (Fin m) k)) (j : Fin m)
204     (hxj : componentCoordinate P j ≠ 0)
205     (hsel : SelectedAffineChartQuotient (k := k) P j ≃ₐ[k] Q)
206     (M : Ideal B) [M.IsPrime] (f : Q)
207     (e : Localization.Away f ≃ₐ[Q]
208       Localization.Away (algebraMap Q B f)) :
209     let g := hsel (selectedAffineChartDenominator P j)
210     let Cq := genericOpenRing M f e
211     let C := genericOpenExtraAwayB M f e g
212     letI : Semiring C := (inferInstance : CommSemiring C).toSemiring
213     letI : Algebra Q Cq := inferInstance
214     letI : Algebra Cq C := inferInstance
215     letI : Algebra Q C := Algebra.compHom C (algebraMap Q Cq)
216     algebraMap Cq C (algebraMap Q Cq g) *
217       originalAffineChartToCommonOpen P j hxj hsel M f e
218         (Ideal.Quotient.mk P.asIdeal (MvPolynomial.X j)) = 1 := by
219   dsimp
220   let g := hsel (selectedAffineChartDenominator P j)
221   let Cq := genericOpenRing M f e
222   let C := genericOpenExtraAwayB M f e g
223   let A₀ := OriginalAffineChartQuotient (k := k) P
224   let S₀ := OriginalAffineChartLocalization (k := k) P j
225   let T := Localization.Away g
226   let E := selectedChartAwayEquivOfQuotientEquiv P j hsel
227   letI : Semiring C := (inferInstance : CommSemiring C).toSemiring
228   letI : Algebra Q Cq := inferInstance
229   letI : Algebra Cq C := inferInstance
230   letI : Algebra Q C := Algebra.compHom C (algebraMap Q Cq)
231   have hz : genericOpenBMap M f e (algebraMap Q B g) = algebraMap Q Cq g :=
232     genericOpenBMap_base_eq M f e g
233   letI : IsLocalization.Away (algebraMap Q Cq g) C := by
234     rw [← hz]
235     infer_instance
236   let ψ : T →+* C := IsLocalization.Away.map
237     (S := T) (Q := C) (algebraMap Q Cq) g
238   have hprod : algebraMap Q T g *
239       E (IsLocalization.Away.invSelf (selectedAffineChartDenominator P j)) = 1 := by
240     change algebraMap Q T g *
241       selectedChartAwayEquivOfQuotientEquiv P j hsel
242         (IsLocalization.Away.invSelf (selectedAffineChartDenominator P j)) = 1
243     rw [selectedChartAwayEquiv_invSelf P j hsel]
244     rw [IsLocalization.Away.mul_invSelf]
245   have hψg : ψ (algebraMap Q T g) = algebraMap Cq C (algebraMap Q Cq g) := by
246     simp [ψ, IsLocalization.Away.map]
247   have hXj : originalAffineChartToCommonOpen P j hxj hsel M f e
248       (Ideal.Quotient.mk P.asIdeal (MvPolynomial.X j)) =
249       ψ (E (IsLocalization.Away.invSelf (selectedAffineChartDenominator P j))) := by
250     change ψ (E ((originalAffineChartOverlapEquiv P j hxj)
251       (algebraMap A₀ S₀
252         (Ideal.Quotient.mk P.asIdeal (MvPolynomial.X j))) )) = _
253     rw [originalAffineChartOverlapEquiv_Xj]
254   calc
255     _ = ψ (algebraMap Q T g) *
256         ψ (E (IsLocalization.Away.invSelf (selectedAffineChartDenominator P j))) := by
257       rw [hψg, hXj]
258     _ = ψ (algebraMap Q T g *
259         E (IsLocalization.Away.invSelf (selectedAffineChartDenominator P j))) := by
260       rw [map_mul]
261     _ = 1 := by rw [hprod]; simp
262 
263 /-- The same selected-coordinate value, when represented from `B`, is its
264 canonical image through the common open. -/
265 theorem genericOpenExtraAwayBMap_algebraMap
266     {Q : Type u} [CommRing Q] {B : Type v} [CommRing B] [Algebra Q B]
267     (M : Ideal B) [M.IsPrime] (f : Q)
268     (e : Localization.Away f ≃ₐ[Q]
269       Localization.Away (algebraMap Q B f)) (g x : Q) :
270     let Cq := genericOpenRing M f e
271     let C := genericOpenExtraAwayB M f e g
272     letI : Algebra Q Cq := inferInstance
273     letI : Algebra Cq C := inferInstance
274     genericOpenExtraAwayBMap M f e g (algebraMap Q B x) =
275       algebraMap Cq C (algebraMap Q Cq x) := by
276   dsimp
277   let Cq := genericOpenRing M f e
278   let C := genericOpenExtraAwayB M f e g
279   letI : Algebra Q Cq := inferInstance
280   letI : Algebra Cq C := inferInstance
281   change algebraMap Cq C (genericOpenBMap M f e (algebraMap Q B x)) = _
282   rw [genericOpenBMap_base_eq M f e x]
283 
284 end Stafford38.Geometry.A0ChartGeneratorCoordinates
285 end
286