AlgebraicAnalysis/DifferentialOperators/CoordinateGeneration.lean

AlgebraicAnalysis library · bbbbf3fc358ca8100b158cec4cf47f336ab70163

1 module
2 public import AlgebraicAnalysis.DifferentialOperators.Basic
3 public import AlgebraicAnalysis.LinearAlgebra.FiniteTaylorReconstruction
4 public import Mathlib.RingTheory.Derivation.Basic
5 
6 @[expose] public section
7 
8 /-!
9 # Generation from coordinates and coordinate derivations
10 
11 This is the presentation-free coordinate-elimination argument.  A finite
12 family of elements and dual derivations generates every intrinsic finite-order
13 differential operator, provided that commuting with all the coordinates
14 already characterizes multiplication operators.
15 -/
16 
17 namespace AlgebraicAnalysis.DifferentialOperators.CoordinateGeneration
18 
19 set_option maxHeartbeats 800000
20 
21 open AlgebraicAnalysis.DifferentialOperators
22 open AlgebraicAnalysis.FiniteTaylorReconstruction
23 
24 noncomputable section
25 
26 variable {k R : Type*} [Field k] [CharZero k] [CommRing R] [Algebra k R]
27 
28 private def delta (x : R) : Module.End k R →ₗ[k] Module.End k R :=
29   { toFun := fun P => commutator P x
30     map_add' := by
31       intro P Q
32       ext y
33       simp [commutator_apply, mul_add]
34       abel
35     map_smul' := by
36       intro c P
37       ext y
38       simp [commutator_apply, smul_sub] }
39 
40 private def rightComposition (D : Module.End k R) :
41     Module.End k R →ₗ[k] Module.End k R := LinearMap.mulRight k D
42 
43 omit [CharZero k] in
44 private lemma rightComposition_pow_apply (D : Module.End k R)
45     (a : ℕ) (P : Module.End k R) :
46     (rightComposition D ^ a) P = P * D ^ a := by
47   induction a with
48   | zero => simp [rightComposition]
49   | succ a ih =>
50       rw [pow_succ', Module.End.mul_apply, ih]
51       simp [rightComposition, pow_succ, mul_assoc]
52 
53 omit [CharZero k] in
54 private lemma delta_mul (x : R) (P Q : Module.End k R) :
55     delta x (P * Q) = delta x P * Q + P * delta x Q := by
56   simpa [delta, add_comm] using commutator_mul P Q x
57 
58 omit [CharZero k] in
59 private lemma delta_right_derivation (x : R) (D : Derivation k R R) :
60     delta x D.toLinearMap = multiplication (D x) := by
61   ext y
62   simp [delta, commutator_apply, multiplication_apply, mul_comm]
63 
64 omit [CharZero k] in
65 private lemma deltas_commute (x y : R) (P : Module.End k R) :
66     delta x (delta y P) = delta y (delta x P) := by
67   ext z
68   simp [delta, commutator_apply]
69   ring_nf
70 
71 omit [CharZero k] in
72 private lemma delta_iterate_preserves_kernel (x y : R) (a : ℕ)
73     (P : Module.End k R) (hP : delta y P = 0) :
74     delta y ((delta x ^ a) P) = 0 := by
75   induction a with
76   | zero => simpa using hP
77   | succ a ih =>
78       rw [pow_succ', Module.End.mul_apply]
79       rw [deltas_commute, ih]
80       exact (delta x).map_zero
81 
82 omit [CharZero k] in
83 private lemma right_derivation_preserves_kernel (y : R) (D : Derivation k R R)
84     (hxy : D y = 0) (a : ℕ) (P : Module.End k R)
85     (hP : delta y P = 0) :
86     delta y ((rightComposition D.toLinearMap ^ a) P) = 0 := by
87   induction a with
88   | zero => simpa using hP
89   | succ a ih =>
90       rw [pow_succ', Module.End.mul_apply]
91       change delta y (rightComposition D.toLinearMap
92         ((rightComposition D.toLinearMap ^ a) P)) = 0
93       rw [show rightComposition D.toLinearMap
94           ((rightComposition D.toLinearMap ^ a) P) =
95           (rightComposition D.toLinearMap ^ a) P * D.toLinearMap by rfl,
96         delta_mul, delta_right_derivation, hxy]
97       rw [ih, zero_mul, zero_add]
98       congr
99       ext z
100       simp [multiplication_apply]
101 
102 omit [CharZero k] in
103 private lemma delta_mem_order {m : ℕ} (x : R) (P : Module.End k R)
104     (hP : P ∈ order (k := k) (R := R) (m + 1)) :
105     delta x P ∈ order (k := k) (R := R) m := hP x
106 
107 omit [CharZero k] in
108 private lemma delta_pow_order_zero (m : ℕ) (x : R)
109     (P : Module.End k R) (hP : P ∈ order (k := k) (R := R) m) :
110     (delta x ^ (m + 1)) P = 0 := by
111   induction m generalizing P with
112   | zero =>
113       rw [pow_one]
114       exact hP x
115   | succ m ih =>
116       rw [pow_succ, Module.End.mul_apply]
117       exact ih (delta x P) (delta_mem_order x P hP)
118 
119 omit [CharZero k] in
120 private lemma delta_pow_after_zero (x : R) (m a : ℕ) (P : Module.End k R)
121     (h : (delta x ^ m) P = 0) :
122     (delta x ^ m) ((delta x ^ a) P) = 0 := by
123   rw [← Module.End.mul_apply, ← pow_add]
124   rw [Nat.add_comm]
125   rw [pow_add, Module.End.mul_apply, h, map_zero]
126 
127 omit [CharZero k] in
128 private lemma delta_mem_algebra (x : R) (P : Module.End k R)
129     (hP : P ∈ algebra (k := k) (R := R)) :
130     delta x P ∈ algebra (k := k) (R := R) := by
131   rcases hP with ⟨m, hm⟩
132   cases m with
133   | zero =>
134       refine ⟨0, ?_⟩
135       change commutator P x ∈ order 0
136       rw [hm x]
137       exact (order 0).zero_mem
138   | succ m => exact ⟨m, delta_mem_order x P hm⟩
139 
140 omit [CharZero k] in
141 private lemma delta_pow_mem_algebra (x : R) (a : ℕ)
142     (P : Module.End k R)
143     (hP : P ∈ algebra (k := k) (R := R)) :
144     (delta x ^ a) P ∈ algebra (k := k) (R := R) := by
145   induction a with
146   | zero => simpa using hP
147   | succ a ih =>
148       rw [pow_succ', Module.End.mul_apply]
149       exact delta_mem_algebra x _ ih
150 
151 private def projection (x : R) (D : Derivation k R R) (m : ℕ)
152     (P : Module.End k R) : Module.End k R :=
153   ∑ a ∈ Finset.range (m + 1),
154     ((-1 : k) ^ a / (a.factorial : k)) • ((delta x ^ a) P * D.toLinearMap ^ a)
155 
156 omit [CharZero k] in
157 private lemma projectorMapG_apply (x : R) (D : Derivation k R R) (m : ℕ)
158     (P : Module.End k R) :
159     projectorMapG m (rightComposition D.toLinearMap) (delta x) P =
160       projection x D m P := by
161   unfold projectorMapG projection
162   rw [LinearMap.sum_apply]
163   apply Finset.sum_congr rfl
164   intro a ha
165   simp only [LinearMap.smul_apply, Module.End.mul_apply]
166   rw [rightComposition_pow_apply]
167 
168 private lemma delta_derivation_pow (x : R) (D : Derivation k R R)
169     (hDx : D x = 1) : ∀ a : ℕ,
170     delta x (D.toLinearMap ^ a) = (a : k) • D.toLinearMap ^ (a - 1)
171   | 0 => by
172       ext y
173       simp [delta, commutator_apply, multiplication_apply]
174   | a + 1 => by
175       rw [pow_succ, delta_mul, delta_right_derivation, hDx,
176         delta_derivation_pow x D hDx a]
177       cases a with
178       | zero =>
179           ext y
180           simp [multiplication_apply]
181       | succ a =>
182           ext y
183           simp [pow_succ, add_mul, add_smul, multiplication_apply]
184 
185 private lemma projection_kernel (x : R) (D : Derivation k R R) (hDx : D x = 1)
186     (m : ℕ) (P : Module.End k R)
187     (hnil : (delta x ^ (m + 1)) P = 0) :
188     delta x (projection x D m P) = 0 := by
189   simp only [projection, map_sum]
190   have hterm (a : ℕ) :
191       delta x (((-1 : k) ^ a / (a.factorial : k)) •
192         ((delta x ^ a) P * D.toLinearMap ^ a)) =
193       ((-1 : k) ^ a / (a.factorial : k)) •
194         (((delta x ^ (a + 1)) P * D.toLinearMap ^ a) +
195           ((a : k) • ((delta x ^ a) P * D.toLinearMap ^ (a - 1)))) := by
196     rw [map_smul, delta_mul, delta_derivation_pow x D hDx]
197     rw [show delta x ((delta x ^ a) P) = (delta x ^ (a + 1)) P by
198       rw [pow_succ', Module.End.mul_apply]]
199     simp only [smul_add]
200     rw [mul_smul_comm, smul_smul]
201   simp_rw [hterm]
202   simp only [smul_add, Finset.sum_add_distrib]
203   rw [Finset.sum_range_succ, hnil]
204   simp only [zero_mul, smul_zero, add_zero]
205   rw [Finset.sum_range_succ']
206   simp only [Nat.cast_zero, zero_smul, zero_add]
207   have hcancel (a : ℕ) :
208       ((-1 : k) ^ a / (a.factorial : k)) •
209           ((delta x ^ (a + 1)) P * D.toLinearMap ^ a) +
210         ((-1 : k) ^ (a + 1) / ((a + 1).factorial : k)) •
211           ((a + 1 : k) •
212             ((delta x ^ (a + 1)) P * D.toLinearMap ^ a)) = 0 := by
213     have ha : ((a + 1 : ℕ) : k) ≠ 0 := by exact_mod_cast Nat.succ_ne_zero a
214     have hfac : ((a.factorial : ℕ) : k) ≠ 0 := by
215       exact_mod_cast Nat.factorial_ne_zero a
216     have hc : ((-1 : k) ^ a / (a.factorial : k)) +
217         ((-1 : k) ^ (a + 1) / ((a + 1).factorial : k)) * (a + 1 : k) = 0 := by
218       rw [Nat.factorial_succ, Nat.cast_mul, Nat.cast_succ]
219       field_simp [hfac, ha]
220       ring
221     rw [smul_smul, ← add_smul, hc, zero_smul]
222   simp only [smul_zero, add_zero]
223   rw [← Finset.sum_add_distrib]
224   apply Finset.sum_eq_zero
225   intro a ha
226   simpa [Nat.succ_sub_one] using hcancel a
227 
228 omit [CharZero k] in
229 private lemma projection_preserves_kernel (x y : R) (D : Derivation k R R)
230     (hDy : D y = 0) (m : ℕ) (P : Module.End k R)
231     (hP : delta y P = 0) : delta y (projection x D m P) = 0 := by
232   simp only [projection, map_sum, map_smul]
233   apply Finset.sum_eq_zero
234   intro a ha
235   rw [delta_mul]
236   have hpow : delta y (D.toLinearMap ^ a) = 0 := by
237     have h := right_derivation_preserves_kernel y D hDy a (1 : Module.End k R)
238       (by ext z; simp [delta, commutator_apply])
239     simpa [rightComposition_pow_apply] using h
240   rw [delta_iterate_preserves_kernel x y a P hP, hpow]
241   simp
242 
243 /-! A derivation is a finite-order operator.  This is exported separately from
244 the coordinate-generation theorem so concrete carriers can expose their
245 derivation generators without importing an application-specific predicate. -/
246 omit [CharZero k] in
247 theorem derivation_mem_algebra (D : Derivation k R R) :
248     D.toLinearMap ∈ algebra (k := k) (R := R) := by
249   refine ⟨1, ?_⟩
250   rw [mem_order_succ_iff]
251   intro r
252   change delta r D.toLinearMap ∈ order 0
253   rw [delta_right_derivation]
254   apply (mem_order_zero_iff_eq_multiplication _).2
255   ext z
256   simp [multiplication_apply]
257 
258 omit [CharZero k] in
259 private lemma projection_mem_algebra (x : R) (D : Derivation k R R) (m : ℕ)
260     (P : Module.End k R)
261     (hP : P ∈ algebra (k := k) (R := R)) : projection x D m P ∈ algebra := by
262   unfold projection
263   apply (algebra (k := k) (R := R)).sum_mem
264   intro a ha
265   apply (algebra (k := k) (R := R)).smul_mem
266   exact (algebra (k := k) (R := R)).mul_mem
267     (delta_pow_mem_algebra x a P hP)
268     ((algebra (k := k) (R := R)).pow_mem (derivation_mem_algebra D) a)
269 
270 /-- Finite-order variant: the coordinate-rigidity hypothesis is required only
271 for operators in `algebra`.  Every intrinsic finite-order differential
272 operator belongs to any linear subspace containing all multiplications and
273 stable under right composition by a finite dual coordinate frame.  No
274 multiplicative closure of the subspace, or commutation hypothesis among the
275 derivations, is required. -/
276 theorem mem_submodule_of_coordinates'
277     {n : ℕ} (x : Fin n → R) (D : Fin n → Derivation k R R)
278     (hdual : ∀ i j, D i (x j) = if i = j then 1 else 0)
279     (hcoordinate : ∀ P : Module.End k R, P ∈ algebra (k := k) (R := R) →
280       (∀ i, commutator P (x i) = 0) →
281         P = multiplication (P 1))
282     (H : Submodule k (Module.End k R))
283     (hmul : ∀ r : R, multiplication r ∈ H)
284     (hright : ∀ i Q, Q ∈ H → Q * (D i).toLinearMap ∈ H)
285     (P : Module.End k R)
286     (hP : P ∈ algebra (k := k) (R := R)) : P ∈ H := by
287   have hright_pow : ∀ i a (Q : Module.End k R), Q ∈ H →
288       Q * (D i).toLinearMap ^ a ∈ H := by
289     intro i a
290     induction a with
291     | zero =>
292         intro Q hQ
293         simpa using hQ
294     | succ a ih =>
295         intro Q hQ
296         rw [pow_succ, ← mul_assoc]
297         exact hright i _ (ih Q hQ)
298   have heliminate : ∀ l : List (Fin n), l.Nodup →
299       (∀ Q : Module.End k R,
300         Q ∈ algebra (k := k) (R := R) →
301         (∀ i ∈ l, delta (x i) Q = 0) → Q ∈ H) →
302       ∀ Q : Module.End k R,
303         Q ∈ algebra (k := k) (R := R) → Q ∈ H := by
304     intro l hnod
305     induction l with
306     | nil =>
307         intro hend Q hQ
308         exact hend Q hQ (by simp)
309     | cons i l ih =>
310         have hinot : i ∉ l := (List.nodup_cons.mp hnod).1
311         have hlnod : l.Nodup := (List.nodup_cons.mp hnod).2
312         intro hend
313         apply ih hlnod
314         intro Q hQ hkern
315         rcases hQ with ⟨m, hm⟩
316         have hnil : (delta (x i) ^ (m + 1)) Q = 0 :=
317           delta_pow_order_zero m (x i) Q hm
318         rw [reconstruction_all m (rightComposition (D i).toLinearMap)
319           (delta (x i)) Q hnil]
320         apply Submodule.sum_mem
321         intro a ha
322         apply Submodule.smul_mem
323         rw [Module.End.mul_apply, Module.End.mul_apply,
324           projectorMapG_apply, rightComposition_pow_apply]
325         apply hright_pow
326         apply hend _ (projection_mem_algebra (x i) (D i) m _
327               (delta_pow_mem_algebra (x i) a Q ⟨m, hm⟩))
328         intro j hj
329         simp only [List.mem_cons] at hj
330         rcases hj with hji | hj
331         · subst j
332           exact projection_kernel (x i) (D i) (by simpa using hdual i i)
333             m _ (delta_pow_after_zero (x i) (m + 1) a Q hnil)
334         · have hij : i ≠ j := fun e => hinot (e ▸ hj)
335           apply projection_preserves_kernel (x i) (x j) (D i)
336               (by rw [hdual, if_neg hij])
337           exact delta_iterate_preserves_kernel (x i) (x j) a Q (hkern j hj)
338   apply heliminate (List.ofFn fun i : Fin n => i)
339     (List.nodup_ofFn.mpr fun _ _ h => h) ?_ P hP
340   intro Q hQ hkern
341   rw [hcoordinate Q hQ (fun i => by
342     simpa [delta] using hkern i (List.mem_ofFn.mpr ⟨i, rfl⟩))]
343   exact hmul (Q 1)
344 
345 /-- Every intrinsic finite-order differential operator belongs to any linear
346 subspace containing all multiplications and stable under right composition by
347 a finite dual coordinate frame.  No multiplicative closure of the subspace,
348 or commutation hypothesis among the derivations, is required. -/
349 theorem mem_submodule_of_coordinates
350     {n : ℕ} (x : Fin n → R) (D : Fin n → Derivation k R R)
351     (hdual : ∀ i j, D i (x j) = if i = j then 1 else 0)
352     (hcoordinate : ∀ P : Module.End k R,
353       (∀ i, commutator P (x i) = 0) →
354         P = multiplication (P 1))
355     (H : Submodule k (Module.End k R))
356     (hmul : ∀ r : R, multiplication r ∈ H)
357     (hright : ∀ i Q, Q ∈ H → Q * (D i).toLinearMap ∈ H)
358     (P : Module.End k R)
359     (hP : P ∈ algebra (k := k) (R := R)) : P ∈ H :=
360   mem_submodule_of_coordinates' x D hdual (fun P _ h => hcoordinate P h) H
361     hmul hright P hP
362 
363 /-- Finite-order variant: the coordinate-rigidity hypothesis is required only
364 for operators in `algebra`.  Subalgebras containing the coordinate
365 derivations satisfy the weaker right-stability hypothesis automatically. -/
366 theorem mem_subalgebra_of_coordinates'
367     {n : ℕ} (x : Fin n → R) (D : Fin n → Derivation k R R)
368     (hdual : ∀ i j, D i (x j) = if i = j then 1 else 0)
369     (hcoordinate : ∀ P : Module.End k R, P ∈ algebra (k := k) (R := R) →
370       (∀ i, commutator P (x i) = 0) →
371         P = multiplication (P 1))
372     (H : Subalgebra k (Module.End k R))
373     (hmul : ∀ r : R, multiplication r ∈ H)
374     (hder : ∀ i, (D i).toLinearMap ∈ H)
375     (P : Module.End k R)
376     (hP : P ∈ algebra (k := k) (R := R)) : P ∈ H := by
377   apply mem_submodule_of_coordinates' x D hdual hcoordinate H.toSubmodule
378     hmul (fun i Q hQ => H.mul_mem hQ (hder i)) P hP
379 
380 /-- Subalgebras containing the coordinate derivations satisfy the weaker
381 right-stability hypothesis automatically. -/
382 theorem mem_subalgebra_of_coordinates
383     {n : ℕ} (x : Fin n → R) (D : Fin n → Derivation k R R)
384     (hdual : ∀ i j, D i (x j) = if i = j then 1 else 0)
385     (hcoordinate : ∀ P : Module.End k R,
386       (∀ i, commutator P (x i) = 0) →
387         P = multiplication (P 1))
388     (H : Subalgebra k (Module.End k R))
389     (hmul : ∀ r : R, multiplication r ∈ H)
390     (hder : ∀ i, (D i).toLinearMap ∈ H)
391     (P : Module.End k R)
392     (hP : P ∈ algebra (k := k) (R := R)) : P ∈ H :=
393   mem_subalgebra_of_coordinates' x D hdual (fun P _ h => hcoordinate P h) H
394     hmul hder P hP
395 
396 end
397 end AlgebraicAnalysis.DifferentialOperators.CoordinateGeneration
398 
399 #print axioms AlgebraicAnalysis.DifferentialOperators.CoordinateGeneration.mem_submodule_of_coordinates
400 #print axioms AlgebraicAnalysis.DifferentialOperators.CoordinateGeneration.mem_subalgebra_of_coordinates
401 #print axioms AlgebraicAnalysis.DifferentialOperators.CoordinateGeneration.mem_submodule_of_coordinates'
402 #print axioms AlgebraicAnalysis.DifferentialOperators.CoordinateGeneration.mem_subalgebra_of_coordinates'
403