lean2/tests/lean/run/nat_bug.lean
Leonardo de Moura 919007612a fix(tests/lean): adjust tests since module 'logic' depends on nat
We need that because of the definitional package
2014-11-22 17:34:05 -08:00

27 lines
816 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import logic
open decidable
open eq
namespace experiment
inductive nat : Type :=
zero : nat,
succ : nat → nat
definition refl := @eq.refl
namespace nat
definition pred (n : nat) := nat.rec zero (fun m x, m) n
theorem pred_zero : pred zero = zero := refl _
theorem pred_succ (n : nat) : pred (succ n) = n := refl _
theorem zero_or_succ (n : nat) : n = zero n = succ (pred n)
:= induction_on n
(or.intro_left _ (refl zero))
(take m IH, or.intro_right _
(show succ m = succ (pred (succ m)), from congr_arg succ (symm (pred_succ m))))
theorem zero_or_succ2 (n : nat) : n = zero n = succ (pred n)
:= @induction_on _ n
(or.intro_left _ (refl zero))
(take m IH, or.intro_right _
(show succ m = succ (pred (succ m)), from congr_arg succ (symm (pred_succ m))))
end nat
end experiment