lemmas dom_const, dom_if
authorhaftmann
Fri, 23 Jan 2009 19:51:48 +0100
changeset 29622 2eeb09477ed3
parent 29619 82054da94a74
child 29623 1219985d24b5
lemmas dom_const, dom_if
src/HOL/Map.thy
--- a/src/HOL/Map.thy	Fri Jan 23 10:21:48 2009 +0100
+++ b/src/HOL/Map.thy	Fri Jan 23 19:51:48 2009 +0100
@@ -503,6 +503,15 @@
 lemma map_add_comm: "dom m1 \<inter> dom m2 = {} \<Longrightarrow> m1++m2 = m2++m1"
 by (rule ext) (force simp: map_add_def dom_def split: option.split)
 
+lemma dom_const [simp]:
+  "dom (\<lambda>x. Some y) = UNIV"
+  by auto
+
+lemma dom_if:
+  "dom (\<lambda>x. if P x then f x else g x) = dom f \<inter> {x. P x} \<union> dom g \<inter> {x. \<not> P x}"
+  by (auto split: if_splits)
+
+
 (* Due to John Matthews - could be rephrased with dom *)
 lemma finite_map_freshness:
   "finite (dom (f :: 'a \<rightharpoonup> 'b)) \<Longrightarrow> \<not> finite (UNIV :: 'a set) \<Longrightarrow>