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.MvPolynomial.Basic

185 declarations and 7 deprecated aliases. Mathlib docs · Source

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:

  • σ : Type* (indexing the variables)
  • R : Type* [CommSemiring R] (the coefficients)
  • s : σ →₀ ℕ, a function from σ to ℕ which is zero away from a finite set. This will give rise to a monomial in MvPolynomial σ R which mathematicians might call X^s
  • a : R
  • i : σ, with corresponding monomial X i, often denoted X_i by mathematicians
  • p : MvPolynomial σ R

Definitions

  • MvPolynomial σ R : the type of polynomials with variables of type σ and coefficients in the commutative semiring R
  • monomial s a : the monomial which mathematically would be denoted a * X^s
  • C a : the constant polynomial with value a
  • X i : the degree one monomial corresponding to i; mathematically this might be denoted Xᵢ.
  • coeff s p : the coefficient of s in p.

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

abbrev MvPolynomial E3 #

Type u_1 → (R : Type u_2) → [CommSemiring R] → Type (max u_2 u_1)

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

def MvPolynomial.monomial E1 #

{R : Type u} → {σ : Type u_1} → [inst : CommSemiring R] → (σ →₀ ℕ) → R →ₗ[R] MvPolynomial σ R

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

theorem MvPolynomial.one_def E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R], 1 = (MvPolynomial.monomial 0) 1

theorem MvPolynomial.single_eq_monomial E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (s : σ →₀ ℕ) (a : R),
  AddMonoidAlgebra.single s a = (MvPolynomial.monomial s) a

theorem MvPolynomial.mul_def E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p q : MvPolynomial σ R},
  p * q = p.coeff.sum fun m a ↦ q.coeff.sum fun n b ↦ (MvPolynomial.monomial (m + n)) (a * b)

def MvPolynomial.C E1 #

{R : Type u} → {σ : Type u_1} → [inst : CommSemiring R] → R →+* MvPolynomial σ R

C a is the constant polynomial with value a

theorem MvPolynomial.algebraMap_eq E0 #

∀ (R : Type u) (σ : Type u_1) [inst : CommSemiring R], algebraMap R (MvPolynomial σ R) = MvPolynomial.C

theorem MvPolynomial.C_eq_algebraMap E1 #

∀ (R : Type u) (σ : Type u_1) [inst : CommSemiring R], MvPolynomial.C = algebraMap R (MvPolynomial σ R)

theorem MvPolynomial.algebraMap_apply E0 #

∀ {R : Type u} {S₁ : Type v} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : CommSemiring S₁] [inst_2 : Algebra R S₁]
  (r : R), (algebraMap R (MvPolynomial σ S₁)) r = MvPolynomial.C ((algebraMap R S₁) r)

def MvPolynomial.X E1 #

{R : Type u} → {σ : Type u_1} → [inst : CommSemiring R] → σ → MvPolynomial σ R

X n is the degree 1 monomial $X_n$.

theorem MvPolynomial.monomial_left_injective E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {r : R},
  r ≠ 0 → Function.Injective fun s ↦ (MvPolynomial.monomial s) r

theorem MvPolynomial.monomial_left_inj E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {s t : σ →₀ ℕ} {r : R},
  r ≠ 0 → ((MvPolynomial.monomial s) r = (MvPolynomial.monomial t) r ↔ s = t)

theorem MvPolynomial.C_apply E0 #

∀ {R : Type u} {σ : Type u_1} {a : R} [inst : CommSemiring R], MvPolynomial.C a = (MvPolynomial.monomial 0) a

theorem MvPolynomial.C_0 E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R], MvPolynomial.C 0 = 0

theorem MvPolynomial.C_1 E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R], MvPolynomial.C 1 = 1

theorem MvPolynomial.C_mul_monomial E1 #

∀ {R : Type u} {σ : Type u_1} {a a' : R} {s : σ →₀ ℕ} [inst : CommSemiring R],
  MvPolynomial.C a * (MvPolynomial.monomial s) a' = (MvPolynomial.monomial s) (a * a')

theorem MvPolynomial.C_add E0 #

∀ {R : Type u} {σ : Type u_1} {a a' : R} [inst : CommSemiring R],
  MvPolynomial.C (a + a') = MvPolynomial.C a + MvPolynomial.C a'

theorem MvPolynomial.C_mul E0 #

∀ {R : Type u} {σ : Type u_1} {a a' : R} [inst : CommSemiring R],
  MvPolynomial.C (a * a') = MvPolynomial.C a * MvPolynomial.C a'

theorem MvPolynomial.C_pow E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (a : R) (n : ℕ), MvPolynomial.C (a ^ n) = MvPolynomial.C a ^ n

theorem MvPolynomial.C_injective E1 #

∀ (σ : Type u_2) (R : Type u_3) [inst : CommSemiring R], Function.Injective ⇑MvPolynomial.C

theorem MvPolynomial.C_surjective E1 #

∀ {R : Type u_2} [inst : CommSemiring R] (σ : Type u_3) [IsEmpty σ], Function.Surjective ⇑MvPolynomial.C

theorem MvPolynomial.C_inj E0 #

∀ {σ : Type u_2} (R : Type u_3) [inst : CommSemiring R] (r s : R), MvPolynomial.C r = MvPolynomial.C s ↔ r = s

theorem MvPolynomial.C_eq_zero E0 #

∀ {R : Type u} {σ : Type u_1} {a : R} [inst : CommSemiring R], MvPolynomial.C a = 0 ↔ a = 0

theorem MvPolynomial.C_ne_zero E1 #

∀ {R : Type u} {σ : Type u_1} {a : R} [inst : CommSemiring R], MvPolynomial.C a ≠ 0 ↔ a ≠ 0

instance MvPolynomial.nontrivial_of_nontrivial E0 #

∀ (σ : Type u_2) (R : Type u_3) [inst : CommSemiring R] [Nontrivial R], Nontrivial (MvPolynomial σ R)

instance MvPolynomial.infinite_of_infinite E0 #

∀ (σ : Type u_2) (R : Type u_3) [inst : CommSemiring R] [Infinite R], Infinite (MvPolynomial σ R)

instance MvPolynomial.infinite_of_nonempty E0 #

∀ (σ : Type u_2) (R : Type u_3) [Nonempty σ] [inst : CommSemiring R] [Nontrivial R], Infinite (MvPolynomial σ R)

instance MvPolynomial.instNoZeroDivisors E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [NoZeroDivisors R], NoZeroDivisors (MvPolynomial σ R)

instance MvPolynomial.instIsCancelMulZeroOfIsCancelAdd E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [IsCancelAdd R] [IsCancelMulZero R],
  IsCancelMulZero (MvPolynomial σ R)

instance MvPolynomial.instIsDomainOfIsCancelAdd E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [IsCancelAdd R] [IsDomain R], IsDomain (MvPolynomial σ R)

The multivariate polynomial ring over an integral domain is an integral domain.

theorem MvPolynomial.C_eq_natCast E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (n : ℕ), MvPolynomial.C ↑n = ↑n

theorem MvPolynomial.C_mul' E1 #

∀ {R : Type u} {σ : Type u_1} {a : R} [inst : CommSemiring R] {p : MvPolynomial σ R}, MvPolynomial.C a * p = a • p

theorem MvPolynomial.smul_eq_C_mul E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (p : MvPolynomial σ R) (a : R), a • p = MvPolynomial.C a * p

theorem MvPolynomial.C_eq_smul_one E1 #

∀ {R : Type u} {σ : Type u_1} {a : R} [inst : CommSemiring R], MvPolynomial.C a = a • 1

theorem MvPolynomial.smul_monomial E1 #

∀ {R : Type u} {σ : Type u_1} {a : R} {s : σ →₀ ℕ} [inst : CommSemiring R] {S₁ : Type u_2} [inst_1 : SMulZeroClass S₁ R]
  (r : S₁), r • (MvPolynomial.monomial s) a = (MvPolynomial.monomial s) (r • a)

theorem MvPolynomial.X_injective E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [Nontrivial R], Function.Injective MvPolynomial.X

theorem MvPolynomial.X_inj E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [Nontrivial R] (m n : σ),
  MvPolynomial.X m = MvPolynomial.X n ↔ m = n

theorem MvPolynomial.monomial_pow E1 #

∀ {R : Type u} {σ : Type u_1} {a : R} {e : ℕ} {s : σ →₀ ℕ} [inst : CommSemiring R],
  (MvPolynomial.monomial s) a ^ e = (MvPolynomial.monomial (e • s)) (a ^ e)

theorem MvPolynomial.monomial_mul_monomial E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {s s' : σ →₀ ℕ} {a b : R},
  (MvPolynomial.monomial s) a * (MvPolynomial.monomial s') b = (MvPolynomial.monomial (s + s')) (a * b)

def MvPolynomial.monomialOneHom E1 #

(R : Type u) → (σ : Type u_1) → [inst : CommSemiring R] → Multiplicative (σ →₀ ℕ) →* MvPolynomial σ R

fun s ↦ monomial s 1 as a homomorphism.

theorem MvPolynomial.monomialOneHom_apply E0 #

∀ {R : Type u} {σ : Type u_1} {s : σ →₀ ℕ} [inst : CommSemiring R],
  (MvPolynomial.monomialOneHom R σ) s = (MvPolynomial.monomial s) 1

theorem MvPolynomial.X_pow_eq_monomial E1 #

∀ {R : Type u} {σ : Type u_1} {e : ℕ} {n : σ} [inst : CommSemiring R],
  MvPolynomial.X n ^ e = (MvPolynomial.monomial fun₀ | n => e) 1

theorem MvPolynomial.monomial_add_single E1 #

∀ {R : Type u} {σ : Type u_1} {a : R} {e : ℕ} {n : σ} {s : σ →₀ ℕ} [inst : CommSemiring R],
  (MvPolynomial.monomial (s + fun₀ | n => e)) a = (MvPolynomial.monomial s) a * MvPolynomial.X n ^ e

theorem MvPolynomial.monomial_single_add E1 #

∀ {R : Type u} {σ : Type u_1} {a : R} {e : ℕ} {n : σ} {s : σ →₀ ℕ} [inst : CommSemiring R],
  (MvPolynomial.monomial ((fun₀ | n => e) + s)) a = MvPolynomial.X n ^ e * (MvPolynomial.monomial s) a

theorem MvPolynomial.C_mul_X_pow_eq_monomial E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {s : σ} {a : R} {n : ℕ},
  MvPolynomial.C a * MvPolynomial.X s ^ n = (MvPolynomial.monomial fun₀ | s => n) a

theorem MvPolynomial.C_mul_X_eq_monomial E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {s : σ} {a : R},
  MvPolynomial.C a * MvPolynomial.X s = (MvPolynomial.monomial fun₀ | s => 1) a

theorem MvPolynomial.monomial_zero E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {s : σ →₀ ℕ}, (MvPolynomial.monomial s) 0 = 0

theorem MvPolynomial.monomial_zero' E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R], ⇑(MvPolynomial.monomial 0) = ⇑MvPolynomial.C

theorem MvPolynomial.monomial_eq_zero E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {s : σ →₀ ℕ} {b : R}, (MvPolynomial.monomial s) b = 0 ↔ b = 0

theorem MvPolynomial.sum_monomial_eq E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {A : Type u_2} [inst_1 : AddCommMonoid A] {u : σ →₀ ℕ} {r : R}
  {b : (σ →₀ ℕ) → R → A}, b u 0 = 0 → ((MvPolynomial.monomial u) r).coeff.sum b = b u r

theorem MvPolynomial.sum_C E0 #

∀ {R : Type u} {σ : Type u_1} {a : R} [inst : CommSemiring R] {A : Type u_2} [inst_1 : AddCommMonoid A]
  {b : (σ →₀ ℕ) → R → A}, b 0 0 = 0 → (MvPolynomial.C a).coeff.sum b = b 0 a

theorem MvPolynomial.monomial_sum_one E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {α : Type u_2} (s : Finset α) (f : α → σ →₀ ℕ),
  (MvPolynomial.monomial (∑ i ∈ s, f i)) 1 = ∏ i ∈ s, (MvPolynomial.monomial (f i)) 1

theorem MvPolynomial.monomial_sum_index E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {α : Type u_2} (s : Finset α) (f : α → σ →₀ ℕ) (a : R),
  (MvPolynomial.monomial (∑ i ∈ s, f i)) a = MvPolynomial.C a * ∏ i ∈ s, (MvPolynomial.monomial (f i)) 1

theorem MvPolynomial.monomial_sum_prod E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {α : Type u_2} (s : Finset α) (f : α → σ →₀ ℕ) (g : α → R),
  (MvPolynomial.monomial (∑ i ∈ s, f i)) (∏ i ∈ s, g i) = ∏ i ∈ s, (MvPolynomial.monomial (f i)) (g i)

theorem MvPolynomial.monomial_finsupp_sum_index E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {α : Type u_2} {β : Type u_3} [inst_1 : Zero β] (f : α →₀ β)
  (g : α → β → σ →₀ ℕ) (a : R),
  (MvPolynomial.monomial (f.sum g)) a = MvPolynomial.C a * f.prod fun a b ↦ (MvPolynomial.monomial (g a b)) 1

theorem MvPolynomial.monomial_eq_monomial_iff E0 #

∀ {R : Type u} [inst : CommSemiring R] {α : Type u_2} (a₁ a₂ : α →₀ ℕ) (b₁ b₂ : R),
  (MvPolynomial.monomial a₁) b₁ = (MvPolynomial.monomial a₂) b₂ ↔ a₁ = a₂ ∧ b₁ = b₂ ∨ b₁ = 0 ∧ b₂ = 0

theorem MvPolynomial.monomial_eq E0 #

∀ {R : Type u} {σ : Type u_1} {a : R} {s : σ →₀ ℕ} [inst : CommSemiring R],
  (MvPolynomial.monomial s) a = MvPolynomial.C a * s.prod fun n e ↦ MvPolynomial.X n ^ e

theorem MvPolynomial.prod_X_pow_eq_monomial E0 #

∀ {R : Type u} {σ : Type u_1} {s : σ →₀ ℕ} [inst : CommSemiring R],
  ∏ x ∈ s.support, MvPolynomial.X x ^ s x = (MvPolynomial.monomial s) 1

theorem MvPolynomial.prod_X_pow E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (x : σ → ℕ) (t : Finset σ),
  ∏ y ∈ t, MvPolynomial.X y ^ x y = (MvPolynomial.monomial (Finsupp.indicator t fun i x_1 ↦ x i)) 1

theorem MvPolynomial.induction_on_monomial E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {motive : MvPolynomial σ R → Prop},
  (∀ (a : R), motive (MvPolynomial.C a)) →
    (∀ (p : MvPolynomial σ R) (n : σ), motive p → motive (p * MvPolynomial.X n)) →
      ∀ (s : σ →₀ ℕ) (a : R), motive ((MvPolynomial.monomial s) a)

theorem MvPolynomial.induction_on' E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {P : MvPolynomial σ R → Prop} (p : MvPolynomial σ R),
  (∀ (u : σ →₀ ℕ) (a : R), P ((MvPolynomial.monomial u) a)) → (∀ (p q : MvPolynomial σ R), P p → P q → P (p + q)) → P p

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

theorem MvPolynomial.monomial_add_induction_on E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {motive : MvPolynomial σ R → Prop} (p : MvPolynomial σ R),
  (∀ (a : R), motive (MvPolynomial.C a)) →
    (∀ (a : σ →₀ ℕ) (b : R) (f : MvPolynomial σ R),
        a ∉ f.coeff.support → b ≠ 0 → motive f → motive ((MvPolynomial.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.

theorem MvPolynomial.induction_on'' E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {motive : MvPolynomial σ R → Prop} (p : MvPolynomial σ R),
  (∀ (a : R), motive (MvPolynomial.C a)) →
    (∀ (a : σ →₀ ℕ) (b : R) (f : MvPolynomial σ R),
        a ∉ f.coeff.support →
          b ≠ 0 → motive f → motive ((MvPolynomial.monomial a) b) → motive ((MvPolynomial.monomial a) b + f)) →
      (∀ (p : MvPolynomial σ R) (n : σ), motive p → motive (p * MvPolynomial.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 E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {motive : MvPolynomial σ R → Prop} (p : MvPolynomial σ R),
  (∀ (a : R), motive (MvPolynomial.C a)) →
    (∀ (p q : MvPolynomial σ R), motive p → motive q → motive (p + q)) →
      (∀ (p : MvPolynomial σ R) (n : σ), motive p → motive (p * MvPolynomial.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 E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {A : Type u_2} [inst_1 : Semiring A]
  {f g : MvPolynomial σ R →+* A},
  (∀ (r : R), f (MvPolynomial.C r) = g (MvPolynomial.C r)) →
    (∀ (i : σ), f (MvPolynomial.X i) = g (MvPolynomial.X i)) → f = g

theorem MvPolynomial.ringHom_ext' E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {A : Type u_2} [inst_1 : Semiring A]
  {f g : MvPolynomial σ R →+* A},
  f.comp MvPolynomial.C = g.comp MvPolynomial.C → (∀ (i : σ), f (MvPolynomial.X i) = g (MvPolynomial.X i)) → f = g

See note [partially-applied ext lemmas].

We set the priority higher than that of AddMonoidAlgebra.ringHom_ext'.

theorem MvPolynomial.ringHom_ext'_iff E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {A : Type u_2} [inst_1 : Semiring A]
  {f g : MvPolynomial σ R →+* A},
  f = g ↔ f.comp MvPolynomial.C = g.comp MvPolynomial.C ∧ ∀ (i : σ), f (MvPolynomial.X i) = g (MvPolynomial.X i)

theorem MvPolynomial.hom_eq_hom E1 #

∀ {R : Type u} {S₂ : Type w} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : Semiring S₂]
  (f g : MvPolynomial σ R →+* S₂),
  f.comp MvPolynomial.C = g.comp MvPolynomial.C →
    (∀ (n : σ), f (MvPolynomial.X n) = g (MvPolynomial.X n)) → ∀ (p : MvPolynomial σ R), f p = g p

theorem MvPolynomial.is_id E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (f : MvPolynomial σ R →+* MvPolynomial σ R),
  f.comp MvPolynomial.C = MvPolynomial.C →
    (∀ (n : σ), f (MvPolynomial.X n) = MvPolynomial.X n) → ∀ (p : MvPolynomial σ R), f p = p

theorem MvPolynomial.algHom_ext' E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {A : Type u_2} {B : Type u_3} [inst_1 : CommSemiring A]
  [inst_2 : CommSemiring B] [inst_3 : Algebra R A] [inst_4 : Algebra R B] {f g : MvPolynomial σ A →ₐ[R] B},
  f.comp (IsScalarTower.toAlgHom R A (MvPolynomial σ A)) = g.comp (IsScalarTower.toAlgHom R A (MvPolynomial σ A)) →
    (∀ (i : σ), f (MvPolynomial.X i) = g (MvPolynomial.X i)) → f = g

See note [partially-applied ext lemmas].

We set the priority higher than that of AddMonoidAlgebra.algHom_ext.

theorem MvPolynomial.algHom_ext'_iff E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {A : Type u_2} {B : Type u_3} [inst_1 : CommSemiring A]
  [inst_2 : CommSemiring B] [inst_3 : Algebra R A] [inst_4 : Algebra R B] {f g : MvPolynomial σ A →ₐ[R] B},
  f = g ↔
    f.comp (IsScalarTower.toAlgHom R A (MvPolynomial σ A)) = g.comp (IsScalarTower.toAlgHom R A (MvPolynomial σ A)) ∧
      ∀ (i : σ), f (MvPolynomial.X i) = g (MvPolynomial.X i)

theorem MvPolynomial.algHom_ext E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {A : Type u_2} [inst_1 : Semiring A] [inst_2 : Algebra R A]
  {f g : MvPolynomial σ R →ₐ[R] A}, (∀ (i : σ), f (MvPolynomial.X i) = g (MvPolynomial.X i)) → f = g

See note [partially-applied ext lemmas].

We set the priority higher than that of MvPolynomial.algHom_ext'.

theorem MvPolynomial.algHom_ext_iff E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {A : Type u_2} [inst_1 : Semiring A] [inst_2 : Algebra R A]
  {f g : MvPolynomial σ R →ₐ[R] A}, f = g ↔ ∀ (i : σ), f (MvPolynomial.X i) = g (MvPolynomial.X i)

theorem MvPolynomial.algHom_C E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {A : Type u_2} [inst_1 : Semiring A] [inst_2 : Algebra R A]
  (f : MvPolynomial σ R →ₐ[R] A) (r : R), f (MvPolynomial.C r) = (algebraMap R A) r

theorem MvPolynomial.adjoin_range_X E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R], Algebra.adjoin R (Set.range MvPolynomial.X) = ⊤

theorem MvPolynomial.linearMap_ext E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {M : Type u_2} [inst_1 : AddCommMonoid M] [inst_2 : Module R M]
  {f g : MvPolynomial σ R →ₗ[R] M},
  (∀ (s : σ →₀ ℕ), f ∘ₗ MvPolynomial.monomial s = g ∘ₗ MvPolynomial.monomial s) → f = g

theorem MvPolynomial.linearMap_ext_iff E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {M : Type u_2} [inst_1 : AddCommMonoid M] [inst_2 : Module R M]
  {f g : MvPolynomial σ R →ₗ[R] M}, f = g ↔ ∀ (s : σ →₀ ℕ), f ∘ₗ MvPolynomial.monomial s = g ∘ₗ MvPolynomial.monomial s

def MvPolynomial.support E1 #

{R : Type u} → {σ : Type u_1} → [inst : CommSemiring R] → MvPolynomial σ R → Finset (σ →₀ ℕ)

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

theorem MvPolynomial.finsupp_support_eq_support E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (p : MvPolynomial σ R), p.coeff.support = p.support

theorem MvPolynomial.support_monomial E1 #

∀ {R : Type u} {σ : Type u_1} {a : R} {s : σ →₀ ℕ} [inst : CommSemiring R] [h : Decidable (a = 0)],
  ((MvPolynomial.monomial s) a).support = if a = 0 then ∅ else {s}

theorem MvPolynomial.support_C E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (c : R) [h : Decidable (c = 0)],
  (MvPolynomial.C c).support = if c = 0 then ∅ else {0}

theorem MvPolynomial.support_monomial_subset E1 #

∀ {R : Type u} {σ : Type u_1} {a : R} {s : σ →₀ ℕ} [inst : CommSemiring R], ((MvPolynomial.monomial s) a).support ⊆ {s}

theorem MvPolynomial.support_add E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p q : MvPolynomial σ R} [inst_1 : DecidableEq σ],
  (p + q).support ⊆ p.support ∪ q.support

theorem MvPolynomial.support_X E1 #

∀ {R : Type u} {σ : Type u_1} {n : σ} [inst : CommSemiring R] [Nontrivial R],
  (MvPolynomial.X n).support = {fun₀ | n => 1}

theorem MvPolynomial.support_X_pow E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [Nontrivial R] (s : σ) (n : ℕ),
  (MvPolynomial.X s ^ n).support = {fun₀ | s => n}

theorem MvPolynomial.support_zero E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R], MvPolynomial.support 0 = ∅

theorem MvPolynomial.support_one E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [Nontrivial R], MvPolynomial.support 1 = {0}

theorem MvPolynomial.support_smul E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {S₁ : Type u_2} [inst_1 : SMulZeroClass S₁ R] {a : S₁}
  {f : MvPolynomial σ R}, (a • f).support ⊆ f.support

theorem MvPolynomial.support_sum E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {α : Type u_2} [inst_1 : DecidableEq σ] {s : Finset α}
  {f : α → MvPolynomial σ R}, (∑ x ∈ s, f x).support ⊆ s.biUnion fun x ↦ (f x).support

theorem MvPolynomial.mem_support_iff E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p : MvPolynomial σ R} {m : σ →₀ ℕ}, m ∈ p.support ↔ p.coeff m ≠ 0

theorem MvPolynomial.notMem_support_iff E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p : MvPolynomial σ R} {m : σ →₀ ℕ}, m ∉ p.support ↔ p.coeff m = 0

theorem MvPolynomial.sum_def E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {A : Type u_2} [inst_1 : AddCommMonoid A] {p : MvPolynomial σ R}
  {b : (σ →₀ ℕ) → R → A}, p.coeff.sum b = ∑ m ∈ p.support, b m (p.coeff m)

theorem MvPolynomial.support_mul E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : DecidableEq σ] (p q : MvPolynomial σ R),
  (p * q).support ⊆ p.support + q.support

theorem MvPolynomial.disjoint_support_monomial E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {a : σ →₀ ℕ} {p : MvPolynomial σ R} {s : R},
  a ∉ p.support → s ≠ 0 → Disjoint ((MvPolynomial.monomial a) s).support p.support

theorem MvPolynomial.ext E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (p q : MvPolynomial σ R),
  (∀ (m : σ →₀ ℕ), p.coeff m = q.coeff m) → p = q

theorem MvPolynomial.ext_iff E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p q : MvPolynomial σ R},
  p = q ↔ ∀ (m : σ →₀ ℕ), p.coeff m = q.coeff m

theorem MvPolynomial.coeff_zero_X E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (i : σ), (MvPolynomial.X i).coeff 0 = 0

theorem MvPolynomial.coeff_addMonoidAlgebraMap E0 #

∀ {R : Type u} {S₁ : Type v} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : CommSemiring S₁] (g : S₁ →+ R)
  (φ : MvPolynomial σ S₁) (m : σ →₀ ℕ), (AddMonoidAlgebra.map g φ).coeff m = g (φ.coeff m)

def MvPolynomial.coeffAddMonoidHom E1 #

{R : Type u} → {σ : Type u_1} → [inst : CommSemiring R] → (σ →₀ ℕ) → MvPolynomial σ R →+ R

AddMonoidAlgebra.coeff · m but promoted to an AddMonoidHom.

theorem MvPolynomial.coeffAddMonoidHom_apply E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (m : σ →₀ ℕ) (x : MvPolynomial σ R),
  (MvPolynomial.coeffAddMonoidHom m) x = x.coeff m

def MvPolynomial.lcoeff E1 #

(R : Type u) → {σ : Type u_1} → [inst : CommSemiring R] → (σ →₀ ℕ) → MvPolynomial σ R →ₗ[R] R

AddMonoidAlgebra.coeff · m but promoted to a LinearMap.

theorem MvPolynomial.lcoeff_apply E0 #

∀ (R : Type u) {σ : Type u_1} [inst : CommSemiring R] (m : σ →₀ ℕ) (x : MvPolynomial σ R),
  (MvPolynomial.lcoeff R m) x = x.coeff m

theorem MvPolynomial.coeff_sum E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {X : Type u_2} (s : Finset X) (f : X → MvPolynomial σ R)
  (m : σ →₀ ℕ), (∑ x ∈ s, f x).coeff m = ∑ x ∈ s, (f x).coeff m

theorem MvPolynomial.monic_monomial_eq E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (m : σ →₀ ℕ),
  (MvPolynomial.monomial m) 1 = m.prod fun n e ↦ MvPolynomial.X n ^ e

theorem MvPolynomial.coeff_monomial E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : DecidableEq σ] (m n : σ →₀ ℕ) (a : R),
  ((MvPolynomial.monomial n) a).coeff m = if n = m then a else 0

theorem MvPolynomial.coeff_C E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : DecidableEq σ] (m : σ →₀ ℕ) (a : R),
  (MvPolynomial.C a).coeff m = if 0 = m then a else 0

