Skip to content

Commit 8b55327

Browse files
feat(Algebra/MvPolynomial/Basic): coeff_C_of_ne_zero and coeff_add_single_C (#39623)
These lemmas are multivariate analogs to `Polynomial.coeff_C_of_ne_zero`, `Polynomial.coeff_C_succ` and `PowerSeries.coeff_C_of_ne_zero` and `PowerSeries.coeff_succ_C`. They are useful for defining partial derivatives for multivariate power series, see PR #39626. - [x] depends on: #39632
1 parent c54f3c8 commit 8b55327

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

Mathlib/Algebra/MvPolynomial/Basic.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,15 @@ theorem coeff_C [DecidableEq σ] (m) (a) :
593593
coeff m (C a : MvPolynomial σ R) = if 0 = m then a else 0 :=
594594
Finsupp.single_apply
595595

596+
theorem coeff_C_of_ne_zero {m : σ →₀ ℕ} (h : m ≠ 0) (a : R) : coeff m (C a) = 0 := by
597+
classical rw [coeff_C, if_neg h.symm]
598+
599+
-- The intended use case of this theorem is for `n = 1` (often useful for `pderiv`).
600+
@[simp]
601+
theorem coeff_add_single_C {n : ℕ} [NeZero n] {m : σ →₀ ℕ} (a : R) (i : σ) :
602+
coeff (m + Finsupp.single i n) (C a) = 0 :=
603+
coeff_C_of_ne_zero (fun H ↦ by simpa [NeZero.ne] using congr($(H) i)) a
604+
596605
lemma eq_C_of_isEmpty [IsEmpty σ] (p : MvPolynomial σ R) :
597606
p = C (p.coeff 0) := by
598607
obtain ⟨x, rfl⟩ := C_surjective σ p

Mathlib/RingTheory/MvPowerSeries/Basic.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,15 @@ theorem coeff_C [DecidableEq σ] (n : σ →₀ ℕ) (a : R) :
351351
theorem coeff_zero_C (a : R) : coeff (0 : σ →₀ ℕ) (C a) = a :=
352352
coeff_monomial_same 0 a
353353

354+
theorem coeff_C_of_ne_zero {n : σ →₀ ℕ} (h : n ≠ 0) (a : R) : coeff n (C a) = 0 := by
355+
classical rw [coeff_C, if_neg h]
356+
357+
-- The intended use case of this theorem is for `m = 1` (often useful for `pderiv`).
358+
@[simp]
359+
theorem coeff_add_single_C {m : ℕ} [NeZero m] {n : σ →₀ ℕ} (a : R) (i : σ) :
360+
coeff (n + single i m) (C a) = 0 :=
361+
coeff_C_of_ne_zero (fun H ↦ by simpa [NeZero.ne] using congr($(H) i)) a
362+
354363
@[grind inj]
355364
theorem C_injective : Function.Injective (C : R → MvPowerSeries σ R) := by
356365
intro a b h

0 commit comments

Comments
 (0)