Some theorems about omaps.
Among other theorems, we introduce pick-a-point reasoning support for omap::submap. This is similar to pick-a-point reasoning fo subset, but we use a defun-sk and a ruleset for omaps, instead of the approach used for osets.
Theorem:
(defthm omap::lookup-of-update (equal (omap::lookup key (omap::update key1 val map)) (if (equal key key1) val (omap::lookup key map))))
Theorem:
(defthm omap::emptyp-of-keys-to-emptyp (equal (emptyp (omap::keys map)) (omap::emptyp map)))
Theorem:
(defthm omap::keys-of-delete (equal (omap::keys (omap::delete key map)) (delete key (omap::keys map))))
Theorem:
(defthm omap::assoc-of-delete (equal (omap::assoc key1 (omap::delete key map)) (if (equal key1 key) nil (omap::assoc key1 map))))
Theorem:
(defthm omap::lookup-of-delete (equal (omap::lookup key1 (omap::delete key map)) (if (equal key1 key) nil (omap::lookup key1 map))))
Theorem:
(defthm omap::assoc-of-submap-is-assoc-of-supermap-when-present (implies (omap::submap map1 map2) (implies (omap::assoc key map1) (equal (omap::assoc key map1) (omap::assoc key map2)))))
Theorem:
(defthm omap::submap-sk-necc (implies (omap::submap-sk map1 map2) (implies (omap::assoc key map1) (equal (omap::assoc key map1) (omap::assoc key map2)))))
Theorem:
(defthm omap::booleanp-of-submap-sk (b* ((bool (omap::submap-sk map1 map2))) (booleanp bool)) :rule-classes :type-prescription)
Theorem:
(defthm omap::submap-sk-of-tail-when-submap-sk (implies (omap::submap-sk map1 map2) (omap::submap-sk (omap::tail map1) map2)))
Theorem:
(defthm omap::submap-sk-when-submap (implies (omap::submap map1 map2) (omap::submap-sk map1 map2)))
Theorem:
(defthm omap::submap-when-submap-sk (implies (omap::submap-sk map1 map2) (omap::submap map1 map2)))
Theorem:
(defthm omap::submap-to-submap-sk (equal (omap::submap map1 map2) (omap::submap-sk map1 map2)))
Theorem:
(defthm submap-of-delete (omap::submap (omap::delete key map) map))