Skip to content

Commit

Permalink
feat(data/set/basic): add singleton_injective (#11464)
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeata committed Jan 15, 2022
1 parent 37cf695 commit 0b4f07f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/data/set/basic.lean
Expand Up @@ -719,6 +719,9 @@ theorem eq_of_mem_singleton {x y : α} (h : x ∈ ({y} : set α)) : x = y := h
@[simp] theorem singleton_eq_singleton_iff {x y : α} : {x} = ({y} : set α) ↔ x = y :=
ext_iff.trans eq_iff_eq_cancel_left

lemma singleton_injective : injective (singleton : α → set α) :=
λ _ _, singleton_eq_singleton_iff.mp

theorem mem_singleton_of_eq {x y : α} (H : x = y) : x ∈ ({y} : set α) := H

theorem insert_eq (x : α) (s : set α) : insert x s = ({x} : set α) ∪ s := rfl
Expand Down

0 comments on commit 0b4f07f

Please sign in to comment.