Documentation

Mathlib.Data.MvPolynomial.Variables

Degrees and variables of polynomials #

This file establishes many results about the degree and variable sets of a multivariate polynomial.

The variable set of a polynomial $P \in R[X]$ is a Finset containing each $x \in X$ that appears in a monomial in $P$.

The degree set of a polynomial $P \in R[X]$ is a Multiset containing, for each $x$ in the variable set, $n$ copies of $x$, where $n$ is the maximum number of copies of $x$ appearing in a monomial of $P$.

Main declarations #

Notation #

As in other polynomial files, we typically use the notation:

degrees #

def MvPolynomial.degrees {R : Type u} {σ : Type u_1} [CommSemiring R] (p : MvPolynomial σ R) :

The maximal degrees of each variable in a multi-variable polynomial, expressed as a multiset.

(For example, degrees (x^2 * y + y^3) would be {x, x, y, y, y}.)

Equations
Instances For
    theorem MvPolynomial.degrees_def {R : Type u} {σ : Type u_1} [CommSemiring R] [DecidableEq σ] (p : MvPolynomial σ R) :
    MvPolynomial.degrees p = Finset.sup (MvPolynomial.support p) fun (s : σ →₀ ) => Finsupp.toMultiset s
    theorem MvPolynomial.degrees_monomial {R : Type u} {σ : Type u_1} [CommSemiring R] (s : σ →₀ ) (a : R) :
    MvPolynomial.degrees ((MvPolynomial.monomial s) a) Finsupp.toMultiset s
    theorem MvPolynomial.degrees_monomial_eq {R : Type u} {σ : Type u_1} [CommSemiring R] (s : σ →₀ ) (a : R) (ha : a 0) :
    MvPolynomial.degrees ((MvPolynomial.monomial s) a) = Finsupp.toMultiset s
    theorem MvPolynomial.degrees_C {R : Type u} {σ : Type u_1} [CommSemiring R] (a : R) :
    MvPolynomial.degrees (MvPolynomial.C a) = 0
    @[simp]
    theorem MvPolynomial.degrees_X {R : Type u} {σ : Type u_1} [CommSemiring R] [Nontrivial R] (n : σ) :
    @[simp]
    @[simp]
    theorem MvPolynomial.degrees_sum {R : Type u} {σ : Type u_1} [CommSemiring R] {ι : Type u_3} [DecidableEq σ] (s : Finset ι) (f : ιMvPolynomial σ R) :
    MvPolynomial.degrees (Finset.sum s fun (i : ι) => f i) Finset.sup s fun (i : ι) => MvPolynomial.degrees (f i)
    theorem MvPolynomial.degrees_prod {R : Type u} {σ : Type u_1} [CommSemiring R] {ι : Type u_3} (s : Finset ι) (f : ιMvPolynomial σ R) :
    MvPolynomial.degrees (Finset.prod s fun (i : ι) => f i) Finset.sum s fun (i : ι) => MvPolynomial.degrees (f i)
    theorem MvPolynomial.mem_degrees {R : Type u} {σ : Type u_1} [CommSemiring R] {p : MvPolynomial σ R} {i : σ} :
    i MvPolynomial.degrees p ∃ (d : σ →₀ ), MvPolynomial.coeff d p 0 i d.support
    theorem MvPolynomial.degrees_rename {R : Type u} {σ : Type u_1} {τ : Type u_2} [CommSemiring R] (f : στ) (φ : MvPolynomial σ R) :

    vars #

    def MvPolynomial.vars {R : Type u} {σ : Type u_1} [CommSemiring R] (p : MvPolynomial σ R) :

    vars p is the set of variables appearing in the polynomial p

    Equations
    Instances For
      @[simp]
      theorem MvPolynomial.vars_0 {R : Type u} {σ : Type u_1} [CommSemiring R] :
      @[simp]
      theorem MvPolynomial.vars_monomial {R : Type u} {σ : Type u_1} {r : R} {s : σ →₀ } [CommSemiring R] (h : r 0) :
      @[simp]
      theorem MvPolynomial.vars_C {R : Type u} {σ : Type u_1} {r : R} [CommSemiring R] :
      MvPolynomial.vars (MvPolynomial.C r) =
      @[simp]
      theorem MvPolynomial.vars_X {R : Type u} {σ : Type u_1} {n : σ} [CommSemiring R] [Nontrivial R] :
      theorem MvPolynomial.mem_vars {R : Type u} {σ : Type u_1} [CommSemiring R] {p : MvPolynomial σ R} (i : σ) :
      i MvPolynomial.vars p ∃ d ∈ MvPolynomial.support p, i d.support
      theorem MvPolynomial.mem_support_not_mem_vars_zero {R : Type u} {σ : Type u_1} [CommSemiring R] {f : MvPolynomial σ R} {x : σ →₀ } (H : x MvPolynomial.support f) {v : σ} (h : vMvPolynomial.vars f) :
      x v = 0
      @[simp]
      theorem MvPolynomial.vars_pow {R : Type u} {σ : Type u_1} [CommSemiring R] (φ : MvPolynomial σ R) (n : ) :
      theorem MvPolynomial.vars_prod {R : Type u} {σ : Type u_1} [CommSemiring R] {ι : Type u_3} [DecidableEq σ] {s : Finset ι} (f : ιMvPolynomial σ R) :
      MvPolynomial.vars (Finset.prod s fun (i : ι) => f i) Finset.biUnion s fun (i : ι) => MvPolynomial.vars (f i)

      The variables of the product of a family of polynomials are a subset of the union of the sets of variables of each polynomial.

      theorem MvPolynomial.vars_C_mul {σ : Type u_1} {A : Type u_3} [CommRing A] [IsDomain A] (a : A) (ha : a 0) (φ : MvPolynomial σ A) :
      MvPolynomial.vars (MvPolynomial.C a * φ) = MvPolynomial.vars φ
      theorem MvPolynomial.vars_sum_subset {R : Type u} {σ : Type u_1} [CommSemiring R] {ι : Type u_3} (t : Finset ι) (φ : ιMvPolynomial σ R) [DecidableEq σ] :
      MvPolynomial.vars (Finset.sum t fun (i : ι) => φ i) Finset.biUnion t fun (i : ι) => MvPolynomial.vars (φ i)
      theorem MvPolynomial.vars_sum_of_disjoint {R : Type u} {σ : Type u_1} [CommSemiring R] {ι : Type u_3} (t : Finset ι) (φ : ιMvPolynomial σ R) [DecidableEq σ] (h : Pairwise (Disjoint on fun (i : ι) => MvPolynomial.vars (φ i))) :
      MvPolynomial.vars (Finset.sum t fun (i : ι) => φ i) = Finset.biUnion t fun (i : ι) => MvPolynomial.vars (φ i)
      theorem MvPolynomial.vars_monomial_single {R : Type u} {σ : Type u_1} [CommSemiring R] (i : σ) {e : } {r : R} (he : e 0) (hr : r 0) :

      degreeOf #

      def MvPolynomial.degreeOf {R : Type u} {σ : Type u_1} [CommSemiring R] (n : σ) (p : MvPolynomial σ R) :

      degreeOf n p gives the highest power of X_n that appears in p

      Equations
      Instances For
        theorem MvPolynomial.degreeOf_eq_sup {R : Type u} {σ : Type u_1} [CommSemiring R] (n : σ) (f : MvPolynomial σ R) :
        theorem MvPolynomial.degreeOf_lt_iff {R : Type u} {σ : Type u_1} [CommSemiring R] {n : σ} {f : MvPolynomial σ R} {d : } (h : 0 < d) :
        theorem MvPolynomial.degreeOf_le_iff {R : Type u} {σ : Type u_1} [CommSemiring R] {n : σ} {f : MvPolynomial σ R} {d : } :
        @[simp]
        theorem MvPolynomial.degreeOf_zero {R : Type u} {σ : Type u_1} [CommSemiring R] (n : σ) :
        @[simp]
        theorem MvPolynomial.degreeOf_C {R : Type u} {σ : Type u_1} [CommSemiring R] (a : R) (x : σ) :
        MvPolynomial.degreeOf x (MvPolynomial.C a) = 0
        theorem MvPolynomial.degreeOf_X {R : Type u} {σ : Type u_1} [CommSemiring R] [DecidableEq σ] (i : σ) (j : σ) [Nontrivial R] :
        MvPolynomial.degreeOf i (MvPolynomial.X j) = if i = j then 1 else 0
        theorem MvPolynomial.monomial_le_degreeOf {R : Type u} {σ : Type u_1} [CommSemiring R] (i : σ) {f : MvPolynomial σ R} {m : σ →₀ } (h_m : m MvPolynomial.support f) :
        theorem MvPolynomial.degreeOf_mul_X_ne {R : Type u} {σ : Type u_1} [CommSemiring R] {i : σ} {j : σ} (f : MvPolynomial σ R) (h : i j) :
        theorem MvPolynomial.degreeOf_rename_of_injective {R : Type u} {σ : Type u_1} {τ : Type u_2} [CommSemiring R] {p : MvPolynomial σ R} {f : στ} (h : Function.Injective f) (i : σ) :

        totalDegree #

        def MvPolynomial.totalDegree {R : Type u} {σ : Type u_1} [CommSemiring R] (p : MvPolynomial σ R) :

        totalDegree p gives the maximum |s| over the monomials X^s in p

        Equations
        Instances For
          theorem MvPolynomial.totalDegree_eq {R : Type u} {σ : Type u_1} [CommSemiring R] (p : MvPolynomial σ R) :
          MvPolynomial.totalDegree p = Finset.sup (MvPolynomial.support p) fun (m : σ →₀ ) => Multiset.card (Finsupp.toMultiset m)
          theorem MvPolynomial.le_totalDegree {R : Type u} {σ : Type u_1} [CommSemiring R] {p : MvPolynomial σ R} {s : σ →₀ } (h : s MvPolynomial.support p) :
          (Finsupp.sum s fun (x : σ) (e : ) => e) MvPolynomial.totalDegree p
          @[simp]
          theorem MvPolynomial.totalDegree_C {R : Type u} {σ : Type u_1} [CommSemiring R] (a : R) :
          MvPolynomial.totalDegree (MvPolynomial.C a) = 0
          @[simp]
          @[simp]
          theorem MvPolynomial.totalDegree_monomial {R : Type u} {σ : Type u_1} [CommSemiring R] (s : σ →₀ ) {c : R} (hc : c 0) :
          @[simp]
          theorem MvPolynomial.totalDegree_list_prod {R : Type u} {σ : Type u_1} [CommSemiring R] (s : List (MvPolynomial σ R)) :
          MvPolynomial.totalDegree (List.prod s) List.sum (List.map MvPolynomial.totalDegree s)
          theorem MvPolynomial.totalDegree_finset_prod {R : Type u} {σ : Type u_1} [CommSemiring R] {ι : Type u_3} (s : Finset ι) (f : ιMvPolynomial σ R) :
          theorem MvPolynomial.totalDegree_finset_sum {R : Type u} {σ : Type u_1} [CommSemiring R] {ι : Type u_3} (s : Finset ι) (f : ιMvPolynomial σ R) :
          theorem MvPolynomial.exists_degree_lt {R : Type u} {σ : Type u_1} [CommSemiring R] [Fintype σ] (f : MvPolynomial σ R) (n : ) (h : MvPolynomial.totalDegree f < n * Fintype.card σ) {d : σ →₀ } (hd : d MvPolynomial.support f) :
          ∃ (i : σ), d i < n
          theorem MvPolynomial.coeff_eq_zero_of_totalDegree_lt {R : Type u} {σ : Type u_1} [CommSemiring R] {f : MvPolynomial σ R} {d : σ →₀ } (h : MvPolynomial.totalDegree f < Finset.sum d.support fun (i : σ) => d i) :

          vars and eval #

          theorem MvPolynomial.eval₂Hom_eq_constantCoeff_of_vars {R : Type u} {S : Type v} {σ : Type u_1} [CommSemiring R] [CommSemiring S] (f : R →+* S) {g : σS} {p : MvPolynomial σ R} (hp : iMvPolynomial.vars p, g i = 0) :
          (MvPolynomial.eval₂Hom f g) p = f (MvPolynomial.constantCoeff p)
          theorem MvPolynomial.aeval_eq_constantCoeff_of_vars {R : Type u} {S : Type v} {σ : Type u_1} [CommSemiring R] [CommSemiring S] [Algebra R S] {g : σS} {p : MvPolynomial σ R} (hp : iMvPolynomial.vars p, g i = 0) :
          (MvPolynomial.aeval g) p = (algebraMap R S) (MvPolynomial.constantCoeff p)
          theorem MvPolynomial.eval₂Hom_congr' {R : Type u} {S : Type v} {σ : Type u_1} [CommSemiring R] [CommSemiring S] {f₁ : R →+* S} {f₂ : R →+* S} {g₁ : σS} {g₂ : σS} {p₁ : MvPolynomial σ R} {p₂ : MvPolynomial σ R} :
          f₁ = f₂(iMvPolynomial.vars p₁, i MvPolynomial.vars p₂g₁ i = g₂ i)p₁ = p₂(MvPolynomial.eval₂Hom f₁ g₁) p₁ = (MvPolynomial.eval₂Hom f₂ g₂) p₂
          theorem MvPolynomial.hom_congr_vars {R : Type u} {S : Type v} {σ : Type u_1} [CommSemiring R] [CommSemiring S] {f₁ : MvPolynomial σ R →+* S} {f₂ : MvPolynomial σ R →+* S} {p₁ : MvPolynomial σ R} {p₂ : MvPolynomial σ R} (hC : RingHom.comp f₁ MvPolynomial.C = RingHom.comp f₂ MvPolynomial.C) (hv : iMvPolynomial.vars p₁, i MvPolynomial.vars p₂f₁ (MvPolynomial.X i) = f₂ (MvPolynomial.X i)) (hp : p₁ = p₂) :
          f₁ p₁ = f₂ p₂

          If f₁ and f₂ are ring homs out of the polynomial ring and p₁ and p₂ are polynomials, then f₁ p₁ = f₂ p₂ if p₁ = p₂ and f₁ and f₂ are equal on R and on the variables of p₁.

          theorem MvPolynomial.exists_rename_eq_of_vars_subset_range {R : Type u} {σ : Type u_1} {τ : Type u_2} [CommSemiring R] (p : MvPolynomial σ R) (f : τσ) (hfi : Function.Injective f) (hf : (MvPolynomial.vars p) Set.range f) :
          ∃ (q : MvPolynomial τ R), (MvPolynomial.rename f) q = p
          theorem MvPolynomial.vars_rename {R : Type u} {σ : Type u_1} {τ : Type u_2} [CommSemiring R] [DecidableEq τ] (f : στ) (φ : MvPolynomial σ R) :
          theorem MvPolynomial.mem_vars_rename {R : Type u} {σ : Type u_1} {τ : Type u_2} [CommSemiring R] (f : στ) (φ : MvPolynomial σ R) {j : τ} (h : j MvPolynomial.vars ((MvPolynomial.rename f) φ)) :
          ∃ i ∈ MvPolynomial.vars φ, f i = j