aboutsummaryrefslogtreecommitdiff
path: root/peano.lisp
diff options
context:
space:
mode:
authorMasaya Tojo <masaya@tojo.tokyo>2021-08-06 00:54:14 +0900
committerMasaya Tojo <masaya@tojo.tokyo>2021-08-06 00:54:14 +0900
commitab711cc5ce71ee2feaa4e88a0b9af113c2d67e3d (patch)
tree1cb6a74138f31d817a7b54bf714f96a95500b4d0 /peano.lisp
parente00735e48932889c2f78ecbcd84554aeaf913179 (diff)
peano: Remove unnecessary hypothesis.
Diffstat (limited to 'peano.lisp')
-rw-r--r--peano.lisp61
1 files changed, 21 insertions, 40 deletions
diff --git a/peano.lisp b/peano.lisp
index 138527b..8c7f7d3 100644
--- a/peano.lisp
+++ b/peano.lisp
@@ -26,23 +26,15 @@
((or (z? x) (z? y)) nil)
(t (nat= (pred x) (pred y)))))
+(defthm nat=-reflexive
+ (nat= x x))
+(defthm nat=-symmetric
+ (equal (nat= x y)
+ (nat= y x)))
-(defthm nat-reflexive
- (implies (nat? x)
- (nat= x x)))
-
-(defthm nat-symmetric
- (implies (and (nat? x)
- (nat? y))
- (equal (nat= x y)
- (nat= y x))))
-
-(defthm nat-transitive
- (implies (and (nat? x)
- (nat? y)
- (nat? z)
- (nat= x y)
+(defthm nat=-transitive
+ (implies (and (nat= x y)
(nat= y z))
(nat= x z)))
@@ -68,23 +60,9 @@
(equal (nat+ nil x)
x)))
-(defthm nat+-left-not-zp
- (implies (and (nat? x)
- (not (z? x))
- (nat? y))
- (not (equal (nat+ x y)
- y))))
-
-(defthm nat+-right-not-zp
- (implies (and (nat? x)
- (nat? y)
- (not (z? y)))
- (not (equal (nat+ x y)
- x)))
- :hints (("Goal" :in-theory (disable nat+-commutative)
- :use ((:instance nat+-commutative
- (x x)
- (y y))))))
+(defthm nat+-right-cancellative
+ (equal (equal (nat+ x k) (nat+ y k))
+ (equal x y)))
(defthm nat+-left-cancellative
(implies (and (nat? x)
@@ -92,11 +70,14 @@
(nat? k))
(equal (equal (nat+ k x) (nat+ k y))
(equal x y)))
- :hints (("Goal" :induct (nat= x y))))
-
-(defthm nat+-right-cancellative
- (implies (and (nat? x)
- (nat? y)
- (nat? k))
- (equal (equal (nat+ x k) (nat+ y k))
- (equal x y))))
+ :hints (("Goal" :in-theory (disable nat+-commutative)
+ :use ((:instance nat+-commutative
+ (x x)
+ (y k))
+ (:instance nat+-commutative
+ (x y)
+ (y k))))))
+
+(defthm associativity-of-nat+
+ (equal (nat+ x (nat+ y z))
+ (nat+ (nat+ x y) z)))