theorem MvPolynomial.coeff_C_of_ne_zero E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {m : σ →₀ ℕ}, m ≠ 0 → ∀ (a : R), (MvPolynomial.C a).coeff m = 0

theorem MvPolynomial.coeff_add_single_C E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {n : ℕ} [NeZero n] {m : σ →₀ ℕ} (a : R) (i : σ),
  (MvPolynomial.C a).coeff (m + fun₀ | i => n) = 0

theorem MvPolynomial.coeff_one E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : DecidableEq σ] (m : σ →₀ ℕ),
  (AddMonoidAlgebra.coeff 1) m = if 0 = m then 1 else 0

theorem MvPolynomial.coeff_zero_C E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (a : R), (MvPolynomial.C a).coeff 0 = a

theorem MvPolynomial.coeff_X_pow E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : DecidableEq σ] (i : σ) (m : σ →₀ ℕ) (k : ℕ),
  (MvPolynomial.X i ^ k).coeff m = if (fun₀ | i => k) = m then 1 else 0

theorem MvPolynomial.coeff_X E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : DecidableEq σ] (i : σ) (m : σ →₀ ℕ),
  (MvPolynomial.X i).coeff m = if (fun₀ | i => 1) = m then 1 else 0

theorem MvPolynomial.coeff_X_same E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (i : σ), ((MvPolynomial.X i).coeff fun₀ | i => 1) = 1

