This is a universal equivalence, introduced using def-universal-equiv.
Function:
(defun keys-equiv (x y) (declare (xargs :non-executable t)) (declare (xargs :guard t)) (prog2$ (throw-nonexec-error 'keys-equiv (list x y)) (let ((k (keys-equiv-witness x y))) (and (iff (hons-assoc-equal k x) (hons-assoc-equal k y))))))
Theorem:
(defthm keys-equiv-necc (implies (not (and (iff (hons-assoc-equal k x) (hons-assoc-equal k y)))) (not (keys-equiv x y))))
Theorem:
(defthm keys-equiv-witnessing-witness-rule-correct (implies (not ((lambda (k y x) (not (iff (hons-assoc-equal k x) (hons-assoc-equal k y)))) (keys-equiv-witness x y) y x)) (keys-equiv x y)) :rule-classes nil)
Theorem:
(defthm keys-equiv-instancing-instance-rule-correct (implies (not (iff (hons-assoc-equal k x) (hons-assoc-equal k y))) (not (keys-equiv x y))) :rule-classes nil)
Theorem:
(defthm keys-equiv-is-an-equivalence (and (booleanp (keys-equiv x y)) (keys-equiv x x) (implies (keys-equiv x y) (keys-equiv y x)) (implies (and (keys-equiv x y) (keys-equiv y z)) (keys-equiv x z))) :rule-classes (:equivalence))