| author | kleing | 
| Wed, 07 Nov 2007 03:51:17 +0100 | |
| changeset 25322 | e2eac0c30ff5 | 
| parent 24572 | 7be5353ec4bd | 
| child 25950 | a3067f6f08a2 | 
| permissions | -rw-r--r-- | 
| 17870 | 1 | (* $Id$ *) | 
| 2 | ||
| 19494 | 3 | theory Nominal | 
| 20809 | 4 | imports Main Infinite_Set | 
| 18068 | 5 | uses | 
| 22245 
1b8f4ef50c48
moved the infrastructure from the nominal_tags file to nominal_thmdecls
 urbanc parents: 
22231diff
changeset | 6 |   ("nominal_thmdecls.ML")
 | 
| 18068 | 7 |   ("nominal_atoms.ML")
 | 
| 8 |   ("nominal_package.ML")
 | |
| 18264 | 9 |   ("nominal_induct.ML") 
 | 
| 18068 | 10 |   ("nominal_permeq.ML")
 | 
| 22762 | 11 |   ("nominal_fresh_fun.ML")
 | 
| 21541 
ea881fbe0489
Implemented new "nominal_primrec" command for defining
 berghofe parents: 
21405diff
changeset | 12 |   ("nominal_primrec.ML")
 | 
| 22312 | 13 |   ("nominal_inductive.ML")
 | 
| 17870 | 14 | begin | 
| 15 | ||
| 16 | section {* Permutations *}
 | |
| 17 | (*======================*) | |
| 18 | ||
| 19 | types | |
| 20 |   'x prm = "('x \<times> 'x) list"
 | |
| 21 | ||
| 19477 | 22 | (* polymorphic operations for permutation and swapping *) | 
| 17870 | 23 | consts | 
| 18491 | 24 | perm :: "'x prm \<Rightarrow> 'a \<Rightarrow> 'a" (infixr "\<bullet>" 80) | 
| 17870 | 25 |   swap :: "('x \<times> 'x) \<Rightarrow> 'x \<Rightarrow> 'x"
 | 
| 26 | ||
| 24544 | 27 | (* an auxiliary constant for the decision procedure involving *) | 
| 28 | (* permutations (to avoid loops when using perm-composition) *) | |
| 19477 | 29 | constdefs | 
| 30 | "perm_aux pi x \<equiv> pi\<bullet>x" | |
| 31 | ||
| 17870 | 32 | (* permutation on sets *) | 
| 19634 
c78cf8981c5d
defs (unchecked overloaded), including former primrec;
 wenzelm parents: 
19566diff
changeset | 33 | defs (unchecked overloaded) | 
| 22829 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 34 |   perm_set_def:  "pi\<bullet>(X::'a set) \<equiv> {pi\<bullet>x | x. x\<in>X}"
 | 
| 17870 | 35 | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 36 | lemma empty_eqvt: | 
| 18656 | 37 |   shows "pi\<bullet>{} = {}"
 | 
| 38 | by (simp add: perm_set_def) | |
| 39 | ||
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 40 | lemma union_eqvt: | 
| 18264 | 41 | shows "pi \<bullet> (X \<union> Y) = (pi \<bullet> X) \<union> (pi \<bullet> Y)" | 
| 42 | by (auto simp add: perm_set_def) | |
| 43 | ||
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 44 | lemma insert_eqvt: | 
| 18656 | 45 | shows "pi\<bullet>(insert x X) = insert (pi\<bullet>x) (pi\<bullet>X)" | 
| 46 | by (auto simp add: perm_set_def) | |
| 47 | ||
| 17870 | 48 | (* permutation on units and products *) | 
| 19687 | 49 | primrec (unchecked perm_unit) | 
| 50 | "pi\<bullet>() = ()" | |
| 51 | ||
| 52 | primrec (unchecked perm_prod) | |
| 22829 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 53 | "pi\<bullet>(x,y) = (pi\<bullet>x,pi\<bullet>y)" | 
| 17870 | 54 | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 55 | lemma fst_eqvt: | 
| 17870 | 56 | "pi\<bullet>(fst x) = fst (pi\<bullet>x)" | 
| 19634 
c78cf8981c5d
defs (unchecked overloaded), including former primrec;
 wenzelm parents: 
19566diff
changeset | 57 | by (cases x) simp | 
| 17870 | 58 | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 59 | lemma snd_eqvt: | 
| 17870 | 60 | "pi\<bullet>(snd x) = snd (pi\<bullet>x)" | 
| 19634 
c78cf8981c5d
defs (unchecked overloaded), including former primrec;
 wenzelm parents: 
19566diff
changeset | 61 | by (cases x) simp | 
| 17870 | 62 | |
| 63 | (* permutation on lists *) | |
| 19687 | 64 | primrec (unchecked perm_list) | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 65 | nil_eqvt: "pi\<bullet>[] = []" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 66 | cons_eqvt: "pi\<bullet>(x#xs) = (pi\<bullet>x)#(pi\<bullet>xs)" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 67 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 68 | lemma append_eqvt: | 
| 17870 | 69 | fixes pi :: "'x prm" | 
| 70 | and l1 :: "'a list" | |
| 71 | and l2 :: "'a list" | |
| 72 | shows "pi\<bullet>(l1@l2) = (pi\<bullet>l1)@(pi\<bullet>l2)" | |
| 19634 
c78cf8981c5d
defs (unchecked overloaded), including former primrec;
 wenzelm parents: 
19566diff
changeset | 73 | by (induct l1) auto | 
| 17870 | 74 | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 75 | lemma rev_eqvt: | 
| 17870 | 76 | fixes pi :: "'x prm" | 
| 77 | and l :: "'a list" | |
| 78 | shows "pi\<bullet>(rev l) = rev (pi\<bullet>l)" | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 79 | by (induct l) (simp_all add: append_eqvt) | 
| 17870 | 80 | |
| 22768 
d41fe3416f52
simplified the proof of pt_set_eqvt (as suggested by Randy Pollack)
 urbanc parents: 
22762diff
changeset | 81 | lemma set_eqvt: | 
| 
d41fe3416f52
simplified the proof of pt_set_eqvt (as suggested by Randy Pollack)
 urbanc parents: 
22762diff
changeset | 82 | fixes pi :: "'x prm" | 
| 
d41fe3416f52
simplified the proof of pt_set_eqvt (as suggested by Randy Pollack)
 urbanc parents: 
22762diff
changeset | 83 | and xs :: "'a list" | 
| 
d41fe3416f52
simplified the proof of pt_set_eqvt (as suggested by Randy Pollack)
 urbanc parents: 
22762diff
changeset | 84 | shows "pi\<bullet>(set xs) = set (pi\<bullet>xs)" | 
| 
d41fe3416f52
simplified the proof of pt_set_eqvt (as suggested by Randy Pollack)
 urbanc parents: 
22762diff
changeset | 85 | by (induct xs, auto simp add: empty_eqvt insert_eqvt) | 
| 
d41fe3416f52
simplified the proof of pt_set_eqvt (as suggested by Randy Pollack)
 urbanc parents: 
22762diff
changeset | 86 | |
| 17870 | 87 | (* permutation on functions *) | 
| 19634 
c78cf8981c5d
defs (unchecked overloaded), including former primrec;
 wenzelm parents: 
19566diff
changeset | 88 | defs (unchecked overloaded) | 
| 17870 | 89 | perm_fun_def: "pi\<bullet>(f::'a\<Rightarrow>'b) \<equiv> (\<lambda>x. pi\<bullet>f((rev pi)\<bullet>x))" | 
| 90 | ||
| 91 | (* permutation on bools *) | |
| 19687 | 92 | primrec (unchecked perm_bool) | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 93 | true_eqvt: "pi\<bullet>True = True" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 94 | false_eqvt: "pi\<bullet>False = False" | 
| 17870 | 95 | |
| 18264 | 96 | lemma perm_bool: | 
| 97 | shows "pi\<bullet>(b::bool) = b" | |
| 19634 
c78cf8981c5d
defs (unchecked overloaded), including former primrec;
 wenzelm parents: 
19566diff
changeset | 98 | by (cases b) auto | 
| 18264 | 99 | |
| 19972 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 100 | lemma perm_boolI: | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 101 | assumes a: "P" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 102 | shows "pi\<bullet>P" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 103 | using a by (simp add: perm_bool) | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 104 | |
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 105 | lemma perm_boolE: | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 106 | assumes a: "pi\<bullet>P" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 107 | shows "P" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 108 | using a by (simp add: perm_bool) | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 109 | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 110 | lemma if_eqvt: | 
| 21010 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 111 | fixes pi::"'a prm" | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 112 | shows "pi\<bullet>(if b then c1 else c2) = (if (pi\<bullet>b) then (pi\<bullet>c1) else (pi\<bullet>c2))" | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 113 | apply(simp add: perm_fun_def) | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 114 | done | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 115 | |
| 22514 | 116 | lemma imp_eqvt: | 
| 117 | shows "pi\<bullet>(A\<longrightarrow>B) = ((pi\<bullet>A)\<longrightarrow>(pi\<bullet>B))" | |
| 118 | by (simp add: perm_bool) | |
| 119 | ||
| 120 | lemma conj_eqvt: | |
| 121 | shows "pi\<bullet>(A\<and>B) = ((pi\<bullet>A)\<and>(pi\<bullet>B))" | |
| 122 | by (simp add: perm_bool) | |
| 123 | ||
| 124 | lemma disj_eqvt: | |
| 125 | shows "pi\<bullet>(A\<or>B) = ((pi\<bullet>A)\<or>(pi\<bullet>B))" | |
| 126 | by (simp add: perm_bool) | |
| 127 | ||
| 128 | lemma neg_eqvt: | |
| 129 | shows "pi\<bullet>(\<not> A) = (\<not> (pi\<bullet>A))" | |
| 130 | by (simp add: perm_bool) | |
| 131 | ||
| 17870 | 132 | (* permutation on options *) | 
| 21010 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 133 | |
| 19687 | 134 | primrec (unchecked perm_option) | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 135 | some_eqvt: "pi\<bullet>Some(x) = Some(pi\<bullet>x)" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 136 | none_eqvt: "pi\<bullet>None = None" | 
| 17870 | 137 | |
| 138 | (* a "private" copy of the option type used in the abstraction function *) | |
| 18579 
002d371401f5
changed the name of the type "nOption" to "noption".
 urbanc parents: 
18578diff
changeset | 139 | datatype 'a noption = nSome 'a | nNone | 
| 17870 | 140 | |
| 19687 | 141 | primrec (unchecked perm_noption) | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 142 | nSome_eqvt: "pi\<bullet>nSome(x) = nSome(pi\<bullet>x)" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 143 | nNone_eqvt: "pi\<bullet>nNone = nNone" | 
| 18600 | 144 | |
| 145 | (* a "private" copy of the product type used in the nominal induct method *) | |
| 146 | datatype ('a,'b) nprod = nPair 'a 'b
 | |
| 147 | ||
| 19687 | 148 | primrec (unchecked perm_nprod) | 
| 149 | perm_nProd_def: "pi\<bullet>(nPair x1 x2) = nPair (pi\<bullet>x1) (pi\<bullet>x2)" | |
| 17870 | 150 | |
| 151 | (* permutation on characters (used in strings) *) | |
| 19634 
c78cf8981c5d
defs (unchecked overloaded), including former primrec;
 wenzelm parents: 
19566diff
changeset | 152 | defs (unchecked overloaded) | 
| 23050 | 153 | perm_char_def: "pi\<bullet>(c::char) \<equiv> c" | 
| 154 | ||
| 155 | lemma perm_string: | |
| 156 | fixes s::"string" | |
| 157 | shows "pi\<bullet>s = s" | |
| 158 | by (induct s)(auto simp add: perm_char_def) | |
| 17870 | 159 | |
| 160 | (* permutation on ints *) | |
| 19634 
c78cf8981c5d
defs (unchecked overloaded), including former primrec;
 wenzelm parents: 
19566diff
changeset | 161 | defs (unchecked overloaded) | 
| 17870 | 162 | perm_int_def: "pi\<bullet>(i::int) \<equiv> i" | 
| 163 | ||
| 164 | (* permutation on nats *) | |
| 19634 
c78cf8981c5d
defs (unchecked overloaded), including former primrec;
 wenzelm parents: 
19566diff
changeset | 165 | defs (unchecked overloaded) | 
| 17870 | 166 | perm_nat_def: "pi\<bullet>(i::nat) \<equiv> i" | 
| 167 | ||
| 168 | section {* permutation equality *}
 | |
| 169 | (*==============================*) | |
| 170 | ||
| 171 | constdefs | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 172 |   prm_eq :: "'x prm \<Rightarrow> 'x prm \<Rightarrow> bool"  (" _ \<triangleq> _ " [80,80] 80)
 | 
| 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 173 | "pi1 \<triangleq> pi2 \<equiv> \<forall>a::'x. pi1\<bullet>a = pi2\<bullet>a" | 
| 17870 | 174 | |
| 175 | section {* Support, Freshness and Supports*}
 | |
| 176 | (*========================================*) | |
| 177 | constdefs | |
| 178 |    supp :: "'a \<Rightarrow> ('x set)"  
 | |
| 179 |    "supp x \<equiv> {a . (infinite {b . [(a,b)]\<bullet>x \<noteq> x})}"
 | |
| 180 | ||
| 17871 | 181 |    fresh :: "'x \<Rightarrow> 'a \<Rightarrow> bool" ("_ \<sharp> _" [80,80] 80)
 | 
| 17870 | 182 | "a \<sharp> x \<equiv> a \<notin> supp x" | 
| 183 | ||
| 22808 | 184 | supports :: "'x set \<Rightarrow> 'a \<Rightarrow> bool" (infixl "supports" 80) | 
| 17870 | 185 | "S supports x \<equiv> \<forall>a b. (a\<notin>S \<and> b\<notin>S \<longrightarrow> [(a,b)]\<bullet>x=x)" | 
| 186 | ||
| 187 | lemma supp_fresh_iff: | |
| 188 | fixes x :: "'a" | |
| 189 |   shows "(supp x) = {a::'x. \<not>a\<sharp>x}"
 | |
| 190 | apply(simp add: fresh_def) | |
| 191 | done | |
| 192 | ||
| 193 | lemma supp_unit: | |
| 194 |   shows "supp () = {}"
 | |
| 195 | by (simp add: supp_def) | |
| 196 | ||
| 18264 | 197 | lemma supp_set_empty: | 
| 198 |   shows "supp {} = {}"
 | |
| 199 | by (force simp add: supp_def perm_set_def) | |
| 200 | ||
| 201 | lemma supp_singleton: | |
| 202 |   shows "supp {x} = supp x"
 | |
| 203 | by (force simp add: supp_def perm_set_def) | |
| 204 | ||
| 17870 | 205 | lemma supp_prod: | 
| 206 | fixes x :: "'a" | |
| 207 | and y :: "'b" | |
| 208 | shows "(supp (x,y)) = (supp x)\<union>(supp y)" | |
| 209 | by (force simp add: supp_def Collect_imp_eq Collect_neg_eq) | |
| 210 | ||
| 18600 | 211 | lemma supp_nprod: | 
| 212 | fixes x :: "'a" | |
| 213 | and y :: "'b" | |
| 214 | shows "(supp (nPair x y)) = (supp x)\<union>(supp y)" | |
| 215 | by (force simp add: supp_def Collect_imp_eq Collect_neg_eq) | |
| 216 | ||
| 17870 | 217 | lemma supp_list_nil: | 
| 218 |   shows "supp [] = {}"
 | |
| 219 | apply(simp add: supp_def) | |
| 220 | done | |
| 221 | ||
| 222 | lemma supp_list_cons: | |
| 223 | fixes x :: "'a" | |
| 224 | and xs :: "'a list" | |
| 225 | shows "supp (x#xs) = (supp x)\<union>(supp xs)" | |
| 226 | apply(auto simp add: supp_def Collect_imp_eq Collect_neg_eq) | |
| 227 | done | |
| 228 | ||
| 229 | lemma supp_list_append: | |
| 230 | fixes xs :: "'a list" | |
| 231 | and ys :: "'a list" | |
| 232 | shows "supp (xs@ys) = (supp xs)\<union>(supp ys)" | |
| 233 | by (induct xs, auto simp add: supp_list_nil supp_list_cons) | |
| 234 | ||
| 235 | lemma supp_list_rev: | |
| 236 | fixes xs :: "'a list" | |
| 237 | shows "supp (rev xs) = (supp xs)" | |
| 238 | by (induct xs, auto simp add: supp_list_append supp_list_cons supp_list_nil) | |
| 239 | ||
| 240 | lemma supp_bool: | |
| 241 | fixes x :: "bool" | |
| 242 |   shows "supp (x) = {}"
 | |
| 243 | apply(case_tac "x") | |
| 244 | apply(simp_all add: supp_def) | |
| 245 | done | |
| 246 | ||
| 247 | lemma supp_some: | |
| 248 | fixes x :: "'a" | |
| 249 | shows "supp (Some x) = (supp x)" | |
| 250 | apply(simp add: supp_def) | |
| 251 | done | |
| 252 | ||
| 253 | lemma supp_none: | |
| 254 | fixes x :: "'a" | |
| 255 |   shows "supp (None) = {}"
 | |
| 256 | apply(simp add: supp_def) | |
| 257 | done | |
| 258 | ||
| 259 | lemma supp_int: | |
| 260 | fixes i::"int" | |
| 261 |   shows "supp (i) = {}"
 | |
| 262 | apply(simp add: supp_def perm_int_def) | |
| 263 | done | |
| 264 | ||
| 20388 | 265 | lemma supp_nat: | 
| 266 | fixes n::"nat" | |
| 267 |   shows "supp (n) = {}"
 | |
| 268 | apply(simp add: supp_def perm_nat_def) | |
| 269 | done | |
| 270 | ||
| 18627 | 271 | lemma supp_char: | 
| 272 | fixes c::"char" | |
| 273 |   shows "supp (c) = {}"
 | |
| 274 | apply(simp add: supp_def perm_char_def) | |
| 275 | done | |
| 276 | ||
| 277 | lemma supp_string: | |
| 278 | fixes s::"string" | |
| 279 |   shows "supp (s) = {}"
 | |
| 23050 | 280 | apply(simp add: supp_def perm_string) | 
| 18627 | 281 | done | 
| 282 | ||
| 18264 | 283 | lemma fresh_set_empty: | 
| 284 |   shows "a\<sharp>{}"
 | |
| 285 | by (simp add: fresh_def supp_set_empty) | |
| 286 | ||
| 18578 | 287 | lemma fresh_singleton: | 
| 288 |   shows "a\<sharp>{x} = a\<sharp>x"
 | |
| 289 | by (simp add: fresh_def supp_singleton) | |
| 290 | ||
| 19858 | 291 | lemma fresh_unit: | 
| 292 | shows "a\<sharp>()" | |
| 293 | by (simp add: fresh_def supp_unit) | |
| 294 | ||
| 17870 | 295 | lemma fresh_prod: | 
| 296 | fixes a :: "'x" | |
| 297 | and x :: "'a" | |
| 298 | and y :: "'b" | |
| 299 | shows "a\<sharp>(x,y) = (a\<sharp>x \<and> a\<sharp>y)" | |
| 300 | by (simp add: fresh_def supp_prod) | |
| 301 | ||
| 302 | lemma fresh_list_nil: | |
| 303 | fixes a :: "'x" | |
| 18264 | 304 | shows "a\<sharp>[]" | 
| 17870 | 305 | by (simp add: fresh_def supp_list_nil) | 
| 306 | ||
| 307 | lemma fresh_list_cons: | |
| 308 | fixes a :: "'x" | |
| 309 | and x :: "'a" | |
| 310 | and xs :: "'a list" | |
| 311 | shows "a\<sharp>(x#xs) = (a\<sharp>x \<and> a\<sharp>xs)" | |
| 312 | by (simp add: fresh_def supp_list_cons) | |
| 313 | ||
| 314 | lemma fresh_list_append: | |
| 315 | fixes a :: "'x" | |
| 316 | and xs :: "'a list" | |
| 317 | and ys :: "'a list" | |
| 318 | shows "a\<sharp>(xs@ys) = (a\<sharp>xs \<and> a\<sharp>ys)" | |
| 319 | by (simp add: fresh_def supp_list_append) | |
| 320 | ||
| 321 | lemma fresh_list_rev: | |
| 322 | fixes a :: "'x" | |
| 323 | and xs :: "'a list" | |
| 324 | shows "a\<sharp>(rev xs) = a\<sharp>xs" | |
| 325 | by (simp add: fresh_def supp_list_rev) | |
| 326 | ||
| 327 | lemma fresh_none: | |
| 328 | fixes a :: "'x" | |
| 329 | shows "a\<sharp>None" | |
| 22831 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 330 | by (simp add: fresh_def supp_none) | 
| 17870 | 331 | |
| 332 | lemma fresh_some: | |
| 333 | fixes a :: "'x" | |
| 334 | and x :: "'a" | |
| 335 | shows "a\<sharp>(Some x) = a\<sharp>x" | |
| 22831 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 336 | by (simp add: fresh_def supp_some) | 
| 17870 | 337 | |
| 21010 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 338 | lemma fresh_int: | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 339 | fixes a :: "'x" | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 340 | and i :: "int" | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 341 | shows "a\<sharp>i" | 
| 22831 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 342 | by (simp add: fresh_def supp_int) | 
| 21010 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 343 | |
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 344 | lemma fresh_nat: | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 345 | fixes a :: "'x" | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 346 | and n :: "nat" | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 347 | shows "a\<sharp>n" | 
| 22831 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 348 | by (simp add: fresh_def supp_nat) | 
| 21010 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 349 | |
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 350 | lemma fresh_char: | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 351 | fixes a :: "'x" | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 352 | and c :: "char" | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 353 | shows "a\<sharp>c" | 
| 22831 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 354 | by (simp add: fresh_def supp_char) | 
| 21010 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 355 | |
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 356 | lemma fresh_string: | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 357 | fixes a :: "'x" | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 358 | and s :: "string" | 
| 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 359 | shows "a\<sharp>s" | 
| 22831 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 360 | by (simp add: fresh_def supp_string) | 
| 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 361 | |
| 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 362 | lemma fresh_bool: | 
| 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 363 | fixes a :: "'x" | 
| 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 364 | and b :: "bool" | 
| 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 365 | shows "a\<sharp>b" | 
| 
18f4014e1259
tuned some of the proofs and added the lemma fresh_bool
 urbanc parents: 
22829diff
changeset | 366 | by (simp add: fresh_def supp_bool) | 
| 21010 
7fe928722821
added the missing freshness-lemmas for nat, int, char and string and
 urbanc parents: 
20809diff
changeset | 367 | |
| 18294 
bbfd64cc91ab
fresh_unit_elim and fresh_prod_elim -- for nominal_induct;
 wenzelm parents: 
18268diff
changeset | 368 | text {* Normalization of freshness results; cf.\ @{text nominal_induct} *}
 | 
| 
bbfd64cc91ab
fresh_unit_elim and fresh_prod_elim -- for nominal_induct;
 wenzelm parents: 
18268diff
changeset | 369 | |
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 370 | lemma fresh_unit_elim: | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 371 | shows "(a\<sharp>() \<Longrightarrow> PROP C) \<equiv> PROP C" | 
| 18294 
bbfd64cc91ab
fresh_unit_elim and fresh_prod_elim -- for nominal_induct;
 wenzelm parents: 
18268diff
changeset | 372 | by (simp add: fresh_def supp_unit) | 
| 
bbfd64cc91ab
fresh_unit_elim and fresh_prod_elim -- for nominal_induct;
 wenzelm parents: 
18268diff
changeset | 373 | |
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 374 | lemma fresh_prod_elim: | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 375 | shows "(a\<sharp>(x,y) \<Longrightarrow> PROP C) \<equiv> (a\<sharp>x \<Longrightarrow> a\<sharp>y \<Longrightarrow> PROP C)" | 
| 18294 
bbfd64cc91ab
fresh_unit_elim and fresh_prod_elim -- for nominal_induct;
 wenzelm parents: 
18268diff
changeset | 376 | by rule (simp_all add: fresh_prod) | 
| 
bbfd64cc91ab
fresh_unit_elim and fresh_prod_elim -- for nominal_induct;
 wenzelm parents: 
18268diff
changeset | 377 | |
| 21405 
26b51f724fe6
added an intro lemma for freshness of products; set up
 urbanc parents: 
21377diff
changeset | 378 | (* this rule needs to be added before the fresh_prodD is *) | 
| 
26b51f724fe6
added an intro lemma for freshness of products; set up
 urbanc parents: 
21377diff
changeset | 379 | (* added to the simplifier with mksimps *) | 
| 
26b51f724fe6
added an intro lemma for freshness of products; set up
 urbanc parents: 
21377diff
changeset | 380 | lemma [simp]: | 
| 
26b51f724fe6
added an intro lemma for freshness of products; set up
 urbanc parents: 
21377diff
changeset | 381 | shows "a\<sharp>x1 \<Longrightarrow> a\<sharp>x2 \<Longrightarrow> a\<sharp>(x1,x2)" | 
| 
26b51f724fe6
added an intro lemma for freshness of products; set up
 urbanc parents: 
21377diff
changeset | 382 | by (simp add: fresh_prod) | 
| 
26b51f724fe6
added an intro lemma for freshness of products; set up
 urbanc parents: 
21377diff
changeset | 383 | |
| 21318 
edb595802d22
added fresh_prodD, which is included fresh_prodD into mksimps setup;
 wenzelm parents: 
21010diff
changeset | 384 | lemma fresh_prodD: | 
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 385 | shows "a\<sharp>(x,y) \<Longrightarrow> a\<sharp>x" | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 386 | and "a\<sharp>(x,y) \<Longrightarrow> a\<sharp>y" | 
| 21318 
edb595802d22
added fresh_prodD, which is included fresh_prodD into mksimps setup;
 wenzelm parents: 
21010diff
changeset | 387 | by (simp_all add: fresh_prod) | 
| 
edb595802d22
added fresh_prodD, which is included fresh_prodD into mksimps setup;
 wenzelm parents: 
21010diff
changeset | 388 | |
| 
edb595802d22
added fresh_prodD, which is included fresh_prodD into mksimps setup;
 wenzelm parents: 
21010diff
changeset | 389 | ML_setup {*
 | 
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 390 |   val mksimps_pairs = ("Nominal.fresh", thms "fresh_prodD")::mksimps_pairs;
 | 
| 21318 
edb595802d22
added fresh_prodD, which is included fresh_prodD into mksimps setup;
 wenzelm parents: 
21010diff
changeset | 391 | change_simpset (fn ss => ss setmksimps (mksimps mksimps_pairs)); | 
| 
edb595802d22
added fresh_prodD, which is included fresh_prodD into mksimps setup;
 wenzelm parents: 
21010diff
changeset | 392 | *} | 
| 
edb595802d22
added fresh_prodD, which is included fresh_prodD into mksimps setup;
 wenzelm parents: 
21010diff
changeset | 393 | |
| 18294 
bbfd64cc91ab
fresh_unit_elim and fresh_prod_elim -- for nominal_induct;
 wenzelm parents: 
18268diff
changeset | 394 | |
| 17870 | 395 | section {* Abstract Properties for Permutations and  Atoms *}
 | 
| 396 | (*=========================================================*) | |
| 397 | ||
| 398 | (* properties for being a permutation type *) | |
| 399 | constdefs | |
| 400 |   "pt TYPE('a) TYPE('x) \<equiv> 
 | |
| 401 | (\<forall>(x::'a). ([]::'x prm)\<bullet>x = x) \<and> | |
| 402 | (\<forall>(pi1::'x prm) (pi2::'x prm) (x::'a). (pi1@pi2)\<bullet>x = pi1\<bullet>(pi2\<bullet>x)) \<and> | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 403 | (\<forall>(pi1::'x prm) (pi2::'x prm) (x::'a). pi1 \<triangleq> pi2 \<longrightarrow> pi1\<bullet>x = pi2\<bullet>x)" | 
| 17870 | 404 | |
| 405 | (* properties for being an atom type *) | |
| 406 | constdefs | |
| 407 |   "at TYPE('x) \<equiv> 
 | |
| 408 | (\<forall>(x::'x). ([]::'x prm)\<bullet>x = x) \<and> | |
| 409 | (\<forall>(a::'x) (b::'x) (pi::'x prm) (x::'x). ((a,b)#(pi::'x prm))\<bullet>x = swap (a,b) (pi\<bullet>x)) \<and> | |
| 410 | (\<forall>(a::'x) (b::'x) (c::'x). swap (a,b) c = (if a=c then b else (if b=c then a else c))) \<and> | |
| 411 | (infinite (UNIV::'x set))" | |
| 412 | ||
| 413 | (* property of two atom-types being disjoint *) | |
| 414 | constdefs | |
| 415 |   "disjoint TYPE('x) TYPE('y) \<equiv> 
 | |
| 416 | (\<forall>(pi::'x prm)(x::'y). pi\<bullet>x = x) \<and> | |
| 417 | (\<forall>(pi::'y prm)(x::'x). pi\<bullet>x = x)" | |
| 418 | ||
| 419 | (* composition property of two permutation on a type 'a *) | |
| 420 | constdefs | |
| 421 |   "cp TYPE ('a) TYPE('x) TYPE('y) \<equiv> 
 | |
| 422 | (\<forall>(pi2::'y prm) (pi1::'x prm) (x::'a) . pi1\<bullet>(pi2\<bullet>x) = (pi1\<bullet>pi2)\<bullet>(pi1\<bullet>x))" | |
| 423 | ||
| 424 | (* property of having finite support *) | |
| 425 | constdefs | |
| 426 |   "fs TYPE('a) TYPE('x) \<equiv> \<forall>(x::'a). finite ((supp x)::'x set)"
 | |
| 427 | ||
| 428 | section {* Lemmas about the atom-type properties*}
 | |
| 429 | (*==============================================*) | |
| 430 | ||
| 431 | lemma at1: | |
| 432 | fixes x::"'x" | |
| 433 |   assumes a: "at TYPE('x)"
 | |
| 434 | shows "([]::'x prm)\<bullet>x = x" | |
| 435 | using a by (simp add: at_def) | |
| 436 | ||
| 437 | lemma at2: | |
| 438 | fixes a ::"'x" | |
| 439 | and b ::"'x" | |
| 440 | and x ::"'x" | |
| 441 | and pi::"'x prm" | |
| 442 |   assumes a: "at TYPE('x)"
 | |
| 443 | shows "((a,b)#pi)\<bullet>x = swap (a,b) (pi\<bullet>x)" | |
| 444 | using a by (simp only: at_def) | |
| 445 | ||
| 446 | lemma at3: | |
| 447 | fixes a ::"'x" | |
| 448 | and b ::"'x" | |
| 449 | and c ::"'x" | |
| 450 |   assumes a: "at TYPE('x)"
 | |
| 451 | shows "swap (a,b) c = (if a=c then b else (if b=c then a else c))" | |
| 452 | using a by (simp only: at_def) | |
| 453 | ||
| 454 | (* rules to calculate simple premutations *) | |
| 455 | lemmas at_calc = at2 at1 at3 | |
| 456 | ||
| 22610 | 457 | lemma at_swap_simps: | 
| 458 | fixes a ::"'x" | |
| 459 | and b ::"'x" | |
| 460 |   assumes a: "at TYPE('x)"
 | |
| 461 | shows "[(a,b)]\<bullet>a = b" | |
| 462 | and "[(a,b)]\<bullet>b = a" | |
| 463 | using a by (simp_all add: at_calc) | |
| 464 | ||
| 17870 | 465 | lemma at4: | 
| 466 |   assumes a: "at TYPE('x)"
 | |
| 467 | shows "infinite (UNIV::'x set)" | |
| 468 | using a by (simp add: at_def) | |
| 469 | ||
| 470 | lemma at_append: | |
| 471 | fixes pi1 :: "'x prm" | |
| 472 | and pi2 :: "'x prm" | |
| 473 | and c :: "'x" | |
| 474 |   assumes at: "at TYPE('x)" 
 | |
| 475 | shows "(pi1@pi2)\<bullet>c = pi1\<bullet>(pi2\<bullet>c)" | |
| 476 | proof (induct pi1) | |
| 477 | case Nil show ?case by (simp add: at1[OF at]) | |
| 478 | next | |
| 479 | case (Cons x xs) | |
| 18053 
2719a6b7d95e
some minor tweaks in some proofs (nothing extraordinary)
 urbanc parents: 
18048diff
changeset | 480 | have "(xs@pi2)\<bullet>c = xs\<bullet>(pi2\<bullet>c)" by fact | 
| 
2719a6b7d95e
some minor tweaks in some proofs (nothing extraordinary)
 urbanc parents: 
18048diff
changeset | 481 | also have "(x#xs)@pi2 = x#(xs@pi2)" by simp | 
| 
2719a6b7d95e
some minor tweaks in some proofs (nothing extraordinary)
 urbanc parents: 
18048diff
changeset | 482 | ultimately show ?case by (cases "x", simp add: at2[OF at]) | 
| 17870 | 483 | qed | 
| 484 | ||
| 485 | lemma at_swap: | |
| 486 | fixes a :: "'x" | |
| 487 | and b :: "'x" | |
| 488 | and c :: "'x" | |
| 489 |   assumes at: "at TYPE('x)" 
 | |
| 490 | shows "swap (a,b) (swap (a,b) c) = c" | |
| 491 | by (auto simp add: at3[OF at]) | |
| 492 | ||
| 493 | lemma at_rev_pi: | |
| 494 | fixes pi :: "'x prm" | |
| 495 | and c :: "'x" | |
| 496 |   assumes at: "at TYPE('x)"
 | |
| 497 | shows "(rev pi)\<bullet>(pi\<bullet>c) = c" | |
| 498 | proof(induct pi) | |
| 499 | case Nil show ?case by (simp add: at1[OF at]) | |
| 500 | next | |
| 501 | case (Cons x xs) thus ?case | |
| 502 | by (cases "x", simp add: at2[OF at] at_append[OF at] at1[OF at] at_swap[OF at]) | |
| 503 | qed | |
| 504 | ||
| 505 | lemma at_pi_rev: | |
| 506 | fixes pi :: "'x prm" | |
| 507 | and x :: "'x" | |
| 508 |   assumes at: "at TYPE('x)"
 | |
| 509 | shows "pi\<bullet>((rev pi)\<bullet>x) = x" | |
| 510 | by (rule at_rev_pi[OF at, of "rev pi" _,simplified]) | |
| 511 | ||
| 512 | lemma at_bij1: | |
| 513 | fixes pi :: "'x prm" | |
| 514 | and x :: "'x" | |
| 515 | and y :: "'x" | |
| 516 |   assumes at: "at TYPE('x)"
 | |
| 517 | and a: "(pi\<bullet>x) = y" | |
| 518 | shows "x=(rev pi)\<bullet>y" | |
| 519 | proof - | |
| 520 | from a have "y=(pi\<bullet>x)" by (rule sym) | |
| 521 | thus ?thesis by (simp only: at_rev_pi[OF at]) | |
| 522 | qed | |
| 523 | ||
| 524 | lemma at_bij2: | |
| 525 | fixes pi :: "'x prm" | |
| 526 | and x :: "'x" | |
| 527 | and y :: "'x" | |
| 528 |   assumes at: "at TYPE('x)"
 | |
| 529 | and a: "((rev pi)\<bullet>x) = y" | |
| 530 | shows "x=pi\<bullet>y" | |
| 531 | proof - | |
| 532 | from a have "y=((rev pi)\<bullet>x)" by (rule sym) | |
| 533 | thus ?thesis by (simp only: at_pi_rev[OF at]) | |
| 534 | qed | |
| 535 | ||
| 536 | lemma at_bij: | |
| 537 | fixes pi :: "'x prm" | |
| 538 | and x :: "'x" | |
| 539 | and y :: "'x" | |
| 540 |   assumes at: "at TYPE('x)"
 | |
| 541 | shows "(pi\<bullet>x = pi\<bullet>y) = (x=y)" | |
| 542 | proof | |
| 543 | assume "pi\<bullet>x = pi\<bullet>y" | |
| 544 | hence "x=(rev pi)\<bullet>(pi\<bullet>y)" by (rule at_bij1[OF at]) | |
| 545 | thus "x=y" by (simp only: at_rev_pi[OF at]) | |
| 546 | next | |
| 547 | assume "x=y" | |
| 548 | thus "pi\<bullet>x = pi\<bullet>y" by simp | |
| 549 | qed | |
| 550 | ||
| 551 | lemma at_supp: | |
| 552 | fixes x :: "'x" | |
| 553 |   assumes at: "at TYPE('x)"
 | |
| 554 |   shows "supp x = {x}"
 | |
| 555 | proof (simp add: supp_def Collect_conj_eq Collect_imp_eq at_calc[OF at], auto) | |
| 556 |   assume f: "finite {b::'x. b \<noteq> x}"
 | |
| 557 |   have a1: "{b::'x. b \<noteq> x} = UNIV-{x}" by force
 | |
| 558 | have a2: "infinite (UNIV::'x set)" by (rule at4[OF at]) | |
| 559 | from f a1 a2 show False by force | |
| 560 | qed | |
| 561 | ||
| 562 | lemma at_fresh: | |
| 563 | fixes a :: "'x" | |
| 564 | and b :: "'x" | |
| 565 |   assumes at: "at TYPE('x)"
 | |
| 566 | shows "(a\<sharp>b) = (a\<noteq>b)" | |
| 567 | by (simp add: at_supp[OF at] fresh_def) | |
| 568 | ||
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 569 | lemma at_prm_fresh: | 
| 17870 | 570 | fixes c :: "'x" | 
| 571 | and pi:: "'x prm" | |
| 572 |   assumes at: "at TYPE('x)"
 | |
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 573 | and a: "c\<sharp>pi" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 574 | shows "pi\<bullet>c = c" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 575 | using a | 
| 17870 | 576 | apply(induct pi) | 
| 577 | apply(simp add: at1[OF at]) | |
| 578 | apply(force simp add: fresh_list_cons at2[OF at] fresh_prod at_fresh[OF at] at3[OF at]) | |
| 579 | done | |
| 580 | ||
| 581 | lemma at_prm_rev_eq: | |
| 582 | fixes pi1 :: "'x prm" | |
| 583 | and pi2 :: "'x prm" | |
| 584 |   assumes at: "at TYPE('x)"
 | |
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 585 | shows "((rev pi1) \<triangleq> (rev pi2)) = (pi1 \<triangleq> pi2)" | 
| 17870 | 586 | proof (simp add: prm_eq_def, auto) | 
| 587 | fix x | |
| 588 | assume "\<forall>x::'x. (rev pi1)\<bullet>x = (rev pi2)\<bullet>x" | |
| 589 | hence "(rev (pi1::'x prm))\<bullet>(pi2\<bullet>(x::'x)) = (rev (pi2::'x prm))\<bullet>(pi2\<bullet>x)" by simp | |
| 590 | hence "(rev (pi1::'x prm))\<bullet>((pi2::'x prm)\<bullet>x) = (x::'x)" by (simp add: at_rev_pi[OF at]) | |
| 591 | hence "(pi2::'x prm)\<bullet>x = (pi1::'x prm)\<bullet>x" by (simp add: at_bij2[OF at]) | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 592 | thus "pi1\<bullet>x = pi2\<bullet>x" by simp | 
| 17870 | 593 | next | 
| 594 | fix x | |
| 595 | assume "\<forall>x::'x. pi1\<bullet>x = pi2\<bullet>x" | |
| 596 | hence "(pi1::'x prm)\<bullet>((rev pi2)\<bullet>x) = (pi2::'x prm)\<bullet>((rev pi2)\<bullet>(x::'x))" by simp | |
| 597 | hence "(pi1::'x prm)\<bullet>((rev pi2)\<bullet>(x::'x)) = x" by (simp add: at_pi_rev[OF at]) | |
| 598 | hence "(rev pi2)\<bullet>x = (rev pi1)\<bullet>(x::'x)" by (simp add: at_bij1[OF at]) | |
| 599 | thus "(rev pi1)\<bullet>x = (rev pi2)\<bullet>(x::'x)" by simp | |
| 600 | qed | |
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 601 | |
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 602 | lemma at_prm_eq_append: | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 603 | fixes pi1 :: "'x prm" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 604 | and pi2 :: "'x prm" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 605 | and pi3 :: "'x prm" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 606 |   assumes at: "at TYPE('x)"
 | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 607 | and a: "pi1 \<triangleq> pi2" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 608 | shows "(pi3@pi1) \<triangleq> (pi3@pi2)" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 609 | using a by (simp add: prm_eq_def at_append[OF at] at_bij[OF at]) | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 610 | |
| 19325 | 611 | lemma at_prm_eq_append': | 
| 612 | fixes pi1 :: "'x prm" | |
| 613 | and pi2 :: "'x prm" | |
| 614 | and pi3 :: "'x prm" | |
| 615 |   assumes at: "at TYPE('x)"
 | |
| 616 | and a: "pi1 \<triangleq> pi2" | |
| 617 | shows "(pi1@pi3) \<triangleq> (pi2@pi3)" | |
| 618 | using a by (simp add: prm_eq_def at_append[OF at]) | |
| 619 | ||
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 620 | lemma at_prm_eq_trans: | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 621 | fixes pi1 :: "'x prm" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 622 | and pi2 :: "'x prm" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 623 | and pi3 :: "'x prm" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 624 | assumes a1: "pi1 \<triangleq> pi2" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 625 | and a2: "pi2 \<triangleq> pi3" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 626 | shows "pi1 \<triangleq> pi3" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 627 | using a1 a2 by (auto simp add: prm_eq_def) | 
| 17870 | 628 | |
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 629 | lemma at_prm_eq_refl: | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 630 | fixes pi :: "'x prm" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 631 | shows "pi \<triangleq> pi" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 632 | by (simp add: prm_eq_def) | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 633 | |
| 17870 | 634 | lemma at_prm_rev_eq1: | 
| 635 | fixes pi1 :: "'x prm" | |
| 636 | and pi2 :: "'x prm" | |
| 637 |   assumes at: "at TYPE('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 638 | shows "pi1 \<triangleq> pi2 \<Longrightarrow> (rev pi1) \<triangleq> (rev pi2)" | 
| 17870 | 639 | by (simp add: at_prm_rev_eq[OF at]) | 
| 640 | ||
| 22774 
8c64803fae48
adds op in front of an infix to fix SML compilation
 narboux parents: 
22768diff
changeset | 641 | |
| 17870 | 642 | lemma at_ds1: | 
| 643 | fixes a :: "'x" | |
| 644 |   assumes at: "at TYPE('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 645 | shows "[(a,a)] \<triangleq> []" | 
| 17870 | 646 | by (force simp add: prm_eq_def at_calc[OF at]) | 
| 647 | ||
| 648 | lemma at_ds2: | |
| 649 | fixes pi :: "'x prm" | |
| 650 | and a :: "'x" | |
| 651 | and b :: "'x" | |
| 652 |   assumes at: "at TYPE('x)"
 | |
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 653 | shows "([(a,b)]@pi) \<triangleq> (pi@[((rev pi)\<bullet>a,(rev pi)\<bullet>b)])" | 
| 17870 | 654 | by (force simp add: prm_eq_def at_append[OF at] at_bij[OF at] at_pi_rev[OF at] | 
| 655 | at_rev_pi[OF at] at_calc[OF at]) | |
| 656 | ||
| 657 | lemma at_ds3: | |
| 658 | fixes a :: "'x" | |
| 659 | and b :: "'x" | |
| 660 | and c :: "'x" | |
| 661 |   assumes at: "at TYPE('x)"
 | |
| 662 | and a: "distinct [a,b,c]" | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 663 | shows "[(a,c),(b,c),(a,c)] \<triangleq> [(a,b)]" | 
| 17870 | 664 | using a by (force simp add: prm_eq_def at_calc[OF at]) | 
| 665 | ||
| 666 | lemma at_ds4: | |
| 667 | fixes a :: "'x" | |
| 668 | and b :: "'x" | |
| 669 | and pi :: "'x prm" | |
| 670 |   assumes at: "at TYPE('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 671 | shows "(pi@[(a,(rev pi)\<bullet>b)]) \<triangleq> ([(pi\<bullet>a,b)]@pi)" | 
| 17870 | 672 | by (force simp add: prm_eq_def at_append[OF at] at_calc[OF at] at_bij[OF at] | 
| 673 | at_pi_rev[OF at] at_rev_pi[OF at]) | |
| 674 | ||
| 675 | lemma at_ds5: | |
| 676 | fixes a :: "'x" | |
| 677 | and b :: "'x" | |
| 678 |   assumes at: "at TYPE('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 679 | shows "[(a,b)] \<triangleq> [(b,a)]" | 
| 17870 | 680 | by (force simp add: prm_eq_def at_calc[OF at]) | 
| 681 | ||
| 19164 | 682 | lemma at_ds5': | 
| 683 | fixes a :: "'x" | |
| 684 | and b :: "'x" | |
| 685 |   assumes at: "at TYPE('x)"
 | |
| 686 | shows "[(a,b),(b,a)] \<triangleq> []" | |
| 687 | by (force simp add: prm_eq_def at_calc[OF at]) | |
| 688 | ||
| 17870 | 689 | lemma at_ds6: | 
| 690 | fixes a :: "'x" | |
| 691 | and b :: "'x" | |
| 692 | and c :: "'x" | |
| 693 |   assumes at: "at TYPE('x)"
 | |
| 694 | and a: "distinct [a,b,c]" | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 695 | shows "[(a,c),(a,b)] \<triangleq> [(b,c),(a,c)]" | 
| 17870 | 696 | using a by (force simp add: prm_eq_def at_calc[OF at]) | 
| 697 | ||
| 698 | lemma at_ds7: | |
| 699 | fixes pi :: "'x prm" | |
| 700 |   assumes at: "at TYPE('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 701 | shows "((rev pi)@pi) \<triangleq> []" | 
| 17870 | 702 | by (simp add: prm_eq_def at1[OF at] at_append[OF at] at_rev_pi[OF at]) | 
| 703 | ||
| 704 | lemma at_ds8_aux: | |
| 705 | fixes pi :: "'x prm" | |
| 706 | and a :: "'x" | |
| 707 | and b :: "'x" | |
| 708 | and c :: "'x" | |
| 709 |   assumes at: "at TYPE('x)"
 | |
| 710 | shows "pi\<bullet>(swap (a,b) c) = swap (pi\<bullet>a,pi\<bullet>b) (pi\<bullet>c)" | |
| 711 | by (force simp add: at_calc[OF at] at_bij[OF at]) | |
| 712 | ||
| 713 | lemma at_ds8: | |
| 714 | fixes pi1 :: "'x prm" | |
| 715 | and pi2 :: "'x prm" | |
| 716 | and a :: "'x" | |
| 717 | and b :: "'x" | |
| 718 |   assumes at: "at TYPE('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 719 | shows "(pi1@pi2) \<triangleq> ((pi1\<bullet>pi2)@pi1)" | 
| 17870 | 720 | apply(induct_tac pi2) | 
| 721 | apply(simp add: prm_eq_def) | |
| 722 | apply(auto simp add: prm_eq_def) | |
| 723 | apply(simp add: at2[OF at]) | |
| 724 | apply(drule_tac x="aa" in spec) | |
| 725 | apply(drule sym) | |
| 726 | apply(simp) | |
| 727 | apply(simp add: at_append[OF at]) | |
| 728 | apply(simp add: at2[OF at]) | |
| 729 | apply(simp add: at_ds8_aux[OF at]) | |
| 730 | done | |
| 731 | ||
| 732 | lemma at_ds9: | |
| 733 | fixes pi1 :: "'x prm" | |
| 734 | and pi2 :: "'x prm" | |
| 735 | and a :: "'x" | |
| 736 | and b :: "'x" | |
| 737 |   assumes at: "at TYPE('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 738 | shows " ((rev pi2)@(rev pi1)) \<triangleq> ((rev pi1)@(rev (pi1\<bullet>pi2)))" | 
| 17870 | 739 | apply(induct_tac pi2) | 
| 740 | apply(simp add: prm_eq_def) | |
| 741 | apply(auto simp add: prm_eq_def) | |
| 742 | apply(simp add: at_append[OF at]) | |
| 743 | apply(simp add: at2[OF at] at1[OF at]) | |
| 744 | apply(drule_tac x="swap(pi1\<bullet>a,pi1\<bullet>b) aa" in spec) | |
| 745 | apply(drule sym) | |
| 746 | apply(simp) | |
| 747 | apply(simp add: at_ds8_aux[OF at]) | |
| 748 | apply(simp add: at_rev_pi[OF at]) | |
| 749 | done | |
| 750 | ||
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 751 | lemma at_ds10: | 
| 19132 | 752 | fixes pi :: "'x prm" | 
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 753 | and a :: "'x" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 754 | and b :: "'x" | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 755 |   assumes at: "at TYPE('x)"
 | 
| 19132 | 756 | and a: "b\<sharp>(rev pi)" | 
| 757 | shows "([(pi\<bullet>a,b)]@pi) \<triangleq> (pi@[(a,b)])" | |
| 19107 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 758 | using a | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 759 | apply - | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 760 | apply(rule at_prm_eq_trans) | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 761 | apply(rule at_ds2[OF at]) | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 762 | apply(simp add: at_prm_fresh[OF at] at_rev_pi[OF at]) | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 763 | apply(rule at_prm_eq_refl) | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 764 | done | 
| 
b16a45c53884
added a few lemmas to do with permutation-equivalence for the
 urbanc parents: 
19045diff
changeset | 765 | |
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 766 | --"there always exists an atom that is not being in a finite set" | 
| 17870 | 767 | lemma ex_in_inf: | 
| 768 | fixes A::"'x set" | |
| 769 |   assumes at: "at TYPE('x)"
 | |
| 770 | and fs: "finite A" | |
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 771 | obtains c::"'x" where "c\<notin>A" | 
| 17870 | 772 | proof - | 
| 773 | from fs at4[OF at] have "infinite ((UNIV::'x set) - A)" | |
| 774 | by (simp add: Diff_infinite_finite) | |
| 775 |   hence "((UNIV::'x set) - A) \<noteq> ({}::'x set)" by (force simp only:)
 | |
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 776 | then obtain c::"'x" where "c\<in>((UNIV::'x set) - A)" by force | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 777 | then have "c\<notin>A" by simp | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 778 | then show ?thesis using prems by simp | 
| 17870 | 779 | qed | 
| 780 | ||
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 781 | text {* there always exists a fresh name for an object with finite support *}
 | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 782 | lemma at_exists_fresh': | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 783 | fixes x :: "'a" | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 784 |   assumes at: "at TYPE('x)"
 | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 785 | and fs: "finite ((supp x)::'x set)" | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 786 | shows "\<exists>c::'x. c\<sharp>x" | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 787 | by (auto simp add: fresh_def intro: ex_in_inf[OF at, OF fs]) | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 788 | |
| 17870 | 789 | lemma at_exists_fresh: | 
| 790 | fixes x :: "'a" | |
| 791 |   assumes at: "at TYPE('x)"
 | |
| 792 | and fs: "finite ((supp x)::'x set)" | |
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 793 | obtains c::"'x" where "c\<sharp>x" | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 794 | by (auto intro: ex_in_inf[OF at, OF fs] simp add: fresh_def) | 
| 17870 | 795 | |
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 796 | lemma at_finite_select: | 
| 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 797 |   shows "at (TYPE('a)) \<Longrightarrow> finite (S::'a set) \<Longrightarrow> \<exists>x. x \<notin> S"
 | 
| 18657 | 798 | apply (drule Diff_infinite_finite) | 
| 799 | apply (simp add: at_def) | |
| 800 | apply blast | |
| 801 |   apply (subgoal_tac "UNIV - S \<noteq> {}")
 | |
| 802 | apply (simp only: ex_in_conv [symmetric]) | |
| 803 | apply blast | |
| 804 | apply (rule notI) | |
| 805 | apply simp | |
| 806 | done | |
| 807 | ||
| 19140 | 808 | lemma at_different: | 
| 19132 | 809 |   assumes at: "at TYPE('x)"
 | 
| 19140 | 810 | shows "\<exists>(b::'x). a\<noteq>b" | 
| 19132 | 811 | proof - | 
| 19140 | 812 | have "infinite (UNIV::'x set)" by (rule at4[OF at]) | 
| 813 |   hence inf2: "infinite (UNIV-{a})" by (rule infinite_remove)
 | |
| 19132 | 814 |   have "(UNIV-{a}) \<noteq> ({}::'x set)" 
 | 
| 815 | proof (rule_tac ccontr, drule_tac notnotD) | |
| 816 |     assume "UNIV-{a} = ({}::'x set)"
 | |
| 817 |     with inf2 have "infinite ({}::'x set)" by simp
 | |
| 19869 | 818 | then show "False" by auto | 
| 19132 | 819 | qed | 
| 820 |   hence "\<exists>(b::'x). b\<in>(UNIV-{a})" by blast
 | |
| 821 |   then obtain b::"'x" where mem2: "b\<in>(UNIV-{a})" by blast
 | |
| 19140 | 822 | from mem2 have "a\<noteq>b" by blast | 
| 823 | then show "\<exists>(b::'x). a\<noteq>b" by blast | |
| 19132 | 824 | qed | 
| 825 | ||
| 17870 | 826 | --"the at-props imply the pt-props" | 
| 827 | lemma at_pt_inst: | |
| 828 |   assumes at: "at TYPE('x)"
 | |
| 829 |   shows "pt TYPE('x) TYPE('x)"
 | |
| 830 | apply(auto simp only: pt_def) | |
| 831 | apply(simp only: at1[OF at]) | |
| 832 | apply(simp only: at_append[OF at]) | |
| 18053 
2719a6b7d95e
some minor tweaks in some proofs (nothing extraordinary)
 urbanc parents: 
18048diff
changeset | 833 | apply(simp only: prm_eq_def) | 
| 17870 | 834 | done | 
| 835 | ||
| 836 | section {* finite support properties *}
 | |
| 837 | (*===================================*) | |
| 838 | ||
| 839 | lemma fs1: | |
| 840 | fixes x :: "'a" | |
| 841 |   assumes a: "fs TYPE('a) TYPE('x)"
 | |
| 842 | shows "finite ((supp x)::'x set)" | |
| 843 | using a by (simp add: fs_def) | |
| 844 | ||
| 845 | lemma fs_at_inst: | |
| 846 | fixes a :: "'x" | |
| 847 |   assumes at: "at TYPE('x)"
 | |
| 848 |   shows "fs TYPE('x) TYPE('x)"
 | |
| 849 | apply(simp add: fs_def) | |
| 850 | apply(simp add: at_supp[OF at]) | |
| 851 | done | |
| 852 | ||
| 853 | lemma fs_unit_inst: | |
| 854 |   shows "fs TYPE(unit) TYPE('x)"
 | |
| 855 | apply(simp add: fs_def) | |
| 856 | apply(simp add: supp_unit) | |
| 857 | done | |
| 858 | ||
| 859 | lemma fs_prod_inst: | |
| 860 |   assumes fsa: "fs TYPE('a) TYPE('x)"
 | |
| 861 |   and     fsb: "fs TYPE('b) TYPE('x)"
 | |
| 862 |   shows "fs TYPE('a\<times>'b) TYPE('x)"
 | |
| 863 | apply(unfold fs_def) | |
| 864 | apply(auto simp add: supp_prod) | |
| 865 | apply(rule fs1[OF fsa]) | |
| 866 | apply(rule fs1[OF fsb]) | |
| 867 | done | |
| 868 | ||
| 18600 | 869 | lemma fs_nprod_inst: | 
| 870 |   assumes fsa: "fs TYPE('a) TYPE('x)"
 | |
| 871 |   and     fsb: "fs TYPE('b) TYPE('x)"
 | |
| 872 |   shows "fs TYPE(('a,'b) nprod) TYPE('x)"
 | |
| 873 | apply(unfold fs_def, rule allI) | |
| 874 | apply(case_tac x) | |
| 875 | apply(auto simp add: supp_nprod) | |
| 876 | apply(rule fs1[OF fsa]) | |
| 877 | apply(rule fs1[OF fsb]) | |
| 878 | done | |
| 879 | ||
| 17870 | 880 | lemma fs_list_inst: | 
| 881 |   assumes fs: "fs TYPE('a) TYPE('x)"
 | |
| 882 |   shows "fs TYPE('a list) TYPE('x)"
 | |
| 883 | apply(simp add: fs_def, rule allI) | |
| 884 | apply(induct_tac x) | |
| 885 | apply(simp add: supp_list_nil) | |
| 886 | apply(simp add: supp_list_cons) | |
| 887 | apply(rule fs1[OF fs]) | |
| 888 | done | |
| 889 | ||
| 18431 | 890 | lemma fs_option_inst: | 
| 891 |   assumes fs: "fs TYPE('a) TYPE('x)"
 | |
| 892 |   shows "fs TYPE('a option) TYPE('x)"
 | |
| 17870 | 893 | apply(simp add: fs_def, rule allI) | 
| 18431 | 894 | apply(case_tac x) | 
| 895 | apply(simp add: supp_none) | |
| 896 | apply(simp add: supp_some) | |
| 897 | apply(rule fs1[OF fs]) | |
| 17870 | 898 | done | 
| 899 | ||
| 900 | section {* Lemmas about the permutation properties *}
 | |
| 901 | (*=================================================*) | |
| 902 | ||
| 903 | lemma pt1: | |
| 904 | fixes x::"'a" | |
| 905 |   assumes a: "pt TYPE('a) TYPE('x)"
 | |
| 906 | shows "([]::'x prm)\<bullet>x = x" | |
| 907 | using a by (simp add: pt_def) | |
| 908 | ||
| 909 | lemma pt2: | |
| 910 | fixes pi1::"'x prm" | |
| 911 | and pi2::"'x prm" | |
| 912 | and x ::"'a" | |
| 913 |   assumes a: "pt TYPE('a) TYPE('x)"
 | |
| 914 | shows "(pi1@pi2)\<bullet>x = pi1\<bullet>(pi2\<bullet>x)" | |
| 915 | using a by (simp add: pt_def) | |
| 916 | ||
| 917 | lemma pt3: | |
| 918 | fixes pi1::"'x prm" | |
| 919 | and pi2::"'x prm" | |
| 920 | and x ::"'a" | |
| 921 |   assumes a: "pt TYPE('a) TYPE('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 922 | shows "pi1 \<triangleq> pi2 \<Longrightarrow> pi1\<bullet>x = pi2\<bullet>x" | 
| 17870 | 923 | using a by (simp add: pt_def) | 
| 924 | ||
| 925 | lemma pt3_rev: | |
| 926 | fixes pi1::"'x prm" | |
| 927 | and pi2::"'x prm" | |
| 928 | and x ::"'a" | |
| 929 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 930 |   and     at: "at TYPE('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 931 | shows "pi1 \<triangleq> pi2 \<Longrightarrow> (rev pi1)\<bullet>x = (rev pi2)\<bullet>x" | 
| 17870 | 932 | by (rule pt3[OF pt], simp add: at_prm_rev_eq[OF at]) | 
| 933 | ||
| 934 | section {* composition properties *}
 | |
| 935 | (* ============================== *) | |
| 936 | lemma cp1: | |
| 937 | fixes pi1::"'x prm" | |
| 938 | and pi2::"'y prm" | |
| 939 | and x ::"'a" | |
| 940 |   assumes cp: "cp TYPE ('a) TYPE('x) TYPE('y)"
 | |
| 941 | shows "pi1\<bullet>(pi2\<bullet>x) = (pi1\<bullet>pi2)\<bullet>(pi1\<bullet>x)" | |
| 942 | using cp by (simp add: cp_def) | |
| 943 | ||
| 944 | lemma cp_pt_inst: | |
| 945 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 946 |   and     at: "at TYPE('x)"
 | |
| 947 |   shows "cp TYPE('a) TYPE('x) TYPE('x)"
 | |
| 948 | apply(auto simp add: cp_def pt2[OF pt,symmetric]) | |
| 949 | apply(rule pt3[OF pt]) | |
| 950 | apply(rule at_ds8[OF at]) | |
| 951 | done | |
| 952 | ||
| 19638 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 953 | section {* disjointness properties *}
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 954 | (*=================================*) | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 955 | lemma dj_perm_forget: | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 956 | fixes pi::"'y prm" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 957 | and x ::"'x" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 958 |   assumes dj: "disjoint TYPE('x) TYPE('y)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 959 | shows "pi\<bullet>x=x" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 960 | using dj by (simp_all add: disjoint_def) | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 961 | |
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 962 | lemma dj_perm_perm_forget: | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 963 | fixes pi1::"'x prm" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 964 | and pi2::"'y prm" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 965 |   assumes dj: "disjoint TYPE('x) TYPE('y)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 966 | shows "pi2\<bullet>pi1=pi1" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 967 | using dj by (induct pi1, auto simp add: disjoint_def) | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 968 | |
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 969 | lemma dj_cp: | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 970 | fixes pi1::"'x prm" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 971 | and pi2::"'y prm" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 972 | and x ::"'a" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 973 |   assumes cp: "cp TYPE ('a) TYPE('x) TYPE('y)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 974 |   and     dj: "disjoint TYPE('y) TYPE('x)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 975 | shows "pi1\<bullet>(pi2\<bullet>x) = (pi2)\<bullet>(pi1\<bullet>x)" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 976 | by (simp add: cp1[OF cp] dj_perm_perm_forget[OF dj]) | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 977 | |
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 978 | lemma dj_supp: | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 979 | fixes a::"'x" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 980 |   assumes dj: "disjoint TYPE('x) TYPE('y)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 981 |   shows "(supp a) = ({}::'y set)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 982 | apply(simp add: supp_def dj_perm_forget[OF dj]) | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 983 | done | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 984 | |
| 19972 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 985 | lemma at_fresh_ineq: | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 986 | fixes a :: "'x" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 987 | and b :: "'y" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 988 |   assumes dj: "disjoint TYPE('y) TYPE('x)"
 | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 989 | shows "a\<sharp>b" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 990 | by (simp add: fresh_def dj_supp[OF dj]) | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 991 | |
| 17870 | 992 | section {* permutation type instances *}
 | 
| 993 | (* ===================================*) | |
| 994 | ||
| 995 | lemma pt_set_inst: | |
| 996 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 997 |   shows  "pt TYPE('a set) TYPE('x)"
 | |
| 998 | apply(simp add: pt_def) | |
| 999 | apply(simp_all add: perm_set_def) | |
| 1000 | apply(simp add: pt1[OF pt]) | |
| 1001 | apply(force simp add: pt2[OF pt] pt3[OF pt]) | |
| 1002 | done | |
| 1003 | ||
| 1004 | lemma pt_list_nil: | |
| 1005 | fixes xs :: "'a list" | |
| 1006 |   assumes pt: "pt TYPE('a) TYPE ('x)"
 | |
| 1007 | shows "([]::'x prm)\<bullet>xs = xs" | |
| 1008 | apply(induct_tac xs) | |
| 1009 | apply(simp_all add: pt1[OF pt]) | |
| 1010 | done | |
| 1011 | ||
| 1012 | lemma pt_list_append: | |
| 1013 | fixes pi1 :: "'x prm" | |
| 1014 | and pi2 :: "'x prm" | |
| 1015 | and xs :: "'a list" | |
| 1016 |   assumes pt: "pt TYPE('a) TYPE ('x)"
 | |
| 1017 | shows "(pi1@pi2)\<bullet>xs = pi1\<bullet>(pi2\<bullet>xs)" | |
| 1018 | apply(induct_tac xs) | |
| 1019 | apply(simp_all add: pt2[OF pt]) | |
| 1020 | done | |
| 1021 | ||
| 1022 | lemma pt_list_prm_eq: | |
| 1023 | fixes pi1 :: "'x prm" | |
| 1024 | and pi2 :: "'x prm" | |
| 1025 | and xs :: "'a list" | |
| 1026 |   assumes pt: "pt TYPE('a) TYPE ('x)"
 | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 1027 | shows "pi1 \<triangleq> pi2 \<Longrightarrow> pi1\<bullet>xs = pi2\<bullet>xs" | 
| 17870 | 1028 | apply(induct_tac xs) | 
| 1029 | apply(simp_all add: prm_eq_def pt3[OF pt]) | |
| 1030 | done | |
| 1031 | ||
| 1032 | lemma pt_list_inst: | |
| 1033 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1034 |   shows  "pt TYPE('a list) TYPE('x)"
 | |
| 1035 | apply(auto simp only: pt_def) | |
| 1036 | apply(rule pt_list_nil[OF pt]) | |
| 1037 | apply(rule pt_list_append[OF pt]) | |
| 1038 | apply(rule pt_list_prm_eq[OF pt],assumption) | |
| 1039 | done | |
| 1040 | ||
| 1041 | lemma pt_unit_inst: | |
| 1042 |   shows  "pt TYPE(unit) TYPE('x)"
 | |
| 1043 | by (simp add: pt_def) | |
| 1044 | ||
| 1045 | lemma pt_prod_inst: | |
| 1046 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 1047 |   and     ptb: "pt TYPE('b) TYPE('x)"
 | |
| 1048 |   shows  "pt TYPE('a \<times> 'b) TYPE('x)"
 | |
| 1049 | apply(auto simp add: pt_def) | |
| 1050 | apply(rule pt1[OF pta]) | |
| 1051 | apply(rule pt1[OF ptb]) | |
| 1052 | apply(rule pt2[OF pta]) | |
| 1053 | apply(rule pt2[OF ptb]) | |
| 1054 | apply(rule pt3[OF pta],assumption) | |
| 1055 | apply(rule pt3[OF ptb],assumption) | |
| 1056 | done | |
| 1057 | ||
| 18600 | 1058 | lemma pt_nprod_inst: | 
| 1059 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 1060 |   and     ptb: "pt TYPE('b) TYPE('x)"
 | |
| 1061 |   shows  "pt TYPE(('a,'b) nprod) TYPE('x)"
 | |
| 1062 | apply(auto simp add: pt_def) | |
| 1063 | apply(case_tac x) | |
| 1064 | apply(simp add: pt1[OF pta] pt1[OF ptb]) | |
| 1065 | apply(case_tac x) | |
| 1066 | apply(simp add: pt2[OF pta] pt2[OF ptb]) | |
| 1067 | apply(case_tac x) | |
| 1068 | apply(simp add: pt3[OF pta] pt3[OF ptb]) | |
| 1069 | done | |
| 1070 | ||
| 17870 | 1071 | lemma pt_fun_inst: | 
| 1072 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 1073 |   and     ptb: "pt TYPE('b) TYPE('x)"
 | |
| 1074 |   and     at:  "at TYPE('x)"
 | |
| 1075 |   shows  "pt TYPE('a\<Rightarrow>'b) TYPE('x)"
 | |
| 1076 | apply(auto simp only: pt_def) | |
| 1077 | apply(simp_all add: perm_fun_def) | |
| 1078 | apply(simp add: pt1[OF pta] pt1[OF ptb]) | |
| 1079 | apply(simp add: pt2[OF pta] pt2[OF ptb]) | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 1080 | apply(subgoal_tac "(rev pi1) \<triangleq> (rev pi2)")(*A*) | 
| 17870 | 1081 | apply(simp add: pt3[OF pta] pt3[OF ptb]) | 
| 1082 | (*A*) | |
| 1083 | apply(simp add: at_prm_rev_eq[OF at]) | |
| 1084 | done | |
| 1085 | ||
| 1086 | lemma pt_option_inst: | |
| 1087 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 1088 |   shows  "pt TYPE('a option) TYPE('x)"
 | |
| 1089 | apply(auto simp only: pt_def) | |
| 1090 | apply(case_tac "x") | |
| 1091 | apply(simp_all add: pt1[OF pta]) | |
| 1092 | apply(case_tac "x") | |
| 1093 | apply(simp_all add: pt2[OF pta]) | |
| 1094 | apply(case_tac "x") | |
| 1095 | apply(simp_all add: pt3[OF pta]) | |
| 1096 | done | |
| 1097 | ||
| 1098 | lemma pt_noption_inst: | |
| 1099 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 18579 
002d371401f5
changed the name of the type "nOption" to "noption".
 urbanc parents: 
18578diff
changeset | 1100 |   shows  "pt TYPE('a noption) TYPE('x)"
 | 
| 17870 | 1101 | apply(auto simp only: pt_def) | 
| 1102 | apply(case_tac "x") | |
| 1103 | apply(simp_all add: pt1[OF pta]) | |
| 1104 | apply(case_tac "x") | |
| 1105 | apply(simp_all add: pt2[OF pta]) | |
| 1106 | apply(case_tac "x") | |
| 1107 | apply(simp_all add: pt3[OF pta]) | |
| 1108 | done | |
| 1109 | ||
| 24544 | 1110 | lemma pt_bool_inst: | 
| 1111 |   shows  "pt TYPE(bool) TYPE('x)"
 | |
| 1112 | by (simp add: pt_def perm_bool) | |
| 1113 | ||
| 17870 | 1114 | section {* further lemmas for permutation types *}
 | 
| 1115 | (*==============================================*) | |
| 1116 | ||
| 1117 | lemma pt_rev_pi: | |
| 1118 | fixes pi :: "'x prm" | |
| 1119 | and x :: "'a" | |
| 1120 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1121 |   and     at: "at TYPE('x)"
 | |
| 1122 | shows "(rev pi)\<bullet>(pi\<bullet>x) = x" | |
| 1123 | proof - | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 1124 | have "((rev pi)@pi) \<triangleq> ([]::'x prm)" by (simp add: at_ds7[OF at]) | 
| 17870 | 1125 | hence "((rev pi)@pi)\<bullet>(x::'a) = ([]::'x prm)\<bullet>x" by (simp add: pt3[OF pt]) | 
| 1126 | thus ?thesis by (simp add: pt1[OF pt] pt2[OF pt]) | |
| 1127 | qed | |
| 1128 | ||
| 1129 | lemma pt_pi_rev: | |
| 1130 | fixes pi :: "'x prm" | |
| 1131 | and x :: "'a" | |
| 1132 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1133 |   and     at: "at TYPE('x)"
 | |
| 1134 | shows "pi\<bullet>((rev pi)\<bullet>x) = x" | |
| 1135 | by (simp add: pt_rev_pi[OF pt, OF at,of "rev pi" "x",simplified]) | |
| 1136 | ||
| 1137 | lemma pt_bij1: | |
| 1138 | fixes pi :: "'x prm" | |
| 1139 | and x :: "'a" | |
| 1140 | and y :: "'a" | |
| 1141 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1142 |   and     at: "at TYPE('x)"
 | |
| 1143 | and a: "(pi\<bullet>x) = y" | |
| 1144 | shows "x=(rev pi)\<bullet>y" | |
| 1145 | proof - | |
| 1146 | from a have "y=(pi\<bullet>x)" by (rule sym) | |
| 1147 | thus ?thesis by (simp only: pt_rev_pi[OF pt, OF at]) | |
| 1148 | qed | |
| 1149 | ||
| 1150 | lemma pt_bij2: | |
| 1151 | fixes pi :: "'x prm" | |
| 1152 | and x :: "'a" | |
| 1153 | and y :: "'a" | |
| 1154 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1155 |   and     at: "at TYPE('x)"
 | |
| 1156 | and a: "x = (rev pi)\<bullet>y" | |
| 1157 | shows "(pi\<bullet>x)=y" | |
| 1158 | using a by (simp add: pt_pi_rev[OF pt, OF at]) | |
| 1159 | ||
| 1160 | lemma pt_bij: | |
| 1161 | fixes pi :: "'x prm" | |
| 1162 | and x :: "'a" | |
| 1163 | and y :: "'a" | |
| 1164 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1165 |   and     at: "at TYPE('x)"
 | |
| 1166 | shows "(pi\<bullet>x = pi\<bullet>y) = (x=y)" | |
| 1167 | proof | |
| 1168 | assume "pi\<bullet>x = pi\<bullet>y" | |
| 1169 | hence "x=(rev pi)\<bullet>(pi\<bullet>y)" by (rule pt_bij1[OF pt, OF at]) | |
| 1170 | thus "x=y" by (simp only: pt_rev_pi[OF pt, OF at]) | |
| 1171 | next | |
| 1172 | assume "x=y" | |
| 1173 | thus "pi\<bullet>x = pi\<bullet>y" by simp | |
| 1174 | qed | |
| 1175 | ||
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1176 | lemma pt_eq_eqvt: | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1177 | fixes pi :: "'x prm" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1178 | and x :: "'a" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1179 | and y :: "'a" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1180 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1181 |   and     at: "at TYPE('x)"
 | 
| 22829 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1182 | shows "pi\<bullet>(x=y) = (pi\<bullet>x = pi\<bullet>y)" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1183 | using assms | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1184 | by (auto simp add: pt_bij perm_bool) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1185 | |
| 17870 | 1186 | lemma pt_bij3: | 
| 1187 | fixes pi :: "'x prm" | |
| 1188 | and x :: "'a" | |
| 1189 | and y :: "'a" | |
| 1190 | assumes a: "x=y" | |
| 1191 | shows "(pi\<bullet>x = pi\<bullet>y)" | |
| 1192 | using a by simp | |
| 1193 | ||
| 1194 | lemma pt_bij4: | |
| 1195 | fixes pi :: "'x prm" | |
| 1196 | and x :: "'a" | |
| 1197 | and y :: "'a" | |
| 1198 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1199 |   and     at: "at TYPE('x)"
 | |
| 1200 | and a: "pi\<bullet>x = pi\<bullet>y" | |
| 1201 | shows "x = y" | |
| 1202 | using a by (simp add: pt_bij[OF pt, OF at]) | |
| 1203 | ||
| 1204 | lemma pt_swap_bij: | |
| 1205 | fixes a :: "'x" | |
| 1206 | and b :: "'x" | |
| 1207 | and x :: "'a" | |
| 1208 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1209 |   and     at: "at TYPE('x)"
 | |
| 1210 | shows "[(a,b)]\<bullet>([(a,b)]\<bullet>x) = x" | |
| 1211 | by (rule pt_bij2[OF pt, OF at], simp) | |
| 1212 | ||
| 19164 | 1213 | lemma pt_swap_bij': | 
| 1214 | fixes a :: "'x" | |
| 1215 | and b :: "'x" | |
| 1216 | and x :: "'a" | |
| 1217 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1218 |   and     at: "at TYPE('x)"
 | |
| 1219 | shows "[(a,b)]\<bullet>([(b,a)]\<bullet>x) = x" | |
| 1220 | apply(simp add: pt2[OF pt,symmetric]) | |
| 1221 | apply(rule trans) | |
| 1222 | apply(rule pt3[OF pt]) | |
| 1223 | apply(rule at_ds5'[OF at]) | |
| 1224 | apply(rule pt1[OF pt]) | |
| 1225 | done | |
| 1226 | ||
| 24571 | 1227 | lemma pt_swap_bij'': | 
| 1228 | fixes a :: "'x" | |
| 1229 | and x :: "'a" | |
| 1230 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1231 |   and     at: "at TYPE('x)"
 | |
| 1232 | shows "[(a,a)]\<bullet>x = x" | |
| 1233 | apply(rule trans) | |
| 1234 | apply(rule pt3[OF pt]) | |
| 1235 | apply(rule at_ds1[OF at]) | |
| 1236 | apply(rule pt1[OF pt]) | |
| 1237 | done | |
| 1238 | ||
| 17870 | 1239 | lemma pt_set_bij1: | 
| 1240 | fixes pi :: "'x prm" | |
| 1241 | and x :: "'a" | |
| 1242 | and X :: "'a set" | |
| 1243 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1244 |   and     at: "at TYPE('x)"
 | |
| 1245 | shows "((pi\<bullet>x)\<in>X) = (x\<in>((rev pi)\<bullet>X))" | |
| 1246 | by (force simp add: perm_set_def pt_rev_pi[OF pt, OF at] pt_pi_rev[OF pt, OF at]) | |
| 1247 | ||
| 1248 | lemma pt_set_bij1a: | |
| 1249 | fixes pi :: "'x prm" | |
| 1250 | and x :: "'a" | |
| 1251 | and X :: "'a set" | |
| 1252 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1253 |   and     at: "at TYPE('x)"
 | |
| 1254 | shows "(x\<in>(pi\<bullet>X)) = (((rev pi)\<bullet>x)\<in>X)" | |
| 1255 | by (force simp add: perm_set_def pt_rev_pi[OF pt, OF at] pt_pi_rev[OF pt, OF at]) | |
| 1256 | ||
| 1257 | lemma pt_set_bij: | |
| 1258 | fixes pi :: "'x prm" | |
| 1259 | and x :: "'a" | |
| 1260 | and X :: "'a set" | |
| 1261 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1262 |   and     at: "at TYPE('x)"
 | |
| 1263 | shows "((pi\<bullet>x)\<in>(pi\<bullet>X)) = (x\<in>X)" | |
| 18053 
2719a6b7d95e
some minor tweaks in some proofs (nothing extraordinary)
 urbanc parents: 
18048diff
changeset | 1264 | by (simp add: perm_set_def pt_bij[OF pt, OF at]) | 
| 17870 | 1265 | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1266 | lemma pt_in_eqvt: | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1267 | fixes pi :: "'x prm" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1268 | and x :: "'a" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1269 | and X :: "'a set" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1270 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1271 |   and     at: "at TYPE('x)"
 | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1272 | shows "pi\<bullet>(x\<in>X)=((pi\<bullet>x)\<in>(pi\<bullet>X))" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1273 | using assms | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1274 | by (auto simp add: pt_set_bij perm_bool) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1275 | |
| 17870 | 1276 | lemma pt_set_bij2: | 
| 1277 | fixes pi :: "'x prm" | |
| 1278 | and x :: "'a" | |
| 1279 | and X :: "'a set" | |
| 1280 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1281 |   and     at: "at TYPE('x)"
 | |
| 1282 | and a: "x\<in>X" | |
| 1283 | shows "(pi\<bullet>x)\<in>(pi\<bullet>X)" | |
| 1284 | using a by (simp add: pt_set_bij[OF pt, OF at]) | |
| 1285 | ||
| 18264 | 1286 | lemma pt_set_bij2a: | 
| 1287 | fixes pi :: "'x prm" | |
| 1288 | and x :: "'a" | |
| 1289 | and X :: "'a set" | |
| 1290 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1291 |   and     at: "at TYPE('x)"
 | |
| 1292 | and a: "x\<in>((rev pi)\<bullet>X)" | |
| 1293 | shows "(pi\<bullet>x)\<in>X" | |
| 1294 | using a by (simp add: pt_set_bij1[OF pt, OF at]) | |
| 1295 | ||
| 17870 | 1296 | lemma pt_set_bij3: | 
| 1297 | fixes pi :: "'x prm" | |
| 1298 | and x :: "'a" | |
| 1299 | and X :: "'a set" | |
| 1300 | shows "pi\<bullet>(x\<in>X) = (x\<in>X)" | |
| 1301 | apply(case_tac "x\<in>X = True") | |
| 1302 | apply(auto) | |
| 1303 | done | |
| 1304 | ||
| 18159 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1305 | lemma pt_subseteq_eqvt: | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1306 | fixes pi :: "'x prm" | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1307 | and Y :: "'a set" | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1308 | and X :: "'a set" | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1309 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1310 |   and     at: "at TYPE('x)"
 | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1311 | shows "((pi\<bullet>X)\<subseteq>(pi\<bullet>Y)) = (X\<subseteq>Y)" | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1312 | proof (auto) | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1313 | fix x::"'a" | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1314 | assume a: "(pi\<bullet>X)\<subseteq>(pi\<bullet>Y)" | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1315 | and "x\<in>X" | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1316 | hence "(pi\<bullet>x)\<in>(pi\<bullet>X)" by (simp add: pt_set_bij[OF pt, OF at]) | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1317 | with a have "(pi\<bullet>x)\<in>(pi\<bullet>Y)" by force | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1318 | thus "x\<in>Y" by (simp add: pt_set_bij[OF pt, OF at]) | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1319 | next | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1320 | fix x::"'a" | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1321 | assume a: "X\<subseteq>Y" | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1322 | and "x\<in>(pi\<bullet>X)" | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1323 | thus "x\<in>(pi\<bullet>Y)" by (force simp add: pt_set_bij1a[OF pt, OF at]) | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1324 | qed | 
| 
08282ca0402e
added a few equivariance lemmas (they need to be automated
 urbanc parents: 
18068diff
changeset | 1325 | |
| 19772 
45897b49fdd2
added some further lemmas that deal with permutations and set-operators
 urbanc parents: 
19771diff
changeset | 1326 | lemma pt_set_diff_eqvt: | 
| 
45897b49fdd2
added some further lemmas that deal with permutations and set-operators
 urbanc parents: 
19771diff
changeset | 1327 | fixes X::"'a set" | 
| 
45897b49fdd2
added some further lemmas that deal with permutations and set-operators
 urbanc parents: 
19771diff
changeset | 1328 | and Y::"'a set" | 
| 
45897b49fdd2
added some further lemmas that deal with permutations and set-operators
 urbanc parents: 
19771diff
changeset | 1329 | and pi::"'x prm" | 
| 
45897b49fdd2
added some further lemmas that deal with permutations and set-operators
 urbanc parents: 
19771diff
changeset | 1330 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
45897b49fdd2
added some further lemmas that deal with permutations and set-operators
 urbanc parents: 
19771diff
changeset | 1331 |   and     at: "at TYPE('x)"
 | 
| 22829 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1332 | shows "pi\<bullet>(X - Y) = (pi\<bullet>X) - (pi\<bullet>Y)" | 
| 19772 
45897b49fdd2
added some further lemmas that deal with permutations and set-operators
 urbanc parents: 
19771diff
changeset | 1333 | by (auto simp add: perm_set_def pt_bij[OF pt, OF at]) | 
| 
45897b49fdd2
added some further lemmas that deal with permutations and set-operators
 urbanc parents: 
19771diff
changeset | 1334 | |
| 22829 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1335 | lemma pt_Collect_eqvt: | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1336 | fixes pi::"'x prm" | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1337 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1338 |   and     at: "at TYPE('x)"
 | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1339 |   shows "pi\<bullet>{x::'a. P x} = {x. P ((rev pi)\<bullet>x)}"
 | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1340 | apply(auto simp add: perm_set_def pt_rev_pi[OF pt, OF at]) | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1341 | apply(rule_tac x="(rev pi)\<bullet>x" in exI) | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1342 | apply(simp add: pt_pi_rev[OF pt, OF at]) | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1343 | done | 
| 19772 
45897b49fdd2
added some further lemmas that deal with permutations and set-operators
 urbanc parents: 
19771diff
changeset | 1344 | |
| 17870 | 1345 | -- "some helper lemmas for the pt_perm_supp_ineq lemma" | 
| 1346 | lemma Collect_permI: | |
| 1347 | fixes pi :: "'x prm" | |
| 1348 | and x :: "'a" | |
| 1349 | assumes a: "\<forall>x. (P1 x = P2 x)" | |
| 1350 |   shows "{pi\<bullet>x| x. P1 x} = {pi\<bullet>x| x. P2 x}"
 | |
| 1351 | using a by force | |
| 1352 | ||
| 1353 | lemma Infinite_cong: | |
| 1354 | assumes a: "X = Y" | |
| 1355 | shows "infinite X = infinite Y" | |
| 1356 | using a by (simp) | |
| 1357 | ||
| 1358 | lemma pt_set_eq_ineq: | |
| 1359 | fixes pi :: "'y prm" | |
| 1360 |   assumes pt: "pt TYPE('x) TYPE('y)"
 | |
| 1361 |   and     at: "at TYPE('y)"
 | |
| 1362 |   shows "{pi\<bullet>x| x::'x. P x} = {x::'x. P ((rev pi)\<bullet>x)}"
 | |
| 1363 | by (force simp only: pt_rev_pi[OF pt, OF at] pt_pi_rev[OF pt, OF at]) | |
| 1364 | ||
| 1365 | lemma pt_inject_on_ineq: | |
| 1366 | fixes X :: "'y set" | |
| 1367 | and pi :: "'x prm" | |
| 1368 |   assumes pt: "pt TYPE('y) TYPE('x)"
 | |
| 1369 |   and     at: "at TYPE('x)"
 | |
| 1370 | shows "inj_on (perm pi) X" | |
| 1371 | proof (unfold inj_on_def, intro strip) | |
| 1372 | fix x::"'y" and y::"'y" | |
| 1373 | assume "pi\<bullet>x = pi\<bullet>y" | |
| 1374 | thus "x=y" by (simp add: pt_bij[OF pt, OF at]) | |
| 1375 | qed | |
| 1376 | ||
| 1377 | lemma pt_set_finite_ineq: | |
| 1378 | fixes X :: "'x set" | |
| 1379 | and pi :: "'y prm" | |
| 1380 |   assumes pt: "pt TYPE('x) TYPE('y)"
 | |
| 1381 |   and     at: "at TYPE('y)"
 | |
| 1382 | shows "finite (pi\<bullet>X) = finite X" | |
| 1383 | proof - | |
| 1384 | have image: "(pi\<bullet>X) = (perm pi ` X)" by (force simp only: perm_set_def) | |
| 1385 | show ?thesis | |
| 1386 | proof (rule iffI) | |
| 1387 | assume "finite (pi\<bullet>X)" | |
| 1388 | hence "finite (perm pi ` X)" using image by (simp) | |
| 1389 | thus "finite X" using pt_inject_on_ineq[OF pt, OF at] by (rule finite_imageD) | |
| 1390 | next | |
| 1391 | assume "finite X" | |
| 1392 | hence "finite (perm pi ` X)" by (rule finite_imageI) | |
| 1393 | thus "finite (pi\<bullet>X)" using image by (simp) | |
| 1394 | qed | |
| 1395 | qed | |
| 1396 | ||
| 1397 | lemma pt_set_infinite_ineq: | |
| 1398 | fixes X :: "'x set" | |
| 1399 | and pi :: "'y prm" | |
| 1400 |   assumes pt: "pt TYPE('x) TYPE('y)"
 | |
| 1401 |   and     at: "at TYPE('y)"
 | |
| 1402 | shows "infinite (pi\<bullet>X) = infinite X" | |
| 1403 | using pt at by (simp add: pt_set_finite_ineq) | |
| 1404 | ||
| 1405 | lemma pt_perm_supp_ineq: | |
| 1406 | fixes pi :: "'x prm" | |
| 1407 | and x :: "'a" | |
| 1408 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 1409 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | |
| 1410 |   and     at:  "at TYPE('x)"
 | |
| 1411 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | |
| 1412 | shows "(pi\<bullet>((supp x)::'y set)) = supp (pi\<bullet>x)" (is "?LHS = ?RHS") | |
| 1413 | proof - | |
| 1414 |   have "?LHS = {pi\<bullet>a | a. infinite {b. [(a,b)]\<bullet>x \<noteq> x}}" by (simp add: supp_def perm_set_def)
 | |
| 1415 |   also have "\<dots> = {pi\<bullet>a | a. infinite {pi\<bullet>b | b. [(a,b)]\<bullet>x \<noteq> x}}" 
 | |
| 1416 | proof (rule Collect_permI, rule allI, rule iffI) | |
| 1417 | fix a | |
| 1418 |     assume "infinite {b::'y. [(a,b)]\<bullet>x  \<noteq> x}"
 | |
| 1419 |     hence "infinite (pi\<bullet>{b::'y. [(a,b)]\<bullet>x \<noteq> x})" by (simp add: pt_set_infinite_ineq[OF ptb, OF at])
 | |
| 1420 |     thus "infinite {pi\<bullet>b |b::'y. [(a,b)]\<bullet>x  \<noteq> x}" by (simp add: perm_set_def)
 | |
| 1421 | next | |
| 1422 | fix a | |
| 1423 |     assume "infinite {pi\<bullet>b |b::'y. [(a,b)]\<bullet>x \<noteq> x}"
 | |
| 1424 |     hence "infinite (pi\<bullet>{b::'y. [(a,b)]\<bullet>x \<noteq> x})" by (simp add: perm_set_def)
 | |
| 1425 |     thus "infinite {b::'y. [(a,b)]\<bullet>x  \<noteq> x}" 
 | |
| 1426 | by (simp add: pt_set_infinite_ineq[OF ptb, OF at]) | |
| 1427 | qed | |
| 1428 |   also have "\<dots> = {a. infinite {b::'y. [((rev pi)\<bullet>a,(rev pi)\<bullet>b)]\<bullet>x \<noteq> x}}" 
 | |
| 1429 | by (simp add: pt_set_eq_ineq[OF ptb, OF at]) | |
| 1430 |   also have "\<dots> = {a. infinite {b. pi\<bullet>([((rev pi)\<bullet>a,(rev pi)\<bullet>b)]\<bullet>x) \<noteq> (pi\<bullet>x)}}"
 | |
| 1431 | by (simp add: pt_bij[OF pta, OF at]) | |
| 1432 |   also have "\<dots> = {a. infinite {b. [(a,b)]\<bullet>(pi\<bullet>x) \<noteq> (pi\<bullet>x)}}"
 | |
| 1433 | proof (rule Collect_cong, rule Infinite_cong, rule Collect_cong) | |
| 1434 | fix a::"'y" and b::"'y" | |
| 1435 | have "pi\<bullet>(([((rev pi)\<bullet>a,(rev pi)\<bullet>b)])\<bullet>x) = [(a,b)]\<bullet>(pi\<bullet>x)" | |
| 1436 | by (simp add: cp1[OF cp] pt_pi_rev[OF ptb, OF at]) | |
| 1437 | thus "(pi\<bullet>([((rev pi)\<bullet>a,(rev pi)\<bullet>b)]\<bullet>x) \<noteq> pi\<bullet>x) = ([(a,b)]\<bullet>(pi\<bullet>x) \<noteq> pi\<bullet>x)" by simp | |
| 1438 | qed | |
| 1439 | finally show "?LHS = ?RHS" by (simp add: supp_def) | |
| 1440 | qed | |
| 1441 | ||
| 1442 | lemma pt_perm_supp: | |
| 1443 | fixes pi :: "'x prm" | |
| 1444 | and x :: "'a" | |
| 1445 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1446 |   and     at: "at TYPE('x)"
 | |
| 1447 | shows "(pi\<bullet>((supp x)::'x set)) = supp (pi\<bullet>x)" | |
| 1448 | apply(rule pt_perm_supp_ineq) | |
| 1449 | apply(rule pt) | |
| 1450 | apply(rule at_pt_inst) | |
| 1451 | apply(rule at)+ | |
| 1452 | apply(rule cp_pt_inst) | |
| 1453 | apply(rule pt) | |
| 1454 | apply(rule at) | |
| 1455 | done | |
| 1456 | ||
| 1457 | lemma pt_supp_finite_pi: | |
| 1458 | fixes pi :: "'x prm" | |
| 1459 | and x :: "'a" | |
| 1460 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1461 |   and     at: "at TYPE('x)"
 | |
| 1462 | and f: "finite ((supp x)::'x set)" | |
| 1463 | shows "finite ((supp (pi\<bullet>x))::'x set)" | |
| 1464 | apply(simp add: pt_perm_supp[OF pt, OF at, symmetric]) | |
| 1465 | apply(simp add: pt_set_finite_ineq[OF at_pt_inst[OF at], OF at]) | |
| 1466 | apply(rule f) | |
| 1467 | done | |
| 1468 | ||
| 1469 | lemma pt_fresh_left_ineq: | |
| 1470 | fixes pi :: "'x prm" | |
| 1471 | and x :: "'a" | |
| 1472 | and a :: "'y" | |
| 1473 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 1474 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | |
| 1475 |   and     at:  "at TYPE('x)"
 | |
| 1476 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | |
| 1477 | shows "a\<sharp>(pi\<bullet>x) = ((rev pi)\<bullet>a)\<sharp>x" | |
| 1478 | apply(simp add: fresh_def) | |
| 1479 | apply(simp add: pt_set_bij1[OF ptb, OF at]) | |
| 1480 | apply(simp add: pt_perm_supp_ineq[OF pta, OF ptb, OF at, OF cp]) | |
| 1481 | done | |
| 1482 | ||
| 1483 | lemma pt_fresh_right_ineq: | |
| 1484 | fixes pi :: "'x prm" | |
| 1485 | and x :: "'a" | |
| 1486 | and a :: "'y" | |
| 1487 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 1488 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | |
| 1489 |   and     at:  "at TYPE('x)"
 | |
| 1490 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | |
| 1491 | shows "(pi\<bullet>a)\<sharp>x = a\<sharp>((rev pi)\<bullet>x)" | |
| 1492 | apply(simp add: fresh_def) | |
| 1493 | apply(simp add: pt_set_bij1[OF ptb, OF at]) | |
| 1494 | apply(simp add: pt_perm_supp_ineq[OF pta, OF ptb, OF at, OF cp]) | |
| 1495 | done | |
| 1496 | ||
| 1497 | lemma pt_fresh_bij_ineq: | |
| 1498 | fixes pi :: "'x prm" | |
| 1499 | and x :: "'a" | |
| 1500 | and a :: "'y" | |
| 1501 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 1502 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | |
| 1503 |   and     at:  "at TYPE('x)"
 | |
| 1504 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | |
| 1505 | shows "(pi\<bullet>a)\<sharp>(pi\<bullet>x) = a\<sharp>x" | |
| 1506 | apply(simp add: pt_fresh_left_ineq[OF pta, OF ptb, OF at, OF cp]) | |
| 1507 | apply(simp add: pt_rev_pi[OF ptb, OF at]) | |
| 1508 | done | |
| 1509 | ||
| 1510 | lemma pt_fresh_left: | |
| 1511 | fixes pi :: "'x prm" | |
| 1512 | and x :: "'a" | |
| 1513 | and a :: "'x" | |
| 1514 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1515 |   and     at: "at TYPE('x)"
 | |
| 1516 | shows "a\<sharp>(pi\<bullet>x) = ((rev pi)\<bullet>a)\<sharp>x" | |
| 1517 | apply(rule pt_fresh_left_ineq) | |
| 1518 | apply(rule pt) | |
| 1519 | apply(rule at_pt_inst) | |
| 1520 | apply(rule at)+ | |
| 1521 | apply(rule cp_pt_inst) | |
| 1522 | apply(rule pt) | |
| 1523 | apply(rule at) | |
| 1524 | done | |
| 1525 | ||
| 1526 | lemma pt_fresh_right: | |
| 1527 | fixes pi :: "'x prm" | |
| 1528 | and x :: "'a" | |
| 1529 | and a :: "'x" | |
| 1530 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1531 |   and     at: "at TYPE('x)"
 | |
| 1532 | shows "(pi\<bullet>a)\<sharp>x = a\<sharp>((rev pi)\<bullet>x)" | |
| 1533 | apply(rule pt_fresh_right_ineq) | |
| 1534 | apply(rule pt) | |
| 1535 | apply(rule at_pt_inst) | |
| 1536 | apply(rule at)+ | |
| 1537 | apply(rule cp_pt_inst) | |
| 1538 | apply(rule pt) | |
| 1539 | apply(rule at) | |
| 1540 | done | |
| 1541 | ||
| 1542 | lemma pt_fresh_bij: | |
| 1543 | fixes pi :: "'x prm" | |
| 1544 | and x :: "'a" | |
| 1545 | and a :: "'x" | |
| 1546 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1547 |   and     at: "at TYPE('x)"
 | |
| 1548 | shows "(pi\<bullet>a)\<sharp>(pi\<bullet>x) = a\<sharp>x" | |
| 1549 | apply(rule pt_fresh_bij_ineq) | |
| 1550 | apply(rule pt) | |
| 1551 | apply(rule at_pt_inst) | |
| 1552 | apply(rule at)+ | |
| 1553 | apply(rule cp_pt_inst) | |
| 1554 | apply(rule pt) | |
| 1555 | apply(rule at) | |
| 1556 | done | |
| 1557 | ||
| 1558 | lemma pt_fresh_bij1: | |
| 1559 | fixes pi :: "'x prm" | |
| 1560 | and x :: "'a" | |
| 1561 | and a :: "'x" | |
| 1562 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1563 |   and     at: "at TYPE('x)"
 | |
| 1564 | and a: "a\<sharp>x" | |
| 1565 | shows "(pi\<bullet>a)\<sharp>(pi\<bullet>x)" | |
| 1566 | using a by (simp add: pt_fresh_bij[OF pt, OF at]) | |
| 1567 | ||
| 19566 | 1568 | lemma pt_fresh_bij2: | 
| 1569 | fixes pi :: "'x prm" | |
| 1570 | and x :: "'a" | |
| 1571 | and a :: "'x" | |
| 1572 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1573 |   and     at: "at TYPE('x)"
 | |
| 1574 | and a: "(pi\<bullet>a)\<sharp>(pi\<bullet>x)" | |
| 1575 | shows "a\<sharp>x" | |
| 1576 | using a by (simp add: pt_fresh_bij[OF pt, OF at]) | |
| 1577 | ||
| 19972 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1578 | lemma pt_fresh_eqvt: | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1579 | fixes pi :: "'x prm" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1580 | and x :: "'a" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1581 | and a :: "'x" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1582 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1583 |   and     at: "at TYPE('x)"
 | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1584 | shows "pi\<bullet>(a\<sharp>x) = (pi\<bullet>a)\<sharp>(pi\<bullet>x)" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1585 | by (simp add: perm_bool pt_fresh_bij[OF pt, OF at]) | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1586 | |
| 17870 | 1587 | lemma pt_perm_fresh1: | 
| 1588 | fixes a :: "'x" | |
| 1589 | and b :: "'x" | |
| 1590 | and x :: "'a" | |
| 1591 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1592 |   and     at: "at TYPE ('x)"
 | |
| 1593 | and a1: "\<not>(a\<sharp>x)" | |
| 1594 | and a2: "b\<sharp>x" | |
| 1595 | shows "[(a,b)]\<bullet>x \<noteq> x" | |
| 1596 | proof | |
| 1597 | assume neg: "[(a,b)]\<bullet>x = x" | |
| 1598 | from a1 have a1':"a\<in>(supp x)" by (simp add: fresh_def) | |
| 1599 | from a2 have a2':"b\<notin>(supp x)" by (simp add: fresh_def) | |
| 1600 | from a1' a2' have a3: "a\<noteq>b" by force | |
| 1601 | from a1' have "([(a,b)]\<bullet>a)\<in>([(a,b)]\<bullet>(supp x))" | |
| 1602 | by (simp only: pt_set_bij[OF at_pt_inst[OF at], OF at]) | |
| 19325 | 1603 | hence "b\<in>([(a,b)]\<bullet>(supp x))" by (simp add: at_calc[OF at]) | 
| 17870 | 1604 | hence "b\<in>(supp ([(a,b)]\<bullet>x))" by (simp add: pt_perm_supp[OF pt,OF at]) | 
| 1605 | with a2' neg show False by simp | |
| 1606 | qed | |
| 1607 | ||
| 19638 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1608 | (* the next two lemmas are needed in the proof *) | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1609 | (* of the structural induction principle *) | 
| 22786 | 1610 | |
| 19638 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1611 | lemma pt_fresh_aux: | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1612 | fixes a::"'x" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1613 | and b::"'x" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1614 | and c::"'x" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1615 | and x::"'a" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1616 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1617 |   and     at: "at TYPE ('x)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1618 | assumes a1: "c\<noteq>a" and a2: "a\<sharp>x" and a3: "c\<sharp>x" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1619 | shows "c\<sharp>([(a,b)]\<bullet>x)" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1620 | using a1 a2 a3 by (simp_all add: pt_fresh_left[OF pt, OF at] at_calc[OF at]) | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1621 | |
| 22786 | 1622 | lemma pt_fresh_perm_app: | 
| 1623 | fixes pi :: "'x prm" | |
| 1624 | and a :: "'x" | |
| 1625 | and x :: "'y" | |
| 1626 |   assumes pt: "pt TYPE('y) TYPE('x)"
 | |
| 1627 |   and     at: "at TYPE('x)"
 | |
| 22829 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1628 | and h1: "a\<sharp>pi" | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1629 | and h2: "a\<sharp>x" | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1630 | shows "a\<sharp>(pi\<bullet>x)" | 
| 22786 | 1631 | using assms | 
| 1632 | proof - | |
| 22829 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1633 | have "a\<sharp>(rev pi)"using h1 by (simp add: fresh_list_rev) | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1634 | then have "(rev pi)\<bullet>a = a" by (simp add: at_prm_fresh[OF at]) | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1635 | then have "((rev pi)\<bullet>a)\<sharp>x" using h2 by simp | 
| 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 1636 | thus "a\<sharp>(pi\<bullet>x)" by (simp add: pt_fresh_right[OF pt, OF at]) | 
| 22786 | 1637 | qed | 
| 1638 | ||
| 1639 | lemma pt_fresh_perm_app_ineq: | |
| 19638 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1640 | fixes pi::"'x prm" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1641 | and c::"'y" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1642 | and x::"'a" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1643 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1644 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1645 |   and     at:  "at TYPE('x)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1646 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1647 |   and     dj:  "disjoint TYPE('y) TYPE('x)"
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1648 | assumes a: "c\<sharp>x" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1649 | shows "c\<sharp>(pi\<bullet>x)" | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1650 | using a by (simp add: pt_fresh_left_ineq[OF pta, OF ptb, OF at, OF cp] dj_perm_forget[OF dj]) | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 1651 | |
| 22535 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1652 | lemma pt_fresh_eqvt_ineq: | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1653 | fixes pi::"'x prm" | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1654 | and c::"'y" | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1655 | and x::"'a" | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1656 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1657 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1658 |   and     at:  "at TYPE('x)"
 | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1659 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1660 |   and     dj:  "disjoint TYPE('y) TYPE('x)"
 | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1661 | shows "pi\<bullet>(c\<sharp>x) = (pi\<bullet>c)\<sharp>(pi\<bullet>x)" | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1662 | by (simp add: pt_fresh_left_ineq[OF pta, OF ptb, OF at, OF cp] dj_perm_forget[OF dj] perm_bool) | 
| 
cbee450f88a6
added extended the lemma for equivariance of freshness
 urbanc parents: 
22514diff
changeset | 1663 | |
| 17870 | 1664 | -- "three helper lemmas for the perm_fresh_fresh-lemma" | 
| 1665 | lemma comprehension_neg_UNIV: "{b. \<not> P b} = UNIV - {b. P b}"
 | |
| 1666 | by (auto) | |
| 1667 | ||
| 1668 | lemma infinite_or_neg_infinite: | |
| 1669 | assumes h:"infinite (UNIV::'a set)" | |
| 1670 |   shows "infinite {b::'a. P b} \<or> infinite {b::'a. \<not> P b}"
 | |
| 1671 | proof (subst comprehension_neg_UNIV, case_tac "finite {b. P b}")
 | |
| 1672 |   assume j:"finite {b::'a. P b}"
 | |
| 1673 |   have "infinite ((UNIV::'a set) - {b::'a. P b})"
 | |
| 1674 | using Diff_infinite_finite[OF j h] by auto | |
| 1675 |   thus "infinite {b::'a. P b} \<or> infinite (UNIV - {b::'a. P b})" ..
 | |
| 1676 | next | |
| 1677 |   assume j:"infinite {b::'a. P b}"
 | |
| 1678 |   thus "infinite {b::'a. P b} \<or> infinite (UNIV - {b::'a. P b})" by simp
 | |
| 1679 | qed | |
| 1680 | ||
| 1681 | --"the co-set of a finite set is infinte" | |
| 1682 | lemma finite_infinite: | |
| 1683 |   assumes a: "finite {b::'x. P b}"
 | |
| 1684 | and b: "infinite (UNIV::'x set)" | |
| 1685 |   shows "infinite {b. \<not>P b}"
 | |
| 1686 | using a and infinite_or_neg_infinite[OF b] by simp | |
| 1687 | ||
| 1688 | lemma pt_fresh_fresh: | |
| 1689 | fixes x :: "'a" | |
| 1690 | and a :: "'x" | |
| 1691 | and b :: "'x" | |
| 1692 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1693 |   and     at: "at TYPE ('x)"
 | |
| 1694 | and a1: "a\<sharp>x" and a2: "b\<sharp>x" | |
| 1695 | shows "[(a,b)]\<bullet>x=x" | |
| 1696 | proof (cases "a=b") | |
| 19325 | 1697 | assume "a=b" | 
| 1698 | hence "[(a,b)] \<triangleq> []" by (simp add: at_ds1[OF at]) | |
| 17870 | 1699 | hence "[(a,b)]\<bullet>x=([]::'x prm)\<bullet>x" by (rule pt3[OF pt]) | 
| 1700 | thus ?thesis by (simp only: pt1[OF pt]) | |
| 1701 | next | |
| 1702 | assume c2: "a\<noteq>b" | |
| 1703 |   from a1 have f1: "finite {c. [(a,c)]\<bullet>x \<noteq> x}" by (simp add: fresh_def supp_def)
 | |
| 1704 |   from a2 have f2: "finite {c. [(b,c)]\<bullet>x \<noteq> x}" by (simp add: fresh_def supp_def)
 | |
| 1705 |   from f1 and f2 have f3: "finite {c. perm [(a,c)] x \<noteq> x \<or> perm [(b,c)] x \<noteq> x}" 
 | |
| 1706 | by (force simp only: Collect_disj_eq) | |
| 1707 |   have "infinite {c. [(a,c)]\<bullet>x = x \<and> [(b,c)]\<bullet>x = x}" 
 | |
| 1708 | by (simp add: finite_infinite[OF f3,OF at4[OF at], simplified]) | |
| 1709 |   hence "infinite ({c. [(a,c)]\<bullet>x = x \<and> [(b,c)]\<bullet>x = x}-{a,b})" 
 | |
| 1710 | by (force dest: Diff_infinite_finite) | |
| 1711 |   hence "({c. [(a,c)]\<bullet>x = x \<and> [(b,c)]\<bullet>x = x}-{a,b}) \<noteq> {}" 
 | |
| 1712 | by (auto iff del: finite_Diff_insert Diff_eq_empty_iff) | |
| 1713 |   hence "\<exists>c. c\<in>({c. [(a,c)]\<bullet>x = x \<and> [(b,c)]\<bullet>x = x}-{a,b})" by (force)
 | |
| 1714 | then obtain c | |
| 1715 | where eq1: "[(a,c)]\<bullet>x = x" | |
| 1716 | and eq2: "[(b,c)]\<bullet>x = x" | |
| 1717 | and ineq: "a\<noteq>c \<and> b\<noteq>c" | |
| 1718 | by (force) | |
| 1719 | hence "[(a,c)]\<bullet>([(b,c)]\<bullet>([(a,c)]\<bullet>x)) = x" by simp | |
| 1720 | hence eq3: "[(a,c),(b,c),(a,c)]\<bullet>x = x" by (simp add: pt2[OF pt,symmetric]) | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 1721 | from c2 ineq have "[(a,c),(b,c),(a,c)] \<triangleq> [(a,b)]" by (simp add: at_ds3[OF at]) | 
| 17870 | 1722 | hence "[(a,c),(b,c),(a,c)]\<bullet>x = [(a,b)]\<bullet>x" by (rule pt3[OF pt]) | 
| 1723 | thus ?thesis using eq3 by simp | |
| 1724 | qed | |
| 1725 | ||
| 1726 | lemma pt_perm_compose: | |
| 1727 | fixes pi1 :: "'x prm" | |
| 1728 | and pi2 :: "'x prm" | |
| 1729 | and x :: "'a" | |
| 1730 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1731 |   and     at: "at TYPE('x)"
 | |
| 1732 | shows "pi2\<bullet>(pi1\<bullet>x) = (pi2\<bullet>pi1)\<bullet>(pi2\<bullet>x)" | |
| 1733 | proof - | |
| 23393 | 1734 | have "(pi2@pi1) \<triangleq> ((pi2\<bullet>pi1)@pi2)" by (rule at_ds8 [OF at]) | 
| 17870 | 1735 | hence "(pi2@pi1)\<bullet>x = ((pi2\<bullet>pi1)@pi2)\<bullet>x" by (rule pt3[OF pt]) | 
| 1736 | thus ?thesis by (simp add: pt2[OF pt]) | |
| 1737 | qed | |
| 1738 | ||
| 19045 | 1739 | lemma pt_perm_compose': | 
| 1740 | fixes pi1 :: "'x prm" | |
| 1741 | and pi2 :: "'x prm" | |
| 1742 | and x :: "'a" | |
| 1743 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1744 |   and     at: "at TYPE('x)"
 | |
| 1745 | shows "(pi2\<bullet>pi1)\<bullet>x = pi2\<bullet>(pi1\<bullet>((rev pi2)\<bullet>x))" | |
| 1746 | proof - | |
| 1747 | have "pi2\<bullet>(pi1\<bullet>((rev pi2)\<bullet>x)) = (pi2\<bullet>pi1)\<bullet>(pi2\<bullet>((rev pi2)\<bullet>x))" | |
| 1748 | by (rule pt_perm_compose[OF pt, OF at]) | |
| 1749 | also have "\<dots> = (pi2\<bullet>pi1)\<bullet>x" by (simp add: pt_pi_rev[OF pt, OF at]) | |
| 1750 | finally have "pi2\<bullet>(pi1\<bullet>((rev pi2)\<bullet>x)) = (pi2\<bullet>pi1)\<bullet>x" by simp | |
| 1751 | thus ?thesis by simp | |
| 1752 | qed | |
| 1753 | ||
| 17870 | 1754 | lemma pt_perm_compose_rev: | 
| 1755 | fixes pi1 :: "'x prm" | |
| 1756 | and pi2 :: "'x prm" | |
| 1757 | and x :: "'a" | |
| 1758 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1759 |   and     at: "at TYPE('x)"
 | |
| 1760 | shows "(rev pi2)\<bullet>((rev pi1)\<bullet>x) = (rev pi1)\<bullet>(rev (pi1\<bullet>pi2)\<bullet>x)" | |
| 1761 | proof - | |
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 1762 | have "((rev pi2)@(rev pi1)) \<triangleq> ((rev pi1)@(rev (pi1\<bullet>pi2)))" by (rule at_ds9[OF at]) | 
| 17870 | 1763 | hence "((rev pi2)@(rev pi1))\<bullet>x = ((rev pi1)@(rev (pi1\<bullet>pi2)))\<bullet>x" by (rule pt3[OF pt]) | 
| 1764 | thus ?thesis by (simp add: pt2[OF pt]) | |
| 1765 | qed | |
| 1766 | ||
| 19972 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1767 | section {* equivaraince for some connectives *}
 | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1768 | |
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1769 | lemma pt_all_eqvt: | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1770 | fixes pi :: "'x prm" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1771 | and x :: "'a" | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1772 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1773 |   and     at: "at TYPE('x)"
 | 
| 22715 
381e6c45f13b
improved the equivariance lemmas for the quantifiers; had to export the lemma eqvt_force_add and eqvt_force_del in the thmdecls
 urbanc parents: 
22714diff
changeset | 1774 | shows "pi\<bullet>(\<forall>(x::'a). P x) = (\<forall>(x::'a). pi\<bullet>(P ((rev pi)\<bullet>x)))" | 
| 19972 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1775 | apply(auto simp add: perm_bool perm_fun_def) | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1776 | apply(drule_tac x="pi\<bullet>x" in spec) | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1777 | apply(simp add: pt_rev_pi[OF pt, OF at]) | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1778 | done | 
| 
89c5afe4139a
added more infrastructure for the recursion combinator
 urbanc parents: 
19869diff
changeset | 1779 | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1780 | lemma pt_ex_eqvt: | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1781 | fixes pi :: "'x prm" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1782 | and x :: "'a" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1783 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1784 |   and     at: "at TYPE('x)"
 | 
| 22715 
381e6c45f13b
improved the equivariance lemmas for the quantifiers; had to export the lemma eqvt_force_add and eqvt_force_del in the thmdecls
 urbanc parents: 
22714diff
changeset | 1785 | shows "pi\<bullet>(\<exists>(x::'a). P x) = (\<exists>(x::'a). pi\<bullet>(P ((rev pi)\<bullet>x)))" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1786 | apply(auto simp add: perm_bool perm_fun_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1787 | apply(rule_tac x="pi\<bullet>x" in exI) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1788 | apply(simp add: pt_rev_pi[OF pt, OF at]) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1789 | done | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 1790 | |
| 17870 | 1791 | section {* facts about supports *}
 | 
| 1792 | (*==============================*) | |
| 1793 | ||
| 1794 | lemma supports_subset: | |
| 1795 | fixes x :: "'a" | |
| 1796 | and S1 :: "'x set" | |
| 1797 | and S2 :: "'x set" | |
| 1798 | assumes a: "S1 supports x" | |
| 18053 
2719a6b7d95e
some minor tweaks in some proofs (nothing extraordinary)
 urbanc parents: 
18048diff
changeset | 1799 | and b: "S1 \<subseteq> S2" | 
| 17870 | 1800 | shows "S2 supports x" | 
| 1801 | using a b | |
| 22808 | 1802 | by (force simp add: supports_def) | 
| 17870 | 1803 | |
| 1804 | lemma supp_is_subset: | |
| 1805 | fixes S :: "'x set" | |
| 1806 | and x :: "'a" | |
| 1807 | assumes a1: "S supports x" | |
| 1808 | and a2: "finite S" | |
| 1809 | shows "(supp x)\<subseteq>S" | |
| 1810 | proof (rule ccontr) | |
| 1811 | assume "\<not>(supp x \<subseteq> S)" | |
| 1812 | hence "\<exists>a. a\<in>(supp x) \<and> a\<notin>S" by force | |
| 1813 | then obtain a where b1: "a\<in>supp x" and b2: "a\<notin>S" by force | |
| 22808 | 1814 | from a1 b2 have "\<forall>b. (b\<notin>S \<longrightarrow> ([(a,b)]\<bullet>x = x))" by (unfold supports_def, force) | 
| 19216 | 1815 |   hence "{b. [(a,b)]\<bullet>x \<noteq> x}\<subseteq>S" by force
 | 
| 17870 | 1816 |   with a2 have "finite {b. [(a,b)]\<bullet>x \<noteq> x}" by (simp add: finite_subset)
 | 
| 1817 | hence "a\<notin>(supp x)" by (unfold supp_def, auto) | |
| 1818 | with b1 show False by simp | |
| 1819 | qed | |
| 1820 | ||
| 18264 | 1821 | lemma supp_supports: | 
| 1822 | fixes x :: "'a" | |
| 1823 |   assumes  pt: "pt TYPE('a) TYPE('x)"
 | |
| 1824 |   and      at: "at TYPE ('x)"
 | |
| 1825 | shows "((supp x)::'x set) supports x" | |
| 22808 | 1826 | proof (unfold supports_def, intro strip) | 
| 18264 | 1827 | fix a b | 
| 1828 | assume "(a::'x)\<notin>(supp x) \<and> (b::'x)\<notin>(supp x)" | |
| 1829 | hence "a\<sharp>x" and "b\<sharp>x" by (auto simp add: fresh_def) | |
| 1830 | thus "[(a,b)]\<bullet>x = x" by (rule pt_fresh_fresh[OF pt, OF at]) | |
| 1831 | qed | |
| 1832 | ||
| 17870 | 1833 | lemma supports_finite: | 
| 1834 | fixes S :: "'x set" | |
| 1835 | and x :: "'a" | |
| 1836 | assumes a1: "S supports x" | |
| 1837 | and a2: "finite S" | |
| 1838 | shows "finite ((supp x)::'x set)" | |
| 1839 | proof - | |
| 1840 | have "(supp x)\<subseteq>S" using a1 a2 by (rule supp_is_subset) | |
| 1841 | thus ?thesis using a2 by (simp add: finite_subset) | |
| 1842 | qed | |
| 1843 | ||
| 1844 | lemma supp_is_inter: | |
| 1845 | fixes x :: "'a" | |
| 1846 |   assumes  pt: "pt TYPE('a) TYPE('x)"
 | |
| 1847 |   and      at: "at TYPE ('x)"
 | |
| 1848 |   and      fs: "fs TYPE('a) TYPE('x)"
 | |
| 1849 |   shows "((supp x)::'x set) = (\<Inter> {S. finite S \<and> S supports x})"
 | |
| 1850 | proof (rule equalityI) | |
| 1851 |   show "((supp x)::'x set) \<subseteq> (\<Inter> {S. finite S \<and> S supports x})"
 | |
| 1852 | proof (clarify) | |
| 1853 | fix S c | |
| 1854 | assume b: "c\<in>((supp x)::'x set)" and "finite (S::'x set)" and "S supports x" | |
| 1855 | hence "((supp x)::'x set)\<subseteq>S" by (simp add: supp_is_subset) | |
| 1856 | with b show "c\<in>S" by force | |
| 1857 | qed | |
| 1858 | next | |
| 1859 |   show "(\<Inter> {S. finite S \<and> S supports x}) \<subseteq> ((supp x)::'x set)"
 | |
| 1860 | proof (clarify, simp) | |
| 1861 | fix c | |
| 1862 | assume d: "\<forall>(S::'x set). finite S \<and> S supports x \<longrightarrow> c\<in>S" | |
| 1863 | have "((supp x)::'x set) supports x" by (rule supp_supports[OF pt, OF at]) | |
| 1864 | with d fs1[OF fs] show "c\<in>supp x" by force | |
| 1865 | qed | |
| 1866 | qed | |
| 1867 | ||
| 1868 | lemma supp_is_least_supports: | |
| 1869 | fixes S :: "'x set" | |
| 1870 | and x :: "'a" | |
| 1871 |   assumes  pt: "pt TYPE('a) TYPE('x)"
 | |
| 1872 |   and      at: "at TYPE ('x)"
 | |
| 1873 | and a1: "S supports x" | |
| 1874 | and a2: "finite S" | |
| 19477 | 1875 | and a3: "\<forall>S'. (S' supports x) \<longrightarrow> S\<subseteq>S'" | 
| 17870 | 1876 | shows "S = (supp x)" | 
| 1877 | proof (rule equalityI) | |
| 1878 | show "((supp x)::'x set)\<subseteq>S" using a1 a2 by (rule supp_is_subset) | |
| 1879 | next | |
| 19477 | 1880 | have "((supp x)::'x set) supports x" by (rule supp_supports[OF pt, OF at]) | 
| 1881 | with a3 show "S\<subseteq>supp x" by force | |
| 17870 | 1882 | qed | 
| 1883 | ||
| 1884 | lemma supports_set: | |
| 1885 | fixes S :: "'x set" | |
| 1886 | and X :: "'a set" | |
| 1887 |   assumes  pt: "pt TYPE('a) TYPE('x)"
 | |
| 1888 |   and      at: "at TYPE ('x)"
 | |
| 1889 | and a: "\<forall>x\<in>X. (\<forall>(a::'x) (b::'x). a\<notin>S\<and>b\<notin>S \<longrightarrow> ([(a,b)]\<bullet>x)\<in>X)" | |
| 1890 | shows "S supports X" | |
| 1891 | using a | |
| 22808 | 1892 | apply(auto simp add: supports_def) | 
| 17870 | 1893 | apply(simp add: pt_set_bij1a[OF pt, OF at]) | 
| 1894 | apply(force simp add: pt_swap_bij[OF pt, OF at]) | |
| 1895 | apply(simp add: pt_set_bij1a[OF pt, OF at]) | |
| 1896 | done | |
| 1897 | ||
| 1898 | lemma supports_fresh: | |
| 1899 | fixes S :: "'x set" | |
| 1900 | and a :: "'x" | |
| 1901 | and x :: "'a" | |
| 1902 | assumes a1: "S supports x" | |
| 1903 | and a2: "finite S" | |
| 1904 | and a3: "a\<notin>S" | |
| 1905 | shows "a\<sharp>x" | |
| 1906 | proof (simp add: fresh_def) | |
| 1907 | have "(supp x)\<subseteq>S" using a1 a2 by (rule supp_is_subset) | |
| 1908 | thus "a\<notin>(supp x)" using a3 by force | |
| 1909 | qed | |
| 1910 | ||
| 1911 | lemma at_fin_set_supports: | |
| 1912 | fixes X::"'x set" | |
| 1913 |   assumes at: "at TYPE('x)"
 | |
| 1914 | shows "X supports X" | |
| 19329 | 1915 | proof - | 
| 1916 | have "\<forall>a b. a\<notin>X \<and> b\<notin>X \<longrightarrow> [(a,b)]\<bullet>X = X" by (auto simp add: perm_set_def at_calc[OF at]) | |
| 22808 | 1917 | then show ?thesis by (simp add: supports_def) | 
| 17870 | 1918 | qed | 
| 1919 | ||
| 19329 | 1920 | lemma infinite_Collection: | 
| 1921 | assumes a1:"infinite X" | |
| 1922 | and a2:"\<forall>b\<in>X. P(b)" | |
| 1923 |   shows "infinite {b\<in>X. P(b)}"
 | |
| 1924 | using a1 a2 | |
| 1925 | apply auto | |
| 1926 |   apply (subgoal_tac "infinite (X - {b\<in>X. P b})")
 | |
| 1927 | apply (simp add: set_diff_def) | |
| 1928 | apply (simp add: Diff_infinite_finite) | |
| 1929 | done | |
| 1930 | ||
| 17870 | 1931 | lemma at_fin_set_supp: | 
| 19329 | 1932 | fixes X::"'x set" | 
| 17870 | 1933 |   assumes at: "at TYPE('x)"
 | 
| 1934 | and fs: "finite X" | |
| 1935 | shows "(supp X) = X" | |
| 19329 | 1936 | proof (rule subset_antisym) | 
| 1937 | show "(supp X) \<subseteq> X" using at_fin_set_supports[OF at] using fs by (simp add: supp_is_subset) | |
| 1938 | next | |
| 1939 | have inf: "infinite (UNIV-X)" using at4[OF at] fs by (auto simp add: Diff_infinite_finite) | |
| 1940 |   { fix a::"'x"
 | |
| 1941 | assume asm: "a\<in>X" | |
| 1942 | hence "\<forall>b\<in>(UNIV-X). [(a,b)]\<bullet>X\<noteq>X" by (auto simp add: perm_set_def at_calc[OF at]) | |
| 1943 |     with inf have "infinite {b\<in>(UNIV-X). [(a,b)]\<bullet>X\<noteq>X}" by (rule infinite_Collection)
 | |
| 1944 |     hence "infinite {b. [(a,b)]\<bullet>X\<noteq>X}" by (rule_tac infinite_super, auto)
 | |
| 1945 | hence "a\<in>(supp X)" by (simp add: supp_def) | |
| 1946 | } | |
| 1947 | then show "X\<subseteq>(supp X)" by blast | |
| 17870 | 1948 | qed | 
| 1949 | ||
| 1950 | section {* Permutations acting on Functions *}
 | |
| 1951 | (*==========================================*) | |
| 1952 | ||
| 1953 | lemma pt_fun_app_eq: | |
| 1954 | fixes f :: "'a\<Rightarrow>'b" | |
| 1955 | and x :: "'a" | |
| 1956 | and pi :: "'x prm" | |
| 1957 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1958 |   and     at: "at TYPE('x)"
 | |
| 1959 | shows "pi\<bullet>(f x) = (pi\<bullet>f)(pi\<bullet>x)" | |
| 1960 | by (simp add: perm_fun_def pt_rev_pi[OF pt, OF at]) | |
| 1961 | ||
| 1962 | ||
| 19045 | 1963 | --"sometimes pt_fun_app_eq does too much; this lemma 'corrects it'" | 
| 17870 | 1964 | lemma pt_perm: | 
| 1965 | fixes x :: "'a" | |
| 1966 | and pi1 :: "'x prm" | |
| 1967 | and pi2 :: "'x prm" | |
| 1968 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1969 |   and     at: "at TYPE ('x)"
 | |
| 1970 | shows "(pi1\<bullet>perm pi2)(pi1\<bullet>x) = pi1\<bullet>(pi2\<bullet>x)" | |
| 1971 | by (simp add: pt_fun_app_eq[OF pt, OF at]) | |
| 1972 | ||
| 1973 | ||
| 1974 | lemma pt_fun_eq: | |
| 1975 | fixes f :: "'a\<Rightarrow>'b" | |
| 1976 | and pi :: "'x prm" | |
| 1977 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 1978 |   and     at: "at TYPE('x)"
 | |
| 1979 | shows "(pi\<bullet>f = f) = (\<forall> x. pi\<bullet>(f x) = f (pi\<bullet>x))" (is "?LHS = ?RHS") | |
| 1980 | proof | |
| 1981 | assume a: "?LHS" | |
| 1982 | show "?RHS" | |
| 1983 | proof | |
| 1984 | fix x | |
| 1985 | have "pi\<bullet>(f x) = (pi\<bullet>f)(pi\<bullet>x)" by (simp add: pt_fun_app_eq[OF pt, OF at]) | |
| 1986 | also have "\<dots> = f (pi\<bullet>x)" using a by simp | |
| 1987 | finally show "pi\<bullet>(f x) = f (pi\<bullet>x)" by simp | |
| 1988 | qed | |
| 1989 | next | |
| 1990 | assume b: "?RHS" | |
| 1991 | show "?LHS" | |
| 1992 | proof (rule ccontr) | |
| 1993 | assume "(pi\<bullet>f) \<noteq> f" | |
| 19477 | 1994 | hence "\<exists>x. (pi\<bullet>f) x \<noteq> f x" by (simp add: expand_fun_eq) | 
| 1995 | then obtain x where b1: "(pi\<bullet>f) x \<noteq> f x" by force | |
| 1996 | from b have "pi\<bullet>(f ((rev pi)\<bullet>x)) = f (pi\<bullet>((rev pi)\<bullet>x))" by force | |
| 1997 | hence "(pi\<bullet>f)(pi\<bullet>((rev pi)\<bullet>x)) = f (pi\<bullet>((rev pi)\<bullet>x))" | |
| 17870 | 1998 | by (simp add: pt_fun_app_eq[OF pt, OF at]) | 
| 19477 | 1999 | hence "(pi\<bullet>f) x = f x" by (simp add: pt_pi_rev[OF pt, OF at]) | 
| 17870 | 2000 | with b1 show "False" by simp | 
| 2001 | qed | |
| 2002 | qed | |
| 2003 | ||
| 2004 | -- "two helper lemmas for the equivariance of functions" | |
| 2005 | lemma pt_swap_eq_aux: | |
| 2006 | fixes y :: "'a" | |
| 2007 | and pi :: "'x prm" | |
| 2008 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2009 | and a: "\<forall>(a::'x) (b::'x). [(a,b)]\<bullet>y = y" | |
| 2010 | shows "pi\<bullet>y = y" | |
| 2011 | proof(induct pi) | |
| 24544 | 2012 | case Nil show ?case by (simp add: pt1[OF pt]) | 
| 2013 | next | |
| 2014 | case (Cons x xs) | |
| 2015 | have ih: "xs\<bullet>y = y" by fact | |
| 2016 | obtain a b where p: "x=(a,b)" by force | |
| 2017 | have "((a,b)#xs)\<bullet>y = ([(a,b)]@xs)\<bullet>y" by simp | |
| 2018 | also have "\<dots> = [(a,b)]\<bullet>(xs\<bullet>y)" by (simp only: pt2[OF pt]) | |
| 2019 | finally show ?case using a ih p by simp | |
| 2020 | qed | |
| 17870 | 2021 | |
| 2022 | lemma pt_swap_eq: | |
| 2023 | fixes y :: "'a" | |
| 2024 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2025 | shows "(\<forall>(a::'x) (b::'x). [(a,b)]\<bullet>y = y) = (\<forall>pi::'x prm. pi\<bullet>y = y)" | |
| 2026 | by (force intro: pt_swap_eq_aux[OF pt]) | |
| 2027 | ||
| 2028 | lemma pt_eqvt_fun1a: | |
| 2029 | fixes f :: "'a\<Rightarrow>'b" | |
| 2030 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 2031 |   and     ptb: "pt TYPE('b) TYPE('x)"
 | |
| 2032 |   and     at:  "at TYPE('x)"
 | |
| 2033 |   and     a:   "((supp f)::'x set)={}"
 | |
| 2034 | shows "\<forall>(pi::'x prm). pi\<bullet>f = f" | |
| 2035 | proof (intro strip) | |
| 2036 | fix pi | |
| 2037 | have "\<forall>a b. a\<notin>((supp f)::'x set) \<and> b\<notin>((supp f)::'x set) \<longrightarrow> (([(a,b)]\<bullet>f) = f)" | |
| 2038 | by (intro strip, fold fresh_def, | |
| 2039 | simp add: pt_fresh_fresh[OF pt_fun_inst[OF pta, OF ptb, OF at],OF at]) | |
| 2040 | with a have "\<forall>(a::'x) (b::'x). ([(a,b)]\<bullet>f) = f" by force | |
| 2041 | hence "\<forall>(pi::'x prm). pi\<bullet>f = f" | |
| 2042 | by (simp add: pt_swap_eq[OF pt_fun_inst[OF pta, OF ptb, OF at]]) | |
| 2043 | thus "(pi::'x prm)\<bullet>f = f" by simp | |
| 2044 | qed | |
| 2045 | ||
| 2046 | lemma pt_eqvt_fun1b: | |
| 2047 | fixes f :: "'a\<Rightarrow>'b" | |
| 2048 | assumes a: "\<forall>(pi::'x prm). pi\<bullet>f = f" | |
| 2049 |   shows "((supp f)::'x set)={}"
 | |
| 2050 | using a by (simp add: supp_def) | |
| 2051 | ||
| 2052 | lemma pt_eqvt_fun1: | |
| 2053 | fixes f :: "'a\<Rightarrow>'b" | |
| 2054 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 2055 |   and     ptb: "pt TYPE('b) TYPE('x)"
 | |
| 2056 |   and     at: "at TYPE('x)"
 | |
| 2057 |   shows "(((supp f)::'x set)={}) = (\<forall>(pi::'x prm). pi\<bullet>f = f)" (is "?LHS = ?RHS")
 | |
| 2058 | by (rule iffI, simp add: pt_eqvt_fun1a[OF pta, OF ptb, OF at], simp add: pt_eqvt_fun1b) | |
| 2059 | ||
| 2060 | lemma pt_eqvt_fun2a: | |
| 2061 | fixes f :: "'a\<Rightarrow>'b" | |
| 2062 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 2063 |   and     ptb: "pt TYPE('b) TYPE('x)"
 | |
| 2064 |   and     at: "at TYPE('x)"
 | |
| 2065 |   assumes a: "((supp f)::'x set)={}"
 | |
| 2066 | shows "\<forall>(pi::'x prm) (x::'a). pi\<bullet>(f x) = f(pi\<bullet>x)" | |
| 2067 | proof (intro strip) | |
| 2068 | fix pi x | |
| 2069 | from a have b: "\<forall>(pi::'x prm). pi\<bullet>f = f" by (simp add: pt_eqvt_fun1[OF pta, OF ptb, OF at]) | |
| 2070 | have "(pi::'x prm)\<bullet>(f x) = (pi\<bullet>f)(pi\<bullet>x)" by (simp add: pt_fun_app_eq[OF pta, OF at]) | |
| 2071 | with b show "(pi::'x prm)\<bullet>(f x) = f (pi\<bullet>x)" by force | |
| 2072 | qed | |
| 2073 | ||
| 2074 | lemma pt_eqvt_fun2b: | |
| 2075 | fixes f :: "'a\<Rightarrow>'b" | |
| 2076 |   assumes pt1: "pt TYPE('a) TYPE('x)"
 | |
| 2077 |   and     pt2: "pt TYPE('b) TYPE('x)"
 | |
| 2078 |   and     at: "at TYPE('x)"
 | |
| 2079 | assumes a: "\<forall>(pi::'x prm) (x::'a). pi\<bullet>(f x) = f(pi\<bullet>x)" | |
| 2080 |   shows "((supp f)::'x set)={}"
 | |
| 2081 | proof - | |
| 2082 | from a have "\<forall>(pi::'x prm). pi\<bullet>f = f" by (simp add: pt_fun_eq[OF pt1, OF at, symmetric]) | |
| 2083 | thus ?thesis by (simp add: supp_def) | |
| 2084 | qed | |
| 2085 | ||
| 2086 | lemma pt_eqvt_fun2: | |
| 2087 | fixes f :: "'a\<Rightarrow>'b" | |
| 2088 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 2089 |   and     ptb: "pt TYPE('b) TYPE('x)"
 | |
| 2090 |   and     at: "at TYPE('x)"
 | |
| 2091 |   shows "(((supp f)::'x set)={}) = (\<forall>(pi::'x prm) (x::'a). pi\<bullet>(f x) = f(pi\<bullet>x))" 
 | |
| 2092 | by (rule iffI, | |
| 2093 | simp add: pt_eqvt_fun2a[OF pta, OF ptb, OF at], | |
| 2094 | simp add: pt_eqvt_fun2b[OF pta, OF ptb, OF at]) | |
| 2095 | ||
| 2096 | lemma pt_supp_fun_subset: | |
| 2097 | fixes f :: "'a\<Rightarrow>'b" | |
| 2098 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 2099 |   and     ptb: "pt TYPE('b) TYPE('x)"
 | |
| 2100 |   and     at: "at TYPE('x)" 
 | |
| 2101 | and f1: "finite ((supp f)::'x set)" | |
| 2102 | and f2: "finite ((supp x)::'x set)" | |
| 2103 | shows "supp (f x) \<subseteq> (((supp f)\<union>(supp x))::'x set)" | |
| 2104 | proof - | |
| 2105 | have s1: "((supp f)\<union>((supp x)::'x set)) supports (f x)" | |
| 22808 | 2106 | proof (simp add: supports_def, fold fresh_def, auto) | 
| 17870 | 2107 | fix a::"'x" and b::"'x" | 
| 2108 | assume "a\<sharp>f" and "b\<sharp>f" | |
| 2109 | hence a1: "[(a,b)]\<bullet>f = f" | |
| 2110 | by (rule pt_fresh_fresh[OF pt_fun_inst[OF pta, OF ptb, OF at], OF at]) | |
| 2111 | assume "a\<sharp>x" and "b\<sharp>x" | |
| 2112 | hence a2: "[(a,b)]\<bullet>x = x" by (rule pt_fresh_fresh[OF pta, OF at]) | |
| 2113 | from a1 a2 show "[(a,b)]\<bullet>(f x) = (f x)" by (simp add: pt_fun_app_eq[OF pta, OF at]) | |
| 2114 | qed | |
| 2115 | from f1 f2 have "finite ((supp f)\<union>((supp x)::'x set))" by force | |
| 2116 | with s1 show ?thesis by (rule supp_is_subset) | |
| 2117 | qed | |
| 2118 | ||
| 2119 | lemma pt_empty_supp_fun_subset: | |
| 2120 | fixes f :: "'a\<Rightarrow>'b" | |
| 2121 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 2122 |   and     ptb: "pt TYPE('b) TYPE('x)"
 | |
| 2123 |   and     at:  "at TYPE('x)" 
 | |
| 2124 |   and     e:   "(supp f)=({}::'x set)"
 | |
| 2125 | shows "supp (f x) \<subseteq> ((supp x)::'x set)" | |
| 2126 | proof (unfold supp_def, auto) | |
| 2127 | fix a::"'x" | |
| 2128 |   assume a1: "finite {b. [(a, b)]\<bullet>x \<noteq> x}"
 | |
| 2129 |   assume "infinite {b. [(a, b)]\<bullet>(f x) \<noteq> f x}"
 | |
| 2130 |   hence a2: "infinite {b. f ([(a, b)]\<bullet>x) \<noteq> f x}" using e
 | |
| 2131 | by (simp add: pt_eqvt_fun2[OF pta, OF ptb, OF at]) | |
| 2132 |   have a3: "{b. f ([(a,b)]\<bullet>x) \<noteq> f x}\<subseteq>{b. [(a,b)]\<bullet>x \<noteq> x}" by force
 | |
| 2133 | from a1 a2 a3 show False by (force dest: finite_subset) | |
| 2134 | qed | |
| 2135 | ||
| 18264 | 2136 | section {* Facts about the support of finite sets of finitely supported things *}
 | 
| 2137 | (*=============================================================================*) | |
| 2138 | ||
| 2139 | constdefs | |
| 2140 |   X_to_Un_supp :: "('a set) \<Rightarrow> 'x set"
 | |
| 2141 | "X_to_Un_supp X \<equiv> \<Union>x\<in>X. ((supp x)::'x set)" | |
| 2142 | ||
| 2143 | lemma UNION_f_eqvt: | |
| 2144 |   fixes X::"('a set)"
 | |
| 2145 | and f::"'a \<Rightarrow> 'x set" | |
| 2146 | and pi::"'x prm" | |
| 2147 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2148 |   and     at: "at TYPE('x)"
 | |
| 2149 | shows "pi\<bullet>(\<Union>x\<in>X. f x) = (\<Union>x\<in>(pi\<bullet>X). (pi\<bullet>f) x)" | |
| 2150 | proof - | |
| 2151 |   have pt_x: "pt TYPE('x) TYPE('x)" by (force intro: at_pt_inst at)
 | |
| 2152 | show ?thesis | |
| 18351 | 2153 | proof (rule equalityI) | 
| 2154 | case goal1 | |
| 2155 | show "pi\<bullet>(\<Union>x\<in>X. f x) \<subseteq> (\<Union>x\<in>(pi\<bullet>X). (pi\<bullet>f) x)" | |
| 2156 | apply(auto simp add: perm_set_def) | |
| 22829 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 2157 | apply(rule_tac x="pi\<bullet>xb" in exI) | 
| 18351 | 2158 | apply(rule conjI) | 
| 22829 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 2159 | apply(rule_tac x="xb" in exI) | 
| 18351 | 2160 | apply(simp) | 
| 22829 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 2161 | apply(subgoal_tac "(pi\<bullet>f) (pi\<bullet>xb) = pi\<bullet>(f xb)")(*A*) | 
| 18351 | 2162 | apply(simp) | 
| 2163 | apply(rule pt_set_bij2[OF pt_x, OF at]) | |
| 2164 | apply(assumption) | |
| 2165 | (*A*) | |
| 2166 | apply(rule sym) | |
| 2167 | apply(rule pt_fun_app_eq[OF pt, OF at]) | |
| 2168 | done | |
| 2169 | next | |
| 2170 | case goal2 | |
| 2171 | show "(\<Union>x\<in>(pi\<bullet>X). (pi\<bullet>f) x) \<subseteq> pi\<bullet>(\<Union>x\<in>X. f x)" | |
| 2172 | apply(auto simp add: perm_set_def) | |
| 2173 | apply(rule_tac x="(rev pi)\<bullet>x" in exI) | |
| 2174 | apply(rule conjI) | |
| 2175 | apply(simp add: pt_pi_rev[OF pt_x, OF at]) | |
| 22829 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 2176 | apply(rule_tac x="xb" in bexI) | 
| 18351 | 2177 | apply(simp add: pt_set_bij1[OF pt_x, OF at]) | 
| 2178 | apply(simp add: pt_fun_app_eq[OF pt, OF at]) | |
| 2179 | apply(assumption) | |
| 2180 | done | |
| 2181 | qed | |
| 18264 | 2182 | qed | 
| 2183 | ||
| 2184 | lemma X_to_Un_supp_eqvt: | |
| 2185 |   fixes X::"('a set)"
 | |
| 2186 | and pi::"'x prm" | |
| 2187 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2188 |   and     at: "at TYPE('x)"
 | |
| 2189 | shows "pi\<bullet>(X_to_Un_supp X) = ((X_to_Un_supp (pi\<bullet>X))::'x set)" | |
| 2190 | apply(simp add: X_to_Un_supp_def) | |
| 2191 | apply(simp add: UNION_f_eqvt[OF pt, OF at] perm_fun_def) | |
| 2192 | apply(simp add: pt_perm_supp[OF pt, OF at]) | |
| 2193 | apply(simp add: pt_pi_rev[OF pt, OF at]) | |
| 2194 | done | |
| 2195 | ||
| 2196 | lemma Union_supports_set: | |
| 2197 |   fixes X::"('a set)"
 | |
| 2198 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2199 |   and     at: "at TYPE('x)"
 | |
| 2200 | shows "(\<Union>x\<in>X. ((supp x)::'x set)) supports X" | |
| 22808 | 2201 | apply(simp add: supports_def fresh_def[symmetric]) | 
| 18264 | 2202 | apply(rule allI)+ | 
| 2203 | apply(rule impI) | |
| 2204 | apply(erule conjE) | |
| 2205 | apply(simp add: perm_set_def) | |
| 2206 | apply(auto) | |
| 22829 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 2207 | apply(subgoal_tac "[(a,b)]\<bullet>xa = xa")(*A*) | 
| 18264 | 2208 | apply(simp) | 
| 2209 | apply(rule pt_fresh_fresh[OF pt, OF at]) | |
| 2210 | apply(force) | |
| 2211 | apply(force) | |
| 2212 | apply(rule_tac x="x" in exI) | |
| 2213 | apply(simp) | |
| 2214 | apply(rule sym) | |
| 2215 | apply(rule pt_fresh_fresh[OF pt, OF at]) | |
| 2216 | apply(force)+ | |
| 2217 | done | |
| 2218 | ||
| 2219 | lemma Union_of_fin_supp_sets: | |
| 2220 |   fixes X::"('a set)"
 | |
| 2221 |   assumes fs: "fs TYPE('a) TYPE('x)" 
 | |
| 2222 | and fi: "finite X" | |
| 2223 | shows "finite (\<Union>x\<in>X. ((supp x)::'x set))" | |
| 2224 | using fi by (induct, auto simp add: fs1[OF fs]) | |
| 2225 | ||
| 2226 | lemma Union_included_in_supp: | |
| 2227 |   fixes X::"('a set)"
 | |
| 2228 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2229 |   and     at: "at TYPE('x)"
 | |
| 2230 |   and     fs: "fs TYPE('a) TYPE('x)" 
 | |
| 2231 | and fi: "finite X" | |
| 2232 | shows "(\<Union>x\<in>X. ((supp x)::'x set)) \<subseteq> supp X" | |
| 2233 | proof - | |
| 2234 | have "supp ((X_to_Un_supp X)::'x set) \<subseteq> ((supp X)::'x set)" | |
| 2235 | apply(rule pt_empty_supp_fun_subset) | |
| 2236 | apply(force intro: pt_set_inst at_pt_inst pt at)+ | |
| 2237 | apply(rule pt_eqvt_fun2b) | |
| 2238 | apply(force intro: pt_set_inst at_pt_inst pt at)+ | |
| 18351 | 2239 | apply(rule allI)+ | 
| 18264 | 2240 | apply(rule X_to_Un_supp_eqvt[OF pt, OF at]) | 
| 2241 | done | |
| 2242 | hence "supp (\<Union>x\<in>X. ((supp x)::'x set)) \<subseteq> ((supp X)::'x set)" by (simp add: X_to_Un_supp_def) | |
| 2243 | moreover | |
| 2244 | have "supp (\<Union>x\<in>X. ((supp x)::'x set)) = (\<Union>x\<in>X. ((supp x)::'x set))" | |
| 2245 | apply(rule at_fin_set_supp[OF at]) | |
| 2246 | apply(rule Union_of_fin_supp_sets[OF fs, OF fi]) | |
| 2247 | done | |
| 2248 | ultimately show ?thesis by force | |
| 2249 | qed | |
| 2250 | ||
| 2251 | lemma supp_of_fin_sets: | |
| 2252 |   fixes X::"('a set)"
 | |
| 2253 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2254 |   and     at: "at TYPE('x)"
 | |
| 2255 |   and     fs: "fs TYPE('a) TYPE('x)" 
 | |
| 2256 | and fi: "finite X" | |
| 2257 | shows "(supp X) = (\<Union>x\<in>X. ((supp x)::'x set))" | |
| 18351 | 2258 | apply(rule equalityI) | 
| 18264 | 2259 | apply(rule supp_is_subset) | 
| 2260 | apply(rule Union_supports_set[OF pt, OF at]) | |
| 2261 | apply(rule Union_of_fin_supp_sets[OF fs, OF fi]) | |
| 2262 | apply(rule Union_included_in_supp[OF pt, OF at, OF fs, OF fi]) | |
| 2263 | done | |
| 2264 | ||
| 2265 | lemma supp_fin_union: | |
| 2266 |   fixes X::"('a set)"
 | |
| 2267 |   and   Y::"('a set)"
 | |
| 2268 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2269 |   and     at: "at TYPE('x)"
 | |
| 2270 |   and     fs: "fs TYPE('a) TYPE('x)" 
 | |
| 2271 | and f1: "finite X" | |
| 2272 | and f2: "finite Y" | |
| 2273 | shows "(supp (X\<union>Y)) = (supp X)\<union>((supp Y)::'x set)" | |
| 2274 | using f1 f2 by (force simp add: supp_of_fin_sets[OF pt, OF at, OF fs]) | |
| 2275 | ||
| 2276 | lemma supp_fin_insert: | |
| 2277 |   fixes X::"('a set)"
 | |
| 2278 | and x::"'a" | |
| 2279 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2280 |   and     at: "at TYPE('x)"
 | |
| 2281 |   and     fs: "fs TYPE('a) TYPE('x)" 
 | |
| 2282 | and f: "finite X" | |
| 2283 | shows "(supp (insert x X)) = (supp x)\<union>((supp X)::'x set)" | |
| 2284 | proof - | |
| 2285 |   have "(supp (insert x X)) = ((supp ({x}\<union>(X::'a set)))::'x set)" by simp
 | |
| 2286 |   also have "\<dots> = (supp {x})\<union>(supp X)"
 | |
| 2287 | by (rule supp_fin_union[OF pt, OF at, OF fs], simp_all add: f) | |
| 2288 | finally show "(supp (insert x X)) = (supp x)\<union>((supp X)::'x set)" | |
| 2289 | by (simp add: supp_singleton) | |
| 2290 | qed | |
| 2291 | ||
| 2292 | lemma fresh_fin_union: | |
| 2293 |   fixes X::"('a set)"
 | |
| 2294 |   and   Y::"('a set)"
 | |
| 2295 | and a::"'x" | |
| 2296 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2297 |   and     at: "at TYPE('x)"
 | |
| 2298 |   and     fs: "fs TYPE('a) TYPE('x)" 
 | |
| 2299 | and f1: "finite X" | |
| 2300 | and f2: "finite Y" | |
| 2301 | shows "a\<sharp>(X\<union>Y) = (a\<sharp>X \<and> a\<sharp>Y)" | |
| 2302 | apply(simp add: fresh_def) | |
| 2303 | apply(simp add: supp_fin_union[OF pt, OF at, OF fs, OF f1, OF f2]) | |
| 2304 | done | |
| 2305 | ||
| 2306 | lemma fresh_fin_insert: | |
| 2307 |   fixes X::"('a set)"
 | |
| 2308 | and x::"'a" | |
| 2309 | and a::"'x" | |
| 2310 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2311 |   and     at: "at TYPE('x)"
 | |
| 2312 |   and     fs: "fs TYPE('a) TYPE('x)" 
 | |
| 2313 | and f: "finite X" | |
| 2314 | shows "a\<sharp>(insert x X) = (a\<sharp>x \<and> a\<sharp>X)" | |
| 2315 | apply(simp add: fresh_def) | |
| 2316 | apply(simp add: supp_fin_insert[OF pt, OF at, OF fs, OF f]) | |
| 2317 | done | |
| 2318 | ||
| 2319 | lemma fresh_fin_insert1: | |
| 2320 |   fixes X::"('a set)"
 | |
| 2321 | and x::"'a" | |
| 2322 | and a::"'x" | |
| 2323 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2324 |   and     at: "at TYPE('x)"
 | |
| 2325 |   and     fs: "fs TYPE('a) TYPE('x)" 
 | |
| 2326 | and f: "finite X" | |
| 2327 | and a1: "a\<sharp>x" | |
| 2328 | and a2: "a\<sharp>X" | |
| 2329 | shows "a\<sharp>(insert x X)" | |
| 2330 | using a1 a2 | |
| 2331 | apply(simp add: fresh_fin_insert[OF pt, OF at, OF fs, OF f]) | |
| 2332 | done | |
| 2333 | ||
| 2334 | lemma pt_list_set_supp: | |
| 2335 | fixes xs :: "'a list" | |
| 2336 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2337 |   and     at: "at TYPE('x)"
 | |
| 2338 |   and     fs: "fs TYPE('a) TYPE('x)"
 | |
| 2339 | shows "supp (set xs) = ((supp xs)::'x set)" | |
| 2340 | proof - | |
| 2341 | have "supp (set xs) = (\<Union>x\<in>(set xs). ((supp x)::'x set))" | |
| 2342 | by (rule supp_of_fin_sets[OF pt, OF at, OF fs], rule finite_set) | |
| 2343 | also have "(\<Union>x\<in>(set xs). ((supp x)::'x set)) = (supp xs)" | |
| 2344 | proof(induct xs) | |
| 2345 | case Nil show ?case by (simp add: supp_list_nil) | |
| 2346 | next | |
| 2347 | case (Cons h t) thus ?case by (simp add: supp_list_cons) | |
| 2348 | qed | |
| 2349 | finally show ?thesis by simp | |
| 2350 | qed | |
| 2351 | ||
| 2352 | lemma pt_list_set_fresh: | |
| 2353 | fixes a :: "'x" | |
| 2354 | and xs :: "'a list" | |
| 2355 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2356 |   and     at: "at TYPE('x)"
 | |
| 2357 |   and     fs: "fs TYPE('a) TYPE('x)"
 | |
| 2358 | shows "a\<sharp>(set xs) = a\<sharp>xs" | |
| 2359 | by (simp add: fresh_def pt_list_set_supp[OF pt, OF at, OF fs]) | |
| 2360 | ||
| 19477 | 2361 | section {* composition instances *}
 | 
| 2362 | (* ============================= *) | |
| 2363 | ||
| 2364 | lemma cp_list_inst: | |
| 2365 |   assumes c1: "cp TYPE ('a) TYPE('x) TYPE('y)"
 | |
| 2366 |   shows "cp TYPE ('a list) TYPE('x) TYPE('y)"
 | |
| 2367 | using c1 | |
| 2368 | apply(simp add: cp_def) | |
| 2369 | apply(auto) | |
| 2370 | apply(induct_tac x) | |
| 2371 | apply(auto) | |
| 2372 | done | |
| 2373 | ||
| 2374 | lemma cp_set_inst: | |
| 2375 |   assumes c1: "cp TYPE ('a) TYPE('x) TYPE('y)"
 | |
| 2376 |   shows "cp TYPE ('a set) TYPE('x) TYPE('y)"
 | |
| 2377 | using c1 | |
| 2378 | apply(simp add: cp_def) | |
| 2379 | apply(auto) | |
| 2380 | apply(auto simp add: perm_set_def) | |
| 22829 
f1db55c7534d
tuned some proofs and changed variable names in some definitions of Nominal.thy
 urbanc parents: 
22808diff
changeset | 2381 | apply(rule_tac x="pi2\<bullet>xc" in exI) | 
| 19477 | 2382 | apply(auto) | 
| 2383 | done | |
| 2384 | ||
| 2385 | lemma cp_option_inst: | |
| 2386 |   assumes c1: "cp TYPE ('a) TYPE('x) TYPE('y)"
 | |
| 2387 |   shows "cp TYPE ('a option) TYPE('x) TYPE('y)"
 | |
| 2388 | using c1 | |
| 2389 | apply(simp add: cp_def) | |
| 2390 | apply(auto) | |
| 2391 | apply(case_tac x) | |
| 2392 | apply(auto) | |
| 2393 | done | |
| 2394 | ||
| 2395 | lemma cp_noption_inst: | |
| 2396 |   assumes c1: "cp TYPE ('a) TYPE('x) TYPE('y)"
 | |
| 2397 |   shows "cp TYPE ('a noption) TYPE('x) TYPE('y)"
 | |
| 2398 | using c1 | |
| 2399 | apply(simp add: cp_def) | |
| 2400 | apply(auto) | |
| 2401 | apply(case_tac x) | |
| 2402 | apply(auto) | |
| 2403 | done | |
| 2404 | ||
| 2405 | lemma cp_unit_inst: | |
| 2406 |   shows "cp TYPE (unit) TYPE('x) TYPE('y)"
 | |
| 2407 | apply(simp add: cp_def) | |
| 2408 | done | |
| 2409 | ||
| 2410 | lemma cp_bool_inst: | |
| 2411 |   shows "cp TYPE (bool) TYPE('x) TYPE('y)"
 | |
| 2412 | apply(simp add: cp_def) | |
| 2413 | apply(rule allI)+ | |
| 2414 | apply(induct_tac x) | |
| 2415 | apply(simp_all) | |
| 2416 | done | |
| 2417 | ||
| 2418 | lemma cp_prod_inst: | |
| 2419 |   assumes c1: "cp TYPE ('a) TYPE('x) TYPE('y)"
 | |
| 2420 |   and     c2: "cp TYPE ('b) TYPE('x) TYPE('y)"
 | |
| 2421 |   shows "cp TYPE ('a\<times>'b) TYPE('x) TYPE('y)"
 | |
| 2422 | using c1 c2 | |
| 2423 | apply(simp add: cp_def) | |
| 2424 | done | |
| 2425 | ||
| 2426 | lemma cp_fun_inst: | |
| 2427 |   assumes c1: "cp TYPE ('a) TYPE('x) TYPE('y)"
 | |
| 2428 |   and     c2: "cp TYPE ('b) TYPE('x) TYPE('y)"
 | |
| 2429 |   and     pt: "pt TYPE ('y) TYPE('x)"
 | |
| 2430 |   and     at: "at TYPE ('x)"
 | |
| 2431 |   shows "cp TYPE ('a\<Rightarrow>'b) TYPE('x) TYPE('y)"
 | |
| 2432 | using c1 c2 | |
| 2433 | apply(auto simp add: cp_def perm_fun_def expand_fun_eq) | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 2434 | apply(simp add: rev_eqvt[symmetric]) | 
| 19477 | 2435 | apply(simp add: pt_rev_pi[OF pt_list_inst[OF pt_prod_inst[OF pt, OF pt]], OF at]) | 
| 2436 | done | |
| 2437 | ||
| 2438 | ||
| 17870 | 2439 | section {* Andy's freshness lemma *}
 | 
| 2440 | (*================================*) | |
| 2441 | ||
| 2442 | lemma freshness_lemma: | |
| 2443 | fixes h :: "'x\<Rightarrow>'a" | |
| 2444 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 2445 |   and     at:  "at TYPE('x)" 
 | |
| 2446 | and f1: "finite ((supp h)::'x set)" | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2447 | and a: "\<exists>a::'x. a\<sharp>(h,h a)" | 
| 17870 | 2448 | shows "\<exists>fr::'a. \<forall>a::'x. a\<sharp>h \<longrightarrow> (h a) = fr" | 
| 2449 | proof - | |
| 2450 |   have ptb: "pt TYPE('x) TYPE('x)" by (simp add: at_pt_inst[OF at]) 
 | |
| 2451 |   have ptc: "pt TYPE('x\<Rightarrow>'a) TYPE('x)" by (simp add: pt_fun_inst[OF ptb, OF pta, OF at]) 
 | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2452 | from a obtain a0 where a1: "a0\<sharp>h" and a2: "a0\<sharp>(h a0)" by (force simp add: fresh_prod) | 
| 17870 | 2453 | show ?thesis | 
| 2454 | proof | |
| 2455 | let ?fr = "h (a0::'x)" | |
| 2456 | show "\<forall>(a::'x). (a\<sharp>h \<longrightarrow> ((h a) = ?fr))" | |
| 2457 | proof (intro strip) | |
| 2458 | fix a | |
| 2459 | assume a3: "(a::'x)\<sharp>h" | |
| 2460 | show "h (a::'x) = h a0" | |
| 2461 | proof (cases "a=a0") | |
| 2462 | case True thus "h (a::'x) = h a0" by simp | |
| 2463 | next | |
| 2464 | case False | |
| 2465 | assume "a\<noteq>a0" | |
| 2466 | hence c1: "a\<notin>((supp a0)::'x set)" by (simp add: fresh_def[symmetric] at_fresh[OF at]) | |
| 2467 | have c2: "a\<notin>((supp h)::'x set)" using a3 by (simp add: fresh_def) | |
| 2468 | from c1 c2 have c3: "a\<notin>((supp h)\<union>((supp a0)::'x set))" by force | |
| 2469 | have f2: "finite ((supp a0)::'x set)" by (simp add: at_supp[OF at]) | |
| 2470 | from f1 f2 have "((supp (h a0))::'x set)\<subseteq>((supp h)\<union>(supp a0))" | |
| 2471 | by (simp add: pt_supp_fun_subset[OF ptb, OF pta, OF at]) | |
| 2472 | hence "a\<notin>((supp (h a0))::'x set)" using c3 by force | |
| 2473 | hence "a\<sharp>(h a0)" by (simp add: fresh_def) | |
| 2474 | with a2 have d1: "[(a0,a)]\<bullet>(h a0) = (h a0)" by (rule pt_fresh_fresh[OF pta, OF at]) | |
| 2475 | from a1 a3 have d2: "[(a0,a)]\<bullet>h = h" by (rule pt_fresh_fresh[OF ptc, OF at]) | |
| 2476 | from d1 have "h a0 = [(a0,a)]\<bullet>(h a0)" by simp | |
| 2477 | also have "\<dots>= ([(a0,a)]\<bullet>h)([(a0,a)]\<bullet>a0)" by (simp add: pt_fun_app_eq[OF ptb, OF at]) | |
| 2478 | also have "\<dots> = h ([(a0,a)]\<bullet>a0)" using d2 by simp | |
| 2479 | also have "\<dots> = h a" by (simp add: at_calc[OF at]) | |
| 2480 | finally show "h a = h a0" by simp | |
| 2481 | qed | |
| 2482 | qed | |
| 2483 | qed | |
| 2484 | qed | |
| 2485 | ||
| 2486 | lemma freshness_lemma_unique: | |
| 2487 | fixes h :: "'x\<Rightarrow>'a" | |
| 2488 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2489 |   and     at: "at TYPE('x)" 
 | |
| 2490 | and f1: "finite ((supp h)::'x set)" | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2491 | and a: "\<exists>(a::'x). a\<sharp>(h,h a)" | 
| 17870 | 2492 | shows "\<exists>!(fr::'a). \<forall>(a::'x). a\<sharp>h \<longrightarrow> (h a) = fr" | 
| 18703 | 2493 | proof (rule ex_ex1I) | 
| 17870 | 2494 | from pt at f1 a show "\<exists>fr::'a. \<forall>a::'x. a\<sharp>h \<longrightarrow> h a = fr" by (simp add: freshness_lemma) | 
| 2495 | next | |
| 2496 | fix fr1 fr2 | |
| 2497 | assume b1: "\<forall>a::'x. a\<sharp>h \<longrightarrow> h a = fr1" | |
| 2498 | assume b2: "\<forall>a::'x. a\<sharp>h \<longrightarrow> h a = fr2" | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2499 | from a obtain a where "(a::'x)\<sharp>h" by (force simp add: fresh_prod) | 
| 17870 | 2500 | with b1 b2 have "h a = fr1 \<and> h a = fr2" by force | 
| 2501 | thus "fr1 = fr2" by force | |
| 2502 | qed | |
| 2503 | ||
| 2504 | -- "packaging the freshness lemma into a function" | |
| 2505 | constdefs | |
| 2506 |   fresh_fun :: "('x\<Rightarrow>'a)\<Rightarrow>'a"
 | |
| 2507 | "fresh_fun (h) \<equiv> THE fr. (\<forall>(a::'x). a\<sharp>h \<longrightarrow> (h a) = fr)" | |
| 2508 | ||
| 2509 | lemma fresh_fun_app: | |
| 2510 | fixes h :: "'x\<Rightarrow>'a" | |
| 2511 | and a :: "'x" | |
| 2512 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2513 |   and     at: "at TYPE('x)" 
 | |
| 2514 | and f1: "finite ((supp h)::'x set)" | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2515 | and a: "\<exists>(a::'x). a\<sharp>(h,h a)" | 
| 17870 | 2516 | and b: "a\<sharp>h" | 
| 2517 | shows "(fresh_fun h) = (h a)" | |
| 2518 | proof (unfold fresh_fun_def, rule the_equality) | |
| 2519 | show "\<forall>(a'::'x). a'\<sharp>h \<longrightarrow> h a' = h a" | |
| 2520 | proof (intro strip) | |
| 2521 | fix a'::"'x" | |
| 2522 | assume c: "a'\<sharp>h" | |
| 2523 | from pt at f1 a have "\<exists>(fr::'a). \<forall>(a::'x). a\<sharp>h \<longrightarrow> (h a) = fr" by (rule freshness_lemma) | |
| 2524 | with b c show "h a' = h a" by force | |
| 2525 | qed | |
| 2526 | next | |
| 2527 | fix fr::"'a" | |
| 2528 | assume "\<forall>a. a\<sharp>h \<longrightarrow> h a = fr" | |
| 2529 | with b show "fr = h a" by force | |
| 2530 | qed | |
| 2531 | ||
| 22714 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2532 | lemma fresh_fun_app': | 
| 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2533 | fixes h :: "'x\<Rightarrow>'a" | 
| 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2534 | and a :: "'x" | 
| 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2535 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2536 |   and     at: "at TYPE('x)" 
 | 
| 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2537 | and f1: "finite ((supp h)::'x set)" | 
| 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2538 | and a: "a\<sharp>h" "a\<sharp>h a" | 
| 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2539 | shows "(fresh_fun h) = (h a)" | 
| 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2540 | apply(rule fresh_fun_app[OF pt, OF at, OF f1]) | 
| 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2541 | apply(auto simp add: fresh_prod intro: a) | 
| 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2542 | done | 
| 
ca804eb70d39
added a more usuable lemma for dealing with fresh_fun
 urbanc parents: 
22650diff
changeset | 2543 | |
| 19477 | 2544 | lemma fresh_fun_equiv_ineq: | 
| 2545 | fixes h :: "'y\<Rightarrow>'a" | |
| 2546 | and pi:: "'x prm" | |
| 2547 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 2548 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | |
| 2549 |   and     ptb':"pt TYPE('a) TYPE('y)"
 | |
| 2550 |   and     at:  "at TYPE('x)" 
 | |
| 2551 |   and     at': "at TYPE('y)"
 | |
| 2552 |   and     cpa: "cp TYPE('a) TYPE('x) TYPE('y)"
 | |
| 2553 |   and     cpb: "cp TYPE('y) TYPE('x) TYPE('y)"
 | |
| 2554 | and f1: "finite ((supp h)::'y set)" | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2555 | and a1: "\<exists>(a::'y). a\<sharp>(h,h a)" | 
| 19477 | 2556 | shows "pi\<bullet>(fresh_fun h) = fresh_fun(pi\<bullet>h)" (is "?LHS = ?RHS") | 
| 2557 | proof - | |
| 2558 |   have ptd: "pt TYPE('y) TYPE('y)" by (simp add: at_pt_inst[OF at']) 
 | |
| 2559 |   have ptc: "pt TYPE('y\<Rightarrow>'a) TYPE('x)" by (simp add: pt_fun_inst[OF ptb, OF pta, OF at]) 
 | |
| 23393 | 2560 |   have cpc: "cp TYPE('y\<Rightarrow>'a) TYPE ('x) TYPE ('y)" by (rule cp_fun_inst[OF cpb cpa ptb at])
 | 
| 19477 | 2561 | have f2: "finite ((supp (pi\<bullet>h))::'y set)" | 
| 2562 | proof - | |
| 2563 | from f1 have "finite (pi\<bullet>((supp h)::'y set))" | |
| 2564 | by (simp add: pt_set_finite_ineq[OF ptb, OF at]) | |
| 2565 | thus ?thesis | |
| 2566 | by (simp add: pt_perm_supp_ineq[OF ptc, OF ptb, OF at, OF cpc]) | |
| 2567 | qed | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2568 | from a1 obtain a' where c0: "a'\<sharp>(h,h a')" by force | 
| 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2569 | hence c1: "a'\<sharp>h" and c2: "a'\<sharp>(h a')" by (simp_all add: fresh_prod) | 
| 19477 | 2570 | have c3: "(pi\<bullet>a')\<sharp>(pi\<bullet>h)" using c1 | 
| 2571 | by (simp add: pt_fresh_bij_ineq[OF ptc, OF ptb, OF at, OF cpc]) | |
| 2572 | have c4: "(pi\<bullet>a')\<sharp>(pi\<bullet>h) (pi\<bullet>a')" | |
| 2573 | proof - | |
| 2574 | from c2 have "(pi\<bullet>a')\<sharp>(pi\<bullet>(h a'))" | |
| 2575 | by (simp add: pt_fresh_bij_ineq[OF pta, OF ptb, OF at,OF cpa]) | |
| 2576 | thus ?thesis by (simp add: pt_fun_app_eq[OF ptb, OF at]) | |
| 2577 | qed | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2578 | have a2: "\<exists>(a::'y). a\<sharp>(pi\<bullet>h,(pi\<bullet>h) a)" using c3 c4 by (force simp add: fresh_prod) | 
| 19477 | 2579 | have d1: "?LHS = pi\<bullet>(h a')" using c1 a1 by (simp add: fresh_fun_app[OF ptb', OF at', OF f1]) | 
| 2580 | have d2: "?RHS = (pi\<bullet>h) (pi\<bullet>a')" using c3 a2 | |
| 2581 | by (simp add: fresh_fun_app[OF ptb', OF at', OF f2]) | |
| 2582 | show ?thesis using d1 d2 by (simp add: pt_fun_app_eq[OF ptb, OF at]) | |
| 2583 | qed | |
| 2584 | ||
| 17870 | 2585 | lemma fresh_fun_equiv: | 
| 2586 | fixes h :: "'x\<Rightarrow>'a" | |
| 2587 | and pi:: "'x prm" | |
| 2588 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 2589 |   and     at:  "at TYPE('x)" 
 | |
| 2590 | and f1: "finite ((supp h)::'x set)" | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2591 | and a1: "\<exists>(a::'x). a\<sharp>(h,h a)" | 
| 17870 | 2592 | shows "pi\<bullet>(fresh_fun h) = fresh_fun(pi\<bullet>h)" (is "?LHS = ?RHS") | 
| 2593 | proof - | |
| 2594 |   have ptb: "pt TYPE('x) TYPE('x)" by (simp add: at_pt_inst[OF at]) 
 | |
| 2595 |   have ptc: "pt TYPE('x\<Rightarrow>'a) TYPE('x)" by (simp add: pt_fun_inst[OF ptb, OF pta, OF at]) 
 | |
| 2596 | have f2: "finite ((supp (pi\<bullet>h))::'x set)" | |
| 2597 | proof - | |
| 2598 | from f1 have "finite (pi\<bullet>((supp h)::'x set))" by (simp add: pt_set_finite_ineq[OF ptb, OF at]) | |
| 2599 | thus ?thesis by (simp add: pt_perm_supp[OF ptc, OF at]) | |
| 2600 | qed | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2601 | from a1 obtain a' where c0: "a'\<sharp>(h,h a')" by force | 
| 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2602 | hence c1: "a'\<sharp>h" and c2: "a'\<sharp>(h a')" by (simp_all add: fresh_prod) | 
| 17870 | 2603 | have c3: "(pi\<bullet>a')\<sharp>(pi\<bullet>h)" using c1 by (simp add: pt_fresh_bij[OF ptc, OF at]) | 
| 2604 | have c4: "(pi\<bullet>a')\<sharp>(pi\<bullet>h) (pi\<bullet>a')" | |
| 2605 | proof - | |
| 2606 | from c2 have "(pi\<bullet>a')\<sharp>(pi\<bullet>(h a'))" by (simp add: pt_fresh_bij[OF pta, OF at]) | |
| 2607 | thus ?thesis by (simp add: pt_fun_app_eq[OF ptb, OF at]) | |
| 2608 | qed | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2609 | have a2: "\<exists>(a::'x). a\<sharp>(pi\<bullet>h,(pi\<bullet>h) a)" using c3 c4 by (force simp add: fresh_prod) | 
| 17870 | 2610 | have d1: "?LHS = pi\<bullet>(h a')" using c1 a1 by (simp add: fresh_fun_app[OF pta, OF at, OF f1]) | 
| 2611 | have d2: "?RHS = (pi\<bullet>h) (pi\<bullet>a')" using c3 a2 by (simp add: fresh_fun_app[OF pta, OF at, OF f2]) | |
| 2612 | show ?thesis using d1 d2 by (simp add: pt_fun_app_eq[OF ptb, OF at]) | |
| 2613 | qed | |
| 19216 | 2614 | |
| 2615 | lemma fresh_fun_supports: | |
| 2616 | fixes h :: "'x\<Rightarrow>'a" | |
| 2617 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2618 |   and     at: "at TYPE('x)" 
 | |
| 2619 | and f1: "finite ((supp h)::'x set)" | |
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 2620 | and a: "\<exists>(a::'x). a\<sharp>(h,h a)" | 
| 19216 | 2621 | shows "((supp h)::'x set) supports (fresh_fun h)" | 
| 22808 | 2622 | apply(simp add: supports_def fresh_def[symmetric]) | 
| 19216 | 2623 | apply(auto) | 
| 2624 | apply(simp add: fresh_fun_equiv[OF pt, OF at, OF f1, OF a]) | |
| 2625 | apply(simp add: pt_fresh_fresh[OF pt_fun_inst[OF at_pt_inst[OF at], OF pt], OF at, OF at]) | |
| 2626 | done | |
| 17870 | 2627 | |
| 2628 | section {* Abstraction function *}
 | |
| 2629 | (*==============================*) | |
| 2630 | ||
| 2631 | lemma pt_abs_fun_inst: | |
| 2632 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2633 |   and     at: "at TYPE('x)"
 | |
| 18579 
002d371401f5
changed the name of the type "nOption" to "noption".
 urbanc parents: 
18578diff
changeset | 2634 |   shows "pt TYPE('x\<Rightarrow>('a noption)) TYPE('x)"
 | 
| 17870 | 2635 | by (rule pt_fun_inst[OF at_pt_inst[OF at],OF pt_noption_inst[OF pt],OF at]) | 
| 2636 | ||
| 2637 | constdefs | |
| 18579 
002d371401f5
changed the name of the type "nOption" to "noption".
 urbanc parents: 
18578diff
changeset | 2638 |   abs_fun :: "'x\<Rightarrow>'a\<Rightarrow>('x\<Rightarrow>('a noption))" ("[_]._" [100,100] 100)
 | 
| 17870 | 2639 | "[a].x \<equiv> (\<lambda>b. (if b=a then nSome(x) else (if b\<sharp>x then nSome([(a,b)]\<bullet>x) else nNone)))" | 
| 2640 | ||
| 18745 
060400dc077c
a fixme comments about abs_fun_if, which should be called perm_if
 urbanc parents: 
18703diff
changeset | 2641 | (* FIXME: should be called perm_if and placed close to the definition of permutations on bools *) | 
| 17870 | 2642 | lemma abs_fun_if: | 
| 2643 | fixes pi :: "'x prm" | |
| 2644 | and x :: "'a" | |
| 2645 | and y :: "'a" | |
| 2646 | and c :: "bool" | |
| 2647 | shows "pi\<bullet>(if c then x else y) = (if c then (pi\<bullet>x) else (pi\<bullet>y))" | |
| 2648 | by force | |
| 2649 | ||
| 2650 | lemma abs_fun_pi_ineq: | |
| 2651 | fixes a :: "'y" | |
| 2652 | and x :: "'a" | |
| 2653 | and pi :: "'x prm" | |
| 2654 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 2655 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | |
| 2656 |   and     at:  "at TYPE('x)"
 | |
| 2657 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | |
| 2658 | shows "pi\<bullet>([a].x) = [(pi\<bullet>a)].(pi\<bullet>x)" | |
| 2659 | apply(simp add: abs_fun_def perm_fun_def abs_fun_if) | |
| 2660 | apply(simp only: expand_fun_eq) | |
| 2661 | apply(rule allI) | |
| 2662 | apply(subgoal_tac "(((rev pi)\<bullet>(xa::'y)) = (a::'y)) = (xa = pi\<bullet>a)")(*A*) | |
| 2663 | apply(subgoal_tac "(((rev pi)\<bullet>xa)\<sharp>x) = (xa\<sharp>(pi\<bullet>x))")(*B*) | |
| 2664 | apply(subgoal_tac "pi\<bullet>([(a,(rev pi)\<bullet>xa)]\<bullet>x) = [(pi\<bullet>a,xa)]\<bullet>(pi\<bullet>x)")(*C*) | |
| 2665 | apply(simp) | |
| 2666 | (*C*) | |
| 2667 | apply(simp add: cp1[OF cp]) | |
| 2668 | apply(simp add: pt_pi_rev[OF ptb, OF at]) | |
| 2669 | (*B*) | |
| 2670 | apply(simp add: pt_fresh_left_ineq[OF pta, OF ptb, OF at, OF cp]) | |
| 2671 | (*A*) | |
| 2672 | apply(rule iffI) | |
| 2673 | apply(rule pt_bij2[OF ptb, OF at, THEN sym]) | |
| 2674 | apply(simp) | |
| 2675 | apply(rule pt_bij2[OF ptb, OF at]) | |
| 2676 | apply(simp) | |
| 2677 | done | |
| 2678 | ||
| 2679 | lemma abs_fun_pi: | |
| 2680 | fixes a :: "'x" | |
| 2681 | and x :: "'a" | |
| 2682 | and pi :: "'x prm" | |
| 2683 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2684 |   and     at: "at TYPE('x)"
 | |
| 2685 | shows "pi\<bullet>([a].x) = [(pi\<bullet>a)].(pi\<bullet>x)" | |
| 2686 | apply(rule abs_fun_pi_ineq) | |
| 2687 | apply(rule pt) | |
| 2688 | apply(rule at_pt_inst) | |
| 2689 | apply(rule at)+ | |
| 2690 | apply(rule cp_pt_inst) | |
| 2691 | apply(rule pt) | |
| 2692 | apply(rule at) | |
| 2693 | done | |
| 2694 | ||
| 2695 | lemma abs_fun_eq1: | |
| 2696 | fixes x :: "'a" | |
| 2697 | and y :: "'a" | |
| 2698 | and a :: "'x" | |
| 2699 | shows "([a].x = [a].y) = (x = y)" | |
| 2700 | apply(auto simp add: abs_fun_def) | |
| 2701 | apply(auto simp add: expand_fun_eq) | |
| 2702 | apply(drule_tac x="a" in spec) | |
| 2703 | apply(simp) | |
| 2704 | done | |
| 2705 | ||
| 2706 | lemma abs_fun_eq2: | |
| 2707 | fixes x :: "'a" | |
| 2708 | and y :: "'a" | |
| 2709 | and a :: "'x" | |
| 2710 | and b :: "'x" | |
| 2711 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2712 |       and at: "at TYPE('x)"
 | |
| 2713 | and a1: "a\<noteq>b" | |
| 2714 | and a2: "[a].x = [b].y" | |
| 18268 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2715 | shows "x=[(a,b)]\<bullet>y \<and> a\<sharp>y" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2716 | proof - | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2717 | from a2 have "\<forall>c::'x. ([a].x) c = ([b].y) c" by (force simp add: expand_fun_eq) | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2718 | hence "([a].x) a = ([b].y) a" by simp | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2719 | hence a3: "nSome(x) = ([b].y) a" by (simp add: abs_fun_def) | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2720 | show "x=[(a,b)]\<bullet>y \<and> a\<sharp>y" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2721 | proof (cases "a\<sharp>y") | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2722 | assume a4: "a\<sharp>y" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2723 | hence "x=[(b,a)]\<bullet>y" using a3 a1 by (simp add: abs_fun_def) | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2724 | moreover | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2725 | have "[(a,b)]\<bullet>y = [(b,a)]\<bullet>y" by (rule pt3[OF pt], rule at_ds5[OF at]) | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2726 | ultimately show ?thesis using a4 by simp | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2727 | next | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2728 | assume "\<not>a\<sharp>y" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2729 | hence "nSome(x) = nNone" using a1 a3 by (simp add: abs_fun_def) | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2730 | hence False by simp | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2731 | thus ?thesis by simp | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2732 | qed | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2733 | qed | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2734 | |
| 17870 | 2735 | lemma abs_fun_eq3: | 
| 2736 | fixes x :: "'a" | |
| 2737 | and y :: "'a" | |
| 2738 | and a :: "'x" | |
| 2739 | and b :: "'x" | |
| 2740 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2741 |       and at: "at TYPE('x)"
 | |
| 2742 | and a1: "a\<noteq>b" | |
| 2743 | and a2: "x=[(a,b)]\<bullet>y" | |
| 2744 | and a3: "a\<sharp>y" | |
| 2745 | shows "[a].x =[b].y" | |
| 2746 | proof - | |
| 18268 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2747 | show ?thesis | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2748 | proof (simp only: abs_fun_def expand_fun_eq, intro strip) | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2749 | fix c::"'x" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2750 | let ?LHS = "if c=a then nSome(x) else if c\<sharp>x then nSome([(a,c)]\<bullet>x) else nNone" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2751 | and ?RHS = "if c=b then nSome(y) else if c\<sharp>y then nSome([(b,c)]\<bullet>y) else nNone" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2752 | show "?LHS=?RHS" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2753 | proof - | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2754 | have "(c=a) \<or> (c=b) \<or> (c\<noteq>a \<and> c\<noteq>b)" by blast | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2755 | moreover --"case c=a" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2756 |       { have "nSome(x) = nSome([(a,b)]\<bullet>y)" using a2 by simp
 | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2757 | also have "\<dots> = nSome([(b,a)]\<bullet>y)" by (simp, rule pt3[OF pt], rule at_ds5[OF at]) | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2758 | finally have "nSome(x) = nSome([(b,a)]\<bullet>y)" by simp | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2759 | moreover | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2760 | assume "c=a" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2761 | ultimately have "?LHS=?RHS" using a1 a3 by simp | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2762 | } | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2763 | moreover -- "case c=b" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2764 |       { have a4: "y=[(a,b)]\<bullet>x" using a2 by (simp only: pt_swap_bij[OF pt, OF at])
 | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2765 | hence "a\<sharp>([(a,b)]\<bullet>x)" using a3 by simp | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2766 | hence "b\<sharp>x" by (simp add: at_calc[OF at] pt_fresh_left[OF pt, OF at]) | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2767 | moreover | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2768 | assume "c=b" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2769 | ultimately have "?LHS=?RHS" using a1 a4 by simp | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2770 | } | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2771 | moreover -- "case c\<noteq>a \<and> c\<noteq>b" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2772 |       { assume a5: "c\<noteq>a \<and> c\<noteq>b"
 | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2773 | moreover | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2774 | have "c\<sharp>x = c\<sharp>y" using a2 a5 by (force simp add: at_calc[OF at] pt_fresh_left[OF pt, OF at]) | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2775 | moreover | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2776 | have "c\<sharp>y \<longrightarrow> [(a,c)]\<bullet>x = [(b,c)]\<bullet>y" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2777 | proof (intro strip) | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2778 | assume a6: "c\<sharp>y" | 
| 18295 
dd50de393330
changed \<sim> of permutation equality to \<triangleq>
 urbanc parents: 
18294diff
changeset | 2779 | have "[(a,c),(b,c),(a,c)] \<triangleq> [(a,b)]" using a1 a5 by (force intro: at_ds3[OF at]) | 
| 18268 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2780 | hence "[(a,c)]\<bullet>([(b,c)]\<bullet>([(a,c)]\<bullet>y)) = [(a,b)]\<bullet>y" | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2781 | by (simp add: pt2[OF pt, symmetric] pt3[OF pt]) | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2782 | hence "[(a,c)]\<bullet>([(b,c)]\<bullet>y) = [(a,b)]\<bullet>y" using a3 a6 | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2783 | by (simp add: pt_fresh_fresh[OF pt, OF at]) | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2784 | hence "[(a,c)]\<bullet>([(b,c)]\<bullet>y) = x" using a2 by simp | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2785 | hence "[(b,c)]\<bullet>y = [(a,c)]\<bullet>x" by (drule_tac pt_bij1[OF pt, OF at], simp) | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2786 | thus "[(a,c)]\<bullet>x = [(b,c)]\<bullet>y" by simp | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2787 | qed | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2788 | ultimately have "?LHS=?RHS" by simp | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2789 | } | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2790 | ultimately show "?LHS = ?RHS" by blast | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2791 | qed | 
| 17870 | 2792 | qed | 
| 18268 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2793 | qed | 
| 
734f23ad5d8f
ISAR-fied two proofs about equality for abstraction functions.
 urbanc parents: 
18264diff
changeset | 2794 | |
| 23158 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2795 | (* alpha equivalence *) | 
| 17870 | 2796 | lemma abs_fun_eq: | 
| 2797 | fixes x :: "'a" | |
| 2798 | and y :: "'a" | |
| 2799 | and a :: "'x" | |
| 2800 | and b :: "'x" | |
| 2801 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2802 |       and at: "at TYPE('x)"
 | |
| 2803 | shows "([a].x = [b].y) = ((a=b \<and> x=y)\<or>(a\<noteq>b \<and> x=[(a,b)]\<bullet>y \<and> a\<sharp>y))" | |
| 2804 | proof (rule iffI) | |
| 2805 | assume b: "[a].x = [b].y" | |
| 2806 | show "(a=b \<and> x=y)\<or>(a\<noteq>b \<and> x=[(a,b)]\<bullet>y \<and> a\<sharp>y)" | |
| 2807 | proof (cases "a=b") | |
| 2808 | case True with b show ?thesis by (simp add: abs_fun_eq1) | |
| 2809 | next | |
| 2810 | case False with b show ?thesis by (simp add: abs_fun_eq2[OF pt, OF at]) | |
| 2811 | qed | |
| 2812 | next | |
| 2813 | assume "(a=b \<and> x=y)\<or>(a\<noteq>b \<and> x=[(a,b)]\<bullet>y \<and> a\<sharp>y)" | |
| 2814 | thus "[a].x = [b].y" | |
| 2815 | proof | |
| 2816 | assume "a=b \<and> x=y" thus ?thesis by simp | |
| 2817 | next | |
| 2818 | assume "a\<noteq>b \<and> x=[(a,b)]\<bullet>y \<and> a\<sharp>y" | |
| 2819 | thus ?thesis by (simp add: abs_fun_eq3[OF pt, OF at]) | |
| 2820 | qed | |
| 2821 | qed | |
| 2822 | ||
| 23158 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2823 | (* symmetric version of alpha-equivalence *) | 
| 19562 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2824 | lemma abs_fun_eq': | 
| 23158 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2825 | fixes x :: "'a" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2826 | and y :: "'a" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2827 | and a :: "'x" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2828 | and b :: "'x" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2829 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2830 |       and at: "at TYPE('x)"
 | 
| 23159 | 2831 | shows "([a].x = [b].y) = ((a=b \<and> x=y)\<or>(a\<noteq>b \<and> [(b,a)]\<bullet>x=y \<and> b\<sharp>x))" | 
| 2832 | by (auto simp add: abs_fun_eq[OF pt, OF at] pt_swap_bij'[OF pt, OF at] | |
| 23158 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2833 | pt_fresh_left[OF pt, OF at] | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2834 | at_calc[OF at]) | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2835 | |
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2836 | (* alpha_equivalence with a fresh name *) | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2837 | lemma abs_fun_fresh: | 
| 19562 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2838 | fixes x :: "'a" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2839 | and y :: "'a" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2840 | and c :: "'x" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2841 | and a :: "'x" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2842 | and b :: "'x" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2843 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2844 |       and at: "at TYPE('x)"
 | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2845 | and fr: "c\<noteq>a" "c\<noteq>b" "c\<sharp>x" "c\<sharp>y" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2846 | shows "([a].x = [b].y) = ([(a,c)]\<bullet>x = [(b,c)]\<bullet>y)" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2847 | proof (rule iffI) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2848 | assume eq0: "[a].x = [b].y" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2849 | show "[(a,c)]\<bullet>x = [(b,c)]\<bullet>y" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2850 | proof (cases "a=b") | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2851 | case True then show ?thesis using eq0 by (simp add: pt_bij[OF pt, OF at] abs_fun_eq[OF pt, OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2852 | next | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2853 | case False | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2854 | have ineq: "a\<noteq>b" by fact | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2855 | with eq0 have eq: "x=[(a,b)]\<bullet>y" and fr': "a\<sharp>y" by (simp_all add: abs_fun_eq[OF pt, OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2856 | from eq have "[(a,c)]\<bullet>x = [(a,c)]\<bullet>[(a,b)]\<bullet>y" by (simp add: pt_bij[OF pt, OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2857 | also have "\<dots> = ([(a,c)]\<bullet>[(a,b)])\<bullet>([(a,c)]\<bullet>y)" by (rule pt_perm_compose[OF pt, OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2858 | also have "\<dots> = [(c,b)]\<bullet>y" using ineq fr fr' | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2859 | by (simp add: pt_fresh_fresh[OF pt, OF at] at_calc[OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2860 | also have "\<dots> = [(b,c)]\<bullet>y" by (rule pt3[OF pt], rule at_ds5[OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2861 | finally show ?thesis by simp | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2862 | qed | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2863 | next | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2864 | assume eq: "[(a,c)]\<bullet>x = [(b,c)]\<bullet>y" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2865 | thus "[a].x = [b].y" | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2866 | proof (cases "a=b") | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2867 | case True then show ?thesis using eq by (simp add: pt_bij[OF pt, OF at] abs_fun_eq[OF pt, OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2868 | next | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2869 | case False | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2870 | have ineq: "a\<noteq>b" by fact | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2871 | from fr have "([(a,c)]\<bullet>c)\<sharp>([(a,c)]\<bullet>x)" by (simp add: pt_fresh_bij[OF pt, OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2872 | hence "a\<sharp>([(b,c)]\<bullet>y)" using eq fr by (simp add: at_calc[OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2873 | hence fr0: "a\<sharp>y" using ineq fr by (simp add: pt_fresh_left[OF pt, OF at] at_calc[OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2874 | from eq have "x = (rev [(a,c)])\<bullet>([(b,c)]\<bullet>y)" by (rule pt_bij1[OF pt, OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2875 | also have "\<dots> = [(a,c)]\<bullet>([(b,c)]\<bullet>y)" by simp | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2876 | also have "\<dots> = ([(a,c)]\<bullet>[(b,c)])\<bullet>([(a,c)]\<bullet>y)" by (rule pt_perm_compose[OF pt, OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2877 | also have "\<dots> = [(b,a)]\<bullet>y" using ineq fr fr0 | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2878 | by (simp add: pt_fresh_fresh[OF pt, OF at] at_calc[OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2879 | also have "\<dots> = [(a,b)]\<bullet>y" by (rule pt3[OF pt], rule at_ds5[OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2880 | finally show ?thesis using ineq fr0 by (simp add: abs_fun_eq[OF pt, OF at]) | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2881 | qed | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2882 | qed | 
| 
e56b3c967ae8
added the lemma abs_fun_eq' to the nominal theory,
 urbanc parents: 
19494diff
changeset | 2883 | |
| 23158 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2884 | lemma abs_fun_fresh': | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2885 | fixes x :: "'a" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2886 | and y :: "'a" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2887 | and c :: "'x" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2888 | and a :: "'x" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2889 | and b :: "'x" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2890 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2891 |       and at: "at TYPE('x)"
 | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2892 | and as: "[a].x = [b].y" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2893 | and fr: "c\<noteq>a" "c\<noteq>b" "c\<sharp>x" "c\<sharp>y" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2894 | shows "x = [(a,c)]\<bullet>[(b,c)]\<bullet>y" | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2895 | using as fr | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2896 | apply(drule_tac sym) | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2897 | apply(simp add: abs_fun_fresh[OF pt, OF at] pt_swap_bij[OF pt, OF at]) | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2898 | done | 
| 
749b6870b1a1
introduced symmetric variants of the lemmas for alpha-equivalence
 urbanc parents: 
23050diff
changeset | 2899 | |
| 17870 | 2900 | lemma abs_fun_supp_approx: | 
| 2901 | fixes x :: "'a" | |
| 2902 | and a :: "'x" | |
| 2903 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2904 |   and     at: "at TYPE('x)"
 | |
| 18048 | 2905 | shows "((supp ([a].x))::'x set) \<subseteq> (supp (x,a))" | 
| 2906 | proof | |
| 2907 | fix c | |
| 2908 | assume "c\<in>((supp ([a].x))::'x set)" | |
| 2909 |   hence "infinite {b. [(c,b)]\<bullet>([a].x) \<noteq> [a].x}" by (simp add: supp_def)
 | |
| 2910 |   hence "infinite {b. [([(c,b)]\<bullet>a)].([(c,b)]\<bullet>x) \<noteq> [a].x}" by (simp add: abs_fun_pi[OF pt, OF at])
 | |
| 2911 | moreover | |
| 2912 |   have "{b. [([(c,b)]\<bullet>a)].([(c,b)]\<bullet>x) \<noteq> [a].x} \<subseteq> {b. ([(c,b)]\<bullet>x,[(c,b)]\<bullet>a) \<noteq> (x, a)}" by force
 | |
| 2913 |   ultimately have "infinite {b. ([(c,b)]\<bullet>x,[(c,b)]\<bullet>a) \<noteq> (x, a)}" by (simp add: infinite_super)
 | |
| 2914 | thus "c\<in>(supp (x,a))" by (simp add: supp_def) | |
| 17870 | 2915 | qed | 
| 2916 | ||
| 2917 | lemma abs_fun_finite_supp: | |
| 2918 | fixes x :: "'a" | |
| 2919 | and a :: "'x" | |
| 2920 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2921 |   and     at: "at TYPE('x)"
 | |
| 2922 | and f: "finite ((supp x)::'x set)" | |
| 2923 | shows "finite ((supp ([a].x))::'x set)" | |
| 2924 | proof - | |
| 18048 | 2925 | from f have "finite ((supp (x,a))::'x set)" by (simp add: supp_prod at_supp[OF at]) | 
| 2926 | moreover | |
| 2927 | have "((supp ([a].x))::'x set) \<subseteq> (supp (x,a))" by (rule abs_fun_supp_approx[OF pt, OF at]) | |
| 2928 | ultimately show ?thesis by (simp add: finite_subset) | |
| 17870 | 2929 | qed | 
| 2930 | ||
| 2931 | lemma fresh_abs_funI1: | |
| 2932 | fixes x :: "'a" | |
| 2933 | and a :: "'x" | |
| 2934 | and b :: "'x" | |
| 2935 |   assumes pt:  "pt TYPE('a) TYPE('x)"
 | |
| 2936 |   and     at:   "at TYPE('x)"
 | |
| 2937 | and f: "finite ((supp x)::'x set)" | |
| 2938 | and a1: "b\<sharp>x" | |
| 2939 | and a2: "a\<noteq>b" | |
| 2940 | shows "b\<sharp>([a].x)" | |
| 2941 | proof - | |
| 2942 | have "\<exists>c::'x. c\<sharp>(b,a,x,[a].x)" | |
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 2943 | proof (rule at_exists_fresh'[OF at], auto simp add: supp_prod at_supp[OF at] f) | 
| 17870 | 2944 | show "finite ((supp ([a].x))::'x set)" using f | 
| 2945 | by (simp add: abs_fun_finite_supp[OF pt, OF at]) | |
| 2946 | qed | |
| 2947 | then obtain c where fr1: "c\<noteq>b" | |
| 2948 | and fr2: "c\<noteq>a" | |
| 2949 | and fr3: "c\<sharp>x" | |
| 2950 | and fr4: "c\<sharp>([a].x)" | |
| 2951 | by (force simp add: fresh_prod at_fresh[OF at]) | |
| 2952 | have e: "[(c,b)]\<bullet>([a].x) = [a].([(c,b)]\<bullet>x)" using a2 fr1 fr2 | |
| 2953 | by (force simp add: abs_fun_pi[OF pt, OF at] at_calc[OF at]) | |
| 2954 | from fr4 have "([(c,b)]\<bullet>c)\<sharp> ([(c,b)]\<bullet>([a].x))" | |
| 2955 | by (simp add: pt_fresh_bij[OF pt_abs_fun_inst[OF pt, OF at], OF at]) | |
| 2956 | hence "b\<sharp>([a].([(c,b)]\<bullet>x))" using fr1 fr2 e | |
| 2957 | by (simp add: at_calc[OF at]) | |
| 2958 | thus ?thesis using a1 fr3 | |
| 2959 | by (simp add: pt_fresh_fresh[OF pt, OF at]) | |
| 2960 | qed | |
| 2961 | ||
| 2962 | lemma fresh_abs_funE: | |
| 2963 | fixes a :: "'x" | |
| 2964 | and b :: "'x" | |
| 2965 | and x :: "'a" | |
| 2966 |   assumes pt:  "pt TYPE('a) TYPE('x)"
 | |
| 2967 |   and     at:  "at TYPE('x)"
 | |
| 2968 | and f: "finite ((supp x)::'x set)" | |
| 2969 | and a1: "b\<sharp>([a].x)" | |
| 2970 | and a2: "b\<noteq>a" | |
| 2971 | shows "b\<sharp>x" | |
| 2972 | proof - | |
| 2973 | have "\<exists>c::'x. c\<sharp>(b,a,x,[a].x)" | |
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 2974 | proof (rule at_exists_fresh'[OF at], auto simp add: supp_prod at_supp[OF at] f) | 
| 17870 | 2975 | show "finite ((supp ([a].x))::'x set)" using f | 
| 2976 | by (simp add: abs_fun_finite_supp[OF pt, OF at]) | |
| 2977 | qed | |
| 2978 | then obtain c where fr1: "b\<noteq>c" | |
| 2979 | and fr2: "c\<noteq>a" | |
| 2980 | and fr3: "c\<sharp>x" | |
| 2981 | and fr4: "c\<sharp>([a].x)" by (force simp add: fresh_prod at_fresh[OF at]) | |
| 2982 | have "[a].x = [(b,c)]\<bullet>([a].x)" using a1 fr4 | |
| 2983 | by (simp add: pt_fresh_fresh[OF pt_abs_fun_inst[OF pt, OF at], OF at]) | |
| 2984 | hence "[a].x = [a].([(b,c)]\<bullet>x)" using fr2 a2 | |
| 2985 | by (force simp add: abs_fun_pi[OF pt, OF at] at_calc[OF at]) | |
| 2986 | hence b: "([(b,c)]\<bullet>x) = x" by (simp add: abs_fun_eq1) | |
| 2987 | from fr3 have "([(b,c)]\<bullet>c)\<sharp>([(b,c)]\<bullet>x)" | |
| 2988 | by (simp add: pt_fresh_bij[OF pt, OF at]) | |
| 2989 | thus ?thesis using b fr1 by (simp add: at_calc[OF at]) | |
| 2990 | qed | |
| 2991 | ||
| 2992 | lemma fresh_abs_funI2: | |
| 2993 | fixes a :: "'x" | |
| 2994 | and x :: "'a" | |
| 2995 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 2996 |   and     at: "at TYPE('x)"
 | |
| 2997 | and f: "finite ((supp x)::'x set)" | |
| 2998 | shows "a\<sharp>([a].x)" | |
| 2999 | proof - | |
| 3000 | have "\<exists>c::'x. c\<sharp>(a,x)" | |
| 21377 
c29146dc14f1
replaced exists_fresh lemma with a version formulated with obtains;
 urbanc parents: 
21318diff
changeset | 3001 | by (rule at_exists_fresh'[OF at], auto simp add: supp_prod at_supp[OF at] f) | 
| 17870 | 3002 | then obtain c where fr1: "a\<noteq>c" and fr1_sym: "c\<noteq>a" | 
| 3003 | and fr2: "c\<sharp>x" by (force simp add: fresh_prod at_fresh[OF at]) | |
| 3004 | have "c\<sharp>([a].x)" using f fr1 fr2 by (simp add: fresh_abs_funI1[OF pt, OF at]) | |
| 3005 | hence "([(c,a)]\<bullet>c)\<sharp>([(c,a)]\<bullet>([a].x))" using fr1 | |
| 3006 | by (simp only: pt_fresh_bij[OF pt_abs_fun_inst[OF pt, OF at], OF at]) | |
| 3007 | hence a: "a\<sharp>([c].([(c,a)]\<bullet>x))" using fr1_sym | |
| 3008 | by (simp add: abs_fun_pi[OF pt, OF at] at_calc[OF at]) | |
| 3009 | have "[c].([(c,a)]\<bullet>x) = ([a].x)" using fr1_sym fr2 | |
| 3010 | by (simp add: abs_fun_eq[OF pt, OF at]) | |
| 3011 | thus ?thesis using a by simp | |
| 3012 | qed | |
| 3013 | ||
| 3014 | lemma fresh_abs_fun_iff: | |
| 3015 | fixes a :: "'x" | |
| 3016 | and b :: "'x" | |
| 3017 | and x :: "'a" | |
| 3018 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 3019 |   and     at: "at TYPE('x)"
 | |
| 3020 | and f: "finite ((supp x)::'x set)" | |
| 3021 | shows "(b\<sharp>([a].x)) = (b=a \<or> b\<sharp>x)" | |
| 3022 | by (auto dest: fresh_abs_funE[OF pt, OF at,OF f] | |
| 3023 | intro: fresh_abs_funI1[OF pt, OF at,OF f] | |
| 3024 | fresh_abs_funI2[OF pt, OF at,OF f]) | |
| 3025 | ||
| 3026 | lemma abs_fun_supp: | |
| 3027 | fixes a :: "'x" | |
| 3028 | and x :: "'a" | |
| 3029 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 3030 |   and     at: "at TYPE('x)"
 | |
| 3031 | and f: "finite ((supp x)::'x set)" | |
| 3032 |   shows "supp ([a].x) = (supp x)-{a}"
 | |
| 3033 | by (force simp add: supp_fresh_iff fresh_abs_fun_iff[OF pt, OF at, OF f]) | |
| 3034 | ||
| 18048 | 3035 | (* maybe needs to be better stated as supp intersection supp *) | 
| 17870 | 3036 | lemma abs_fun_supp_ineq: | 
| 3037 | fixes a :: "'y" | |
| 3038 | and x :: "'a" | |
| 3039 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 3040 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | |
| 3041 |   and     at:  "at TYPE('x)"
 | |
| 3042 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | |
| 3043 |   and     dj:  "disjoint TYPE('y) TYPE('x)"
 | |
| 3044 | shows "((supp ([a].x))::'x set) = (supp x)" | |
| 3045 | apply(auto simp add: supp_def) | |
| 3046 | apply(auto simp add: abs_fun_pi_ineq[OF pta, OF ptb, OF at, OF cp]) | |
| 3047 | apply(auto simp add: dj_perm_forget[OF dj]) | |
| 3048 | apply(auto simp add: abs_fun_eq1) | |
| 3049 | done | |
| 3050 | ||
| 3051 | lemma fresh_abs_fun_iff_ineq: | |
| 3052 | fixes a :: "'y" | |
| 3053 | and b :: "'x" | |
| 3054 | and x :: "'a" | |
| 3055 |   assumes pta: "pt TYPE('a) TYPE('x)"
 | |
| 3056 |   and     ptb: "pt TYPE('y) TYPE('x)"
 | |
| 3057 |   and     at:  "at TYPE('x)"
 | |
| 3058 |   and     cp:  "cp TYPE('a) TYPE('x) TYPE('y)"
 | |
| 3059 |   and     dj:  "disjoint TYPE('y) TYPE('x)"
 | |
| 3060 | shows "b\<sharp>([a].x) = b\<sharp>x" | |
| 3061 | by (simp add: fresh_def abs_fun_supp_ineq[OF pta, OF ptb, OF at, OF cp, OF dj]) | |
| 3062 | ||
| 18048 | 3063 | section {* abstraction type for the parsing in nominal datatype *}
 | 
| 3064 | (*==============================================================*) | |
| 23755 | 3065 | |
| 3066 | inductive_set ABS_set :: "('x\<Rightarrow>('a noption)) set"
 | |
| 3067 | where | |
| 17870 | 3068 | ABS_in: "(abs_fun a x)\<in>ABS_set" | 
| 3069 | ||
| 18579 
002d371401f5
changed the name of the type "nOption" to "noption".
 urbanc parents: 
18578diff
changeset | 3070 | typedef (ABS) ('x,'a) ABS = "ABS_set::('x\<Rightarrow>('a noption)) set"
 | 
| 17870 | 3071 | proof | 
| 3072 | fix x::"'a" and a::"'x" | |
| 3073 | show "(abs_fun a x)\<in> ABS_set" by (rule ABS_in) | |
| 3074 | qed | |
| 3075 | ||
| 3076 | syntax ABS :: "type \<Rightarrow> type \<Rightarrow> type" ("\<guillemotleft>_\<guillemotright>_" [1000,1000] 1000)
 | |
| 3077 | ||
| 3078 | ||
| 18048 | 3079 | section {* lemmas for deciding permutation equations *}
 | 
| 17870 | 3080 | (*===================================================*) | 
| 3081 | ||
| 19477 | 3082 | lemma perm_aux_fold: | 
| 3083 | shows "perm_aux pi x = pi\<bullet>x" by (simp only: perm_aux_def) | |
| 3084 | ||
| 3085 | lemma pt_perm_compose_aux: | |
| 3086 | fixes pi1 :: "'x prm" | |
| 3087 | and pi2 :: "'x prm" | |
| 3088 | and x :: "'a" | |
| 3089 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 3090 |   and     at: "at TYPE('x)"
 | |
| 3091 | shows "pi2\<bullet>(pi1\<bullet>x) = perm_aux (pi2\<bullet>pi1) (pi2\<bullet>x)" | |
| 3092 | proof - | |
| 23393 | 3093 | have "(pi2@pi1) \<triangleq> ((pi2\<bullet>pi1)@pi2)" by (rule at_ds8[OF at]) | 
| 19477 | 3094 | hence "(pi2@pi1)\<bullet>x = ((pi2\<bullet>pi1)@pi2)\<bullet>x" by (rule pt3[OF pt]) | 
| 3095 | thus ?thesis by (simp add: pt2[OF pt] perm_aux_def) | |
| 3096 | qed | |
| 3097 | ||
| 3098 | lemma cp1_aux: | |
| 3099 | fixes pi1::"'x prm" | |
| 3100 | and pi2::"'y prm" | |
| 3101 | and x ::"'a" | |
| 3102 |   assumes cp: "cp TYPE ('a) TYPE('x) TYPE('y)"
 | |
| 3103 | shows "pi1\<bullet>(pi2\<bullet>x) = perm_aux (pi1\<bullet>pi2) (pi1\<bullet>x)" | |
| 3104 | using cp by (simp add: cp_def perm_aux_def) | |
| 3105 | ||
| 17870 | 3106 | lemma perm_eq_app: | 
| 3107 | fixes f :: "'a\<Rightarrow>'b" | |
| 3108 | and x :: "'a" | |
| 3109 | and pi :: "'x prm" | |
| 3110 |   assumes pt: "pt TYPE('a) TYPE('x)"
 | |
| 3111 |   and     at: "at TYPE('x)"
 | |
| 3112 | shows "(pi\<bullet>(f x)=y) = ((pi\<bullet>f)(pi\<bullet>x)=y)" | |
| 3113 | by (simp add: pt_fun_app_eq[OF pt, OF at]) | |
| 3114 | ||
| 3115 | lemma perm_eq_lam: | |
| 3116 | fixes f :: "'a\<Rightarrow>'b" | |
| 3117 | and x :: "'a" | |
| 3118 | and pi :: "'x prm" | |
| 3119 | shows "((pi\<bullet>(\<lambda>x. f x))=y) = ((\<lambda>x. (pi\<bullet>(f ((rev pi)\<bullet>x))))=y)" | |
| 3120 | by (simp add: perm_fun_def) | |
| 3121 | ||
| 19132 | 3122 | section {* test *}
 | 
| 3123 | lemma at_prm_eq_compose: | |
| 3124 | fixes pi1 :: "'x prm" | |
| 3125 | and pi2 :: "'x prm" | |
| 3126 | and pi3 :: "'x prm" | |
| 3127 |   assumes at: "at TYPE('x)"
 | |
| 3128 | and a: "pi1 \<triangleq> pi2" | |
| 3129 | shows "(pi3\<bullet>pi1) \<triangleq> (pi3\<bullet>pi2)" | |
| 3130 | proof - | |
| 3131 |   have pt: "pt TYPE('x) TYPE('x)" by (rule at_pt_inst[OF at])
 | |
| 3132 |   have pt_prm: "pt TYPE('x prm) TYPE('x)" 
 | |
| 3133 | by (rule pt_list_inst[OF pt_prod_inst[OF pt, OF pt]]) | |
| 3134 | from a show ?thesis | |
| 3135 | apply - | |
| 3136 | apply(auto simp add: prm_eq_def) | |
| 3137 | apply(rule_tac pi="rev pi3" in pt_bij4[OF pt, OF at]) | |
| 3138 | apply(rule trans) | |
| 3139 | apply(rule pt_perm_compose[OF pt, OF at]) | |
| 3140 | apply(simp add: pt_rev_pi[OF pt_prm, OF at]) | |
| 3141 | apply(rule sym) | |
| 3142 | apply(rule trans) | |
| 3143 | apply(rule pt_perm_compose[OF pt, OF at]) | |
| 3144 | apply(simp add: pt_rev_pi[OF pt_prm, OF at]) | |
| 3145 | done | |
| 3146 | qed | |
| 3147 | ||
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3148 | (************************) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3149 | (* Various eqvt-lemmas *) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3150 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3151 | lemma Zero_nat_eqvt: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3152 | shows "pi\<bullet>(0::nat) = 0" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3153 | by (auto simp add: perm_nat_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3154 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3155 | lemma One_nat_eqvt: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3156 | shows "pi\<bullet>(1::nat) = 1" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3157 | by (simp add: perm_nat_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3158 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3159 | lemma Suc_eqvt: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3160 | shows "pi\<bullet>(Suc x) = Suc (pi\<bullet>x)" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3161 | by (auto simp add: perm_nat_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3162 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3163 | lemma numeral_nat_eqvt: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3164 | shows "pi\<bullet>((number_of n)::nat) = number_of n" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3165 | by (simp add: perm_nat_def perm_int_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3166 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3167 | lemma max_nat_eqvt: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3168 | fixes x::"nat" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3169 | shows "pi\<bullet>(max x y) = max (pi\<bullet>x) (pi\<bullet>y)" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3170 | by (simp add:perm_nat_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3171 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3172 | lemma min_nat_eqvt: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3173 | fixes x::"nat" | 
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 3174 | shows "pi\<bullet>(min x y) = min (pi\<bullet>x) (pi\<bullet>y)" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3175 | by (simp add:perm_nat_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3176 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3177 | lemma plus_nat_eqvt: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3178 | fixes x::"nat" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3179 | shows "pi\<bullet>(x + y) = (pi\<bullet>x) + (pi\<bullet>y)" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3180 | by (simp add:perm_nat_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3181 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3182 | lemma minus_nat_eqvt: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3183 | fixes x::"nat" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3184 | shows "pi\<bullet>(x - y) = (pi\<bullet>x) - (pi\<bullet>y)" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3185 | by (simp add:perm_nat_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3186 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3187 | lemma mult_nat_eqvt: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3188 | fixes x::"nat" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3189 | shows "pi\<bullet>(x * y) = (pi\<bullet>x) * (pi\<bullet>y)" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3190 | by (simp add:perm_nat_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3191 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3192 | lemma div_nat_eqvt: | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3193 | fixes x::"nat" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3194 | shows "pi\<bullet>(x div y) = (pi\<bullet>x) div (pi\<bullet>y)" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3195 | by (simp add:perm_nat_def) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3196 | |
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3197 | lemma Zero_int_eqvt: | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3198 | shows "pi\<bullet>(0::int) = 0" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3199 | by (auto simp add: perm_int_def) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3200 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3201 | lemma One_int_eqvt: | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3202 | shows "pi\<bullet>(1::int) = 1" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3203 | by (simp add: perm_int_def) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3204 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3205 | lemma numeral_int_eqvt: | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3206 | shows "pi\<bullet>((number_of n)::int) = number_of n" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3207 | by (simp add: perm_int_def perm_int_def) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3208 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3209 | lemma max_int_eqvt: | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3210 | fixes x::"int" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3211 | shows "pi\<bullet>(max (x::int) y) = max (pi\<bullet>x) (pi\<bullet>y)" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3212 | by (simp add:perm_int_def) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3213 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3214 | lemma min_int_eqvt: | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3215 | fixes x::"int" | 
| 22500 
8436bfd21bf3
corrected the lemmas min_nat_eqvt and min_int_eqvt
 urbanc parents: 
22446diff
changeset | 3216 | shows "pi\<bullet>(min x y) = min (pi\<bullet>x) (pi\<bullet>y)" | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3217 | by (simp add:perm_int_def) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3218 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3219 | lemma plus_int_eqvt: | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3220 | fixes x::"int" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3221 | shows "pi\<bullet>(x + y) = (pi\<bullet>x) + (pi\<bullet>y)" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3222 | by (simp add:perm_int_def) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3223 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3224 | lemma minus_int_eqvt: | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3225 | fixes x::"int" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3226 | shows "pi\<bullet>(x - y) = (pi\<bullet>x) - (pi\<bullet>y)" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3227 | by (simp add:perm_int_def) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3228 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3229 | lemma mult_int_eqvt: | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3230 | fixes x::"int" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3231 | shows "pi\<bullet>(x * y) = (pi\<bullet>x) * (pi\<bullet>y)" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3232 | by (simp add:perm_int_def) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3233 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3234 | lemma div_int_eqvt: | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3235 | fixes x::"int" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3236 | shows "pi\<bullet>(x div y) = (pi\<bullet>x) div (pi\<bullet>y)" | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3237 | by (simp add:perm_int_def) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3238 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3239 | (*******************************************************************) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3240 | (* Setup of the theorem attributes eqvt, eqvt_force, fresh and bij *) | 
| 22245 
1b8f4ef50c48
moved the infrastructure from the nominal_tags file to nominal_thmdecls
 urbanc parents: 
22231diff
changeset | 3241 | use "nominal_thmdecls.ML" | 
| 
1b8f4ef50c48
moved the infrastructure from the nominal_tags file to nominal_thmdecls
 urbanc parents: 
22231diff
changeset | 3242 | setup "NominalThmDecls.setup" | 
| 19132 | 3243 | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3244 | lemmas [eqvt] = | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3245 | (* connectives *) | 
| 22732 
5bd1a2a94e1b
declared lemmas true_eqvt and false_eqvt to be equivariant (suggested by samth at ccs.neu.edu)
 urbanc parents: 
22729diff
changeset | 3246 | if_eqvt imp_eqvt disj_eqvt conj_eqvt neg_eqvt | 
| 
5bd1a2a94e1b
declared lemmas true_eqvt and false_eqvt to be equivariant (suggested by samth at ccs.neu.edu)
 urbanc parents: 
22729diff
changeset | 3247 | true_eqvt false_eqvt | 
| 24568 | 3248 | imp_eqvt [folded induct_implies_def] | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3249 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3250 | (* datatypes *) | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3251 | perm_unit.simps | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3252 | perm_list.simps append_eqvt | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3253 | perm_prod.simps | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3254 | fst_eqvt snd_eqvt | 
| 22511 
ca326e0fb5c5
added the permutation operation on options to the list of equivariance lemmas
 urbanc parents: 
22500diff
changeset | 3255 | perm_option.simps | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3256 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3257 | (* nats *) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3258 | Suc_eqvt Zero_nat_eqvt One_nat_eqvt min_nat_eqvt max_nat_eqvt | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3259 | plus_nat_eqvt minus_nat_eqvt mult_nat_eqvt div_nat_eqvt | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3260 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3261 | (* ints *) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3262 | Zero_int_eqvt One_int_eqvt min_int_eqvt max_int_eqvt | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3263 | plus_int_eqvt minus_int_eqvt mult_int_eqvt div_int_eqvt | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3264 | |
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3265 | (* sets *) | 
| 22768 
d41fe3416f52
simplified the proof of pt_set_eqvt (as suggested by Randy Pollack)
 urbanc parents: 
22762diff
changeset | 3266 | union_eqvt empty_eqvt insert_eqvt set_eqvt | 
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3267 | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3268 | |
| 22446 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3269 | (* the lemmas numeral_nat_eqvt numeral_int_eqvt do not conform with the *) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3270 | (* usual form of an eqvt-lemma, but they are needed for analysing *) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3271 | (* permutations on nats and ints *) | 
| 
91951d4177d3
added eqvt-lemmas for integers and eqvt-tagged the lemma append_eqvt
 urbanc parents: 
22418diff
changeset | 3272 | lemmas [eqvt_force] = numeral_nat_eqvt numeral_int_eqvt | 
| 22326 
a3acee47a883
start adding the attribute eqvt to some lemmas of the nominal library
 narboux parents: 
22312diff
changeset | 3273 | |
| 17870 | 3274 | (***************************************) | 
| 3275 | (* setup for the individial atom-kinds *) | |
| 18047 
3d643b13eb65
simplified the abs_supp_approx proof and tuned some comments in
 urbanc parents: 
18012diff
changeset | 3276 | (* and nominal datatypes *) | 
| 18068 | 3277 | use "nominal_atoms.ML" | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3278 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3279 | (************************************************************) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3280 | (* various tactics for analysing permutations, supports etc *) | 
| 19986 
3e0eababf58d
- nominal_permeq.ML is now loaded before nominal_package.ML
 berghofe parents: 
19972diff
changeset | 3281 | use "nominal_permeq.ML"; | 
| 17870 | 3282 | |
| 3283 | method_setup perm_simp = | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3284 |   {* NominalPermeq.perm_simp_meth *}
 | 
| 19477 | 3285 |   {* simp rules and simprocs for analysing permutations *}
 | 
| 17870 | 3286 | |
| 3287 | method_setup perm_simp_debug = | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3288 |   {* NominalPermeq.perm_simp_meth_debug *}
 | 
| 19986 
3e0eababf58d
- nominal_permeq.ML is now loaded before nominal_package.ML
 berghofe parents: 
19972diff
changeset | 3289 |   {* simp rules and simprocs for analysing permutations including debugging facilities *}
 | 
| 19477 | 3290 | |
| 3291 | method_setup perm_full_simp = | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3292 |   {* NominalPermeq.perm_full_simp_meth *}
 | 
| 19477 | 3293 |   {* tactic for deciding equalities involving permutations *}
 | 
| 3294 | ||
| 3295 | method_setup perm_full_simp_debug = | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3296 |   {* NominalPermeq.perm_full_simp_meth_debug *}
 | 
| 19986 
3e0eababf58d
- nominal_permeq.ML is now loaded before nominal_package.ML
 berghofe parents: 
19972diff
changeset | 3297 |   {* tactic for deciding equalities involving permutations including debugging facilities *}
 | 
| 17870 | 3298 | |
| 3299 | method_setup supports_simp = | |
| 19986 
3e0eababf58d
- nominal_permeq.ML is now loaded before nominal_package.ML
 berghofe parents: 
19972diff
changeset | 3300 |   {* NominalPermeq.supports_meth *}
 | 
| 18703 | 3301 |   {* tactic for deciding whether something supports something else *}
 | 
| 17870 | 3302 | |
| 3303 | method_setup supports_simp_debug = | |
| 19986 
3e0eababf58d
- nominal_permeq.ML is now loaded before nominal_package.ML
 berghofe parents: 
19972diff
changeset | 3304 |   {* NominalPermeq.supports_meth_debug *}
 | 
| 
3e0eababf58d
- nominal_permeq.ML is now loaded before nominal_package.ML
 berghofe parents: 
19972diff
changeset | 3305 |   {* tactic for deciding whether something supports something else including debugging facilities *}
 | 
| 17870 | 3306 | |
| 19164 | 3307 | method_setup finite_guess = | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3308 |   {* NominalPermeq.finite_guess_meth *}
 | 
| 19164 | 3309 |   {* tactic for deciding whether something has finite support *}
 | 
| 3310 | ||
| 3311 | method_setup finite_guess_debug = | |
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3312 |   {* NominalPermeq.finite_guess_meth_debug *}
 | 
| 19986 
3e0eababf58d
- nominal_permeq.ML is now loaded before nominal_package.ML
 berghofe parents: 
19972diff
changeset | 3313 |   {* tactic for deciding whether something has finite support including debugging facilities *}
 | 
| 19494 | 3314 | |
| 19638 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 3315 | method_setup fresh_guess = | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3316 |   {* NominalPermeq.fresh_guess_meth *}
 | 
| 19638 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 3317 |   {* tactic for deciding whether an atom is fresh for something*}
 | 
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 3318 | |
| 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 3319 | method_setup fresh_guess_debug = | 
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3320 |   {* NominalPermeq.fresh_guess_meth_debug *}
 | 
| 19986 
3e0eababf58d
- nominal_permeq.ML is now loaded before nominal_package.ML
 berghofe parents: 
19972diff
changeset | 3321 |   {* tactic for deciding whether an atom is fresh for something including debugging facilities *}
 | 
| 19638 
4358b88a9d12
added the lemmas pt_fresh_aux and pt_fresh_aux_ineq
 urbanc parents: 
19634diff
changeset | 3322 | |
| 22762 | 3323 | (*****************************************************************) | 
| 3324 | (* tactics for generating fresh names and simplifying fresh_funs *) | |
| 3325 | use "nominal_fresh_fun.ML"; | |
| 22729 | 3326 | |
| 3327 | method_setup generate_fresh = | |
| 3328 |   {* setup_generate_fresh *} 
 | |
| 3329 |   {* tactic to generate a name fresh for all the variables in the goal *}
 | |
| 3330 | ||
| 3331 | method_setup fresh_fun_simp = | |
| 3332 |   {* setup_fresh_fun_simp *} 
 | |
| 3333 |   {* tactic to delete one inner occurence of fresh_fun *}
 | |
| 3334 | ||
| 3335 | ||
| 22418 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3336 | (************************************************) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3337 | (* main file for constructing nominal datatypes *) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3338 | use "nominal_package.ML" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3339 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3340 | (******************************************************) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3341 | (* primitive recursive functions on nominal datatypes *) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3342 | use "nominal_primrec.ML" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3343 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3344 | (****************************************************) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3345 | (* inductive definition involving nominal datatypes *) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3346 | use "nominal_inductive.ML" | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3347 | |
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3348 | (*****************************************) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3349 | (* setup for induction principles method *) | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3350 | use "nominal_induct.ML"; | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3351 | method_setup nominal_induct = | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3352 |   {* NominalInduct.nominal_induct_method *}
 | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3353 |   {* nominal induction *}
 | 
| 
49e2d9744ae1
major update of the nominal package; there is now an infrastructure
 urbanc parents: 
22326diff
changeset | 3354 | |
| 17870 | 3355 | end |