File: Mathlib/Data/Erased.lean

full_name: Erased
code: /-- `Erased α` is the same as `α`, except that the elements
  of `Erased α` are erased in the VM in the same way as types
  and proofs. This can be used to track data without storing it
  literally. -/
def Erased (α : Sort u) : Sort max 1 u 
goal: Sort (max 1 u)

full_name: Erased.mk
code: /-- Erase a value. -/
@[inline]
def mk {α} (a : α) : Erased α 
goal: Erased α

full_name: Erased.out
code: /-- Extracts the erased value, noncomputably. -/
noncomputable def out {α} : Erased α → α
  
goal: Erased α → α

full_name: Erased.OutType
code: /-- Extracts the erased value, if it is a type.

Note: `(mk a).OutType` is not definitionally equal to `a`.
-/
abbrev OutType (a : Erased (Sort u)) : Sort u 
goal: Sort u

full_name: Erased.out_proof
code: /-- Extracts the erased value, if it is a proof. -/
theorem out_proof {p : Prop} (a : Erased p) : p 
goal: p

full_name: Erased.out_mk
code: @[simp]
theorem out_mk {α} (a : α) : (mk a).out = a 
goal: (Erased.mk a).out = a

full_name: Erased.mk_out
code: @[simp]
theorem mk_out {α} : ∀ a : Erased α, mk (out a) = a
  
goal: Erased.mk a.out = a

full_name: Erased.out_inj
code: @[ext]
theorem out_inj {α} (a b : Erased α) (h : a.out = b.out) : a = b 
goal: a = b

full_name: Erased.equiv
code: /-- Equivalence between `Erased α` and `α`. -/
noncomputable def equiv (α) : Erased α ≃ α 
goal: Erased α ≃ α

full_name: Erased.instRepr
code: instance (α : Type u) : Repr (Erased α) 
goal: Repr (Erased α)

full_name: Erased.instToString
code: instance (α : Type u) : ToString (Erased α) 
goal: ToString (Erased α)

full_name: Erased.choice
code: /-- Computably produce an erased value from a proof of nonemptiness. -/
def choice {α} (h : Nonempty α) : Erased α 
goal: Erased α

full_name: Erased.nonempty_iff
code: @[simp]
theorem nonempty_iff {α} : Nonempty (Erased α) ↔ Nonempty α 
goal: Nonempty (Erased α) ↔ Nonempty α

full_name: Erased.instInhabitedOfNonempty
code: instance {α} [h : Nonempty α] : Inhabited (Erased α) 
goal: Inhabited (Erased α)

full_name: Erased.bind
code: /-- `(>>=)` operation on `Erased`.

This is a separate definition because `α` and `β` can live in different
universes (the universe is fixed in `Monad`).
-/
def bind {α β} (a : Erased α) (f : α → Erased β) : Erased β 
goal: Erased β

full_name: Erased.bind_eq_out
code: @[simp]
theorem bind_eq_out {α β} (a f) : @bind α β a f = f a.out 
goal: a.bind f = f a.out

full_name: Erased.join
code: /-- Collapses two levels of erasure.
-/
def join {α} (a : Erased (Erased α)) : Erased α 
goal: Erased α

full_name: Erased.join_eq_out
code: @[simp]
theorem join_eq_out {α} (a) : @join α a = a.out 
goal: a.join = a.out

full_name: Erased.map
code: /-- `(<$>)` operation on `Erased`.

This is a separate definition because `α` and `β` can live in different
universes (the universe is fixed in `Functor`).
-/
def map {α β} (f : α → β) (a : Erased α) : Erased β 
goal: Erased β

full_name: Erased.map_out
code: @[simp]
theorem map_out {α β} {f : α → β} (a : Erased α) : (a.map f).out = f a.out 
goal: (Erased.map f a).out = f a.out

full_name: Erased.Monad
code: protected instance Monad : Monad Erased 
goal: Monad Erased

full_name: Erased.pure_def
code: @[simp]
theorem pure_def {α} : (pure : α → Erased α) = @mk _ 
goal: pure = Erased.mk

full_name: Erased.bind_def
code: @[simp]
theorem bind_def {α β} : ((· >>= ·) : Erased α → (α → Erased β) → Erased β) = @bind _ _ 
goal: (fun x x_1 => x >>= x_1) = Erased.bind

full_name: Erased.map_def
code: @[simp]
theorem map_def {α β} : ((· <$> ·) : (α → β) → Erased α → Erased β) = @map _ _ 
goal: (fun x x_1 => x <$> x_1) = Erased.map

full_name: Erased.instLawfulMonad
code: protected instance instLawfulMonad : LawfulMonad Erased 
goal: LawfulMonad Erased