Stafford38/Geometry/SameWitness/CommonOpenColumnDerivatives.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Stafford38.Geometry.SameWitness.CommonOpenPositions
3 public import Stafford38.Geometry.SameWitness.CommonOpenEtale
4 
5 @[expose] public section
6 
7 set_option autoImplicit false
8 set_option maxHeartbeats 1600000
9 set_option linter.style.haveILetI false
10 
11 noncomputable section
12 
13 namespace Stafford38.Geometry.SameWitness
14 
15 open Stafford38.Geometry.EtaleCotangentBasis
16 open Stafford38.Geometry.ActualCommonOpenCompletionDerivation
17 open Stafford38.Geometry.SelectedResidueCoefficientLocalization
18 open Stafford38.Geometry.ActualOptionColumnBinding
19 open Stafford38.Geometry.ActualSelectedNormalizationChartTransport
20 open Stafford38.Geometry.ComponentProjectiveClosure
21 open Stafford38.Geometry.ActualOptionCommonOpenColumns
22 open Stafford38.Geometry.ActualSelectedNormalizationDivisorEtale
23 open Stafford38.Geometry.EtaleGenericOpenTransport
24 open Stafford38.Geometry.GeneralDivisorialVisibleFrame
25 open Stafford38.Geometry.HomogenizedAffineEvaluation
26 open Stafford38.Geometry.PrescribedGroundPointUnitPowerChart
27 open Stafford38.Geometry.SmoothLocalTiltedArcAxisLift
28 open Stafford38.Geometry.LocalizedProjectiveChartTransition
29 
30 universe u
31 
32 /-- The two common-open derivative identities with every scalar certificate
33 bound explicitly over the abstract algebra. -/
34 def commonOpenDerivativeIdentities
35     {k U : Type u} [Field k] [CommRing U] {d n : ℕ}
36     (a : Algebra (MvPolynomial (Option (Fin d)) k) U) (b : Algebra k U)
37     (tower : @IsScalarTower k (MvPolynomial (Option (Fin d)) k) U
38       (inferInstance : Algebra k (MvPolynomial (Option (Fin d)) k)).toSMul
39       a.toSMul b.toSMul)
40     (etale : @Algebra.FormallyEtale (MvPolynomial (Option (Fin d)) k) U _ _ a)
41     (rho : U →+* LaurentSeries k)
42     (hground : rho.comp b.algebraMap = algebraMap k (LaurentSeries k))
43     (alpha : Fin d → k) (qPre : Fin (n + 1) → MvPowerSeries (Fin (d + 1)) k)
44     (qU : Fin (n + 1) → U) : Prop :=
45     let R := MvPolynomial (Option (Fin d)) k
46     letI : Algebra R U := a
47     letI : SMul R U := a.toSMul
48     letI : Algebra k U := b
49     letI : SMul k U := b.toSMul
50     letI : IsScalarTower k R U := tower
51     letI : Algebra.FormallyEtale R U := etale
52     letI : Algebra U (LaurentSeries k) :=
53       RingHom.toAlgebra' rho (by intro x y; exact mul_comm _ _)
54     letI : Algebra k (LaurentSeries k) :=
55       RingHom.toAlgebra' (algebraMap k (LaurentSeries k))
56         (by intro x y; exact mul_comm _ _)
57     letI : Module k (LaurentSeries k) := Algebra.toModule
58     letI : SMul k (LaurentSeries k) :=
59       (Algebra.toModule : Module k (LaurentSeries k)).toSMul
60     letI : IsScalarTower k U (LaurentSeries k) :=
61       IsScalarTower.of_algebraMap_eq' hground.symm
62     letI : IsScalarTower U (LaurentSeries k) (LaurentSeries k) :=
63       ⟨fun x y z => by
64         change (algebraMap U (LaurentSeries k) x * y) * z = _
65         exact mul_assoc _ _ _⟩
66     (∀ j i, coordinateDerivation (k := k)
67     (σ := Option (Fin d))
68     (B := U) (L := LaurentSeries k) (some j)
69     (qU i) = algebraMap (PowerSeries k) (LaurentSeries k)
70       (tiltedTransverseDerivativeMatrix alpha qPre i j)) ∧
71     (∀ i, algebraMap (PowerSeries k) (LaurentSeries k)
72       (PowerSeries.derivative (R := k)
73         (tiltedArc alpha (qPre i))) =
74     coordinateDerivation (k := k)
75       (σ := Option (Fin d))
76       (B := U) (L := LaurentSeries k) none (qU i) +
77       ∑ j, algebraMap (PowerSeries k) (LaurentSeries k)
78         (PowerSeries.C (alpha j)) *
79         coordinateDerivation (k := k)
80           (σ := Option (Fin d))
81           (B := U) (L := LaurentSeries k) (some j)
82           (qU i))
83 
84 /-- Equal coordinate and ground actions transport the complete derivative
85 proposition together with its dependent tower and étale certificates. -/
86 theorem commonOpenDerivativeIdentities_transport
87     {k U : Type u} [Field k] [CommRing U] {d n : ℕ}
88     (a0 a1 : Algebra (MvPolynomial (Option (Fin d)) k) U)
89     (b0 b1 : Algebra k U) (ha : a0 = a1) (hb : b0 = b1)
90     (t0 : @IsScalarTower k (MvPolynomial (Option (Fin d)) k) U
91       (inferInstance : Algebra k (MvPolynomial (Option (Fin d)) k)).toSMul
92       a0.toSMul b0.toSMul)
93     (t1 : @IsScalarTower k (MvPolynomial (Option (Fin d)) k) U
94       (inferInstance : Algebra k (MvPolynomial (Option (Fin d)) k)).toSMul
95       a1.toSMul b1.toSMul)
96     (e0 : @Algebra.FormallyEtale (MvPolynomial (Option (Fin d)) k) U _ _ a0)
97     (e1 : @Algebra.FormallyEtale (MvPolynomial (Option (Fin d)) k) U _ _ a1)
98     (rho : U →+* LaurentSeries k)
99     (h0 : rho.comp b0.algebraMap = algebraMap k (LaurentSeries k))
100     (h1 : rho.comp b1.algebraMap = algebraMap k (LaurentSeries k))
101     (alpha : Fin d → k) (qPre : Fin (n + 1) → MvPowerSeries (Fin (d + 1)) k)
102     (qU : Fin (n + 1) → U)
103     (h : commonOpenDerivativeIdentities a0 b0 t0 e0 rho h0 alpha qPre qU) :
104     commonOpenDerivativeIdentities a1 b1 t1 e1 rho h1 alpha qPre qU := by
105   cases ha
106   cases hb
107   exact h
108 
109 /-- Derivative identities on an abstract common-open algebra, with its
110 retained coordinate and Laurent actions scoped in the certificate. -/
111 structure CommonOpenDerivativeData
112     {k U : Type u} [Field k] [CommRing U] [Algebra k U] {d n : ℕ}
113     (psi : MvPolynomial (Option (Fin d)) k →ₐ[k] U)
114     (hEtale : @Algebra.FormallyEtale (MvPolynomial (Option (Fin d)) k) U _ _
115       psi.toRingHom.toAlgebra)
116     (rho : U →+* LaurentSeries k)
117     (hground : rho.comp (algebraMap k U) = algebraMap k (LaurentSeries k))
118     (alpha : Fin d → k) (qPre : Fin (n + 1) → MvPowerSeries (Fin (d + 1)) k)
119     (qU : Fin (n + 1) → U) : Prop where
120   htransverse :
121     let R := MvPolynomial (Option (Fin d)) k
122     letI : Algebra R U := psi.toRingHom.toAlgebra
123     letI : SMul R U := (psi.toRingHom.toAlgebra).toSMul
124     letI : IsScalarTower k R U :=
125       IsScalarTower.of_algebraMap_eq' psi.comp_algebraMap.symm
126     letI : Algebra.FormallyEtale R U := hEtale
127     letI : Algebra U (LaurentSeries k) :=
128       RingHom.toAlgebra' rho (by intro x y; exact mul_comm _ _)
129     letI : Algebra k (LaurentSeries k) :=
130       RingHom.toAlgebra' (algebraMap k (LaurentSeries k))
131         (by intro x y; exact mul_comm _ _)
132     letI : Module k (LaurentSeries k) := Algebra.toModule
133     letI : SMul k (LaurentSeries k) :=
134       (Algebra.toModule : Module k (LaurentSeries k)).toSMul
135     letI : IsScalarTower k U (LaurentSeries k) :=
136       IsScalarTower.of_algebraMap_eq' hground.symm
137     letI : IsScalarTower U (LaurentSeries k) (LaurentSeries k) :=
138       ⟨fun x y z => by
139         change (algebraMap U (LaurentSeries k) x * y) * z = _
140         exact mul_assoc _ _ _⟩
141     ∀ j i, coordinateDerivation (k := k)
142     (σ := Option (Fin d))
143     (B := U) (L := LaurentSeries k) (some j)
144     (qU i) = algebraMap (PowerSeries k) (LaurentSeries k)
145       (tiltedTransverseDerivativeMatrix alpha qPre i j)
146   hraw :
147     let R := MvPolynomial (Option (Fin d)) k
148     letI : Algebra R U := psi.toRingHom.toAlgebra
149     letI : SMul R U := (psi.toRingHom.toAlgebra).toSMul
150     letI : IsScalarTower k R U :=
151       IsScalarTower.of_algebraMap_eq' psi.comp_algebraMap.symm
152     letI : Algebra.FormallyEtale R U := hEtale
153     letI : Algebra U (LaurentSeries k) :=
154       RingHom.toAlgebra' rho (by intro x y; exact mul_comm _ _)
155     letI : Algebra k (LaurentSeries k) :=
156       RingHom.toAlgebra' (algebraMap k (LaurentSeries k))
157         (by intro x y; exact mul_comm _ _)
158     letI : Module k (LaurentSeries k) := Algebra.toModule
159     letI : SMul k (LaurentSeries k) :=
160       (Algebra.toModule : Module k (LaurentSeries k)).toSMul
161     letI : IsScalarTower k U (LaurentSeries k) :=
162       IsScalarTower.of_algebraMap_eq' hground.symm
163     letI : IsScalarTower U (LaurentSeries k) (LaurentSeries k) :=
164       ⟨fun x y z => by
165         change (algebraMap U (LaurentSeries k) x * y) * z = _
166         exact mul_assoc _ _ _⟩
167     ∀ i, algebraMap (PowerSeries k) (LaurentSeries k)
168       (PowerSeries.derivative (R := k)
169         (tiltedArc alpha (qPre i))) =
170     coordinateDerivation (k := k)
171       (σ := Option (Fin d))
172       (B := U) (L := LaurentSeries k) none (qU i) +
173       ∑ j, algebraMap (PowerSeries k) (LaurentSeries k)
174         (PowerSeries.C (alpha j)) *
175         coordinateDerivation (k := k)
176           (σ := Option (Fin d))
177           (B := U) (L := LaurentSeries k) (some j)
178           (qU i)
179 
180 /-- Assemble a derivative certificate from equal raw scalar actions over
181 an abstract open algebra, preserving all dependent proof certificates. -/
182 theorem commonOpenDerivativeData_of_rawCertificate
183     {k U : Type u} [Field k] [CommRing U] [Algebra k U] {d n : ℕ}
184     (psi : MvPolynomial (Option (Fin d)) k →ₐ[k] U)
185     (hEtale : @Algebra.FormallyEtale (MvPolynomial (Option (Fin d)) k) U _ _
186       psi.toRingHom.toAlgebra)
187     (rho : U →+* LaurentSeries k)
188     (hground : rho.comp (algebraMap k U) = algebraMap k (LaurentSeries k))
189     (alpha : Fin d → k) (qPre : Fin (n + 1) → MvPowerSeries (Fin (d + 1)) k)
190     (qU : Fin (n + 1) → U)
191     (h : let targetAction : Algebra (MvPolynomial (Option (Fin d)) k) U :=
192         psi.toRingHom.toAlgebra
193       let canonicalGround : Algebra k U := inferInstance
194       ∃ (a : Algebra (MvPolynomial (Option (Fin d)) k) U) (b : Algebra k U)
195         (t : @IsScalarTower k (MvPolynomial (Option (Fin d)) k) U
196           (inferInstance : Algebra k (MvPolynomial (Option (Fin d)) k)).toSMul
197           a.toSMul b.toSMul)
198         (et : @Algebra.FormallyEtale (MvPolynomial (Option (Fin d)) k) U _ _ a)
199         (hgnd : rho.comp b.algebraMap = algebraMap k (LaurentSeries k)),
200         a = targetAction ∧ b = canonicalGround ∧
201         commonOpenDerivativeIdentities a b t et rho hgnd alpha qPre qU) :
202     CommonOpenDerivativeData psi hEtale rho hground alpha qPre qU := by
203   let R := MvPolynomial (Option (Fin d)) k
204   let groundAction : Algebra k U := inferInstance
205   let psiAction : Algebra R U := psi.toRingHom.toAlgebra
206   have hPsiGround := psi.comp_algebraMap
207   obtain ⟨a, b, tower, etale, ground, ha, hb, hRaw⟩ := h
208   letI : Algebra k U := groundAction
209   letI : SMul k U := groundAction.toSMul
210   letI : Algebra R U := psiAction
211   letI : SMul R U := psiAction.toSMul
212   have targetTower : IsScalarTower k R U :=
213     IsScalarTower.of_algebraMap_eq' hPsiGround.symm
214   have hTarget := commonOpenDerivativeIdentities_transport a psiAction
215     b groundAction ha hb tower targetTower etale hEtale rho ground hground
216     alpha qPre qU hRaw
217   exact @CommonOpenDerivativeData.mk k U inferInstance inferInstance groundAction
218     d n psi hEtale rho hground alpha qPre qU hTarget.1 hTarget.2
219 
220 /-- The point-local derivative columns retain their values after extension
221 along the common-open Laurent arc and its given coordinate algebra map. -/
222 theorem commonOpen_rawDerivativeCertificate_of_pointColumns
223     {k B Q : Type u} [Field k] [CharZero k] [IsAlgClosed k]
224     [CommRing B] [CommRing Q] [Algebra k Q]
225     {d n : ℕ} (coeff : k →+* B) (qToB : Q →+* B)
226     (fFin : @AlgHom k (MvPolynomial (Option (Fin d)) k) B _ _ _ _ coeff.toAlgebra)
227     (hfinite : @Algebra.FiniteType k B _ _ coeff.toAlgebra)
228     (M : Ideal B) [M.IsPrime] [M.IsMaximal] :
229     letI : Algebra k B := coeff.toAlgebra
230     letI : Algebra Q B := qToB.toAlgebra
231     let R := MvPolynomial (Option (Fin d)) k
232     letI : Algebra R B := fFin.toRingHom.toAlgebra
233     letI : IsScalarTower k R B := IsScalarTower.of_algebraMap_eq' (by
234       ext c; exact (fFin.commutes c).symm)
235     letI : Algebra.FiniteType k B := hfinite
236     letI : Algebra.EssFiniteType R B := Algebra.EssFiniteType.of_comp k R B
237     ∀ (f : Q) (e : Localization.Away f ≃ₐ[Q]
238       Localization.Away (algebraMap Q B f)) (g : Q)
239     (eM : (B ⧸ M) ≃ₐ[k] k)
240     (hEtM : Algebra.FormallyEtale R (Localization.AtPrime M)),
241     letI : Algebra.FormallyEtale R (Localization.AtPrime M) := hEtM
242     ∀ (alpha : Fin d → k)
243     (hf : IsUnit ((originalToPointLocalFinSuccArcLaurentSeries
244       (k := k) (d := d) (A := B) M eM alpha) (algebraMap Q B f)))
245     (hunitM : ∀ b, b ∉ M → IsUnit ((originalToPointLocalFinSuccArcLaurentSeries
246       (k := k) (d := d) (A := B) M eM alpha) b))
247     (hg : IsUnit ((originalToPointLocalFinSuccArcLaurentSeries
248       (k := k) (d := d) (A := B) M eM alpha) (algebraMap Q B g)))
249     (qT : Fin (n + 1) → Localization.AtPrime M)
250     (qU : Fin (n + 1) → genericOpenExtraAwayB M f e g)
251     (hq : ∀ i, qU i = pointLocalToCommonOpen (A := B) M f e g (qT i))
252     (psi : MvPolynomial (Option (Fin d)) k →ₐ[k] genericOpenExtraAwayB M f e g)
253     (hpsi : ((algebraMap (genericOpenRing M f e) (genericOpenExtraAwayB M f e g)).comp
254       ((algebraMap B (genericOpenRing M f e)).comp fFin.toRingHom)).toAlgebra =
255       (@RingHom.toAlgebra (MvPolynomial (Option (Fin d)) k)
256         (genericOpenExtraAwayB M f e g) inferInstance inferInstance psi.toRingHom))
257     (hpsiEtale : @Algebra.FormallyEtale (MvPolynomial (Option (Fin d)) k)
258       (genericOpenExtraAwayB M f e g) _ _ (@RingHom.toAlgebra (MvPolynomial (Option (Fin d)) k)
259         (genericOpenExtraAwayB M f e g) inferInstance inferInstance psi.toRingHom))
260     (rho : genericOpenExtraAwayB M f e g →+* LaurentSeries k)
261     (hground : rho.comp (algebraMap k (genericOpenExtraAwayB M f e g)) =
262       algebraMap k (LaurentSeries k))
263     (hcanonical : rho = genericArcToGenericOpenExtraAwayB M f e
264       (originalToPointLocalFinSuccArcLaurentSeries
265         (k := k) (d := d) (A := B) M eM alpha) hf hunitM g hg),
266     let targetAction : Algebra (MvPolynomial (Option (Fin d)) k)
267         (genericOpenExtraAwayB M f e g) :=
268       @RingHom.toAlgebra (MvPolynomial (Option (Fin d)) k)
269         (genericOpenExtraAwayB M f e g) inferInstance inferInstance psi.toRingHom
270     let canonicalGround : Algebra k (genericOpenExtraAwayB M f e g) := inferInstance
271     ∃ (a : Algebra (MvPolynomial (Option (Fin d)) k) (genericOpenExtraAwayB M f e g))
272       (b : Algebra k (genericOpenExtraAwayB M f e g))
273       (t : @IsScalarTower k (MvPolynomial (Option (Fin d)) k)
274         (genericOpenExtraAwayB M f e g)
275         (inferInstance : Algebra k (MvPolynomial (Option (Fin d)) k)).toSMul
276         a.toSMul b.toSMul)
277       (et : @Algebra.FormallyEtale (MvPolynomial (Option (Fin d)) k)
278         (genericOpenExtraAwayB M f e g) _ _ a)
279       (hgnd : rho.comp b.algebraMap = algebraMap k (LaurentSeries k)),
280       a = targetAction ∧ b = canonicalGround ∧
281       commonOpenDerivativeIdentities a b t et rho hgnd alpha
282         (fun i => pointLocalPowerSeriesChart coeff fFin hfinite M eM hEtM (qT i)) qU := by
283   letI : Algebra k B := coeff.toAlgebra
284   letI : Algebra Q B := qToB.toAlgebra
285   dsimp only
286   intro f e g eM hEtM alpha hf hunitM hg qT qU hq psi hpsi hpsiEtale rho hground hcanonical
287   let R := MvPolynomial (Option (Fin d)) k
288   let U := genericOpenExtraAwayB M f e g
289   let psiAction : Algebra R U :=
290     @RingHom.toAlgebra R U inferInstance inferInstance psi.toRingHom
291   have hPsiGround := psi.comp_algebraMap
292   letI : Algebra R B := fFin.toRingHom.toAlgebra
293   letI : IsScalarTower k R B := IsScalarTower.of_algebraMap_eq' (by
294     ext c; exact (fFin.commutes c).symm)
295   letI : Algebra.FiniteType k B := hfinite
296   letI : Algebra.EssFiniteType R B := Algebra.EssFiniteType.of_comp k R B
297   letI : Algebra.FormallyEtale R (Localization.AtPrime M) := hEtM
298   let Cq := genericOpenRing M f e
299   letI : Algebra R Cq := ((algebraMap B Cq).comp (algebraMap R B)).toAlgebra
300   let rawAction : Algebra R U := Algebra.compHom U (algebraMap R Cq)
301   have hRawAction : rawAction =
302       psiAction := by
303     apply Algebra.algebra_ext
304     intro x
305     have hpoint := congrArg (fun a : Algebra R U => a.algebraMap x) hpsi
306     exact hpoint
307   have hcols := actual_option_columns (k := k) (d := d) (A := B)
308     M f e g eM alpha hf hunitM hg n qT qU hq
309   let groundAction : Algebra k U := inferInstance
310   letI : Algebra R U := psiAction
311   letI : SMul R U :=
312     psiAction.toSMul
313   letI : IsScalarTower k R U := IsScalarTower.of_algebraMap_eq' psi.comp_algebraMap.symm
314   have hGroundAction : Algebra.compHom U (algebraMap k R) = groundAction := by
315     apply Algebra.algebra_ext
316     intro c
317     exact RingHom.congr_fun psi.comp_algebraMap c
318   letI : Algebra R U := rawAction
319   letI : SMul R U := rawAction.toSMul
320   let rawGround : Algebra k U := Algebra.compHom U (algebraMap k R)
321   have hRawGround : rawGround = groundAction := by
322     apply Algebra.algebra_ext
323     intro c
324     have hpoint := congrArg (fun a : Algebra R U =>
325       a.algebraMap (algebraMap k R c)) hRawAction
326     exact hpoint.trans (RingHom.congr_fun hPsiGround c)
327   letI : Algebra k U := rawGround
328   letI : SMul k U := rawGround.toSMul
329   letI : IsScalarTower k R U := IsScalarTower.of_algebraMap_eq' (by
330     ext c
331     rfl)
332   letI : Algebra.FormallyEtale R U :=
333     Eq.mp (congrArg (fun a : Algebra R U =>
334       @Algebra.FormallyEtale R U inferInstance inferInstance a)
335       hRawAction.symm) hpsiEtale
336   have hgroundRaw : rho.comp (algebraMap k U) =
337       algebraMap k (LaurentSeries k) := by
338     apply RingHom.ext
339     intro c
340     have hpoint := congrArg (fun a : Algebra k U => rho (a.algebraMap c))
341       hRawGround
342     exact hpoint.trans (RingHom.congr_fun hground c)
343   dsimp only at hcols
344   rcases hcols with ⟨hposition, htransverse, hraw⟩
345   have hposition' := hposition
346   have htransverse' := htransverse
347   have hraw' := hraw
348   rw [← hcanonical] at hposition' htransverse' hraw'
349   have hcolumns := actual_option_columns_to_laurent
350     (k := k) (d := d) (A := B) (U := U) (M := M)
351     eM (algebraMap (PowerSeries k) (LaurentSeries k)) rho hgroundRaw alpha qT qU
352     hposition' htransverse' hraw'
353   have hchart : (fun i => pointLocalPowerSeriesChart coeff fFin hfinite
354       M eM hEtM (qT i)) = fun i =>
355       localToFinSuccPowerSeries (k := k) (B := B) (d := d) M eM (qT i) := by
356     funext i
357     unfold pointLocalPowerSeriesChart
358     dsimp only [id_eq]
359     exact congrFun (AlgHom.coe_toRingHom
360       (localToFinSuccPowerSeries (k := k) (B := B) (d := d) M eM)) (qT i)
361   have hRawIdentities : commonOpenDerivativeIdentities rawAction rawGround
362       (inferInstance : IsScalarTower k R U)
363       (inferInstance : Algebra.FormallyEtale R U) rho hgroundRaw alpha
364       (fun i => pointLocalPowerSeriesChart coeff fFin hfinite M eM hEtM (qT i)) qU := by
365     rw [hchart]
366     simpa only [commonOpenDerivativeIdentities,
367       tiltedTransverseDerivativeMatrix, localTransverseDerivativeMatrix] using hcolumns.2
368   exact ⟨rawAction, rawGround,
369     (inferInstance : IsScalarTower k R U),
370     (inferInstance : Algebra.FormallyEtale R U), hgroundRaw,
371     hRawAction, hRawGround, hRawIdentities⟩
372 
373 /-- The point-local derivative columns retain their values after extension
374 along the common-open Laurent arc and its given coordinate algebra map. -/
375 theorem commonOpen_derivatives_of_pointColumns
376     {k B Q : Type u} [Field k] [CharZero k] [IsAlgClosed k]
377     [CommRing B] [CommRing Q] [Algebra k Q]
378     {d n : ℕ} (coeff : k →+* B) (qToB : Q →+* B)
379     (fFin : @AlgHom k (MvPolynomial (Option (Fin d)) k) B _ _ _ _ coeff.toAlgebra)
380     (hfinite : @Algebra.FiniteType k B _ _ coeff.toAlgebra)
381     (M : Ideal B) [M.IsPrime] [M.IsMaximal] :
382     letI : Algebra k B := coeff.toAlgebra
383     letI : Algebra Q B := qToB.toAlgebra
384     let R := MvPolynomial (Option (Fin d)) k
385     letI : Algebra R B := fFin.toRingHom.toAlgebra
386     letI : IsScalarTower k R B := IsScalarTower.of_algebraMap_eq' (by
387       ext c; exact (fFin.commutes c).symm)
388     letI : Algebra.FiniteType k B := hfinite
389     letI : Algebra.EssFiniteType R B := Algebra.EssFiniteType.of_comp k R B
390     ∀ (f : Q) (e : Localization.Away f ≃ₐ[Q]
391       Localization.Away (algebraMap Q B f)) (g : Q)
392     (eM : (B ⧸ M) ≃ₐ[k] k)
393     (hEtM : Algebra.FormallyEtale R (Localization.AtPrime M)),
394     letI : Algebra.FormallyEtale R (Localization.AtPrime M) := hEtM
395     ∀ (alpha : Fin d → k)
396     (hf : IsUnit ((originalToPointLocalFinSuccArcLaurentSeries
397       (k := k) (d := d) (A := B) M eM alpha) (algebraMap Q B f)))
398     (hunitM : ∀ b, b ∉ M → IsUnit ((originalToPointLocalFinSuccArcLaurentSeries
399       (k := k) (d := d) (A := B) M eM alpha) b))
400     (hg : IsUnit ((originalToPointLocalFinSuccArcLaurentSeries
401       (k := k) (d := d) (A := B) M eM alpha) (algebraMap Q B g)))
402     (qT : Fin (n + 1) → Localization.AtPrime M)
403     (qU : Fin (n + 1) → genericOpenExtraAwayB M f e g)
404     (hq : ∀ i, qU i = pointLocalToCommonOpen (A := B) M f e g (qT i))
405     (psi : MvPolynomial (Option (Fin d)) k →ₐ[k] genericOpenExtraAwayB M f e g)
406     (hpsi : ((algebraMap (genericOpenRing M f e) (genericOpenExtraAwayB M f e g)).comp
407       ((algebraMap B (genericOpenRing M f e)).comp fFin.toRingHom)).toAlgebra =
408       (@RingHom.toAlgebra (MvPolynomial (Option (Fin d)) k)
409         (genericOpenExtraAwayB M f e g) inferInstance inferInstance psi.toRingHom))
410     (hpsiEtale : @Algebra.FormallyEtale (MvPolynomial (Option (Fin d)) k)
411       (genericOpenExtraAwayB M f e g) _ _ (@RingHom.toAlgebra (MvPolynomial (Option (Fin d)) k)
412         (genericOpenExtraAwayB M f e g) inferInstance inferInstance psi.toRingHom))
413     (rho : genericOpenExtraAwayB M f e g →+* LaurentSeries k)
414     (hground : rho.comp (algebraMap k (genericOpenExtraAwayB M f e g)) =
415       algebraMap k (LaurentSeries k))
416     (hcanonical : rho = genericArcToGenericOpenExtraAwayB M f e
417       (originalToPointLocalFinSuccArcLaurentSeries
418         (k := k) (d := d) (A := B) M eM alpha) hf hunitM g hg),
419     CommonOpenDerivativeData psi hpsiEtale rho hground alpha
420       (fun i => pointLocalPowerSeriesChart coeff fFin hfinite M eM hEtM (qT i)) qU := by
421   letI : Algebra k B := coeff.toAlgebra
422   letI : Algebra Q B := qToB.toAlgebra
423   dsimp only
424   intro f e g eM hEtM alpha hf hunitM hg qT qU hq psi hpsi hpsiEtale rho hground hcanonical
425   let R := MvPolynomial (Option (Fin d)) k
426   let U := genericOpenExtraAwayB M f e g
427   letI : Algebra R B := fFin.toRingHom.toAlgebra
428   letI : IsScalarTower k R B := IsScalarTower.of_algebraMap_eq' (by
429     ext c; exact (fFin.commutes c).symm)
430   letI : Algebra.FiniteType k B := hfinite
431   letI : Algebra.EssFiniteType R B := Algebra.EssFiniteType.of_comp k R B
432   letI : Algebra.FormallyEtale R (Localization.AtPrime M) := hEtM
433   exact commonOpenDerivativeData_of_rawCertificate psi hpsiEtale rho hground alpha
434     (fun i => pointLocalPowerSeriesChart coeff fFin hfinite M eM hEtM (qT i)) qU
435     (commonOpen_rawDerivativeCertificate_of_pointColumns
436       (k := k) (B := B) (Q := Q) (d := d) (n := n)
437       coeff qToB fFin hfinite M f e g eM hEtM alpha hf hunitM hg
438       qT qU hq psi hpsi hpsiEtale rho hground hcanonical)
439 
440 /-- Transport the retained arc and prescribed columns entirely over abstract rings. -/
441 theorem commonOpen_derivatives_of_retainedArc
442     {k B Q : Type u} [Field k] [CharZero k] [IsAlgClosed k]
443     [CommRing B] [CommRing Q] [Algebra k Q]
444     {d n : ℕ} (coeff : k →+* B) (qToB : Q →+* B)
445     (fFin : @AlgHom k (MvPolynomial (Option (Fin d)) k) B _ _ _ _ coeff.toAlgebra)
446     (hfinite : @Algebra.FiniteType k B _ _ coeff.toAlgebra)
447     (M : Ideal B) [M.IsPrime] [M.IsMaximal] :
448     letI : Algebra k B := coeff.toAlgebra
449     letI : Algebra Q B := qToB.toAlgebra
450     let R := MvPolynomial (Option (Fin d)) k
451     letI : Algebra R B := fFin.toRingHom.toAlgebra
452     letI : IsScalarTower k R B := IsScalarTower.of_algebraMap_eq' (by
453       ext c; exact (fFin.commutes c).symm)
454     letI : Algebra.FiniteType k B := hfinite
455     letI : Algebra.EssFiniteType R B := Algebra.EssFiniteType.of_comp k R B
456     ∀ (f : Q) (e : Localization.Away f ≃ₐ[Q]
457       Localization.Away (algebraMap Q B f)) (g : Q)
458     (eM : (B ⧸ M) ≃ₐ[k] k)
459     (hEtM : Algebra.FormallyEtale R (Localization.AtPrime M)),
460     letI : Algebra.FormallyEtale R (Localization.AtPrime M) := hEtM
461     ∀ (alpha : Fin d → k)
462     (rhoA : B →+* LaurentSeries k)
463     (hf : IsUnit (rhoA (algebraMap Q B f)))
464     (hunitM : ∀ b, b ∉ M → IsUnit (rhoA b))
465     (hg : IsUnit (rhoA (algebraMap Q B g)))
466     (hsource : rhoA = originalToPointLocalFinSuccArcLaurentSeries
467       (k := k) (d := d) (A := B) M eM alpha)
468     (qT : Fin (n + 1) → Localization.AtPrime M)
469     (qU : Fin (n + 1) → genericOpenExtraAwayB M f e g)
470     (hq : ∀ i, qU i = pointLocalToCommonOpen (A := B) M f e g (qT i))
471     (psi : MvPolynomial (Option (Fin d)) k →ₐ[k] genericOpenExtraAwayB M f e g)
472     (hpsi : ((algebraMap (genericOpenRing M f e) (genericOpenExtraAwayB M f e g)).comp
473       ((algebraMap B (genericOpenRing M f e)).comp fFin.toRingHom)).toAlgebra =
474       (@RingHom.toAlgebra (MvPolynomial (Option (Fin d)) k)
475         (genericOpenExtraAwayB M f e g) inferInstance inferInstance psi.toRingHom))
476     (hpsiEtale : @Algebra.FormallyEtale (MvPolynomial (Option (Fin d)) k)
477       (genericOpenExtraAwayB M f e g) _ _ (@RingHom.toAlgebra (MvPolynomial (Option (Fin d)) k)
478         (genericOpenExtraAwayB M f e g) inferInstance inferInstance psi.toRingHom))
479     (rho : genericOpenExtraAwayB M f e g →+* LaurentSeries k)
480     (hground : rho.comp (algebraMap k (genericOpenExtraAwayB M f e g)) =
481       algebraMap k (LaurentSeries k))
482     (hcanonical : rho = genericArcToGenericOpenExtraAwayB M f e
483       rhoA hf hunitM g hg)
484     (qPre : Fin (n + 1) → MvPowerSeries (Fin (d + 1)) k)
485     (hqPre : qPre = fun i => pointLocalPowerSeriesChart coeff fFin hfinite M eM hEtM (qT i)),
486     CommonOpenDerivativeData psi hpsiEtale rho hground alpha
487       qPre qU := by
488   letI : Algebra k B := coeff.toAlgebra
489   letI : Algebra Q B := qToB.toAlgebra
490   dsimp only
491   intro f e g eM hEtM alpha rhoA hf hunitM hg hsource qT qU hq psi hpsi hpsiEtale rho hground hcanonical qPre hqPre
492   let R := MvPolynomial (Option (Fin d)) k
493   letI : Algebra R B := fFin.toRingHom.toAlgebra
494   letI : IsScalarTower k R B := IsScalarTower.of_algebraMap_eq' (by
495     ext c; exact (fFin.commutes c).symm)
496   letI : Algebra.FiniteType k B := hfinite
497   letI : Algebra.EssFiniteType R B := Algebra.EssFiniteType.of_comp k R B
498   letI : Algebra.FormallyEtale R (Localization.AtPrime M) := hEtM
499   have hf' := hf
500   rw [hsource] at hf'
501   have hunitM' := hunitM
502   rw [hsource] at hunitM'
503   have hg' := hg
504   rw [hsource] at hg'
505   have hcanonical' := genericOpenArc_eq_of_source_eq
506     M f e g rhoA _ rho hf hunitM hg hsource hcanonical
507   rw [hqPre]
508   exact commonOpen_derivatives_of_pointColumns coeff qToB fFin hfinite
509     M f e g eM hEtM alpha hf' hunitM' hg' qT qU hq
510     psi hpsi hpsiEtale rho hground hcanonical'
511 
512 end Stafford38.Geometry.SameWitness
513 
514 end
515