Documentation

Mathlib.Algebra.Polynomial.Mirror

"Mirror" of a univariate polynomial #

In this file we define Polynomial.mirror, a variant of Polynomial.reverse. The difference between reverse and mirror is that reverse will decrease the degree if the polynomial is divisible by X.

Main definitions #

Main results #

noncomputable def Polynomial.mirror {R : Type u_1} [Semiring R] (p : Polynomial R) :

mirror of a polynomial: reverses the coefficients while preserving Polynomial.natDegree

Equations
@[simp]
theorem Polynomial.mirror_zero {R : Type u_1} [Semiring R] :
mirror 0 = 0
theorem Polynomial.mirror_monomial {R : Type u_1} [Semiring R] (n : ) (a : R) :
((monomial n) a).mirror = (monomial n) a
theorem Polynomial.mirror_C {R : Type u_1} [Semiring R] (a : R) :
(C a).mirror = C a
theorem Polynomial.mirror_eval_one {R : Type u_1} [Semiring R] (p : Polynomial R) :
eval 1 p.mirror = eval 1 p
theorem Polynomial.mirror_eq_iff {R : Type u_1} [Semiring R] {p q : Polynomial R} :
p.mirror = q p = q.mirror
@[simp]
theorem Polynomial.mirror_inj {R : Type u_1} [Semiring R] {p q : Polynomial R} :
p.mirror = q.mirror p = q
@[simp]
theorem Polynomial.mirror_eq_zero {R : Type u_1} [Semiring R] {p : Polynomial R} :
p.mirror = 0 p = 0
theorem Polynomial.coeff_mul_mirror {R : Type u_1} [Semiring R] (p : Polynomial R) :
(p * p.mirror).coeff (p.natDegree + p.natTrailingDegree) = p.sum fun (x : ) (x : R) => x ^ 2
theorem Polynomial.mirror_neg {R : Type u_1} [Ring R] (p : Polynomial R) :
theorem Polynomial.mirror_smul {R : Type u_1} [Ring R] (p : Polynomial R) [NoZeroDivisors R] (a : R) :
(a p).mirror = a p.mirror
theorem Polynomial.irreducible_of_mirror {R : Type u_1} [CommRing R] [NoZeroDivisors R] {f : Polynomial R} (h1 : ¬IsUnit f) (h2 : ∀ (k : Polynomial R), f * f.mirror = k * k.mirrork = f k = -f k = f.mirror k = -f.mirror) (h3 : IsRelPrime f f.mirror) :