Stafford38/Geometry/ComponentProjectiveChartKernel.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Stafford38.Geometry.ComponentProjectiveChartFactorization
3 
4 @[expose] public section
5 
6 /-! Exact affine generic-point kernel of the projective cone in any chart. -/
7 
8 namespace Stafford38.Geometry.ComponentProjectiveChartKernel
9 
10 open Stafford38.Geometry.ComponentProjectiveClosure
11 open Stafford38.Geometry.ComponentFunctionFieldBoundary
12 open Stafford38.Geometry.AffineComponentCoordinateSplit
13 open Stafford38.Geometry.ProjectiveChartCoordinates
14 open Stafford38.Geometry.ProjectiveEquationFormalChart
15 open Stafford38.Geometry.LocalizedProjectiveChartTransition
16 open Stafford38.Geometry.ComponentProjectiveChartFactorization
17 
18 noncomputable section
19 
20 set_option autoImplicit false
21 set_option maxHeartbeats 2400000
22 set_option synthInstance.maxHeartbeats 200000
23 
24 universe u
25 
26 variable {k : Type u} [Field k] {m : ℕ}
27 
28 theorem homogenizeAtZero_eval_common_scale
29     {S : Type*} [CommSemiring S] (f : MvPolynomial (Fin m) k)
30     (coeff : k →+* S) (y : Fin m → S) (t : S) :
31     MvPolynomial.eval₂ coeff
32         (fun a ↦ Fin.cases 1 y a * t) (homogenizeAtZero f) =
33       MvPolynomial.eval₂ coeff (Fin.cases 1 y) (homogenizeAtZero f) *
34         t ^ f.totalDegree := by
35   exact eval₂_mul_common_of_isHomogeneous
36     (homogenizeAtZero_isHomogeneous f) coeff (Fin.cases 1 y) t
37 
38 /-- Reindex zeroth-chart coordinates so coordinate zero becomes the chosen
39 projective chart and successors follow the explicit complement equivalence. -/
40 def chartIndexEquiv (chart : Fin (m + 1))
41     (e : Fin m ≃ ChartAffineIndex (Fin (m + 1)) chart) :
42     Fin (m + 1) ≃ Fin (m + 1) :=
43   Equiv.ofBijective (fun a ↦ Fin.cases chart (fun i ↦ (e i).1) a) (by
44     constructor
45     · intro a b hab
46       rcases Fin.eq_zero_or_eq_succ a with ha | ⟨i, ha⟩
47       · subst a
48         rcases Fin.eq_zero_or_eq_succ b with hb | ⟨j, hb⟩
49         · subst b
50           rfl
51         · subst b
52           have hab' : chart = (e j).1 := by
53             change chart = (e j).1 at hab
54             exact hab
55           exact False.elim ((e j).property hab'.symm)
56       · subst a
57         rcases Fin.eq_zero_or_eq_succ b with hb | ⟨j, hb⟩
58         · subst b
59           have hab' : (e i).1 = chart := by
60             change (e i).1 = chart at hab
61             exact hab
62           exact False.elim ((e i).property hab')
63         · subst b
64           have hab' : (e i).1 = (e j).1 := by
65             change (e i).1 = (e j).1 at hab
66             exact hab
67           have hij : i = j := e.injective (Subtype.ext hab')
68           subst j
69           rfl
70     · intro b
71       by_cases hb : b = chart
72       · refine ⟨0, ?_⟩
73         simp [hb]
74       · let i : Fin m := e.symm ⟨b, hb⟩
75         refine ⟨Fin.succ i, ?_⟩
76         simp [i]
77   )
78 
79 @[simp] theorem chartIndexEquiv_zero (chart : Fin (m + 1))
80     (e : Fin m ≃ ChartAffineIndex (Fin (m + 1)) chart) :
81     chartIndexEquiv chart e 0 = chart := by
82   rfl
83 
84 @[simp] theorem chartIndexEquiv_succ (chart : Fin (m + 1))
85     (e : Fin m ≃ ChartAffineIndex (Fin (m + 1)) chart) (i : Fin m) :
86     chartIndexEquiv chart e i.succ = (e i).1 := by
87   rfl
88 
89 /-- Homogenize in the selected chart by transporting the standard
90 zeroth-chart homogenization along the coordinate permutation. -/
91 def homogenizeAtChart (chart : Fin (m + 1))
92     (e : Fin m ≃ ChartAffineIndex (Fin (m + 1)) chart)
93     (f : MvPolynomial (Fin m) k) : MvPolynomial (Fin (m + 1)) k :=
94   MvPolynomial.rename (chartIndexEquiv chart e) (homogenizeAtZero f)
95 
96 theorem homogenizeAtChart_isHomogeneous (chart : Fin (m + 1))
97     (e : Fin m ≃ ChartAffineIndex (Fin (m + 1)) chart)
98     (f : MvPolynomial (Fin m) k) :
99     (homogenizeAtChart chart e f).IsHomogeneous f.totalDegree := by
100   simpa [homogenizeAtChart] using
101     (homogenizeAtZero_isHomogeneous f).rename_isHomogeneous
102 
103 theorem dehomogenize_chart_homogenizeAtChart (chart : Fin (m + 1))
104     (e : Fin m ≃ ChartAffineIndex (Fin (m + 1)) chart)
105     (f : MvPolynomial (Fin m) k) :
106     dehomogenizeProjectiveChart chart e (homogenizeAtChart chart e f) = f := by
107   have hmaps :
108       (dehomogenizeProjectiveChart chart e).comp
109         (MvPolynomial.renameEquiv k (chartIndexEquiv chart e)).toAlgHom =
110         projectiveDehomogenize := by
111     apply MvPolynomial.algHom_ext
112     intro a
113     rcases Fin.eq_zero_or_eq_succ a with hzero | ⟨i, hi⟩
114     · subst a
115       simp [dehomogenizeProjectiveChart, projectiveDehomogenize,
116         chartIndexEquiv_zero]
117     · subst a
118       simp [dehomogenizeProjectiveChart, projectiveDehomogenize,
119         chartIndexEquiv_succ, (e i).property]
120   calc
121     dehomogenizeProjectiveChart chart e (homogenizeAtChart chart e f) =
122         ((dehomogenizeProjectiveChart chart e).comp
123           (MvPolynomial.renameEquiv k (chartIndexEquiv chart e)).toAlgHom)
124           (homogenizeAtZero f) := rfl
125     _ = projectiveDehomogenize (homogenizeAtZero f) := by rw [hmaps]
126     _ = f := projectiveDehomogenize_homogenizeAtZero f
127 
128 def chartGenericPoint (P : PrimeSpectrum (MvPolynomial (Fin m) k))
129     (chart : Fin (m + 1))
130     (e : Fin m ≃ ChartAffineIndex (Fin (m + 1)) chart) :
131     Fin m → ComponentFractionField P :=
132   fun i ↦ componentProjectivePoint P (e i).1 / componentProjectivePoint P chart
133 
134 theorem componentChartEquationIdeal_eq_genericEvalKer
135     (P : PrimeSpectrum (MvPolynomial (Fin m) k))
136     (chart : Fin (m + 1))
137     (e : Fin m ≃ ChartAffineIndex (Fin (m + 1)) chart)
138     (hchart : componentProjectivePoint P chart ≠ 0) :
139     componentChartEquationIdeal P chart e =
140       RingHom.ker (MvPolynomial.eval₂Hom
141         (algebraMap k (ComponentFractionField P)) (chartGenericPoint P chart e)) := by
142   apply le_antisymm
143   · let q : Fin (m + 1) → ComponentFractionField P :=
144       fun a ↦ componentProjectivePoint P a / componentProjectivePoint P chart
145     have hqchart : q chart = 1 := by
146       dsimp [q]
147       exact div_self hchart
148     have hq : ∀ a, q a = (componentProjectivePoint P chart)⁻¹ *
149         componentProjectivePoint P a := by
150       intro a
151       simp [q, div_eq_mul_inv, mul_comm]
152     have hkernel := eval₂_ker_contains_componentChartEquationIdeal
153       (P := P) (V := ComponentFractionField P)
154       (coeff := algebraMap k (ComponentFractionField P))
155       (ι := RingHom.id (ComponentFractionField P))
156       (hι := Function.injective_id) (hcoeff := rfl)
157       (q := q) (chart := chart) (e := e) (hqchart := hqchart)
158       (scale := (componentProjectivePoint P chart)⁻¹) (hq := hq)
159     change componentChartEquationIdeal P chart e ≤
160       RingHom.ker (MvPolynomial.eval₂Hom
161         (algebraMap k (ComponentFractionField P))
162         (fun i ↦ q (e i).1)) at hkernel
163     change componentChartEquationIdeal P chart e ≤
164       RingHom.ker (MvPolynomial.eval₂Hom
165         (algebraMap k (ComponentFractionField P)) (chartGenericPoint P chart e))
166     exact hkernel
167   · intro f hf
168     change MvPolynomial.eval₂ (algebraMap k (ComponentFractionField P))
169       (chartGenericPoint P chart e) f = 0 at hf
170     let H := homogenizeAtChart chart e f
171     have hdehom : dehomogenizeProjectiveChart chart e H = f :=
172       dehomogenize_chart_homogenizeAtChart chart e f
173     have hH : H.IsHomogeneous f.totalDegree :=
174       homogenizeAtChart_isHomogeneous chart e f
175     let σ := chartIndexEquiv chart e
176     have hpoint : (fun a ↦ componentProjectivePoint P (σ a)) =
177         fun a ↦ Fin.cases 1 (chartGenericPoint P chart e) a *
178           componentProjectivePoint P chart := by
179       funext a
180       rcases Fin.eq_zero_or_eq_succ a with hzero | ⟨i, hi⟩
181       · subst a
182         simp [σ, chartIndexEquiv_zero, componentProjectivePoint_eq_finCases]
183       · subst a
184         change componentProjectivePoint P (e i).1 =
185           (componentProjectivePoint P (e i).1 / componentProjectivePoint P chart) *
186             componentProjectivePoint P chart
187         exact (div_mul_cancel₀ (componentProjectivePoint P (e i).1) hchart).symm
188     have hgenericEval :
189         MvPolynomial.eval₂ (algebraMap k (ComponentFractionField P))
190           (componentProjectivePoint P) H = 0 := by
191       have hscale :
192           MvPolynomial.eval₂ (algebraMap k (ComponentFractionField P))
193             (fun a ↦ Fin.cases 1 (chartGenericPoint P chart e) a *
194               componentProjectivePoint P chart) (homogenizeAtZero f) =
195             MvPolynomial.eval₂ (algebraMap k (ComponentFractionField P))
196               (Fin.cases 1 (chartGenericPoint P chart e)) (homogenizeAtZero f) *
197               componentProjectivePoint P chart ^ f.totalDegree := by
198         exact homogenizeAtZero_eval_common_scale f
199           (algebraMap k (ComponentFractionField P))
200           (chartGenericPoint P chart e) (componentProjectivePoint P chart)
201       have hrename :
202           MvPolynomial.eval₂ (algebraMap k (ComponentFractionField P))
203               (componentProjectivePoint P)
204               (MvPolynomial.rename σ (homogenizeAtZero f)) =
205             MvPolynomial.eval₂ (algebraMap k (ComponentFractionField P))
206               (componentProjectivePoint P ∘ σ) (homogenizeAtZero f) :=
207         MvPolynomial.eval₂_rename (algebraMap k (ComponentFractionField P)) σ
208           (componentProjectivePoint P) (homogenizeAtZero f)
209       calc
210         MvPolynomial.eval₂ (algebraMap k (ComponentFractionField P))
211             (componentProjectivePoint P) H =
212             MvPolynomial.eval₂ (algebraMap k (ComponentFractionField P))
213               (fun a ↦ componentProjectivePoint P (σ a)) (homogenizeAtZero f) := by
214                 dsimp only [H, homogenizeAtChart]
215                 exact hrename
216         _ = MvPolynomial.eval₂ (algebraMap k (ComponentFractionField P))
217               (Fin.cases 1 (chartGenericPoint P chart e)) (homogenizeAtZero f) *
218                 componentProjectivePoint P chart ^ f.totalDegree := by
219                 rw [hpoint]
220                 exact hscale
221         _ = 0 := by
222             have hzero : MvPolynomial.eval₂
223                 (algebraMap k (ComponentFractionField P))
224                 (Fin.cases 1 (chartGenericPoint P chart e))
225                 (homogenizeAtZero f) = 0 := by
226               calc
227                 _ = MvPolynomial.eval₂ (algebraMap k (ComponentFractionField P))
228                     (chartGenericPoint P chart e)
229                     (projectiveDehomogenize (homogenizeAtZero f)) :=
230                       (eval₂_projectiveDehomogenize
231                         (algebraMap k (ComponentFractionField P))
232                         (chartGenericPoint P chart e) (homogenizeAtZero f)).symm
233                 _ = MvPolynomial.eval₂ (algebraMap k (ComponentFractionField P))
234                     (chartGenericPoint P chart e) f := by
235                       rw [projectiveDehomogenize_homogenizeAtZero]
236                 _ = 0 := hf
237             rw [hzero]
238             simp
239     have hcone : componentProjectiveConeMap P H = 0 := by
240       rw [componentProjectiveConeMap_eq_eval₂_mul_X_pow_of_isHomogeneous P hH]
241       have hgenericEvalZero : MvPolynomial.eval₂
242           (algebraMap k (ComponentFractionField P))
243           (Fin.cases 1 (fun j ↦ componentCoordinate P j)) H = 0 := by
244         simpa only [componentProjectivePoint_eq_finCases] using hgenericEval
245       rw [hgenericEvalZero]
246       simp
247     have hHmem : H ∈ componentProjectiveClosureIdeal P := hcone
248     have hdehom_mem : dehomogenizeProjectiveChart chart e H ∈
249         componentChartEquationIdeal P chart e := by
250       apply Ideal.subset_span
251       exact ⟨⟨H, f.totalDegree, hH, hHmem⟩, rfl⟩
252     rw [hdehom] at hdehom_mem
253     exact hdehom_mem
254 
255 #print axioms chartIndexEquiv
256 #print axioms homogenizeAtChart_isHomogeneous
257 #print axioms dehomogenize_chart_homogenizeAtChart
258 #print axioms componentChartEquationIdeal_eq_genericEvalKer
259 
260 /-- The canonical quotient-to-function-field map for a projective chart,
261 derived from generic-chart evaluation via the quotient universal property. -/
262 noncomputable def canonicalComponentChartEquationGenericPointMap
263     (P : PrimeSpectrum (MvPolynomial (Fin m) k))
264     (chart : Fin (m + 1))
265     (e : Fin m ≃ ChartAffineIndex (Fin (m + 1)) chart)
266     (hchart : componentProjectivePoint P chart ≠ 0) :
267     (MvPolynomial (Fin m) k ⧸ componentChartEquationIdeal P chart e) →ₐ[k]
268       ComponentFractionField P :=
269   Ideal.Quotient.liftₐ (componentChartEquationIdeal P chart e)
270     (MvPolynomial.aeval (chartGenericPoint P chart e)) (by
271       intro f hf
272       have hker := componentChartEquationIdeal_eq_genericEvalKer P chart e hchart
273       rw [hker] at hf
274       exact RingHom.mem_ker.mp hf)
275 
276 /-- Generator action of the canonical chart quotient map. -/
277 theorem canonicalComponentChartEquationGenericPointMap_mk
278     (P : PrimeSpectrum (MvPolynomial (Fin m) k))
279     (chart : Fin (m + 1))
280     (e : Fin m ≃ ChartAffineIndex (Fin (m + 1)) chart)
281     (hchart : componentProjectivePoint P chart ≠ 0)
282     (f : MvPolynomial (Fin m) k) :
283     canonicalComponentChartEquationGenericPointMap P chart e hchart
284         (Ideal.Quotient.mk _ f) =
285       MvPolynomial.eval₂ (algebraMap k (ComponentFractionField P))
286         (chartGenericPoint P chart e) f := by
287   change Ideal.Quotient.lift (componentChartEquationIdeal P chart e)
288       (MvPolynomial.aeval (chartGenericPoint P chart e)).toRingHom _
289       (Ideal.Quotient.mk (componentChartEquationIdeal P chart e) f) = _
290   rw [Ideal.Quotient.lift_mk]
291   rfl
292 
293 /-- The quotient universal-property characterization of the canonical map. -/
294 theorem canonicalComponentChartEquationGenericPointMap_comp_mk
295     (P : PrimeSpectrum (MvPolynomial (Fin m) k))
296     (chart : Fin (m + 1))
297     (e : Fin m ≃ ChartAffineIndex (Fin (m + 1)) chart)
298     (hchart : componentProjectivePoint P chart ≠ 0) :
299     (canonicalComponentChartEquationGenericPointMap P chart e hchart).comp
300         (Ideal.Quotient.mkₐ k (componentChartEquationIdeal P chart e)) =
301       MvPolynomial.aeval (chartGenericPoint P chart e) := by
302   exact Ideal.Quotient.liftₐ_comp _ _ _
303 
304 /-- Any algebra map with the prescribed generic-chart evaluation is this map. -/
305 theorem canonicalComponentChartEquationGenericPointMap_unique
306     (P : PrimeSpectrum (MvPolynomial (Fin m) k))
307     (chart : Fin (m + 1))
308     (e : Fin m ≃ ChartAffineIndex (Fin (m + 1)) chart)
309     (hchart : componentProjectivePoint P chart ≠ 0)
310     (f : (MvPolynomial (Fin m) k ⧸ componentChartEquationIdeal P chart e) →ₐ[k]
311       ComponentFractionField P)
312     (hf : f.comp (Ideal.Quotient.mkₐ k (componentChartEquationIdeal P chart e)) =
313       MvPolynomial.aeval (chartGenericPoint P chart e)) :
314     f = canonicalComponentChartEquationGenericPointMap P chart e hchart := by
315   apply AlgHom.ext
316   intro x
317   obtain ⟨p, rfl⟩ := Ideal.Quotient.mk_surjective x
318   have hp := congrArg (fun g : MvPolynomial (Fin m) k →ₐ[k]
319       ComponentFractionField P => g p) hf
320   rw [canonicalComponentChartEquationGenericPointMap_mk]
321   simpa only [AlgHom.comp_apply, Ideal.Quotient.mkₐ_eq_mk,
322     MvPolynomial.aeval_def] using hp
323 
324 end
325 
326 end Stafford38.Geometry.ComponentProjectiveChartKernel
327