(key-and-env-equiv x y) is an extension of 4v-env-equiv that additionally requires the keys match between the two alists.
This is a universal equivalence, introduced using def-universal-equiv.
Function:
(defun key-and-env-equiv (x y) (and (keys-equiv x y) (4v-env-equiv x y)))
Function:
(defun key-and-env-equiv (x y) (and (keys-equiv x y) (4v-env-equiv x y)))
Theorem:
(defthm key-and-env-equiv-is-an-equivalence (and (booleanp (key-and-env-equiv x y)) (key-and-env-equiv x x) (implies (key-and-env-equiv x y) (key-and-env-equiv y x)) (implies (and (key-and-env-equiv x y) (key-and-env-equiv y z)) (key-and-env-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm key-and-env-equiv-refines-4v-env-equiv (implies (key-and-env-equiv x y) (4v-env-equiv x y)) :rule-classes (:refinement))
Theorem:
(defthm key-and-env-equiv-implies-key-and-env-equiv-append-1 (implies (key-and-env-equiv a a-equiv) (key-and-env-equiv (append a b) (append a-equiv b))) :rule-classes (:congruence))
Theorem:
(defthm key-and-env-equiv-implies-key-and-env-equiv-append-2 (implies (key-and-env-equiv b b-equiv) (key-and-env-equiv (append a b) (append a b-equiv))) :rule-classes (:congruence))
Theorem:
(defthm 4v-env-equiv-to-key-and-env-equiv (implies (keys-equiv a b) (equal (4v-env-equiv a b) (key-and-env-equiv a b))))