Performance note. In the execution, this is just an inlined call of eql.
Function:
(defun maybe-integer-equiv$inline (x y) (declare (xargs :guard (and (maybe-integerp x) (maybe-integerp y)))) (eql (maybe-integerp-fix x) (maybe-integerp-fix 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-integerp-fix-1 (implies (maybe-integer-equiv x x-equiv) (equal (maybe-integerp-fix x) (maybe-integerp-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm maybe-integerp-fix-under-maybe-integer-equiv (maybe-integer-equiv (maybe-integerp-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))