@[reducible, inline, deprecated Option.get!_eq_getD (since := "2024-11-18")]
Equations
@[simp]
@[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)
:
@[reducible, inline, deprecated Option.isSome_of_isSome_filter (since := "2025-03-18")]
abbrev
Option.isSome_filter_of_isSome
{α : Type u_1}
(p : α → Bool)
(o : Option α)
(h : (Option.filter p o).isSome = true)
:
@[simp]
@[simp]
theorem
Option.join_map_eq_map_join
{α : Type u_1}
{β : Type u_2}
{f : α → β}
{x : Option (Option α)}
:
@[simp]
@[reducible, inline, deprecated Option.isSome_guard (since := "2025-03-18")]
Equations
@[simp]
@[simp]
theorem
Option.guard_congr
{α : Type u_1}
{f g : α → Prop}
[DecidablePred f]
[DecidablePred g]
(h : ∀ (a : α), f a ↔ g a)
:
theorem
Option.guard_comp
{α : Type u_1}
{β : Type u_2}
{p : α → Prop}
[DecidablePred p]
{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
@[reducible, inline, deprecated Option.isSome_choice_iff_nonempty (since := "2025-03-18")]
beq #
ite #
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 : β), a ∈ Option.map f o → p a)
: