# Theory of univariate polynomials #

The main defs here are eval₂, eval, and map. We give several lemmas about their interaction with each other and with module operations.

theorem Polynomial.eval₂_def {R : Type u_1} {S : Type u_2} [] [] (f : R →+* S) (x : S) (p : ) :
= p.sum fun (e : ) (a : R) => f a * x ^ e
@[irreducible]
def Polynomial.eval₂ {R : Type u_1} {S : Type u_2} [] [] (f : R →+* S) (x : S) (p : ) :
S

Evaluate a polynomial p given a ring hom f from the scalar ring to the target and a value x for the variable in the target

Equations
Instances For
theorem Polynomial.eval₂_eq_sum {R : Type u} {S : Type v} [] {p : } [] {f : R →+* S} {x : S} :
= p.sum fun (e : ) (a : R) => f a * x ^ e
theorem Polynomial.eval₂_congr {R : Type u_1} {S : Type u_2} [] [] {f : R →+* S} {g : R →+* S} {s : S} {t : S} {φ : } {ψ : } :
f = gs = tφ = ψ =
@[simp]
theorem Polynomial.eval₂_at_zero {R : Type u} {S : Type v} [] {p : } [] (f : R →+* S) :
= f (p.coeff 0)
@[simp]
theorem Polynomial.eval₂_zero {R : Type u} {S : Type v} [] [] (f : R →+* S) (x : S) :
= 0
@[simp]
theorem Polynomial.eval₂_C {R : Type u} {S : Type v} {a : R} [] [] (f : R →+* S) (x : S) :
Polynomial.eval₂ f x (Polynomial.C a) = f a
@[simp]
theorem Polynomial.eval₂_X {R : Type u} {S : Type v} [] [] (f : R →+* S) (x : S) :
Polynomial.eval₂ f x Polynomial.X = x
@[simp]
theorem Polynomial.eval₂_monomial {R : Type u} {S : Type v} [] [] (f : R →+* S) (x : S) {n : } {r : R} :
Polynomial.eval₂ f x ( r) = f r * x ^ n
@[simp]
theorem Polynomial.eval₂_X_pow {R : Type u} {S : Type v} [] [] (f : R →+* S) (x : S) {n : } :
Polynomial.eval₂ f x (Polynomial.X ^ n) = x ^ n
@[simp]
theorem Polynomial.eval₂_add {R : Type u} {S : Type v} [] {p : } {q : } [] (f : R →+* S) (x : S) :
Polynomial.eval₂ f x (p + q) = +
@[simp]
theorem Polynomial.eval₂_one {R : Type u} {S : Type v} [] [] (f : R →+* S) (x : S) :
= 1
@[simp]
theorem Polynomial.eval₂_bit0 {R : Type u} {S : Type v} [] {p : } [] (f : R →+* S) (x : S) :
@[simp]
theorem Polynomial.eval₂_bit1 {R : Type u} {S : Type v} [] {p : } [] (f : R →+* S) (x : S) :
@[simp]
theorem Polynomial.eval₂_smul {R : Type u} {S : Type v} [] [] (g : R →+* S) (p : ) (x : S) {s : R} :
Polynomial.eval₂ g x (s p) = g s *
@[simp]
theorem Polynomial.eval₂_C_X {R : Type u} [] {p : } :
Polynomial.eval₂ Polynomial.C Polynomial.X p = p
@[simp]
theorem Polynomial.eval₂AddMonoidHom_apply {R : Type u} {S : Type v} [] [] (f : R →+* S) (x : S) (p : ) :
p =
def Polynomial.eval₂AddMonoidHom {R : Type u} {S : Type v} [] [] (f : R →+* S) (x : S) :
→+ S

eval₂AddMonoidHom (f : R →+* S) (x : S) is the AddMonoidHom from R[X] to S obtained by evaluating the pushforward of p along f at x.

