lean2/tests/lean/run/lift.lean

25 lines
449 B
Text
Raw Normal View History

2014-09-09 23:21:30 +00:00
import data.nat
open nat
inductive lift .{l} (A : Type.{l}) : Type.{l+1} :=
up : A → lift A
namespace lift
definition down {A : Type} (a : lift A) : A :=
lift.rec (λ a, a) a
2014-09-09 23:21:30 +00:00
theorem down_up {A : Type} (a : A) : down (up a) = a :=
rfl
theorem up_down {A : Type} (a' : lift A) : up (down a') = a' :=
lift.induction_on a' (λ a, rfl)
2014-09-09 23:21:30 +00:00
end lift
set_option pp.universes true
check nat
check lift nat
open lift
definition one1 : lift nat := up 1