Stafford38/Geometry/PaperActualDivisorTangent.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Stafford38.Geometry.PaperLaurentChartDerivation
3 public import Stafford38.Geometry.KaehlerVisibleDerivationFrame
4 public import Stafford38.Geometry.CanonicalNonconstantFiniteGradientProductionProof
5 public import Stafford38.Geometry.CanonicalVisibleDivisorFrameProduction
6 public import Stafford38.Geometry.RetainedPlaceConormalTransport
7 public import Stafford38.Geometry.RetainedGroundMapIdentification
8 public import Stafford38.Geometry.ProjectiveBoundaryFrameRank
9 public import Stafford38.Geometry.ProjectiveChartCoordinates
10 public import Stafford38.Geometry.ProjectiveTangentInclusion
11 public import Stafford38.Geometry.CompletedDVRPowerSeriesEquiv
12 
13 @[expose] public section
14 
15 /-!
16 # Tangent generators from an actual retained completed divisor chart
17 
18 This module connects residue-field derivations and the uniformizer derivation
19 to the dehomogenized Laurent point of a retained projective column.  The
20 projective column `q` is kept separate from its affine ratios `q_(i+1)/q_0`.
21 -/
22 
23 namespace Stafford38.Geometry.PaperActualDivisorTangent
24 
25 open IsLocalRing
26 open Stafford38.Geometry.AffineComponentCoordinateSplit
27 open Stafford38.Geometry.AffineConormalSpan
28 open Stafford38.Geometry.AsymptoticDivisorExistence
29 open Stafford38.Geometry.ComponentFunctionFieldBoundary
30 open Stafford38.Geometry.ComponentProjectiveClosure
31 open Stafford38.Geometry.ComponentProjectiveClosureNormalization
32 open Stafford38.Geometry.ContinuousPowerSeriesTangentFrame
33 open Stafford38.Geometry.FormalDivisorLaurentConormal
34 open Stafford38.Geometry.KaehlerVisibleDerivationFrame
35 open Stafford38.Geometry.LaurentConormalResidueExtension
36 open Stafford38.Geometry.PaperLaurentChartDerivation
37 open Stafford38.Geometry.ProjectiveBoundaryFrameRank
38 open Stafford38.Geometry.CanonicalNonconstantFiniteGradientProductionProof
39 open Stafford38.Geometry.CanonicalVisibleDivisorFrameProduction
40 open Stafford38.Geometry.CompletedDVRPowerSeries
41 open Stafford38.Geometry.CompletedDVRCoefficientSection
42 open Stafford38.Geometry.ProjectiveTangentInclusion
43 open Stafford38.Geometry.ProjectiveConormalDehomogenization
44 open Stafford38.Geometry.ProjectiveDivisorOrderGap
45 open Stafford38.GeometryPowerSeriesTangentLimit
46 open Stafford38.Geometry.RetainedGroundMapIdentification
47 open Stafford38.Geometry.RetainedPlaceConormalTransport
48 open Stafford38.Geometry.RetainedProjectiveCompletion
49 open Stafford38.Geometry.RetainedDVR
50 open Stafford38.Geometry.RelativeCoefficientDVR
51 open Stafford38.Geometry.RelativeRetainedBoundaryPlace
52 open Stafford38.GeometryFormalDivisorAxisLift
53 open Stafford38.GeometryFormalDivisorTangent
54 open Stafford38.GeometryResidueMinorSelection
55 open Stafford38.GeometryRetractionSpecialization
56 open Stafford38.GeometrySplitTangentMatrix
57 
58 noncomputable section
59 
60 universe u
61 
62 variable {k κ : Type u} [Field k] [Field κ] [Algebra k κ]
63   [CharZero k] [CharZero κ]
64 
65 set_option maxHeartbeats 4000000
66 set_option synthInstance.maxHeartbeats 400000
67 
68 /-! ## Identify the completed chart parameter -/
69 
70 /-- The actual chosen uniformizer of a retained divisor maps to the formal
71 series variable under its completed power-series chart. -/
72 theorem retainedToCompletedPowerSeries_chosenUniformizer
73     {F : Type u} [Field F] [Algebra k F] {x : F}
74     (W : Data k F x) :
75     letI : Algebra (CoordinateZeroLocalRing W.coefficientField) F :=
76       W.ambientAlgebra
77     let V := W.place.valuation.toSubring
78     letI : IsDiscreteValuationRing V := W.place.isDiscrete
79     letI : Algebra W.coefficientField V :=
80       (relativeCoefficientMap W.coefficientField W.place).toAlgebra
81     retainedToCompletedPowerSeries W (chosenUniformizer V) =
82       (PowerSeries.X : PowerSeries (ResidueField V)) := by
83   letI : Algebra (CoordinateZeroLocalRing W.coefficientField) F :=
84     W.ambientAlgebra
85   let V := W.place.valuation.toSubring
86   letI : IsDiscreteValuationRing V := W.place.isDiscrete
87   letI : Algebra W.coefficientField V :=
88     (relativeCoefficientMap W.coefficientField W.place).toAlgebra
89   apply W.completedPowerSeriesEquiv.injective
90   calc
91     W.completedPowerSeriesEquiv (retainedToCompletedPowerSeries W
92         (chosenUniformizer V)) =
93         algebraMap V (AdicCompletion (maximalIdeal V) V)
94           (chosenUniformizer V) := by
95       simp [retainedToCompletedPowerSeries]
96       rfl
97     _ = W.completedPowerSeriesEquiv PowerSeries.X := by
98       symm
99       change completedDVRPowerSeriesMap W.coefficientField V
100           (relativeResidue_isSeparable W.coefficientField W.place)
101           PowerSeries.X =
102         algebraMap V (AdicCompletion (maximalIdeal V) V)
103           (chosenUniformizer V)
104       rw [completedDVRPowerSeriesMap_X]
105       rfl
106 
107 /-! ## Preserve the differentiated column while constructing its split -/
108 
109 /-- Strengthened form of the normalized formal divisor-axis construction.
110 Besides the split matrix and annihilating row, it retains the exact identity
111 that expresses the normalized transverse column in terms of the actual
112 uniformizer derivative and the residue-derivation columns. -/
113 theorem exists_formalDivisorAxisLift_with_derivative_relation
114     {ι : Type*} {δ : Type*} [Fintype ι] [Fintype δ]
115     [DecidableEq ι] [DecidableEq δ]
116     (q : ι → PowerSeries κ)
117     (Z : Matrix ι δ (PowerSeries κ))
118     (rows : δ ↪ ι) (chart zero axis : ι)
119     (a b : ℕ) (u₀ u₁ : PowerSeries κ)
120     (hqchart : q chart = 1) (hZchart : ∀ j, Z chart j = 0)
121     (ha : 0 < a) (hab : a < b)
122     (hqzero : q zero = (PowerSeries.X : PowerSeries κ) ^ a * u₀)
123     (hu₀ : PowerSeries.constantCoeff u₀ ≠ 0)
124     (hZzero : ∀ j, ∃ w : PowerSeries κ,
125       Z zero j = (PowerSeries.X : PowerSeries κ) ^ a * w)
126     (hqaxis : q axis = (PowerSeries.X : PowerSeries κ) ^ b * u₁)
127     (hZaxis : ∀ j, ∃ w : PowerSeries κ,
128       Z axis j = (PowerSeries.X : PowerSeries κ) ^ b * w)
129     (hminor : PowerSeries.constantCoeff (selectedMinor Z rows).det ≠ 0) :
130     ∃ (lambda : δ → PowerSeries κ) (c : ℕ)
131       (tau : ι → PowerSeries κ)
132       (C : Matrix (FormalTangentColumn δ) ι (PowerSeries κ))
133       (ell : ι → PowerSeries κ),
134       c ≤ a - 1 ∧
135       (∀ i, PowerSeries.derivative (R := κ) (q i) - Z.mulVec lambda i =
136         (PowerSeries.X : PowerSeries κ) ^ c * tau i) ∧
137       (∃ i, PowerSeries.constantCoeff (tau i) ≠ 0) ∧
138       C * formalTangentMatrix q Z tau = 1 ∧
139       rowMul ell (formalTangentMatrix q Z tau) = 0 ∧
140       residueColumn ell = axisRow (k := κ) axis := by
141   obtain ⟨lambda, c, tau, C, ell, _hlambda, _hselected,
142       _htauchart, _htauselected, hc, hfactor, hprimitive,
143       _htauaxis, _haxiscolumns, hCB, hrow, hresidue⟩ :=
144     exists_formalDivisorAxisLift q Z rows chart zero axis a b u₀ u₁
145       hqchart hZchart ha hab hqzero hu₀ hZzero hqaxis hZaxis hminor
146   exact ⟨lambda, c, tau, C, ell, hc, hfactor, hprimitive, hCB,
147     hrow, hresidue⟩
148 
149 /-! ## Linear-algebra comparison in the actual affine chart -/
150 
151 abbrev zeroChartIndexEquiv {m : ℕ} :
152     Fin m ≃ ChartAffineIndex (Fin (m + 1)) 0 :=
153   Stafford38.Geometry.ProjectiveChartCoordinates.zerothChartEquiv (m := m)
154 
155 /-- A left inverse of the augmented projective matrix makes the affine
156 dehomogenizations of its nonposition columns independent in the `q₀` chart. -/
157 theorem linearIndependent_dehomogenizedTangentColumns
158     {m : ℕ} (hm : 0 < m) {δ : Type*} [Fintype δ]
159     (q : Fin (m + 1) → LaurentSeries κ)
160     (B : Matrix (Fin (m + 1)) δ (LaurentSeries κ))
161     (hq0 : q 0 ≠ 0)
162     (hinjective : Function.Injective
163       (augmentedProjectiveMatrix q B).mulVec) :
164     LinearIndependent (LaurentSeries κ)
165       (fun j ↦ dehomogenizedTangentColumn q (fun i ↦ B i j)) := by
166   let e := zeroChartIndexEquiv (m := m)
167   have hchart := linearIndependent_chartDehomogenizedTangentColumns
168     (chart := (0 : Fin (m + 1))) q B hq0 hinjective
169   let reindex : (ChartAffineIndex (Fin (m + 1)) 0 → LaurentSeries κ) →ₗ[
170       LaurentSeries κ] (Fin m → LaurentSeries κ) := {
171     toFun := fun f i ↦ f (e i)
172     map_add' := by intro f g; ext i; rfl
173     map_smul' := by intro a f; ext i; rfl }
174   have hReindex : Function.Injective reindex := by
175     intro f g h
176     funext i
177     have hi := congrFun h (e.symm i)
178     simpa [reindex] using hi
179   have hkernel : LinearMap.ker reindex = ⊥ :=
180     LinearMap.ker_eq_bot.mpr hReindex
181   have h := hchart.map' reindex hkernel
182   change LinearIndependent (LaurentSeries κ)
183     (fun j ↦ reindex (chartDehomogenizedTangentColumn 0 q
184       (fun i ↦ B i j))) at h
185   have hcomp :
186       (fun j ↦ reindex (chartDehomogenizedTangentColumn 0 q
187         (fun i ↦ B i j))) =
188         (fun j ↦ dehomogenizedTangentColumn q (fun i ↦ B i j)) := by
189     funext j
190     funext i
191     simp [reindex, e, zeroChartIndexEquiv,
192       chartDehomogenizedTangentColumn, dehomogenizedTangentColumn]
193   rw [hcomp] at h
194   exact h
195 
196 /-- Coefficientwise residue derivations preserve divisibility by a power of
197 the uniformizer. -/
198 theorem coefficientwiseDerivation_X_pow_mul
199     (D : Derivation k κ κ) (a : ℕ) (f : PowerSeries κ) :
200     coefficientwiseDerivation D
201         ((PowerSeries.X : PowerSeries κ) ^ a * f) =
202       (PowerSeries.X : PowerSeries κ) ^ a *
203         coefficientwiseDerivation D f := by
204   rw [Derivation.leibniz]
205   have hpow : coefficientwiseDerivation D
206       ((PowerSeries.X : PowerSeries κ) ^ a) = 0 := by
207     induction a with
208     | zero => simp [Derivation.map_one_eq_zero]
209     | succ a ih =>
210       rw [pow_succ, Derivation.leibniz, coefficientwiseDerivation_X, ih]
211       simp
212   rw [hpow]
213   simp [smul_eq_mul]
214 
215 /-- The finite-dimensional comparison needed to produce the actual affine
216 tangent inclusion from its geometric derivation vectors. -/
217 theorem tangentSpace_eq_dehomogenizedTangentSpan_of_actual_columns
218     {m d : ℕ} (hm : 0 < m)
219     (q : Fin (m + 1) → PowerSeries κ)
220     (Z : Matrix (Fin (m + 1)) (Fin d) (PowerSeries κ))
221     (tau : Fin (m + 1) → PowerSeries κ)
222     (C : Matrix (FormalTangentColumn (Fin d))
223       (Fin (m + 1)) (PowerSeries κ))
224     (hCB : C * formalTangentMatrix q Z tau = 1)
225     (hq0 : q 0 ≠ 0)
226     (I : Ideal (MvPolynomial (Fin m) k))
227     (hbase : ∀ f ∈ I,
228       MvPolynomial.eval₂ (algebraMap k (LaurentSeries κ))
229         (dehomogenizedPoint (laurentColumn q)) f = 0)
230     (D : Fin d → Derivation k κ κ)
231     (hZ : Z = coefficientwiseTangentMatrix q D)
232     (lambda : Fin d → PowerSeries κ) (c : ℕ)
233     (hfactor : ∀ i,
234       PowerSeries.derivative (R := κ) (q i) - Z.mulVec lambda i =
235         (PowerSeries.X : PowerSeries κ) ^ c * tau i)
236     (hbound : Module.finrank (LaurentSeries κ)
237       (zariskiTangentSpace (dehomogenizedPoint (laurentColumn q))
238         (I.map (MvPolynomial.map (algebraMap k (LaurentSeries κ))))) ≤ d + 1) :
239     dehomogenizedTangentSpan (laurentColumn q)
240         (laurentNonpositionTangentMatrix Z tau) =
241       zariskiTangentSpace (dehomogenizedPoint (laurentColumn q))
242         (I.map (MvPolynomial.map (algebraMap k (LaurentSeries κ)))) := by
243   let L := LaurentSeries κ
244   let qL := laurentColumn q
245   let B := laurentNonpositionTangentMatrix Z tau
246   let T : Submodule L (AffineTangentVector L m) :=
247     zariskiTangentSpace (dehomogenizedPoint qL)
248       (I.map (MvPolynomial.map (algebraMap k L)))
249   let S : Submodule L (AffineTangentVector L m) :=
250     dehomogenizedTangentSpan qL B
251   have hZtan (j : Fin d) :
252       dehomogenizedTangentColumn qL (fun i ↦ B i (Sum.inl j)) ∈ T := by
253     have hj := coefficientwise_chartVector_mem_zariskiTangentSpace
254       I q hq0 (D j) hbase
255     have hcol : (fun i ↦ B i (Sum.inl j)) =
256         laurentColumn (fun i ↦ coefficientwiseDerivation (D j) (q i)) := by
257       funext i
258       simp [B, laurentNonpositionTangentMatrix, hZ,
259         coefficientwiseTangentMatrix, laurentColumn,
260         LaurentSeries.coe_algebraMap]
261     rw [hcol]
262     exact hj
263   have hUtan :
264       dehomogenizedTangentColumn qL
265         (laurentColumn fun i ↦ PowerSeries.derivative (R := κ) (q i)) ∈ T := by
266     have h := uniformizer_chartVector_mem_zariskiTangentSpace
267       (k := k) I q hq0 hbase
268     exact h
269   let phi : (Fin (m + 1) → L) →ₗ[L] (Fin m → L) := {
270     toFun := fun w ↦ dehomogenizedTangentColumn qL w
271     map_add' := by
272       intro v w
273       funext i
274       simp [dehomogenizedTangentColumn, Pi.add_apply]
275       ring
276     map_smul' := by
277       intro a w
278       funext i
279       simp [dehomogenizedTangentColumn, Pi.smul_apply, smul_eq_mul]
280       ring }
281   let qDeriv : Fin (m + 1) → L :=
282     fun i ↦ algebraMap (PowerSeries κ) L (PowerSeries.derivative (R := κ) (q i))
283   let tauL : Fin (m + 1) → L :=
284     fun i ↦ algebraMap (PowerSeries κ) L (tau i)
285   let lambdaL : Fin d → L :=
286     fun j ↦ algebraMap (PowerSeries κ) L (lambda j)
287   let zcol (j : Fin d) : Fin (m + 1) → L :=
288     fun i ↦ algebraMap (PowerSeries κ) L (Z i j)
289   let Xc : L := algebraMap (PowerSeries κ) L
290     ((PowerSeries.X : PowerSeries κ) ^ c)
291   have hmul (i : Fin (m + 1)) :
292       algebraMap (PowerSeries κ) L (Z.mulVec lambda i) =
293         ∑ j, lambdaL j * zcol j i := by
294     simp [Matrix.mulVec, dotProduct, lambdaL, zcol, map_sum,
295       map_mul, mul_comm]
296   have hfactorL : qDeriv - (∑ j, lambdaL j • zcol j) = Xc • tauL := by
297     funext i
298     simp only [Pi.sub_apply, Pi.smul_apply, smul_eq_mul, Finset.sum_apply]
299     have hi := congrArg (algebraMap (PowerSeries κ) L) (hfactor i)
300     calc
301       qDeriv i - (∑ j, lambdaL j • zcol j i) =
302           algebraMap (PowerSeries κ) L (PowerSeries.derivative (R := κ) (q i)) -
303             algebraMap (PowerSeries κ) L (Z.mulVec lambda i) := by
304         simp only [qDeriv, Finset.sum_apply, Pi.smul_apply, smul_eq_mul]
305         rw [hmul]
306       _ = algebraMap (PowerSeries κ) L
307           (PowerSeries.derivative (R := κ) (q i) - Z.mulVec lambda i) := by
308         rw [map_sub]
309       _ = Xc * tauL i := by
310         rw [hfactor i, map_mul]
311   have hsumtan : phi (∑ j, lambdaL j • zcol j) ∈ T := by
312     rw [map_sum]
313     apply T.sum_mem
314     intro j hj
315     have hcolumn : phi (zcol j) =
316         dehomogenizedTangentColumn qL (fun i ↦ B i (Sum.inl j)) := by
317       rfl
318     rw [phi.map_smul, hcolumn]
319     exact T.smul_mem _ (hZtan j)
320   have hXtau : Xc • phi tauL ∈ T := by
321     have hUtan' : phi qDeriv ∈ T := by
322       change dehomogenizedTangentColumn (laurentColumn q)
323         (laurentColumn (fun i ↦ PowerSeries.derivative (R := κ) (q i))) ∈ T
324       exact hUtan
325     have hdiff := T.sub_mem hUtan' hsumtan
326     have hdiff' : phi (qDeriv - ∑ j, lambdaL j • zcol j) ∈ T := by
327       simpa [phi.map_sub] using hdiff
328     rw [hfactorL] at hdiff'
329     simpa [phi.map_smul] using hdiff'
330   have hXc : Xc ≠ 0 := by
331     have hpow : PowerSeries.X ^ c ≠ 0 :=
332       pow_ne_zero c (PowerSeries.X_ne_zero (R := κ))
333     simpa [Xc, LaurentSeries.coe_algebraMap] using
334       (HahnSeries.ofPowerSeries_injective (Γ := ℤ)).ne hpow
335   have htau : phi tauL ∈ T := by
336     have h := T.smul_mem Xc⁻¹ hXtau
337     have hx : Xc⁻¹ * Xc = 1 := inv_mul_cancel₀ hXc
338     simpa [smul_smul, hx] using h
339   have hSleT : S ≤ T := by
340     change dehomogenizedTangentSpan qL B ≤ T
341     rw [dehomogenizedTangentSpan]
342     apply Submodule.span_le.mpr
343     rintro _ ⟨j, rfl⟩
344     rcases j with j | j
345     · simpa [B, laurentNonpositionTangentMatrix,
346         LaurentSeries.coe_algebraMap] using hZtan j
347     · change dehomogenizedTangentColumn qL
348         (fun i ↦ B i (Sum.inr j)) ∈ T
349       have hcol : (fun i ↦ B i (Sum.inr j)) = tauL := by
350         funext i
351         change (HahnSeries.ofPowerSeries ℤ κ (tau i)) =
352           algebraMap (PowerSeries κ) L (tau i)
353         rfl
354       rw [hcol]
355       change dehomogenizedTangentColumn qL tauL ∈ T at htau
356       exact htau
357   let CL : Matrix (FormalTangentColumn (Fin d))
358       (Fin (m + 1)) L :=
359     fun i j ↦ algebraMap (PowerSeries κ) L (C i j)
360   let aug := augmentedProjectiveMatrix qL B
361   have haug : aug = fun i j ↦
362       algebraMap (PowerSeries κ) L (formalTangentMatrix q Z tau i j) := by
363     ext i j
364     rcases j with _ | j
365     · rfl
366     · rcases j with j | _
367       · rfl
368       · rfl
369   have hleft : CL * aug = 1 := by
370     apply Matrix.ext
371     intro i j
372     have h := congrArg (algebraMap (PowerSeries κ) L)
373       (congrFun (congrFun hCB i) j)
374     simp only [Matrix.mul_apply, map_sum, map_mul] at h
375     change (∑ a, CL i a * aug a j) = (1 : Matrix _ _ L) i j
376     rw [Matrix.one_apply]
377     simpa [CL, haug, LaurentSeries.coe_algebraMap,
378       Matrix.one_apply, map_one] using h
379   have hinjective : Function.Injective aug.mulVec := by
380     intro v w hvw
381     have hmulv : CL.mulVec (aug.mulVec v) = v := by
382       have h := congrArg (fun M : Matrix _ _ L ↦ M.mulVec v) hleft
383       calc
384         CL.mulVec (aug.mulVec v) = (CL * aug).mulVec v :=
385           Matrix.mulVec_mulVec v CL aug
386         _ = v := by simpa [Matrix.one_mulVec] using h
387     have hmulw : CL.mulVec (aug.mulVec w) = w := by
388       have h := congrArg (fun M : Matrix _ _ L ↦ M.mulVec w) hleft
389       calc
390         CL.mulVec (aug.mulVec w) = (CL * aug).mulVec w :=
391           Matrix.mulVec_mulVec w CL aug
392         _ = w := by simpa [Matrix.one_mulVec] using h
393     calc
394       v = CL.mulVec (aug.mulVec v) := hmulv.symm
395       _ = CL.mulVec (aug.mulVec w) := congrArg CL.mulVec hvw
396       _ = w := hmulw
397   have hli := linearIndependent_dehomogenizedTangentColumns
398     (κ := κ) (m := m) (δ := Fin d ⊕ Unit) hm qL B
399       (by simpa [qL] using laurentColumn_ne_zero_of_ne_zero q hq0) hinjective
400   have hdimS : Module.finrank L S = d + 1 := by
401     change Module.finrank L
402       (Submodule.span L (Set.range fun j : Fin d ⊕ Unit ↦
403         dehomogenizedTangentColumn qL (fun i ↦ B i j))) = d + 1
404     rw [finrank_span_eq_card hli]
405     simp
406   have hSle : Module.finrank L S ≤ Module.finrank L T :=
407     Submodule.finrank_mono hSleT
408   have hTle : Module.finrank L T ≤ Module.finrank L S := by
409     simpa [T, S, hdimS] using hbound
410   have hfin : Module.finrank L S = Module.finrank L T := Nat.le_antisymm hSle hTle
411   have heq : S = T := Submodule.eq_of_le_of_finrank_eq hSleT hfin
412   exact heq
413 
414 /-! ## Equations at the actual retained generic point -/
415 
416 /-- A component equation remains zero after any ring homomorphism from its
417 function field.  The retained Laurent lift specializes this lemma using the
418 explicit identity between affine component coordinates and the ratios of the
419 completed projective column. -/
420 theorem component_equation_eval₂_vanish_after_map
421     {k : Type u} [Field k] {m : ℕ}
422     (P : PrimeSpectrum (MvPolynomial (Fin m) k))
423     {R : Type*} [CommSemiring R]
424     (lift : ComponentFractionField P →+* R)
425     {f : MvPolynomial (Fin m) k} (hf : f ∈ P.asIdeal) :
426     MvPolynomial.eval₂
427         (lift.comp (algebraMap k (ComponentFractionField P)))
428         (lift ∘ componentCoordinate P) f = 0 := by
429   have hgeneric : MvPolynomial.eval₂ (algebraMap k (ComponentFractionField P))
430       (componentCoordinate P) f = 0 := by
431     rw [← componentAffineGenericPointMap_eq_eval₂]
432     exact componentAffineGenericPointMap_eq_zero_of_mem P hf
433   have hmap := MvPolynomial.eval₂_comp_left lift
434     (algebraMap k (ComponentFractionField P)) (componentCoordinate P) f
435   rw [hgeneric, map_zero] at hmap
436   exact hmap.symm
437 
438 
439 
440 /-- The normalized matrix constructed from actual residue derivations yields
441 an official one-row conormal datum.  Its tangent inclusion is proved from the
442 derivation vectors and the independent dimension bound; it is not an input.
443 The component prime `P` transfers conormality to the reduced ideal `I` at the
444 same generic point. -/
445 theorem exists_regularizedOneRowConormalData_of_actual_columns
446     {m : ℕ} (hm : 0 < m)
447     (I : Ideal (MvPolynomial (Fin m) k)) (hI : I.IsRadical)
448     (P : PrimeSpectrum (MvPolynomial (Fin m) k))
449     (hP : P.asIdeal ∈ I.minimalPrimes)
450     (q : Fin (m + 1) → PowerSeries κ)
451     (Z : Matrix (Fin (m + 1)) (Fin (Module.finrank κ (Ω[κ⁄k])))
452       (PowerSeries κ))
453     (rows : Fin (Module.finrank κ (Ω[κ⁄k])) ↪ Fin (m + 1))
454     (chart : Fin (m + 1))
455     (a b : ℕ) (u₀ u₁ : PowerSeries κ)
456     (D : Fin (Module.finrank κ (Ω[κ⁄k])) → Derivation k κ κ)
457     (hZ : Z = coefficientwiseTangentMatrix q D)
458     (hqchart : q chart = 1)
459     (ha : 0 < a) (hab : a < b)
460     (hqzero : q 0 = (PowerSeries.X : PowerSeries κ) ^ a * u₀)
461     (hu₀ : PowerSeries.constantCoeff u₀ ≠ 0)
462     (hqaxis : q (Fin.succ ⟨0, hm⟩) =
463       (PowerSeries.X : PowerSeries κ) ^ b * u₁)
464     (hminor : PowerSeries.constantCoeff (selectedMinor Z rows).det ≠ 0)
465     (hbaseP : ∀ f ∈ P.asIdeal,
466       MvPolynomial.eval₂ (algebraMap k (LaurentSeries κ))
467         (dehomogenizedPoint (laurentColumn q)) f = 0)
468     (hbound : Module.finrank (LaurentSeries κ)
469       (zariskiTangentSpace (dehomogenizedPoint (laurentColumn q))
470         (P.asIdeal.map
471           (MvPolynomial.map (algebraMap k (LaurentSeries κ))))) ≤
472         Module.finrank κ (Ω[κ⁄k]) + 1)
473     (hy : ∀ f,
474       MvPolynomial.eval (dehomogenizedPoint (laurentColumn q))
475         (MvPolynomial.map (algebraMap k (LaurentSeries κ)) f) = 0 ↔
476           f ∈ P.asIdeal) :
477     Nonempty (RegularizedOneRowConormalData (k := k) (K := κ) hm I q) := by
478   classical
479   let axis : Fin (m + 1) := Fin.succ ⟨0, hm⟩
480   let d := Module.finrank κ (Ω[κ⁄k])
481   let L := LaurentSeries κ
482   let qL := laurentColumn q
483   let y := dehomogenizedPoint qL
484   let Iext := I.map (MvPolynomial.map (algebraMap k L))
485   let Pext := P.asIdeal.map (MvPolynomial.map (algebraMap k L))
486   have hu₀ne : u₀ ≠ 0 := by
487     intro h
488     apply hu₀
489     simp [h]
490   have hq0 : q 0 ≠ 0 := by
491     rw [hqzero]
492     exact mul_ne_zero (pow_ne_zero a (PowerSeries.X_ne_zero (R := κ))) hu₀ne
493   have hZchart : ∀ j, Z chart j = 0 := by
494     intro j
495     rw [hZ, coefficientwiseTangentMatrix]
496     simp [hqchart]
497   have hZzero : ∀ j, ∃ w : PowerSeries κ,
498       Z 0 j = (PowerSeries.X : PowerSeries κ) ^ a * w := by
499     intro j
500     refine ⟨coefficientwiseDerivation (D j) u₀, ?_⟩
501     rw [hZ, coefficientwiseTangentMatrix, hqzero]
502     exact coefficientwiseDerivation_X_pow_mul (D j) a u₀
503   have hZaxis : ∀ j, ∃ w : PowerSeries κ,
504       Z axis j = (PowerSeries.X : PowerSeries κ) ^ b * w := by
505     intro j
506     refine ⟨coefficientwiseDerivation (D j) u₁, ?_⟩
507     rw [hZ, coefficientwiseTangentMatrix, hqaxis]
508     exact coefficientwiseDerivation_X_pow_mul (D j) b u₁
509   obtain ⟨lambda, c, tau, C, ell, hc, hfactor, _hprimitive, hCB,
510       hrow, hresidue⟩ :=
511     exists_formalDivisorAxisLift_with_derivative_relation
512       q Z rows chart 0 axis a b u₀ u₁ hqchart hZchart ha hab
513       hqzero hu₀ hZzero hqaxis hZaxis hminor
514   have hbase : ∀ f ∈ P.asIdeal,
515       MvPolynomial.eval₂ (algebraMap k L) y f = 0 := by
516     intro f hf
517     simpa [L, y, qL] using hbaseP f hf
518   have htangentEq := tangentSpace_eq_dehomogenizedTangentSpan_of_actual_columns
519     (κ := κ) hm q Z tau C hCB hq0 P.asIdeal hbase D hZ
520       lambda c hfactor hbound
521   have htangent :
522       zariskiTangentSpace y Pext ≤
523         dehomogenizedTangentSpan qL
524           (laurentNonpositionTangentMatrix Z tau) :=
525     by
526       change zariskiTangentSpace y Pext ≤ _
527       rw [← htangentEq]
528   have hrowL :=
529     laurentNonposition_rowMul_eq_zero_of_formalTangent_rowMul q ell Z tau hrow
530   have hdot := laurentColumn_dot_eq_zero_of_formalTangent_rowMul
531     q ell Z tau hrow
532   have hq0L : qL 0 ≠ 0 := by
533     exact laurentColumn_ne_zero_of_ne_zero q hq0
534   have hconormalP :=
535     coordinateCovector_mem_affineConormalSpace_of_zariski_le_span
536       Pext qL (laurentColumn ell)
537       (laurentNonpositionTangentMatrix Z tau) hq0L hdot hrowL htangent
538   have hconormalI :=
539     affineConormalSpace_map_minimalPrime_le I P.asIdeal hI hP y hy hconormalP
540   have hground : groundLaurentMap (k := k) (K := κ) =
541       algebraMap k L := by
542     ext c
543     rfl
544   have hPker : Pext ≤ RingHom.ker (MvPolynomial.eval y) := by
545     rw [Ideal.map_le_iff_le_comap]
546     intro f hf
547     rw [Ideal.mem_comap, RingHom.mem_ker, MvPolynomial.eval_map]
548     exact hbaseP f hf
549   have hIleP : Iext ≤ Pext := by
550     exact Ideal.map_mono hP.1.2
551   have hbaseI : Iext ≤ RingHom.ker (MvPolynomial.eval y) := hIleP.trans hPker
552   have hresidueTail :
553       residueColumn (fun i : Fin m ↦ ell i.succ) =
554         (fun i : Fin m ↦ if i = ⟨0, hm⟩ then 1 else 0) := by
555     calc
556       residueColumn (fun i : Fin m ↦ ell i.succ) =
557           (fun i : Fin m ↦ residueColumn ell i.succ) := residueColumn_tail ell
558       _ = (fun i : Fin m ↦ axisRow (k := κ) axis i.succ) := by
559         rw [hresidue]
560       _ = (fun i : Fin m ↦ if i = ⟨0, hm⟩ then 1 else 0) := by
561         funext i
562         by_cases hi : i = ⟨0, hm⟩
563         · subst i
564           simp [axis, axisRow]
565         · have hne : i.succ ≠ Fin.succ ⟨0, hm⟩ := by
566             intro h
567             exact hi (Fin.succ_injective m h)
568           change axisRow (Fin.succ ⟨0, hm⟩) i.succ = _
569           rw [axisRow_apply_of_ne hne, if_neg hi]
570   refine ⟨{
571     ell := ell
572     q_origin_ne := hq0
573     projective_annihilation := hdot
574     base_vanish := ?_
575     conormal := hconormalI
576     residue_axis := hresidueTail }⟩
577   intro f hf
578   exact RingHom.mem_ker.mp (hbaseI hf)
579 
580 end
581 
582 end Stafford38.Geometry.PaperActualDivisorTangent
583