The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V09. Commutative algebra I: ideals, polynomials, factorization

Mathlib.Algebra.Polynomial.Eval.Defs

155 declarations and 2 deprecated aliases. Mathlib docs · Source

Evaluating a polynomial

Main definitions

  • Polynomial.eval₂: evaluate p : R[X] in S given a ring hom f : R →+* S and x : S.
  • Polynomial.eval: evaluate p : R[X] given x : R.
  • Polynomial.IsRoot: x : R is a root of p : R[X].
  • Polynomial.comp: compose two polynomials p q : R[X] by evaluating p at q.
  • Polynomial.map: apply f : R →+* S to the coefficients of p : R[X].

We also provide the following bundled versions:

  • Polynomial.eval₂AddMonoidHom, Polynomial.eval₂RingHom
  • Polynomial.evalRingHom
  • Polynomial.compRingHom
  • Polynomial.mapRingHom

We include results on applying the definitions to C, X and ring operations.

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

def Polynomial.eval₂ E3 #

{R : Type u} → {S : Type v} → [inst : Semiring R] → [inst_1 : Semiring S] → (R →+* S) → S → Polynomial R → 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

theorem Polynomial.eval₂_eq_sum E1 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] {p : Polynomial R} [inst_1 : Semiring S] {f : R →+* S} {x : S},
  Polynomial.eval₂ f x p = p.sum fun e a ↦ f a * x ^ e

theorem Polynomial.eval₂_congr E1 #

∀ {R : Type u_1} {S : Type u_2} [inst : Semiring R] [inst_1 : Semiring S] {f g : R →+* S} {s t : S}
  {φ ψ : Polynomial R}, f = g → s = t → φ = ψ → Polynomial.eval₂ f s φ = Polynomial.eval₂ g t ψ

theorem Polynomial.eval₂_zero E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) (x : S), Polynomial.eval₂ f x 0 = 0

theorem Polynomial.eval₂_C E0 #

∀ {R : Type u} {S : Type v} {a : R} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) (x : S),
  Polynomial.eval₂ f x (Polynomial.C a) = f a

theorem Polynomial.eval₂_X E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) (x : S),
  Polynomial.eval₂ f x Polynomial.X = x

theorem Polynomial.eval₂_monomial E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) (x : S) {n : ℕ} {r : R},
  Polynomial.eval₂ f x ((Polynomial.monomial n) r) = f r * x ^ n

theorem Polynomial.eval₂_X_pow E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) (x : S) {n : ℕ},
  Polynomial.eval₂ f x (Polynomial.X ^ n) = x ^ n

theorem Polynomial.eval₂_add E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] {p q : Polynomial R} [inst_1 : Semiring S] (f : R →+* S) (x : S),
  Polynomial.eval₂ f x (p + q) = Polynomial.eval₂ f x p + Polynomial.eval₂ f x q

theorem Polynomial.eval₂_one E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) (x : S), Polynomial.eval₂ f x 1 = 1

def Polynomial.eval₂AddMonoidHom E3 #

{R : Type u} → {S : Type v} → [inst : Semiring R] → [inst_1 : Semiring S] → (R →+* S) → S → Polynomial R →+ 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.

theorem Polynomial.eval₂AddMonoidHom_apply E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) (x : S) (p : Polynomial R),
  (Polynomial.eval₂AddMonoidHom f x) p = Polynomial.eval₂ f x p

theorem Polynomial.eval₂_natCast E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) (x : S) (n : ℕ),
  Polynomial.eval₂ f x ↑n = ↑n

theorem Polynomial.eval₂_ofNat E0 #

∀ {R : Type u} [inst : Semiring R] {S : Type u_1} [inst_1 : Semiring S] (n : ℕ) [inst_2 : n.AtLeastTwo] (f : R →+* S)
  (a : S), Polynomial.eval₂ f a (OfNat.ofNat n) = OfNat.ofNat n

theorem Polynomial.eval₂_sum E1 #

∀ {R : Type u} {S : Type v} {T : Type w} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) [inst_2 : Semiring T]
  (p : Polynomial T) (g : ℕ → T → Polynomial R) (x : S),
  Polynomial.eval₂ f x (p.sum g) = p.sum fun n a ↦ Polynomial.eval₂ f x (g n a)

theorem Polynomial.eval₂_list_sum E1 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) (l : List (Polynomial R)) (x : S),
  Polynomial.eval₂ f x l.sum = (List.map (Polynomial.eval₂ f x) l).sum

theorem Polynomial.eval₂_multiset_sum E1 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) (s : Multiset (Polynomial R))
  (x : S), Polynomial.eval₂ f x s.sum = (Multiset.map (Polynomial.eval₂ f x) s).sum

