Documentation

Mathlib.Data.Polynomial.Smeval

Scalar-multiple polynomial evaluation #

This file defines polynomial evaluation via scalar multiplication. Our polynomials have coefficients in a semiring R, and we evaluate at a weak form of R-algebra, namely an additive commutative monoid with an action of R and a notion of natural number power. This is a generalization of Data.Polynomial.Eval.

Main definitions #

Main results #

To do #

def Polynomial.smul_pow {R : Type u_1} [Semiring R] {S : Type u_2} [AddCommMonoid S] [Pow S ] [MulActionWithZero R S] (x : S) :
RS

Scalar multiplication together with taking a natural number power.

Equations
Instances For
    @[irreducible]
    def Polynomial.smeval {R : Type u_3} [Semiring R] (p : Polynomial R) {S : Type u_4} [AddCommMonoid S] [Pow S ] [MulActionWithZero R S] (x : S) :
    S

    Evaluate a polynomial p in the scalar semiring R at an element x in the target S using scalar multiple R-action.

    Equations
    Instances For
      @[simp]
      theorem Polynomial.smeval_C {R : Type u_1} [Semiring R] (r : R) {S : Type u_2} [AddCommMonoid S] [Pow S ] [MulActionWithZero R S] (x : S) :
      Polynomial.smeval (Polynomial.C r) x = r x ^ 0
      @[simp]
      theorem Polynomial.smeval_monomial {R : Type u_1} [Semiring R] (r : R) {S : Type u_2} [AddCommMonoid S] [Pow S ] [MulActionWithZero R S] (x : S) (n : ) :
      theorem Polynomial.eval₂_eq_smeval (R : Type u_3) [Semiring R] {S : Type u_4} [Semiring S] (f : R →+* S) (p : Polynomial R) (x : S) :
      @[simp]
      theorem Polynomial.smeval_zero (R : Type u_1) [Semiring R] {S : Type u_2} [AddCommMonoid S] [Pow S ] [MulActionWithZero R S] (x : S) :
      @[simp]
      theorem Polynomial.smeval_one (R : Type u_1) [Semiring R] {S : Type u_2} [AddCommMonoid S] [Pow S ] [MulActionWithZero R S] (x : S) :
      @[simp]
      theorem Polynomial.smeval_X (R : Type u_1) [Semiring R] {S : Type u_2} [AddCommMonoid S] [Pow S ] [MulActionWithZero R S] (x : S) :
      Polynomial.smeval Polynomial.X x = x ^ 1
      @[simp]
      theorem Polynomial.smeval_X_pow (R : Type u_1) [Semiring R] {S : Type u_2} [AddCommMonoid S] [Pow S ] [MulActionWithZero R S] (x : S) {n : } :
      Polynomial.smeval (Polynomial.X ^ n) x = x ^ n
      @[simp]
      theorem Polynomial.smeval_add (R : Type u_1) [Semiring R] (p : Polynomial R) (q : Polynomial R) {S : Type u_2} [AddCommMonoid S] [Pow S ] [Module R S] (x : S) :
      theorem Polynomial.smeval_nat_cast (R : Type u_1) [Semiring R] {S : Type u_2} [AddCommMonoid S] [Pow S ] [Module R S] (x : S) (n : ) :
      Polynomial.smeval (n) x = n x ^ 0
      @[simp]
      theorem Polynomial.smeval_smul (R : Type u_1) [Semiring R] (p : Polynomial R) {S : Type u_2} [AddCommMonoid S] [Pow S ] [Module R S] (x : S) (r : R) :
      def Polynomial.smeval.linearMap (R : Type u_1) [Semiring R] {S : Type u_2} [AddCommMonoid S] [Pow S ] [Module R S] (x : S) :

      Polynomial.smeval as a linear map.

      Equations
      Instances For
        @[simp]
        theorem Polynomial.smeval.linearMap_apply (R : Type u_1) [Semiring R] (p : Polynomial R) {S : Type u_2} [AddCommMonoid S] [Pow S ] [Module R S] (x : S) :
        theorem Polynomial.leval_coe_eq_smeval {R : Type u_3} [Semiring R] (r : R) :

        In the module docstring for algebras at Mathlib.Algebra.Algebra.Basic, we see that [CommSemiring R] [Semiring S] [Module R S] [IsScalarTower R S S] [SMulCommClass R S S] is an equivalent way to express [CommSemiring R] [Semiring S] [Algebra R S] that allows one to relax the defining structures independently. For non-associative power-associative algebras (e.g., octonions), we replace the [Semiring S] with [NonAssocSemiring S] [Pow S ℕ] [NatPowAssoc S].

        theorem Polynomial.smeval_mul_X (R : Type u_1) [CommSemiring R] (p : Polynomial R) {S : Type u_2} [NonAssocSemiring S] [Module R S] [IsScalarTower R S S] [Pow S ] [NatPowAssoc S] (x : S) :
        Polynomial.smeval (p * Polynomial.X) x = Polynomial.smeval p x * x
        theorem Polynomial.smeval_X_mul (R : Type u_1) [CommSemiring R] (p : Polynomial R) {S : Type u_2} [NonAssocSemiring S] [Module R S] [SMulCommClass R S S] [Pow S ] [NatPowAssoc S] (x : S) :
        Polynomial.smeval (Polynomial.X * p) x = x * Polynomial.smeval p x
        theorem Polynomial.smeval_assoc_X_pow (R : Type u_1) [CommSemiring R] (p : Polynomial R) {S : Type u_2} [NonAssocSemiring S] [Module R S] [IsScalarTower R S S] [Pow S ] [NatPowAssoc S] (x : S) (m : ) (n : ) :
        Polynomial.smeval p x * x ^ m * x ^ n = Polynomial.smeval p x * (x ^ m * x ^ n)
        theorem Polynomial.smeval_mul_X_pow (R : Type u_1) [CommSemiring R] (p : Polynomial R) {S : Type u_2} [NonAssocSemiring S] [Module R S] [IsScalarTower R S S] [Pow S ] [NatPowAssoc S] (x : S) (n : ) :
        Polynomial.smeval (p * Polynomial.X ^ n) x = Polynomial.smeval p x * x ^ n
        theorem Polynomial.smeval_X_pow_assoc (R : Type u_1) [CommSemiring R] (p : Polynomial R) {S : Type u_2} [NonAssocSemiring S] [Module R S] [SMulCommClass R S S] [Pow S ] [NatPowAssoc S] (x : S) (m : ) (n : ) :
        x ^ m * x ^ n * Polynomial.smeval p x = x ^ m * (x ^ n * Polynomial.smeval p x)
        theorem Polynomial.smeval_X_pow_mul (R : Type u_1) [CommSemiring R] (p : Polynomial R) {S : Type u_2} [NonAssocSemiring S] [Module R S] [SMulCommClass R S S] [Pow S ] [NatPowAssoc S] (x : S) (n : ) :
        Polynomial.smeval (Polynomial.X ^ n * p) x = x ^ n * Polynomial.smeval p x
        theorem Polynomial.smeval_C_mul (R : Type u_1) [CommSemiring R] (r : R) (p : Polynomial R) {S : Type u_2} [NonAssocSemiring S] [Module R S] [Pow S ] (x : S) :
        Polynomial.smeval (Polynomial.C r * p) x = r Polynomial.smeval p x
        theorem Polynomial.smeval_monomial_mul (R : Type u_1) [CommSemiring R] (r : R) (p : Polynomial R) {S : Type u_2} [NonAssocSemiring S] [Module R S] [SMulCommClass R S S] [Pow S ] [NatPowAssoc S] (x : S) (n : ) :
        theorem Polynomial.smeval_mul (R : Type u_1) [CommSemiring R] (p : Polynomial R) (q : Polynomial R) {S : Type u_2} [NonAssocSemiring S] [Module R S] [IsScalarTower R S S] [SMulCommClass R S S] [Pow S ] [NatPowAssoc S] (x : S) :
        theorem Polynomial.smeval_pow (R : Type u_1) [CommSemiring R] (p : Polynomial R) {S : Type u_2} [NonAssocSemiring S] [Module R S] [IsScalarTower R S S] [SMulCommClass R S S] [Pow S ] [NatPowAssoc S] (x : S) (n : ) :
        theorem Polynomial.aeval_eq_smeval {R : Type u_1} [CommSemiring R] {S : Type u_2} [Semiring S] [Algebra R S] (x : S) (p : Polynomial R) :
        theorem Polynomial.aeval_coe_eq_smeval {R : Type u_1} [CommSemiring R] {S : Type u_2} [Semiring S] [Algebra R S] (x : S) :