@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem Option.get_map {α : Type u_1} {β : Type u_2} {f : α → β} {o : Option α} {h : (Option.map f o).isSome = true} :
See Option.apply_get for a version that can be rewritten in the reverse direction.
theorem Option.apply_get {α : Type u_1} {β : Type u_2} {f : α → β} {o : Option α} {h : o.isSome = true} :
See Option.get_map for a version that can be rewritten in the reverse direction.
@[simp]
theorem Option.map_map {β : Type u_1} {γ : Type u_2} {α : Type u_3} (h : β → γ) (g : α → β) (x : Option α) :
theorem Option.comp_map {β : Type u_1} {γ : Type u_2} {α : Type u_3} (h : β → γ) (g : α → β) (x : Option α) :
@[simp]
theorem Option.mem_map_of_mem {α : Type u_1} {β : Type u_2} {x : Option α} {a : α} (g : α → β) (h : a ∈ x) :
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem Option.eq_some_of_filter_eq_some {α : Type u_1} {p : α → Bool} {o : Option α} {a : α} (h : Option.filter p o = some a) :
@[simp]
@[simp]
theorem Option.join_map_eq_map_join {α : Type u_1} {β : Type u_2} {f : α → β} {x : Option (Option α)} :
@[simp]
instance Option.commutative_merge {α : Type u_1} (f : α → α → α) [Std.Commutative f] :
Std.Commutative (merge f)
instance Option.associative_merge {α : Type u_1} (f : α → α → α) [Std.Associative f] :
Std.Associative (merge f)
@[simp]
An optional arbitrary element of a given type.
If α is non-empty, then there exists some v : α and this arbitrary element is some v.
Otherwise, it is none.
Equations
- Option.choice α = if h : Nonempty α then some (Classical.choice h) else none
Instances For
@[simp]
@[simp]
theorem Option.any_or_of_any_left {α : Type u_1} {o₁ o₂ : Option α} {f : α → Bool} (h : Option.any f o₁ = true) :
orElse #
@[simp]
The simp normal form of o <|> o' is o.or o' via orElse_eq_orElse and orElse_eq_or.
beq #
ite #
@[simp]
theorem Option.get_filter {α : Type u_1} {x : Option α} {f : α → Bool} (h : (Option.filter f x).isSome = true) :
pbind #
pmap #
theorem Option.pmap_map {α : Type u_1} {β : Type u_2} {γ : Type u_3} (o : Option α) (f : α → β) {p : β → Prop} (g : (b : β) → p b → γ) (H : ∀ (a : β), Option.map f o = some a → p a) :
pelim #
pfilter #
theorem Option.filter_pbind {α : Type u_1} {o : Option α} {β : Type u_2} {p : β → Bool} {f : (a : α) → o = some a → Option β} :
Option.filter p (o.pbind f) = (o.pfilter fun (a : α) (h : o = some a) => Option.any p (f a h)).pbind
fun (a : α) (h : (o.pfilter fun (a : α) (h : o = some a) => Option.any p (f a h)) = some a) => f a ⋯
@[simp]
LT and LE #
Rel #
min and max #
@[simp]
theorem Option.max_filter_left {α : Type u_1} [Max α] [Std.IdempotentOp max] {p : α → Bool} {o : Option α} :
@[simp]
theorem Option.max_filter_right {α : Type u_1} [Max α] [Std.IdempotentOp max] {p : α → Bool} {o : Option α} :
@[simp]
theorem Option.min_filter_left {α : Type u_1} [Min α] [Std.IdempotentOp min] {p : α → Bool} {o : Option α} :
@[simp]
theorem Option.min_filter_right {α : Type u_1} [Min α] [Std.IdempotentOp min] {p : α → Bool} {o : Option α} :
theorem Option.wellFounded_lt {α : Type u_1} {rel : α → α → Prop} (h : WellFounded rel) :
WellFounded (Option.lt rel)
theorem Option.SomeLtNone.wellFounded_lt {α : Type u_1} {r : α → α → Prop} (h : WellFounded r) :
WellFounded (lt r)