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
  • p.mirror = p.reverse * Polynomial.X ^ p.natTrailingDegree
Instances For
    @[simp]
    theorem Polynomial.mirror_monomial {R : Type u_1} [Semiring R] (n : ) (a : R) :
    theorem Polynomial.mirror_C {R : Type u_1} [Semiring R] (a : R) :
    (Polynomial.C a).mirror = Polynomial.C a
    theorem Polynomial.mirror_X {R : Type u_1} [Semiring R] :
    Polynomial.X.mirror = Polynomial.X
    theorem Polynomial.mirror_natDegree {R : Type u_1} [Semiring R] (p : Polynomial R) :
    p.mirror.natDegree = p.natDegree
    theorem Polynomial.mirror_natTrailingDegree {R : Type u_1} [Semiring R] (p : Polynomial R) :
    p.mirror.natTrailingDegree = p.natTrailingDegree
    theorem Polynomial.coeff_mirror {R : Type u_1} [Semiring R] (p : Polynomial R) (n : ) :
    p.mirror.coeff n = p.coeff ((Polynomial.revAt (p.natDegree + p.natTrailingDegree)) n)
    theorem Polynomial.mirror_mirror {R : Type u_1} [Semiring R] (p : Polynomial R) :
    p.mirror.mirror = p
    theorem Polynomial.mirror_involutive {R : Type u_1} [Semiring R] :
    Function.Involutive Polynomial.mirror
    theorem Polynomial.mirror_eq_iff {R : Type u_1} [Semiring R] {p : Polynomial R} {q : Polynomial R} :
    p.mirror = q p = q.mirror
    @[simp]
    theorem Polynomial.mirror_inj {R : Type u_1} [Semiring R] {p : Polynomial R} {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
    @[simp]
    theorem Polynomial.mirror_trailingCoeff {R : Type u_1} [Semiring R] (p : Polynomial R) :
    p.mirror.trailingCoeff = p.leadingCoeff
    @[simp]
    theorem Polynomial.mirror_leadingCoeff {R : Type u_1} [Semiring R] (p : Polynomial R) :
    p.mirror.leadingCoeff = p.trailingCoeff
    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 (n : ) (x : R) => x ^ 2
    theorem Polynomial.natDegree_mul_mirror {R : Type u_1} [Semiring R] (p : Polynomial R) [NoZeroDivisors R] :
    (p * p.mirror).natDegree = 2 * p.natDegree
    theorem Polynomial.natTrailingDegree_mul_mirror {R : Type u_1} [Semiring R] (p : Polynomial R) [NoZeroDivisors R] :
    (p * p.mirror).natTrailingDegree = 2 * p.natTrailingDegree
    theorem Polynomial.mirror_neg {R : Type u_1} [Ring R] (p : Polynomial R) :
    (-p).mirror = -p.mirror
    theorem Polynomial.mirror_mul_of_domain {R : Type u_1} [Ring R] (p : Polynomial R) (q : Polynomial R) [NoZeroDivisors R] :
    (p * q).mirror = p.mirror * q.mirror
    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) :