Skip to content

Commit

Permalink
feat(data/set/basic): default_coe_singleton (#6971)
Browse files Browse the repository at this point in the history
Co-authored-by: Yakov Pechersky <pechersky@users.noreply.github.com>
  • Loading branch information
pechersky and pechersky committed Apr 1, 2021
1 parent ec9476f commit e540c2f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/data/set/basic.lean
Expand Up @@ -716,6 +716,10 @@ lemma eq_singleton_iff_nonempty_unique_mem {s : set α} {a : α} :
s = {a} ↔ s.nonempty ∧ ∀ x ∈ s, x = a :=
eq_singleton_iff_unique_mem.trans $ and_congr_left $ λ H, ⟨λ h', ⟨_, h'⟩, λ ⟨x, h⟩, H x h ▸ h⟩

-- while `simp` is capable of proving this, it is not capable of turning the LHS into the RHS.
@[simp] lemma default_coe_singleton (x : α) :
default ({x} : set α) = ⟨x, rfl⟩ := rfl

/-! ### Lemmas about sets defined as `{x ∈ s | p x}`. -/

theorem mem_sep {s : set α} {p : α → Prop} {x : α} (xs : x ∈ s) (px : p x) : x ∈ {x ∈ s | p x} :=
Expand Down

0 comments on commit e540c2f

Please sign in to comment.