2014-08-24 19:58:48 -07:00
|
|
|
import logic
|
2014-10-01 17:51:17 -07:00
|
|
|
open eq.ops
|
2014-11-22 17:34:05 -08:00
|
|
|
namespace experiment
|
2014-07-25 16:00:38 -07:00
|
|
|
inductive nat : Type :=
|
2015-02-25 17:00:10 -08:00
|
|
|
| zero : nat
|
|
|
|
| succ : nat → nat
|
2014-09-04 16:36:06 -07:00
|
|
|
namespace nat
|
2014-09-04 15:03:59 -07:00
|
|
|
definition add (x y : nat) : nat := nat.rec x (λn r, succ r) y
|
2014-10-21 15:27:45 -07:00
|
|
|
infixl `+` := add
|
2014-09-04 15:03:59 -07:00
|
|
|
definition mul (n m : nat) := nat.rec zero (fun m x, x + n) m
|
2014-10-21 15:27:45 -07:00
|
|
|
infixl `*` := mul
|
2014-07-25 16:00:38 -07:00
|
|
|
|
|
|
|
axiom mul_succ_right (n m : nat) : n * succ m = n * m + n
|
2014-09-04 18:41:06 -07:00
|
|
|
open eq
|
2014-07-25 16:00:38 -07:00
|
|
|
theorem small2 (n m l : nat) : n * succ l + m = n * l + n + m
|
2014-09-04 16:36:06 -07:00
|
|
|
:= subst (mul_succ_right _ _) (eq.refl (n * succ l + m))
|
|
|
|
end nat
|
2014-11-22 17:34:05 -08:00
|
|
|
end experiment
|