Stafford38/Geometry/GeneralTangentLimitCriterion.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Stafford38.Geometry.ProjectiveConormalDehomogenization
3 public import Stafford38.Geometry.LaurentConormalDirection
4 public import Stafford38.Geometry.SmoothAffineConormal
5 public import Stafford38.Geometry.ConormalScalarExtensionVanishing
6 public import Stafford38.Geometry.SmoothConormalFibreVanishing
7 public import Stafford38.Geometry.ProjectiveConormalDirections
8 public import Stafford38.Geometry.FormalDivisorLaurentConormal
9 public import Stafford38.Geometry.GeneralTangentLatticePresentation
10 public import Stafford38.Geometry.LocalizedProjectiveChartTransition
11 
12 @[expose] public section
13 
14 /-!
15 # The split-lattice tangent-limit calculation
16 
17 This file records the tangent-limit criterion after the affine-chart and
18 tangent-lattice dictionaries have been made explicit.  It uses no
19 normalization theorem.  A
20 power-series matrix is the lattice of projective tangent columns.  A left
21 inverse is the direct-summand certificate.  The axis condition is imposed on
22 the reduced lattice, and the annihilator is constructed by the retraction
23 correction; it is not an input.
24 
25 The Laurent-valued smooth equation-conormal direction hull is transported to
26 the ground-field projective closure by the existing scalar-extension and
27 smooth-fibre vanishing theorems.  `Input` is the internal split-matrix kernel.
28 The paper-facing `DirectSummandInput` instead takes the formal arc and the
29 actual complemented tangent lattice.  The theorem below constructs the
30 matrix presentation and proves the projective-closure and tangent-chart
31 dictionaries before applying that kernel.
32 -/
33 
34 namespace Stafford38.Geometry.GeneralTangentLimitCriterion
35 
36 open Stafford38.Characteristic
37 open Stafford38.Geometry.AffineConormalClosure
38 open Stafford38.Geometry.AffineConormalSpan
39 open Stafford38.Geometry.ConormalScalarExtensionVanishing
40 open Stafford38.Geometry.LaurentConormalDirection
41 open Stafford38.Geometry.ProjectiveConormalDehomogenization
42 open Stafford38.Geometry.ProjectiveConormalDirections
43 open Stafford38.Geometry.ScalarExtensionPoints
44 open Stafford38.Geometry.SmoothAffineConormal
45 open Stafford38.Geometry.SmoothConormalFibreVanishing
46 open Stafford38.Geometry.FormalDivisorLaurentConormal
47 open Stafford38.Geometry.GeneralTangentLatticePresentation
48 open Stafford38.Geometry.LocalizedProjectiveChartTransition
49 open Stafford38.Geometry.ProjectiveEquationFormalChart
50 open Stafford38.GeometryPowerSeriesTangentLimit
51 open Stafford38.GeometryRetractionSpecialization
52 
53 noncomputable section
54 
55 variable {k : Type*} [Field k]
56 
57 /-- The scalar-extended smooth equation-conormal phase locus used by the
58 Laurent specialization theorem.  The smoothness predicate is the genuine
59 `SmoothAffinePoint` predicate; it is not a dimension label or a placeholder.
60 -/
61 def smoothEquationConormalLocus {n : ℕ}
62     (I : Ideal (MvPolynomial (Fin n) k)) :
63     Set (PhaseVar n → LaurentSeries k) :=
64   {q | q ∈ equationConormalLocus
65       (I.map (scalarPolynomialMap
66         (k := k) (K := LaurentSeries k) (Fin n))) ∧
67     SmoothAffinePoint
68       (I.map (scalarPolynomialMap
69         (k := k) (K := LaurentSeries k) (Fin n)))
70       (fun i ↦ q (Sum.inl i))}
71 
72 /-! ## Coordinate-free statement of the paper hypotheses -/
73 
74 /-- Coordinatewise extension of scalars on a finite coordinate module. -/
75 def extendColumn {R K : Type*} [CommSemiring R] [CommSemiring K]
76     [Algebra R K] {ι : Type*} :
77     (ι → R) →ₛₗ[algebraMap R K] (ι → K) where
78   toFun v i := algebraMap R K (v i)
79   map_add' x y := by ext i; simp
80   map_smul' a x := by ext i; simp
81 
82 /-- The ordinary scalar extension of a lattice, presented as the span of its
83 coordinatewise images.  This definition avoids choosing a basis. -/
84 def genericFibre {R K : Type*} [CommSemiring R] [CommSemiring K]
85     [Algebra R K] {ι : Type*} (L : Submodule R (ι → R)) :
86     Submodule K (ι → K) :=
87   Submodule.span K (extendColumn (R := R) (K := K) '' (L : Set (ι → R)))
88 
89 /-- The derivative of the zeroth affine chart at a homogeneous point. -/
90 def dehomogenizedTangentLinearMap {K : Type*} [Field K] {n : ℕ}
91     (q : Fin (n + 1) → K) :
92     (Fin (n + 1) → K) →ₗ[K] (Fin n → K) where
93   toFun w := dehomogenizedTangentColumn q w
94   map_add' x y := by
95     ext i
96     simp [dehomogenizedTangentColumn]
97     ring
98   map_smul' a x := by
99     ext i
100     simp [dehomogenizedTangentColumn]
101     ring
102 
103 /-- The affine cone over the embedded projective tangent plane in the chart
104 `q 0 ≠ 0`: it is the inverse image of the affine tangent space under the
105 chart derivative.  Its radial kernel contains `q`. -/
106 def projectiveTangentCone {K : Type*} [Field K] {n : ℕ}
107     (q : Fin (n + 1) → K) (T : Submodule K (Fin n → K)) :
108     Submodule K (Fin (n + 1) → K) :=
109   T.comap (dehomogenizedTangentLinearMap q)
110 
111 /-- Equation-level membership in the projective closure in the zeroth chart.
112 The equations are the standard homogenizations of every affine equation, so
113 this is the ordinary homogeneous-equation presentation of the closure. -/
114 def projectiveClosureAtZero {K : Type*} [Field K] {n : ℕ}
115     (I : Ideal (MvPolynomial (Fin n) K))
116     (q : Fin (n + 1) → K) : Prop :=
117   ∀ f ∈ I, MvPolynomial.eval q (homogenizeAtZero f) = 0
118 
119 /-- In the nonzero zeroth chart, the homogeneous-equation presentation of the
120 projective closure is equivalent to membership in the original affine zero
121 locus. -/
122 theorem projectiveClosureAtZero_iff {K : Type*} [Field K] {n : ℕ}
123     (I : Ideal (MvPolynomial (Fin n) K))
124     (q : Fin (n + 1) → K) (hq0 : q 0 ≠ 0) :
125     projectiveClosureAtZero I q ↔
126       dehomogenizedPoint q ∈ MvPolynomial.zeroLocus K I := by
127   constructor
128   · intro h f hf
129     have heval := eval_projectiveDehomogenize_eq_zero_of_homogeneous
130       (homogenizeAtZero f) f.totalDegree
131       (homogenizeAtZero_isHomogeneous f) q hq0 (h f hf)
132     simpa only [projectiveDehomogenize_homogenizeAtZero,
133       MvPolynomial.aeval_eq_eval] using heval
134   · intro h f hf
135     have hnormalized :
136         MvPolynomial.eval (normalizedProjectivePoint q (q 0))
137           (homogenizeAtZero f) = 0 := by
138       rw [normalizedProjectivePoint_eq_chartPoint q hq0,
139         ← eval_projectiveDehomogenize,
140         projectiveDehomogenize_homogenizeAtZero]
141       exact h f hf
142     rw [eval_eq_pow_mul_eval_normalizedProjectivePoint
143       (homogenizeAtZero f) f.totalDegree
144       (homogenizeAtZero_isHomogeneous f) q (q 0) hq0,
145       hnormalized, mul_zero]
146 
147 /-- A formal projective arc represented by power-series coordinates.  The
148 unit-coordinate condition makes the tuple a morphism to projective space;
149 the second field is membership in the homogeneous-equation closure after
150 passing to the generic Laurent point. -/
151 def FormalProjectiveArcInClosure {n : ℕ}
152     (I : Ideal (MvPolynomial (Fin n) k))
153     (q : Fin (n + 1) → PowerSeries k) : Prop :=
154   (∃ i, IsUnit (q i)) ∧
155     projectiveClosureAtZero
156       (I.map (scalarPolynomialMap
157         (k := k) (K := LaurentSeries k) (Fin n)))
158       (laurentColumn q)
159 
160 /-- Exact chart dictionary for `FormalProjectiveArcInClosure`: its
161 homogeneous projective equations are equivalent to the affine equations at
162 the Laurent generic point, while the unit-coordinate condition records that
163 the tuple is a genuine formal projective arc. -/
164 theorem formalProjectiveArcInClosure_iff {n : ℕ}
165     (I : Ideal (MvPolynomial (Fin n) k))
166     (q : Fin (n + 1) → PowerSeries k)
167     (hq0 : q 0 ≠ 0) :
168     FormalProjectiveArcInClosure I q ↔
169       (∃ i, IsUnit (q i)) ∧
170         dehomogenizedPoint (laurentColumn q) ∈
171           MvPolynomial.zeroLocus (LaurentSeries k)
172             (I.map (scalarPolynomialMap
173               (k := k) (K := LaurentSeries k) (Fin n))) := by
174   rw [FormalProjectiveArcInClosure,
175     projectiveClosureAtZero_iff]
176   exact laurentColumn_ne_zero_of_ne_zero q hq0
177 
178 /-- The columns of a matrix presentation span the generic fibre of the
179 original lattice after scalar extension. -/
180 theorem genericFibre_eq_span_matrixColumns
181     {R K : Type*} [CommRing R] [Field K] [Algebra R K]
182     {ι κ : Type*} [Fintype κ]
183     (L : Submodule R (ι → R)) (B : Matrix ι κ R)
184     (hspan : Submodule.span R (Set.range fun j => fun i => B i j) = L) :
185     genericFibre (K := K) L =
186       Submodule.span K (Set.range fun j => fun i =>
187         algebraMap R K (B i j)) := by
188   let f := extendColumn (R := R) (K := K) (ι := ι)
189   let columns : κ → (ι → R) := fun j i => B i j
190   apply le_antisymm
191   · apply Submodule.span_le.mpr
192     rintro _ ⟨x, hx, rfl⟩
193     have hxspan : x ∈ Submodule.span R (Set.range columns) := by
194       rw [hspan]
195       exact hx
196     obtain ⟨c, hc⟩ :=
197       (Submodule.mem_span_range_iff_exists_fun R).mp hxspan
198     apply (Submodule.mem_span_range_iff_exists_fun K).mpr
199     refine ⟨fun j => algebraMap R K (c j), ?_⟩
200     apply funext
201     intro i
202     simp only [Finset.sum_apply, Pi.smul_apply, smul_eq_mul]
203     have hi : (∑ j, c j * B i j) = x i := by
204       simpa only [columns, Finset.sum_apply, Pi.smul_apply,
205         smul_eq_mul] using congrFun hc i
206     change _ = algebraMap R K (x i)
207     simpa only [map_sum, map_mul] using congrArg (algebraMap R K) hi
208   · apply Submodule.span_le.mpr
209     rintro _ ⟨j, rfl⟩
210     apply Submodule.subset_span
211     refine ⟨columns j, ?_, rfl⟩
212     rw [← hspan]
213     exact Submodule.subset_span ⟨j, rfl⟩
214 
215 /-- The chart derivative is onto whenever the chart denominator is nonzero. -/
216 private theorem dehomogenizedTangentLinearMap_surjective
217     {K : Type*} [Field K] {n : ℕ}
218     (q : Fin (n + 1) → K) (hq0 : q 0 ≠ 0) :
219     Function.Surjective (dehomogenizedTangentLinearMap q) := by
220   intro v
221   refine ⟨Fin.cases 0 (fun i => v i * q 0), ?_⟩
222   ext i
223   change (v i * q 0 * q 0 - q i.succ * 0) / q 0 ^ 2 = v i
224   field_simp
225   ring
226 
227 /-- If the scalar-extended lattice is the projective tangent cone, any matrix
228 whose columns span that lattice contains the projective point and its chart
229 derivatives span exactly the affine tangent space.  This is the dictionary
230 formerly exposed as the separate `hposition` and `htangent` inputs. -/
231 private theorem matrix_tangent_dictionary
232     {K : Type*} [Field K] {n : ℕ} {κ : Type*} [Fintype κ]
233     (q : Fin (n + 1) → K) (hq0 : q 0 ≠ 0)
234     (T : Submodule K (Fin n → K))
235     (B : Matrix (Fin (n + 1)) κ K)
236     (hspan : Submodule.span K
237       (Set.range fun j => fun i => B i j) = projectiveTangentCone q T) :
238     (∃ c : κ → K, ∀ i, q i = ∑ j, B i j * c j) ∧
239       dehomogenizedTangentSpan q B = T := by
240   have hqcone : q ∈ projectiveTangentCone q T := by
241     change dehomogenizedTangentColumn q q ∈ T
242     convert T.zero_mem using 1
243     ext i
244     simp [dehomogenizedTangentColumn]
245   have hqspan : q ∈ Submodule.span K
246       (Set.range fun j => fun i => B i j) := by
247     rw [hspan]
248     exact hqcone
249   obtain ⟨c, hc⟩ :=
250     (Submodule.mem_span_range_iff_exists_fun K).mp hqspan
251   refine ⟨⟨c, fun i => ?_⟩, ?_⟩
252   · have hi := congrFun hc.symm i
253     simpa [Finset.sum_apply, smul_eq_mul, mul_comm] using hi
254   let d := dehomogenizedTangentLinearMap q
255   calc
256     dehomogenizedTangentSpan q B =
257         (Submodule.span K (Set.range fun j => fun i => B i j)).map d := by
258           rw [dehomogenizedTangentSpan, Submodule.map_span]
259           congr 1
260           ext v
261           simp only [Set.mem_image, Set.mem_range]
262           constructor
263           · rintro ⟨j, rfl⟩
264             exact ⟨fun i => B i j, ⟨j, rfl⟩, rfl⟩
265           · rintro ⟨_, ⟨j, rfl⟩, rfl⟩
266             exact ⟨j, rfl⟩
267     _ = (projectiveTangentCone q T).map d := by rw [hspan]
268     _ = T := by
269       exact Submodule.map_comap_eq_of_surjective
270         (dehomogenizedTangentLinearMap_surjective q hq0) T
271 
272 /-- The data appearing in the paper's tangent-limit hypothesis, expressed in
273 the affine chart of the projective arc.  `hposition` says that the generic
274 projective point belongs to the cone spanned by the generic tangent lattice;
275 the tangent-space equality is the exact smooth affine tangent dictionary.
276 The cardinality equation records the advertised rank `dimY + 1`.
277 -/
278 structure Input {n dimY : ℕ} {κ : Type*} [Fintype κ] [DecidableEq κ]
279     (I : Ideal (MvPolynomial (Fin n) k))
280     (q : Fin (n + 1) → PowerSeries k)
281     (B : Matrix (Fin (n + 1)) κ (PowerSeries k)) where
282   axis : Fin n
283   C : Matrix κ (Fin (n + 1)) (PowerSeries k)
284   hprime : I.IsPrime
285   hsplit : C * B = 1
286   hrank : Fintype.card κ = dimY + 1
287   hq0 : q 0 ≠ 0
288   hbase : ∀ f ∈ I.map (scalarPolynomialMap
289       (k := k) (K := LaurentSeries k) (Fin n)),
290       MvPolynomial.eval (dehomogenizedPoint (laurentColumn q)) f = 0
291   hsmooth : SmoothAffinePoint
292       (I.map (scalarPolynomialMap
293         (k := k) (K := LaurentSeries k) (Fin n)))
294       (dehomogenizedPoint (laurentColumn q))
295   hposition : ∃ c : κ → LaurentSeries k, ∀ i,
296       laurentColumn q i = ∑ j, algebraMap (PowerSeries k) (LaurentSeries k)
297         (B i j) * c j
298   htangent : dehomogenizedTangentSpan (laurentColumn q)
299       (fun i j ↦ algebraMap (PowerSeries k) (LaurentSeries k) (B i j)) =
300       zariskiTangentSpace (dehomogenizedPoint (laurentColumn q))
301         (I.map (scalarPolynomialMap
302           (k := k) (K := LaurentSeries k) (Fin n)))
303   haxis : ∀ j, PowerSeries.constantCoeff (B axis.succ j) = 0
304 
305 /-- The hypotheses of the paper's tangent-limit lemma, with the tangent
306 lattice supplied as an actual direct summand rather than chosen matrices.
307 `hgenericTangentCone` is literally the assertion that its Laurent generic
308 fibre is the affine cone over the embedded projective tangent plane, using
309 `projectiveTangentCone` above. -/
310 structure DirectSummandInput {n dimY : ℕ}
311     (I : Ideal (MvPolynomial (Fin n) k))
312     (q : Fin (n + 1) → PowerSeries k)
313     (L : Submodule (PowerSeries k)
314       (Fin (n + 1) → PowerSeries k)) where
315   axis : Fin n
316   isComplemented : IsComplemented L
317   rank_eq : Module.finrank (PowerSeries k) L = dimY + 1
318   hprime : I.IsPrime
319   chart_nonzero : q 0 ≠ 0
320   arc_mem_closure : FormalProjectiveArcInClosure I q
321   generic_smooth : SmoothAffinePoint
322     (I.map (scalarPolynomialMap
323       (k := k) (K := LaurentSeries k) (Fin n)))
324     (dehomogenizedPoint (laurentColumn q))
325   hgenericTangentCone :
326     genericFibre (K := LaurentSeries k) L =
327       projectiveTangentCone (laurentColumn q)
328         (zariskiTangentSpace
329           (dehomogenizedPoint (laurentColumn q))
330           (I.map (scalarPolynomialMap
331             (k := k) (K := LaurentSeries k) (Fin n))))
332   residue_le_coordinateHyperplane : ∀ v : L,
333     PowerSeries.constantCoeff ((v : Fin (n + 1) → PowerSeries k) axis.succ) = 0
334 
335 private theorem rowMul_zero_of_leftInverse_axis
336     {n : ℕ} {κ : Type*} [Fintype κ] [DecidableEq κ]
337     (B : Matrix (Fin (n + 1)) κ (PowerSeries k))
338     (C : Matrix κ (Fin (n + 1)) (PowerSeries k))
339     (axis : Fin (n + 1))
340     (hCB : C * B = 1)
341     (haxis : ∀ j, PowerSeries.constantCoeff (B axis j) = 0) :
342     ∃ ell : Fin (n + 1) → PowerSeries k,
343       rowMul ell B = 0 ∧
344         residueColumn ell = axisRow (k := k) axis := by
345   let a₀ : Fin (n + 1) → k := axisRow (k := k) axis
346   let a : Fin (n + 1) → PowerSeries k := constantColumn a₀
347   have hres : residueColumn a = a₀ := by
348     exact residueColumn_constantColumn a₀
349   have hred : rowMul a₀
350       (fun i j ↦ PowerSeries.constantCoeff (B i j)) = 0 := by
351     funext j
352     simp [a₀, axisRow, rowMul, haxis j]
353   let ell : Fin (n + 1) → PowerSeries k := annihilatorLift a B C
354   have hell := powerSeries_annihilatorLift_spec a a₀ B C hCB hres hred
355   refine ⟨ell, ?_, ?_⟩
356   · exact hell.1
357   · simpa [ell, a₀] using hell.2
358 
359 private theorem rowMul_laurent_of_rowMul
360     {n : ℕ} {κ : Type*} [Fintype κ]
361     (ell : Fin (n + 1) → PowerSeries k)
362     (B : Matrix (Fin (n + 1)) κ (PowerSeries k))
363     (h : rowMul ell B = 0) :
364     rowMul (laurentColumn ell)
365       (fun i j ↦ algebraMap (PowerSeries k) (LaurentSeries k) (B i j)) = 0 := by
366   funext j
367   have hj := congrFun h j
368   simpa [rowMul, laurentColumn, map_sum] using
369     congrArg (algebraMap (PowerSeries k) (LaurentSeries k)) hj
370 
371 theorem exists_axis_laurent_smooth_conormal_direction_with_fibre_closure
372     {n dimY : ℕ} {κ : Type*} [Fintype κ] [DecidableEq κ]
373     [IsAlgClosed k]
374     (I : Ideal (MvPolynomial (Fin n) k))
375     (q : Fin (n + 1) → PowerSeries k)
376     (B : Matrix (Fin (n + 1)) κ (PowerSeries k))
377     (D : Input (dimY := dimY) I q B) :
378     ∃ ell : Fin (n + 1) → PowerSeries k,
379       rowMul ell B = 0 ∧
380       residueColumn ell = axisRow (k := k) D.axis.succ ∧
381       (let phase : PhaseVar n → LaurentSeries k :=
382         Sum.elim (dehomogenizedPoint (laurentColumn q))
383           (fun i ↦ algebraMap (PowerSeries k) (LaurentSeries k) (ell i.succ));
384        phase ∈ smoothEquationConormalLocus I ∧
385        residueColumn (fun i : Fin n ↦ ell i.succ) ∈
386          extensionFibreClosure (k := k) (K := LaurentSeries k)
387            (smoothEquationConormalLocus I) ∧
388        (fun i : Fin n => if i = D.axis then (1 : k) else 0) ∈
389          MvPolynomial.zeroLocus k
390            (MvPolynomial.vanishingIdeal k (smoothConormalFibreProjection I)) ∧
391        Projectivization.mk k
392            (fun i : Fin n => if i = D.axis then (1 : k) else 0)
393            (by intro h; have hh := congrFun h D.axis; simpa using hh) ∈
394          projectiveHomogeneousClosure
395            (projectivizedDirectionSet (smoothConormalDirectionSet I))) := by
396   obtain ⟨ell, hrow, hres⟩ := rowMul_zero_of_leftInverse_axis
397     B D.C D.axis.succ D.hsplit D.haxis
398   have hrowL := rowMul_laurent_of_rowMul ell B hrow
399   have hqL : ∑ i, laurentColumn ell i * laurentColumn q i = 0 := by
400     obtain ⟨c, hc⟩ := D.hposition
401     have hprod : ∑ i, laurentColumn ell i * laurentColumn q i =
402         ∑ j, (∑ i, laurentColumn ell i *
403           algebraMap (PowerSeries k) (LaurentSeries k) (B i j)) * c j := by
404       calc
405         ∑ i, laurentColumn ell i * laurentColumn q i =
406             ∑ i, laurentColumn ell i *
407               (∑ j, algebraMap (PowerSeries k) (LaurentSeries k)
408                 (B i j) * c j) := by
409                   apply Finset.sum_congr rfl
410                   intro i hi
411                   rw [hc i]
412         _ = ∑ i, ∑ j, laurentColumn ell i *
413               (algebraMap (PowerSeries k) (LaurentSeries k) (B i j) * c j) := by
414                 apply Finset.sum_congr rfl
415                 intro i hi
416                 rw [Finset.mul_sum]
417         _ = ∑ j, ∑ i, laurentColumn ell i *
418               (algebraMap (PowerSeries k) (LaurentSeries k) (B i j) * c j) :=
419                 Finset.sum_comm
420         _ = ∑ j, (∑ i, laurentColumn ell i *
421               algebraMap (PowerSeries k) (LaurentSeries k) (B i j)) * c j := by
422                 apply Finset.sum_congr rfl
423                 intro j hj
424                 rw [Finset.sum_mul]
425                 apply Finset.sum_congr rfl
426                 intro i hi
427                 ring
428     rw [hprod]
429     have hzero : ∀ j, (∑ i, laurentColumn ell i *
430           algebraMap (PowerSeries k) (LaurentSeries k) (B i j)) = 0 := by
431       intro j
432       exact congrFun hrowL j
433     change (∑ j, rowMul (laurentColumn ell)
434       (fun i l ↦ algebraMap (PowerSeries k) (LaurentSeries k) (B i l)) j * c j) = 0
435     rw [hrowL]
436     simp
437   have hphase :
438       Sum.elim (dehomogenizedPoint (laurentColumn q))
439           (fun i ↦ algebraMap (PowerSeries k) (LaurentSeries k) (ell i.succ)) ∈
440         equationConormalLocus
441           (I.map (scalarPolynomialMap
442             (k := k) (K := LaurentSeries k) (Fin n))) := by
443     exact phasePoint_mem_equationConormalLocus_of_projective_row
444       (I.map (scalarPolynomialMap
445         (k := k) (K := LaurentSeries k) (Fin n)))
446       (laurentColumn q) (laurentColumn ell)
447       (fun i j ↦ algebraMap (PowerSeries k) (LaurentSeries k) (B i j))
448       (laurentColumn_ne_zero_of_ne_zero q D.hq0)
449       hqL hrowL D.hbase D.htangent
450   let phase : PhaseVar n → LaurentSeries k :=
451     Sum.elim (dehomogenizedPoint (laurentColumn q))
452       (fun i ↦ algebraMap (PowerSeries k) (LaurentSeries k) (ell i.succ))
453   have hphaseSmooth : phase ∈ smoothEquationConormalLocus I := by
454     exact ⟨hphase, D.hsmooth⟩
455   have hclosure := residue_mem_extensionFibreClosure_of_laurent_generic
456     (S := smoothEquationConormalLocus I)
457     (dehomogenizedPoint (laurentColumn q))
458     (fun i : Fin n ↦ ell i.succ) hphaseSmooth
459   let axisVec : Fin n → k := fun i => if i = D.axis then 1 else 0
460   have hresTail : residueColumn (fun i : Fin n ↦ ell i.succ) = axisVec := by
461     funext i
462     have hi := congrFun hres i.succ
463     simpa [residueColumn, axisRow, axisVec] using hi
464   have hvanAxis : axisVec ∈
465       MvPolynomial.zeroLocus k
466         (MvPolynomial.vanishingIdeal k (smoothConormalFibreProjection I)) := by
467     rw [MvPolynomial.mem_zeroLocus_iff]
468     intro P hP
469     have hf : fibreLift P ∈
470         MvPolynomial.vanishingIdeal k (equationConormalLocus I) :=
471       fibreLift_mem_vanishingIdeal_equationConormal I D.hprime P hP
472     have hPext : P ∈ extensionValuedVanishingIdeal
473         (k := k) (K := LaurentSeries k)
474         (fibreImage (smoothEquationConormalLocus I)) := by
475       rw [mem_extensionValuedVanishingIdeal_iff]
476       intro v hv
477       rcases hv with ⟨z, hz, rfl⟩
478       have hs := scalarExtension_vanishing I (fibreLift P) (by
479         simpa [fibreLift, MvPolynomial.eval_rename, Function.comp_def] using hf)
480         z hz.1
481       have hsplit :
482           Sum.elim (fun i ↦ z (Sum.inl i)) (fun i ↦ z (Sum.inr i)) = z := by
483         funext i
484         rcases i with i | i <;> rfl
485       rw [← hsplit] at hs
486       simpa [eval₂_fibreLift] using hs
487     have hz := hclosure P hPext
488     rw [hresTail] at hz
489     simpa [MvPolynomial.aeval_eq_eval] using hz
490   have hproj := mk_mem_projectiveHomogeneousClosure_of_fibre_zeroLocus
491     I axisVec (by
492       intro h
493       have hh := congrFun h D.axis
494       simpa [axisVec] using hh) hvanAxis
495   exact ⟨ell, hrow, hres,
496     ⟨hphaseSmooth, hclosure, ⟨by simpa [axisVec] using hvanAxis,
497       by simpa [axisVec] using hproj⟩⟩⟩
498 
499 /-- Existing projective-direction API, obtained by forgetting the affine
500 fibre-closure conclusion of the canonical stronger construction. -/
501 theorem exists_axis_laurent_smooth_conormal_direction
502     {n dimY : ℕ} {κ : Type*} [Fintype κ] [DecidableEq κ]
503     [IsAlgClosed k]
504     (I : Ideal (MvPolynomial (Fin n) k))
505     (q : Fin (n + 1) → PowerSeries k)
506     (B : Matrix (Fin (n + 1)) κ (PowerSeries k))
507     (D : Input (dimY := dimY) I q B) :
508     ∃ ell : Fin (n + 1) → PowerSeries k,
509       rowMul ell B = 0 ∧
510       residueColumn ell = axisRow (k := k) D.axis.succ ∧
511       (let phase : PhaseVar n → LaurentSeries k :=
512         Sum.elim (dehomogenizedPoint (laurentColumn q))
513           (fun i ↦ algebraMap (PowerSeries k) (LaurentSeries k) (ell i.succ));
514        phase ∈ smoothEquationConormalLocus I ∧
515        residueColumn (fun i : Fin n ↦ ell i.succ) ∈
516          extensionFibreClosure (k := k) (K := LaurentSeries k)
517            (smoothEquationConormalLocus I) ∧
518        Projectivization.mk k
519            (fun i : Fin n => if i = D.axis then (1 : k) else 0)
520            (by intro h; have hh := congrFun h D.axis; simpa using hh) ∈
521          projectiveHomogeneousClosure
522            (projectivizedDirectionSet (smoothConormalDirectionSet I))) := by
523   obtain ⟨ell, hrow, hres, hdata⟩ :=
524     exists_axis_laurent_smooth_conormal_direction_with_fibre_closure I q B D
525   exact ⟨ell, hrow, hres, hdata.1, hdata.2.1, hdata.2.2.2⟩
526 
527 /-- The affine consequence of the paper's tangent-limit argument.  Starting
528 from an actual rank `dimY + 1` direct-summand lattice whose generic fibre is
529 the projective tangent cone, this theorem constructs split matrix coordinates
530 internally and obtains vanishing on the smooth conormal fibre projection.  No
531 annihilator, matrix retraction, position coefficients, or chart tangent
532 dictionary occurs in the input. -/
533 theorem tangent_limit_affine_fibre_closure_of_directSummand
534     {n dimY : ℕ} [IsAlgClosed k]
535     (I : Ideal (MvPolynomial (Fin n) k))
536     (q : Fin (n + 1) → PowerSeries k)
537     (L : Submodule (PowerSeries k)
538       (Fin (n + 1) → PowerSeries k))
539     (D : DirectSummandInput (dimY := dimY) I q L) :
540     (fun i : Fin n => if i = D.axis then (1 : k) else 0) ∈
541       MvPolynomial.zeroLocus k
542         (MvPolynomial.vanishingIdeal k (smoothConormalFibreProjection I)) := by
543   obtain ⟨P⟩ := exists_splitMatrixPresentation_of_isComplemented
544     L D.isComplemented (dimY + 1) D.rank_eq
545   let B : Matrix (Fin (n + 1)) (Fin (dimY + 1))
546       (PowerSeries k) := P.B
547   let BL : Matrix (Fin (n + 1)) (Fin (dimY + 1))
548       (LaurentSeries k) :=
549     fun i j => algebraMap (PowerSeries k) (LaurentSeries k) (B i j)
550   have hgenericSpan :
551       Submodule.span (LaurentSeries k)
552           (Set.range fun j => fun i => BL i j) =
553         projectiveTangentCone (laurentColumn q)
554           (zariskiTangentSpace
555             (dehomogenizedPoint (laurentColumn q))
556             (I.map (scalarPolynomialMap
557               (k := k) (K := LaurentSeries k) (Fin n)))) := by
558     rw [← D.hgenericTangentCone,
559       genericFibre_eq_span_matrixColumns L B P.columnsSpan]
560   have hq0L : laurentColumn q 0 ≠ 0 :=
561     laurentColumn_ne_zero_of_ne_zero q D.chart_nonzero
562   obtain ⟨hposition, htangent⟩ := matrix_tangent_dictionary
563     (laurentColumn q) hq0L
564     (zariskiTangentSpace
565       (dehomogenizedPoint (laurentColumn q))
566       (I.map (scalarPolynomialMap
567         (k := k) (K := LaurentSeries k) (Fin n))))
568     BL hgenericSpan
569   have hbase : ∀ f ∈ I.map (scalarPolynomialMap
570       (k := k) (K := LaurentSeries k) (Fin n)),
571       MvPolynomial.eval (dehomogenizedPoint (laurentColumn q)) f = 0 := by
572     have hz := (projectiveClosureAtZero_iff
573       (I.map (scalarPolynomialMap
574         (k := k) (K := LaurentSeries k) (Fin n)))
575       (laurentColumn q) hq0L).mp D.arc_mem_closure.2
576     exact hz
577   have haxis : ∀ j,
578       PowerSeries.constantCoeff (B D.axis.succ j) = 0 := by
579     intro j
580     have hmem : (fun i => B i j) ∈ L := by
581       rw [← P.columnsSpan]
582       exact Submodule.subset_span ⟨j, rfl⟩
583     let v : L := ⟨fun i => B i j, hmem⟩
584     simpa [v] using D.residue_le_coordinateHyperplane v
585   let low : Input (dimY := dimY) I q B := {
586     axis := D.axis
587     C := P.C
588     hprime := D.hprime
589     hsplit := P.leftInverse
590     hrank := by simp
591     hq0 := D.chart_nonzero
592     hbase := hbase
593     hsmooth := D.generic_smooth
594     hposition := hposition
595     htangent := htangent
596     haxis := haxis }
597   obtain ⟨ell, hrow, hres, hconormal⟩ :=
598     exists_axis_laurent_smooth_conormal_direction_with_fibre_closure I q B low
599   exact hconormal.2.2.1
600 
601 /-- The projective-direction conclusion is the standard projectivization of
602 the affine fibre-closure endpoint. -/
603 theorem tangent_limit_criterion_of_directSummand_with_fibre_closure
604     {n dimY : ℕ} [IsAlgClosed k]
605     (I : Ideal (MvPolynomial (Fin n) k))
606     (q : Fin (n + 1) → PowerSeries k)
607     (L : Submodule (PowerSeries k)
608       (Fin (n + 1) → PowerSeries k))
609     (D : DirectSummandInput (dimY := dimY) I q L) :
610     (fun i : Fin n => if i = D.axis then (1 : k) else 0) ∈
611       MvPolynomial.zeroLocus k
612         (MvPolynomial.vanishingIdeal k (smoothConormalFibreProjection I)) ∧
613     Projectivization.mk k
614         (fun i : Fin n => if i = D.axis then (1 : k) else 0)
615         (by intro h; have hh := congrFun h D.axis; simpa using hh) ∈
616       projectiveHomogeneousClosure
617         (projectivizedDirectionSet (smoothConormalDirectionSet I)) := by
618   have hvan := tangent_limit_affine_fibre_closure_of_directSummand I q L D
619   have hnonzero : (fun i : Fin n => if i = D.axis then (1 : k) else 0) ≠ 0 := by
620     intro h
621     have hh := congrFun h D.axis
622     simpa using hh
623   have hproj := mk_mem_projectiveHomogeneousClosure_of_fibre_zeroLocus
624     I (fun i : Fin n => if i = D.axis then (1 : k) else 0) hnonzero hvan
625   exact ⟨hvan, hproj⟩
626 
627 /-- Existing paper-facing criterion, derived from the joint affine and
628 projective closure result. -/
629 theorem tangent_limit_criterion_of_directSummand
630     {n dimY : ℕ} [IsAlgClosed k]
631     (I : Ideal (MvPolynomial (Fin n) k))
632     (q : Fin (n + 1) → PowerSeries k)
633     (L : Submodule (PowerSeries k)
634       (Fin (n + 1) → PowerSeries k))
635     (D : DirectSummandInput (dimY := dimY) I q L) :
636     Projectivization.mk k
637         (fun i : Fin n => if i = D.axis then (1 : k) else 0)
638         (by intro h; have hh := congrFun h D.axis; simpa using hh) ∈
639       projectiveHomogeneousClosure
640         (projectivizedDirectionSet (smoothConormalDirectionSet I)) := by
641   exact (tangent_limit_criterion_of_directSummand_with_fibre_closure
642     I q L D).2
643 
644 #print axioms exists_axis_laurent_smooth_conormal_direction
645 #print axioms formalProjectiveArcInClosure_iff
646 #print axioms tangent_limit_criterion_of_directSummand
647 
648 end
649 end Stafford38.Geometry.GeneralTangentLimitCriterion
650