more theorems
authorhaftmann
Mon, 05 May 2025 12:42:40 +0200
changeset 82602 700f9b01c9d9
parent 82601 43f4f9c5c6bd
child 82604 5540532087fa
more theorems
src/HOL/Map.thy
--- a/src/HOL/Map.thy	Sun May 04 21:03:04 2025 +0100
+++ b/src/HOL/Map.thy	Mon May 05 12:42:40 2025 +0200
@@ -297,6 +297,10 @@
   "map_of (map (\<lambda>(k, v). (k, f v)) xs) = map_option f \<circ> map_of xs"
   by (induct xs) (auto simp: fun_eq_iff)
 
+lemma map_of_filter:
+  "map_of (filter (\<lambda>x. P (fst x)) xs) = map_of xs |` Collect P"
+  by (induct xs) (simp_all add: fun_eq_iff restrict_map_def)
+
 lemma dom_map_option:
   "dom (\<lambda>k. map_option (f k) (m k)) = dom m"
   by (simp add: dom_def)