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.
noncomputable def
Polynomial.reflect
{R : Type u_1}
[Semiring R]
(N : ℕ)
:
Polynomial R → Polynomial R
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 { toFinsupp := f } = { toFinsupp := Finsupp.embDomain (Polynomial.revAt N) f }
Instances For
@[simp]
@[simp]
theorem
Polynomial.eval₂_reflect_mul_pow
{R : Type u_1}
[Semiring R]
{S : Type u_2}
[CommSemiring S]
(i : R →+* S)
(x : S)
[Invertible x]
(N : ℕ)
(f : Polynomial R)
(hf : f.natDegree ≤ N)
:
theorem
Polynomial.eval₂_reflect_eq_zero_iff
{R : Type u_1}
[Semiring R]
{S : Type u_2}
[CommSemiring S]
(i : R →+* S)
(x : S)
[Invertible x]
(N : ℕ)
(f : Polynomial R)
(hf : f.natDegree ≤ N)
:
@[simp]
@[simp]
theorem
Polynomial.natDegree_eq_reverse_natDegree_add_natTrailingDegree
{R : Type u_1}
[Semiring R]
(f : Polynomial R)
:
theorem
Polynomial.reverse_mul
{R : Type u_1}
[Semiring R]
{f g : Polynomial R}
(fg : f.leadingCoeff * g.leadingCoeff ≠ 0)
:
@[simp]
theorem
Polynomial.reverse_mul_of_domain
{R : Type u_2}
[Semiring R]
[NoZeroDivisors R]
(f g : Polynomial R)
:
theorem
Polynomial.trailingCoeff_mul
{R : Type u_2}
[Semiring R]
[NoZeroDivisors R]
(p q : Polynomial R)
:
@[simp]
@[simp]
@[simp]
theorem
Polynomial.eval₂_reverse_mul_pow
{R : Type u_1}
[Semiring R]
{S : Type u_2}
[CommSemiring S]
(i : R →+* S)
(x : S)
[Invertible x]
(f : Polynomial R)
:
@[simp]
theorem
Polynomial.eval₂_reverse_eq_zero_iff
{R : Type u_1}
[Semiring R]
{S : Type u_2}
[CommSemiring S]
(i : R →+* S)
(x : S)
[Invertible x]
(f : Polynomial R)
:
@[simp]