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