theorem Polynomial.eval₂_finsetSum E1 #

∀ {R : Type u} {S : Type v} {ι : Type y} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) (s : Finset ι)
  (g : ι → Polynomial R) (x : S), Polynomial.eval₂ f x (∑ i ∈ s, g i) = ∑ i ∈ s, Polynomial.eval₂ f x (g i)

theorem Polynomial.eval₂_eq_liftNC E1 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] {f : R →+* S} {x : S} {p : Polynomial R},
  Polynomial.eval₂ f x p = (AddMonoidAlgebra.liftNC ↑f ⇑((powersHom S) x)) p

theorem Polynomial.eval₂_mul_noncomm E1 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] {p q : Polynomial R} [inst_1 : Semiring S] (f : R →+* S) (x : S),
  (∀ (k : ℕ), Commute (f (q.coeff k)) x) →
    Polynomial.eval₂ f x (p * q) = Polynomial.eval₂ f x p * Polynomial.eval₂ f x q

theorem Polynomial.eval₂_mul_X E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] {p : Polynomial R} [inst_1 : Semiring S] (f : R →+* S) (x : S),
  Polynomial.eval₂ f x (p * Polynomial.X) = Polynomial.eval₂ f x p * x

theorem Polynomial.eval₂_X_mul E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] {p : Polynomial R} [inst_1 : Semiring S] (f : R →+* S) (x : S),
  Polynomial.eval₂ f x (Polynomial.X * p) = Polynomial.eval₂ f x p * x

theorem Polynomial.eval₂_mul_C' E1 #

∀ {R : Type u} {S : Type v} {a : R} [inst : Semiring R] {p : Polynomial R} [inst_1 : Semiring S] (f : R →+* S) (x : S),
  Commute (f a) x → Polynomial.eval₂ f x (p * Polynomial.C a) = Polynomial.eval₂ f x p * f a

theorem Polynomial.eval₂_list_prod_noncomm E1 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) (x : S) (ps : List (Polynomial R)),
  (∀ p ∈ ps, ∀ (k : ℕ), Commute (f (p.coeff k)) x) →
    Polynomial.eval₂ f x ps.prod = (List.map (Polynomial.eval₂ f x) ps).prod

def Polynomial.eval₂RingHom' E1 #

{R : Type u} →
  {S : Type v} →
    [inst : Semiring R] →
      [inst_1 : Semiring S] → (f : R →+* S) → (x : S) → (∀ (a : R), Commute (f a) x) → Polynomial R →+* S

eval₂ as a RingHom for noncommutative rings

theorem Polynomial.eval₂RingHom'_apply E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) (x : S)
  (hf : ∀ (a : R), Commute (f a) x) (p : Polynomial R), (Polynomial.eval₂RingHom' f x hf) p = Polynomial.eval₂ f x p

theorem Polynomial.eval₂_mul E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] {p q : Polynomial R} [inst_1 : CommSemiring S] (f : R →+* S) (x : S),
  Polynomial.eval₂ f x (p * q) = Polynomial.eval₂ f x p * Polynomial.eval₂ f x q

theorem Polynomial.eval₂_mul_eq_zero_of_left E1 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] {p : Polynomial R} [inst_1 : CommSemiring S] (f : R →+* S) (x : S)
  (q : Polynomial R), Polynomial.eval₂ f x p = 0 → Polynomial.eval₂ f x (p * q) = 0

theorem Polynomial.eval₂_mul_eq_zero_of_right E1 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] {q : Polynomial R} [inst_1 : CommSemiring S] (f : R →+* S) (x : S)
  (p : Polynomial R), Polynomial.eval₂ f x q = 0 → Polynomial.eval₂ f x (p * q) = 0

def Polynomial.eval₂RingHom E3 #

{R : Type u} → {S : Type v} → [inst : Semiring R] → [inst_1 : CommSemiring S] → (R →+* S) → S → Polynomial R →+* S

eval₂ as a RingHom

theorem Polynomial.coe_eval₂RingHom E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : CommSemiring S] (f : R →+* S) (x : S),
  ⇑(Polynomial.eval₂RingHom f x) = Polynomial.eval₂ f x

theorem Polynomial.eval₂RingHom_comp_C E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : CommSemiring S] (f : R →+* S) (x : S),
  (Polynomial.eval₂RingHom f x).comp Polynomial.C = f

theorem Polynomial.eval₂_pow E1 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] {p : Polynomial R} [inst_1 : CommSemiring S] (f : R →+* S) (x : S)
  (n : ℕ), Polynomial.eval₂ f x (p ^ n) = Polynomial.eval₂ f x p ^ n

theorem Polynomial.eval₂_dvd E1 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] {p q : Polynomial R} [inst_1 : CommSemiring S] (f : R →+* S) (x : S),
  p ∣ q → Polynomial.eval₂ f x p ∣ Polynomial.eval₂ f x q

