This is a universal equivalence, introduced using def-universal-equiv.
Function:
(defun 4v-sexpr-list-equiv (x y) (declare (xargs :non-executable t)) (declare (xargs :guard t)) (declare (xargs :non-executable t)) (prog2$ (throw-nonexec-error '4v-sexpr-list-equiv (list x y)) (let ((env (4v-sexpr-list-equiv-witness x y))) (and (equal (4v-sexpr-eval-list x env) (4v-sexpr-eval-list y env))))))
Theorem:
(defthm 4v-sexpr-list-equiv-necc (implies (not (and (equal (4v-sexpr-eval-list x env) (4v-sexpr-eval-list y env)))) (not (4v-sexpr-list-equiv x y))))
Theorem:
(defthm 4v-sexpr-list-equiv-witnessing-witness-rule-correct (implies (not ((lambda (env y x) (not (equal (4v-sexpr-eval-list x env) (4v-sexpr-eval-list y env)))) (4v-sexpr-list-equiv-witness x y) y x)) (4v-sexpr-list-equiv x y)) :rule-classes nil)
Theorem:
(defthm 4v-sexpr-list-equiv-instancing-instance-rule-correct (implies (not (equal (4v-sexpr-eval-list x env) (4v-sexpr-eval-list y env))) (not (4v-sexpr-list-equiv x y))) :rule-classes nil)
Theorem:
(defthm 4v-sexpr-list-equiv-is-an-equivalence (and (booleanp (4v-sexpr-list-equiv x y)) (4v-sexpr-list-equiv x x) (implies (4v-sexpr-list-equiv x y) (4v-sexpr-list-equiv y x)) (implies (and (4v-sexpr-list-equiv x y) (4v-sexpr-list-equiv y z)) (4v-sexpr-list-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm 4v-sexpr-list-equiv-alt-def (equal (4v-sexpr-list-equiv x y) (if (atom x) (atom y) (and (consp y) (4v-sexpr-equiv (car x) (car y)) (4v-sexpr-list-equiv (cdr x) (cdr y))))) :rule-classes :definition)
Theorem:
(defthm 4v-sexpr-list-equiv-implies-equal-4v-sexpr-eval-list-1 (implies (4v-sexpr-list-equiv x x-equiv) (equal (4v-sexpr-eval-list x env) (4v-sexpr-eval-list x-equiv env))) :rule-classes (:congruence))
Theorem:
(defthm 4v-sexpr-list-equiv-implies-4v-sexpr-equiv-cons-2 (implies (4v-sexpr-list-equiv a a-equiv) (4v-sexpr-equiv (cons x a) (cons x a-equiv))) :rule-classes (:congruence))
Theorem:
(defthm 4v-sexpr-equiv-implies-4v-sexpr-list-equiv-cons-1 (implies (4v-sexpr-equiv a a-equiv) (4v-sexpr-list-equiv (cons a b) (cons a-equiv b))) :rule-classes (:congruence))
Theorem:
(defthm 4v-sexpr-list-equiv-implies-4v-sexpr-list-equiv-cons-2 (implies (4v-sexpr-list-equiv b b-equiv) (4v-sexpr-list-equiv (cons a b) (cons a b-equiv))) :rule-classes (:congruence))