Equations
• = { toFun := , map_zero' := , map_add' := }
Instances For
@[simp]
theorem Polynomial.eval₂_natCast {R : Type u} {S : Type v} [] [] (f : R →+* S) (x : S) (n : ) :
Polynomial.eval₂ f x n = n
@[simp]
theorem Polynomial.eval₂_ofNat {R : Type u} [] {S : Type u_1} [] (n : ) [n.AtLeastTwo] (f : R →+* S) (a : S) :
=
theorem Polynomial.eval₂_sum {R : Type u} {S : Type v} {T : Type w} [] [] (f : R →+* S) [] (p : ) (g : T) (x : S) :
Polynomial.eval₂ f x (p.sum g) = p.sum fun (n : ) (a : T) => Polynomial.eval₂ f x (g n a)
theorem Polynomial.eval₂_list_sum {R : Type u} {S : Type v} [] [] (f : R →+* S) (l : List ()) (x : S) :
Polynomial.eval₂ f x l.sum = (List.map () l).sum
theorem Polynomial.eval₂_multiset_sum {R : Type u} {S : Type v} [] [] (f : R →+* S) (s : ) (x : S) :
Polynomial.eval₂ f x s.sum = (Multiset.map () s).sum
theorem Polynomial.eval₂_finset_sum {R : Type u} {S : Type v} {ι : Type y} [] [] (f : R →+* S) (s : ) (g : ι) (x : S) :
Polynomial.eval₂ f x (s.sum fun (i : ι) => g i) = s.sum fun (i : ι) => Polynomial.eval₂ f x (g i)
theorem Polynomial.eval₂_ofFinsupp {R : Type u} {S : Type v} [] [] {f : R →+* S} {x : S} {p : } :
Polynomial.eval₂ f x { toFinsupp := p } = (AddMonoidAlgebra.liftNC f (() x)) p
theorem Polynomial.eval₂_mul_noncomm {R : Type u} {S : Type v} [] {p : } {q : } [] (f : R →+* S) (x : S) (hf : ∀ (k : ), Commute (f (q.coeff k)) x) :
Polynomial.eval₂ f x (p * q) = *
@[simp]
theorem Polynomial.eval₂_mul_X {R : Type u} {S : Type v} [] {p : } [] (f : R →+* S) (x : S) :
Polynomial.eval₂ f x (p * Polynomial.X) = * x
@[simp]
theorem Polynomial.eval₂_X_mul {R : Type u} {S : Type v} [] {p : } [] (f : R →+* S) (x : S) :
Polynomial.eval₂ f x (Polynomial.X * p) = * x
theorem Polynomial.eval₂_mul_C' {R : Type u} {S : Type v} {a : R} [] {p : } [] (f : R →+* S) (x : S) (h : Commute (f a) x) :
Polynomial.eval₂ f x (p * Polynomial.C a) = * f a
theorem Polynomial.eval₂_list_prod_noncomm {R : Type u} {S : Type v} [] [] (f : R →+* S) (x : S) (ps : List ()) (hf : pps, ∀ (k : ), Commute (f (p.coeff k)) x) :
Polynomial.eval₂ f x ps.prod = (List.map () ps).prod
@[simp]
theorem Polynomial.eval₂RingHom'_apply {R : Type u} {S : Type v} [] [] (f : R →+* S) (x : S) (hf : ∀ (a : R), Commute (f a) x) (p : ) :
() p =
def Polynomial.eval₂RingHom' {R : Type u} {S : Type v} [] [] (f : R →+* S) (x : S) (hf : ∀ (a : R), Commute (f a) x) :

eval₂ as a RingHom for noncommutative rings

Equations
• = { toFun := , map_one' := , map_mul' := , map_zero' := , map_add' := }
Instances For

We next prove that eval₂ is multiplicative as long as target ring is commutative (even if the source ring is not).

theorem Polynomial.eval₂_eq_sum_range {R : Type u} {S : Type v} [] {p : } [] (f : R →+* S) (x : S) :
= (Finset.range (p.natDegree + 1)).sum fun (i : ) => f (p.coeff i) * x ^ i
theorem Polynomial.eval₂_eq_sum_range' {R : Type u} {S : Type v} [] [] (f : R →+* S) {p : } {n : } (hn : p.natDegree < n) (x : S) :
= ().sum fun (i : ) => f (p.coeff i) * x ^ i
@[simp]
theorem Polynomial.eval₂_mul {R : Type u} {S : Type v} [] {p : } {q : } [] (f : R →+* S) (x : S) :
Polynomial.eval₂ f x (p * q) = *
theorem Polynomial.eval₂_mul_eq_zero_of_left {R : Type u} {S : Type v} [] {p : } [] (f : R →+* S) (x : S) (q : ) (hp : = 0) :
Polynomial.eval₂ f x (p * q) = 0
theorem Polynomial.eval₂_mul_eq_zero_of_right {R : Type u} {S : Type v} [] {q : } [] (f : R →+* S) (x : S) (p : ) (hq : = 0) :
Polynomial.eval₂ f x (p * q) = 0
def Polynomial.eval₂RingHom {R : Type u} {S : Type v} [] [] (f : R →+* S) (x : S) :

eval₂ as a RingHom

Equations
• = let __src := ; { toFun := __src.toFun, map_one' := , map_mul' := , map_zero' := , map_add' := }
Instances For
@[simp]
theorem Polynomial.coe_eval₂RingHom {R : Type u} {S : Type v} [] [] (f : R →+* S) (x : S) :
() =
theorem Polynomial.eval₂_pow {R : Type u} {S : Type v} [] {p : } [] (f : R →+* S) (x : S) (n : ) :
Polynomial.eval₂ f x (p ^ n) = ^ n
theorem Polynomial.eval₂_dvd {R : Type u} {S : Type v} [] {p : } {q : } [] (f : R →+* S) (x : S) :
p q
theorem Polynomial.eval₂_eq_zero_of_dvd_of_eval₂_eq_zero {R : Type u} {S : Type v} [] {p : } {q : } [] (f : R →+* S) (x : S) (h : p q) (h0 : = 0) :
= 0
theorem Polynomial.eval₂_list_prod {R : Type u} {S : Type v} [] [] (f : R →+* S) (l : List ()) (x : S) :
Polynomial.eval₂ f x l.prod = (List.map () l).prod
def Polynomial.eval {R : Type u} [] :
RR

