Generic equivalence relation among typed list elements.
Function:
(defun element-equiv (x y) (equal (element-fix x) (element-fix y)))
Theorem:
(defthm element-equiv-is-an-equivalence (and (booleanp (element-equiv x y)) (element-equiv x x) (implies (element-equiv x y) (element-equiv y x)) (implies (and (element-equiv x y) (element-equiv y z)) (element-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm element-equiv-implies-equal-element-fix-1 (implies (element-equiv x x-equiv) (equal (element-fix x) (element-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm element-fix-under-element-equiv (element-equiv (element-fix x) x))
Theorem:
(defthm equal-of-element-fix-1-forward-to-element-equiv (implies (equal (element-fix x) y) (element-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-element-fix-2-forward-to-element-equiv (implies (equal x (element-fix y)) (element-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm element-equiv-of-element-fix-1-forward (implies (element-equiv (element-fix x) y) (element-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm element-equiv-of-element-fix-2-forward (implies (element-equiv x (element-fix y)) (element-equiv x y)) :rule-classes :forward-chaining)