theorem Polynomial.eval₂_eq_zero_of_dvd_of_eval₂_eq_zero E1 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] {p q : Polynomial R} [inst_1 : CommSemiring S] (f : R →+* S) (x : S),
  p ∣ q → Polynomial.eval₂ f x p = 0 → Polynomial.eval₂ f x q = 0

theorem Polynomial.eval₂_list_prod E1 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : CommSemiring S] (f : R →+* S) (l : List (Polynomial R))
  (x : S), Polynomial.eval₂ f x l.prod = (List.map (Polynomial.eval₂ f x) l).prod

def Polynomial.eval E3 #

{R : Type u} → [inst : Semiring R] → R → Polynomial R → R

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

theorem Polynomial.eval₂_id E0 #

∀ {R : Type u} [inst : Semiring R] {p : Polynomial R} {x : R}, Polynomial.eval₂ (RingHom.id R) x p = Polynomial.eval x p

theorem Polynomial.eval_eq_sum E1 #

∀ {R : Type u} [inst : Semiring R] {p : Polynomial R} {x : R}, Polynomial.eval x p = p.sum fun e a ↦ a * x ^ e

theorem Polynomial.eval₂_at_apply E0 #

∀ {R : Type u} [inst : Semiring R] {p : Polynomial R} {S : Type u_1} [inst_1 : Semiring S] (f : R →+* S) (r : R),
  Polynomial.eval₂ f (f r) p = f (Polynomial.eval r p)

theorem Polynomial.eval₂_at_one E0 #

∀ {R : Type u} [inst : Semiring R] {p : Polynomial R} {S : Type u_1} [inst_1 : Semiring S] (f : R →+* S),
  Polynomial.eval₂ f 1 p = f (Polynomial.eval 1 p)

theorem Polynomial.eval₂_at_natCast E0 #

∀ {R : Type u} [inst : Semiring R] {p : Polynomial R} {S : Type u_1} [inst_1 : Semiring S] (f : R →+* S) (n : ℕ),
  Polynomial.eval₂ f (↑n) p = f (Polynomial.eval (↑n) p)

theorem Polynomial.eval₂_at_ofNat E0 #

∀ {R : Type u} [inst : Semiring R] {p : Polynomial R} {S : Type u_1} [inst_1 : Semiring S] (f : R →+* S) (n : ℕ)
  [inst_2 : n.AtLeastTwo], Polynomial.eval₂ f (OfNat.ofNat n) p = f (Polynomial.eval (OfNat.ofNat n) p)

theorem Polynomial.eval_C E0 #

∀ {R : Type u} {a : R} [inst : Semiring R] {x : R}, Polynomial.eval x (Polynomial.C a) = a

theorem Polynomial.eval_natCast E0 #

∀ {R : Type u} [inst : Semiring R] {x : R} {n : ℕ}, Polynomial.eval x ↑n = ↑n

theorem Polynomial.eval_ofNat E0 #

∀ {R : Type u} [inst : Semiring R] (n : ℕ) [inst_1 : n.AtLeastTwo] (a : R),
  Polynomial.eval a (OfNat.ofNat n) = OfNat.ofNat n

theorem Polynomial.eval_X E0 #

∀ {R : Type u} [inst : Semiring R] {x : R}, Polynomial.eval x Polynomial.X = x

theorem Polynomial.eval_monomial E0 #

∀ {R : Type u} [inst : Semiring R] {x : R} {n : ℕ} {a : R}, Polynomial.eval x ((Polynomial.monomial n) a) = a * x ^ n

theorem Polynomial.eval_zero E0 #

∀ {R : Type u} [inst : Semiring R] {x : R}, Polynomial.eval x 0 = 0

theorem Polynomial.eval_add E0 #

∀ {R : Type u} [inst : Semiring R] {p q : Polynomial R} {x : R},
  Polynomial.eval x (p + q) = Polynomial.eval x p + Polynomial.eval x q

theorem Polynomial.eval_one E0 #

∀ {R : Type u} [inst : Semiring R] {x : R}, Polynomial.eval x 1 = 1

theorem Polynomial.eval_C_mul E0 #

∀ {R : Type u} {a : R} [inst : Semiring R] {p : Polynomial R} {x : R},
  Polynomial.eval x (Polynomial.C a * p) = a * Polynomial.eval x p

theorem Polynomial.eval_natCast_mul E0 #

∀ {R : Type u} [inst : Semiring R] {p : Polynomial R} {x : R} {n : ℕ},
  Polynomial.eval x (↑n * p) = ↑n * Polynomial.eval x p

theorem Polynomial.eval_mul_X E0 #

