Theory of univariate polynomials #
The theorems include formulas for computing coefficients, such as
coeff_add
, coeff_sum
, coeff_mul
@[simp]
theorem
Polynomial.coeff_add
{R : Type u}
[Semiring R]
(p : Polynomial R)
(q : Polynomial R)
(n : ℕ)
:
@[simp]
theorem
Polynomial.coeff_smul
{R : Type u}
{S : Type v}
[Semiring R]
[SMulZeroClass S R]
(r : S)
(p : Polynomial R)
(n : ℕ)
:
theorem
Polynomial.support_smul
{R : Type u}
{S : Type v}
[Semiring R]
[SMulZeroClass S R]
(r : S)
(p : Polynomial R)
:
theorem
Polynomial.card_support_mul_le
{R : Type u}
[Semiring R]
{p : Polynomial R}
{q : Polynomial R}
:
@[simp]
theorem
Polynomial.lsum_apply
{R : Type u_1}
{A : Type u_2}
{M : Type u_3}
[Semiring R]
[Semiring A]
[AddCommMonoid M]
[Module R A]
[Module R M]
(f : ℕ → A →ₗ[R] M)
(p : Polynomial A)
:
(Polynomial.lsum f) p = p.sum fun (x1 : ℕ) (x2 : A) => (f x1) x2
def
Polynomial.lsum
{R : Type u_1}
{A : Type u_2}
{M : Type u_3}
[Semiring R]
[Semiring A]
[AddCommMonoid M]
[Module R A]
[Module R M]
(f : ℕ → A →ₗ[R] M)
:
Polynomial A →ₗ[R] M
Polynomial.sum
as a linear map.
Equations
- Polynomial.lsum f = { toFun := fun (p : Polynomial A) => p.sum fun (x1 : ℕ) (x2 : A) => (f x1) x2, map_add' := ⋯, map_smul' := ⋯ }
Instances For
The nth coefficient, as a linear map.
Equations
- Polynomial.lcoeff R n = { toFun := fun (p : Polynomial R) => p.coeff n, map_add' := ⋯, map_smul' := ⋯ }
Instances For
@[simp]
theorem
Polynomial.lcoeff_apply
{R : Type u}
[Semiring R]
(n : ℕ)
(f : Polynomial R)
:
(Polynomial.lcoeff R n) f = f.coeff n
@[simp]
theorem
Polynomial.finset_sum_coeff
{R : Type u}
[Semiring R]
{ι : Type u_1}
(s : Finset ι)
(f : ι → Polynomial R)
(n : ℕ)
:
(∑ b ∈ s, f b).coeff n = ∑ b ∈ s, (f b).coeff n
theorem
Polynomial.coeff_list_sum
{R : Type u}
[Semiring R]
(l : List (Polynomial R))
(n : ℕ)
:
l.sum.coeff n = (List.map (⇑(Polynomial.lcoeff R n)) l).sum
theorem
Polynomial.coeff_sum
{R : Type u}
{S : Type v}
[Semiring R]
{p : Polynomial R}
[Semiring S]
(n : ℕ)
(f : ℕ → R → Polynomial S)
:
theorem
Polynomial.coeff_mul
{R : Type u}
[Semiring R]
(p : Polynomial R)
(q : Polynomial R)
(n : ℕ)
:
(p * q).coeff n = ∑ x ∈ Finset.antidiagonal n, p.coeff x.1 * q.coeff x.2
Decomposes the coefficient of the product p * q
as a sum
over antidiagonal
. A version which sums over range (n + 1)
can be obtained
by using Finset.Nat.sum_antidiagonal_eq_sum_range_succ
.
@[simp]
@[simp]
theorem
Polynomial.constantCoeff_apply
{R : Type u}
[Semiring R]
(p : Polynomial R)
:
Polynomial.constantCoeff p = p.coeff 0
constantCoeff p
returns the constant term of the polynomial p
,
defined as coeff p 0
. This is a ring homomorphism.
Equations
- Polynomial.constantCoeff = { toFun := fun (p : Polynomial R) => p.coeff 0, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ }
Instances For
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
Polynomial.coeff_mul_ofNat
{R : Type u}
[Semiring R]
{p : Polynomial R}
{a : ℕ}
{k : ℕ}
[a.AtLeastTwo]
:
(p * OfNat.ofNat a).coeff k = p.coeff k * OfNat.ofNat a
@[simp]
theorem
Polynomial.coeff_ofNat_mul
{R : Type u}
[Semiring R]
{p : Polynomial R}
{a : ℕ}
{k : ℕ}
[a.AtLeastTwo]
:
(OfNat.ofNat a * p).coeff k = OfNat.ofNat a * p.coeff k
@[simp]
@[simp]
@[simp]
@[simp]
theorem
Polynomial.coeff_mul_monomial
{R : Type u}
[Semiring R]
(p : Polynomial R)
(n : ℕ)
(d : ℕ)
(r : R)
:
(p * (Polynomial.monomial n) r).coeff (d + n) = p.coeff d * r
theorem
Polynomial.coeff_monomial_mul
{R : Type u}
[Semiring R]
(p : Polynomial R)
(n : ℕ)
(d : ℕ)
(r : R)
:
((Polynomial.monomial n) r * p).coeff (d + n) = r * p.coeff d
theorem
Polynomial.coeff_mul_monomial_zero
{R : Type u}
[Semiring R]
(p : Polynomial R)
(d : ℕ)
(r : R)
:
(p * (Polynomial.monomial 0) r).coeff d = p.coeff d * r
theorem
Polynomial.coeff_monomial_zero_mul
{R : Type u}
[Semiring R]
(p : Polynomial R)
(d : ℕ)
(r : R)
:
((Polynomial.monomial 0) r * p).coeff d = r * p.coeff d
theorem
Polynomial.mul_X_pow_eq_zero
{R : Type u}
[Semiring R]
{p : Polynomial R}
{n : ℕ}
(H : p * Polynomial.X ^ n = 0)
:
p = 0
@[deprecated Polynomial.natCast_coeff_zero]
Alias of Polynomial.natCast_coeff_zero
.
@[deprecated Polynomial.intCast_coeff_zero]
Alias of Polynomial.intCast_coeff_zero
.
Equations
- ⋯ = ⋯