The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V01. The language of Mathlib

Mathlib.Data.Option.Defs

6 declarations. Mathlib docs · Source

def Option.traverse E1 #

{F : Type u → Type v} → [Applicative F] → {α : Type u_1} → {β : Type u} → (α → F β) → Option α → F (Option β)

Traverse an object of Option α with a function f : α → F β for an applicative F.

def Option.elim' E1 #

{α : Type u_1} → {β : Type u_2} → β → (α → β) → Option α → β

An elimination principle for Option. It is a nondependent version of Option.rec.

theorem Option.elim'_none E0 #

∀ {α : Type u_1} {β : Type u_2} (b : β) (f : α → β), Option.elim' b f none = b

theorem Option.elim'_some E0 #

∀ {α : Type u_1} {β : Type u_2} {a : α} (b : β) (f : α → β), Option.elim' b f (some a) = f a

theorem Option.elim'_none_some E0 #

∀ {α : Type u_1} {β : Type u_2} (f : Option α → β), Option.elim' (f none) (f ∘ some) = f

theorem Option.elim'_eq_elim E1 #

∀ {α : Type u_3} {β : Type u_4} (b : β) (f : α → β) (a : Option α), Option.elim' b f a = a.elim b f