Stafford38/Paper/Section5/GenericTangentRank.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 
3 public import Stafford38.Geometry.PaperGenericTangentRank
4 public import Stafford38.Geometry.KaehlerTranscendenceBasis
5 public import Stafford38.Geometry.PowerSeriesArcTangency
6 public import Stafford38.Paper.Section5.Definitions
7 
8 @[expose] public section
9 
10 /-!
11 # Lemma 5.12(a): the generic tangent space has dimension `dim Ω_{F/k}`
12 
13 Let `F` be the function field of the component cut out by the prime `I`, with
14 generic point `y ∈ F^m`, and let `E ⊇ F` be a field extension (in the paper
15 `E = κ((t))`).  `Θ_y` is the tangent space at `y` of the equations of `I` with
16 coefficients extended to `E`.  The proof follows the paper: the second
17 fundamental exact sequence for `k[x] → R = k[x]/I` gives
18 `Ω_{R/k} = R^m / span_R {df(x̄) : f ∈ I}` (`quotientKaehlerMap_exact`), its
19 localization gives `Ω_{F/k} = F^m / span_F {df(x̄)}` (`fieldKaehlerMap_exact`),
20 so the Jacobian has rank `m - dim Ω_{F/k}` over `F`; rank does not change under
21 `F ⊆ E`, and `Θ_y` is the common kernel of the `df_y`.  In characteristic zero
22 `dim Ω_{F/k}` is the transcendence degree of `F/k`.
23 -/
24 
25 namespace Stafford38.Paper.Section5
26 
27 open Stafford38.Geometry
28 open Stafford38.Geometry.AffineConormalSpan
29 open Stafford38.Geometry.CoisotropicTranslation
30 open KaehlerDifferential
31 
32 noncomputable section
33 
34 universe u
35 
36 /-- A vector is tangent to the scalar extension of `I` at `y` once `y` is a
37 zero of `I` and the vector is killed by the differentials of the equations of
38 `I` themselves: `E`-combinations of equations vanishing at `y` add nothing. -/
39 theorem mem_zariskiTangentSpace_map_of_forall_mem
40     {k E : Type*} [Field k] [Field E] [Algebra k E]
41     {m : ℕ} (I : Ideal (MvPolynomial (Fin m) k)) (y w : Fin m → E)
42     (hy : ∀ g ∈ I, MvPolynomial.eval₂ (algebraMap k E) y g = 0)
43     (hw : ∀ g ∈ I, ∑ i, MvPolynomial.eval₂ (algebraMap k E) y
44       (MvPolynomial.pderiv i g) * w i = 0) :
45     w ∈ zariskiTangentSpace y (I.map (MvPolynomial.map (algebraMap k E))) := by
46   have hmap : ∀ h ∈ I.map (MvPolynomial.map (algebraMap k E)),
47       MvPolynomial.eval y h = 0 ∧ differentialCovector y h w = 0 := by
48     intro h hh
49     rw [Ideal.map] at hh
50     induction hh using Submodule.span_induction with
51     | mem h hh =>
52         rcases hh with ⟨g, hg, rfl⟩
53         refine ⟨by rw [MvPolynomial.eval_map]; exact hy g hg, ?_⟩
54         simpa [differentialCovector, differentialAt, MvPolynomial.pderiv_map,
55           MvPolynomial.eval_map] using hw g hg
56     | zero => simp [differentialCovector, differentialAt]
57     | add h₁ h₂ _ _ ih₁ ih₂ =>
58         refine ⟨by rw [MvPolynomial.eval_add, ih₁.1, ih₂.1, add_zero], ?_⟩
59         have hadd : differentialCovector y (h₁ + h₂) w =
60             differentialCovector y h₁ w + differentialCovector y h₂ w := by
61           simp only [differentialCovector_apply, differentialAt, map_add,
62             add_mul, Finset.sum_add_distrib]
63         rw [hadd, ih₁.2, ih₂.2, add_zero]
64     | smul a h _ ih =>
65         rw [show (a • h : MvPolynomial (Fin m) E) = a * h by rfl]
66         refine ⟨by rw [MvPolynomial.eval_mul, ih.1, mul_zero], ?_⟩
67         rw [differentialCovector_mul]
68         simp [ih.1, ih.2]
69   rw [zariskiTangentSpace, Submodule.mem_dualCoannihilator]
70   intro φ hφ
71   induction hφ using Submodule.span_induction with
72   | mem f hf =>
73       rcases hf with ⟨g, rfl⟩
74       exact (hmap g.1 g.2).2
75   | zero => simp
76   | add φ ψ _ _ ihφ ihψ => simp [ihφ, ihψ]
77   | smul a φ _ ihφ => simp [ihφ]
78 
79 /-- The generic point of the component is a zero of every equation in `I`. -/
80 theorem eval₂_genericPoint_eq_zero
81     {k F : Type*} [Field k] [Field F] [Algebra k F]
82     {m : ℕ} {I : Ideal (MvPolynomial (Fin m) k)}
83     [Algebra (MvPolynomial (Fin m) k ⧸ I) F]
84     [IsScalarTower k (MvPolynomial (Fin m) k ⧸ I) F]
85     {g : MvPolynomial (Fin m) k} (hg : g ∈ I) :
86     MvPolynomial.eval₂ (algebraMap k F)
87       (GenericPointKaehlerConormal.genericPoint I F) g = 0 := by
88   have hhom : MvPolynomial.aeval (GenericPointKaehlerConormal.genericPoint I F) =
89       (IsScalarTower.toAlgHom k (MvPolynomial (Fin m) k ⧸ I) F).comp
90         (Ideal.Quotient.mkₐ k I) := by
91     apply MvPolynomial.algHom_ext
92     intro i
93     simp [GenericPointKaehlerConormal.genericPoint]
94   have h := congrArg (fun φ ↦ φ g) hhom
95   simp only [MvPolynomial.aeval_def, AlgHom.comp_apply,
96     Ideal.Quotient.mkₐ_eq_mk, (Ideal.Quotient.eq_zero_iff_mem).2 hg,
97     map_zero] at h
98   exact h
99 
100 section ExactSequence
101 
102 variable {k : Type*} [Field k] {m : ℕ} (I : Ideal (MvPolynomial (Fin m) k))
103 
104 local notation "A" => MvPolynomial (Fin m) k
105 local notation "R" => MvPolynomial (Fin m) k ⧸ I
106 
107 /-- The column `df(x̄) = (∂_i f(x̄))_i ∈ R^n` of an equation `f`. -/
108 noncomputable def quotientGradient (f : A) : Fin m → R :=
109   fun i ↦ Ideal.Quotient.mk I (MvPolynomial.pderiv i f)
110 
111 /-- `ξ ↦ Σ ξ_i dx̄_i`, from `R^n` to `Ω_{R/K}`. -/
112 noncomputable def quotientKaehlerMap : (Fin m → R) →ₗ[R] Ω[R⁄k] :=
113   Fintype.linearCombination R fun i ↦ D k R (Ideal.Quotient.mk I (MvPolynomial.X i))
114 
115 /-- **Second fundamental exact sequence for `K[x] → R = K[x]/𝔭`.**  In
116 `R ⊗ Ω_{K[x]/K} = R^n` (basis `1 ⊗ dx_i`) the image of `f ∈ 𝔭` is `df(x̄)`, and the
117 exact sequence `𝔭/𝔭² → R^n → Ω_{R/K} → 0` (Matsumura, Thm. 25.2) gives
118 `Ω_{R/K} = R^n / span_R {df(x̄) : f ∈ 𝔭}`: the map `ξ ↦ Σ ξ_i dx̄_i` is onto, with
119 kernel `span_R {df(x̄)}`. -/
120 theorem quotientKaehlerMap_exact :
121     LinearMap.range (quotientKaehlerMap I) = ⊤ ∧
122       LinearMap.ker (quotientKaehlerMap I) =
123         Submodule.span R (Set.range fun f : I ↦ quotientGradient I f.1) := by
124   classical
125   have h1 : ∀ ω : Ω[R⁄k], (1 : R) • ω = ω := fun ω ↦ one_smul R ω
126   have hδ : ∀ ξ : Fin m → R, quotientKaehlerMap I ξ =
127       ∑ i, ξ i • D k R (Ideal.Quotient.mk I (MvPolynomial.X i)) := fun ξ ↦
128     Fintype.linearCombination_apply _ _ _
129   let tb := Algebra.TensorProduct.basis R (mvPolynomialBasis k (Fin m))
130   have htb : ∀ i, mapBaseChange k A R (tb i) = D k R (Ideal.Quotient.mk I (MvPolynomial.X i)) := by
131     intro i
132     simp only [tb, Algebra.TensorProduct.basis_apply, mapBaseChange_tmul,
133       mvPolynomialBasis_apply, map_D, h1]
134     rfl
135   -- The coordinates of `1 ⊗ df` in the basis `1 ⊗ dx_i` are `df(x̄)`.
136   have hcoord : ∀ f : A, (1 : R) ⊗ₜ[A] D k A f = ∑ i, quotientGradient I f i • tb i := by
137     intro f
138     apply tb.repr.injective
139     ext i
140     rw [Algebra.TensorProduct.basis_repr_tmul, map_sum]
141     simp [tb, quotientGradient, Finsupp.single_apply]
142   -- Hence the image of `t ∈ R ⊗ Ω_{K[x]/K}` in `Ω_{R/K}` is `δ` of its coordinates.
143   have hmap : ∀ ξ : Fin m → R, mapBaseChange k A R (∑ i, ξ i • tb i) = quotientKaehlerMap I ξ := by
144     intro ξ
145     rw [hδ, map_sum]
146     simp_rw [map_smul, htb]
147   have hsurj : Function.Surjective (algebraMap A R) := Ideal.Quotient.mk_surjective
148   refine ⟨?_, le_antisymm ?_ ?_⟩
149   · -- `Ω_{R/K}` is spanned by the `dx̄_i`.
150     rw [eq_top_iff]
151     intro ω _
152     obtain ⟨t, rfl⟩ := mapBaseChange_surjective k A R hsurj ω
153     refine ⟨tb.equivFun t, ?_⟩
154     rw [← hmap, tb.sum_equivFun]
155   · -- `ξ ∈ ker δ`: `t = Σ ξ_i ⊗ dx_i` lies in the kernel of `R ⊗ Ω_{K[x]/K} → Ω_{R/K}`,
156     -- hence in the image of `𝔭/𝔭²`, so `t = 1 ⊗ df` for some `f ∈ 𝔭` and `ξ = df(x̄)`.
157     intro ξ h
158     have hker : (∑ i, ξ i • tb i) ∈ LinearMap.ker (mapBaseChange k A R) := by
159       rw [LinearMap.mem_ker, hmap]
160       exact h
161     obtain ⟨c, hc⟩ := (exact_kerCotangentToTensor_mapBaseChange k A R hsurj _).mp hker
162     obtain ⟨⟨f, hf⟩, rfl⟩ := Ideal.toCotangent_surjective _ c
163     rw [kerCotangentToTensor_toCotangent] at hc
164     have hfI : f ∈ I := by
165       simpa [RingHom.mem_ker, Ideal.Quotient.eq_zero_iff_mem] using hf
166     have hξ : ξ = quotientGradient I f := by
167       have := congrArg tb.equivFun ((hcoord f).symm.trans hc)
168       simp only [map_sum, map_smul] at this
169       funext i
170       have hi := congrFun this i
171       simpa [Finsupp.single_apply] using hi.symm
172     rw [hξ]
173     exact Submodule.subset_span ⟨⟨f, hfI⟩, rfl⟩
174   · -- `δ(df(x̄)) = d(f(x̄)) = 0` for `f ∈ 𝔭`.
175     rw [Submodule.span_le]
176     rintro _ ⟨⟨f, hf⟩, rfl⟩
177     rw [SetLike.mem_coe, LinearMap.mem_ker, ← hmap, ← hcoord, mapBaseChange_tmul, h1, map_D]
178     change D k R (Ideal.Quotient.mk I f) = 0
179     rw [(Ideal.Quotient.eq_zero_iff_mem).2 hf, map_zero]
180 
181 end ExactSequence
182 
183 /-- A span is carried into the span of the image under a scalar extension `A → B`. -/
184 theorem algebraMap_comp_mem_span {A B ι : Type*} [CommRing A] [CommRing B] [Algebra A B] {n : ℕ}
185     (S : ι → Fin n → A) {v : Fin n → A} (hv : v ∈ Submodule.span A (Set.range S)) :
186     (fun i ↦ algebraMap A B (v i)) ∈
187       Submodule.span B (Set.range fun j i ↦ algebraMap A B (S j i)) := by
188   induction hv using Submodule.span_induction with
189   | mem w hw =>
190       obtain ⟨j, rfl⟩ := hw
191       exact Submodule.subset_span ⟨j, rfl⟩
192   | zero =>
193       convert Submodule.zero_mem (Submodule.span B (Set.range fun j i ↦ algebraMap A B (S j i)))
194       simp
195   | add w w' _ _ hw hw' =>
196       convert Submodule.add_mem _ hw hw' using 1
197       funext i
198       simp
199   | smul a w _ hw =>
200       convert Submodule.smul_mem _ (algebraMap A B a) hw using 1
201       funext i
202       simp
203 
204 section Localization
205 
206 variable {k F : Type*} [Field k] [Field F] [Algebra k F] {m : ℕ}
207   (I : Ideal (MvPolynomial (Fin m) k)) [I.IsPrime]
208   [Algebra (MvPolynomial (Fin m) k ⧸ I) F] [IsScalarTower k (MvPolynomial (Fin m) k ⧸ I) F]
209   [IsFractionRing (MvPolynomial (Fin m) k ⧸ I) F]
210 
211 local notation "R" => MvPolynomial (Fin m) k ⧸ I
212 
213 /-- `df(x̄) ∈ F^n` for an equation `f`. -/
214 noncomputable def genericGradient (f : MvPolynomial (Fin m) k) : Fin m → F :=
215   fun i ↦ algebraMap R F (quotientGradient I f i)
216 
217 /-- `ξ ↦ Σ ξ_i dx̄_i`, from `F^n` to `Ω_{F/K}`. -/
218 noncomputable def fieldKaehlerMap : (Fin m → F) →ₗ[F] Ω[F⁄k] :=
219   Fintype.linearCombination F fun i ↦
220     D k F (GenericPointKaehlerConormal.genericPoint I F i)
221 
222 /-- **Localization of the exact sequence.**  `Ω_{S⁻¹R/K} = S⁻¹ Ω_{R/K}` for
223 `S = R ∖ {0}` (Hartshorne, Prop. II.8.2A), and localization is exact, so
224 `Ω_{F/K} = F^n / span_F {df(x̄) : f ∈ 𝔭}`. -/
225 theorem fieldKaehlerMap_exact :
226     LinearMap.range (fieldKaehlerMap (F := F) I) = ⊤ ∧
227       LinearMap.ker (fieldKaehlerMap (F := F) I) =
228         Submodule.span F (Set.range fun f : I ↦ genericGradient (F := F) I f.1) := by
229   classical
230   obtain ⟨hrangeR, hkerR⟩ := quotientKaehlerMap_exact I
231   let φ := KaehlerDifferential.map k k R F
232   have hδF : ∀ ξ : Fin m → F, fieldKaehlerMap I ξ =
233       ∑ i, ξ i • D k F (GenericPointKaehlerConormal.genericPoint I F i) := fun ξ ↦
234     Fintype.linearCombination_apply _ _ _
235   have hδR : ∀ ξ : Fin m → R, quotientKaehlerMap I ξ =
236       ∑ i, ξ i • D k R (Ideal.Quotient.mk I (MvPolynomial.X i)) := fun ξ ↦
237     Fintype.linearCombination_apply _ _ _
238   -- `Ω_{R/K} → Ω_{F/K}` sends `Σ ξ_i dx̄_i` to `Σ ξ_i dx̄_i`.
239   have hφ : ∀ ξ : Fin m → R, φ (quotientKaehlerMap I ξ) =
240       fieldKaehlerMap I (fun i ↦ algebraMap R F (ξ i)) := by
241     intro ξ
242     rw [hδR, hδF, map_sum]
243     refine Finset.sum_congr rfl fun i _ ↦ ?_
244     rw [map_smul, map_D]
245     exact (algebraMap_smul F (ξ i) (D k F (GenericPointKaehlerConormal.genericPoint I F i))).symm
246   refine ⟨?_, le_antisymm ?_ ?_⟩
247   · -- `Ω_{F/K}` is spanned by the images of `Ω_{R/K} = δ_R(R^n)`.
248     rw [eq_top_iff, ← span_range_map_derivation_of_isLocalization k R F (nonZeroDivisors R),
249       Submodule.span_le]
250     rintro _ ⟨r, rfl⟩
251     obtain ⟨ξ, hξ⟩ : D k R r ∈ LinearMap.range (quotientKaehlerMap I) := by
252       rw [hrangeR]; exact Submodule.mem_top
253     refine ⟨fun i ↦ algebraMap R F (ξ i), ?_⟩
254     rw [← hφ, hξ]
255     rfl
256   · -- Clear denominators, `ξ = b⁻¹ ξ'`; then `Σ ξ'_i dx̄_i` dies in `F ⊗ Ω_{R/K}`, so
257     -- `c Σ ξ'_i dx̄_i = 0` in `Ω_{R/K}` for some `c ≠ 0`, and `c ξ' ∈ span_R {df(x̄)}`.
258     intro ξ hξ
259     rw [LinearMap.mem_ker] at hξ
260     obtain ⟨b, hb⟩ := IsLocalization.exist_integer_multiples_of_finite (nonZeroDivisors R) ξ
261     choose ξ' hξ' using hb
262     have hzero : φ (quotientKaehlerMap I ξ') = 0 := by
263       rw [hφ]
264       have : (fun i ↦ algebraMap R F (ξ' i)) = (algebraMap R F b) • ξ := by
265         funext i
266         rw [hξ' i, Pi.smul_apply, Algebra.smul_def, smul_eq_mul]
267       rw [this, map_smul, hξ, smul_zero]
268     obtain ⟨c, hc⟩ := (IsLocalizedModule.eq_zero_iff (nonZeroDivisors R) φ).mp hzero
269     have hmem : (c : R) • ξ' ∈ Submodule.span R (Set.range fun f : I ↦ quotientGradient I f.1) := by
270       rw [← hkerR, LinearMap.mem_ker, map_smul]
271       exact hc
272     have hF := algebraMap_comp_mem_span (B := F) _ hmem
273     have hb0 : algebraMap R F b ≠ 0 := IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors b.2
274     have hc0 : algebraMap R F c ≠ 0 := IsFractionRing.to_map_ne_zero_of_mem_nonZeroDivisors c.2
275     have hξeq : ξ = (algebraMap R F c * algebraMap R F b)⁻¹ •
276         (fun i ↦ algebraMap R F (((c : R) • ξ') i)) := by
277       funext i
278       simp only [Pi.smul_apply, smul_eq_mul, map_mul, hξ' i]
279       rw [Algebra.smul_def]
280       field_simp
281     rw [hξeq]
282     exact Submodule.smul_mem _ _ hF
283   · -- `δ_F(df(x̄))` is the image of `δ_R(df(x̄)) = 0`.
284     rw [Submodule.span_le]
285     rintro _ ⟨⟨f, hf⟩, rfl⟩
286     have hR : quotientKaehlerMap I (quotientGradient I f) = 0 := by
287       rw [← LinearMap.mem_ker, hkerR]
288       exact Submodule.subset_span ⟨⟨f, hf⟩, rfl⟩
289     rw [SetLike.mem_coe, LinearMap.mem_ker]
290     have := hφ (quotientGradient I f)
291     rw [hR, map_zero] at this
292     exact this.symm
293 
294 end Localization
295 
296 /-- **Lemma 5.12(a), `dim Θ_y = dim Ω_{F/k}`.**  By the exact sequence and its
297 localization (`fieldKaehlerMap_exact`), `span_F {df(x̄) : f ∈ 𝔭}` has dimension
298 `n − dim_F Ω_{F/K}`.  Rank does not change under the field extension `F ⊆ E`
299 (in the paper `E = κ((t))`), so `span_E {df_y : f ∈ 𝔭}` has the same dimension,
300 and `Θ_y = ⋂_f ker df_y` has dimension `n − (n − dim_F Ω_{F/K})`. -/
301 theorem generic_tangent_finrank_eq_component_kaehler_finrank
302     {k F E : Type u} [Field k] [Field F] [Field E]
303     [Algebra k F] [Algebra k E] [Algebra F E] [IsScalarTower k F E]
304     {m : ℕ} {I : Ideal (MvPolynomial (Fin m) k)} [I.IsPrime]
305     [Algebra (MvPolynomial (Fin m) k ⧸ I) F]
306     [IsScalarTower k (MvPolynomial (Fin m) k ⧸ I) F]
307     [IsFractionRing (MvPolynomial (Fin m) k ⧸ I) F] :
308     Module.finrank E
309         (zariskiTangentSpace
310           (fun i ↦ algebraMap F E
311             (GenericPointKaehlerConormal.genericPoint I F i))
312           (I.map (MvPolynomial.map (algebraMap k E)))) =
313       Module.finrank F (Ω[F⁄k]) := by
314   classical
315   let yF := GenericPointKaehlerConormal.genericPoint I F
316   let yE : Fin m → E := fun i ↦ algebraMap F E (yF i)
317   let IE : Ideal (MvPolynomial (Fin m) E) := I.map (MvPolynomial.map (algebraMap k E))
318   obtain ⟨hrange, hker⟩ := fieldKaehlerMap_exact (F := F) I
319   -- `dim_F span_F {df(x̄)} = n − dim_F Ω_{F/K}`.
320   let T : Submodule F (Fin m → F) :=
321     Submodule.span F (Set.range fun f : I ↦ genericGradient (F := F) I f.1)
322   have hTdim : Module.finrank F T + Module.finrank F (Ω[F⁄k]) = m := by
323     have h := LinearMap.finrank_range_add_finrank_ker (fieldKaehlerMap (F := F) I)
324     rw [hrange, hker, finrank_top, Module.finrank_fin_fun] at h
325     rw [add_comm]
326     exact h
327   -- Rank does not change under `F ⊆ E`.
328   let gE : I → Fin m → E := fun f i ↦ algebraMap F E (genericGradient (F := F) I f.1 i)
329   let TE : Submodule E (Fin m → E) := Submodule.span E (Set.range gE)
330   have hTE : Module.finrank E TE = Module.finrank F T := by
331     let b := Module.finBasis F T
332     let z : Fin (Module.finrank F T) → Fin m → F := fun j ↦ (b j : Fin m → F)
333     have hliF : LinearIndependent F z :=
334       b.linearIndependent.map' T.subtype (Submodule.ker_subtype T)
335     have hli : LinearIndependent E (fun j i ↦ algebraMap F E (z j i)) :=
336       (linearIndependent_algebraMap_comp_iff (R := F) (S := E) (ι' := Fin m)).2 hliF
337     have hspanz : Submodule.span F (Set.range z) = T := by
338       have h := congrArg (Submodule.map T.subtype) b.span_eq
339       rw [Submodule.map_span, ← Set.range_comp, Submodule.map_top, Submodule.range_subtype] at h
340       exact h
341     have hTEeq : TE = Submodule.span E (Set.range fun j i ↦ algebraMap F E (z j i)) := by
342       apply le_antisymm
343       · rw [Submodule.span_le]
344         rintro _ ⟨f, rfl⟩
345         have hf : genericGradient (F := F) I f.1 ∈ Submodule.span F (Set.range z) := by
346           rw [hspanz]
347           exact Submodule.subset_span ⟨f, rfl⟩
348         exact algebraMap_comp_mem_span (B := E) z hf
349       · rw [Submodule.span_le]
350         rintro _ ⟨j, rfl⟩
351         exact algebraMap_comp_mem_span (B := E) (fun f : I ↦ genericGradient (F := F) I f.1)
352           (b j).2
353     rw [hTEeq, finrank_span_eq_card hli, Fintype.card_fin]
354   -- `df_y` for `f ∈ 𝔭` is the image of `df(x̄)`, and `f(y) = 0`.
355   have hevalF : ∀ p : MvPolynomial (Fin m) k, MvPolynomial.eval₂ (algebraMap k F) yF p =
356       algebraMap (MvPolynomial (Fin m) k ⧸ I) F (Ideal.Quotient.mk I p) := by
357     have hhom : MvPolynomial.aeval yF =
358         (IsScalarTower.toAlgHom k (MvPolynomial (Fin m) k ⧸ I) F).comp
359           (Ideal.Quotient.mkₐ k I) := by
360       apply MvPolynomial.algHom_ext
361       intro i
362       simp [yF, GenericPointKaehlerConormal.genericPoint]
363     intro p
364     exact congrArg (fun φ ↦ φ p) hhom
365   have hevalE : ∀ p : MvPolynomial (Fin m) k, MvPolynomial.eval₂ (algebraMap k E) yE p =
366       algebraMap F E (MvPolynomial.eval₂ (algebraMap k F) yF p) := by
367     intro p
368     rw [MvPolynomial.eval₂_comp_left, ← IsScalarTower.algebraMap_eq k F E]
369     rfl
370   have hdf : ∀ f : MvPolynomial (Fin m) k, ∀ i,
371       Stafford38.Geometry.CoisotropicTranslation.differentialAt yE
372         (MvPolynomial.map (algebraMap k E) f) i =
373           algebraMap F E (genericGradient (F := F) I f i) := by
374     intro f i
375     simp only [Stafford38.Geometry.CoisotropicTranslation.differentialAt,
376       MvPolynomial.pderiv_map, MvPolynomial.eval_map]
377     rw [hevalE, hevalF]
378     rfl
379   have hzero : ∀ g ∈ I, MvPolynomial.eval₂ (algebraMap k E) yE g = 0 := by
380     intro g hg
381     rw [hevalE, hevalF, (Ideal.Quotient.eq_zero_iff_mem).2 hg, map_zero, map_zero]
382   -- `Θ_y = ⋂_{f ∈ 𝔭} ker df_y`.
383   let C := TE.map (coordinateCovectorLinear (k := E) (n := m))
384   have hC : Module.finrank E C = Module.finrank E TE :=
385     (Submodule.equivMapOfInjective _ coordinateCovector_injective TE).finrank_eq.symm
386   have hΘ : zariskiTangentSpace yE IE = C.dualCoannihilator := by
387     apply le_antisymm
388     · intro v hv
389       rw [Submodule.mem_dualCoannihilator]
390       rintro _ ⟨t, ht, rfl⟩
391       induction ht using Submodule.span_induction with
392       | mem t ht =>
393           obtain ⟨f, rfl⟩ := ht
394           have hfE : MvPolynomial.map (algebraMap k E) f.1 ∈ IE :=
395             Ideal.mem_map_of_mem _ f.2
396           have h := (Submodule.mem_dualCoannihilator _).1 hv _
397             (Submodule.subset_span ⟨⟨_, hfE⟩, rfl⟩)
398           rw [differentialCovector_apply] at h
399           change ∑ i, gE f i * v i = 0
400           simpa [gE, hdf] using h
401       | zero => simp
402       | add t t' _ _ ht ht' => simp [ht, ht']
403       | smul a t _ ht => simp [ht]
404     · intro v hv
405       rw [Submodule.mem_dualCoannihilator] at hv
406       apply mem_zariskiTangentSpace_map_of_forall_mem I yE v hzero
407       intro g hg
408       have h := hv _ ⟨gE ⟨g, hg⟩, Submodule.subset_span ⟨⟨g, hg⟩, rfl⟩, rfl⟩
409       change ∑ i, gE ⟨g, hg⟩ i * v i = 0 at h
410       have h' : ∀ i, MvPolynomial.eval₂ (algebraMap k E) yE (MvPolynomial.pderiv i g) =
411           gE ⟨g, hg⟩ i := by
412         intro i
413         have := hdf g i
414         simp only [Stafford38.Geometry.CoisotropicTranslation.differentialAt,
415           MvPolynomial.pderiv_map, MvPolynomial.eval_map] at this
416         exact this
417       simp_rw [h']
418       exact h
419   have hdual := Subspace.finrank_add_finrank_dualCoannihilator_eq C
420   rw [← hΘ, hC, hTE, Module.finrank_fin_fun] at hdual
421   change Module.finrank E (zariskiTangentSpace yE IE) = _
422   omega
423 
424 /-- **`dim Ω_{F/k} = trdeg_k F`.**  For a field `F` generated over `k` by
425 finitely many elements, in characteristic zero, the Kähler rank is the
426 transcendence degree (Matsumura, Thm. 26.5), which is finite. -/
427 theorem component_kaehler_finrank_eq_trdeg
428     {k F : Type u} [Field k] [CharZero k] [Field F] [Algebra k F]
429     {m : ℕ} (y : Fin m → F)
430     (hgen : IntermediateField.adjoin k (Set.range y) = ⊤) :
431     (Module.finrank F (Ω[F⁄k]) : Cardinal) = Algebra.trdeg k F ∧
432       Module.finrank F (Ω[F⁄k]) = (Algebra.trdeg k F).toNat := by
433   classical
434   have : Algebra.IsAlgebraic (Algebra.adjoin k (Set.range y)) F := by
435     rw [← IntermediateField.isAlgebraic_adjoin_iff_top, hgen,
436       Algebra.isAlgebraic_iff_isIntegral]
437     exact Algebra.isIntegral_of_surjective IntermediateField.topEquiv.surjective
438   obtain ⟨t, hts, ht⟩ := exists_isTranscendenceBasis_subset (R := k) (Set.range y)
439   have htfin : t.Finite := (Set.finite_range y).subset hts
440   let : Fintype t := htfin.fintype
441   have hrank : Module.finrank F (Ω[F⁄k]) = Fintype.card t :=
442     kaehlerFinrankOfTranscendenceBasis k F t (↑) ht
443   have hcard : (Fintype.card t : Cardinal) = Algebra.trdeg k F := by
444     rw [← Cardinal.mk_fintype]
445     exact (definition_5_1_g_h ht).2
446   refine ⟨by rw [hrank, hcard], ?_⟩
447   rw [← hcard, Cardinal.toNat_natCast, hrank]
448 
449 end
450 
451 #print axioms mem_zariskiTangentSpace_map_of_forall_mem
452 #print axioms eval₂_genericPoint_eq_zero
453 #print axioms quotientKaehlerMap_exact
454 #print axioms fieldKaehlerMap_exact
455 #print axioms generic_tangent_finrank_eq_component_kaehler_finrank
456 #print axioms component_kaehler_finrank_eq_trdeg
457 
458 end Stafford38.Paper.Section5
459