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