Performance note. In the execution, this is just an inlined call of eql.
Function:
(defun maybe-bit-equiv$inline (x y) (declare (xargs :guard (and (maybe-bitp x) (maybe-bitp y)))) (eql (maybe-bit-fix x) (maybe-bit-fix y)))
Theorem:
(defthm maybe-bit-equiv-is-an-equivalence (and (booleanp (maybe-bit-equiv x y)) (maybe-bit-equiv x x) (implies (maybe-bit-equiv x y) (maybe-bit-equiv y x)) (implies (and (maybe-bit-equiv x y) (maybe-bit-equiv y z)) (maybe-bit-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm maybe-bit-equiv-implies-equal-maybe-bit-fix-1 (implies (maybe-bit-equiv x x-equiv) (equal (maybe-bit-fix x) (maybe-bit-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm maybe-bit-fix-under-maybe-bit-equiv (maybe-bit-equiv (maybe-bit-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))