File: Mathlib/Algebra/MvPolynomial/Degrees.lean

full_name: MvPolynomial.degrees
code: /-- 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}`.)
-/
def degrees (p : MvPolynomial σ R) : Multiset σ 
goal: Multiset σ

full_name: MvPolynomial.degrees_def
code: theorem degrees_def [DecidableEq σ] (p : MvPolynomial σ R) :
    p.degrees = p.support.sup fun s : σ →₀ ℕ => Finsupp.toMultiset s 
goal: p.degrees = p.support.sup fun s => Finsupp.toMultiset s

full_name: MvPolynomial.degrees_monomial
code: theorem degrees_monomial (s : σ →₀ ℕ) (a : R) : degrees (monomial s a) ≤ toMultiset s 
goal: ((MvPolynomial.monomial s) a).degrees ≤ Finsupp.toMultiset s

full_name: MvPolynomial.degrees_monomial_eq
code: theorem degrees_monomial_eq (s : σ →₀ ℕ) (a : R) (ha : a ≠ 0) :
    degrees (monomial s a) = toMultiset s 
goal: ((MvPolynomial.monomial s) a).degrees = Finsupp.toMultiset s

full_name: MvPolynomial.degrees_C
code: theorem degrees_C (a : R) : degrees (C a : MvPolynomial σ R) = 0 
goal: (MvPolynomial.C a).degrees = 0

full_name: MvPolynomial.degrees_X'
code: theorem degrees_X' (n : σ) : degrees (X n : MvPolynomial σ R) ≤ {n} 
goal: (MvPolynomial.X n).degrees ≤ {n}

full_name: MvPolynomial.degrees_X
code: @[simp]
theorem degrees_X [Nontrivial R] (n : σ) : degrees (X n : MvPolynomial σ R) = {n} 
goal: (MvPolynomial.X n).degrees = {n}

full_name: MvPolynomial.degrees_zero
code: @[simp]
theorem degrees_zero : degrees (0 : MvPolynomial σ R) = 0 
goal: MvPolynomial.degrees 0 = 0

full_name: MvPolynomial.degrees_one
code: @[simp]
theorem degrees_one : degrees (1 : MvPolynomial σ R) = 0 
goal: MvPolynomial.degrees 1 = 0

full_name: MvPolynomial.degrees_add
code: theorem degrees_add [DecidableEq σ] (p q : MvPolynomial σ R) :
    (p + q).degrees ≤ p.degrees ⊔ q.degrees 
goal: (p + q).degrees ≤ p.degrees ⊔ q.degrees

full_name: MvPolynomial.degrees_sum
code: theorem degrees_sum {ι : Type*} [DecidableEq σ] (s : Finset ι) (f : ι → MvPolynomial σ R) :
    (∑ i ∈ s, f i).degrees ≤ s.sup fun i => (f i).degrees 
goal: (∑ i ∈ s, f i).degrees ≤ s.sup fun i => (f i).degrees

full_name: MvPolynomial.degrees_mul
code: theorem degrees_mul (p q : MvPolynomial σ R) : (p * q).degrees ≤ p.degrees + q.degrees 
goal: (p * q).degrees ≤ p.degrees + q.degrees

full_name: MvPolynomial.degrees_prod
code: theorem degrees_prod {ι : Type*} (s : Finset ι) (f : ι → MvPolynomial σ R) :
    (∏ i ∈ s, f i).degrees ≤ ∑ i ∈ s, (f i).degrees 
goal: (∏ i ∈ s, f i).degrees ≤ ∑ i ∈ s, (f i).degrees

full_name: MvPolynomial.degrees_pow
code: theorem degrees_pow (p : MvPolynomial σ R) (n : ℕ) : (p ^ n).degrees ≤ n • p.degrees 
goal: (p ^ n).degrees ≤ n • p.degrees

full_name: MvPolynomial.mem_degrees
code: theorem mem_degrees {p : MvPolynomial σ R} {i : σ} :
    i ∈ p.degrees ↔ ∃ d, p.coeff d ≠ 0 ∧ i ∈ d.support 
goal: i ∈ p.degrees ↔ ∃ d, MvPolynomial.coeff d p ≠ 0 ∧ i ∈ d.support

full_name: MvPolynomial.le_degrees_add
code: theorem le_degrees_add {p q : MvPolynomial σ R} (h : p.degrees.Disjoint q.degrees) :
    p.degrees ≤ (p + q).degrees 
goal: p.degrees ≤ (p + q).degrees

full_name: MvPolynomial.degrees_add_of_disjoint
code: theorem degrees_add_of_disjoint [DecidableEq σ] {p q : MvPolynomial σ R}
    (h : Multiset.Disjoint p.degrees q.degrees) : (p + q).degrees = p.degrees ∪ q.degrees 
goal: (p + q).degrees = p.degrees ∪ q.degrees

full_name: MvPolynomial.degrees_map
code: theorem degrees_map [CommSemiring S] (p : MvPolynomial σ R) (f : R →+* S) :
    (map f p).degrees ⊆ p.degrees 
goal: ((MvPolynomial.map f) p).degrees ⊆ p.degrees

full_name: MvPolynomial.degrees_rename
code: theorem degrees_rename (f : σ → τ) (φ : MvPolynomial σ R) :
    (rename f φ).degrees ⊆ φ.degrees.map f 
goal: ((MvPolynomial.rename f) φ).degrees ⊆ Multiset.map f φ.degrees

full_name: MvPolynomial.degrees_map_of_injective
code: theorem degrees_map_of_injective [CommSemiring S] (p : MvPolynomial σ R) {f : R →+* S}
    (hf : Injective f) : (map f p).degrees = p.degrees 
goal: ((MvPolynomial.map f) p).degrees = p.degrees

full_name: MvPolynomial.degrees_rename_of_injective
code: theorem degrees_rename_of_injective {p : MvPolynomial σ R} {f : σ → τ} (h : Function.Injective f) :
    degrees (rename f p) = (degrees p).map f 
goal: ((MvPolynomial.rename f) p).degrees = Multiset.map f p.degrees

full_name: MvPolynomial.degreeOf
code: /-- `degreeOf n p` gives the highest power of X_n that appears in `p` -/
def degreeOf (n : σ) (p : MvPolynomial σ R) : ℕ 
goal: ℕ

full_name: MvPolynomial.degreeOf_def
code: theorem degreeOf_def [DecidableEq σ] (n : σ) (p : MvPolynomial σ R) :
    p.degreeOf n = p.degrees.count n 
goal: MvPolynomial.degreeOf n p = Multiset.count n p.degrees

full_name: MvPolynomial.degreeOf_eq_sup
code: theorem degreeOf_eq_sup (n : σ) (f : MvPolynomial σ R) :
    degreeOf n f = f.support.sup fun m => m n 
goal: MvPolynomial.degreeOf n f = f.support.sup fun m => m n

full_name: MvPolynomial.degreeOf_lt_iff
code: theorem degreeOf_lt_iff {n : σ} {f : MvPolynomial σ R} {d : ℕ} (h : 0 < d) :
    degreeOf n f < d ↔ ∀ m : σ →₀ ℕ, m ∈ f.support → m n < d 
goal: MvPolynomial.degreeOf n f < d ↔ ∀ m ∈ f.support, m n < d

full_name: MvPolynomial.degreeOf_le_iff
code: lemma degreeOf_le_iff {n : σ} {f : MvPolynomial σ R} {d : ℕ} :
    degreeOf n f ≤ d ↔ ∀ m ∈ support f, m n ≤ d 
goal: MvPolynomial.degreeOf n f ≤ d ↔ ∀ m ∈ f.support, m n ≤ d

full_name: MvPolynomial.degreeOf_zero
code: @[simp]
theorem degreeOf_zero (n : σ) : degreeOf n (0 : MvPolynomial σ R) = 0 
goal: MvPolynomial.degreeOf n 0 = 0

full_name: MvPolynomial.degreeOf_C
code: @[simp]
theorem degreeOf_C (a : R) (x : σ) : degreeOf x (C a : MvPolynomial σ R) = 0 
goal: MvPolynomial.degreeOf x (MvPolynomial.C a) = 0

full_name: MvPolynomial.degreeOf_X
code: theorem degreeOf_X [DecidableEq σ] (i j : σ) [Nontrivial R] :
    degreeOf i (X j : MvPolynomial σ R) = if i = j then 1 else 0 
goal: MvPolynomial.degreeOf i (MvPolynomial.X j) = if i = j then 1 else 0

full_name: MvPolynomial.degreeOf_add_le
code: theorem degreeOf_add_le (n : σ) (f g : MvPolynomial σ R) :
    degreeOf n (f + g) ≤ max (degreeOf n f) (degreeOf n g) 
goal: MvPolynomial.degreeOf n (f + g) ≤ max (MvPolynomial.degreeOf n f) (MvPolynomial.degreeOf n g)

full_name: MvPolynomial.monomial_le_degreeOf
code: theorem monomial_le_degreeOf (i : σ) {f : MvPolynomial σ R} {m : σ →₀ ℕ} (h_m : m ∈ f.support) :
    m i ≤ degreeOf i f 
goal: m i ≤ MvPolynomial.degreeOf i f

full_name: MvPolynomial.degreeOf_mul_le
code: theorem degreeOf_mul_le (i : σ) (f g : MvPolynomial σ R) :
    degreeOf i (f * g) ≤ degreeOf i f + degreeOf i g 
goal: MvPolynomial.degreeOf i (f * g) ≤ MvPolynomial.degreeOf i f + MvPolynomial.degreeOf i g

full_name: MvPolynomial.degreeOf_mul_X_ne
code: theorem degreeOf_mul_X_ne {i j : σ} (f : MvPolynomial σ R) (h : i ≠ j) :
    degreeOf i (f * X j) = degreeOf i f 
goal: MvPolynomial.degreeOf i (f * MvPolynomial.X j) = MvPolynomial.degreeOf i f

full_name: MvPolynomial.degreeOf_mul_X_eq
code: theorem degreeOf_mul_X_eq (j : σ) (f : MvPolynomial σ R) :
    degreeOf j (f * X j) ≤ degreeOf j f + 1 
goal: MvPolynomial.degreeOf j (f * MvPolynomial.X j) ≤ MvPolynomial.degreeOf j f + 1

full_name: MvPolynomial.degreeOf_C_mul_le
code: theorem degreeOf_C_mul_le (p : MvPolynomial σ R) (i : σ) (c : R) :
    (C c * p).degreeOf i ≤ p.degreeOf i 
goal: MvPolynomial.degreeOf i (MvPolynomial.C c * p) ≤ MvPolynomial.degreeOf i p

full_name: MvPolynomial.degreeOf_mul_C_le
code: theorem degreeOf_mul_C_le (p : MvPolynomial σ R) (i : σ) (c : R) :
    (p * C c).degreeOf i ≤ p.degreeOf i 
goal: MvPolynomial.degreeOf i (p * MvPolynomial.C c) ≤ MvPolynomial.degreeOf i p

full_name: MvPolynomial.degreeOf_rename_of_injective
code: theorem degreeOf_rename_of_injective {p : MvPolynomial σ R} {f : σ → τ} (h : Function.Injective f)
    (i : σ) : degreeOf (f i) (rename f p) = degreeOf i p 
goal: MvPolynomial.degreeOf (f i) ((MvPolynomial.rename f) p) = MvPolynomial.degreeOf i p

full_name: MvPolynomial.totalDegree
code: /-- `totalDegree p` gives the maximum |s| over the monomials X^s in `p` -/
def totalDegree (p : MvPolynomial σ R) : ℕ 
goal: ℕ

full_name: MvPolynomial.totalDegree_eq
code: theorem totalDegree_eq (p : MvPolynomial σ R) :
    p.totalDegree = p.support.sup fun m => Multiset.card (toMultiset m) 
goal: p.totalDegree = p.support.sup fun m => Multiset.card (Finsupp.toMultiset m)

full_name: MvPolynomial.le_totalDegree
code: theorem le_totalDegree {p : MvPolynomial σ R} {s : σ →₀ ℕ} (h : s ∈ p.support) :
    (s.sum fun _ e => e) ≤ totalDegree p 
goal: (s.sum fun x e => e) ≤ p.totalDegree

full_name: MvPolynomial.totalDegree_le_degrees_card
code: theorem totalDegree_le_degrees_card (p : MvPolynomial σ R) :
    p.totalDegree ≤ Multiset.card p.degrees 
goal: p.totalDegree ≤ Multiset.card p.degrees

full_name: MvPolynomial.totalDegree_le_of_support_subset
code: theorem totalDegree_le_of_support_subset (h : p.support ⊆ q.support) :
    totalDegree p ≤ totalDegree q 
goal: p.totalDegree ≤ q.totalDegree

full_name: MvPolynomial.totalDegree_C
code: @[simp]
theorem totalDegree_C (a : R) : (C a : MvPolynomial σ R).totalDegree = 0 
goal: (MvPolynomial.C a).totalDegree = 0

full_name: MvPolynomial.totalDegree_zero
code: @[simp]
theorem totalDegree_zero : (0 : MvPolynomial σ R).totalDegree = 0 
goal: MvPolynomial.totalDegree 0 = 0

full_name: MvPolynomial.totalDegree_one
code: @[simp]
theorem totalDegree_one : (1 : MvPolynomial σ R).totalDegree = 0 
goal: MvPolynomial.totalDegree 1 = 0

full_name: MvPolynomial.totalDegree_X
code: @[simp]
theorem totalDegree_X {R} [CommSemiring R] [Nontrivial R] (s : σ) :
    (X s : MvPolynomial σ R).totalDegree = 1 
goal: (MvPolynomial.X s).totalDegree = 1

full_name: MvPolynomial.totalDegree_add
code: theorem totalDegree_add (a b : MvPolynomial σ R) :
    (a + b).totalDegree ≤ max a.totalDegree b.totalDegree 
goal: (a + b).totalDegree ≤ max a.totalDegree b.totalDegree

full_name: MvPolynomial.totalDegree_add_eq_left_of_totalDegree_lt
code: theorem totalDegree_add_eq_left_of_totalDegree_lt {p q : MvPolynomial σ R}
    (h : q.totalDegree < p.totalDegree) : (p + q).totalDegree = p.totalDegree 
goal: (p + q).totalDegree = p.totalDegree

full_name: MvPolynomial.totalDegree_add_eq_right_of_totalDegree_lt
code: theorem totalDegree_add_eq_right_of_totalDegree_lt {p q : MvPolynomial σ R}
    (h : q.totalDegree < p.totalDegree) : (q + p).totalDegree = p.totalDegree 
goal: (q + p).totalDegree = p.totalDegree

full_name: MvPolynomial.totalDegree_mul
code: theorem totalDegree_mul (a b : MvPolynomial σ R) :
    (a * b).totalDegree ≤ a.totalDegree + b.totalDegree 
goal: (a * b).totalDegree ≤ a.totalDegree + b.totalDegree

full_name: MvPolynomial.totalDegree_smul_le
code: theorem totalDegree_smul_le [CommSemiring S] [DistribMulAction R S] (a : R) (f : MvPolynomial σ S) :
    (a • f).totalDegree ≤ f.totalDegree 
goal: (a • f).totalDegree ≤ f.totalDegree

full_name: MvPolynomial.totalDegree_pow
code: theorem totalDegree_pow (a : MvPolynomial σ R) (n : ℕ) :
    (a ^ n).totalDegree ≤ n * a.totalDegree 
goal: (a ^ n).totalDegree ≤ n * a.totalDegree

full_name: MvPolynomial.totalDegree_monomial
code: @[simp]
theorem totalDegree_monomial (s : σ →₀ ℕ) {c : R} (hc : c ≠ 0) :
    (monomial s c : MvPolynomial σ R).totalDegree = s.sum fun _ e => e 
goal: ((MvPolynomial.monomial s) c).totalDegree = s.sum fun x e => e

full_name: MvPolynomial.totalDegree_monomial_le
code: theorem totalDegree_monomial_le (s : σ →₀ ℕ) (c : R) :
    (monomial s c).totalDegree ≤ s.sum fun _ ↦ id 
goal: ((MvPolynomial.monomial s) c).totalDegree ≤ s.sum fun x => id

full_name: MvPolynomial.totalDegree_X_pow
code: @[simp]
theorem totalDegree_X_pow [Nontrivial R] (s : σ) (n : ℕ) :
    (X s ^ n : MvPolynomial σ R).totalDegree = n 
goal: (MvPolynomial.X s ^ n).totalDegree = n

full_name: MvPolynomial.totalDegree_list_prod
code: theorem totalDegree_list_prod :
    ∀ s : List (MvPolynomial σ R), s.prod.totalDegree ≤ (s.map MvPolynomial.totalDegree).sum
  
goal: s.prod.totalDegree ≤ (List.map MvPolynomial.totalDegree s).sum

full_name: MvPolynomial.totalDegree_multiset_prod
code: theorem totalDegree_multiset_prod (s : Multiset (MvPolynomial σ R)) :
    s.prod.totalDegree ≤ (s.map MvPolynomial.totalDegree).sum 
goal: s.prod.totalDegree ≤ (Multiset.map MvPolynomial.totalDegree s).sum

full_name: MvPolynomial.totalDegree_finset_prod
code: theorem totalDegree_finset_prod {ι : Type*} (s : Finset ι) (f : ι → MvPolynomial σ R) :
    (s.prod f).totalDegree ≤ ∑ i ∈ s, (f i).totalDegree 
goal: (s.prod f).totalDegree ≤ ∑ i ∈ s, (f i).totalDegree

full_name: MvPolynomial.totalDegree_finset_sum
code: theorem totalDegree_finset_sum {ι : Type*} (s : Finset ι) (f : ι → MvPolynomial σ R) :
    (s.sum f).totalDegree ≤ Finset.sup s fun i => (f i).totalDegree 
goal: (s.sum f).totalDegree ≤ s.sup fun i => (f i).totalDegree

full_name: MvPolynomial.totalDegree_finsetSum_le
code: lemma totalDegree_finsetSum_le {ι : Type*} {s : Finset ι} {f : ι → MvPolynomial σ R} {d : ℕ}
    (hf : ∀ i ∈ s, (f i).totalDegree ≤ d) : (s.sum f).totalDegree ≤ d 
goal: (s.sum f).totalDegree ≤ d

full_name: MvPolynomial.degreeOf_le_totalDegree
code: lemma degreeOf_le_totalDegree (f : MvPolynomial σ R) (i : σ) : f.degreeOf i ≤ f.totalDegree 
goal: MvPolynomial.degreeOf i f ≤ f.totalDegree

full_name: MvPolynomial.exists_degree_lt
code: theorem exists_degree_lt [Fintype σ] (f : MvPolynomial σ R) (n : ℕ)
    (h : f.totalDegree < n * Fintype.card σ) {d : σ →₀ ℕ} (hd : d ∈ f.support) : ∃ i, d i < n 
goal: ∃ i, d i < n

full_name: MvPolynomial.coeff_eq_zero_of_totalDegree_lt
code: theorem coeff_eq_zero_of_totalDegree_lt {f : MvPolynomial σ R} {d : σ →₀ ℕ}
    (h : f.totalDegree < ∑ i ∈ d.support, d i) : coeff d f = 0 
goal: MvPolynomial.coeff d f = 0

full_name: MvPolynomial.totalDegree_rename_le
code: theorem totalDegree_rename_le (f : σ → τ) (p : MvPolynomial σ R) :
    (rename f p).totalDegree ≤ p.totalDegree 
goal: ((MvPolynomial.rename f) p).totalDegree ≤ p.totalDegree