Basic equivalence relation for maybe-integer structures.
Function:
(defun maybe-integer-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (maybe-integer-p acl2::x) (maybe-integer-p acl2::y)))) (equal (maybe-integer-fix acl2::x) (maybe-integer-fix acl2::y)))
Theorem:
(defthm maybe-integer-equiv-is-an-equivalence (and (booleanp (maybe-integer-equiv x y)) (maybe-integer-equiv x x) (implies (maybe-integer-equiv x y) (maybe-integer-equiv y x)) (implies (and (maybe-integer-equiv x y) (maybe-integer-equiv y z)) (maybe-integer-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm maybe-integer-equiv-implies-equal-maybe-integer-fix-1 (implies (maybe-integer-equiv acl2::x x-equiv) (equal (maybe-integer-fix acl2::x) (maybe-integer-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm maybe-integer-fix-under-maybe-integer-equiv (maybe-integer-equiv (maybe-integer-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-maybe-integer-fix-1-forward-to-maybe-integer-equiv (implies (equal (maybe-integer-fix acl2::x) acl2::y) (maybe-integer-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-maybe-integer-fix-2-forward-to-maybe-integer-equiv (implies (equal acl2::x (maybe-integer-fix acl2::y)) (maybe-integer-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm maybe-integer-equiv-of-maybe-integer-fix-1-forward (implies (maybe-integer-equiv (maybe-integer-fix acl2::x) acl2::y) (maybe-integer-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm maybe-integer-equiv-of-maybe-integer-fix-2-forward (implies (maybe-integer-equiv acl2::x (maybe-integer-fix acl2::y)) (maybe-integer-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)