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
|
|
|
|
|
2015-06-15 11:10:03 +00:00
|
|
|
theorem succ.inj {n m : Nat} (H : succ n = succ m) : n = m
|
2015-01-27 19:22:14 +00:00
|
|
|
:= calc
|
|
|
|
n = pred (succ n) : pred_succ n⁻¹
|
|
|
|
... = pred (succ m) : {H}
|
|
|
|
... = m : pred_succ m
|
|
|
|
|
|
|
|
end Nat
|