@@ -90,13 +90,30 @@ theorem vars_C : (C r : MvPolynomial σ R).vars = ∅ := by
9090theorem vars_X [Nontrivial R] : (X n : MvPolynomial σ R).vars = {n} := by
9191 rw [X, vars_monomial (one_ne_zero' R), Finsupp.support_single_ne_zero _ (one_ne_zero' ℕ)]
9292
93- theorem mem_vars (i : σ) : i ∈ p.vars ↔ ∃ d ∈ p.support, i ∈ d.support := by
93+ theorem mem_vars_iff_mem_support (i : σ) : i ∈ p.vars ↔ ∃ d ∈ p.support, i ∈ d.support := by
9494 classical simp only [vars_def, Multiset.mem_toFinset, mem_degrees, mem_support_iff]
9595
96+ @ [deprecated (since := "2026-04-24" )] alias mem_vars := mem_vars_iff_mem_support
97+
98+ theorem mem_vars_iff_degreeOf_ne_zero {i : σ} : i ∈ p.vars ↔ p.degreeOf i ≠ 0 := by
99+ classical simp [degreeOf, vars_def]
100+
96101theorem mem_support_notMem_vars_zero {f : MvPolynomial σ R} {x : σ →₀ ℕ} (H : x ∈ f.support)
97102 {v : σ} (h : v ∉ vars f) : x v = 0 := by
98103 contrapose! h
99- exact (mem_vars v).mpr ⟨x, H, Finsupp.mem_support_iff.mpr h⟩
104+ exact (mem_vars_iff_mem_support v).mpr ⟨x, H, Finsupp.mem_support_iff.mpr h⟩
105+
106+ theorem support_subset_vars_of_mem_support {s : σ →₀ ℕ} (h : s ∈ p.support) :
107+ s.support ⊆ p.vars := fun i hi ↦ by
108+ contrapose! hi
109+ simp [mem_support_notMem_vars_zero h hi]
110+
111+ theorem vars_eq_empty_iff_eq_C : p.vars = ∅ ↔ p = C (p.coeff 0 ) := by
112+ refine ⟨fun h ↦ ?_, fun h ↦ by rw [h]; simp⟩
113+ rw [← totalDegree_eq_zero_iff_eq_C]
114+ suffices p.degrees.card = 0 by grind [totalDegree_le_degrees_card p]
115+ classical rw [vars_def, Multiset.toFinset_eq_empty] at h
116+ simp_all
100117
101118theorem vars_add_subset [DecidableEq σ] (p q : MvPolynomial σ R) :
102119 (p + q).vars ⊆ p.vars ∪ q.vars := by
@@ -149,7 +166,7 @@ variable {A : Type*} [CommRing A] [NoZeroDivisors A]
149166theorem vars_C_mul (a : A) (ha : a ≠ 0 ) (φ : MvPolynomial σ A) :
150167 (C a * φ : MvPolynomial σ A).vars = φ.vars := by
151168 ext1 i
152- simp only [mem_vars , mem_support_iff]
169+ simp only [mem_vars_iff_mem_support , mem_support_iff]
153170 apply exists_congr
154171 intro d
155172 rw [coeff_C_mul, mul_ne_zero_iff, eq_true ha, true_and]
@@ -206,7 +223,7 @@ theorem vars_monomial_single (i : σ) {e : ℕ} {r : R} (he : e ≠ 0) (hr : r
206223theorem vars_eq_support_biUnion_support [DecidableEq σ] :
207224 p.vars = p.support.biUnion Finsupp.support := by
208225 ext i
209- rw [mem_vars , Finset.mem_biUnion]
226+ rw [mem_vars_iff_mem_support , Finset.mem_biUnion]
210227
211228end Map
212229
@@ -244,7 +261,7 @@ theorem eval₂Hom_eq_constantCoeff_of_vars (f : R →+* S) {g : σ → S} {p :
244261 contradiction
245262 rw [Finsupp.prod, Finset.prod_eq_zero hi, mul_zero]
246263 rw [hp, zero_pow (Finsupp.mem_support_iff.1 hi)]
247- rw [mem_vars ]
264+ rw [mem_vars_iff_mem_support ]
248265 exact ⟨d, hd, hi⟩
249266
250267theorem aeval_eq_constantCoeff_of_vars [Algebra R S] {g : σ → S} {p : MvPolynomial σ R}
@@ -265,7 +282,7 @@ theorem eval₂Hom_congr' {f₁ f₂ : R →+* S} {g₁ g₂ : σ → S} {p₁ p
265282 apply Finset.prod_congr rfl
266283 intro i hi
267284 have : i ∈ p₁.vars := by
268- rw [mem_vars ]
285+ rw [mem_vars_iff_mem_support ]
269286 exact ⟨d, hd, hi⟩
270287 rw [h i this this]
271288
@@ -312,7 +329,7 @@ lemma aeval_ite_mem_eq_self (q : MvPolynomial σ R) {s : Set σ} (hs : (q.vars :
312329 refine Finset.sum_congr rfl fun u hu ↦ ?_
313330 rw [MvPolynomial.aeval_monomial, MvPolynomial.monomial_eq]
314331 congr 1
315- exact Finsupp.prod_congr (fun i hi ↦ by simp [hs ((MvPolynomial.mem_vars _).mpr ⟨u, hu, hi⟩)])
332+ exact Finsupp.prod_congr (fun i hi ↦ by simp [hs ((mem_vars_iff_mem_support _).mpr ⟨u, hu, hi⟩)])
316333
317334end EvalVars
318335
0 commit comments