Stafford38/Geometry/DivisorTangentLattice.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Mathlib.RingTheory.Derivation.Basic
3 public import Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic
4 public import Mathlib.RingTheory.Nakayama
5 public import Mathlib.RingTheory.Finiteness.Ideal
6 public import Mathlib.Tactic.FieldSimp
7 public import Mathlib.Tactic.Ring
8 public import Mathlib.Tactic.Module
9 public import Lean.Elab.Tactic.Omega
10 
11 @[expose] public section
12 
13 /-!
14 # The divisor-tangent lattice lemma
15 
16 Let `V` be a local ring inside a field `F`, `t` an element of its maximal
17 ideal, and `d` a derivation of `F` with values in an `F`-vector space `Ω`.
18 Suppose the homogeneous coordinates `Q₀, Q₁, Q j` lie in `V` with
19 
20 ```text
21 Q₀ = t^a * u,   Q₁ = t^(a+e) * w,   Q j₀ = 1,   a, e ≥ 1,   u a unit.
22 ```
23 
24 The affine coordinates are `x j = Q j / Q₀` and `x₁ = Q₁ / Q₀`. Let `W` be
25 a finitely generated `V`-lattice in `Ω` containing `d t`, `d u`, `d w` and
26 the `d (Q j)`; in the geometric application `W` is the image of `Ω_{V/k}`.
27 The *visibility* hypothesis asks that `W` is spanned modulo `t W` by `d t`
28 and the `d (Q j)`. Under it,
29 `d x₁ = ∑ j, c j • d (x j)` with each `c j ∈ m_V`.
30 
31 After completing `V`, the covector `e₁ - ∑ c j e_j` has residue the first
32 axis and annihilates generic tangent vectors. The proof is Nakayama's lemma
33 applied to the lattice spanned by the scaled differentials
34 `t^(a+1) u^2 • d (x j)`. This module proves the implication from explicit
35 visibility data; the canonical and generic producers are
36 `ExactDivisorialVisibleFrameExistence` and `GeneralDivisorialVisibleFrame`.
37 -/
38 
39 namespace Stafford38.Geometry.DivisorTangentLattice
40 
41 open IsLocalRing
42 
43 noncomputable section
44 
45 universe u v w x y
46 
47 variable {k : Type u} {V : Type v} {F : Type w} {Ω : Type x}
48 variable [CommRing k] [CommRing V] [IsLocalRing V] [Field F]
49 variable [Algebra k F] [Algebra V F]
50 variable [AddCommGroup Ω] [Module k Ω] [Module F Ω] [Module V Ω]
51 variable [IsScalarTower V F Ω]
52 
53 variable (d : Derivation k F Ω)
54 variable {ι : Type y} [Fintype ι]
55 
56 set_option linter.unusedSectionVars false
57 
58 /-- The `V`-lattice spanned by `d t` and the differentials of the
59 homogeneous coordinates. -/
60 def coordinateFrame (t : V) (Q : ι → V) : Submodule V Ω :=
61   Submodule.span V {d (algebraMap V F t)} ⊔
62     Submodule.span V (Set.range fun j ↦ d (algebraMap V F (Q j)))
63 
64 theorem dQ_mem_coordinateFrame (t : V) (Q : ι → V) (j : ι) :
65     d (algebraMap V F (Q j)) ∈ coordinateFrame d t Q :=
66   Submodule.mem_sup_right (Submodule.subset_span ⟨j, rfl⟩)
67 
68 /-- Normalized divisor-frame data for the lattice lemma.  All coordinates
69 are elements of `V`.  The lattice `W` is any finitely generated `V`-submodule
70 containing the differentials of `t`, `u`, `w` and the `Q j`; in the geometric
71 application it is the image of `Ω_{V/k}`.  The visibility field is the only
72 non-algebraic hypothesis: modulo `t`, the lattice `W` is spanned by `d t` and
73 the `d (Q j)`. -/
74 structure VisibleDivisorFrame (d : Derivation k F Ω) (ι : Type y) [Fintype ι] where
75   Q₀ : V
76   Q₁ : V
77   t : V
78   u : V
79   w : V
80   Q : ι → V
81   a : ℕ
82   e : ℕ
83   j₀ : ι
84   W : Submodule V Ω
85   t_mem : t ∈ maximalIdeal V
86   t_ne : t ≠ 0
87   u_unit : IsUnit u
88   a_unit : IsUnit (a : V)
89   one_le_a : 1 ≤ a
90   one_le_e : 1 ≤ e
91   Q₀_eq : Q₀ = t ^ a * u
92   Q₁_eq : Q₁ = t ^ (a + e) * w
93   Q_j₀ : Q j₀ = 1
94   W_fg : W.FG
95   dt_mem : d (algebraMap V F t) ∈ W
96   du_mem : d (algebraMap V F u) ∈ W
97   dw_mem : d (algebraMap V F w) ∈ W
98   dQ_mem : ∀ j, d (algebraMap V F (Q j)) ∈ W
99   visible : W ≤ coordinateFrame d t Q ⊔ Ideal.span {t} • W
100 
101 namespace VisibleDivisorFrame
102 
103 variable {d}
104 variable (D : VisibleDivisorFrame (V := V) d ι)
105 
106 /-- The scaled differential of the affine coordinate with numerator `P`. -/
107 def scaledDifferential (P : V) : Ω :=
108   (algebraMap V F D.t ^ (D.a + 1) * algebraMap V F D.u ^ 2) •
109     d (algebraMap V F P / algebraMap V F D.Q₀)
110 
111 theorem algebraMap_t_ne_zero (hinj : Function.Injective (algebraMap V F)) :
112     algebraMap V F D.t ≠ 0 :=
113   (map_ne_zero_iff _ hinj).2 D.t_ne
114 
115 theorem algebraMap_u_ne_zero : algebraMap V F D.u ≠ 0 :=
116   (D.u_unit.map (algebraMap V F)).ne_zero
117 
118 theorem scale_ne_zero (hinj : Function.Injective (algebraMap V F)) :
119     algebraMap V F D.t ^ (D.a + 1) * algebraMap V F D.u ^ 2 ≠ 0 :=
120   mul_ne_zero (pow_ne_zero _ (D.algebraMap_t_ne_zero hinj))
121     (pow_ne_zero _ D.algebraMap_u_ne_zero)
122 
123 /-- The scaled affine differential in terms of differentials of elements of
124 `V`.  This is the only place where the quotient rule is used. -/
125 theorem scaledDifferential_eq (hinj : Function.Injective (algebraMap V F))
126     (P : V) :
127     D.scaledDifferential P =
128       (D.u * D.t) • d (algebraMap V F P) -
129         ((D.a : V) * P * D.u) • d (algebraMap V F D.t) -
130         (D.t * P) • d (algebraMap V F D.u) := by
131   obtain ⟨a', ha'⟩ := Nat.exists_eq_add_of_le' D.one_le_a
132   have hT := D.algebraMap_t_ne_zero hinj
133   have hU := D.algebraMap_u_ne_zero
134   unfold scaledDifferential
135   rw [Derivation.leibniz_div, D.Q₀_eq, map_mul, map_pow, Derivation.leibniz,
136     Derivation.leibniz_pow]
137   simp only [← algebraMap_smul (R := V) (A := F) (M := Ω), map_mul, map_natCast,
138     ha', Nat.add_sub_cancel, ← Nat.cast_smul_eq_nsmul F]
139   simp only [smul_sub, smul_add, smul_smul]
140   rw [sub_sub]
141   congr 1
142   · congr 1
143     field_simp
144     ring
145   · rw [add_comm]
146     congr 1
147     · congr 1
148       field_simp
149       ring
150     · congr 1
151       field_simp
152       ring
153 
154 /-- The lattice spanned by the scaled affine differentials of the
155 coordinates `Q j`. -/
156 def scaledLattice : Submodule V Ω :=
157   Submodule.span V (Set.range fun j ↦ D.scaledDifferential (D.Q j))
158 
159 theorem scaledDifferential_mem_scaledLattice (j : ι) :
160     D.scaledDifferential (D.Q j) ∈ D.scaledLattice :=
161   Submodule.subset_span ⟨j, rfl⟩
162 
163 theorem scaledDifferential_j₀ (hinj : Function.Injective (algebraMap V F)) :
164     D.scaledDifferential (D.Q D.j₀) =
165       -(((D.a : V) * D.u) • d (algebraMap V F D.t)) -
166         D.t • d (algebraMap V F D.u) := by
167   rw [D.scaledDifferential_eq hinj, D.Q_j₀, map_one, Derivation.map_one_eq_zero,
168     smul_zero, zero_sub, mul_one, mul_one]
169 
170 /-- Step (i): `t • d (Q j)` lies in the scaled lattice. -/
171 theorem t_smul_dQ_mem_scaledLattice (hinj : Function.Injective (algebraMap V F))
172     (j : ι) :
173     D.t • d (algebraMap V F (D.Q j)) ∈ D.scaledLattice := by
174   have hid : (D.u * D.t) • d (algebraMap V F (D.Q j)) =
175       D.scaledDifferential (D.Q j) - D.Q j • D.scaledDifferential (D.Q D.j₀) := by
176     rw [D.scaledDifferential_eq hinj, D.scaledDifferential_j₀ hinj]
177     module
178   have hmem : (D.u * D.t) • d (algebraMap V F (D.Q j)) ∈ D.scaledLattice := by
179     rw [hid]
180     exact Submodule.sub_mem _ (D.scaledDifferential_mem_scaledLattice j)
181       (Submodule.smul_mem _ _ (D.scaledDifferential_mem_scaledLattice D.j₀))
182   have hinv : D.t • d (algebraMap V F (D.Q j)) =
183       (↑D.u_unit.unit⁻¹ : V) • ((D.u * D.t) • d (algebraMap V F (D.Q j))) := by
184     rw [smul_smul, ← mul_assoc, Units.inv_mul_of_eq D.u_unit.unit_spec, one_mul]
185   rw [hinv]
186   exact Submodule.smul_mem _ _ hmem
187 
188 /-- The ideal generated by the uniformizer. -/
189 def parameterIdeal : Ideal V := Ideal.span {D.t}
190 
191 theorem t_mem_parameterIdeal : D.t ∈ D.parameterIdeal :=
192   Ideal.mem_span_singleton_self _
193 
194 theorem parameterIdeal_le_jacobson : D.parameterIdeal ≤ (⊥ : Ideal V).jacobson :=
195   (Ideal.span_le.2 (Set.singleton_subset_iff.2 D.t_mem)).trans
196     (maximalIdeal_le_jacobson _)
197 
198 theorem parameterIdeal_fg : D.parameterIdeal.FG :=
199   Submodule.fg_span_singleton _
200 
201 /-- Step (ii): `t • d t` lies in the scaled lattice up to `t²` times the
202 lattice `W`. -/
203 theorem t_smul_dt_mem (hinj : Function.Injective (algebraMap V F)) :
204     D.t • d (algebraMap V F D.t) ∈
205       D.scaledLattice ⊔
206         D.parameterIdeal • (D.parameterIdeal • D.W) := by
207   have hid : ((D.a : V) * D.u) • (D.t • d (algebraMap V F D.t)) =
208       -(D.t • D.scaledDifferential (D.Q D.j₀)) -
209         D.t • (D.t • d (algebraMap V F D.u)) := by
210     rw [D.scaledDifferential_j₀ hinj]
211     module
212   have hmem : ((D.a : V) * D.u) • (D.t • d (algebraMap V F D.t)) ∈
213       D.scaledLattice ⊔
214         D.parameterIdeal • (D.parameterIdeal • D.W) := by
215     rw [hid]
216     refine Submodule.sub_mem _ (Submodule.neg_mem _ ?_) ?_
217     · exact Submodule.mem_sup_left
218         (Submodule.smul_mem _ _ (D.scaledDifferential_mem_scaledLattice D.j₀))
219     · exact Submodule.mem_sup_right
220         (Submodule.smul_mem_smul D.t_mem_parameterIdeal
221           (Submodule.smul_mem_smul D.t_mem_parameterIdeal
222             D.du_mem))
223   have hunit : IsUnit ((D.a : V) * D.u) := D.a_unit.mul D.u_unit
224   have hinv : D.t • d (algebraMap V F D.t) =
225       (↑hunit.unit⁻¹ : V) • (((D.a : V) * D.u) • (D.t • d (algebraMap V F D.t))) := by
226     rw [smul_smul, Units.inv_mul_of_eq hunit.unit_spec, one_smul]
227   rw [hinv]
228   exact Submodule.smul_mem _ _ hmem
229 
230 /-- Step (iii): `t` times the unit frame is contained in the scaled lattice
231 up to `t²` times the unit frame. -/
232 theorem parameterIdeal_smul_W_le (hinj : Function.Injective (algebraMap V F)) :
233     D.parameterIdeal • D.W ≤
234       D.scaledLattice ⊔ D.parameterIdeal • (D.parameterIdeal • D.W) := by
235   set L := D.scaledLattice
236   set I := D.parameterIdeal
237   set R := L ⊔ I • (I • D.W)
238   -- The elements whose `t`-multiple lies in `R`.
239   let M : Submodule V Ω := Submodule.comap (LinearMap.lsmul V Ω D.t) R
240   have hM : ∀ ω ∈ M, D.t • ω ∈ R := fun ω hω ↦ hω
241   have hcoord : coordinateFrame d D.t D.Q ≤ M := by
242     refine sup_le ?_ ?_
243     · rw [Submodule.span_le, Set.singleton_subset_iff]
244       exact D.t_smul_dt_mem hinj
245     · rw [Submodule.span_le]
246       rintro _ ⟨j, rfl⟩
247       exact Submodule.mem_sup_left (D.t_smul_dQ_mem_scaledLattice hinj j)
248   -- `t` times a visible element lies in `R`.
249   have hW : D.W ≤ M := by
250     intro ω hω
251     obtain ⟨ω₁, hω₁, ω₂, hω₂, rfl⟩ := Submodule.mem_sup.1 (D.visible hω)
252     show D.t • (ω₁ + ω₂) ∈ R
253     rw [smul_add]
254     refine Submodule.add_mem _ (hM ω₁ (hcoord hω₁)) ?_
255     exact Submodule.mem_sup_right (Submodule.smul_mem_smul D.t_mem_parameterIdeal hω₂)
256   refine Submodule.smul_le.2 ?_
257   intro r hr ω hω
258   obtain ⟨s, rfl⟩ := Ideal.mem_span_singleton.1 hr
259   rw [mul_comm, mul_smul]
260   exact Submodule.smul_mem _ _ (hM ω (hW hω))
261 
262 /-- Nakayama: `t` times the lattice `W` lies in the scaled lattice. -/
263 theorem parameterIdeal_smul_W_le_scaledLattice
264     (hinj : Function.Injective (algebraMap V F)) :
265     D.parameterIdeal • D.W ≤ D.scaledLattice :=
266   Submodule.le_of_le_smul_of_le_jacobson_bot
267     (Submodule.FG.smul D.parameterIdeal_fg D.W_fg)
268     D.parameterIdeal_le_jacobson
269     (D.parameterIdeal_smul_W_le hinj)
270 
271 /-- Step (iv): the scaled differential of the selected coordinate `Q₁`
272 is `t^(a+e-1)` times an element of `t` times the lattice `W`. -/
273 theorem scaledDifferential_Q₁_eq (hinj : Function.Injective (algebraMap V F)) :
274     ∃ ω ∈ D.parameterIdeal • D.W,
275       D.scaledDifferential D.Q₁ = D.t ^ (D.a + D.e - 1) • ω := by
276   set W := D.W
277   obtain ⟨a', ha'⟩ := Nat.exists_eq_add_of_le' D.one_le_a
278   obtain ⟨e', he'⟩ := Nat.exists_eq_add_of_le' D.one_le_e
279   -- The unscaled combination inside the unit frame.
280   let ω₀ : Ω := (D.u * D.t) • d (algebraMap V F D.w) +
281     ((D.e : V) * D.u * D.w) • d (algebraMap V F D.t) -
282     (D.t * D.w) • d (algebraMap V F D.u)
283   have hω₀ : ω₀ ∈ D.W := by
284     refine Submodule.sub_mem _ (Submodule.add_mem _ ?_ ?_) ?_
285     · exact Submodule.smul_mem _ _ D.dw_mem
286     · exact Submodule.smul_mem _ _ D.dt_mem
287     · exact Submodule.smul_mem _ _ D.du_mem
288   refine ⟨D.t • ω₀, Submodule.smul_mem_smul D.t_mem_parameterIdeal hω₀, ?_⟩
289   have hexp' : D.a + D.e - 1 = a' + e' + 1 := by omega
290   rw [hexp', D.scaledDifferential_eq hinj, D.Q₁_eq, map_mul, map_pow, Derivation.leibniz,
291     Derivation.leibniz_pow]
292   have hexp : a' + 1 + (e' + 1) - 1 = a' + e' + 1 := by omega
293   simp only [ω₀, ha', he', ← Nat.cast_smul_eq_nsmul F, ← map_natCast (algebraMap V F),
294     ← map_pow, algebraMap_smul, hexp]
295   push_cast
296   module
297 
298 /-- The divisor-tangent lattice lemma.  The differential of the selected
299 affine coordinate is a combination of the other affine differentials with
300 coefficients divisible by `t^(a+e-1)`; in particular the coefficients lie in
301 the maximal ideal of `V`. -/
302 theorem exists_coefficients (hinj : Function.Injective (algebraMap V F)) :
303     ∃ b : ι → V,
304       d (algebraMap V F D.Q₁ / algebraMap V F D.Q₀) =
305         ∑ j, (D.t ^ (D.a + D.e - 1) * b j) •
306           d (algebraMap V F (D.Q j) / algebraMap V F D.Q₀) := by
307   classical
308   obtain ⟨ω, hω, hℓ⟩ := D.scaledDifferential_Q₁_eq hinj
309   have hωL : ω ∈ D.scaledLattice :=
310     D.parameterIdeal_smul_W_le_scaledLattice hinj hω
311   obtain ⟨b, hb⟩ := (Submodule.mem_span_range_iff_exists_fun V).1 hωL
312   refine ⟨b, ?_⟩
313   have hscale := D.scale_ne_zero hinj
314   have hleft : (algebraMap V F D.t ^ (D.a + 1) * algebraMap V F D.u ^ 2) •
315         d (algebraMap V F D.Q₁ / algebraMap V F D.Q₀) =
316       (algebraMap V F D.t ^ (D.a + 1) * algebraMap V F D.u ^ 2) •
317         ∑ j, (D.t ^ (D.a + D.e - 1) * b j) •
318           d (algebraMap V F (D.Q j) / algebraMap V F D.Q₀) := by
319     change D.scaledDifferential D.Q₁ = _
320     rw [hℓ, ← hb, Finset.smul_sum, Finset.smul_sum]
321     refine Finset.sum_congr rfl fun j _ ↦ ?_
322     simp only [scaledDifferential, ← algebraMap_smul (R := V) (A := F) (M := Ω), smul_smul,
323       map_mul, map_pow]
324     ring_nf
325   let c := algebraMap V F D.t ^ (D.a + 1) * algebraMap V F D.u ^ 2
326   letI : Module.IsTorsionFree F Ω :=
327     Module.IsTorsionFree.of_smul_eq_zero (fun r z hz ↦ by
328       by_cases hr : r = 0
329       · exact Or.inl hr
330       · right
331         have hcancel := congrArg (fun z : Ω => r⁻¹ • z) hz
332         simpa [smul_smul, inv_mul_cancel₀ hr] using hcancel)
333   exact smul_right_injective Ω hscale hleft
334 
335 theorem exists_maximalIdeal_coefficients (hinj : Function.Injective (algebraMap V F)) :
336     ∃ c : ι → V, (∀ j, c j ∈ maximalIdeal V) ∧
337       d (algebraMap V F D.Q₁ / algebraMap V F D.Q₀) =
338         ∑ j, c j • d (algebraMap V F (D.Q j) / algebraMap V F D.Q₀) := by
339   obtain ⟨b, hb⟩ := D.exists_coefficients hinj
340   refine ⟨fun j ↦ D.t ^ (D.a + D.e - 1) * b j, fun j ↦ ?_, hb⟩
341   have hpos : D.a + D.e - 1 = (D.a + D.e - 2) + 1 := by
342     have := D.one_le_a; have := D.one_le_e; omega
343   show D.t ^ (D.a + D.e - 1) * b j ∈ maximalIdeal V
344   rw [hpos, pow_succ]
345   exact Ideal.mul_mem_right _ _ (Ideal.mul_mem_left _ _ D.t_mem)
346 
347 #print axioms VisibleDivisorFrame.exists_coefficients
348 #print axioms VisibleDivisorFrame.exists_maximalIdeal_coefficients
349 #print axioms VisibleDivisorFrame.exists_maximalIdeal_coefficients
350 
351 end VisibleDivisorFrame
352 
353 end
354 
355 end Stafford38.Geometry.DivisorTangentLattice
356