Evaluating a polynomial #
Main definitions #
- Polynomial.eval₂: evaluate- p : R[X]in- Sgiven a ring hom- f : R →+* Sand- x : S.
- Polynomial.eval: evaluate- p : R[X]given- x : R.
- Polynomial.IsRoot:- x : Ris a root of- p : R[X].
- Polynomial.comp: compose two polynomials- p q : R[X]by evaluating- pat- q.
- Polynomial.map: apply- f : R →+* Sto 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.
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
Instances For
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
- Polynomial.eval₂AddMonoidHom f x = { toFun := Polynomial.eval₂ f x, map_zero' := ⋯, map_add' := ⋯ }
Instances For
eval₂ as a RingHom for noncommutative rings
Equations
- Polynomial.eval₂RingHom' f x hf = { toFun := Polynomial.eval₂ f x, 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).
Equations
- Polynomial.eval₂RingHom f x = { toFun := (↑(Polynomial.eval₂AddMonoidHom f x)).toFun, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ }
Instances For
eval x p is the evaluation of the polynomial p at x
Equations
- Polynomial.eval x p = Polynomial.eval₂ (RingHom.id R) x p
Instances For
Polynomial evaluation commutes with Multiset.sum.
IsRoot p x implies x is a root of p. The evaluation of p at x is zero
Equations
- p.IsRoot a = (Polynomial.eval a p = 0)
Instances For
Equations
The composition of polynomials as a polynomial.
Equations
- p.comp q = Polynomial.eval₂ Polynomial.C q p
Instances For
map f p maps a polynomial p across a ring hom f
Equations
Instances For
Polynomial.map as a RingHom.
Equations
- Polynomial.mapRingHom f = { toFun := Polynomial.map f, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ }
Instances For
comp p, regarded as a ring homomorphism from R[X] to itself.
Instances For
Polynomial evaluation commutes with List.prod
Polynomial evaluation commutes with Multiset.prod
Polynomial evaluation commutes with Finset.prod