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