Documentation

Mathlib.Algebra.MvPolynomial.Basic

Multivariate polynomials #

This file defines polynomial rings over a base ring (or even semiring), with variables from a general type σ (which could be infinite).

Important definitions #

Let R be a commutative ring (or a semiring) and let σ be an arbitrary type. This file creates the type MvPolynomial σ R, which mathematicians might denote $R[X_i : i \in σ]$. It is the type of multivariate (a.k.a. multivariable) polynomials, with variables corresponding to the terms in σ, and coefficients in R.

Notation #

In the definitions below, we use the following notation:

Definitions #

Implementation notes #

Recall that if Y has a zero, then X →₀ Y is the type of functions from X to Y with finite support, i.e. such that only finitely many elements of X get sent to non-zero terms in Y. The definition of MvPolynomial σ R is (σ →₀ ℕ) →₀ R; here σ →₀ ℕ denotes the space of all monomials in the variables, and the function to R sends a monomial to its coefficient in the polynomial being represented.

Tags #

polynomial, multivariate polynomial, multivariable polynomial

def MvPolynomial (σ : Type u_1) (R : Type u_2) [CommSemiring R] :
Type (max u_1 u_2)

Multivariate polynomial, where σ is the index set of the variables and R is the coefficient ring

Equations
Instances For
    instance MvPolynomial.inhabited {R : Type u} {σ : Type u_1} [CommSemiring R] :
    Equations
    instance MvPolynomial.faithfulSMul {R : Type u} {S₁ : Type v} {σ : Type u_1} [CommSemiring S₁] [SMulZeroClass R S₁] [FaithfulSMul R S₁] :
    instance MvPolynomial.module {R : Type u} {S₁ : Type v} {σ : Type u_1} [Semiring R] [CommSemiring S₁] [Module R S₁] :
    Module R (MvPolynomial σ S₁)
    Equations
    instance MvPolynomial.isScalarTower {R : Type u} {S₁ : Type v} {S₂ : Type w} {σ : Type u_1} [CommSemiring S₂] [SMul R S₁] [SMulZeroClass R S₂] [SMulZeroClass S₁ S₂] [IsScalarTower R S₁ S₂] :
    IsScalarTower R S₁ (MvPolynomial σ S₂)
    instance MvPolynomial.smulCommClass {R : Type u} {S₁ : Type v} {S₂ : Type w} {σ : Type u_1} [CommSemiring S₂] [SMulZeroClass R S₂] [SMulZeroClass S₁ S₂] [SMulCommClass R S₁ S₂] :
    SMulCommClass R S₁ (MvPolynomial σ S₂)
    instance MvPolynomial.isCentralScalar {R : Type u} {S₁ : Type v} {σ : Type u_1} [CommSemiring S₁] [SMulZeroClass R S₁] [SMulZeroClass Rᵐᵒᵖ S₁] [IsCentralScalar R S₁] :
    instance MvPolynomial.algebra {R : Type u} {S₁ : Type v} {σ : Type u_1} [CommSemiring R] [CommSemiring S₁] [Algebra R S₁] :
    Algebra R (MvPolynomial σ S₁)
    Equations
    instance MvPolynomial.isScalarTower_right {R : Type u} {S₁ : Type v} {σ : Type u_1} [CommSemiring S₁] [DistribSMul R S₁] [IsScalarTower R S₁ S₁] :
    instance MvPolynomial.smulCommClass_right {R : Type u} {S₁ : Type v} {σ : Type u_1} [CommSemiring S₁] [DistribSMul R S₁] [SMulCommClass R S₁ S₁] :
    instance MvPolynomial.unique {R : Type u} {σ : Type u_1} [CommSemiring R] [Subsingleton R] :

    If R is a subsingleton, then MvPolynomial σ R has a unique element

    Equations
    def MvPolynomial.monomial {R : Type u} {σ : Type u_1} [CommSemiring R] (s : σ →₀ ) :

    monomial s a is the monomial with coefficient a and exponents given by s

    Equations
    Instances For
      theorem MvPolynomial.one_def {R : Type u} {σ : Type u_1} [CommSemiring R] :
      1 = (monomial 0) 1
      theorem MvPolynomial.single_eq_monomial {R : Type u} {σ : Type u_1} [CommSemiring R] (s : σ →₀ ) (a : R) :
      theorem MvPolynomial.mul_def {R : Type u} {σ : Type u_1} [CommSemiring R] {p q : MvPolynomial σ R} :
      p * q = Finsupp.sum p fun (m : σ →₀ ) (a : R) => Finsupp.sum q fun (n : σ →₀ ) (b : R) => (monomial (m + n)) (a * b)
      def MvPolynomial.C {R : Type u} {σ : Type u_1} [CommSemiring R] :

      C a is the constant polynomial with value a

      Equations
      Instances For
        @[simp]
        theorem MvPolynomial.algebraMap_eq (R : Type u) (σ : Type u_1) [CommSemiring R] :
        def MvPolynomial.X {R : Type u} {σ : Type u_1} [CommSemiring R] (n : σ) :

        X n is the degree 1 monomial $X_n$.

        Equations
        Instances For
          theorem MvPolynomial.monomial_left_injective {R : Type u} {σ : Type u_1} [CommSemiring R] {r : R} (hr : r 0) :
          Function.Injective fun (s : σ →₀ ) => (monomial s) r
          @[simp]
          theorem MvPolynomial.monomial_left_inj {R : Type u} {σ : Type u_1} [CommSemiring R] {s t : σ →₀ } {r : R} (hr : r 0) :
          (monomial s) r = (monomial t) r s = t
          theorem MvPolynomial.C_apply {R : Type u} {σ : Type u_1} {a : R} [CommSemiring R] :
          C a = (monomial 0) a
          @[simp]
          theorem MvPolynomial.C_0 {R : Type u} {σ : Type u_1} [CommSemiring R] :
          C 0 = 0
          @[simp]
          theorem MvPolynomial.C_1 {R : Type u} {σ : Type u_1} [CommSemiring R] :
          C 1 = 1
          theorem MvPolynomial.C_mul_monomial {R : Type u} {σ : Type u_1} {a a' : R} {s : σ →₀ } [CommSemiring R] :
          C a * (monomial s) a' = (monomial s) (a * a')
          @[simp]
          theorem MvPolynomial.C_add {R : Type u} {σ : Type u_1} {a a' : R} [CommSemiring R] :
          C (a + a') = C a + C a'
          @[simp]
          theorem MvPolynomial.C_mul {R : Type u} {σ : Type u_1} {a a' : R} [CommSemiring R] :
          C (a * a') = C a * C a'
          @[simp]
          theorem MvPolynomial.C_pow {R : Type u} {σ : Type u_1} [CommSemiring R] (a : R) (n : ) :
          C (a ^ n) = C a ^ n
          @[simp]
          theorem MvPolynomial.C_inj {σ : Type u_2} (R : Type u_3) [CommSemiring R] (r s : R) :
          C r = C s r = s
          @[simp]
          theorem MvPolynomial.C_eq_zero {R : Type u} {σ : Type u_1} {a : R} [CommSemiring R] :
          C a = 0 a = 0
          theorem MvPolynomial.C_ne_zero {R : Type u} {σ : Type u_1} {a : R} [CommSemiring R] :
          C a 0 a 0
          theorem MvPolynomial.C_eq_coe_nat {R : Type u} {σ : Type u_1} [CommSemiring R] (n : ) :
          C n = n
          theorem MvPolynomial.C_mul' {R : Type u} {σ : Type u_1} {a : R} [CommSemiring R] {p : MvPolynomial σ R} :
          C a * p = a p
          theorem MvPolynomial.smul_eq_C_mul {R : Type u} {σ : Type u_1} [CommSemiring R] (p : MvPolynomial σ R) (a : R) :
          a p = C a * p
          theorem MvPolynomial.C_eq_smul_one {R : Type u} {σ : Type u_1} {a : R} [CommSemiring R] :
          C a = a 1
          theorem MvPolynomial.smul_monomial {R : Type u} {σ : Type u_1} {a : R} {s : σ →₀ } [CommSemiring R] {S₁ : Type u_2} [SMulZeroClass S₁ R] (r : S₁) :
          r (monomial s) a = (monomial s) (r a)
          @[simp]
          theorem MvPolynomial.X_inj {R : Type u} {σ : Type u_1} [CommSemiring R] [Nontrivial R] (m n : σ) :
          X m = X n m = n
          theorem MvPolynomial.monomial_pow {R : Type u} {σ : Type u_1} {a : R} {e : } {s : σ →₀ } [CommSemiring R] :
          (monomial s) a ^ e = (monomial (e s)) (a ^ e)
          @[simp]
          theorem MvPolynomial.monomial_mul {R : Type u} {σ : Type u_1} [CommSemiring R] {s s' : σ →₀ } {a b : R} :
          (monomial s) a * (monomial s') b = (monomial (s + s')) (a * b)

          fun s ↦ monomial s 1 as a homomorphism.

          Equations
          Instances For
            @[simp]
            theorem MvPolynomial.monomialOneHom_apply {R : Type u} {σ : Type u_1} {s : σ →₀ } [CommSemiring R] :
            (monomialOneHom R σ) s = (monomial s) 1
            theorem MvPolynomial.X_pow_eq_monomial {R : Type u} {σ : Type u_1} {e : } {n : σ} [CommSemiring R] :
            X n ^ e = (monomial (Finsupp.single n e)) 1
            theorem MvPolynomial.monomial_add_single {R : Type u} {σ : Type u_1} {a : R} {e : } {n : σ} {s : σ →₀ } [CommSemiring R] :
            (monomial (s + Finsupp.single n e)) a = (monomial s) a * X n ^ e
            theorem MvPolynomial.monomial_single_add {R : Type u} {σ : Type u_1} {a : R} {e : } {n : σ} {s : σ →₀ } [CommSemiring R] :
            (monomial (Finsupp.single n e + s)) a = X n ^ e * (monomial s) a
            theorem MvPolynomial.C_mul_X_pow_eq_monomial {R : Type u} {σ : Type u_1} [CommSemiring R] {s : σ} {a : R} {n : } :
            C a * X s ^ n = (monomial (Finsupp.single s n)) a
            theorem MvPolynomial.C_mul_X_eq_monomial {R : Type u} {σ : Type u_1} [CommSemiring R] {s : σ} {a : R} :
            C a * X s = (monomial (Finsupp.single s 1)) a
            @[simp]
            theorem MvPolynomial.monomial_zero {R : Type u} {σ : Type u_1} [CommSemiring R] {s : σ →₀ } :
            (monomial s) 0 = 0
            @[simp]
            theorem MvPolynomial.monomial_zero' {R : Type u} {σ : Type u_1} [CommSemiring R] :
            (monomial 0) = C
            @[simp]
            theorem MvPolynomial.monomial_eq_zero {R : Type u} {σ : Type u_1} [CommSemiring R] {s : σ →₀ } {b : R} :
            (monomial s) b = 0 b = 0
            @[simp]
            theorem MvPolynomial.sum_monomial_eq {R : Type u} {σ : Type u_1} [CommSemiring R] {A : Type u_2} [AddCommMonoid A] {u : σ →₀ } {r : R} {b : (σ →₀ ) → RA} (w : b u 0 = 0) :
            Finsupp.sum ((monomial u) r) b = b u r
            @[simp]
            theorem MvPolynomial.sum_C {R : Type u} {σ : Type u_1} {a : R} [CommSemiring R] {A : Type u_2} [AddCommMonoid A] {b : (σ →₀ ) → RA} (w : b 0 0 = 0) :
            Finsupp.sum (C a) b = b 0 a
            theorem MvPolynomial.monomial_sum_one {R : Type u} {σ : Type u_1} [CommSemiring R] {α : Type u_2} (s : Finset α) (f : ασ →₀ ) :
            (monomial (∑ is, f i)) 1 = is, (monomial (f i)) 1
            theorem MvPolynomial.monomial_sum_index {R : Type u} {σ : Type u_1} [CommSemiring R] {α : Type u_2} (s : Finset α) (f : ασ →₀ ) (a : R) :
            (monomial (∑ is, f i)) a = C a * is, (monomial (f i)) 1
            theorem MvPolynomial.monomial_finsupp_sum_index {R : Type u} {σ : Type u_1} [CommSemiring R] {α : Type u_2} {β : Type u_3} [Zero β] (f : α →₀ β) (g : αβσ →₀ ) (a : R) :
            (monomial (f.sum g)) a = C a * f.prod fun (a : α) (b : β) => (monomial (g a b)) 1
            theorem MvPolynomial.monomial_eq_monomial_iff {R : Type u} [CommSemiring R] {α : Type u_2} (a₁ a₂ : α →₀ ) (b₁ b₂ : R) :
            (monomial a₁) b₁ = (monomial a₂) b₂ a₁ = a₂ b₁ = b₂ b₁ = 0 b₂ = 0
            theorem MvPolynomial.monomial_eq {R : Type u} {σ : Type u_1} {a : R} {s : σ →₀ } [CommSemiring R] :
            (monomial s) a = C a * s.prod fun (n : σ) (e : ) => X n ^ e
            @[simp]
            theorem MvPolynomial.prod_X_pow_eq_monomial {R : Type u} {σ : Type u_1} {s : σ →₀ } [CommSemiring R] :
            xs.support, X x ^ s x = (monomial s) 1
            theorem MvPolynomial.induction_on_monomial {R : Type u} {σ : Type u_1} [CommSemiring R] {motive : MvPolynomial σ RProp} (C : ∀ (a : R), motive (C a)) (mul_X : ∀ (p : MvPolynomial σ R) (n : σ), motive pmotive (p * X n)) (s : σ →₀ ) (a : R) :
            motive ((monomial s) a)
            theorem MvPolynomial.induction_on' {R : Type u} {σ : Type u_1} [CommSemiring R] {P : MvPolynomial σ RProp} (p : MvPolynomial σ R) (monomial : ∀ (u : σ →₀ ) (a : R), P ((monomial u) a)) (add : ∀ (p q : MvPolynomial σ R), P pP qP (p + q)) :
            P p

            Analog of Polynomial.induction_on'. To prove something about mv_polynomials, it suffices to show the condition is closed under taking sums, and it holds for monomials.

            theorem MvPolynomial.monomial_add_induction_on {R : Type u} {σ : Type u_1} [CommSemiring R] {motive : MvPolynomial σ RProp} (p : MvPolynomial σ R) (C : ∀ (a : R), motive (C a)) (monomial_add : ∀ (a : σ →₀ ) (b : R) (f : MvPolynomial σ R), af.supportb 0motive fmotive ((monomial a) b + f)) :
            motive p

            Similar to MvPolynomial.induction_on but only a weak form of h_add is required. In particular, this version only requires us to show that motive is closed under addition of nontrivial monomials not present in the support.

            @[deprecated MvPolynomial.monomial_add_induction_on (since := "2025-03-11")]
            theorem MvPolynomial.induction_on''' {R : Type u} {σ : Type u_1} [CommSemiring R] {motive : MvPolynomial σ RProp} (p : MvPolynomial σ R) (C : ∀ (a : R), motive (C a)) (monomial_add : ∀ (a : σ →₀ ) (b : R) (f : MvPolynomial σ R), af.supportb 0motive fmotive ((monomial a) b + f)) :
            motive p

            Alias of MvPolynomial.monomial_add_induction_on.


            Similar to MvPolynomial.induction_on but only a weak form of h_add is required. In particular, this version only requires us to show that motive is closed under addition of nontrivial monomials not present in the support.

            theorem MvPolynomial.induction_on'' {R : Type u} {σ : Type u_1} [CommSemiring R] {motive : MvPolynomial σ RProp} (p : MvPolynomial σ R) (C : ∀ (a : R), motive (C a)) (monomial_add : ∀ (a : σ →₀ ) (b : R) (f : MvPolynomial σ R), af.supportb 0motive fmotive ((monomial a) b)motive ((monomial a) b + f)) (mul_X : ∀ (p : MvPolynomial σ R) (n : σ), motive pmotive (p * X n)) :
            motive p

            Similar to MvPolynomial.induction_on but only a yet weaker form of h_add is required. In particular, this version only requires us to show that motive is closed under addition of monomials not present in the support for which motive is already known to hold.

            theorem MvPolynomial.induction_on {R : Type u} {σ : Type u_1} [CommSemiring R] {motive : MvPolynomial σ RProp} (p : MvPolynomial σ R) (C : ∀ (a : R), motive (C a)) (add : ∀ (p q : MvPolynomial σ R), motive pmotive qmotive (p + q)) (mul_X : ∀ (p : MvPolynomial σ R) (n : σ), motive pmotive (p * X n)) :
            motive p

            Analog of Polynomial.induction_on. If a property holds for any constant polynomial and is preserved under addition and multiplication by variables then it holds for all multivariate polynomials.

            theorem MvPolynomial.ringHom_ext {R : Type u} {σ : Type u_1} [CommSemiring R] {A : Type u_2} [Semiring A] {f g : MvPolynomial σ R →+* A} (hC : ∀ (r : R), f (C r) = g (C r)) (hX : ∀ (i : σ), f (X i) = g (X i)) :
            f = g
            theorem MvPolynomial.ringHom_ext' {R : Type u} {σ : Type u_1} [CommSemiring R] {A : Type u_2} [Semiring A] {f g : MvPolynomial σ R →+* A} (hC : f.comp C = g.comp C) (hX : ∀ (i : σ), f (X i) = g (X i)) :
            f = g

            See note [partially-applied ext lemmas].

            theorem MvPolynomial.hom_eq_hom {R : Type u} {S₂ : Type w} {σ : Type u_1} [CommSemiring R] [Semiring S₂] (f g : MvPolynomial σ R →+* S₂) (hC : f.comp C = g.comp C) (hX : ∀ (n : σ), f (X n) = g (X n)) (p : MvPolynomial σ R) :
            f p = g p
            theorem MvPolynomial.is_id {R : Type u} {σ : Type u_1} [CommSemiring R] (f : MvPolynomial σ R →+* MvPolynomial σ R) (hC : f.comp C = C) (hX : ∀ (n : σ), f (X n) = X n) (p : MvPolynomial σ R) :
            f p = p
            theorem MvPolynomial.algHom_ext' {R : Type u} {σ : Type u_1} [CommSemiring R] {A : Type u_2} {B : Type u_3} [CommSemiring A] [CommSemiring B] [Algebra R A] [Algebra R B] {f g : MvPolynomial σ A →ₐ[R] B} (h₁ : f.comp (IsScalarTower.toAlgHom R A (MvPolynomial σ A)) = g.comp (IsScalarTower.toAlgHom R A (MvPolynomial σ A))) (h₂ : ∀ (i : σ), f (X i) = g (X i)) :
            f = g
            theorem MvPolynomial.algHom_ext {R : Type u} {σ : Type u_1} [CommSemiring R] {A : Type u_2} [Semiring A] [Algebra R A] {f g : MvPolynomial σ R →ₐ[R] A} (hf : ∀ (i : σ), f (X i) = g (X i)) :
            f = g
            @[simp]
            theorem MvPolynomial.algHom_C {R : Type u} {σ : Type u_1} [CommSemiring R] {A : Type u_2} [Semiring A] [Algebra R A] (f : MvPolynomial σ R →ₐ[R] A) (r : R) :
            f (C r) = (algebraMap R A) r
            theorem MvPolynomial.linearMap_ext {R : Type u} {σ : Type u_1} [CommSemiring R] {M : Type u_2} [AddCommMonoid M] [Module R M] {f g : MvPolynomial σ R →ₗ[R] M} (h : ∀ (s : σ →₀ ), f ∘ₗ monomial s = g ∘ₗ monomial s) :
            f = g
            def MvPolynomial.support {R : Type u} {σ : Type u_1} [CommSemiring R] (p : MvPolynomial σ R) :

            The finite set of all m : σ →₀ ℕ such that X^m has a non-zero coefficient.

            Equations
            Instances For
              theorem MvPolynomial.support_monomial {R : Type u} {σ : Type u_1} {a : R} {s : σ →₀ } [CommSemiring R] [h : Decidable (a = 0)] :
              theorem MvPolynomial.support_monomial_subset {R : Type u} {σ : Type u_1} {a : R} {s : σ →₀ } [CommSemiring R] :
              theorem MvPolynomial.support_add {R : Type u} {σ : Type u_1} [CommSemiring R] {p q : MvPolynomial σ R} [DecidableEq σ] :
              theorem MvPolynomial.support_X {R : Type u} {σ : Type u_1} {n : σ} [CommSemiring R] [Nontrivial R] :
              theorem MvPolynomial.support_X_pow {R : Type u} {σ : Type u_1} [CommSemiring R] [Nontrivial R] (s : σ) (n : ) :
              @[simp]
              theorem MvPolynomial.support_zero {R : Type u} {σ : Type u_1} [CommSemiring R] :
              theorem MvPolynomial.support_smul {R : Type u} {σ : Type u_1} [CommSemiring R] {S₁ : Type u_2} [SMulZeroClass S₁ R] {a : S₁} {f : MvPolynomial σ R} :
              theorem MvPolynomial.support_sum {R : Type u} {σ : Type u_1} [CommSemiring R] {α : Type u_2} [DecidableEq σ] {s : Finset α} {f : αMvPolynomial σ R} :
              (∑ xs, f x).support s.biUnion fun (x : α) => (f x).support
              def MvPolynomial.coeff {R : Type u} {σ : Type u_1} [CommSemiring R] (m : σ →₀ ) (p : MvPolynomial σ R) :
              R

              The coefficient of the monomial m in the multi-variable polynomial p.

              Equations
              Instances For
                @[simp]
                theorem MvPolynomial.mem_support_iff {R : Type u} {σ : Type u_1} [CommSemiring R] {p : MvPolynomial σ R} {m : σ →₀ } :
                m p.support coeff m p 0
                theorem MvPolynomial.not_mem_support_iff {R : Type u} {σ : Type u_1} [CommSemiring R] {p : MvPolynomial σ R} {m : σ →₀ } :
                mp.support coeff m p = 0
                theorem MvPolynomial.sum_def {R : Type u} {σ : Type u_1} [CommSemiring R] {A : Type u_2} [AddCommMonoid A] {p : MvPolynomial σ R} {b : (σ →₀ ) → RA} :
                Finsupp.sum p b = mp.support, b m (coeff m p)
                theorem MvPolynomial.support_mul {R : Type u} {σ : Type u_1} [CommSemiring R] [DecidableEq σ] (p q : MvPolynomial σ R) :
                theorem MvPolynomial.ext {R : Type u} {σ : Type u_1} [CommSemiring R] (p q : MvPolynomial σ R) :
                (∀ (m : σ →₀ ), coeff m p = coeff m q)p = q
                @[simp]
                theorem MvPolynomial.coeff_add {R : Type u} {σ : Type u_1} [CommSemiring R] (m : σ →₀ ) (p q : MvPolynomial σ R) :
                coeff m (p + q) = coeff m p + coeff m q
                @[simp]
                theorem MvPolynomial.coeff_smul {R : Type u} {σ : Type u_1} [CommSemiring R] {S₁ : Type u_2} [SMulZeroClass S₁ R] (m : σ →₀ ) (C : S₁) (p : MvPolynomial σ R) :
                coeff m (C p) = C coeff m p
                @[simp]
                theorem MvPolynomial.coeff_zero {R : Type u} {σ : Type u_1} [CommSemiring R] (m : σ →₀ ) :
                coeff m 0 = 0
                @[simp]
                theorem MvPolynomial.coeff_zero_X {R : Type u} {σ : Type u_1} [CommSemiring R] (i : σ) :
                coeff 0 (X i) = 0
                def MvPolynomial.coeffAddMonoidHom {R : Type u} {σ : Type u_1} [CommSemiring R] (m : σ →₀ ) :

                MvPolynomial.coeff m but promoted to an AddMonoidHom.

                Equations
                Instances For
                  @[simp]
                  theorem MvPolynomial.coeffAddMonoidHom_apply {R : Type u} {σ : Type u_1} [CommSemiring R] (m : σ →₀ ) (p : MvPolynomial σ R) :
                  def MvPolynomial.lcoeff (R : Type u) {σ : Type u_1} [CommSemiring R] (m : σ →₀ ) :

                  MvPolynomial.coeff m but promoted to a LinearMap.

                  Equations
                  Instances For
                    @[simp]
                    theorem MvPolynomial.lcoeff_apply (R : Type u) {σ : Type u_1} [CommSemiring R] (m : σ →₀ ) (p : MvPolynomial σ R) :
                    (lcoeff R m) p = coeff m p
                    theorem MvPolynomial.coeff_sum {R : Type u} {σ : Type u_1} [CommSemiring R] {X : Type u_2} (s : Finset X) (f : XMvPolynomial σ R) (m : σ →₀ ) :
                    coeff m (∑ xs, f x) = xs, coeff m (f x)
                    theorem MvPolynomial.monic_monomial_eq {R : Type u} {σ : Type u_1} [CommSemiring R] (m : σ →₀ ) :
                    (monomial m) 1 = m.prod fun (n : σ) (e : ) => X n ^ e
                    @[simp]
                    theorem MvPolynomial.coeff_monomial {R : Type u} {σ : Type u_1} [CommSemiring R] [DecidableEq σ] (m n : σ →₀ ) (a : R) :
                    coeff m ((monomial n) a) = if n = m then a else 0
                    @[simp]
                    theorem MvPolynomial.coeff_C {R : Type u} {σ : Type u_1} [CommSemiring R] [DecidableEq σ] (m : σ →₀ ) (a : R) :
                    coeff m (C a) = if 0 = m then a else 0
                    theorem MvPolynomial.eq_C_of_isEmpty {R : Type u} {σ : Type u_1} [CommSemiring R] [IsEmpty σ] (p : MvPolynomial σ R) :
                    p = C (coeff 0 p)
                    theorem MvPolynomial.coeff_one {R : Type u} {σ : Type u_1} [CommSemiring R] [DecidableEq σ] (m : σ →₀ ) :
                    coeff m 1 = if 0 = m then 1 else 0
                    @[simp]
                    theorem MvPolynomial.coeff_zero_C {R : Type u} {σ : Type u_1} [CommSemiring R] (a : R) :
                    coeff 0 (C a) = a
                    @[simp]
                    theorem MvPolynomial.coeff_zero_one {R : Type u} {σ : Type u_1} [CommSemiring R] :
                    coeff 0 1 = 1
                    theorem MvPolynomial.coeff_X_pow {R : Type u} {σ : Type u_1} [CommSemiring R] [DecidableEq σ] (i : σ) (m : σ →₀ ) (k : ) :
                    coeff m (X i ^ k) = if Finsupp.single i k = m then 1 else 0
                    theorem MvPolynomial.coeff_X' {R : Type u} {σ : Type u_1} [CommSemiring R] [DecidableEq σ] (i : σ) (m : σ →₀ ) :
                    coeff m (X i) = if Finsupp.single i 1 = m then 1 else 0
                    @[simp]
                    theorem MvPolynomial.coeff_X {R : Type u} {σ : Type u_1} [CommSemiring R] (i : σ) :
                    coeff (Finsupp.single i 1) (X i) = 1
                    @[simp]
                    theorem MvPolynomial.coeff_C_mul {R : Type u} {σ : Type u_1} [CommSemiring R] (m : σ →₀ ) (a : R) (p : MvPolynomial σ R) :
                    coeff m (C a * p) = a * coeff m p
                    theorem MvPolynomial.coeff_mul {R : Type u} {σ : Type u_1} [CommSemiring R] [DecidableEq σ] (p q : MvPolynomial σ R) (n : σ →₀ ) :
                    coeff n (p * q) = xFinset.antidiagonal n, coeff x.1 p * coeff x.2 q
                    @[simp]
                    theorem MvPolynomial.coeff_mul_monomial {R : Type u} {σ : Type u_1} [CommSemiring R] (m s : σ →₀ ) (r : R) (p : MvPolynomial σ R) :
                    coeff (m + s) (p * (monomial s) r) = coeff m p * r
                    @[simp]
                    theorem MvPolynomial.coeff_monomial_mul {R : Type u} {σ : Type u_1} [CommSemiring R] (m s : σ →₀ ) (r : R) (p : MvPolynomial σ R) :
                    coeff (s + m) ((monomial s) r * p) = r * coeff m p
                    @[simp]
                    theorem MvPolynomial.coeff_mul_X {R : Type u} {σ : Type u_1} [CommSemiring R] (m : σ →₀ ) (s : σ) (p : MvPolynomial σ R) :
                    coeff (m + Finsupp.single s 1) (p * X s) = coeff m p
                    @[simp]
                    theorem MvPolynomial.coeff_X_mul {R : Type u} {σ : Type u_1} [CommSemiring R] (m : σ →₀ ) (s : σ) (p : MvPolynomial σ R) :
                    coeff (Finsupp.single s 1 + m) (X s * p) = coeff m p
                    theorem MvPolynomial.coeff_single_X_pow {R : Type u} {σ : Type u_1} [CommSemiring R] [DecidableEq σ] (s s' : σ) (n n' : ) :
                    coeff (Finsupp.single s' n') (X s ^ n) = if s = s' n = n' n = 0 n' = 0 then 1 else 0
                    @[simp]
                    theorem MvPolynomial.coeff_single_X {R : Type u} {σ : Type u_1} [CommSemiring R] [DecidableEq σ] (s s' : σ) (n : ) :
                    coeff (Finsupp.single s' n) (X s) = if n = 1 s = s' then 1 else 0
                    @[simp]
                    theorem MvPolynomial.support_mul_X {R : Type u} {σ : Type u_1} [CommSemiring R] (s : σ) (p : MvPolynomial σ R) :
                    @[simp]
                    theorem MvPolynomial.support_X_mul {R : Type u} {σ : Type u_1} [CommSemiring R] (s : σ) (p : MvPolynomial σ R) :
                    @[simp]
                    theorem MvPolynomial.support_smul_eq {R : Type u} {σ : Type u_1} [CommSemiring R] {S₁ : Type u_2} [Semiring S₁] [Module S₁ R] [NoZeroSMulDivisors S₁ R] {a : S₁} (h : a 0) (p : MvPolynomial σ R) :
                    theorem MvPolynomial.coeff_mul_monomial' {R : Type u} {σ : Type u_1} [CommSemiring R] (m s : σ →₀ ) (r : R) (p : MvPolynomial σ R) :
                    coeff m (p * (monomial s) r) = if s m then coeff (m - s) p * r else 0
                    theorem MvPolynomial.coeff_monomial_mul' {R : Type u} {σ : Type u_1} [CommSemiring R] (m s : σ →₀ ) (r : R) (p : MvPolynomial σ R) :
                    coeff m ((monomial s) r * p) = if s m then r * coeff (m - s) p else 0
                    theorem MvPolynomial.coeff_mul_X' {R : Type u} {σ : Type u_1} [CommSemiring R] [DecidableEq σ] (m : σ →₀ ) (s : σ) (p : MvPolynomial σ R) :
                    coeff m (p * X s) = if s m.support then coeff (m - Finsupp.single s 1) p else 0
                    theorem MvPolynomial.coeff_X_mul' {R : Type u} {σ : Type u_1} [CommSemiring R] [DecidableEq σ] (m : σ →₀ ) (s : σ) (p : MvPolynomial σ R) :
                    coeff m (X s * p) = if s m.support then coeff (m - Finsupp.single s 1) p else 0
                    theorem MvPolynomial.eq_zero_iff {R : Type u} {σ : Type u_1} [CommSemiring R] {p : MvPolynomial σ R} :
                    p = 0 ∀ (d : σ →₀ ), coeff d p = 0
                    theorem MvPolynomial.ne_zero_iff {R : Type u} {σ : Type u_1} [CommSemiring R] {p : MvPolynomial σ R} :
                    p 0 ∃ (d : σ →₀ ), coeff d p 0
                    @[simp]
                    theorem MvPolynomial.X_ne_zero {R : Type u} {σ : Type u_1} [CommSemiring R] [Nontrivial R] (s : σ) :
                    X s 0
                    @[simp]
                    theorem MvPolynomial.support_eq_empty {R : Type u} {σ : Type u_1} [CommSemiring R] {p : MvPolynomial σ R} :
                    p.support = p = 0
                    @[simp]
                    theorem MvPolynomial.support_nonempty {R : Type u} {σ : Type u_1} [CommSemiring R] {p : MvPolynomial σ R} :
                    theorem MvPolynomial.exists_coeff_ne_zero {R : Type u} {σ : Type u_1} [CommSemiring R] {p : MvPolynomial σ R} (h : p 0) :
                    ∃ (d : σ →₀ ), coeff d p 0
                    theorem MvPolynomial.C_dvd_iff_dvd_coeff {R : Type u} {σ : Type u_1} [CommSemiring R] (r : R) (φ : MvPolynomial σ R) :
                    C r φ ∀ (i : σ →₀ ), r coeff i φ
                    @[simp]
                    theorem MvPolynomial.isRegular_X {R : Type u} {σ : Type u_1} {n : σ} [CommSemiring R] :
                    @[simp]
                    theorem MvPolynomial.isRegular_X_pow {R : Type u} {σ : Type u_1} {n : σ} [CommSemiring R] (k : ) :
                    IsRegular (X n ^ k)
                    @[simp]
                    theorem MvPolynomial.isRegular_prod_X {R : Type u} {σ : Type u_1} [CommSemiring R] (s : Finset σ) :
                    IsRegular (∏ ns, X n)
                    def MvPolynomial.coeffs {R : Type u} {σ : Type u_1} [CommSemiring R] (p : MvPolynomial σ R) :

                    The finset of nonzero coefficients of a multivariate polynomial.

                    Equations
                    Instances For
                      @[simp]
                      theorem MvPolynomial.coeffs_zero {R : Type u} {σ : Type u_1} [CommSemiring R] :
                      theorem MvPolynomial.coeffs_one {R : Type u} {σ : Type u_1} [CommSemiring R] :
                      theorem MvPolynomial.mem_coeffs_iff {R : Type u} {σ : Type u_1} [CommSemiring R] {p : MvPolynomial σ R} {c : R} :
                      c p.coeffs np.support, c = coeff n p
                      theorem MvPolynomial.coeff_mem_coeffs {R : Type u} {σ : Type u_1} [CommSemiring R] {p : MvPolynomial σ R} (m : σ →₀ ) (h : coeff m p 0) :
                      theorem MvPolynomial.zero_not_mem_coeffs {R : Type u} {σ : Type u_1} [CommSemiring R] (p : MvPolynomial σ R) :
                      0p.coeffs

                      constantCoeff p returns the constant term of the polynomial p, defined as coeff 0 p. This is a ring homomorphism.

                      Equations
                      Instances For
                        @[simp]
                        theorem MvPolynomial.constantCoeff_C {R : Type u} (σ : Type u_1) [CommSemiring R] (r : R) :
                        @[simp]
                        theorem MvPolynomial.constantCoeff_X (R : Type u) {σ : Type u_1} [CommSemiring R] (i : σ) :
                        @[simp]
                        theorem MvPolynomial.constantCoeff_smul {S₁ : Type v} {σ : Type u_1} [CommSemiring S₁] {R : Type u_2} [SMulZeroClass R S₁] (a : R) (f : MvPolynomial σ S₁) :
                        theorem MvPolynomial.constantCoeff_monomial {R : Type u} {σ : Type u_1} [CommSemiring R] [DecidableEq σ] (d : σ →₀ ) (r : R) :
                        constantCoeff ((monomial d) r) = if d = 0 then r else 0
                        @[simp]
                        theorem MvPolynomial.support_sum_monomial_coeff {R : Type u} {σ : Type u_1} [CommSemiring R] (p : MvPolynomial σ R) :
                        vp.support, (monomial v) (coeff v p) = p
                        theorem MvPolynomial.as_sum {R : Type u} {σ : Type u_1} [CommSemiring R] (p : MvPolynomial σ R) :
                        p = vp.support, (monomial v) (coeff v p)
                        def MvPolynomial.coeffsIn {R : Type u_2} {S : Type u_3} (σ : Type u_4) [CommSemiring R] [CommSemiring S] [Module R S] (M : Submodule R S) :

                        The R-submodule of multivariate polynomials whose coefficients lie in a R-submodule M.

                        Equations
                        Instances For
                          @[simp]
                          theorem MvPolynomial.coe_coeffsIn {R : Type u_2} {S : Type u_3} (σ : Type u_4) [CommSemiring R] [CommSemiring S] [Module R S] (M : Submodule R S) :
                          (coeffsIn σ M) = {p : MvPolynomial σ S | ∀ (i : σ →₀ ), coeff i p M}
                          theorem MvPolynomial.mem_coeffsIn {R : Type u_2} {S : Type u_3} {σ : Type u_4} [CommSemiring R] [CommSemiring S] [Module R S] {M : Submodule R S} {p : MvPolynomial σ S} :
                          p coeffsIn σ M ∀ (i : σ →₀ ), coeff i p M
                          @[simp]
                          theorem MvPolynomial.monomial_mem_coeffsIn {R : Type u_2} {S : Type u_3} {σ : Type u_4} [CommSemiring R] [CommSemiring S] [Module R S] {M : Submodule R S} {i : σ →₀ } {x : S} :
                          (monomial i) x coeffsIn σ M x M
                          @[simp]
                          theorem MvPolynomial.C_mem_coeffsIn {R : Type u_2} {S : Type u_3} {σ : Type u_4} [CommSemiring R] [CommSemiring S] [Module R S] {M : Submodule R S} {x : S} :
                          C x coeffsIn σ M x M
                          @[simp]
                          theorem MvPolynomial.one_coeffsIn {R : Type u_2} {S : Type u_3} {σ : Type u_4} [CommSemiring R] [CommSemiring S] [Module R S] {M : Submodule R S} :
                          1 coeffsIn σ M 1 M
                          @[simp]
                          theorem MvPolynomial.mul_monomial_mem_coeffsIn {R : Type u_2} {S : Type u_3} {σ : Type u_4} [CommSemiring R] [CommSemiring S] [Module R S] {M : Submodule R S} {p : MvPolynomial σ S} {i : σ →₀ } :
                          p * (monomial i) 1 coeffsIn σ M p coeffsIn σ M
                          @[simp]
                          theorem MvPolynomial.monomial_mul_mem_coeffsIn {R : Type u_2} {S : Type u_3} {σ : Type u_4} [CommSemiring R] [CommSemiring S] [Module R S] {M : Submodule R S} {p : MvPolynomial σ S} {i : σ →₀ } :
                          (monomial i) 1 * p coeffsIn σ M p coeffsIn σ M
                          @[simp]
                          theorem MvPolynomial.mul_X_mem_coeffsIn {R : Type u_2} {S : Type u_3} {σ : Type u_4} [CommSemiring R] [CommSemiring S] [Module R S] {M : Submodule R S} {p : MvPolynomial σ S} {s : σ} :
                          p * X s coeffsIn σ M p coeffsIn σ M
                          @[simp]
                          theorem MvPolynomial.X_mul_mem_coeffsIn {R : Type u_2} {S : Type u_3} {σ : Type u_4} [CommSemiring R] [CommSemiring S] [Module R S] {M : Submodule R S} {p : MvPolynomial σ S} {s : σ} :
                          X s * p coeffsIn σ M p coeffsIn σ M
                          theorem MvPolynomial.coeffsIn_eq_span_monomial {R : Type u_2} {S : Type u_3} {σ : Type u_4} [CommSemiring R] [CommSemiring S] [Module R S] (M : Submodule R S) :
                          coeffsIn σ M = Submodule.span R {x : MvPolynomial σ S | mM, ∃ (i : σ →₀ ), (monomial i) m = x}
                          theorem MvPolynomial.coeffsIn_le {R : Type u_2} {S : Type u_3} {σ : Type u_4} [CommSemiring R] [CommSemiring S] [Module R S] {M : Submodule R S} {N : Submodule R (MvPolynomial σ S)} :
                          coeffsIn σ M N mM, ∀ (i : σ →₀ ), (monomial i) m N
                          theorem MvPolynomial.coeffsIn_mul {R : Type u_2} {S : Type u_3} {σ : Type u_4} [CommSemiring R] [CommSemiring S] [Algebra R S] (M N : Submodule R S) :
                          coeffsIn σ (M * N) = coeffsIn σ M * coeffsIn σ N
                          theorem MvPolynomial.coeffsIn_pow {R : Type u_2} {S : Type u_3} {σ : Type u_4} [CommSemiring R] [CommSemiring S] [Algebra R S] {n : } :
                          n 0∀ (M : Submodule R S), coeffsIn σ (M ^ n) = coeffsIn σ M ^ n
                          theorem MvPolynomial.le_coeffsIn_pow {R : Type u_2} {S : Type u_3} {σ : Type u_4} [CommSemiring R] [CommSemiring S] [Algebra R S] {M : Submodule R S} {n : } :
                          coeffsIn σ M ^ n coeffsIn σ (M ^ n)