theorem MvPolynomial.coeff_C_mul E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (m : σ →₀ ℕ) (a : R) (p : MvPolynomial σ R),
  (MvPolynomial.C a * p).coeff m = a * p.coeff m

theorem MvPolynomial.coeff_mul E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : DecidableEq σ] (p q : MvPolynomial σ R) (n : σ →₀ ℕ),
  (p * q).coeff n = ∑ x ∈ Finset.HasAntidiagonal.antidiagonal n, p.coeff x.1 * q.coeff x.2

theorem MvPolynomial.coeff_mul_monomial E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (m s : σ →₀ ℕ) (r : R) (p : MvPolynomial σ R),
  (p * (MvPolynomial.monomial s) r).coeff (m + s) = p.coeff m * r

theorem MvPolynomial.coeff_monomial_mul E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (m s : σ →₀ ℕ) (r : R) (p : MvPolynomial σ R),
  ((MvPolynomial.monomial s) r * p).coeff (s + m) = r * p.coeff m

theorem MvPolynomial.coeff_mul_X E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (m : σ →₀ ℕ) (s : σ) (p : MvPolynomial σ R),
  (p * MvPolynomial.X s).coeff (m + fun₀ | s => 1) = p.coeff m

theorem MvPolynomial.coeff_X_mul E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (m : σ →₀ ℕ) (s : σ) (p : MvPolynomial σ R),
  (MvPolynomial.X s * p).coeff ((fun₀ | s => 1) + m) = p.coeff m

