NLA-lib Explorer

Mapping and binding a successful option

Library · Source module

Mapping and binding a successful option

If an option succeeds with a value satisfying Q, and f sends values satisfying Q to values satisfying R, then its map by f succeeds with a value satisfying R: the last step of a run lemma whose run is a loop followed by a pop of the scratch buffer. Likewise its bind by f succeeds when f succeeds on every value satisfying Q: one step of a proof that a sequence of runs succeeds. Upstream candidate for Mathlib.Data.Option.Basic.

Main results

* Option.exists_map_eq_some_of_exists, Option.exists_map_eq_some. * Option.exists_bind_eq_some_of_exists.

Declarations