Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit e540c2f

Browse files
committed
feat(data/set/basic): default_coe_singleton (#6971)
Co-authored-by: Yakov Pechersky <pechersky@users.noreply.github.com>
1 parent ec9476f commit e540c2f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/data/set/basic.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,10 @@ lemma eq_singleton_iff_nonempty_unique_mem {s : set α} {a : α} :
716716
s = {a} ↔ s.nonempty ∧ ∀ x ∈ s, x = a :=
717717
eq_singleton_iff_unique_mem.trans $ and_congr_left $ λ H, ⟨λ h', ⟨_, h'⟩, λ ⟨x, h⟩, H x h ▸ h⟩
718718

719+
-- while `simp` is capable of proving this, it is not capable of turning the LHS into the RHS.
720+
@[simp] lemma default_coe_singleton (x : α) :
721+
default ({x} : set α) = ⟨x, rfl⟩ := rfl
722+
719723
/-! ### Lemmas about sets defined as `{x ∈ s | p x}`. -/
720724

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

0 commit comments

Comments
 (0)