Fixing function for maybe-4vec structures.
(maybe-4vec-fix x) → new-x
Function:
(defun maybe-4vec-fix$inline (x) (declare (xargs :guard (maybe-4vec-p x))) (let ((__function__ 'maybe-4vec-fix)) (declare (ignorable __function__)) (mbe :logic (cond ((not x) nil) (t (b* ((fty::val (4vec-fix x))) fty::val))) :exec x)))
Theorem:
(defthm maybe-4vec-p-of-maybe-4vec-fix (b* ((new-x (maybe-4vec-fix$inline x))) (maybe-4vec-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm maybe-4vec-fix-when-maybe-4vec-p (implies (maybe-4vec-p x) (equal (maybe-4vec-fix x) x)))
Function:
(defun maybe-4vec-equiv$inline (x y) (declare (xargs :guard (and (maybe-4vec-p x) (maybe-4vec-p y)))) (equal (maybe-4vec-fix x) (maybe-4vec-fix y)))
Theorem:
(defthm maybe-4vec-equiv-is-an-equivalence (and (booleanp (maybe-4vec-equiv x y)) (maybe-4vec-equiv x x) (implies (maybe-4vec-equiv x y) (maybe-4vec-equiv y x)) (implies (and (maybe-4vec-equiv x y) (maybe-4vec-equiv y z)) (maybe-4vec-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm maybe-4vec-equiv-implies-equal-maybe-4vec-fix-1 (implies (maybe-4vec-equiv x x-equiv) (equal (maybe-4vec-fix x) (maybe-4vec-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm maybe-4vec-fix-under-maybe-4vec-equiv (maybe-4vec-equiv (maybe-4vec-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-maybe-4vec-fix-1-forward-to-maybe-4vec-equiv (implies (equal (maybe-4vec-fix x) y) (maybe-4vec-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-maybe-4vec-fix-2-forward-to-maybe-4vec-equiv (implies (equal x (maybe-4vec-fix y)) (maybe-4vec-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm maybe-4vec-equiv-of-maybe-4vec-fix-1-forward (implies (maybe-4vec-equiv (maybe-4vec-fix x) y) (maybe-4vec-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm maybe-4vec-equiv-of-maybe-4vec-fix-2-forward (implies (maybe-4vec-equiv x (maybe-4vec-fix y)) (maybe-4vec-equiv x y)) :rule-classes :forward-chaining)