Fixing function for a4vec structures.
Function:
(defun a4vec-fix$inline (x) (declare (xargs :guard (a4vec-p x))) (let ((__function__ 'a4vec-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((upper (list-fix (car x))) (lower (list-fix (cdr x)))) (cons upper lower)) :exec x)))
Theorem:
(defthm a4vec-p-of-a4vec-fix (b* ((new-x (a4vec-fix$inline x))) (a4vec-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm a4vec-fix-when-a4vec-p (implies (a4vec-p x) (equal (a4vec-fix x) x)))
Function:
(defun a4vec-equiv$inline (x y) (declare (xargs :guard (and (a4vec-p x) (a4vec-p y)))) (equal (a4vec-fix x) (a4vec-fix y)))
Theorem:
(defthm a4vec-equiv-is-an-equivalence (and (booleanp (a4vec-equiv x y)) (a4vec-equiv x x) (implies (a4vec-equiv x y) (a4vec-equiv y x)) (implies (and (a4vec-equiv x y) (a4vec-equiv y z)) (a4vec-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm a4vec-equiv-implies-equal-a4vec-fix-1 (implies (a4vec-equiv x x-equiv) (equal (a4vec-fix x) (a4vec-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm a4vec-fix-under-a4vec-equiv (a4vec-equiv (a4vec-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-a4vec-fix-1-forward-to-a4vec-equiv (implies (equal (a4vec-fix x) y) (a4vec-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-a4vec-fix-2-forward-to-a4vec-equiv (implies (equal x (a4vec-fix y)) (a4vec-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm a4vec-equiv-of-a4vec-fix-1-forward (implies (a4vec-equiv (a4vec-fix x) y) (a4vec-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm a4vec-equiv-of-a4vec-fix-2-forward (implies (a4vec-equiv x (a4vec-fix y)) (a4vec-equiv x y)) :rule-classes :forward-chaining)