lean4-htt/tests/lean/run/nat_bug2.lean
Daniel Selsam a9b01991c2 feat(frontends/lean/inductive_cmd): new frontend for the inductive cmd
Conflicts:
	src/frontends/lean/CMakeLists.txt
	src/frontends/lean/structure_cmd.h
2016-08-17 07:34:03 -07:00

24 lines
686 B
Text

namespace experiment
inductive nat : Type
| zero : nat
| succ : nat → nat
namespace nat
definition plus (x y : nat) : nat
:= nat.rec x (λn r, succ r) y
definition to_nat (n : num) : nat
:= num.rec zero (λn, pos_num.rec (succ zero) (λn r, plus r (plus r (succ zero))) (λn r, plus r r) n) n
definition add (x y : nat) : nat
:= plus x y
constant le : nat → nat → Prop
infixl `+` := add
infix `≤` := le
axiom add_one (n:nat) : n + (succ zero) = succ n
axiom add_le_right {n m : nat} (H : n ≤ m) (k : nat) : n + k ≤ m + k
theorem succ_le {n m : nat} (H : n ≤ m) : succ n ≤ succ m
:= add_one m ▸ add_one n ▸ add_le_right H (to_nat (1:num))
end nat
end experiment