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