∀ {R : Type u} [inst : Semiring R] {p : Polynomial R} {x : R},
  Polynomial.eval x (p * Polynomial.X) = Polynomial.eval x p * x

theorem Polynomial.eval_mul_X_pow E0 #

∀ {R : Type u} [inst : Semiring R] {p : Polynomial R} {x : R} {k : ℕ},
  Polynomial.eval x (p * Polynomial.X ^ k) = Polynomial.eval x p * x ^ k

theorem Polynomial.eval_mul_C_of_commute E1 #

∀ {R : Type u} {a : R} [inst : Semiring R] {p : Polynomial R} {x : R},
  Commute a x → Polynomial.eval x (p * Polynomial.C a) = Polynomial.eval x p * a

theorem Polynomial.eval_listSum E1 #

∀ {R : Type u} [inst : Semiring R] (l : List (Polynomial R)) (x : R),
  Polynomial.eval x l.sum = (List.map (Polynomial.eval x) l).sum

Polynomial evaluation commutes with List.sum.

theorem Polynomial.eval_multisetSum E1 #

∀ {R : Type u} [inst : Semiring R] (s : Multiset (Polynomial R)) (x : R),
  Polynomial.eval x s.sum = (Multiset.map (Polynomial.eval x) s).sum

Polynomial evaluation commutes with Multiset.sum.

theorem Polynomial.eval_sum E1 #

∀ {R : Type u} [inst : Semiring R] (p : Polynomial R) (f : ℕ → R → Polynomial R) (x : R),
  Polynomial.eval x (p.sum f) = p.sum fun n a ↦ Polynomial.eval x (f n a)

theorem Polynomial.eval_finsetSum E1 #

∀ {R : Type u} {ι : Type y} [inst : Semiring R] (s : Finset ι) (g : ι → Polynomial R) (x : R),
  Polynomial.eval x (∑ i ∈ s, g i) = ∑ i ∈ s, Polynomial.eval x (g i)

def Polynomial.IsRoot E3 #

{R : Type u} → [inst : Semiring R] → Polynomial R → R → Prop

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

instance Polynomial.IsRoot.decidable E0 #

{R : Type u} → {a : R} → [inst : Semiring R] → {p : Polynomial R} → [DecidableEq R] → Decidable (p.IsRoot a)

theorem Polynomial.IsRoot.def E0 #

∀ {R : Type u} {a : R} [inst : Semiring R] {p : Polynomial R}, p.IsRoot a ↔ Polynomial.eval a p = 0

theorem Polynomial.IsRoot.dvd E1 #

∀ {R : Type u_1} [inst : CommSemiring R] {p q : Polynomial R} {x : R}, p.IsRoot x → p ∣ q → q.IsRoot x

theorem Polynomial.not_isRoot_C E1 #

∀ {R : Type u} [inst : Semiring R] (r a : R), r ≠ 0 → ¬(Polynomial.C r).IsRoot a

theorem Polynomial.eval_surjective E1 #

∀ {R : Type u} [inst : Semiring R] (x : R), Function.Surjective (Polynomial.eval x)

def Polynomial.comp E3 #

{R : Type u} → [inst : Semiring R] → Polynomial R → Polynomial R → Polynomial R

The composition of polynomials as a polynomial.

theorem Polynomial.comp_eq_sum_left E1 #

∀ {R : Type u} [inst : Semiring R] {p q : Polynomial R}, p.comp q = p.sum fun e a ↦ Polynomial.C a * q ^ e

theorem Polynomial.comp_X E0 #

∀ {R : Type u} [inst : Semiring R] {p : Polynomial R}, p.comp Polynomial.X = p

theorem Polynomial.X_comp E0 #

∀ {R : Type u} [inst : Semiring R] {p : Polynomial R}, Polynomial.X.comp p = p

theorem Polynomial.comp_C E0 #

∀ {R : Type u} {a : R} [inst : Semiring R] {p : Polynomial R},
  p.comp (Polynomial.C a) = Polynomial.C (Polynomial.eval a p)

theorem Polynomial.C_comp E0 #

∀ {R : Type u} {a : R} [inst : Semiring R] {p : Polynomial R}, (Polynomial.C a).comp p = Polynomial.C a

theorem Polynomial.natCast_comp E0 #

∀ {R : Type u} [inst : Semiring R] {p : Polynomial R} {n : ℕ}, (↑n).comp p = ↑n

theorem Polynomial.ofNat_comp E0 #

∀ {R : Type u} [inst : Semiring R] {p : Polynomial R} (n : ℕ) [inst_1 : n.AtLeastTwo], (OfNat.ofNat n).comp p = ↑n

theorem Polynomial.comp_zero E0 #

