Stafford38/Geometry/ComponentProjectiveChartFactorization.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Stafford38.Geometry.ComponentProjectiveClosureNormalization
3 public import Stafford38.Geometry.ProjectiveChartCoordinates
4 
5 @[expose] public section
6 
7 set_option autoImplicit false
8 
9 /-! Affine-chart ring factorization for the homogeneous component equations.
10 The quotient coordinate map retains the selected projective coordinates
11 and their common scaling in the function field. -/
12 
13 namespace Stafford38.Geometry.ComponentProjectiveChartFactorization
14 
15 open Stafford38.Geometry.ComponentProjectiveClosure
16 open Stafford38.Geometry.ComponentProjectiveClosureNormalization
17 open Stafford38.Geometry.ComponentFunctionFieldBoundary
18 open Stafford38.Geometry.AffineComponentCoordinateSplit
19 open Stafford38.Geometry.AsymptoticDivisorExistence
20 open Stafford38.Geometry.RelativeCoefficientDVR
21 open Stafford38.Geometry.RelativeRetainedBoundaryPlace
22 open Stafford38.Geometry.ProjectiveChartCoordinates
23 
24 noncomputable section
25 
26 set_option maxHeartbeats 2400000
27 set_option synthInstance.maxHeartbeats 200000
28 
29 universe u
30 
31 variable {k : Type u} [Field k] {m : ℕ}
32 
33 /-- Indices for all homogeneous equations of the generic projective component. -/
34 abbrev ProjectiveEquationIndex
35     (P : PrimeSpectrum (MvPolynomial (Fin m) k)) :=
36   {H : MvPolynomial (Fin (m + 1)) k //
37     ∃ d, H.IsHomogeneous d ∧ H ∈ componentProjectiveClosureIdeal P}
38 
39 /-- The selected affine-chart equation family, using the shared chart
40 dehomogenization owner. -/
41 def componentChartEquations
42     (P : PrimeSpectrum (MvPolynomial (Fin m) k))
43     (_chart : Fin (m + 1)) :
44     ProjectiveEquationIndex P → MvPolynomial (Fin (m + 1)) k :=
45   fun H ↦ H.1
46 
47 /-- The chart ideal is the shared dehomogenized equation ideal of the
48 homogeneous component ideal. -/
49 def componentChartEquationIdeal
50     (P : PrimeSpectrum (MvPolynomial (Fin m) k))
51     (chart : Fin (m + 1))
52     (e : Fin m ≃ ChartAffineIndex (Fin (m + 1)) chart) :
53     Ideal (MvPolynomial (Fin m) k) :=
54   dehomogenizedEquationIdeal chart e (componentChartEquations P chart)
55 
56 /-- Dehomogenized homogeneous component equations vanish under every
57 normalized common-scale lift into an injective coefficient subring. -/
58 theorem eval₂_ker_contains_componentChartEquationIdeal
59     (P : PrimeSpectrum (MvPolynomial (Fin m) k))
60     {V : Type u} [CommRing V]
61     (coeff : k →+* V)
62     (ι : V →+* ComponentFractionField P)
63     (hι : Function.Injective ι)
64     (hcoeff : ι.comp coeff = algebraMap k (ComponentFractionField P))
65     (q : Fin (m + 1) → V) (chart : Fin (m + 1))
66     (e : Fin m ≃ ChartAffineIndex (Fin (m + 1)) chart)
67     (hqchart : q chart = 1)
68     (scale : ComponentFractionField P)
69     (hq : ∀ a, ι (q a) = scale * componentProjectivePoint P a) :
70     componentChartEquationIdeal P chart e ≤
71       RingHom.ker (MvPolynomial.eval₂Hom coeff
72         (fun i ↦ q (e i).1)) := by
73   change Ideal.span (Set.range fun H : ProjectiveEquationIndex P ↦
74       dehomogenizeProjectiveChart chart e H.1) ≤
75     RingHom.ker (MvPolynomial.eval₂Hom coeff (fun i ↦ q (e i).1))
76   apply Ideal.span_le.mpr
77   rintro _ ⟨H, rfl⟩
78   obtain ⟨d, hhomogeneous, hH⟩ := H.2
79   change MvPolynomial.eval₂Hom coeff (fun i ↦ q (e i).1)
80       (dehomogenizeProjectiveChart chart e H.1) = 0
81   have hprojective :=
82     eval₂_eq_zero_of_commonScale_componentProjectivePoint
83       P coeff ι hι hcoeff hhomogeneous hH q scale hq
84   have hdehom :
85       MvPolynomial.eval₂Hom coeff (fun i ↦ q (e i).1)
86         (dehomogenizeProjectiveChart chart e H.1) =
87         MvPolynomial.eval₂Hom coeff q H.1 := by
88     change ((MvPolynomial.eval₂Hom coeff (fun i ↦ q (e i).1)).comp
89         (MvPolynomial.eval₂Hom MvPolynomial.C
90           (fun a ↦ if h : a = chart then 1
91             else MvPolynomial.X (e.symm ⟨a, h⟩)))) H.1 = _
92     rw [MvPolynomial.comp_eval₂Hom]
93     have hC :
94         (MvPolynomial.eval₂Hom coeff (fun i ↦ q (e i).1)).comp
95             MvPolynomial.C = coeff :=
96       MvPolynomial.eval₂Hom_comp_C coeff (fun i ↦ q (e i).1)
97     rw [hC]
98     have hvars :
99         (fun a ↦ MvPolynomial.eval₂Hom coeff (fun i ↦ q (e i).1)
100           (if h : a = chart then 1 else MvPolynomial.X (e.symm ⟨a, h⟩))) = q := by
101       funext a
102       by_cases h : a = chart
103       · subst a
104         simp [hqchart]
105       · simp only [h, ↓reduceDIte, MvPolynomial.eval₂Hom_X']
106         have he : e (e.symm ⟨a, h⟩) = ⟨a, h⟩ := Equiv.apply_symm_apply e ⟨a, h⟩
107         exact congrArg (fun z : ChartAffineIndex (Fin (m + 1)) chart ↦
108           q z.1) he
109     rw [hvars]
110   rw [hdehom]
111   exact hprojective
112 
113 /-- The normalized projective coordinate column induces a genuine ring map
114 from the affine chart equation quotient to its valuation ring. -/
115 def componentChartEquationQuotientMap
116     (P : PrimeSpectrum (MvPolynomial (Fin m) k))
117     {V : Type u} [CommRing V]
118     (coeff : k →+* V)
119     (ι : V →+* ComponentFractionField P)
120     (hι : Function.Injective ι)
121     (hcoeff : ι.comp coeff = algebraMap k (ComponentFractionField P))
122     (q : Fin (m + 1) → V) (chart : Fin (m + 1))
123     (e : Fin m ≃ ChartAffineIndex (Fin (m + 1)) chart)
124     (hqchart : q chart = 1)
125     (scale : ComponentFractionField P)
126     (hq : ∀ a, ι (q a) = scale * componentProjectivePoint P a) :
127     MvPolynomial (Fin m) k ⧸ componentChartEquationIdeal P chart e →+* V :=
128   Ideal.Quotient.lift _ (MvPolynomial.eval₂Hom coeff
129     (fun i ↦ q (e i).1))
130     (eval₂_ker_contains_componentChartEquationIdeal
131       P coeff ι hι hcoeff q chart e hqchart scale hq)
132 
133 /-- The retained Lane-C DVR witness supplies the coefficient map, injective
134 valuation-ring inclusion, and scalar compatibility needed by the chart
135 factorization. -/
136 def retainedComponentChartEquationQuotientMap
137     [CharZero k]
138     (P : PrimeSpectrum (MvPolynomial (Fin m) k)) (i : Fin m)
139     (W : Stafford38.Geometry.RelativeRetainedBoundaryPlace.Data k
140       (ComponentFractionField P) (componentCoordinate P i))
141     (chart : Fin (m + 1))
142     (e : Fin m ≃ ChartAffineIndex (Fin (m + 1)) chart) :
143     letI : Algebra (CoordinateZeroLocalRing
144         W.coefficientField) (ComponentFractionField P) := W.ambientAlgebra
145     letI : IsDiscreteValuationRing W.place.valuation.toSubring :=
146       W.place.isDiscrete
147     letI : Algebra W.coefficientField W.place.valuation.toSubring :=
148       (relativeCoefficientMap W.coefficientField W.place).toAlgebra
149     ∀ (q : Fin (m + 1) → W.place.valuation.toSubring)
150       (hqchart : q chart = 1)
151       (scale : ComponentFractionField P)
152       (hq : ∀ a, (q a : ComponentFractionField P) =
153         scale * componentProjectivePoint P a),
154       MvPolynomial (Fin m) k ⧸ componentChartEquationIdeal P chart e →+*
155         W.place.valuation.toSubring := by
156   letI : Algebra (CoordinateZeroLocalRing
157       W.coefficientField) (ComponentFractionField P) := W.ambientAlgebra
158   let V := W.place.valuation.toSubring
159   letI : IsDiscreteValuationRing V := W.place.isDiscrete
160   letI : Algebra W.coefficientField V :=
161     (relativeCoefficientMap W.coefficientField W.place).toAlgebra
162   letI : IsScalarTower W.coefficientField
163       (CoordinateZeroLocalRing W.coefficientField)
164       (ComponentFractionField P) := W.coefficientTower
165   intro q hqchart scale hq
166   let coeff : k →+* V := retainedComponentCoefficientMap P i W
167   have hcoeff : V.subtype.comp coeff =
168       algebraMap k (ComponentFractionField P) := by
169     ext c
170     change ((relativeCoefficientMap
171         W.coefficientField W.place (algebraMap k W.coefficientField c) : V) :
172         ComponentFractionField P) =
173       algebraMap k (ComponentFractionField P) c
174     calc
175       ((relativeCoefficientMap
176           W.coefficientField W.place (algebraMap k W.coefficientField c) : V) :
177           ComponentFractionField P) =
178           algebraMap W.coefficientField (ComponentFractionField P)
179             (algebraMap k W.coefficientField c) :=
180         DFunLike.congr_fun
181           (relativeCoefficientMap_commutes W.coefficientField W.place)
182           (algebraMap k W.coefficientField c)
183       _ = algebraMap k (ComponentFractionField P) c :=
184         IsScalarTower.algebraMap_apply k W.coefficientField
185           (ComponentFractionField P) c
186   exact componentChartEquationQuotientMap
187     (P := P) (V := V) (coeff := coeff) (ι := V.subtype)
188     (hι := Subtype.val_injective) (hcoeff := hcoeff)
189     (q := q) (chart := chart) (e := e)
190     (hqchart := hqchart) (scale := scale) (hq := hq)
191 
192 /-- On the generic point, the chart coordinates supplied by the valuation
193 ring are exactly the ratios of the original projective component point. -/
194 theorem chart_coordinates_agree_with_generic_point
195     (P : PrimeSpectrum (MvPolynomial (Fin m) k))
196     {V : Type u} [CommRing V]
197     (ι : V →+* ComponentFractionField P)
198     (q : Fin (m + 1) → V) (chart : Fin (m + 1))
199     (e : Fin m ≃ ChartAffineIndex (Fin (m + 1)) chart)
200     (hqchart : q chart = 1)
201     (scale : ComponentFractionField P)
202     (hq : ∀ a, ι (q a) = scale * componentProjectivePoint P a) :
203     ∀ i, ι (q (e i).1) =
204       componentProjectivePoint P (e i).1 /
205         componentProjectivePoint P chart := by
206   intro i
207   have hscale : scale * componentProjectivePoint P chart = 1 := by
208     simpa [hqchart] using (hq chart).symm
209   have hchart : componentProjectivePoint P chart ≠ 0 := by
210     intro hz
211     rw [hz, mul_zero] at hscale
212     exact one_ne_zero hscale.symm
213   rw [hq]
214   calc
215     scale * componentProjectivePoint P (e i).1 =
216         (scale * componentProjectivePoint P chart) *
217           (componentProjectivePoint P (e i).1 /
218             componentProjectivePoint P chart) := by
219       field_simp [hchart]
220     _ = componentProjectivePoint P (e i).1 /
221         componentProjectivePoint P chart := by
222       rw [hscale, one_mul]
223 
224 end
225 
226 end Stafford38.Geometry.ComponentProjectiveChartFactorization
227 
228 #print axioms Stafford38.Geometry.ComponentProjectiveChartFactorization.eval₂_ker_contains_componentChartEquationIdeal
229 #print axioms Stafford38.Geometry.ComponentProjectiveChartFactorization.componentChartEquationQuotientMap
230 #print axioms Stafford38.Geometry.ComponentProjectiveChartFactorization.retainedComponentChartEquationQuotientMap
231 #print axioms Stafford38.Geometry.ComponentProjectiveChartFactorization.chart_coordinates_agree_with_generic_point
232