Module docstring
{"# Evaluating polynomials and scalar multiplication
Main results
eval₂_smul,eval_smul,map_smul,comp_smul: the functions preserve scalar multiplicationPolynomial.leval:Polynomial.evalas linear map
"}
{"# Evaluating polynomials and scalar multiplication
eval₂_smul, eval_smul, map_smul, comp_smul: the functions preserve scalar multiplicationPolynomial.leval: Polynomial.eval as linear map"}
Polynomial.eval₂_smul
theorem
(g : R →+* S) (p : R[X]) (x : S) {s : R} : eval₂ g x (s • p) = g s * eval₂ g x p
@[simp]
theorem eval₂_smul (g : R →+* S) (p : R[X]) (x : S) {s : R} :
eval₂ g x (s • p) = g s * eval₂ g x p := by
have A : p.natDegree < p.natDegree.succ := Nat.lt_succ_self _
have B : (s • p).natDegree < p.natDegree.succ := (natDegree_smul_le _ _).trans_lt A
rw [eval₂_eq_sum, eval₂_eq_sum, sum_over_range' _ _ _ A, sum_over_range' _ _ _ B] <;>
simp [mul_sum, mul_assoc]
Polynomial.eval_smul
theorem
[SMulZeroClass S R] [IsScalarTower S R R] (s : S) (p : R[X]) (x : R) : (s • p).eval x = s • p.eval x
@[simp]
theorem eval_smul [SMulZeroClass S R] [IsScalarTower S R R] (s : S) (p : R[X])
(x : R) : (s • p).eval x = s • p.eval x := by
rw [← smul_one_smul R s p, eval, eval₂_smul, RingHom.id_apply, smul_one_mul]
Polynomial.leval
definition
{R : Type*} [Semiring R] (r : R) : R[X] →ₗ[R] R
Polynomial.smul_comp
theorem
[SMulZeroClass S R] [IsScalarTower S R R] (s : S) (p q : R[X]) : (s • p).comp q = s • p.comp q
@[simp]
theorem smul_comp [SMulZeroClass S R] [IsScalarTower S R R] (s : S) (p q : R[X]) :
(s • p).comp q = s • p.comp q := by
rw [← smul_one_smul R s p, comp, comp, eval₂_smul, ← smul_eq_C_mul, smul_assoc, one_smul]
Polynomial.map_smul
theorem
(r : R) : (r • p).map f = f r • p.map f
@[simp]
protected theorem map_smul (r : R) : (r • p).map f = f r • p.map f := by
rw [map, eval₂_smul, RingHom.comp_apply, C_mul']