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