@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[reducible, inline, deprecated Option.map_none (since := "2025-04-10")]
Equations
Instances For
@[reducible, inline, deprecated Option.map_some (since := "2025-04-10")]
Equations
Instances For
@[simp]
@[reducible, inline, deprecated Option.isSome_map (since := "2025-04-10")]
Equations
Instances For
@[simp]
@[simp]
theorem
Option.get_map
{α : Type u_1}
{β : Type u_2}
{f : α → β}
{o : Option α}
{h : (Option.map f o).isSome = true}
:
@[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)
:
@[deprecated Option.bind_guard (since := "2025-05-15")]
@[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
Instances For
@[reducible, inline, deprecated Option.choice_eq_some (since := "2025-05-12")]
Equations
Instances For
@[simp]
@[reducible, inline, deprecated Option.map_or (since := "2025-04-10")]
Equations
Instances For
@[simp]
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 α}
: