src/HOL/Map.thy
changeset 15693 3a67e61c6e96
parent 15691 900cf45ff0a6
child 15695 f072119afa4e
     1.1 --- a/src/HOL/Map.thy	Sun Apr 10 17:20:03 2005 +0200
     1.2 +++ b/src/HOL/Map.thy	Mon Apr 11 12:14:23 2005 +0200
     1.3 @@ -18,7 +18,7 @@
     1.4  consts
     1.5  chg_map	:: "('b => 'b) => 'a => ('a ~=> 'b) => ('a ~=> 'b)"
     1.6  map_add :: "('a ~=> 'b) => ('a ~=> 'b) => ('a ~=> 'b)" (infixl "++" 100)
     1.7 -restrict_map :: "('a ~=> 'b) => 'a set => ('a ~=> 'b)" (infixl "|^"  110)
     1.8 +restrict_map :: "('a ~=> 'b) => 'a set => ('a ~=> 'b)" (infixl "|`"  110)
     1.9  dom	:: "('a ~=> 'b) => 'a set"
    1.10  ran	:: "('a ~=> 'b) => 'b set"
    1.11  map_of	:: "('a * 'b)list => 'a ~=> 'b"
    1.12 @@ -55,7 +55,6 @@
    1.13    "_maplet"  :: "['a, 'a] => maplet"             ("_ /\<mapsto>/ _")
    1.14    "_maplets" :: "['a, 'a] => maplet"             ("_ /[\<mapsto>]/ _")
    1.15  
    1.16 -  restrict_map :: "('a ~=> 'b) => 'a set => ('a ~=> 'b)" (infixl "\<upharpoonright>" 110) --"requires amssymb!"
    1.17    map_upd_s  :: "('a ~=> 'b) => 'a set => 'b => ('a ~=> 'b)"
    1.18  				    		 ("_/'(_/{\<mapsto>}/_')" [900,0,0]900)
    1.19    map_subst :: "('a ~=> 'b) => 'b => 'b => 
    1.20 @@ -63,6 +62,9 @@
    1.21   "@chg_map" :: "('a ~=> 'b) => 'a => ('b => 'b) => ('a ~=> 'b)"
    1.22  					  ("_/'(_/\<mapsto>\<lambda>_. _')"  [900,0,0,0] 900)
    1.23  
    1.24 +syntax (latex output)
    1.25 +  restrict_map :: "('a ~=> 'b) => 'a set => ('a ~=> 'b)" ("_\<restriction>\<^bsub>_\<^esub>" [111,110] 110) --"requires amssymb!"
    1.26 +
    1.27  translations
    1.28    "empty"    => "_K None"
    1.29    "empty"    <= "%x. None"
    1.30 @@ -80,7 +82,7 @@
    1.31  chg_map_def:  "chg_map f a m == case m a of None => m | Some b => m(a|->f b)"
    1.32  
    1.33  map_add_def:   "m1++m2 == %x. case m2 x of None => m1 x | Some y => Some y"
    1.34 -restrict_map_def: "m|^A == %x. if x : A then m x else None"
    1.35 +restrict_map_def: "m|`A == %x. if x : A then m x else None"
    1.36  
    1.37  map_upds_def: "m(xs [|->] ys) == m ++ map_of (rev(zip xs ys))"
    1.38  map_upd_s_def: "m(as{|->}b) == %x. if x : as then Some b else m x"
    1.39 @@ -324,44 +326,44 @@
    1.40  
    1.41  subsection {* @{term restrict_map} *}
    1.42  
    1.43 -lemma restrict_map_to_empty[simp]: "m|^{} = empty"
    1.44 +lemma restrict_map_to_empty[simp]: "m|`{} = empty"
    1.45  by(simp add: restrict_map_def)
    1.46  
    1.47 -lemma restrict_map_empty[simp]: "empty|^D = empty"
    1.48 +lemma restrict_map_empty[simp]: "empty|`D = empty"
    1.49  by(simp add: restrict_map_def)
    1.50  
    1.51 -lemma restrict_in [simp]: "x \<in> A \<Longrightarrow> (m|^A) x = m x"
    1.52 +lemma restrict_in [simp]: "x \<in> A \<Longrightarrow> (m|`A) x = m x"
    1.53  by (auto simp: restrict_map_def)
    1.54  
    1.55 -lemma restrict_out [simp]: "x \<notin> A \<Longrightarrow> (m|^A) x = None"
    1.56 +lemma restrict_out [simp]: "x \<notin> A \<Longrightarrow> (m|`A) x = None"
    1.57  by (auto simp: restrict_map_def)
    1.58  
    1.59 -lemma ran_restrictD: "y \<in> ran (m|^A) \<Longrightarrow> \<exists>x\<in>A. m x = Some y"
    1.60 +lemma ran_restrictD: "y \<in> ran (m|`A) \<Longrightarrow> \<exists>x\<in>A. m x = Some y"
    1.61  by (auto simp: restrict_map_def ran_def split: split_if_asm)
    1.62  
    1.63 -lemma dom_restrict [simp]: "dom (m|^A) = dom m \<inter> A"
    1.64 +lemma dom_restrict [simp]: "dom (m|`A) = dom m \<inter> A"
    1.65  by (auto simp: restrict_map_def dom_def split: split_if_asm)
    1.66  
    1.67 -lemma restrict_upd_same [simp]: "m(x\<mapsto>y)|^(-{x}) = m|^(-{x})"
    1.68 +lemma restrict_upd_same [simp]: "m(x\<mapsto>y)|`(-{x}) = m|`(-{x})"
    1.69  by (rule ext, auto simp: restrict_map_def)
    1.70  
    1.71 -lemma restrict_restrict [simp]: "m|^A|^B = m|^(A\<inter>B)"
    1.72 +lemma restrict_restrict [simp]: "m|`A|`B = m|`(A\<inter>B)"
    1.73  by (rule ext, auto simp: restrict_map_def)
    1.74  
    1.75  lemma restrict_fun_upd[simp]:
    1.76 - "m(x := y)|^D = (if x \<in> D then (m|^(D-{x}))(x := y) else m|^D)"
    1.77 + "m(x := y)|`D = (if x \<in> D then (m|`(D-{x}))(x := y) else m|`D)"
    1.78  by(simp add: restrict_map_def expand_fun_eq)
    1.79  
    1.80  lemma fun_upd_None_restrict[simp]:
    1.81 -  "(m|^D)(x := None) = (if x:D then m|^(D - {x}) else m|^D)"
    1.82 +  "(m|`D)(x := None) = (if x:D then m|`(D - {x}) else m|`D)"
    1.83  by(simp add: restrict_map_def expand_fun_eq)
    1.84  
    1.85  lemma fun_upd_restrict:
    1.86 - "(m|^D)(x := y) = (m|^(D-{x}))(x := y)"
    1.87 + "(m|`D)(x := y) = (m|`(D-{x}))(x := y)"
    1.88  by(simp add: restrict_map_def expand_fun_eq)
    1.89  
    1.90  lemma fun_upd_restrict_conv[simp]:
    1.91 - "x \<in> D \<Longrightarrow> (m|^D)(x := y) = (m|^(D-{x}))(x := y)"
    1.92 + "x \<in> D \<Longrightarrow> (m|`D)(x := y) = (m|`(D-{x}))(x := y)"
    1.93  by(simp add: restrict_map_def expand_fun_eq)
    1.94  
    1.95  
    1.96 @@ -432,7 +434,7 @@
    1.97  
    1.98  lemma restrict_map_upds[simp]: "!!m ys.
    1.99   \<lbrakk> length xs = length ys; set xs \<subseteq> D \<rbrakk>
   1.100 - \<Longrightarrow> m(xs [\<mapsto>] ys)|^D = (m|^(D - set xs))(xs [\<mapsto>] ys)"
   1.101 + \<Longrightarrow> m(xs [\<mapsto>] ys)|`D = (m|`(D - set xs))(xs [\<mapsto>] ys)"
   1.102  apply (induct xs, simp)
   1.103  apply (case_tac ys, simp)
   1.104  apply(simp add:Diff_insert[symmetric] insert_absorb)