2014-08-19 04:23:14 +00:00
|
|
|
import logic
|
2014-11-23 01:34:05 +00:00
|
|
|
namespace experiment
|
2014-08-19 04:23:14 +00:00
|
|
|
namespace nat
|
2014-10-02 23:20:52 +00:00
|
|
|
constant nat : Type.{1}
|
|
|
|
constant add : nat → nat → nat
|
|
|
|
constant le : nat → nat → Prop
|
|
|
|
constant one : nat
|
2014-10-21 22:27:45 +00:00
|
|
|
infixl `+` := add
|
|
|
|
infix `≤` := le
|
2014-08-19 04:23:14 +00:00
|
|
|
axiom add_assoc (a b c : nat) : (a + b) + c = a + (b + c)
|
|
|
|
axiom add_le_left {a b : nat} (H : a ≤ b) (c : nat) : c + a ≤ c + b
|
|
|
|
end nat
|
|
|
|
|
|
|
|
namespace int
|
2014-10-02 23:20:52 +00:00
|
|
|
constant int : Type.{1}
|
|
|
|
constant add : int → int → int
|
|
|
|
constant le : int → int → Prop
|
|
|
|
constant one : int
|
2014-10-21 22:27:45 +00:00
|
|
|
infixl `+` := add
|
|
|
|
infix `≤` := le
|
2014-08-19 04:23:14 +00:00
|
|
|
axiom add_assoc (a b c : int) : (a + b) + c = a + (b + c)
|
|
|
|
axiom add_le_left {a b : int} (H : a ≤ b) (c : int) : c + a ≤ c + b
|
2014-09-17 21:39:05 +00:00
|
|
|
definition lt (a b : int) := a + one ≤ b
|
2014-10-21 22:27:45 +00:00
|
|
|
infix `<` := lt
|
2014-08-19 04:23:14 +00:00
|
|
|
end int
|
|
|
|
|
2014-09-03 23:00:38 +00:00
|
|
|
open int
|
|
|
|
open nat
|
2014-09-05 01:41:06 +00:00
|
|
|
open eq
|
2014-08-19 04:23:14 +00:00
|
|
|
theorem add_lt_left {a b : int} (H : a < b) (c : int) : c + a < c + b :=
|
|
|
|
subst (symm (add_assoc c a one)) (add_le_left H c)
|
2014-11-23 01:34:05 +00:00
|
|
|
end experiment
|