AlgebraicAnalysis/DifferentialOperators/Basic.lean

AlgebraicAnalysis library · bbbbf3fc358ca8100b158cec4cf47f336ab70163

1 module
2 public import Mathlib.Algebra.Algebra.Subalgebra.Basic
3 
4 @[expose] public section
5 
6 /-!
7 # Finite-order differential operators
8 
9 Neutral extraction of the intrinsic finite-order differential-operator algebra
10 from Stafford38 commit `1585e4c7`, originally
11 `Stafford38/DifferentialOperators.lean`.  No Weyl presentation or
12 application-specific hypothesis is used.
13 
14 
15 ## References and proof context
16 
17 [StacksD] The Stacks Project Authors, *Finite order differential operators*, The Stacks Project, Section 10.133, tag 09CH (accessed 2026-09-09).
18 https://stacks.math.columbia.edu/tag/09CH
19 
20 Background for the recursive commutator definition. See docs/literature.md for mathematical context and docs/provenance.yaml for code ancestry.
21 -/
22 
23 namespace AlgebraicAnalysis.DifferentialOperators
24 
25 variable {k R : Type*} [CommRing k] [CommRing R] [Algebra k R]
26 
27 /-- `k`-linear endomorphisms of the `k`-algebra `R`. -/
28 abbrev End := Module.End k R
29 
30 /-- Multiplication by an element of `R`, as a `k`-linear endomorphism. -/
31 def multiplication (a : R) : End (k := k) (R := R) :=
32   LinearMap.mulLeft k a
33 
34 @[simp] theorem multiplication_apply (a x : R) :
35     multiplication (k := k) a x = a * x := rfl
36 
37 /-- The commutator of an endomorphism with multiplication by `a`. -/
38 def commutator (P : End (k := k) (R := R)) (a : R) : End (k := k) (R := R) :=
39   P * multiplication (k := k) a - multiplication (k := k) a * P
40 
41 @[simp] theorem commutator_apply (P : End (k := k) (R := R)) (a x : R) :
42     commutator P a x = P (a * x) - a * P x := rfl
43 
44 /-- Differential operators of order at most `n`. -/
45 def order : ℕ → Submodule k (End (k := k) (R := R))
46   | 0 =>
47       { carrier := {P | ∀ a, commutator P a = 0}
48         zero_mem' := by simp [commutator]
49         add_mem' := by
50           intro P Q hP hQ a
51           have heq : commutator (P + Q) a = commutator P a + commutator Q a := by
52             ext x
53             simp [commutator_apply, mul_add, sub_eq_add_neg, add_assoc, add_comm,
54               add_left_comm]
55           calc
56             commutator (P + Q) a = commutator P a + commutator Q a := heq
57             _ = 0 := by rw [hP a, hQ a, add_zero]
58         smul_mem' := by
59           intro c P hP a
60           have heq : commutator (c • P) a = c • commutator P a := by
61             ext x
62             simp [commutator_apply, smul_sub]
63           rw [heq, hP a, smul_zero] }
64   | n + 1 =>
65       { carrier := {P | ∀ a, commutator P a ∈ order n}
66         zero_mem' := by simp [commutator]
67         add_mem' := by
68           intro P Q hP hQ a
69           have heq : commutator (P + Q) a = commutator P a + commutator Q a := by
70             ext x
71             simp [commutator_apply, mul_add, sub_eq_add_neg, add_assoc, add_comm,
72               add_left_comm]
73           rw [heq]
74           exact (order n).add_mem (hP a) (hQ a)
75         smul_mem' := by
76           intro c P hP a
77           have heq : commutator (c • P) a = c • commutator P a := by
78             ext x
79             simp [commutator_apply, smul_sub]
80           rw [heq]
81           exact (order n).smul_mem c (hP a) }
82 
83 @[simp] theorem mem_order_zero_iff (P : End (k := k) (R := R)) :
84     P ∈ order (k := k) (R := R) 0 ↔ ∀ a, commutator P a = 0 := Iff.rfl
85 
86 @[simp] theorem mem_order_succ_iff (P : End (k := k) (R := R)) (n : ℕ) :
87     P ∈ order (k := k) (R := R) (n + 1) ↔
88       ∀ a, commutator P a ∈ order n := by
89   change (∀ a, commutator P a ∈ order n) ↔ _
90   rfl
91 
92 theorem mem_order_zero_iff_eq_multiplication (P : End (k := k) (R := R)) :
93     P ∈ order (k := k) (R := R) 0 ↔
94       P = multiplication (k := k) (P 1) := by
95   constructor
96   · intro h
97     ext a
98     have ha := LinearMap.congr_fun (h a) 1
99     simpa [mul_comm] using sub_eq_zero.mp (by simpa [commutator_apply] using ha)
100   · intro hP
101     rw [mem_order_zero_iff]
102     intro a
103     rw [hP]
104     ext x
105     simp [commutator_apply, mul_assoc, mul_comm]
106 
107 theorem order_mono_step (n : ℕ) :
108     order (k := k) (R := R) n ≤ order (n + 1) := by
109   induction n with
110   | zero =>
111       intro P hP
112       rw [mem_order_succ_iff]
113       intro a
114       rw [hP a]
115       exact (order 0).zero_mem
116   | succ n ih =>
117       intro P hP
118       rw [mem_order_succ_iff] at hP ⊢
119       intro a
120       exact ih (hP a)
121 
122 theorem order_mono {m n : ℕ} (h : m ≤ n) :
123     order (k := k) (R := R) m ≤ order n := by
124   induction n, h using Nat.le_induction with
125   | base => exact le_rfl
126   | succ n _ ih => exact ih.trans (order_mono_step n)
127 
128 theorem commutator_mul (P Q : End (k := k) (R := R)) (a : R) :
129     commutator (P * Q) a = P * commutator Q a + commutator P a * Q := by
130   ext x
131   simp [commutator_apply, Module.End.mul_apply]
132 
133 private theorem orderZero_mul {P Q : End (k := k) (R := R)} {n : ℕ}
134     (hP : P ∈ order (k := k) (R := R) 0) (hQ : Q ∈ order n) :
135     P * Q ∈ order n := by
136   induction n generalizing Q with
137   | zero =>
138       rw [mem_order_zero_iff_eq_multiplication] at hP hQ
139       rw [mem_order_zero_iff]
140       intro a
141       rw [hP, hQ]
142       ext x
143       simp [commutator_apply, mul_assoc, mul_comm, mul_left_comm]
144   | succ n ih =>
145       rw [mem_order_succ_iff] at hQ ⊢
146       intro a
147       rw [commutator_mul, hP a, zero_mul, add_zero]
148       exact ih (hQ a)
149 
150 /-- Orders add under composition. -/
151 theorem mul_mem_order {P Q : End (k := k) (R := R)} {m n : ℕ}
152     (hP : P ∈ order (k := k) (R := R) m) (hQ : Q ∈ order n) :
153     P * Q ∈ order (m + n) := by
154   induction m generalizing P n Q with
155   | zero => simpa using orderZero_mul hP hQ
156   | succ m ihm =>
157       induction n generalizing P Q with
158       | zero =>
159           rw [Nat.add_zero, mem_order_succ_iff] at hP ⊢
160           intro a
161           rw [commutator_mul, hQ a, mul_zero, zero_add]
162           simpa using ihm (hP a) hQ
163       | succ n ihn =>
164           have hQ' : Q ∈ order (n + 1) := hQ
165           rw [mem_order_succ_iff] at hP hQ
166           rw [Nat.add_succ, mem_order_succ_iff]
167           intro a
168           rw [commutator_mul]
169           exact (order ((m + 1) + n)).add_mem
170             (ihn hP (hQ a))
171             (by simpa only [Nat.succ_add, Nat.add_succ] using ihm (hP a) hQ')
172 
173 /-- The algebra of all finite-order `k`-linear differential operators on `R`. -/
174 def algebra : Subalgebra k (End (k := k) (R := R)) where
175   carrier := {P | ∃ n, P ∈ order n}
176   zero_mem' := ⟨0, (order 0).zero_mem⟩
177   add_mem' := by
178     rintro P Q ⟨m, hP⟩ ⟨n, hQ⟩
179     refine ⟨max m n, (order (max m n)).add_mem ?_ ?_⟩
180     · exact order_mono (Nat.le_max_left _ _) hP
181     · exact order_mono (Nat.le_max_right _ _) hQ
182   mul_mem' := by
183     rintro P Q ⟨m, hP⟩ ⟨n, hQ⟩
184     exact ⟨m + n, mul_mem_order hP hQ⟩
185   one_mem' := by
186     refine ⟨0, (mem_order_zero_iff_eq_multiplication _).2 ?_⟩
187     ext x
188     simp [multiplication_apply]
189   algebraMap_mem' := by
190     intro c
191     refine ⟨0, (mem_order_zero_iff_eq_multiplication _).2 ?_⟩
192     ext x
193     simp [multiplication_apply]
194 
195 @[simp] theorem mem_algebra_iff (P : End (k := k) (R := R)) :
196     P ∈ algebra (k := k) (R := R) ↔ ∃ n, P ∈ order n := Iff.rfl
197 
198 /-! The two basic kinds of operators are finite-order without any geometric
199 assumption.  Keeping these witnesses public lets a concrete carrier expose
200 its coefficient and derivation generators through this neutral API. -/
201 
202 /-- Multiplication by a coefficient is an intrinsic differential operator of
203 order zero. -/
204 theorem multiplication_mem_algebra (a : R) :
205     multiplication (k := k) a ∈ algebra (k := k) (R := R) := by
206   refine ⟨0, (mem_order_zero_iff_eq_multiplication _).2 ?_⟩
207   ext x
208   simp [multiplication_apply]
209 
210 end AlgebraicAnalysis.DifferentialOperators
211