eval x p is the evaluation of the polynomial p at x

Equations
• Polynomial.eval =
Instances For
theorem Polynomial.eval_eq_sum {R : Type u} [] {p : } {x : R} :
= p.sum fun (e : ) (a : R) => a * x ^ e
theorem Polynomial.eval_eq_sum_range {R : Type u} [] {p : } (x : R) :
= (Finset.range (p.natDegree + 1)).sum fun (i : ) => p.coeff i * x ^ i
theorem Polynomial.eval_eq_sum_range' {R : Type u} [] {p : } {n : } (hn : p.natDegree < n) (x : R) :
= ().sum fun (i : ) => p.coeff i * x ^ i
@[simp]
theorem Polynomial.eval₂_at_apply {R : Type u} [] {p : } {S : Type u_1} [] (f : R →+* S) (r : R) :
Polynomial.eval₂ f (f r) p = f ()
@[simp]
theorem Polynomial.eval₂_at_one {R : Type u} [] {p : } {S : Type u_1} [] (f : R →+* S) :
= f ()
@[simp]
theorem Polynomial.eval₂_at_natCast {R : Type u} [] {p : } {S : Type u_1} [] (f : R →+* S) (n : ) :
Polynomial.eval₂ f (n) p = f (Polynomial.eval (n) p)
@[simp]
theorem Polynomial.eval₂_at_ofNat {R : Type u} [] {p : } {S : Type u_1} [] (f : R →+* S) (n : ) [n.AtLeastTwo] :
= f ()
@[simp]
theorem Polynomial.eval_C {R : Type u} {a : R} [] {x : R} :
Polynomial.eval x (Polynomial.C a) = a
@[simp]
theorem Polynomial.eval_natCast {R : Type u} [] {x : R} {n : } :
= n
@[simp]
theorem Polynomial.eval_ofNat {R : Type u} [] (n : ) [n.AtLeastTwo] (a : R) :
@[simp]
theorem Polynomial.eval_X {R : Type u} [] {x : R} :
Polynomial.eval x Polynomial.X = x
@[simp]
theorem Polynomial.eval_monomial {R : Type u} [] {x : R} {n : } {a : R} :
Polynomial.eval x ( a) = a * x ^ n
@[simp]
theorem Polynomial.eval_zero {R : Type u} [] {x : R} :
= 0
@[simp]
theorem Polynomial.eval_add {R : Type u} [] {p : } {q : } {x : R} :
Polynomial.eval x (p + q) = +
@[simp]
theorem Polynomial.eval_one {R : Type u} [] {x : R} :
= 1
@[simp]
theorem Polynomial.eval_bit0 {R : Type u} [] {p : } {x : R} :
@[simp]
theorem Polynomial.eval_bit1 {R : Type u} [] {p : } {x : R} :
@[simp]
theorem Polynomial.eval_smul {R : Type u} {S : Type v} [] [] [] [] (s : S) (p : ) (x : R) :
@[simp]
theorem Polynomial.eval_C_mul {R : Type u} {a : R} [] {p : } {x : R} :
Polynomial.eval x (Polynomial.C a * p) = a *
theorem Polynomial.eval_monomial_one_add_sub {S : Type v} [] (d : ) (y : S) :
Polynomial.eval (1 + y) ( (d + 1)) - Polynomial.eval y ( (d + 1)) = (Finset.range (d + 1)).sum fun (x_1 : ) => ((d + 1).choose x_1) * (x_1 * y ^ (x_1 - 1))

A reformulation of the expansion of (1 + y)^d: $$(d + 1) (1 + y)^d - (d + 1)y^d = \sum_{i = 0}^d {d + 1 \choose i} \cdot i \cdot y^{i - 1}.$$

@[simp]
theorem Polynomial.leval_apply {R : Type u_1} [] (r : R) (f : ) :
() f =
def Polynomial.leval {R : Type u_1} [] (r : R) :

Polynomial.eval as linear map

Equations
• = { toFun := fun (f : ) => , map_add' := , map_smul' := }
Instances For
@[simp]
theorem Polynomial.eval_natCast_mul {R : Type u} [] {p : } {x : R} {n : } :
Polynomial.eval x (n * p) = n *
@[simp]
theorem Polynomial.eval_mul_X {R : Type u} [] {p : } {x : R} :
Polynomial.eval x (p * Polynomial.X) = * x
@[simp]
theorem Polynomial.eval_mul_X_pow {R : Type u} [] {p : } {x : R} {k : } :
Polynomial.eval x (p * Polynomial.X ^ k) = * x ^ k
theorem Polynomial.eval_sum {R : Type u} [] (p : ) (f : R) (x : R) :
Polynomial.eval x (p.sum f) = p.sum fun (n : ) (a : R) => Polynomial.eval x (f n a)
theorem Polynomial.eval_finset_sum {R : Type u} {ι : Type y} [] (s : ) (g : ι) (x : R) :
Polynomial.eval x (s.sum fun (i : ι) => g i) = s.sum fun (i : ι) => Polynomial.eval x (g i)
def Polynomial.IsRoot {R : Type u} [] (p : ) (a : R) :

