Reverse of a univariate polynomial #
The main definition is reverse
. Applying reverse
to a polynomial f : R[X]
produces
the polynomial with a reversed list of coefficients, equivalent to X^f.natDegree * f(1/X)
.
The main result is that reverse (f * g) = reverse f * reverse g
, provided the leading
coefficients of f
and g
do not multiply to zero.
reflect N f
is the polynomial such that (reflect N f).coeff i = f.coeff (revAt N i)
.
In other words, the terms with exponent [0, ..., N]
now have exponent [N, ..., 0]
.
In practice, reflect
is only used when N
is at least as large as the degree of f
.
Eventually, it will be used with N
exactly equal to the degree of f
.
Equations
- Polynomial.reflect N x = match x with | { toFinsupp := f } => { toFinsupp := Finsupp.embDomain (Polynomial.revAt N) f }
Instances For
The reverse of a polynomial f is the polynomial obtained by "reading f backwards".
Even though this is not the actual definition, reverse f = f (1/X) * X ^ f.natDegree
.
Equations
- f.reverse = Polynomial.reflect f.natDegree f