theorem MvPolynomial.coeff_single_X_pow E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : DecidableEq σ] (s s' : σ) (n n' : ℕ),
  ((MvPolynomial.X s ^ n).coeff fun₀ | s' => n') = if s = s' ∧ n = n' ∨ n = 0 ∧ n' = 0 then 1 else 0

theorem MvPolynomial.coeff_single_X E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : DecidableEq σ] (s s' : σ) (n : ℕ),
  ((MvPolynomial.X s).coeff fun₀ | s' => n) = if n = 1 ∧ s = s' then 1 else 0

theorem MvPolynomial.coeff_prod_X_pow E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : DecidableEq σ] (d : σ →₀ ℕ) (x : σ → ℕ) (s : Finset σ),
  (∏ y ∈ s, MvPolynomial.X y ^ x y).coeff d = if d = Finsupp.indicator s fun i x_1 ↦ x i then 1 else 0

theorem MvPolynomial.support_mul_X E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (s : σ) (p : MvPolynomial σ R),
  (p * MvPolynomial.X s).support = Finset.map (addRightEmbedding fun₀ | s => 1) p.support

theorem MvPolynomial.support_X_mul E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (s : σ) (p : MvPolynomial σ R),
  (MvPolynomial.X s * p).support = Finset.map (addLeftEmbedding fun₀ | s => 1) p.support

theorem MvPolynomial.support_smul_eq E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {S : Type u_2} [inst_1 : Semiring S] [IsDomain S]
  [inst_3 : Module S R] [Module.IsTorsionFree S R] {a : S},
  a ≠ 0 → ∀ (p : MvPolynomial σ R), (a • p).support = p.support

theorem MvPolynomial.support_sdiff_support_subset_support_add E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : DecidableEq σ] (p q : MvPolynomial σ R),
  p.support \ q.support ⊆ (p + q).support