IsRoot p x implies x is a root of p. The evaluation of p at x is zero

Equations
• p.IsRoot a = ( = 0)
Instances For
instance Polynomial.IsRoot.decidable {R : Type u} {a : R} [] {p : } [] :
Decidable (p.IsRoot a)
Equations
• Polynomial.IsRoot.decidable = id inferInstance
@[simp]
theorem Polynomial.IsRoot.def {R : Type u} {a : R} [] {p : } :
p.IsRoot a = 0
theorem Polynomial.IsRoot.eq_zero {R : Type u} [] {p : } {x : R} (h : p.IsRoot x) :
= 0
theorem Polynomial.coeff_zero_eq_eval_zero {R : Type u} [] (p : ) :
p.coeff 0 =
theorem Polynomial.zero_isRoot_of_coeff_zero_eq_zero {R : Type u} [] {p : } (hp : p.coeff 0 = 0) :
p.IsRoot 0
theorem Polynomial.IsRoot.dvd {R : Type u_1} [] {p : } {q : } {x : R} (h : p.IsRoot x) (hpq : p q) :
q.IsRoot x
theorem Polynomial.not_isRoot_C {R : Type u} [] (r : R) (a : R) (hr : r 0) :
¬(Polynomial.C r).IsRoot a
theorem Polynomial.eval_surjective {R : Type u} [] (x : R) :
def Polynomial.comp {R : Type u} [] (p : ) (q : ) :

The composition of polynomials as a polynomial.

Equations
Instances For
theorem Polynomial.comp_eq_sum_left {R : Type u} [] {p : } {q : } :
p.comp q = p.sum fun (e : ) (a : R) => Polynomial.C a * q ^ e
@[simp]
theorem Polynomial.comp_X {R : Type u} [] {p : } :
p.comp Polynomial.X = p
@[simp]
theorem Polynomial.X_comp {R : Type u} [] {p : } :
Polynomial.X.comp p = p
@[simp]
theorem Polynomial.comp_C {R : Type u} {a : R} [] {p : } :
p.comp (Polynomial.C a) = Polynomial.C ()
@[simp]
theorem Polynomial.C_comp {R : Type u} {a : R} [] {p : } :
(Polynomial.C a).comp p = Polynomial.C a
@[simp]
theorem Polynomial.natCast_comp {R : Type u} [] {p : } {n : } :
(n).comp p = n
@[simp]
theorem Polynomial.ofNat_comp {R : Type u} [] {p : } (n : ) [n.AtLeastTwo] :
().comp p = n
@[simp]
theorem Polynomial.comp_zero {R : Type u} [] {p : } :
p.comp 0 = Polynomial.C ()
@[simp]
theorem Polynomial.zero_comp {R : Type u} [] {p : } :
= 0
@[simp]
theorem Polynomial.comp_one {R : Type u} [] {p : } :
p.comp 1 = Polynomial.C ()
@[simp]
theorem Polynomial.one_comp {R : Type u} [] {p : } :
= 1
@[simp]
theorem Polynomial.add_comp {R : Type u} [] {p : } {q : } {r : } :
(p + q).comp r = p.comp r + q.comp r
@[simp]
theorem Polynomial.monomial_comp {R : Type u} {a : R} [] {p : } (n : ) :
( a).comp p = Polynomial.C a * p ^ n
@[simp]
theorem Polynomial.mul_X_comp {R : Type u} [] {p : } {r : } :
(p * Polynomial.X).comp r = p.comp r * r
@[simp]
theorem Polynomial.X_pow_comp {R : Type u} [] {p : } {k : } :
(Polynomial.X ^ k).comp p = p ^ k
@[simp]
theorem Polynomial.mul_X_pow_comp {R : Type u} [] {p : } {r : } {k : } :
(p * Polynomial.X ^ k).comp r = p.comp r * r ^ k
@[simp]
theorem Polynomial.C_mul_comp {R : Type u} {a : R} [] {p : } {r : } :
(Polynomial.C a * p).comp r = Polynomial.C a * p.comp r
@[simp]
theorem Polynomial.natCast_mul_comp {R : Type u} [] {p : } {r : } {n : } :
(n * p).comp r = n * p.comp r
theorem Polynomial.mul_X_add_natCast_comp {R : Type u} [] {p : } {q : } {n : } :
(p * (Polynomial.X + n)).comp q = p.comp q * (q + n)
@[simp]
theorem Polynomial.mul_comp {R : Type u_1} [] (p : ) (q : ) (r : ) :
(p * q).comp r = p.comp r * q.comp r
@[simp]
theorem Polynomial.pow_comp {R : Type u_1} [] (p : ) (q : ) (n : ) :
(p ^ n).comp q = p.comp q ^ n
@[simp]
theorem Polynomial.bit0_comp {R : Type u} [] {p : } {q : } :
(bit0 p).comp q = bit0 (p.comp q)
@[simp]
theorem Polynomial.bit1_comp {R : Type u} [] {p : } {q : } :
(bit1 p).comp q = bit1 (p.comp q)
@[simp]
theorem Polynomial.smul_comp {R : Type u} {S : Type v} [] [] [] [] (s : S) (p : ) (q : ) :
(s p).comp q = s p.comp q
theorem Polynomial.comp_assoc {R : Type u_1} [] (φ : ) (ψ : ) (χ : ) :
(φ.comp ψ).comp χ = φ.comp (ψ.comp χ)
theorem Polynomial.coeff_comp_degree_mul_degree {R : Type u} [] {p : } {q : } (hqd0 : q.natDegree 0) :
@[simp]
theorem Polynomial.sum_comp {R : Type u} {ι : Type y} [] (s : ) (p : ι) (q : ) :
(s.sum fun (i : ι) => p i).comp q = s.sum fun (i : ι) => (p i).comp q
def Polynomial.map {R : Type u} {S : Type v} [] [] (f : R →+* S) :

