Skip to content

Commit 68e18bf

Browse files
committed
feat(MvPolynomial/WeightedHomogenous): relate weightedTotalDegree to degrees and degreeOf (leanprover-community#29458)
`weightedTotalDegree` is the most general notion of multivariate degree in mathlib. These theorems show that it specializes to `degrees` and `degreeOf` with specialized weights. Co-authored-by: LiamSchilling <wschilling003@gmail.com>
1 parent bcf30a0 commit 68e18bf

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Mathlib/RingTheory/MvPolynomial/Homogeneous.lean

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,31 @@ def IsHomogeneous [CommSemiring R] (φ : MvPolynomial σ R) (n : ℕ) :=
5151

5252
variable [CommSemiring R]
5353

54+
/-- The `degrees` of a polynomial `p` is a special case of the `weightedTotalDegree` of `p` where
55+
the weights are singletons containing each variable. -/
56+
@[simp]
57+
theorem weightedTotalDegree_singleton [DecidableEq σ] (p : MvPolynomial σ R) :
58+
weightedTotalDegree (fun i => {i}) p = degrees p := by
59+
rw [degrees_def]; rfl
60+
61+
/-- The `totalDegree` of a polynomial `p` is a special case of the `weightedTotalDegree` of `p`
62+
where all of the weights are `1`. -/
5463
theorem weightedTotalDegree_one (φ : MvPolynomial σ R) :
5564
weightedTotalDegree (1 : σ → ℕ) φ = φ.totalDegree := by
5665
simp only [totalDegree, weightedTotalDegree, weight, LinearMap.toAddMonoidHom_coe,
5766
linearCombination, Pi.one_apply, Finsupp.coe_lsum, LinearMap.coe_smulRight, LinearMap.id_coe,
5867
id, smul_eq_mul, mul_one]
5968

69+
/-- The `degreeOf` a variable `i` for a polynomial `p` is a special case of the
70+
`weightedTotalDegree` of `p` where `i` has the only nonzero weight and that weight is `1`. -/
71+
@[simp]
72+
theorem weightedTotalDegree_piSingle [DecidableEq σ] (i : σ) (p : MvPolynomial σ R) :
73+
weightedTotalDegree (Pi.single i 1) p = degreeOf i p := by
74+
simp only [weightedTotalDegree, weight, linearCombination, Pi.single_apply, degreeOf, degrees,
75+
Multiset.count_finset_sup]
76+
congr; ext d
77+
simp +contextual
78+
6079
theorem weightedTotalDegree_rename_of_injective {σ τ : Type*} {e : σ → τ}
6180
{w : τ → ℕ} {P : MvPolynomial σ R} (he : Function.Injective e) :
6281
weightedTotalDegree w (rename e P) = weightedTotalDegree (w ∘ e) P := by

0 commit comments

Comments
 (0)