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.Erased

19 declarations. Mathlib docs · Source

abbrev Erased.OutType E1 #

Erased (Sort u) → Sort u

Extracts the erased value, if it is a type.

Note: (mk a).OutType is not definitionally equal to a.

theorem Erased.out_proof E1 #

∀ {p : Prop} (a : Erased p), p

Extracts the erased value, if it is a proof.

def Erased.equiv E1 #

(α : Sort u_1) → Erased α ≃ α

Equivalence between Erased α and α.

instance Erased.instRepr_mathlib E0 #

(α : Type u) → Repr (Erased α)

instance Erased.instToString_mathlib E0 #

(α : Type u) → ToString (Erased α)

def Erased.choice E1 #

{α : Sort u_1} → Nonempty α → Erased α

Computably produce an erased value from a proof of nonemptiness.

theorem Erased.nonempty_iff E0 #

∀ {α : Sort u_1}, Nonempty (Erased α) ↔ Nonempty α

instance Erased.instInhabitedOfNonempty_mathlib E0 #

{α : Sort u_1} → [h : Nonempty α] → Inhabited (Erased α)

def Erased.bind E1 #

{α : Sort u_1} → {β : Sort u_2} → Erased α → (α → Erased β) → Erased β

(>>=) operation on Erased.

This is a separate definition because α and β can live in different universes (the universe is fixed in Monad).

theorem Erased.bind_eq_out E0 #

∀ {α : Sort u_1} {β : Sort u_2} (a : Erased α) (f : α → Erased β), a.bind f = f a.out

def Erased.join E1 #

{α : Sort u_1} → Erased (Erased α) → Erased α

Collapses two levels of erasure.

theorem Erased.join_eq_out E0 #

∀ {α : Sort u_1} (a : Erased (Erased α)), a.join = a.out

def Erased.map E1 #

{α : Sort u_1} → {β : Sort u_2} → (α → β) → Erased α → Erased β

(<$>) operation on Erased.

This is a separate definition because α and β can live in different universes (the universe is fixed in Functor).

theorem Erased.map_out E0 #

∀ {α : Sort u_1} {β : Sort u_2} {f : α → β} (a : Erased α), (Erased.map f a).out = f a.out

instance Erased.Monad E0 #

Monad Erased

theorem Erased.pure_def E0 #

∀ {α : Type u_1}, pure = Erased.mk

theorem Erased.bind_def E0 #

∀ {α β : Type u_1}, (fun x1 x2 ↦ x1 >>= x2) = Erased.bind

theorem Erased.map_def E0 #

∀ {α β : Type u_1}, (fun x1 x2 ↦ x1 <$> x2) = Erased.map

instance Erased.instLawfulMonad E0 #

LawfulMonad Erased