A list of coefficients of a polynomial #
Definition #
coeffList f
: aList
of the coefficients, from leading term down to constant term.coeffList 0
is defined to be[]
.
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 List
s 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
.
The list of coefficients starting from the leading term down to the constant term.