NLA-lib Explorer

Option.exists_bind_eq_some_of_exists

Library · theorem

If o is some a for an a satisfying Q, and f succeeds on every value satisfying Q, then o.bind f succeeds.

Option.exists_bind_eq_some_of_exists.{u_1, u_2} {α : Type u_1} {β : Type u_2} {o : Option α}
  {f : α → Option β} (Q : α → Prop) (h : ∃ a, o = some a ∧ Q a)
  (hQ : ∀ (a : α), Q a → ∃ b, f a = some b) : ∃ b, o.bind f = some b

Full source on GitHub

Import NLAlib.ForMathlib.Data.Option.Basic.