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