Stafford38/Geometry/ActualWitnessSelectedChartBinding.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Stafford38.Geometry.A0NormalizedProjectiveCoordinates
3 public import Stafford38.Geometry.AffineComponentCoordinateSplit
4 public import Stafford38.Geometry.AsymptoticDivisorExistence
5 public import Stafford38.Geometry.ActualChartValuationImage
6 public import Stafford38.Geometry.ComponentProjectiveChartFactorization
7 public import Stafford38.Geometry.ComponentProjectiveChartKernel
8 public import Stafford38.Geometry.ComponentProjectiveClosure
9 public import Stafford38.Geometry.EtaleGenericOpenExtraAwayB
10 public import Stafford38.Geometry.EtaleGenericOpenTransport
11 public import Stafford38.Geometry.GeneralDivisorialVisibleFrameResidueSupport
12 
13 @[expose] public section
14 
15 set_option autoImplicit false
16 set_option maxHeartbeats 2400000
17 set_option synthInstance.maxHeartbeats 400000
18 
19 noncomputable section
20 
21 namespace Stafford38.Geometry.ActualWitnessSelectedChartBinding
22 
23 open IsLocalRing
24 open Stafford38.Geometry.A0ChartFormalEtale
25 open Stafford38.Geometry.A0NormalizedProjectiveCoordinates
26 open Stafford38.Geometry.ActualChartValuationImage
27 open Stafford38.Geometry.AsymptoticChartArcAdapter
28 open Stafford38.Geometry.AsymptoticDivisorExistence
29 open Stafford38.Geometry.AffineComponentCoordinateSplit
30 open Stafford38.Geometry.ComponentFunctionFieldBoundary
31 open Stafford38.Geometry.ComponentProjectiveChartKernel
32 open Stafford38.Geometry.ComponentProjectiveChartFactorization
33 open Stafford38.Geometry.ComponentProjectiveClosure
34 open Stafford38.Geometry.EtaleGenericOpenTransport
35 open Stafford38.Geometry.ProjectiveChartCoordinates
36 open Stafford38.Geometry.ChartGenericPointFractionRing
37 open Stafford38.Geometry.GeneralDivisorialVisibleFrame
38 open Stafford38.Geometry.RelativeCoefficientDVR
39 open Stafford38.Geometry.ProjectiveChartSameFieldOverlap
40 
41 universe u v w
42 
43 /-- The canonical chart quotient equivalence sends each polynomial generator
44 to its named generic-chart coordinate. -/
45 theorem componentChartEquiv_mk_X
46     {k : Type u} [Field k] {m : ℕ}
47     (P : PrimeSpectrum (MvPolynomial (Fin m) k))
48     (chart : Fin (m + 1))
49     (e : Fin m ≃ ChartAffineIndex (Fin (m + 1)) chart)
50     (hchart : componentProjectivePoint P chart ≠ 0) (i : Fin m) :
51     componentChartEquationGenericPointMap P chart e hchart
52       (Ideal.Quotient.mk (componentChartEquationIdeal P chart e)
53         (MvPolynomial.X i)) = chartGenericPoint P chart e i := by
54   simpa using componentChartEquationGenericPointMap_mk P chart e hchart
55     (MvPolynomial.X i)
56 
57 /-- The selected chart's distinguished denominator is the generic coordinate
58 at the original zeroth projective index. -/
59 theorem selected_denominator_eq_generic_coordinate
60     {k : Type u} [Field k] {m : ℕ}
61     (P : PrimeSpectrum (MvPolynomial (Fin m) k)) (j : Fin m)
62     (hchart : componentProjectivePoint P (Fin.succ j) ≠ 0) :
63     let e := SelectedAffineCoordinateEquiv j
64     let Q := Algebra.adjoin k (Set.range (chartGenericPoint P (Fin.succ j) e))
65     let hsel : SelectedAffineChartQuotient (k := k) P j ≃ₐ[k] Q :=
66       componentChartEquationQuotient_equiv_genericSubalgebra P (Fin.succ j) e hchart
67     hsel (selectedAffineChartDenominator P j) =
68       ⟨chartGenericPoint P (Fin.succ j) e (selectedAffineChartOrigin j),
69         Algebra.subset_adjoin (R := k) (A := ComponentFractionField P)
70           (Set.mem_range_self (selectedAffineChartOrigin j))⟩ := by
71   dsimp only
72   let e := SelectedAffineCoordinateEquiv j
73   let Q := Algebra.adjoin k (Set.range (chartGenericPoint P (Fin.succ j) e))
74   let hsel : SelectedAffineChartQuotient (k := k) P j ≃ₐ[k] Q :=
75     componentChartEquationQuotient_equiv_genericSubalgebra P (Fin.succ j) e hchart
76   apply Subtype.ext
77   change componentChartEquationGenericPointMap P (Fin.succ j) e hchart
78       (Ideal.Quotient.mk (componentChartEquationIdeal P (Fin.succ j) e)
79         (MvPolynomial.X (selectedAffineChartOrigin j))) = _
80   exact componentChartEquiv_mk_X P (Fin.succ j) e hchart
81     (selectedAffineChartOrigin j)
82 
83 /-- A selected non-chart affine variable is the matching generic chart
84 coordinate under the canonical quotient equivalence. -/
85 theorem selected_variable_eq_generic_coordinate
86     {k : Type u} [Field k] {m : ℕ}
87     (P : PrimeSpectrum (MvPolynomial (Fin m) k)) (j i : Fin m)
88     (hij : i ≠ j)
89     (hchart : componentProjectivePoint P (Fin.succ j) ≠ 0) :
90     let e := SelectedAffineCoordinateEquiv j
91     let Q := Algebra.adjoin k (Set.range (chartGenericPoint P (Fin.succ j) e))
92     let hsel : SelectedAffineChartQuotient (k := k) P j ≃ₐ[k] Q :=
93       componentChartEquationQuotient_equiv_genericSubalgebra P (Fin.succ j) e hchart
94     hsel (selectedAffineChartVariableClass P j i hij) =
95       ⟨chartGenericPoint P (Fin.succ j) e
96           ((SelectedAffineCoordinateEquiv j).symm ⟨i.succ, by simpa using hij⟩),
97         Algebra.subset_adjoin (R := k) (A := ComponentFractionField P)
98           (Set.mem_range_self
99             ((SelectedAffineCoordinateEquiv j).symm ⟨i.succ, by simpa using hij⟩))⟩ := by
100   dsimp only
101   let e := SelectedAffineCoordinateEquiv j
102   let Q := Algebra.adjoin k (Set.range (chartGenericPoint P (Fin.succ j) e))
103   let hsel : SelectedAffineChartQuotient (k := k) P j ≃ₐ[k] Q :=
104     componentChartEquationQuotient_equiv_genericSubalgebra P (Fin.succ j) e hchart
105   apply Subtype.ext
106   change componentChartEquationGenericPointMap P (Fin.succ j) e hchart
107       (Ideal.Quotient.mk (componentChartEquationIdeal P (Fin.succ j) e)
108         (MvPolynomial.X ((SelectedAffineCoordinateEquiv j).symm
109           ⟨i.succ, by simpa using hij⟩))) = _
110   exact componentChartEquiv_mk_X P (Fin.succ j) e hchart
111     ((SelectedAffineCoordinateEquiv j).symm ⟨i.succ, by simpa using hij⟩)
112 
113 /-- The retained witness's actual normalized column, when read in the
114 canonical selected-chart quotient algebra Q, is the same tuple as the
115 canonical quotient equivalence: q₀ is its distinguished denominator, qᵢ is
116 the selected chart class for i≠j, and qⱼ=1. -/
117 theorem actual_selected_chart_q_coordinates
118     {k : Type u} [Field k] [CharZero k] {m : ℕ}
119     (hm : 0 < m)
120     (P : PrimeSpectrum (MvPolynomial (Fin m) k))
121     (w : GeneralDivisorialVisibleFrameWitness hm P)
122     (j : Fin m) (hchart : w.column.chart = Fin.succ j) :
123     let C := w.column
124     let W := C.W
125     let F := ComponentFractionField P
126     letI : Algebra (CoordinateZeroLocalRing W.coefficientField) F := W.ambientAlgebra
127     let V := W.place.valuation.toSubring
128     letI : Algebra V F := V.subtype.toAlgebra
129     let e := SelectedAffineCoordinateEquiv j
130     let Q := Algebra.adjoin k (Set.range (chartGenericPoint P (Fin.succ j) e))
131     let hxj : componentCoordinate P j ≠ 0 := by
132       have hp : componentProjectivePoint P (Fin.succ j) ≠ 0 := by
133         have hc : componentProjectivePoint P C.chart ≠ 0 := by
134           intro hz
135           have hqchartF : ((C.q C.chart : V) : F) = 1 :=
136             congrArg (fun z : V => (z : F)) C.chart_one
137           have hqzeroF : ((C.q C.chart : V) : F) = 0 := by
138             rw [C.q_commonScale C.chart, hz]
139             simp
140           exact one_ne_zero (hqchartF.symm.trans hqzeroF)
141         simpa [C, hchart] using hc
142       simpa [componentProjectivePoint] using hp
143     let hsel : SelectedAffineChartQuotient (k := k) P j ≃ₐ[k] Q :=
144       componentChartEquationQuotient_equiv_genericSubalgebra P (Fin.succ j) e (by
145         simpa [componentProjectivePoint] using hxj)
146     ∃ qQ : Fin (m + 1) → Q,
147       qQ (Fin.succ j) = 1 ∧
148       (∀ a, ((qQ a : Q) : F) = ((C.q a : V) : F)) ∧
149       qQ 0 = hsel (selectedAffineChartDenominator P j) ∧
150       ∀ i : Fin m, ∀ hij : i ≠ j,
151         qQ (Fin.succ i) = hsel (selectedAffineChartVariableClass P j i hij) := by
152   classical
153   dsimp only
154   let C := w.column
155   let W := C.W
156   let F := ComponentFractionField P
157   letI : Algebra (CoordinateZeroLocalRing W.coefficientField) F := W.ambientAlgebra
158   let V := W.place.valuation.toSubring
159   letI : Algebra V F := V.subtype.toAlgebra
160   have hpChart : componentProjectivePoint P (Fin.succ j) ≠ 0 := by
161     have hp : componentProjectivePoint P C.chart ≠ 0 := by
162       intro hz
163       have hqchartF : ((C.q C.chart : V) : F) = 1 :=
164         congrArg (fun z : V => (z : F)) C.chart_one
165       have hqzeroF : ((C.q C.chart : V) : F) = 0 := by
166         rw [C.q_commonScale C.chart, hz]
167         simp
168       exact one_ne_zero (hqchartF.symm.trans hqzeroF)
169     simpa [C, hchart] using hp
170   have hxj : componentCoordinate P j ≠ 0 := by
171     simpa [componentProjectivePoint] using hpChart
172   let e := SelectedAffineCoordinateEquiv j
173   let Q := Algebra.adjoin k (Set.range (chartGenericPoint P (Fin.succ j) e))
174   let hsel : SelectedAffineChartQuotient (k := k) P j ≃ₐ[k] Q :=
175     componentChartEquationQuotient_equiv_genericSubalgebra P (Fin.succ j) e hpChart
176   have hactual := exists_actual_normalizedProjectiveColumn hm P w
177   dsimp only at hactual
178   rw [hchart] at hactual
179   obtain ⟨qQ, hqChart, hqcoe, hqrows⟩ := hactual
180   have hqChart' : qQ (Fin.succ j) = 1 := hqChart
181   have horigin :
182       (SelectedAffineCoordinateEquiv j (selectedAffineChartOrigin j)).1 = 0 := by
183     have h := Equiv.apply_symm_apply (SelectedAffineCoordinateEquiv j)
184       ⟨0, by simpa [eq_comm] using Fin.succ_ne_zero j⟩
185     exact congrArg Subtype.val h
186   have hq0generic : ((qQ 0 : Q) : F) =
187       chartGenericPoint P (Fin.succ j) e (selectedAffineChartOrigin j) := by
188     have hi := hqrows (selectedAffineChartOrigin j)
189     simpa [SelectedAffineCoordinateEquiv, horigin] using hi
190   have hq0 : qQ 0 = hsel (selectedAffineChartDenominator P j) := by
191     calc
192       qQ 0 = ⟨chartGenericPoint P (Fin.succ j) e (selectedAffineChartOrigin j),
193         Algebra.subset_adjoin (R := k) (A := F)
194           (Set.mem_range_self (selectedAffineChartOrigin j))⟩ := by
195         apply Subtype.ext
196         exact hq0generic
197       _ = hsel (selectedAffineChartDenominator P j) := by
198         exact (selected_denominator_eq_generic_coordinate P j hpChart).symm
199   have hqvars : ∀ i : Fin m, ∀ hij : i ≠ j,
200       qQ (Fin.succ i) = hsel (selectedAffineChartVariableClass P j i hij) := by
201     intro i hij
202     let ai := (SelectedAffineCoordinateEquiv j).symm
203       ⟨i.succ, by simpa using hij⟩
204     have ha : (SelectedAffineCoordinateEquiv j ai).1 = Fin.succ i := by
205       have h := Equiv.apply_symm_apply (SelectedAffineCoordinateEquiv j)
206         ⟨i.succ, by simpa using hij⟩
207       exact congrArg Subtype.val h
208     have hi := hqrows ai
209     have hrow : ((qQ (Fin.succ i) : Q) : F) =
210         chartGenericPoint P (Fin.succ j) e ai := by
211       simpa [SelectedAffineCoordinateEquiv, ha] using hi
212     calc
213       qQ (Fin.succ i) =
214           ⟨chartGenericPoint P (Fin.succ j) e ai,
215             Algebra.subset_adjoin (R := k) (A := F) (Set.mem_range_self ai)⟩ := by
216               apply Subtype.ext
217               exact hrow
218       _ = hsel (selectedAffineChartVariableClass P j i hij) := by
219         exact (selected_variable_eq_generic_coordinate P j i hij hpChart).symm
220   exact ⟨qQ, hqChart', hqcoe, hq0, hqvars⟩
221 
222 /-- The chart chosen by a retained witness is a nonzero projective coordinate,
223 so its matching affine component coordinate is nonzero. -/
224 theorem actualWitness_selected_coordinate_ne_zero
225     {k : Type u} [Field k] [CharZero k] {m : ℕ}
226     (hm : 0 < m)
227     (P : PrimeSpectrum (MvPolynomial (Fin m) k))
228     (w : GeneralDivisorialVisibleFrameWitness hm P)
229     (j : Fin m) (hchart : w.column.chart = Fin.succ j) :
230     componentCoordinate P j ≠ 0 := by
231   let C := w.column
232   let W := C.W
233   let F := ComponentFractionField P
234   letI : Algebra (CoordinateZeroLocalRing W.coefficientField) F := W.ambientAlgebra
235   let V := W.place.valuation.toSubring
236   letI : Algebra V F := V.subtype.toAlgebra
237   have hpoint : componentProjectivePoint P C.chart ≠ 0 := by
238     intro hz
239     have hqchartF : ((C.q C.chart : V) : F) = 1 :=
240       congrArg (fun z : V => (z : F)) C.chart_one
241     have hqzeroF : ((C.q C.chart : V) : F) = 0 := by
242       rw [C.q_commonScale C.chart, hz]
243       simp
244     exact one_ne_zero (hqchartF.symm.trans hqzeroF)
245   have hselected : componentProjectivePoint P (Fin.succ j) ≠ 0 := by
246     simpa [C, hchart] using hpoint
247   simpa [componentProjectivePoint] using hselected
248 
249 /-- The retained witness's normalized column, transported from its canonical
250 selected-chart quotient into the common open, is the same tuple as the
251 canonical common-open coordinates. This is the same Q, denominator, map and
252 generic-open data used by `canonicalChart_all_normalized_projective_coordinates`.
253 -/
254 theorem actualWitness_commonOpen_q_coordinates
255     {k : Type u} [Field k] [CharZero k] {m : ℕ}
256     (hm : 0 < m)
257     (P : PrimeSpectrum (MvPolynomial (Fin m) k))
258     (w : GeneralDivisorialVisibleFrameWitness hm P)
259     (j : Fin m) (hchart : w.column.chart = Fin.succ j)
260     {B : Type w} [CommRing B]
261     [Algebra (Algebra.adjoin k (Set.range
262       (chartGenericPoint P (Fin.succ j) (SelectedAffineCoordinateEquiv j)))) B]
263     (M : Ideal B) [M.IsPrime]
264     (f : Algebra.adjoin k (Set.range
265       (chartGenericPoint P (Fin.succ j) (SelectedAffineCoordinateEquiv j))))
266     (e : Localization.Away f ≃ₐ[
267       Algebra.adjoin k (Set.range
268         (chartGenericPoint P (Fin.succ j) (SelectedAffineCoordinateEquiv j)))]
269       Localization.Away (algebraMap _ B f)) :
270     let Q := Algebra.adjoin k (Set.range
271       (chartGenericPoint P (Fin.succ j) (SelectedAffineCoordinateEquiv j)))
272     let hxj := actualWitness_selected_coordinate_ne_zero hm P w j hchart
273     let F := ComponentFractionField P
274     let W := w.column.W
275     letI : Algebra (CoordinateZeroLocalRing W.coefficientField) F := W.ambientAlgebra
276     let V := W.place.valuation.toSubring
277     letI : Algebra V F := V.subtype.toAlgebra
278     let hsel : SelectedAffineChartQuotient (k := k) P j ≃ₐ[k] Q :=
279       componentChartEquationQuotient_equiv_genericSubalgebra P (Fin.succ j)
280         (SelectedAffineCoordinateEquiv j) (by
281           simpa [componentProjectivePoint] using hxj)
282     let g := hsel (selectedAffineChartDenominator P j)
283     let Cq := genericOpenRing M f e
284     let C := genericOpenExtraAwayB M f e g
285     letI : Semiring C := (inferInstance : CommSemiring C).toSemiring
286     letI : Algebra Q Cq := inferInstance
287     letI : Algebra Cq C := inferInstance
288     letI : Algebra Q C := Algebra.compHom C (algebraMap Q Cq)
289     let qC : Fin (m + 1) → C := Fin.cases
290       (algebraMap Cq C (algebraMap Q Cq g))
291       (fun i => if hij : i = j then 1 else
292         algebraMap Cq C (algebraMap Q Cq
293           (hsel (selectedAffineChartVariableClass P j i hij))))
294     ∃ qQ : Fin (m + 1) → Q,
295       qQ (Fin.succ j) = 1 ∧
296       (∀ a, ((qQ a : Q) : F) =
297         ((w.column.q a : w.column.W.place.valuation.toSubring) : F)) ∧
298       qQ 0 = hsel (selectedAffineChartDenominator P j) ∧
299       (∀ i : Fin m, ∀ hij : i ≠ j,
300         qQ (Fin.succ i) = hsel (selectedAffineChartVariableClass P j i hij)) ∧
301       ∀ a, algebraMap Q C (qQ a) = qC a := by
302   classical
303   dsimp only
304   have hxj : componentCoordinate P j ≠ 0 :=
305     actualWitness_selected_coordinate_ne_zero hm P w j hchart
306   let Q := Algebra.adjoin k (Set.range
307     (chartGenericPoint P (Fin.succ j) (SelectedAffineCoordinateEquiv j)))
308   let hsel : SelectedAffineChartQuotient (k := k) P j ≃ₐ[k] Q :=
309     componentChartEquationQuotient_equiv_genericSubalgebra P (Fin.succ j)
310       (SelectedAffineCoordinateEquiv j) (by
311         simpa [componentProjectivePoint] using hxj)
312   let g := hsel (selectedAffineChartDenominator P j)
313   let Cq := genericOpenRing M f e
314   let C := genericOpenExtraAwayB M f e g
315   letI : Semiring C := (inferInstance : CommSemiring C).toSemiring
316   letI : Algebra Q Cq := inferInstance
317   letI : Algebra Cq C := inferInstance
318   letI : Algebra Q C := Algebra.compHom C (algebraMap Q Cq)
319   have hcomp (x : Q) : algebraMap Q C x =
320       algebraMap Cq C (algebraMap Q Cq x) := rfl
321   let qC : Fin (m + 1) → C := Fin.cases
322     (algebraMap Cq C (algebraMap Q Cq g))
323     (fun i => if hij : i = j then 1 else
324       algebraMap Cq C (algebraMap Q Cq
325         (hsel (selectedAffineChartVariableClass P j i hij))))
326   obtain ⟨qQ, hqchart, hqcoe, hq0, hqvars⟩ :=
327     actual_selected_chart_q_coordinates hm P w j hchart
328   refine ⟨qQ, hqchart, hqcoe, hq0, hqvars, ?_⟩
329   intro a
330   cases a using Fin.cases with
331   | zero =>
332       calc
333         algebraMap Q C (qQ 0) =
334             algebraMap Q C (hsel (selectedAffineChartDenominator P j)) :=
335           congrArg (algebraMap Q C) hq0
336         _ = algebraMap Cq C (algebraMap Q Cq
337               (hsel (selectedAffineChartDenominator P j))) := hcomp _
338         _ = qC 0 := by simp [qC, g]
339   | succ i =>
340       by_cases hij : i = j
341       · subst i
342         calc
343           algebraMap Q C (qQ (Fin.succ j)) = algebraMap Q C 1 :=
344             congrArg (algebraMap Q C) hqchart
345           _ = algebraMap Cq C (algebraMap Q Cq 1) := hcomp _
346           _ = qC (Fin.succ j) := by simp [qC]
347       · calc
348           algebraMap Q C (qQ (Fin.succ i)) =
349               algebraMap Q C
350                 (hsel (selectedAffineChartVariableClass P j i hij)) :=
351             congrArg (algebraMap Q C) (hqvars i hij)
352           _ = algebraMap Cq C (algebraMap Q Cq
353                 (hsel (selectedAffineChartVariableClass P j i hij))) := hcomp _
354           _ = qC (Fin.succ i) := by simp [qC, hij]
355 
356 #print axioms componentChartEquiv_mk_X
357 #print axioms selected_denominator_eq_generic_coordinate
358 #print axioms selected_variable_eq_generic_coordinate
359 #print axioms actualWitness_selected_coordinate_ne_zero
360 #print axioms actual_selected_chart_q_coordinates
361 #print axioms actualWitness_commonOpen_q_coordinates
362 
363 end Stafford38.Geometry.ActualWitnessSelectedChartBinding
364 end
365