Stafford38/Geometry/EtaleCotangentBasis.lean

This project (Stafford38) · 1029fdb382eee06e7b59bcf32801f40931e2079a

1 module
2 public import Mathlib.RingTheory.Etale.Kaehler
3 public import Mathlib.RingTheory.TensorProduct.Free
4 public import Mathlib.LinearAlgebra.Basis.Basic
5 
6 @[expose] public section
7 
8 set_option autoImplicit false
9 
10 open scoped TensorProduct
11 open Module
12 
13 namespace Stafford38.Geometry.EtaleCotangentBasis
14 
15 universe u v w
16 
17 variable {k : Type u} [CommRing k]
18 variable {σ : Type v} [Fintype σ] [DecidableEq σ]
19 variable {B : Type w} [CommRing B]
20 variable [Algebra (MvPolynomial σ k) B]
21 variable [Algebra k B] [IsScalarTower k (MvPolynomial σ k) B]
22 variable [Algebra.FormallyEtale (MvPolynomial σ k) B]
23 
24 /-- Polynomial coordinate differentials remain a basis after a formally étale extension. -/
25 noncomputable def basisOfFormallyEtale :
26     Basis σ B Ω[B⁄k] := by
27   exact (Algebra.TensorProduct.basis B
28     (KaehlerDifferential.mvPolynomialBasis k σ)).map
29       (KaehlerDifferential.tensorKaehlerEquivOfFormallyEtale k
30         (MvPolynomial σ k) B)
31 
32 /-- The transported basis is represented by the actual images of the polynomial coordinates. -/
33 theorem basisOfFormallyEtale_apply (i : σ) :
34     basisOfFormallyEtale (k := k) (σ := σ) i =
35       KaehlerDifferential.D k B
36         (algebraMap (MvPolynomial σ k) B (MvPolynomial.X i)) := by
37   let E := KaehlerDifferential.tensorKaehlerEquivOfFormallyEtale k
38     (MvPolynomial σ k) B
39   have hb : (Algebra.TensorProduct.basis B
40       (KaehlerDifferential.mvPolynomialBasis k σ)) i =
41       1 ⊗ₜ[MvPolynomial σ k]
42         KaehlerDifferential.D k (MvPolynomial σ k) (MvPolynomial.X i) := by
43     simp [Algebra.TensorProduct.basis_apply,
44       KaehlerDifferential.mvPolynomialBasis_apply]
45   change E ((Algebra.TensorProduct.basis B
46       (KaehlerDifferential.mvPolynomialBasis k σ)) i) = _
47   rw [← E.apply_symm_apply (KaehlerDifferential.D k B
48     (algebraMap (MvPolynomial σ k) B (MvPolynomial.X i)))]
49   rw [KaehlerDifferential.tensorKaehlerEquivOfFormallyEtale_symm_D_algebraMap]
50   exact congrArg E hb
51 
52 /-- The transported coordinate basis remains a basis after any field-valued scalar extension. -/
53 noncomputable def basisAfterPoint
54     {L : Type*} [Field L] [Algebra B L] :
55     Basis σ L (L ⊗[B] Ω[B⁄k]) :=
56   Algebra.TensorProduct.basis L (basisOfFormallyEtale (k := k) (σ := σ))
57 
58 
59 /-- Its scalar-extended basis vectors are the scalar extensions of the actual coordinate differentials. -/
60 theorem basisAfterPoint_apply
61     {L : Type*} [Field L] [Algebra B L] (i : σ) :
62     basisAfterPoint (k := k) (σ := σ) (B := B) (L := L) i =
63       1 ⊗ₜ[B] KaehlerDifferential.D k B
64         (algebraMap (MvPolynomial σ k) B (MvPolynomial.X i)) := by
65   change (Algebra.TensorProduct.basis L
66       (basisOfFormallyEtale (k := k) (σ := σ))) i = _
67   rw [Algebra.TensorProduct.basis_apply, basisOfFormallyEtale_apply]
68 
69 /-- Dual basis functionals define actual derivations on the étale algebra. -/
70 noncomputable def coordinateDerivation
71     {L : Type*} [CommRing L] [Algebra B L] [Algebra k L]
72     [IsScalarTower k B L] (i : σ) : Derivation k B L :=
73   KaehlerDifferential.linearMapEquivDerivation k B
74     ((basisOfFormallyEtale (k := k) (σ := σ)).constr B
75       (fun j => if j = i then (1 : L) else 0))
76 
77 /-- The derivation specified by its values on the étale polynomial parameters. -/
78 noncomputable def derivationFromValues
79     {L : Type*} [CommRing L] [Algebra B L] [Algebra k L]
80     [IsScalarTower k B L] (v : σ → L) : Derivation k B L :=
81   KaehlerDifferential.linearMapEquivDerivation k B
82     ((basisOfFormallyEtale (k := k) (σ := σ)).constr B v)
83 
84 theorem coordinateDerivation_apply_parameter
85     {L : Type*} [CommRing L] [Algebra B L] [Algebra k L]
86     [IsScalarTower k B L] (i j : σ) :
87     coordinateDerivation (k := k) (σ := σ) i
88       (algebraMap (MvPolynomial σ k) B (MvPolynomial.X j)) =
89         if j = i then (1 : L) else 0 := by
90   rw [coordinateDerivation,
91     KaehlerDifferential.linearMapEquivDerivation_apply_apply,
92     ← basisOfFormallyEtale_apply, Basis.constr_basis]
93 
94 /-- The coordinate values of `derivationFromValues` are exactly the supplied values. -/
95 theorem derivationFromValues_apply_parameter
96     {L : Type*} [CommRing L] [Algebra B L] [Algebra k L]
97     [IsScalarTower k B L] (v : σ → L) (i : σ) :
98     derivationFromValues (k := k) (σ := σ) (B := B) v
99       (algebraMap (MvPolynomial σ k) B (MvPolynomial.X i)) = v i := by
100   rw [derivationFromValues,
101     KaehlerDifferential.linearMapEquivDerivation_apply_apply,
102     ← basisOfFormallyEtale_apply, Basis.constr_basis]
103 
104 /-- Every derivation is uniquely determined by, and reconstructed from, its
105 values on the polynomial parameters.  Thus the displayed derivations are an
106 actual basis of the tangent directions, not merely candidate vectors. -/
107 theorem derivation_eq_from_parameter_values
108     {L : Type*} [CommRing L] [Algebra B L] [Algebra k L]
109     [IsScalarTower k B L] (D : Derivation k B L) :
110     derivationFromValues (k := k) (σ := σ) (B := B)
111       (fun i => D (algebraMap (MvPolynomial σ k) B (MvPolynomial.X i))) = D := by
112   let E : (Ω[B⁄k] →ₗ[B] L) ≃ₗ[B] Derivation k B L :=
113     KaehlerDifferential.linearMapEquivDerivation k B
114   let b : Basis σ B Ω[B⁄k] := basisOfFormallyEtale (k := k) (σ := σ)
115   let v := fun i => D (algebraMap (MvPolynomial σ k) B (MvPolynomial.X i))
116   let D' := derivationFromValues (k := k) (σ := σ) (B := B) v
117   calc
118     D' = E (E.symm D') := (E.apply_symm_apply _).symm
119     _ = E (E.symm D) := by
120       congr 1
121       apply b.ext
122       intro i
123       change (E.symm D') (basisOfFormallyEtale (k := k) (σ := σ) i) =
124         (E.symm D) (basisOfFormallyEtale (k := k) (σ := σ) i)
125       have hbi := basisOfFormallyEtale_apply (k := k) (σ := σ) (B := B) i
126       rw [hbi]
127       simp only [E, KaehlerDifferential.linearMapEquivDerivation_symm_apply,
128         Derivation.liftKaehlerDifferential_comp_D]
129       rw [derivationFromValues_apply_parameter]
130     _ = D := E.apply_symm_apply D
131 
132 /-- Applying a scalar-extension map to a coordinate derivative gives the
133 coordinate derivative with values in the target algebra. -/
134 theorem coordinateDerivation_algebraMap
135     {L : Type*} [CommRing L] [Algebra B L] [Algebra k L]
136     [IsScalarTower k B L] [IsScalarTower B L L]
137     (i : σ) (b : B) :
138     algebraMap B L (coordinateDerivation (k := k) (σ := σ) (B := B) (L := B) i b) =
139       coordinateDerivation (k := k) (σ := σ) (B := B) (L := L) i b := by
140   let D : Derivation k B L := (Algebra.linearMap B L).compDer
141     (coordinateDerivation (k := k) (σ := σ) (B := B) (L := B) i)
142   have hD : D = coordinateDerivation (k := k) (σ := σ) (B := B) (L := L) i := by
143     rw [← derivation_eq_from_parameter_values (k := k) (σ := σ) (B := B) D,
144       ← derivation_eq_from_parameter_values (k := k) (σ := σ) (B := B)
145         (coordinateDerivation (k := k) (σ := σ) (B := B) (L := L) i)]
146     congr 1
147     funext j
148     change algebraMap B L
149       (coordinateDerivation (k := k) (σ := σ) (B := B) (L := B) i
150         (algebraMap (MvPolynomial σ k) B (MvPolynomial.X j))) =
151       coordinateDerivation (k := k) (σ := σ) (B := B) (L := L) i
152         (algebraMap (MvPolynomial σ k) B (MvPolynomial.X j))
153     rw [coordinateDerivation_apply_parameter, coordinateDerivation_apply_parameter]
154     split_ifs <;> simp
155   exact congrArg (fun E : Derivation k B L => E b) hD
156 
157 /-- If two formally-etale charts carry the same polynomial parameters to one
158 another, the coordinate derivation on the larger chart restricts to the
159 coordinate derivation on the smaller chart.  The proof uses only the
160 parameter-value uniqueness above; no separate uniqueness argument is needed. -/
161 theorem coordinateDerivation_compAlgebraMap
162     {C : Type*} [CommRing C]
163     [Algebra (MvPolynomial σ k) C] [Algebra k C]
164     [IsScalarTower k (MvPolynomial σ k) C]
165     [Algebra.FormallyEtale (MvPolynomial σ k) C]
166     [Algebra B C] [IsScalarTower k B C] [IsScalarTower B C C]
167     (hparam : ∀ j : σ,
168       algebraMap B C (algebraMap (MvPolynomial σ k) B (MvPolynomial.X j)) =
169         algebraMap (MvPolynomial σ k) C (MvPolynomial.X j))
170     (i : σ) :
171     (Algebra.linearMap B C).compDer
172         (coordinateDerivation (k := k) (σ := σ) (B := B) (L := B) i) =
173       (coordinateDerivation (k := k) (σ := σ) (B := C) (L := C) i).compAlgebraMap B := by
174   let Dleft : Derivation k B C :=
175     (Algebra.linearMap B C).compDer
176       (coordinateDerivation (k := k) (σ := σ) (B := B) (L := B) i)
177   let Dright : Derivation k B C :=
178     (coordinateDerivation (k := k) (σ := σ) (B := C) (L := C) i).compAlgebraMap B
179   have hleft (j : σ) :
180       Dleft (algebraMap (MvPolynomial σ k) B (MvPolynomial.X j)) =
181         if j = i then (1 : C) else 0 := by
182     change algebraMap B C
183       (coordinateDerivation (k := k) (σ := σ) (B := B) (L := B) i
184         (algebraMap (MvPolynomial σ k) B (MvPolynomial.X j))) = _
185     rw [coordinateDerivation_apply_parameter]
186     simp
187   have hright (j : σ) :
188       Dright (algebraMap (MvPolynomial σ k) B (MvPolynomial.X j)) =
189         if j = i then (1 : C) else 0 := by
190     change coordinateDerivation (k := k) (σ := σ) (B := C) (L := C) i
191       (algebraMap B C (algebraMap (MvPolynomial σ k) B (MvPolynomial.X j))) = _
192     rw [hparam j]
193     exact coordinateDerivation_apply_parameter (k := k) (σ := σ) i j
194   change Dleft = Dright
195   calc
196     Dleft = derivationFromValues (k := k) (σ := σ) (B := B) (L := C)
197         (fun j => Dleft (algebraMap (MvPolynomial σ k) B (MvPolynomial.X j))) :=
198       (derivation_eq_from_parameter_values Dleft).symm
199     _ = derivationFromValues (k := k) (σ := σ) (B := B) (L := C)
200         (fun j => Dright (algebraMap (MvPolynomial σ k) B (MvPolynomial.X j))) := by
201       congr 1
202       funext j
203       rw [hleft j, hright j]
204     _ = Dright := derivation_eq_from_parameter_values Dright
205 
206 /-- The coordinate derivations form a basis: every derivation is their finite
207 linear combination with coefficients given by its parameter derivatives. -/
208 theorem derivation_eq_sum_coordinateDerivations
209     {L : Type*} [CommRing L] [Algebra B L] [Algebra k L]
210     [IsScalarTower k B L] (D : Derivation k B L) :
211     D = ∑ i, D (algebraMap (MvPolynomial σ k) B (MvPolynomial.X i)) •
212       coordinateDerivation (k := k) (σ := σ) (B := B) i := by
213   let E : Derivation k B L := ∑ i, D (algebraMap (MvPolynomial σ k) B (MvPolynomial.X i)) •
214     coordinateDerivation (k := k) (σ := σ) (B := B) i
215   have hcoord : ∀ j, E (algebraMap (MvPolynomial σ k) B (MvPolynomial.X j)) =
216       D (algebraMap (MvPolynomial σ k) B (MvPolynomial.X j)) := by
217     intro j
218     change (Derivation.coeFnAddMonoidHom
219       (∑ i, D (algebraMap (MvPolynomial σ k) B (MvPolynomial.X i)) •
220         coordinateDerivation (k := k) (σ := σ) (B := B) i))
221         (algebraMap (MvPolynomial σ k) B (MvPolynomial.X j)) = _
222     rw [map_sum]
223     simp [Derivation.smul_apply, coordinateDerivation_apply_parameter]
224   calc
225     D = derivationFromValues (k := k) (σ := σ) (B := B)
226         (fun i => D (algebraMap (MvPolynomial σ k) B (MvPolynomial.X i))) :=
227           (derivation_eq_from_parameter_values D).symm
228     _ = derivationFromValues (k := k) (σ := σ) (B := B)
229         (fun i => E (algebraMap (MvPolynomial σ k) B (MvPolynomial.X i))) := by
230           congr 1
231           funext i
232           exact (hcoord i).symm
233     _ = E := derivation_eq_from_parameter_values E
234 
235 
236 end Stafford38.Geometry.EtaleCotangentBasis
237