map f p maps a polynomial p across a ring hom f

Equations
Instances For
@[simp]
theorem Polynomial.map_C {R : Type u} {S : Type v} {a : R} [] [] (f : R →+* S) :
Polynomial.map f (Polynomial.C a) = Polynomial.C (f a)
@[simp]
theorem Polynomial.map_X {R : Type u} {S : Type v} [] [] (f : R →+* S) :
Polynomial.map f Polynomial.X = Polynomial.X
@[simp]
theorem Polynomial.map_monomial {R : Type u} {S : Type v} [] [] (f : R →+* S) {n : } {a : R} :
Polynomial.map f ( a) = (f a)
@[simp]
theorem Polynomial.map_zero {R : Type u} {S : Type v} [] [] (f : R →+* S) :
= 0
@[simp]
theorem Polynomial.map_add {R : Type u} {S : Type v} [] {p : } {q : } [] (f : R →+* S) :
Polynomial.map f (p + q) = +
@[simp]
theorem Polynomial.map_one {R : Type u} {S : Type v} [] [] (f : R →+* S) :
= 1
@[simp]
theorem Polynomial.map_mul {R : Type u} {S : Type v} [] {p : } {q : } [] (f : R →+* S) :
Polynomial.map f (p * q) = *
@[simp]
theorem Polynomial.map_smul {R : Type u} {S : Type v} [] {p : } [] (f : R →+* S) (r : R) :
Polynomial.map f (r p) = f r
def Polynomial.mapRingHom {R : Type u} {S : Type v} [] [] (f : R →+* S) :

Polynomial.map as a RingHom.

Equations
• = { toFun := , map_one' := , map_mul' := , map_zero' := , map_add' := }
Instances For
@[simp]
theorem Polynomial.coe_mapRingHom {R : Type u} {S : Type v} [] [] (f : R →+* S) :
@[simp]
theorem Polynomial.map_natCast {R : Type u} {S : Type v} [] [] (f : R →+* S) (n : ) :
= n
@[simp]
theorem Polynomial.map_ofNat {R : Type u} {S : Type v} [] [] (f : R →+* S) (n : ) [n.AtLeastTwo] :
@[simp]
theorem Polynomial.map_bit0 {R : Type u} {S : Type v} [] {p : } [] (f : R →+* S) :
@[simp]
theorem Polynomial.map_bit1 {R : Type u} {S : Type v} [] {p : } [] (f : R →+* S) :
theorem Polynomial.map_dvd {R : Type u} {S : Type v} [] [] (f : R →+* S) {x : } {y : } :
x y
@[simp]
theorem Polynomial.coeff_map {R : Type u} {S : Type v} [] {p : } [] (f : R →+* S) (n : ) :
().coeff n = f (p.coeff n)
@[simp]
theorem Polynomial.mapEquiv_symm_apply {R : Type u} {S : Type v} [] [] (e : R ≃+* S) (a : ) :
.symm a = Polynomial.map (e.symm) a
@[simp]
theorem Polynomial.mapEquiv_apply {R : Type u} {S : Type v} [] [] (e : R ≃+* S) (a : ) :
a = Polynomial.map (e) a
def Polynomial.mapEquiv {R : Type u} {S : Type v} [] [] (e : R ≃+* S) :

If R and S are isomorphic, then so are their polynomial rings.

Equations
Instances For
theorem Polynomial.map_map {R : Type u} {S : Type v} {T : Type w} [] [] (f : R →+* S) [] (g : S →+* T) (p : ) :
Polynomial.map g () = Polynomial.map (g.comp f) p
@[simp]
theorem Polynomial.map_id {R : Type u} [] {p : } :
= p
def Polynomial.piEquiv {ι : Type u_2} [] (R : ιType u_1) [(i : ι) → Semiring (R i)] :
Polynomial ((i : ι) → R i) ≃+* ((i : ι) → Polynomial (R i))

