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.Variables

38 declarations. Mathlib docs · Source

Variables of polynomials

This file establishes many results about the 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$.

Main declarations

  • MvPolynomial.vars p : the finset of variables occurring in p. For example if p = x⁴y+yz then vars p = {x, y, z}

Notation

As in other polynomial files, we typically use the 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.

  • r : R

  • i : σ, with corresponding monomial X i, often denoted X_i by mathematicians

  • p : MvPolynomial σ R

vars

vars and eval

def MvPolynomial.vars E1 #

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

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

theorem MvPolynomial.vars_def E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : DecidableEq σ] (p : MvPolynomial σ R),
  p.vars = p.degrees.toFinset

theorem MvPolynomial.coe_vars_subset_iff E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p : MvPolynomial σ R} {s : Set σ},
  ↑p.vars ⊆ s ↔ p ∈ (MvPolynomial.rename Subtype.val).range

theorem MvPolynomial.exists_rename_eq_of_vars_subset_range E1 #

∀ {R : Type u} {σ : Type u_1} {τ : Type u_2} [inst : CommSemiring R] (p : MvPolynomial σ R) (f : τ → σ),
  Function.Injective f → ↑p.vars ⊆ Set.range f → ∃ q, (MvPolynomial.rename f) q = p

theorem MvPolynomial.exists_rename_coe_vars_eq E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (p : MvPolynomial σ R),
  ∃ q, (MvPolynomial.rename Subtype.val) q = p

theorem MvPolynomial.vars_rename E1 #

∀ {R : Type u} {σ : Type u_1} {τ : Type u_2} [inst : CommSemiring R] [inst_1 : DecidableEq τ] (f : σ → τ)
  (φ : MvPolynomial σ R), ((MvPolynomial.rename f) φ).vars ⊆ Finset.image f φ.vars

theorem MvPolynomial.mem_vars_rename E0 #

∀ {R : Type u} {σ : Type u_1} {τ : Type u_2} [inst : CommSemiring R] (f : σ → τ) (φ : MvPolynomial σ R) {j : τ},
  j ∈ ((MvPolynomial.rename f) φ).vars → ∃ i ∈ φ.vars, f i = j

theorem MvPolynomial.vars_0 E0 #

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

theorem MvPolynomial.vars_monomial E0 #

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

theorem MvPolynomial.vars_C E0 #

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

theorem MvPolynomial.vars_X E0 #

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

theorem MvPolynomial.mem_vars_iff_mem_support E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p : MvPolynomial σ R} (i : σ),
  i ∈ p.vars ↔ ∃ d ∈ p.support, i ∈ d.support

theorem MvPolynomial.mem_vars_iff_degreeOf_ne_zero E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p : MvPolynomial σ R} {i : σ},
  i ∈ p.vars ↔ MvPolynomial.degreeOf i p ≠ 0

theorem MvPolynomial.mem_support_notMem_vars_zero E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {f : MvPolynomial σ R} {x : σ →₀ ℕ},
  x ∈ f.support → ∀ {v : σ}, v ∉ f.vars → x v = 0

theorem MvPolynomial.support_subset_vars_of_mem_support E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p : MvPolynomial σ R} {s : σ →₀ ℕ},
  s ∈ p.support → s.support ⊆ p.vars

theorem MvPolynomial.vars_eq_empty_iff_eq_C E1 #

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

theorem MvPolynomial.vars_add_subset E1 #

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

theorem MvPolynomial.vars_add_of_disjoint E1 #

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

theorem MvPolynomial.vars_mul E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : DecidableEq σ] (φ ψ : MvPolynomial σ R),
  (φ * ψ).vars ⊆ φ.vars ∪ ψ.vars

theorem MvPolynomial.vars_one E0 #

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

theorem MvPolynomial.vars_pow E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (φ : MvPolynomial σ R) (n : ℕ), (φ ^ n).vars ⊆ φ.vars

theorem MvPolynomial.vars_prod E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {ι : Type u_3} [inst_1 : DecidableEq σ] {s : Finset ι}
  (f : ι → MvPolynomial σ R), (∏ i ∈ s, f i).vars ⊆ s.biUnion fun i ↦ (f i).vars

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 E1 #

∀ {σ : Type u_1} {A : Type u_3} [inst : CommRing A] [NoZeroDivisors A] (a : A),
  a ≠ 0 → ∀ (φ : MvPolynomial σ A), (MvPolynomial.C a * φ).vars = φ.vars

theorem MvPolynomial.vars_sum_subset E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {ι : Type u_3} (t : Finset ι) (φ : ι → MvPolynomial σ R)
  [inst_1 : DecidableEq σ], (∑ i ∈ t, φ i).vars ⊆ t.biUnion fun i ↦ (φ i).vars

