equal
deleted
inserted
replaced
501 by(auto simp: dom_def override_on_def) |
501 by(auto simp: dom_def override_on_def) |
502 |
502 |
503 lemma map_add_comm: "dom m1 \<inter> dom m2 = {} \<Longrightarrow> m1++m2 = m2++m1" |
503 lemma map_add_comm: "dom m1 \<inter> dom m2 = {} \<Longrightarrow> m1++m2 = m2++m1" |
504 by (rule ext) (force simp: map_add_def dom_def split: option.split) |
504 by (rule ext) (force simp: map_add_def dom_def split: option.split) |
505 |
505 |
|
506 lemma dom_const [simp]: |
|
507 "dom (\<lambda>x. Some y) = UNIV" |
|
508 by auto |
|
509 |
|
510 lemma dom_if: |
|
511 "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}" |
|
512 by (auto split: if_splits) |
|
513 |
|
514 |
506 (* Due to John Matthews - could be rephrased with dom *) |
515 (* Due to John Matthews - could be rephrased with dom *) |
507 lemma finite_map_freshness: |
516 lemma finite_map_freshness: |
508 "finite (dom (f :: 'a \<rightharpoonup> 'b)) \<Longrightarrow> \<not> finite (UNIV :: 'a set) \<Longrightarrow> |
517 "finite (dom (f :: 'a \<rightharpoonup> 'b)) \<Longrightarrow> \<not> finite (UNIV :: 'a set) \<Longrightarrow> |
509 \<exists>x. f x = None" |
518 \<exists>x. f x = None" |
510 by(bestsimp dest:ex_new_if_finite) |
519 by(bestsimp dest:ex_new_if_finite) |