Skip to content

Commit

Permalink
feat(data/option/basic): add eq_of_mem_of_mem (#11098)
Browse files Browse the repository at this point in the history
If `a : α` belongs to both `o1 o2 : option α` then `o1 = o2`
  • Loading branch information
stuart-presnell committed Dec 28, 2021
1 parent f11d3ca commit 134ff7d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/data/option/basic.lean
Expand Up @@ -71,6 +71,9 @@ by cases x; [contradiction, rw get_or_else_some]
theorem mem_unique {o : option α} {a b : α} (ha : a ∈ o) (hb : b ∈ o) : a = b :=
option.some.inj $ ha.symm.trans hb

theorem eq_of_mem_of_mem {a : α} {o1 o2 : option α} (h1 : a ∈ o1) (h2 : a ∈ o2) : o1 = o2 :=
h1.trans h2.symm

theorem mem.left_unique : relator.left_unique ((∈) : α → option α → Prop) :=
λ a o b, mem_unique

Expand Down

0 comments on commit 134ff7d

Please sign in to comment.