theorem MvPolynomial.support_symmDiff_support_subset_support_add E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : DecidableEq σ] (p q : MvPolynomial σ R),
  symmDiff p.support q.support ⊆ (p + q).support

theorem MvPolynomial.coeff_mul_monomial' E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (m s : σ →₀ ℕ) (r : R) (p : MvPolynomial σ R),
  (p * (MvPolynomial.monomial s) r).coeff m = if s ≤ m then p.coeff (m - s) * r else 0

theorem MvPolynomial.coeff_monomial_mul' E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (m s : σ →₀ ℕ) (r : R) (p : MvPolynomial σ R),
  ((MvPolynomial.monomial s) r * p).coeff m = if s ≤ m then r * p.coeff (m - s) else 0

theorem MvPolynomial.coeff_mul_X' E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : DecidableEq σ] (m : σ →₀ ℕ) (s : σ)
  (p : MvPolynomial σ R), (p * MvPolynomial.X s).coeff m = if s ∈ m.support then p.coeff (m - fun₀ | s => 1) else 0

theorem MvPolynomial.coeff_X_mul' E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : DecidableEq σ] (m : σ →₀ ℕ) (s : σ)
  (p : MvPolynomial σ R), (MvPolynomial.X s * p).coeff m = if s ∈ m.support then p.coeff (m - fun₀ | s => 1) else 0

theorem MvPolynomial.ne_zero_iff E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p : MvPolynomial σ R}, p ≠ 0 ↔ ∃ d, p.coeff d ≠ 0

theorem MvPolynomial.X_ne_zero E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [Nontrivial R] (s : σ), MvPolynomial.X s ≠ 0

theorem MvPolynomial.support_eq_empty E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p : MvPolynomial σ R}, p.support = ∅ ↔ p = 0

theorem MvPolynomial.support_nonempty E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p : MvPolynomial σ R}, p.support.Nonempty ↔ p ≠ 0

theorem MvPolynomial.exists_coeff_ne_zero E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p : MvPolynomial σ R}, p ≠ 0 → ∃ d, p.coeff d ≠ 0

theorem IsRegular.monomial E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {m : σ →₀ ℕ} {a : R},
  IsRegular a → IsRegular ((MvPolynomial.monomial m) a)

theorem MvPolynomial.monomial_one_mul_cancel_left_iff E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p q : MvPolynomial σ R} {m : σ →₀ ℕ},
  (MvPolynomial.monomial m) 1 * p = (MvPolynomial.monomial m) 1 * q ↔ p = q

theorem MvPolynomial.X_mul_cancel_left_iff E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p q : MvPolynomial σ R} {i : σ},
  MvPolynomial.X i * p = MvPolynomial.X i * q ↔ p = q

theorem MvPolynomial.monomial_one_mul_cancel_right_iff E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p q : MvPolynomial σ R} {m : σ →₀ ℕ},
  p * (MvPolynomial.monomial m) 1 = q * (MvPolynomial.monomial m) 1 ↔ p = q

theorem MvPolynomial.X_mul_cancel_right_iff E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p q : MvPolynomial σ R} {i : σ},
  p * MvPolynomial.X i = q * MvPolynomial.X i ↔ p = q

