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