∀ {R : Type u} [inst : Semiring R] {p : Polynomial R}, p.comp 0 = Polynomial.C (Polynomial.eval 0 p)

theorem Polynomial.zero_comp E0 #

∀ {R : Type u} [inst : Semiring R] {p : Polynomial R}, Polynomial.comp 0 p = 0

theorem Polynomial.comp_one E0 #

∀ {R : Type u} [inst : Semiring R] {p : Polynomial R}, p.comp 1 = Polynomial.C (Polynomial.eval 1 p)

theorem Polynomial.one_comp E0 #

∀ {R : Type u} [inst : Semiring R] {p : Polynomial R}, Polynomial.comp 1 p = 1

theorem Polynomial.add_comp E0 #

∀ {R : Type u} [inst : Semiring R] {p q r : Polynomial R}, (p + q).comp r = p.comp r + q.comp r

theorem Polynomial.monomial_comp E0 #

∀ {R : Type u} {a : R} [inst : Semiring R] {p : Polynomial R} (n : ℕ),
  ((Polynomial.monomial n) a).comp p = Polynomial.C a * p ^ n

theorem Polynomial.mul_X_comp E0 #

∀ {R : Type u} [inst : Semiring R] {p r : Polynomial R}, (p * Polynomial.X).comp r = p.comp r * r

theorem Polynomial.X_pow_comp E0 #

∀ {R : Type u} [inst : Semiring R] {p : Polynomial R} {k : ℕ}, (Polynomial.X ^ k).comp p = p ^ k

theorem Polynomial.mul_X_pow_comp E0 #

∀ {R : Type u} [inst : Semiring R] {p r : Polynomial R} {k : ℕ}, (p * Polynomial.X ^ k).comp r = p.comp r * r ^ k

theorem Polynomial.C_mul_comp E0 #

∀ {R : Type u} {a : R} [inst : Semiring R] {p r : Polynomial R}, (Polynomial.C a * p).comp r = Polynomial.C a * p.comp r

theorem Polynomial.natCast_mul_comp E0 #

∀ {R : Type u} [inst : Semiring R] {p r : Polynomial R} {n : ℕ}, (↑n * p).comp r = ↑n * p.comp r

theorem Polynomial.mul_X_add_natCast_comp E1 #

∀ {R : Type u} [inst : Semiring R] {p q : Polynomial R} {n : ℕ}, (p * (Polynomial.X + ↑n)).comp q = p.comp q * (q + ↑n)

theorem Polynomial.mul_comp E0 #

∀ {R : Type u_1} [inst : CommSemiring R] (p q r : Polynomial R), (p * q).comp r = p.comp r * q.comp r

theorem Polynomial.mul_comp_neg_X E0 #

∀ {R : Type u_1} [inst : Ring R] (p q : Polynomial R),
  (p * q).comp (-Polynomial.X) = p.comp (-Polynomial.X) * q.comp (-Polynomial.X)

theorem Polynomial.pow_comp E0 #

∀ {R : Type u_1} [inst : CommSemiring R] (p q : Polynomial R) (n : ℕ), (p ^ n).comp q = p.comp q ^ n

theorem Polynomial.comp_assoc E1 #

∀ {R : Type u_1} [inst : CommSemiring R] (φ ψ χ : Polynomial R), (φ.comp ψ).comp χ = φ.comp (ψ.comp χ)

theorem Polynomial.sum_comp E0 #

∀ {R : Type u} {ι : Type y} [inst : Semiring R] (s : Finset ι) (p : ι → Polynomial R) (q : Polynomial R),
  (∑ i ∈ s, p i).comp q = ∑ i ∈ s, (p i).comp q

def Polynomial.map E3 #

{R : Type u} → {S : Type v} → [inst : Semiring R] → [inst_1 : Semiring S] → (R →+* S) → Polynomial R → Polynomial S

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

theorem Polynomial.map_C E0 #

∀ {R : Type u} {S : Type v} {a : R} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S),
  Polynomial.map f (Polynomial.C a) = Polynomial.C (f a)

theorem Polynomial.map_X E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S),
  Polynomial.map f Polynomial.X = Polynomial.X

theorem Polynomial.map_monomial E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) {n : ℕ} {a : R},
  Polynomial.map f ((Polynomial.monomial n) a) = (Polynomial.monomial n) (f a)

theorem Polynomial.map_zero E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S), Polynomial.map f 0 = 0

theorem Polynomial.map_add E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] {p q : Polynomial R} [inst_1 : Semiring S] (f : R →+* S),
  Polynomial.map f (p + q) = Polynomial.map f p + Polynomial.map f q

theorem Polynomial.map_one E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S), Polynomial.map f 1 = 1