The polynomial ring over a finite product of rings is isomorphic to the product of polynomial rings over individual rings.

Equations
Instances For
theorem Polynomial.eval₂_eq_eval_map {R : Type u} {S : Type v} [] {p : } [] (f : R →+* S) {x : S} :
=
theorem Polynomial.map_injective {R : Type u} {S : Type v} [] [] (f : R →+* S) (hf : ) :
theorem Polynomial.map_surjective {R : Type u} {S : Type v} [] [] (f : R →+* S) (hf : ) :
theorem Polynomial.degree_map_le {R : Type u} {S : Type v} [] [] (f : R →+* S) (p : ) :
().degree p.degree
theorem Polynomial.natDegree_map_le {R : Type u} {S : Type v} [] [] (f : R →+* S) (p : ) :
().natDegree p.natDegree
theorem Polynomial.map_eq_zero_iff {R : Type u} {S : Type v} [] {p : } [] {f : R →+* S} (hf : ) :
= 0 p = 0
theorem Polynomial.map_ne_zero_iff {R : Type u} {S : Type v} [] {p : } [] {f : R →+* S} (hf : ) :
0 p 0
theorem Polynomial.map_monic_eq_zero_iff {R : Type u} {S : Type v} [] {p : } [] {f : R →+* S} (hp : p.Monic) :
= 0 ∀ (x : R), f x = 0
theorem Polynomial.map_monic_ne_zero {R : Type u} {S : Type v} [] {p : } [] {f : R →+* S} (hp : p.Monic) [] :
0
theorem Polynomial.degree_map_eq_of_leadingCoeff_ne_zero {R : Type u} {S : Type v} [] {p : } [] (f : R →+* S) (hf : f p.leadingCoeff 0) :
().degree = p.degree
theorem Polynomial.natDegree_map_of_leadingCoeff_ne_zero {R : Type u} {S : Type v} [] {p : } [] (f : R →+* S) (hf : f p.leadingCoeff 0) :
().natDegree = p.natDegree
theorem Polynomial.leadingCoeff_map_of_leadingCoeff_ne_zero {R : Type u} {S : Type v} [] {p : } [] (f : R →+* S) (hf : f p.leadingCoeff 0) :
@[simp]
theorem Polynomial.mapRingHom_id {R : Type u} [] :
@[simp]
theorem Polynomial.mapRingHom_comp {R : Type u} {S : Type v} {T : Type w} [] [] [] (f : S →+* T) (g : R →+* S) :
.comp = Polynomial.mapRingHom (f.comp g)
theorem Polynomial.map_list_prod {R : Type u} {S : Type v} [] [] (f : R →+* S) (L : List ()) :
Polynomial.map f L.prod = ().prod
@[simp]
theorem Polynomial.map_pow {R : Type u} {S : Type v} [] {p : } [] (f : R →+* S) (n : ) :
Polynomial.map f (p ^ n) = ^ n
theorem Polynomial.mem_map_rangeS {R : Type u} {S : Type v} [] [] (f : R →+* S) {p : } :
p .rangeS ∀ (n : ), p.coeff n f.rangeS
theorem Polynomial.mem_map_range {R : Type u_1} {S : Type u_2} [Ring R] [Ring S] (f : R →+* S) {p : } :
p .range ∀ (n : ), p.coeff n f.range
theorem Polynomial.eval₂_map {R : Type u} {S : Type v} {T : Type w} [] {p : } [] (f : R →+* S) [] (g : S →+* T) (x : T) :
theorem Polynomial.eval_map {R : Type u} {S : Type v} [] {p : } [] (f : R →+* S) (x : S) :
=
theorem Polynomial.map_sum {R : Type u} {S : Type v} [] [] (f : R →+* S) {ι : Type u_1} (g : ι) (s : ) :
Polynomial.map f (s.sum fun (i : ι) => g i) = s.sum fun (i : ι) => Polynomial.map f (g i)
theorem Polynomial.map_comp {R : Type u} {S : Type v} [] [] (f : R →+* S) (p : ) (q : ) :
Polynomial.map f (p.comp q) = ().comp ()
@[simp]
theorem Polynomial.eval_zero_map {R : Type u} {S : Type v} [] [] (f : R →+* S) (p : ) :
= f ()
@[simp]
theorem Polynomial.eval_one_map {R : Type u} {S : Type v} [] [] (f : R →+* S) (p : ) :
= f ()
@[simp]
theorem Polynomial.eval_natCast_map {R : Type u} {S : Type v} [] [] (f : R →+* S) (p : ) (n : ) :
Polynomial.eval (n) () = f (Polynomial.eval (n) p)
@[simp]
theorem Polynomial.eval_intCast_map {R : Type u_1} {S : Type u_2} [Ring R] [Ring S] (f : R →+* S) (p : ) (i : ) :
Polynomial.eval (i) () = f (Polynomial.eval (i) p)