theorem MvPolynomial.vars_sum_of_disjoint E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {ι : Type u_3} (t : Finset ι) (φ : ι → MvPolynomial σ R)
  [inst_1 : DecidableEq σ],
  Pairwise (Function.onFun Disjoint fun i ↦ (φ i).vars) → (∑ i ∈ t, φ i).vars = t.biUnion fun i ↦ (φ i).vars

theorem MvPolynomial.vars_map E1 #

∀ {R : Type u} {S : Type v} {σ : Type u_1} [inst : CommSemiring R] (p : MvPolynomial σ R) [inst_1 : CommSemiring S]
  (f : R →+* S), ((MvPolynomial.map f) p).vars ⊆ p.vars

theorem MvPolynomial.vars_map_of_injective E1 #

∀ {R : Type u} {S : Type v} {σ : Type u_1} [inst : CommSemiring R] (p : MvPolynomial σ R) [inst_1 : CommSemiring S]
  {f : R →+* S}, Function.Injective ⇑f → ((MvPolynomial.map f) p).vars = p.vars

theorem MvPolynomial.vars_monomial_single E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (i : σ) {e : ℕ} {r : R},
  e ≠ 0 → r ≠ 0 → ((MvPolynomial.monomial fun₀ | i => e) r).vars = {i}

theorem MvPolynomial.vars_eq_support_biUnion_support E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (p : MvPolynomial σ R) [inst_1 : DecidableEq σ],
  p.vars = p.support.biUnion Finsupp.support

theorem MvPolynomial.eval₂Hom_congr' E1 #

∀ {R : Type u} {S : Type v} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : CommSemiring S] {f₁ f₂ : R →+* S}
  {g₁ g₂ : σ → S} {p₁ p₂ : MvPolynomial σ R},
  f₁ = f₂ →
    (∀ i ∈ p₁.vars, i ∈ p₂.vars → g₁ i = g₂ i) →
      p₁ = p₂ → (MvPolynomial.eval₂Hom f₁ g₁) p₁ = (MvPolynomial.eval₂Hom f₂ g₂) p₂

theorem MvPolynomial.eval₂Hom_eq_constantCoeff_of_vars E1 #

∀ {R : Type u} {S : Type v} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : CommSemiring S] (f : R →+* S) {g : σ → S}
  {p : MvPolynomial σ R}, (∀ i ∈ p.vars, g i = 0) → (MvPolynomial.eval₂Hom f g) p = f (MvPolynomial.constantCoeff p)

theorem MvPolynomial.aeval_eq_constantCoeff_of_vars E1 #

∀ {R : Type u} {S : Type v} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : CommSemiring S] [inst_2 : Algebra R S]
  {g : σ → S} {p : MvPolynomial σ R},
  (∀ i ∈ p.vars, g i = 0) → (MvPolynomial.aeval g) p = (algebraMap R S) (MvPolynomial.constantCoeff p)

theorem MvPolynomial.hom_congr_vars E1 #

∀ {R : Type u} {S : Type v} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : CommSemiring S]
  {f₁ f₂ : MvPolynomial σ R →+* S} {p₁ p₂ : MvPolynomial σ R},
  f₁.comp MvPolynomial.C = f₂.comp MvPolynomial.C →
    (∀ i ∈ p₁.vars, i ∈ p₂.vars → f₁ (MvPolynomial.X i) = f₂ (MvPolynomial.X i)) → 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.aeval_ite_mem_eq E0 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (q : MvPolynomial σ R) (s : Set σ)
  [inst_1 : DecidablePred fun x ↦ x ∈ s] [inst_2 : DecidablePred fun x ↦ ↑x.support ⊆ s],
  (MvPolynomial.aeval fun i ↦ if i ∈ s then MvPolynomial.X i else 0) q =
    ∑ x ∈ q.support, if ↑x.support ⊆ s then (MvPolynomial.monomial x) (q.coeff x) else 0

theorem MvPolynomial.aeval_ite_mem_eq_self E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] (q : MvPolynomial σ R) {s : Set σ},
  ↑q.vars ⊆ s →
    ∀ [inst_1 : (i : σ) → Decidable (i ∈ s)], (MvPolynomial.aeval fun i ↦ if i ∈ s then MvPolynomial.X i else 0) q = q

theorem MvPolynomial.leadingCoeff_toLex E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] {p : MvPolynomial σ R} [inst_1 : LinearOrder σ],
  AddMonoidAlgebra.leadingCoeff (⇑toLex) p = p.coeff (ofLex (AddMonoidAlgebra.supDegree (⇑toLex) p))

theorem MvPolynomial.supDegree_toLex_C E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : LinearOrder σ] (r : R),
  AddMonoidAlgebra.supDegree (⇑toLex) (MvPolynomial.C r) = 0

theorem MvPolynomial.leadingCoeff_toLex_C E1 #

∀ {R : Type u} {σ : Type u_1} [inst : CommSemiring R] [inst_1 : LinearOrder σ] (r : R),
  AddMonoidAlgebra.leadingCoeff (⇑toLex) (MvPolynomial.C r) = r