theorem Polynomial.map_mul E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] {p q : Polynomial R} [inst_1 : Semiring S] (f : R →+* S),
  Polynomial.map f (p * q) = Polynomial.map f p * Polynomial.map f q

def Polynomial.mapRingHom E3 #

{R : Type u} → {S : Type v} → [inst : Semiring R] → [inst_1 : Semiring S] → (R →+* S) → Polynomial R →+* Polynomial S

Polynomial.map as a RingHom.

theorem Polynomial.coe_mapRingHom E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S),
  ⇑(Polynomial.mapRingHom f) = Polynomial.map f

theorem Polynomial.map_natCast E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) (n : ℕ), Polynomial.map f ↑n = ↑n

theorem Polynomial.map_ofNat E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) (n : ℕ) [inst_2 : n.AtLeastTwo],
  Polynomial.map f (OfNat.ofNat n) = OfNat.ofNat n

theorem Polynomial.map_dvd E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) {x y : Polynomial R},
  x ∣ y → Polynomial.map f x ∣ Polynomial.map f y

theorem Polynomial.associated_map_map E1 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) {x y : Polynomial R},
  Associated x y → Associated (Polynomial.map f x) (Polynomial.map f y)

theorem Polynomial.mapRingHom_comp_C E1 #

∀ {R : Type u_1} {S : Type u_2} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S),
  (Polynomial.mapRingHom f).comp Polynomial.C = Polynomial.C.comp f

theorem Polynomial.eval₂_eq_eval_map E1 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] {p : Polynomial R} [inst_1 : Semiring S] (f : R →+* S) {x : S},
  Polynomial.eval₂ f x p = Polynomial.eval x (Polynomial.map f p)

theorem Polynomial.map_list_prod E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) (L : List (Polynomial R)),
  Polynomial.map f L.prod = (List.map (Polynomial.map f) L).prod

theorem Polynomial.map_pow E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] {p : Polynomial R} [inst_1 : Semiring S] (f : R →+* S) (n : ℕ),
  Polynomial.map f (p ^ n) = Polynomial.map f p ^ n

theorem Polynomial.eval_map E1 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] {p : Polynomial R} [inst_1 : Semiring S] (f : R →+* S) (x : S),
  Polynomial.eval x (Polynomial.map f p) = Polynomial.eval₂ f x p

theorem Polynomial.eval_map_apply E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] {p : Polynomial R} [inst_1 : Semiring S] (f : R →+* S) (x : R),
  Polynomial.eval (f x) (Polynomial.map f p) = f (Polynomial.eval x p)

theorem Polynomial.map_sum E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) {ι : Type u_1}
  (g : ι → Polynomial R) (s : Finset ι), Polynomial.map f (∑ i ∈ s, g i) = ∑ i ∈ s, Polynomial.map f (g i)

theorem Polynomial.map_comp E0 #

∀ {R : Type u} {S : Type v} [inst : Semiring R] [inst_1 : Semiring S] (f : R →+* S) (p q : Polynomial R),
  Polynomial.map f (p.comp q) = (Polynomial.map f p).comp (Polynomial.map f q)

theorem Polynomial.eval_X_pow E1 #

∀ {R : Type u} [inst : Semiring R] {x : R} (n : ℕ), Polynomial.eval x (Polynomial.X ^ n) = x ^ n

theorem Polynomial.eval_mul E0 #

∀ {R : Type u} [inst : CommSemiring R] {p q : Polynomial R} {x : R},
  Polynomial.eval x (p * q) = Polynomial.eval x p * Polynomial.eval x q

def Polynomial.evalRingHom E3 #

{R : Type u} → [inst : CommSemiring R] → R → Polynomial R →+* R

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

theorem Polynomial.coe_evalRingHom E0 #

∀ {R : Type u} [inst : CommSemiring R] (r : R), ⇑(Polynomial.evalRingHom r) = Polynomial.eval r

theorem Polynomial.eval_pow E0 #

∀ {R : Type u} [inst : CommSemiring R] {p : Polynomial R} {x : R} (n : ℕ),
  Polynomial.eval x (p ^ n) = Polynomial.eval x p ^ n

theorem Polynomial.eval_comp E0 #

∀ {R : Type u} [inst : CommSemiring R] {p q : Polynomial R} {x : R},
  Polynomial.eval x (p.comp q) = Polynomial.eval (Polynomial.eval x q) p

theorem Polynomial.isRoot_comp E1 #

∀ {R : Type u_1} [inst : CommSemiring R] {p q : Polynomial R} {r : R},
  (p.comp q).IsRoot r ↔ p.IsRoot (Polynomial.eval r q)

def Polynomial.compRingHom E3 #

{R : Type u} → [inst : CommSemiring R] → Polynomial R → Polynomial R →+* Polynomial R

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

theorem Polynomial.coe_compRingHom E0 #

