Skip to content

Commit

Permalink
feat(data/finsupp/basic): Add finsupp.erase_of_not_mem_support (#10689
Browse files Browse the repository at this point in the history
)

Analogous to `list.erase_of_not_mem`
  • Loading branch information
stuart-presnell committed Dec 15, 2021
1 parent 03a250a commit c574e38
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/data/finsupp/basic.lean
Expand Up @@ -680,6 +680,13 @@ begin
{ rw [erase_ne hs] }
end

@[simp] lemma erase_of_not_mem_support {f : α →₀ M} {a} (haf : a ∉ f.support) : erase a f = f :=
begin
ext b, by_cases hab : b = a,
{ rwa [hab, erase_same, eq_comm, ←not_mem_support_iff] },
{ rw erase_ne hab }
end

@[simp] lemma erase_zero (a : α) : erase a (0 : α →₀ M) = 0 :=
by rw [← support_eq_empty, support_erase, support_zero, erase_empty]

Expand Down

0 comments on commit c574e38

Please sign in to comment.