Skip to content

Commit d7d52d2

Browse files
feat(Algebra/MvPolynomial/PDeriv): a coefficient formula for pderiv (#39624)
This formula is useful for defining partial derivatives of multivariate power series, see PR #39626.
1 parent 31bbfaf commit d7d52d2

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Mathlib/Algebra/MvPolynomial/PDeriv.lean

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,21 @@ theorem pderiv_pow {i : σ} {f : MvPolynomial σ R} {n : ℕ} :
118118
theorem pderiv_C_mul {f : MvPolynomial σ R} {i : σ} : pderiv i (C a * f) = C a * pderiv i f := by
119119
rw [C_mul', Derivation.map_smul, C_mul']
120120

121+
theorem coeff_pderiv {i : σ} (p : MvPolynomial σ R) (m : σ →₀ ℕ) :
122+
coeff m (pderiv i p) = coeff (m + single i 1) p * (m i + 1) := by
123+
classical
124+
induction p using MvPolynomial.induction_on' with
125+
| add p q hp hq => simp [hp, hq, add_mul]
126+
| monomial n a =>
127+
rw [pderiv_monomial, coeff_monomial, coeff_monomial]
128+
by_cases h : n = m + single i 1
129+
· simp [h]
130+
simp only [h, ↓reduceIte, zero_mul]
131+
by_cases hn : n i = 0
132+
· simp [hn]
133+
apply if_neg
134+
rwa [tsub_eq_iff_eq_add_of_le (fun _ ↦ by grind)]
135+
121136
theorem pderiv_map {S} [CommSemiring S] {φ : R →+* S} {f : MvPolynomial σ R} {i : σ} :
122137
pderiv i (map φ f) = map φ (pderiv i f) := by
123138
apply induction_on f (fun r ↦ by simp) (fun p q hp hq ↦ by simp [hp, hq]) fun p j eq ↦ ?_

0 commit comments

Comments
 (0)