we have made eval₂ irreducible from the start.

Perhaps we can make also eval, comp, and map irreducible too?

theorem Polynomial.hom_eval₂ {R : Type u} {S : Type v} {T : Type w} [] (p : ) [] [] (f : R →+* S) (g : S →+* T) (x : S) :
g () = Polynomial.eval₂ (g.comp f) (g x) p
theorem Polynomial.eval₂_hom {R : Type u} {S : Type v} [] {p : } [] (f : R →+* S) (x : R) :
Polynomial.eval₂ f (f x) p = f ()
theorem Polynomial.eval₂_comp {R : Type u} {S : Type v} [] {p : } {q : } [] (f : R →+* S) {x : S} :
@[simp]
theorem Polynomial.iterate_comp_eval₂ {R : Type u} {S : Type v} [] {p : } {q : } [] (f : R →+* S) (k : ) (t : S) :
Polynomial.eval₂ f t (p.comp^[k] q) = (fun (x : S) => )^[k] ()
@[simp]
theorem Polynomial.eval₂_mul' {R : Type u} {S : Type v} [] [] [Algebra R S] (x : S) (p : ) (q : ) :
@[simp]
theorem Polynomial.eval₂_pow' {R : Type u} {S : Type v} [] [] [Algebra R S] (x : S) (p : ) (n : ) :
@[simp]
theorem Polynomial.eval₂_comp' {R : Type u} {S : Type v} [] [] [Algebra R S] (x : S) (p : ) (q : ) :
@[simp]
theorem Polynomial.eval_mul {R : Type u} [] {p : } {q : } {x : R} :
Polynomial.eval x (p * q) = *
def Polynomial.evalRingHom {R : Type u} [] :
R

eval r, regarded as a ring homomorphism from R[X] to R.

Equations
• Polynomial.evalRingHom =
Instances For
@[simp]
theorem Polynomial.coe_evalRingHom {R : Type u} [] (r : R) :
theorem Polynomial.evalRingHom_zero :
= Polynomial.constantCoeff
@[simp]
theorem Polynomial.eval_pow {R : Type u} [] {p : } {x : R} (n : ) :
Polynomial.eval x (p ^ n) = ^ n
@[simp]
theorem Polynomial.eval_comp {R : Type u} [] {p : } {q : } {x : R} :
Polynomial.eval x (p.comp q) =
@[simp]
theorem Polynomial.iterate_comp_eval {R : Type u} [] {p : } {q : } (k : ) (t : R) :
Polynomial.eval t (p.comp^[k] q) = (fun (x : R) => )^[k] ()
theorem Polynomial.isRoot_comp {R : Type u_1} [] {p : } {q : } {r : R} :
(p.comp q).IsRoot r p.IsRoot ()
def Polynomial.compRingHom {R : Type u} [] :

comp p, regarded as a ring homomorphism from R[X] to itself.

Equations
Instances For
@[simp]
theorem Polynomial.coe_compRingHom {R : Type u} [] (q : ) :
q.compRingHom = fun (p : ) => p.comp q
theorem Polynomial.coe_compRingHom_apply {R : Type u} [] (p : ) (q : ) :
q.compRingHom p = p.comp q
theorem Polynomial.root_mul_left_of_isRoot {R : Type u} {a : R} [] (p : ) {q : } :
q.IsRoot a(p * q).IsRoot a
theorem Polynomial.root_mul_right_of_isRoot {R : Type u} {a : R} [] {p : } (q : ) :
p.IsRoot a(p * q).IsRoot a
theorem Polynomial.eval₂_multiset_prod {R : Type u} {S : Type v} [] [] (f : R →+* S) (s : ) (x : S) :
Polynomial.eval₂ f x s.prod = (Multiset.map () s).prod
theorem Polynomial.eval₂_finset_prod {R : Type u} {S : Type v} {ι : Type y} [] [] (f : R →+* S) (s : ) (g : ι) (x : S) :
Polynomial.eval₂ f x (s.prod fun (i : ι) => g i) = s.prod fun (i : ι) => Polynomial.eval₂ f x (g i)
theorem Polynomial.eval_list_prod {R : Type u} [] (l : List ()) (x : R) :
Polynomial.eval x l.prod = ().prod

Polynomial evaluation commutes with List.prod

theorem Polynomial.eval_multiset_prod {R : Type u} [] (s : ) (x : R) :
Polynomial.eval x s.prod = ().prod

Polynomial evaluation commutes with Multiset.prod

theorem Polynomial.eval_prod {R : Type u} [] {ι : Type u_1} (s : ) (p : ι) (x : R) :
Polynomial.eval x (s.prod fun (j : ι) => p j) = s.prod fun (j : ι) => Polynomial.eval x (p j)

Polynomial evaluation commutes with Finset.prod