∀ {R : Type u} [inst : CommSemiring R] (q : Polynomial R), ⇑q.compRingHom = fun p ↦ p.comp q

theorem Polynomial.coe_compRingHom_apply E0 #

∀ {R : Type u} [inst : CommSemiring R] (p q : Polynomial R), q.compRingHom p = p.comp q

theorem Polynomial.root_mul_left_of_isRoot E1 #

∀ {R : Type u} {a : R} [inst : CommSemiring R] (p : Polynomial R) {q : Polynomial R}, q.IsRoot a → (p * q).IsRoot a

theorem Polynomial.root_mul_right_of_isRoot E1 #

∀ {R : Type u} {a : R} [inst : CommSemiring R] {p : Polynomial R} (q : Polynomial R), p.IsRoot a → (p * q).IsRoot a

theorem Polynomial.eval₂_multiset_prod E1 #

∀ {R : Type u} {S : Type v} [inst : CommSemiring R] [inst_1 : CommSemiring S] (f : R →+* S)
  (s : Multiset (Polynomial R)) (x : S), Polynomial.eval₂ f x s.prod = (Multiset.map (Polynomial.eval₂ f x) s).prod

theorem Polynomial.eval₂_finsetProd E1 #

∀ {R : Type u} {S : Type v} {ι : Type y} [inst : CommSemiring R] [inst_1 : CommSemiring S] (f : R →+* S) (s : Finset ι)
  (g : ι → Polynomial R) (x : S), Polynomial.eval₂ f x (∏ i ∈ s, g i) = ∏ i ∈ s, Polynomial.eval₂ f x (g i)

theorem Polynomial.eval_list_prod E1 #

∀ {R : Type u} [inst : CommSemiring R] (l : List (Polynomial R)) (x : R),
  Polynomial.eval x l.prod = (List.map (Polynomial.eval x) l).prod

Polynomial evaluation commutes with List.prod

theorem Polynomial.eval_multiset_prod E1 #

∀ {R : Type u} [inst : CommSemiring R] (s : Multiset (Polynomial R)) (x : R),
  Polynomial.eval x s.prod = (Multiset.map (Polynomial.eval x) s).prod

Polynomial evaluation commutes with Multiset.prod

theorem Polynomial.eval_prod E1 #

∀ {R : Type u} [inst : CommSemiring R] {ι : Type u_1} (s : Finset ι) (p : ι → Polynomial R) (x : R),
  Polynomial.eval x (∏ j ∈ s, p j) = ∏ j ∈ s, Polynomial.eval x (p j)

Polynomial evaluation commutes with Finset.prod

theorem Polynomial.list_prod_comp E1 #

∀ {R : Type u} [inst : CommSemiring R] (l : List (Polynomial R)) (q : Polynomial R),
  l.prod.comp q = (List.map (fun p ↦ p.comp q) l).prod

theorem Polynomial.multiset_prod_comp E1 #

∀ {R : Type u} [inst : CommSemiring R] (s : Multiset (Polynomial R)) (q : Polynomial R),
  s.prod.comp q = (Multiset.map (fun p ↦ p.comp q) s).prod

theorem Polynomial.prod_comp E1 #

∀ {R : Type u} [inst : CommSemiring R] {ι : Type u_1} (s : Finset ι) (p : ι → Polynomial R) (q : Polynomial R),
  (∏ j ∈ s, p j).comp q = ∏ j ∈ s, (p j).comp q

theorem Polynomial.isRoot_prod E1 #

∀ {R : Type u_2} [inst : CommSemiring R] [IsDomain R] {ι : Type u_1} (s : Finset ι) (p : ι → Polynomial R) (x : R),
  (∏ j ∈ s, p j).IsRoot x ↔ ∃ i ∈ s, (p i).IsRoot x

theorem Polynomial.eval_dvd E1 #

∀ {R : Type u} [inst : CommSemiring R] {p q : Polynomial R} {x : R}, p ∣ q → Polynomial.eval x p ∣ Polynomial.eval x q

theorem Polynomial.eval_eq_zero_of_dvd_of_eval_eq_zero E1 #

∀ {R : Type u} [inst : CommSemiring R] {p q : Polynomial R} {x : R},
  p ∣ q → Polynomial.eval x p = 0 → Polynomial.eval x q = 0

theorem Polynomial.eval_geom_sum E0 #

∀ {R : Type u_1} [inst : CommSemiring R] {n : ℕ} {x : R},
  Polynomial.eval x (∑ i ∈ Finset.range n, Polynomial.X ^ i) = ∑ i ∈ Finset.range n, x ^ i

theorem Polynomial.root_mul E1 #

