Extra definitions on Option #
This file defines more operations involving Option α. Lemmas about them are located in other
files under Mathlib.Data.Option.
Other basic operations on Option are defined in the core library.
def
Option.traverse
{F : Type u → Type v}
[Applicative F]
{α : Type u_1}
{β : Type u}
(f : α → F β)
:
Traverse an object of Option α with a function f : α → F β for an applicative F.
Equations
- Option.traverse f none = pure none
- Option.traverse f (some x_1) = some <$> f x_1
Instances For
An elimination principle for Option. It is a nondependent version of Option.rec.
Equations
- Option.elim' b f (some a) = f a
- Option.elim' b f none = b
Instances For
@[simp]
@[simp]
@[simp]
@[inline]
o = none is decidable even if the wrapped type does not have decidable equality.
This is not an instance because it is not definitionally equal to Option.decidableEq.
Try to use o.isNone or o.isSome instead.
Equations
Instances For
Equations
- none.decidableForallMem = isTrue ⋯
- (some x_1).decidableForallMem = if h : p x_1 then isTrue ⋯ else isFalse ⋯