theorem MvPolynomial.C_dvd_iff_dvd_coeff E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (r : R) (φ : MvPolynomial σ R),
  MvPolynomial.C r ∣ φ ↔ ∀ (i : σ →₀ ℕ), r ∣ φ.coeff i

theorem MvPolynomial.isRegular_X E0 #

∀ {R : Type u} {σ : Type u_1} {n : σ} [inst : CommSemiring R], IsRegular (MvPolynomial.X n)

theorem MvPolynomial.isRegular_X_pow E0 #

∀ {R : Type u} {σ : Type u_1} {n : σ} [inst : CommSemiring R] (k : ℕ), IsRegular (MvPolynomial.X n ^ k)

theorem MvPolynomial.isRegular_prod_X E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (s : Finset σ), IsRegular (∏ n ∈ s, MvPolynomial.X n)

def MvPolynomial.coeffs E1 #

{R : Type u} → {σ : Type u_1} → [inst : CommSemiring R] → MvPolynomial σ R → Finset R

The finset of nonzero coefficients of a multivariate polynomial.

theorem MvPolynomial.coeffs_zero E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R], MvPolynomial.coeffs 0 = ∅

theorem MvPolynomial.coeffs_one E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R], MvPolynomial.coeffs 1 ⊆ {1}

theorem MvPolynomial.coeffs_eq_empty_of_subsingleton E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [Subsingleton R] (p : MvPolynomial σ R), p.coeffs = ∅

theorem MvPolynomial.coeffs_one_of_nontrivial E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [Nontrivial R], MvPolynomial.coeffs 1 = {1}

theorem MvPolynomial.mem_coeffs_iff E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p : MvPolynomial σ R} {c : R},
  c ∈ p.coeffs ↔ ∃ n ∈ p.support, c = p.coeff n

theorem MvPolynomial.coeff_mem_coeffs E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p : MvPolynomial σ R} (m : σ →₀ ℕ),
  p.coeff m ≠ 0 → p.coeff m ∈ p.coeffs

theorem MvPolynomial.zero_notMem_coeffs E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (p : MvPolynomial σ R), 0 ∉ p.coeffs

theorem MvPolynomial.coeffs_C E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : DecidableEq R] (r : R),
  (MvPolynomial.C r).coeffs = if r = 0 then ∅ else {r}

theorem MvPolynomial.coeffs_C_subset E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (r : R), (MvPolynomial.C r).coeffs ⊆ {r}

theorem MvPolynomial.coeffs_mul_X E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (p : MvPolynomial σ R) (n : σ),
  (p * MvPolynomial.X n).coeffs = p.coeffs

theorem MvPolynomial.coeffs_X_mul E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (p : MvPolynomial σ R) (n : σ),
  (MvPolynomial.X n * p).coeffs = p.coeffs

theorem MvPolynomial.coeffs_add E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : DecidableEq R] {p q : MvPolynomial σ R},
  Disjoint p.support q.support → (p + q).coeffs = p.coeffs ∪ q.coeffs

def MvPolynomial.constantCoeff E1 #

{R : Type u} → {σ : Type u_1} → [inst : CommSemiring R] → MvPolynomial σ R →+* R

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

theorem MvPolynomial.constantCoeff_eq E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (p : MvPolynomial σ R), MvPolynomial.constantCoeff p = p.coeff 0

theorem MvPolynomial.constantCoeff_C E0 #

∀ {R : Type u} (σ : Type u_1) [inst : CommSemiring R] (r : R), MvPolynomial.constantCoeff (MvPolynomial.C r) = r

theorem MvPolynomial.constantCoeff_X E0 #

∀ (R : Type u) {σ : Type u_1} [inst : CommSemiring R] (i : σ), MvPolynomial.constantCoeff (MvPolynomial.X i) = 0

theorem MvPolynomial.constantCoeff_smul E0 #

∀ {S₁ : Type v} {σ : Type u_1} [inst : CommSemiring S₁] {R : Type u_2} [inst_1 : SMulZeroClass R S₁] (a : R)
  (f : MvPolynomial σ S₁), MvPolynomial.constantCoeff (a • f) = a • MvPolynomial.constantCoeff f

theorem MvPolynomial.constantCoeff_monomial E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : DecidableEq σ] (d : σ →₀ ℕ) (r : R),
  MvPolynomial.constantCoeff ((MvPolynomial.monomial d) r) = if d = 0 then r else 0

theorem MvPolynomial.constantCoeff_comp_C E0 #

∀ (R : Type u) (σ : Type u_1) [inst : CommSemiring R], MvPolynomial.constantCoeff.comp MvPolynomial.C = RingHom.id R

theorem MvPolynomial.constantCoeff_comp_algebraMap E1 #

∀ (R : Type u) (σ : Type u_1) [inst : CommSemiring R],
  MvPolynomial.constantCoeff.comp (algebraMap R (MvPolynomial σ R)) = RingHom.id R

theorem MvPolynomial.support_sum_monomial_coeff E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (p : MvPolynomial σ R),
  ∑ v ∈ p.support, (MvPolynomial.monomial v) (p.coeff v) = p

theorem MvPolynomial.as_sum E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (p : MvPolynomial σ R),
  p = ∑ v ∈ p.support, (MvPolynomial.monomial v) (p.coeff v)

def MvPolynomial.coeffsIn E1 #

{R : Type u_2} →
  {S : Type u_3} →
    (σ : Type u_4) →
      [inst : CommSemiring R] →
        [inst_1 : CommSemiring S] → [inst_2 : Module R S] → Submodule R S → Submodule R (MvPolynomial σ S)

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

theorem MvPolynomial.coe_coeffsIn E0 #

∀ {R : Type u_2} {S : Type u_3} (σ : Type u_4) [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Module R S]
  (M : Submodule R S), ↑(MvPolynomial.coeffsIn σ M) = {p | ∀ (i : σ →₀ ℕ), p.coeff i ∈ M}

theorem MvPolynomial.mem_coeffsIn E0 #

