1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
; See the top-level arithmetic-3 LICENSE file for authorship,
; copyright, and license information.
;;
;; mini-theories.lisp
;;
(in-package "ACL2")
(local (include-book "basic-arithmetic"))
(local (include-book "inequalities"))
(local (include-book "prefer-times"))
(local (include-book "expt"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Some proofs of linear equalities don't work when presented as
; equalities because they need to be proved by linear arithmetic,
; but linear arithmetic only works at the literal level. This
; lemma allows you to state the equality as an equality rewrite
; rule, but breaks the equality into literals for the proof.
(defthm rewrite-linear-equalities-to-iff
(equal (equal (< w x) (< y z))
(iff (< w x) (< y z))))
(in-theory (disable rewrite-linear-equalities-to-iff))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; See the note above equal-/ in basic-arithmetic.lisp.
(encapsulate
()
(local
(defthm Uniqueness-of-*-inverses-lemma-2
(equal (equal (* x y)
1)
(and (not (equal x 0))
(acl2-numberp x)
(equal y (/ x))))))
(defthm Uniqueness-of-*-inverses
(equal (equal (* x y)
1)
(and (not (equal (fix x) 0))
(equal y (/ x))))
:hints (("Goal" :in-theory (disable equal-/)))))
(in-theory (disable Uniqueness-of-*-inverses))
;; This, and the inverse for exponents-add, should use
;; a macro to enforce the theory invariant more fully.
(theory-invariant
(not (and (active-runep '(:rewrite Uniqueness-of-*-inverses))
(active-runep '(:rewrite equal-/)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defthm expts-add-aggressive
(implies (and (integerp i)
(integerp j))
(equal (expt x (+ i j))
(if (equal (+ i j) 0)
1
(if (equal (fix x) 0)
0
(* (expt x i) (expt x j)))))))
(defthm expts-add-inverse
(implies (and (integerp i)
(integerp j))
(equal (* (expt x i) (expt x j))
(if (and (equal i 0)
(equal j 0))
1
(if (equal (fix x) 0)
0
(expt x (+ i j)))))))
(in-theory (disable expts-add-aggressive expts-add-inverse))
|