A type for VM-erased data #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file defines a type erased α
which is classically isomorphic to α
,
but erased in the VM. That is, at runtime every value of erased α
is
represented as 0
, just like types and proofs.
Extracts the erased value, noncomputably.
Equations
- erased.out ⟨s, h⟩ = classical.some h
Extracts the erased value, if it is a proof.
Equivalence between erased α
and α
.
Equations
- erased.equiv α = {to_fun := erased.out α, inv_fun := erased.mk α, left_inv := _, right_inv := _}
@[protected, instance]
Equations
- erased.has_repr α = {repr := λ (_x : erased α), "erased"}
@[protected, instance]
Equations
- erased.has_to_string α = {to_string := λ (_x : erased α), "erased"}
Computably produce an erased value from a proof of nonemptiness.
Equations
@[protected, instance]
Equations
@[simp]
theorem
erased.map_out
{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
(a : erased α) :
(erased.map f a).out = f a.out