∀ {R : Type u} {a : R} [inst : CommSemiring R] {p q : Polynomial R} [NoZeroDivisors R],
  (p * q).IsRoot a ↔ p.IsRoot a ∨ q.IsRoot a

theorem Polynomial.root_or_root_of_root_mul E1 #

∀ {R : Type u} {a : R} [inst : CommSemiring R] {p q : Polynomial R} [NoZeroDivisors R],
  (p * q).IsRoot a → p.IsRoot a ∨ q.IsRoot a

theorem Polynomial.map_multiset_prod E0 #

∀ {R : Type u} {S : Type v} [inst : CommSemiring R] [inst_1 : CommSemiring S] (f : R →+* S)
  (m : Multiset (Polynomial R)), Polynomial.map f m.prod = (Multiset.map (Polynomial.map f) m).prod

theorem Polynomial.map_prod E0 #

∀ {R : Type u} {S : Type v} [inst : CommSemiring R] [inst_1 : CommSemiring S] (f : R →+* S) {ι : Type u_1}
  (g : ι → Polynomial R) (s : Finset ι), Polynomial.map f (∏ i ∈ s, g i) = ∏ i ∈ s, Polynomial.map f (g i)

theorem Polynomial.map_sub E0 #

∀ {R : Type u} [inst : Ring R] {p q : Polynomial R} {S : Type u_1} [inst_1 : Ring S] (f : R →+* S),
  Polynomial.map f (p - q) = Polynomial.map f p - Polynomial.map f q

theorem Polynomial.map_neg E0 #

∀ {R : Type u} [inst : Ring R] {p : Polynomial R} {S : Type u_1} [inst_1 : Ring S] (f : R →+* S),
  Polynomial.map f (-p) = -Polynomial.map f p

theorem Polynomial.map_intCast E0 #

∀ {R : Type u} [inst : Ring R] {S : Type u_1} [inst_1 : Ring S] (f : R →+* S) (n : ℤ), Polynomial.map f ↑n = ↑n

theorem Polynomial.eval_intCast E0 #

∀ {R : Type u} [inst : Ring R] {n : ℤ} {x : R}, Polynomial.eval x ↑n = ↑n

theorem Polynomial.eval₂_neg E0 #

∀ {R : Type u} [inst : Ring R] {p : Polynomial R} {S : Type u_1} [inst_1 : Ring S] (f : R →+* S) {x : S},
  Polynomial.eval₂ f x (-p) = -Polynomial.eval₂ f x p

theorem Polynomial.eval₂_sub E0 #

∀ {R : Type u} [inst : Ring R] {p q : Polynomial R} {S : Type u_1} [inst_1 : Ring S] (f : R →+* S) {x : S},
  Polynomial.eval₂ f x (p - q) = Polynomial.eval₂ f x p - Polynomial.eval₂ f x q

theorem Polynomial.eval_neg E0 #

∀ {R : Type u} [inst : Ring R] (p : Polynomial R) (x : R), Polynomial.eval x (-p) = -Polynomial.eval x p

theorem Polynomial.eval_sub E0 #

∀ {R : Type u} [inst : Ring R] (p q : Polynomial R) (x : R),
  Polynomial.eval x (p - q) = Polynomial.eval x p - Polynomial.eval x q

theorem Polynomial.root_X_sub_C E1 #

∀ {R : Type u} {a b : R} [inst : Ring R], (Polynomial.X - Polynomial.C a).IsRoot b ↔ a = b

theorem Polynomial.neg_comp E0 #

∀ {R : Type u} [inst : Ring R] {p q : Polynomial R}, (-p).comp q = -p.comp q

theorem Polynomial.sub_comp E0 #

∀ {R : Type u} [inst : Ring R] {p q r : Polynomial R}, (p - q).comp r = p.comp r - q.comp r

theorem Polynomial.intCast_comp E0 #

∀ {R : Type u} [inst : Ring R] {p : Polynomial R} (i : ℤ), (↑i).comp p = ↑i

theorem Polynomial.eval₂_at_intCast E0 #

∀ {R : Type u} [inst : Ring R] {p : Polynomial R} {S : Type u_1} [inst_1 : Ring S] (f : R →+* S) (n : ℤ),
  Polynomial.eval₂ f (↑n) p = f (Polynomial.eval (↑n) p)

theorem Polynomial.mul_X_sub_intCast_comp E1 #

∀ {R : Type u} [inst : Ring R] {p q : Polynomial R} {n : ℕ}, (p * (Polynomial.X - ↑n)).comp q = p.comp q * (q - ↑n)

Deprecated aliases

NameNew nameSince
Polynomial.eval₂_defPolynomial.eval₂_eq_sum2026-10-20
Polynomial.eval₂_ofFinsuppPolynomial.eval₂_eq_liftNC2026-10-25