Skip to content

Commit aee6b1e

Browse files
committed
feat(PowerSeries): coefficients of series products (#14452)
Add three elementary lemmas about coefficients of series products.
1 parent 81fa779 commit aee6b1e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

Mathlib/RingTheory/PowerSeries/Basic.lean

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,36 @@ theorem coeff_prod (f : ι → PowerSeries R) (d : ℕ) (s : Finset ι) :
673673
Equiv.coe_toEmbedding, Finsupp.mapRange.equiv_apply, AddEquiv.coe_toEquiv_symm,
674674
Finsupp.mapRange_apply, AddEquiv.finsuppUnique_symm]
675675

676+
/-- The `n`-th coefficient of the `k`-th power of a power series. -/
677+
lemma coeff_pow (k n : ℕ) (φ : R⟦X⟧) :
678+
coeff R n (φ ^ k) = ∑ l ∈ finsuppAntidiag (range k) n, ∏ i ∈ range k, coeff R (l i) φ := by
679+
have h₁ (i : ℕ) : Function.const ℕ φ i = φ := rfl
680+
have h₂ (i : ℕ) : ∏ j ∈ range i, Function.const ℕ φ j = φ ^ i := by
681+
apply prod_range_induction (fun _ => φ) (fun i => φ ^ i) rfl (congrFun rfl) i
682+
rw [← h₂, ← h₁ k]
683+
apply coeff_prod (f := Function.const ℕ φ) (d := n) (s := range k)
684+
685+
/-- First coefficient of the product of two power series. -/
686+
lemma coeff_one_mul (φ ψ : R⟦X⟧) : coeff R 1 (φ * ψ) =
687+
coeff R 1 φ * constantCoeff R ψ + coeff R 1 ψ * constantCoeff R φ := by
688+
have : Finset.antidiagonal 1 = {(0, 1), (1, 0)} := by exact rfl
689+
rw [coeff_mul, this, Finset.sum_insert, Finset.sum_singleton, coeff_zero_eq_constantCoeff,
690+
mul_comm, add_comm]
691+
norm_num
692+
693+
/-- First coefficient of the `n`-th power of a power series with constant coefficient 1. -/
694+
lemma coeff_one_pow (n : ℕ) (φ : R⟦X⟧) (hC : constantCoeff R φ = 1) :
695+
coeff R 1 (φ ^ n) = n * coeff R 1 φ := by
696+
induction n with
697+
| zero => simp only [pow_zero, coeff_one, one_ne_zero, ↓reduceIte, Nat.cast_zero, zero_mul]
698+
| succ n' ih =>
699+
have h₁ (m : ℕ) : φ ^ (m + 1) = φ ^ m * φ := by exact rfl
700+
have h₂ : Finset.antidiagonal 1 = {(0, 1), (1, 0)} := by exact rfl
701+
rw [h₁, coeff_mul, h₂, Finset.sum_insert, Finset.sum_singleton]
702+
simp only [coeff_zero_eq_constantCoeff, map_pow, Nat.cast_add, Nat.cast_one,
703+
ih, hC, one_pow, one_mul, mul_one, ← one_add_mul, add_comm]
704+
decide
705+
676706
end CommSemiring
677707

678708
section CommRing

0 commit comments

Comments
 (0)