Documentation

Mathlib.Algebra.Polynomial.CoeffList

A list of coefficients of a polynomial #

Definition #

This is useful for talking about polynomials in terms of list operations. It is "redundant" data in the sense that Polynomial is already a Finsupp (of its coefficients), and Polynomial.coeff turns this into a function, and these have exactly the same data as coeffList. The difference is that coeffList is intended for working together with list operations: getting List.head, comparing adjacent coefficients with each other, or anything that involves induction on Polynomials by dropping the leading term (which is Polynomial.eraseLead).

Note that coeffList starts with the highest-degree terms and ends with the constant term. This might seem backwards in the sense that Polynomial.coeff and List.get! are reversed to one another, but it means that induction on Lists is the same as induction on Polynomial.leadingCoeff.

The most significant theorem here is coeffList_eraseLead, which says that coeffList P can be written as leadingCoeff P :: List.replicate k 0 ++ coeffList P.eraseLead. That is, the list of coefficients starts with the leading coefficient, followed by some number of zeros, and then the coefficients of P.eraseLead.

def Polynomial.coeffList {R : Type u_1} [Semiring R] (P : Polynomial R) :

The list of coefficients starting from the leading term down to the constant term.

Equations
Instances For
    @[simp]
    @[simp]
    theorem Polynomial.coeffList_eq_nil {R : Type u_1} [Semiring R] {P : Polynomial R} :

    Only the zero polynomial has no coefficients.

    @[simp]
    theorem Polynomial.coeffList_C {R : Type u_1} [Semiring R] {x : R} (h : x 0) :
    theorem Polynomial.coeffList_eq_cons_leadingCoeff {R : Type u_1} [Semiring R] {P : Polynomial R} (h : P 0) :
    ∃ (ls : List R), P.coeffList = P.leadingCoeff :: ls
    @[simp]
    @[simp]
    @[simp]
    theorem Polynomial.coeffList_monomial {R : Type u_1} [Semiring R] {x : R} (hx : x 0) (n : ) :
    @[simp]
    theorem Polynomial.coeffList_neg {R : Type u_1} [Ring R] (P : Polynomial R) :
    (-P).coeffList = List.map (fun (x : R) => -x) P.coeffList
    theorem Polynomial.coeffList_C_mul {R : Type u_1} [DivisionSemiring R] (P : Polynomial R) {x : R} (hx : x 0) :
    (C x * P).coeffList = List.map (fun (x_1 : R) => x * x_1) P.coeffList