Skip to content

Commit

Permalink
feat(data/option/basic): add bind_some' (#16641)
Browse files Browse the repository at this point in the history
We already have `some_bind` `bind_some` `some_bind'`, but there is no `bind_some'`.
  • Loading branch information
negiizhao committed Oct 11, 2022
1 parent 94fc87e commit f737ca1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/data/option/basic.lean
Expand Up @@ -110,6 +110,9 @@ theorem eq_none_iff_forall_not_mem {o : option α} :
@[simp] theorem bind_some : ∀ x : option α, x >>= some = x :=
@bind_pure α option _ _

@[simp] theorem bind_some' : ∀ x : option α, x.bind some = x :=
bind_some

@[simp] theorem bind_eq_some {α β} {x : option α} {f : α → option β} {b : β} :
x >>= f = some b ↔ ∃ a, x = some a ∧ f a = some b :=
by cases x; simp
Expand Down

0 comments on commit f737ca1

Please sign in to comment.