theorem Polynomial.list_prod_comp {R : Type u} [] (l : List ()) (q : ) :
l.prod.comp q = (List.map (fun (p : ) => p.comp q) l).prod
theorem Polynomial.multiset_prod_comp {R : Type u} [] (s : ) (q : ) :
s.prod.comp q = (Multiset.map (fun (p : ) => p.comp q) s).prod
theorem Polynomial.prod_comp {R : Type u} [] {ι : Type u_1} (s : ) (p : ι) (q : ) :
(s.prod fun (j : ι) => p j).comp q = s.prod fun (j : ι) => (p j).comp q
theorem Polynomial.isRoot_prod {R : Type u_2} [] [] {ι : Type u_1} (s : ) (p : ι) (x : R) :
(s.prod fun (j : ι) => p j).IsRoot x is, (p i).IsRoot x
theorem Polynomial.eval_dvd {R : Type u} [] {p : } {q : } {x : R} :
p q
theorem Polynomial.eval_eq_zero_of_dvd_of_eval_eq_zero {R : Type u} [] {p : } {q : } {x : R} :
p q = 0 = 0
@[simp]
theorem Polynomial.eval_geom_sum {R : Type u_1} [] {n : } {x : R} :
Polynomial.eval x (().sum fun (i : ) => Polynomial.X ^ i) = ().sum fun (i : ) => x ^ i
theorem Polynomial.support_map_subset {R : Type u} {S : Type v} [] [] (f : R →+* S) (p : ) :
().support p.support
theorem Polynomial.support_map_of_injective {R : Type u} {S : Type v} [] [] (p : ) {f : R →+* S} (hf : ) :
().support = p.support
theorem Polynomial.map_multiset_prod {R : Type u} {S : Type v} [] [] (f : R →+* S) (m : ) :
Polynomial.map f m.prod = ().prod
theorem Polynomial.map_prod {R : Type u} {S : Type v} [] [] (f : R →+* S) {ι : Type u_1} (g : ι) (s : ) :
Polynomial.map f (s.prod fun (i : ι) => g i) = s.prod fun (i : ι) => Polynomial.map f (g i)
theorem Polynomial.IsRoot.map {R : Type u} {S : Type v} [] [] {f : R →+* S} {x : R} {p : } (h : p.IsRoot x) :
().IsRoot (f x)
theorem Polynomial.IsRoot.of_map {S : Type v} [] {R : Type u_1} [] {f : R →+* S} {x : R} {p : } (h : ().IsRoot (f x)) (hf : ) :
p.IsRoot x
theorem Polynomial.isRoot_map_iff {S : Type v} [] {R : Type u_1} [] {f : R →+* S} {x : R} {p : } (hf : ) :
().IsRoot (f x) p.IsRoot x
@[simp]
theorem Polynomial.map_sub {R : Type u} [Ring R] {p : } {q : } {S : Type u_1} [Ring S] (f : R →+* S) :
Polynomial.map f (p - q) = -
@[simp]
theorem Polynomial.map_neg {R : Type u} [Ring R] {p : } {S : Type u_1} [Ring S] (f : R →+* S) :
@[simp]
theorem Polynomial.map_intCast {R : Type u} [Ring R] {S : Type u_1} [Ring S] (f : R →+* S) (n : ) :
= n
@[simp]
theorem Polynomial.eval_intCast {R : Type u} [Ring R] {n : } {x : R} :
= n
@[simp]
theorem Polynomial.eval₂_neg {R : Type u} [Ring R] {p : } {S : Type u_1} [Ring S] (f : R →+* S) {x : S} :
@[simp]
theorem Polynomial.eval₂_sub {R : Type u} [Ring R] {p : } {q : } {S : Type u_1} [Ring S] (f : R →+* S) {x : S} :
Polynomial.eval₂ f x (p - q) = -
@[simp]
theorem Polynomial.eval_neg {R : Type u} [Ring R] (p : ) (x : R) :
@[simp]
theorem Polynomial.eval_sub {R : Type u} [Ring R] (p : ) (q : ) (x : R) :
Polynomial.eval x (p - q) = -
theorem Polynomial.root_X_sub_C {R : Type u} {a : R} {b : R} [Ring R] :
(Polynomial.X - Polynomial.C a).IsRoot b a = b
@[simp]
theorem Polynomial.neg_comp {R : Type u} [Ring R] {p : } {q : } :
(-p).comp q = -p.comp q
@[simp]
theorem Polynomial.sub_comp {R : Type u} [Ring R] {p : } {q : } {r : } :
(p - q).comp r = p.comp r - q.comp r
@[simp]
theorem Polynomial.cast_int_comp {R : Type u} [Ring R] {p : } (i : ) :
(i).comp p = i
@[simp]
theorem Polynomial.eval₂_at_intCast {R : Type u} [Ring R] {p : } {S : Type u_1} [Ring S] (f : R →+* S) (n : ) :
Polynomial.eval₂ f (n) p = f (Polynomial.eval (n) p)
theorem Polynomial.mul_X_sub_intCast_comp {R : Type u} [Ring R] {p : } {q : } {n : } :
(p * (Polynomial.X - n)).comp q = p.comp q * (q - n)