Skip to content

Commit

Permalink
feat(data/finset/basic): insert_singleton_comm (#3914)
Browse files Browse the repository at this point in the history
Add the result that `({a, b} : finset α) = {b, a}`.  This came up in
#3872, and `library_search` does not show it as already present.
  • Loading branch information
jsm28 committed Aug 23, 2020
1 parent 7ac7246 commit ff97055
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/data/finset/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,12 @@ insert_eq_of_mem $ mem_singleton_self _
theorem insert.comm (a b : α) (s : finset α) : insert a (insert b s) = insert b (insert a s) :=
ext $ λ x, by simp only [mem_insert, or.left_comm]

theorem insert_singleton_comm (a b : α) : ({a, b} : finset α) = {b, a} :=
begin
ext,
simp [or.comm]
end

@[simp] theorem insert_idem (a : α) (s : finset α) : insert a (insert a s) = insert a s :=
ext $ λ x, by simp only [mem_insert, or.assoc.symm, or_self]

Expand Down

0 comments on commit ff97055

Please sign in to comment.