Skip to content

Commit

Permalink
feat(data/mv_polynomial/basic): add mv_polynomial.support_sum (#10731)
Browse files Browse the repository at this point in the history


Co-authored-by: Iván Sadofschi Costa <isadofschi@users.noreply.github.com>
  • Loading branch information
isadofschi and isadofschi committed Dec 14, 2021
1 parent 9af43e4 commit dda8a10
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/data/finsupp/basic.lean
Expand Up @@ -1113,6 +1113,16 @@ have ∀ c, f.sum (λ a b, g a b c) ≠ 0 → (∃ a, f a ≠ 0 ∧ ¬ (g a (f a
⟨a, mem_support_iff.mp ha, ne⟩,
by simpa only [finset.subset_iff, mem_support_iff, finset.mem_bUnion, sum_apply, exists_prop]

lemma support_finset_sum [decidable_eq β] [add_comm_monoid M] {s : finset α} {f : α → (β →₀ M)} :
(finset.sum s f).support ⊆ s.bUnion (λ x, (f x).support) :=
begin
rw ←finset.sup_eq_bUnion,
induction s using finset.cons_induction_on with a s ha ih,
{ refl },
{ rw [finset.sum_cons, finset.sup_cons],
exact support_add.trans (finset.union_subset_union (finset.subset.refl _) ih), },
end

@[simp] lemma sum_zero [has_zero M] [add_comm_monoid N] {f : α →₀ M} :
f.sum (λa b, (0 : N)) = 0 :=
finset.sum_const_zero
Expand Down
5 changes: 5 additions & 0 deletions src/data/mv_polynomial/basic.lean
Expand Up @@ -385,6 +385,11 @@ lemma support_add : (p + q).support ⊆ p.support ∪ q.support := finsupp.suppo
lemma support_X [nontrivial R] : (X n : mv_polynomial σ R).support = {single n 1} :=
by rw [X, support_monomial, if_neg]; exact one_ne_zero

@[simp] lemma support_zero : (0 : mv_polynomial σ R).support = ∅ := rfl

lemma support_sum {α : Type*} {s : finset α} {f : α → mv_polynomial σ R} :
(∑ x in s, f x).support ⊆ s.bUnion (λ x, (f x).support) := finsupp.support_finset_sum

end support

section coeff
Expand Down

0 comments on commit dda8a10

Please sign in to comment.