This is a universal equivalence, introduced using def-universal-equiv.
Function:
(defun nth-equiv (x y) (declare (xargs :non-executable t)) (declare (xargs :guard t)) (prog2$ (throw-nonexec-error 'nth-equiv (list x y)) (let ((n (nth-equiv-witness x y))) (and (equal (nth n x) (nth n y))))))
Theorem:
(defthm nth-equiv-necc (implies (not (and (equal (nth n x) (nth n y)))) (not (nth-equiv x y))))
Theorem:
(defthm nth-equiv-is-an-equivalence (and (booleanp (nth-equiv x y)) (nth-equiv x x) (implies (nth-equiv x y) (nth-equiv y x)) (implies (and (nth-equiv x y) (nth-equiv y z)) (nth-equiv x z))) :rule-classes (:equivalence))