2015-01-27 19:22:14 +00:00
|
|
|
open eq.ops
|
|
|
|
|
|
|
|
inductive Nat : Type :=
|
2015-02-26 01:00:10 +00:00
|
|
|
zero : Nat |
|
2015-01-27 19:22:14 +00:00
|
|
|
succ : Nat → Nat
|
|
|
|
|
|
|
|
namespace Nat
|
|
|
|
|
|
|
|
definition pred (n : Nat) := Nat.rec zero (fun m x, m) n
|
|
|
|
theorem pred_succ (n : Nat) : pred (succ n) = n := rfl
|
|
|
|
|
|
|
|
theorem succ_inj {n m : Nat} (H : succ n = succ m) : n = m
|
|
|
|
:= calc
|
|
|
|
n = pred (succ n) : pred_succ n⁻¹
|
|
|
|
... = pred (succ m) : {H}
|
|
|
|
... = m : pred_succ m
|
|
|
|
|
|
|
|
end Nat
|