∀ {R : Type u_2} {S : Type u_3} {σ : Type u_4} [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Module R S]
  {M : Submodule R S} {p : MvPolynomial σ S}, p ∈ MvPolynomial.coeffsIn σ M ↔ ∀ (i : σ →₀ ℕ), p.coeff i ∈ M

theorem MvPolynomial.monomial_mem_coeffsIn E0 #

∀ {R : Type u_2} {S : Type u_3} {σ : Type u_4} [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Module R S]
  {M : Submodule R S} {i : σ →₀ ℕ} {x : S}, (MvPolynomial.monomial i) x ∈ MvPolynomial.coeffsIn σ M ↔ x ∈ M

theorem MvPolynomial.C_mem_coeffsIn E0 #

∀ {R : Type u_2} {S : Type u_3} {σ : Type u_4} [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Module R S]
  {M : Submodule R S} {x : S}, MvPolynomial.C x ∈ MvPolynomial.coeffsIn σ M ↔ x ∈ M

theorem MvPolynomial.one_coeffsIn E0 #

∀ {R : Type u_2} {S : Type u_3} {σ : Type u_4} [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Module R S]
  {M : Submodule R S}, 1 ∈ MvPolynomial.coeffsIn σ M ↔ 1 ∈ M

theorem MvPolynomial.mul_monomial_mem_coeffsIn E0 #

∀ {R : Type u_2} {S : Type u_3} {σ : Type u_4} [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Module R S]
  {M : Submodule R S} {p : MvPolynomial σ S} {i : σ →₀ ℕ},
  p * (MvPolynomial.monomial i) 1 ∈ MvPolynomial.coeffsIn σ M ↔ p ∈ MvPolynomial.coeffsIn σ M

theorem MvPolynomial.monomial_mul_mem_coeffsIn E0 #

∀ {R : Type u_2} {S : Type u_3} {σ : Type u_4} [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Module R S]
  {M : Submodule R S} {p : MvPolynomial σ S} {i : σ →₀ ℕ},
  (MvPolynomial.monomial i) 1 * p ∈ MvPolynomial.coeffsIn σ M ↔ p ∈ MvPolynomial.coeffsIn σ M

theorem MvPolynomial.mul_X_mem_coeffsIn E0 #

∀ {R : Type u_2} {S : Type u_3} {σ : Type u_4} [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Module R S]
  {M : Submodule R S} {p : MvPolynomial σ S} {s : σ},
  p * MvPolynomial.X s ∈ MvPolynomial.coeffsIn σ M ↔ p ∈ MvPolynomial.coeffsIn σ M

theorem MvPolynomial.X_mul_mem_coeffsIn E0 #

∀ {R : Type u_2} {S : Type u_3} {σ : Type u_4} [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Module R S]
  {M : Submodule R S} {p : MvPolynomial σ S} {s : σ},
  MvPolynomial.X s * p ∈ MvPolynomial.coeffsIn σ M ↔ p ∈ MvPolynomial.coeffsIn σ M

theorem MvPolynomial.coeffsIn_eq_span_monomial E1 #

∀ {R : Type u_2} {S : Type u_3} {σ : Type u_4} [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Module R S]
  (M : Submodule R S), MvPolynomial.coeffsIn σ M = Submodule.span R {x | ∃ m ∈ M, ∃ i, (MvPolynomial.monomial i) m = x}

theorem MvPolynomial.coeffsIn_le E1 #

∀ {R : Type u_2} {S : Type u_3} {σ : Type u_4} [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Module R S]
  {M : Submodule R S} {N : Submodule R (MvPolynomial σ S)},
  MvPolynomial.coeffsIn σ M ≤ N ↔ ∀ m ∈ M, ∀ (i : σ →₀ ℕ), (MvPolynomial.monomial i) m ∈ N

theorem MvPolynomial.mem_coeffsIn_iff_coeffs_subset E0 #

∀ {R : Type u_2} {S : Type u_3} {σ : Type u_4} [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Module R S]
  {M : Submodule R S} {p : MvPolynomial σ S}, p ∈ MvPolynomial.coeffsIn σ M ↔ ↑p.coeffs ⊆ ↑M

theorem MvPolynomial.coeffsIn_mul E1 #

∀ {R : Type u_2} {S : Type u_3} {σ : Type u_4} [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Algebra R S]
  (M N : Submodule R S), MvPolynomial.coeffsIn σ (M * N) = MvPolynomial.coeffsIn σ M * MvPolynomial.coeffsIn σ N

theorem MvPolynomial.coeffsIn_pow E1 #

∀ {R : Type u_2} {S : Type u_3} {σ : Type u_4} [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Algebra R S]
  {n : ℕ}, n ≠ 0 → ∀ (M : Submodule R S), MvPolynomial.coeffsIn σ (M ^ n) = MvPolynomial.coeffsIn σ M ^ n

theorem MvPolynomial.le_coeffsIn_pow E1 #

∀ {R : Type u_2} {S : Type u_3} {σ : Type u_4} [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Algebra R S]
  {M : Submodule R S} {n : ℕ}, MvPolynomial.coeffsIn σ M ^ n ≤ MvPolynomial.coeffsIn σ (M ^ n)

def MvPolynomial.mvPolynomialInferBaseImpl E1 #

Mathlib.Tactic.Polynomial.PolynomialExt

Infer base ring for MvPolynomial _ R. Used by the polynomial tactic.

Deprecated aliases

NameNew nameSince
MvPolynomial.C_eq_coe_natMvPolynomial.C_eq_natCast2026-10-13
MvPolynomial.coeff_X'MvPolynomial.coeff_X2026-05-25
MvPolynomial.coeff_addAddMonoidAlgebra.coeff_add2026-07-06
MvPolynomial.coeff_smulAddMonoidAlgebra.coeff_smul2026-10-06
MvPolynomial.coeff_zeroAddMonoidAlgebra.coeff_zero2026-07-06
MvPolynomial.coeff_zero_oneAddMonoidAlgebra.coeff_one_zero2026-07-08
MvPolynomial.monomial_mulMvPolynomial.monomial_mul_monomial2026-08-08