author | Christian Urban <urbanc@in.tum.de> |
Wed, 29 Sep 2010 09:47:26 -0400 | |
changeset 2500 | 3b6a70e73006 |
parent 2479 | a9b6a00b1ba0 |
child 2507 | f5621efe5a20 |
permissions | -rw-r--r-- |
1062 | 1 |
(* Title: Nominal2_Base |
2 |
Authors: Brian Huffman, Christian Urban |
|
3 |
||
4 |
Basic definitions and lemma infrastructure for |
|
5 |
Nominal Isabelle. |
|
6 |
*) |
|
7 |
theory Nominal2_Base |
|
8 |
imports Main Infinite_Set |
|
1833
2050b5723c04
added a library for basic nominal functions; separated nominal_eqvt file
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
9 |
uses ("nominal_library.ML") |
2467
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
10 |
("nominal_atoms.ML") |
1062 | 11 |
begin |
12 |
||
13 |
section {* Atoms and Sorts *} |
|
14 |
||
15 |
text {* A simple implementation for atom_sorts is strings. *} |
|
16 |
(* types atom_sort = string *) |
|
17 |
||
18 |
text {* To deal with Church-like binding we use trees of |
|
19 |
strings as sorts. *} |
|
20 |
||
21 |
datatype atom_sort = Sort "string" "atom_sort list" |
|
22 |
||
23 |
datatype atom = Atom atom_sort nat |
|
24 |
||
25 |
||
26 |
text {* Basic projection function. *} |
|
27 |
||
28 |
primrec |
|
29 |
sort_of :: "atom \<Rightarrow> atom_sort" |
|
30 |
where |
|
31 |
"sort_of (Atom s i) = s" |
|
32 |
||
1930
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
33 |
primrec |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
34 |
nat_of :: "atom \<Rightarrow> nat" |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
35 |
where |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
36 |
"nat_of (Atom s n) = n" |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
37 |
|
1062 | 38 |
|
39 |
text {* There are infinitely many atoms of each sort. *} |
|
40 |
lemma INFM_sort_of_eq: |
|
41 |
shows "INFM a. sort_of a = s" |
|
42 |
proof - |
|
43 |
have "INFM i. sort_of (Atom s i) = s" by simp |
|
44 |
moreover have "inj (Atom s)" by (simp add: inj_on_def) |
|
45 |
ultimately show "INFM a. sort_of a = s" by (rule INFM_inj) |
|
46 |
qed |
|
47 |
||
48 |
lemma infinite_sort_of_eq: |
|
49 |
shows "infinite {a. sort_of a = s}" |
|
50 |
using INFM_sort_of_eq unfolding INFM_iff_infinite . |
|
51 |
||
52 |
lemma atom_infinite [simp]: |
|
53 |
shows "infinite (UNIV :: atom set)" |
|
54 |
using subset_UNIV infinite_sort_of_eq |
|
55 |
by (rule infinite_super) |
|
56 |
||
57 |
lemma obtain_atom: |
|
58 |
fixes X :: "atom set" |
|
59 |
assumes X: "finite X" |
|
60 |
obtains a where "a \<notin> X" "sort_of a = s" |
|
61 |
proof - |
|
62 |
from X have "MOST a. a \<notin> X" |
|
63 |
unfolding MOST_iff_cofinite by simp |
|
64 |
with INFM_sort_of_eq |
|
65 |
have "INFM a. sort_of a = s \<and> a \<notin> X" |
|
66 |
by (rule INFM_conjI) |
|
67 |
then obtain a where "a \<notin> X" "sort_of a = s" |
|
68 |
by (auto elim: INFM_E) |
|
69 |
then show ?thesis .. |
|
70 |
qed |
|
71 |
||
1930
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
72 |
lemma atom_components_eq_iff: |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
73 |
fixes a b :: atom |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
74 |
shows "a = b \<longleftrightarrow> sort_of a = sort_of b \<and> nat_of a = nat_of b" |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
75 |
by (induct a, induct b, simp) |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
76 |
|
1062 | 77 |
section {* Sort-Respecting Permutations *} |
78 |
||
79 |
typedef perm = |
|
80 |
"{f. bij f \<and> finite {a. f a \<noteq> a} \<and> (\<forall>a. sort_of (f a) = sort_of a)}" |
|
81 |
proof |
|
82 |
show "id \<in> ?perm" by simp |
|
83 |
qed |
|
84 |
||
85 |
lemma permI: |
|
86 |
assumes "bij f" and "MOST x. f x = x" and "\<And>a. sort_of (f a) = sort_of a" |
|
87 |
shows "f \<in> perm" |
|
88 |
using assms unfolding perm_def MOST_iff_cofinite by simp |
|
89 |
||
90 |
lemma perm_is_bij: "f \<in> perm \<Longrightarrow> bij f" |
|
91 |
unfolding perm_def by simp |
|
92 |
||
93 |
lemma perm_is_finite: "f \<in> perm \<Longrightarrow> finite {a. f a \<noteq> a}" |
|
94 |
unfolding perm_def by simp |
|
95 |
||
96 |
lemma perm_is_sort_respecting: "f \<in> perm \<Longrightarrow> sort_of (f a) = sort_of a" |
|
97 |
unfolding perm_def by simp |
|
98 |
||
99 |
lemma perm_MOST: "f \<in> perm \<Longrightarrow> MOST x. f x = x" |
|
100 |
unfolding perm_def MOST_iff_cofinite by simp |
|
101 |
||
102 |
lemma perm_id: "id \<in> perm" |
|
103 |
unfolding perm_def by simp |
|
104 |
||
105 |
lemma perm_comp: |
|
106 |
assumes f: "f \<in> perm" and g: "g \<in> perm" |
|
107 |
shows "(f \<circ> g) \<in> perm" |
|
108 |
apply (rule permI) |
|
109 |
apply (rule bij_comp) |
|
110 |
apply (rule perm_is_bij [OF g]) |
|
111 |
apply (rule perm_is_bij [OF f]) |
|
112 |
apply (rule MOST_rev_mp [OF perm_MOST [OF g]]) |
|
113 |
apply (rule MOST_rev_mp [OF perm_MOST [OF f]]) |
|
114 |
apply (simp) |
|
115 |
apply (simp add: perm_is_sort_respecting [OF f]) |
|
116 |
apply (simp add: perm_is_sort_respecting [OF g]) |
|
117 |
done |
|
118 |
||
119 |
lemma perm_inv: |
|
120 |
assumes f: "f \<in> perm" |
|
121 |
shows "(inv f) \<in> perm" |
|
122 |
apply (rule permI) |
|
123 |
apply (rule bij_imp_bij_inv) |
|
124 |
apply (rule perm_is_bij [OF f]) |
|
125 |
apply (rule MOST_mono [OF perm_MOST [OF f]]) |
|
126 |
apply (erule subst, rule inv_f_f) |
|
127 |
apply (rule bij_is_inj [OF perm_is_bij [OF f]]) |
|
128 |
apply (rule perm_is_sort_respecting [OF f, THEN sym, THEN trans]) |
|
129 |
apply (simp add: surj_f_inv_f [OF bij_is_surj [OF perm_is_bij [OF f]]]) |
|
130 |
done |
|
131 |
||
132 |
lemma bij_Rep_perm: "bij (Rep_perm p)" |
|
133 |
using Rep_perm [of p] unfolding perm_def by simp |
|
134 |
||
135 |
lemma finite_Rep_perm: "finite {a. Rep_perm p a \<noteq> a}" |
|
136 |
using Rep_perm [of p] unfolding perm_def by simp |
|
137 |
||
138 |
lemma sort_of_Rep_perm: "sort_of (Rep_perm p a) = sort_of a" |
|
139 |
using Rep_perm [of p] unfolding perm_def by simp |
|
140 |
||
141 |
lemma Rep_perm_ext: |
|
142 |
"Rep_perm p1 = Rep_perm p2 \<Longrightarrow> p1 = p2" |
|
2479
a9b6a00b1ba0
updated to Isabelle Sept 16
Christian Urban <urbanc@in.tum.de>
parents:
2475
diff
changeset
|
143 |
by (simp add: fun_eq_iff Rep_perm_inject [symmetric]) |
1062 | 144 |
|
145 |
||
146 |
subsection {* Permutations form a group *} |
|
147 |
||
148 |
instantiation perm :: group_add |
|
149 |
begin |
|
150 |
||
151 |
definition |
|
152 |
"0 = Abs_perm id" |
|
153 |
||
154 |
definition |
|
155 |
"- p = Abs_perm (inv (Rep_perm p))" |
|
156 |
||
157 |
definition |
|
158 |
"p + q = Abs_perm (Rep_perm p \<circ> Rep_perm q)" |
|
159 |
||
160 |
definition |
|
161 |
"(p1::perm) - p2 = p1 + - p2" |
|
162 |
||
163 |
lemma Rep_perm_0: "Rep_perm 0 = id" |
|
164 |
unfolding zero_perm_def |
|
165 |
by (simp add: Abs_perm_inverse perm_id) |
|
166 |
||
167 |
lemma Rep_perm_add: |
|
168 |
"Rep_perm (p1 + p2) = Rep_perm p1 \<circ> Rep_perm p2" |
|
169 |
unfolding plus_perm_def |
|
170 |
by (simp add: Abs_perm_inverse perm_comp Rep_perm) |
|
171 |
||
172 |
lemma Rep_perm_uminus: |
|
173 |
"Rep_perm (- p) = inv (Rep_perm p)" |
|
174 |
unfolding uminus_perm_def |
|
175 |
by (simp add: Abs_perm_inverse perm_inv Rep_perm) |
|
176 |
||
177 |
instance |
|
178 |
apply default |
|
179 |
unfolding Rep_perm_inject [symmetric] |
|
180 |
unfolding minus_perm_def |
|
181 |
unfolding Rep_perm_add |
|
182 |
unfolding Rep_perm_uminus |
|
183 |
unfolding Rep_perm_0 |
|
184 |
by (simp_all add: o_assoc inv_o_cancel [OF bij_is_inj [OF bij_Rep_perm]]) |
|
185 |
||
186 |
end |
|
187 |
||
188 |
||
189 |
section {* Implementation of swappings *} |
|
190 |
||
191 |
definition |
|
192 |
swap :: "atom \<Rightarrow> atom \<Rightarrow> perm" ("'(_ \<rightleftharpoons> _')") |
|
193 |
where |
|
194 |
"(a \<rightleftharpoons> b) = |
|
195 |
Abs_perm (if sort_of a = sort_of b |
|
196 |
then (\<lambda>c. if a = c then b else if b = c then a else c) |
|
197 |
else id)" |
|
198 |
||
199 |
lemma Rep_perm_swap: |
|
200 |
"Rep_perm (a \<rightleftharpoons> b) = |
|
201 |
(if sort_of a = sort_of b |
|
202 |
then (\<lambda>c. if a = c then b else if b = c then a else c) |
|
203 |
else id)" |
|
204 |
unfolding swap_def |
|
205 |
apply (rule Abs_perm_inverse) |
|
206 |
apply (rule permI) |
|
207 |
apply (auto simp add: bij_def inj_on_def surj_def)[1] |
|
208 |
apply (rule MOST_rev_mp [OF MOST_neq(1) [of a]]) |
|
209 |
apply (rule MOST_rev_mp [OF MOST_neq(1) [of b]]) |
|
210 |
apply (simp) |
|
211 |
apply (simp) |
|
212 |
done |
|
213 |
||
214 |
lemmas Rep_perm_simps = |
|
215 |
Rep_perm_0 |
|
216 |
Rep_perm_add |
|
217 |
Rep_perm_uminus |
|
218 |
Rep_perm_swap |
|
219 |
||
220 |
lemma swap_different_sorts [simp]: |
|
221 |
"sort_of a \<noteq> sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) = 0" |
|
222 |
by (rule Rep_perm_ext) (simp add: Rep_perm_simps) |
|
223 |
||
224 |
lemma swap_cancel: |
|
225 |
"(a \<rightleftharpoons> b) + (a \<rightleftharpoons> b) = 0" |
|
1879 | 226 |
by (rule Rep_perm_ext) |
2479
a9b6a00b1ba0
updated to Isabelle Sept 16
Christian Urban <urbanc@in.tum.de>
parents:
2475
diff
changeset
|
227 |
(simp add: Rep_perm_simps fun_eq_iff) |
1062 | 228 |
|
229 |
lemma swap_self [simp]: |
|
230 |
"(a \<rightleftharpoons> a) = 0" |
|
2479
a9b6a00b1ba0
updated to Isabelle Sept 16
Christian Urban <urbanc@in.tum.de>
parents:
2475
diff
changeset
|
231 |
by (rule Rep_perm_ext, simp add: Rep_perm_simps fun_eq_iff) |
1062 | 232 |
|
233 |
lemma minus_swap [simp]: |
|
234 |
"- (a \<rightleftharpoons> b) = (a \<rightleftharpoons> b)" |
|
235 |
by (rule minus_unique [OF swap_cancel]) |
|
236 |
||
237 |
lemma swap_commute: |
|
238 |
"(a \<rightleftharpoons> b) = (b \<rightleftharpoons> a)" |
|
239 |
by (rule Rep_perm_ext) |
|
2479
a9b6a00b1ba0
updated to Isabelle Sept 16
Christian Urban <urbanc@in.tum.de>
parents:
2475
diff
changeset
|
240 |
(simp add: Rep_perm_swap fun_eq_iff) |
1062 | 241 |
|
242 |
lemma swap_triple: |
|
243 |
assumes "a \<noteq> b" and "c \<noteq> b" |
|
244 |
assumes "sort_of a = sort_of b" "sort_of b = sort_of c" |
|
245 |
shows "(a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c) = (a \<rightleftharpoons> b)" |
|
246 |
using assms |
|
247 |
by (rule_tac Rep_perm_ext) |
|
2479
a9b6a00b1ba0
updated to Isabelle Sept 16
Christian Urban <urbanc@in.tum.de>
parents:
2475
diff
changeset
|
248 |
(auto simp add: Rep_perm_simps fun_eq_iff) |
1062 | 249 |
|
250 |
||
251 |
section {* Permutation Types *} |
|
252 |
||
253 |
text {* |
|
254 |
Infix syntax for @{text permute} has higher precedence than |
|
255 |
addition, but lower than unary minus. |
|
256 |
*} |
|
257 |
||
258 |
class pt = |
|
259 |
fixes permute :: "perm \<Rightarrow> 'a \<Rightarrow> 'a" ("_ \<bullet> _" [76, 75] 75) |
|
260 |
assumes permute_zero [simp]: "0 \<bullet> x = x" |
|
261 |
assumes permute_plus [simp]: "(p + q) \<bullet> x = p \<bullet> (q \<bullet> x)" |
|
262 |
begin |
|
263 |
||
264 |
lemma permute_diff [simp]: |
|
265 |
shows "(p - q) \<bullet> x = p \<bullet> - q \<bullet> x" |
|
266 |
unfolding diff_minus by simp |
|
267 |
||
268 |
lemma permute_minus_cancel [simp]: |
|
269 |
shows "p \<bullet> - p \<bullet> x = x" |
|
270 |
and "- p \<bullet> p \<bullet> x = x" |
|
271 |
unfolding permute_plus [symmetric] by simp_all |
|
272 |
||
273 |
lemma permute_swap_cancel [simp]: |
|
274 |
shows "(a \<rightleftharpoons> b) \<bullet> (a \<rightleftharpoons> b) \<bullet> x = x" |
|
275 |
unfolding permute_plus [symmetric] |
|
276 |
by (simp add: swap_cancel) |
|
277 |
||
278 |
lemma permute_swap_cancel2 [simp]: |
|
279 |
shows "(a \<rightleftharpoons> b) \<bullet> (b \<rightleftharpoons> a) \<bullet> x = x" |
|
280 |
unfolding permute_plus [symmetric] |
|
281 |
by (simp add: swap_commute) |
|
282 |
||
283 |
lemma inj_permute [simp]: |
|
284 |
shows "inj (permute p)" |
|
285 |
by (rule inj_on_inverseI) |
|
286 |
(rule permute_minus_cancel) |
|
287 |
||
288 |
lemma surj_permute [simp]: |
|
289 |
shows "surj (permute p)" |
|
290 |
by (rule surjI, rule permute_minus_cancel) |
|
291 |
||
292 |
lemma bij_permute [simp]: |
|
293 |
shows "bij (permute p)" |
|
294 |
by (rule bijI [OF inj_permute surj_permute]) |
|
295 |
||
296 |
lemma inv_permute: |
|
297 |
shows "inv (permute p) = permute (- p)" |
|
298 |
by (rule inv_equality) (simp_all) |
|
299 |
||
300 |
lemma permute_minus: |
|
301 |
shows "permute (- p) = inv (permute p)" |
|
302 |
by (simp add: inv_permute) |
|
303 |
||
304 |
lemma permute_eq_iff [simp]: |
|
305 |
shows "p \<bullet> x = p \<bullet> y \<longleftrightarrow> x = y" |
|
306 |
by (rule inj_permute [THEN inj_eq]) |
|
307 |
||
308 |
end |
|
309 |
||
310 |
subsection {* Permutations for atoms *} |
|
311 |
||
312 |
instantiation atom :: pt |
|
313 |
begin |
|
314 |
||
315 |
definition |
|
1879 | 316 |
"p \<bullet> a = (Rep_perm p) a" |
1062 | 317 |
|
318 |
instance |
|
319 |
apply(default) |
|
320 |
apply(simp_all add: permute_atom_def Rep_perm_simps) |
|
321 |
done |
|
322 |
||
323 |
end |
|
324 |
||
325 |
lemma sort_of_permute [simp]: |
|
326 |
shows "sort_of (p \<bullet> a) = sort_of a" |
|
327 |
unfolding permute_atom_def by (rule sort_of_Rep_perm) |
|
328 |
||
329 |
lemma swap_atom: |
|
330 |
shows "(a \<rightleftharpoons> b) \<bullet> c = |
|
331 |
(if sort_of a = sort_of b |
|
332 |
then (if c = a then b else if c = b then a else c) else c)" |
|
333 |
unfolding permute_atom_def |
|
334 |
by (simp add: Rep_perm_swap) |
|
335 |
||
336 |
lemma swap_atom_simps [simp]: |
|
337 |
"sort_of a = sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> a = b" |
|
338 |
"sort_of a = sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> b = a" |
|
339 |
"c \<noteq> a \<Longrightarrow> c \<noteq> b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> c = c" |
|
340 |
unfolding swap_atom by simp_all |
|
341 |
||
342 |
lemma expand_perm_eq: |
|
343 |
fixes p q :: "perm" |
|
344 |
shows "p = q \<longleftrightarrow> (\<forall>a::atom. p \<bullet> a = q \<bullet> a)" |
|
345 |
unfolding permute_atom_def |
|
346 |
by (metis Rep_perm_ext ext) |
|
347 |
||
348 |
||
349 |
subsection {* Permutations for permutations *} |
|
350 |
||
351 |
instantiation perm :: pt |
|
352 |
begin |
|
353 |
||
354 |
definition |
|
355 |
"p \<bullet> q = p + q - p" |
|
356 |
||
357 |
instance |
|
358 |
apply default |
|
359 |
apply (simp add: permute_perm_def) |
|
360 |
apply (simp add: permute_perm_def diff_minus minus_add add_assoc) |
|
361 |
done |
|
362 |
||
363 |
end |
|
364 |
||
1879 | 365 |
lemma permute_self: |
366 |
shows "p \<bullet> p = p" |
|
367 |
unfolding permute_perm_def |
|
368 |
by (simp add: diff_minus add_assoc) |
|
1062 | 369 |
|
370 |
lemma permute_eqvt: |
|
371 |
shows "p \<bullet> (q \<bullet> x) = (p \<bullet> q) \<bullet> (p \<bullet> x)" |
|
372 |
unfolding permute_perm_def by simp |
|
373 |
||
374 |
lemma zero_perm_eqvt: |
|
375 |
shows "p \<bullet> (0::perm) = 0" |
|
376 |
unfolding permute_perm_def by simp |
|
377 |
||
378 |
lemma add_perm_eqvt: |
|
379 |
fixes p p1 p2 :: perm |
|
380 |
shows "p \<bullet> (p1 + p2) = p \<bullet> p1 + p \<bullet> p2" |
|
381 |
unfolding permute_perm_def |
|
382 |
by (simp add: expand_perm_eq) |
|
383 |
||
384 |
lemma swap_eqvt: |
|
385 |
shows "p \<bullet> (a \<rightleftharpoons> b) = (p \<bullet> a \<rightleftharpoons> p \<bullet> b)" |
|
386 |
unfolding permute_perm_def |
|
387 |
by (auto simp add: swap_atom expand_perm_eq) |
|
388 |
||
2310 | 389 |
lemma uminus_eqvt: |
390 |
fixes p q::"perm" |
|
391 |
shows "p \<bullet> (- q) = - (p \<bullet> q)" |
|
392 |
unfolding permute_perm_def |
|
393 |
by (simp add: diff_minus minus_add add_assoc) |
|
1062 | 394 |
|
395 |
subsection {* Permutations for functions *} |
|
396 |
||
397 |
instantiation "fun" :: (pt, pt) pt |
|
398 |
begin |
|
399 |
||
400 |
definition |
|
401 |
"p \<bullet> f = (\<lambda>x. p \<bullet> (f (- p \<bullet> x)))" |
|
402 |
||
403 |
instance |
|
404 |
apply default |
|
405 |
apply (simp add: permute_fun_def) |
|
406 |
apply (simp add: permute_fun_def minus_add) |
|
407 |
done |
|
408 |
||
409 |
end |
|
410 |
||
411 |
lemma permute_fun_app_eq: |
|
412 |
shows "p \<bullet> (f x) = (p \<bullet> f) (p \<bullet> x)" |
|
1879 | 413 |
unfolding permute_fun_def by simp |
1062 | 414 |
|
415 |
||
416 |
subsection {* Permutations for booleans *} |
|
417 |
||
418 |
instantiation bool :: pt |
|
419 |
begin |
|
420 |
||
421 |
definition "p \<bullet> (b::bool) = b" |
|
422 |
||
423 |
instance |
|
424 |
apply(default) |
|
425 |
apply(simp_all add: permute_bool_def) |
|
426 |
done |
|
427 |
||
428 |
end |
|
429 |
||
430 |
lemma Not_eqvt: |
|
431 |
shows "p \<bullet> (\<not> A) = (\<not> (p \<bullet> A))" |
|
432 |
by (simp add: permute_bool_def) |
|
433 |
||
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
434 |
lemma conj_eqvt: |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
435 |
shows "p \<bullet> (A \<and> B) = ((p \<bullet> A) \<and> (p \<bullet> B))" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
436 |
by (simp add: permute_bool_def) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
437 |
|
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
438 |
lemma imp_eqvt: |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
439 |
shows "p \<bullet> (A \<longrightarrow> B) = ((p \<bullet> A) \<longrightarrow> (p \<bullet> B))" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
440 |
by (simp add: permute_bool_def) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
441 |
|
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
442 |
lemma ex_eqvt: |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
443 |
shows "p \<bullet> (\<exists>x. P x) = (\<exists>x. (p \<bullet> P) x)" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
444 |
unfolding permute_fun_def permute_bool_def |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
445 |
by (auto, rule_tac x="p \<bullet> x" in exI, simp) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
446 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
447 |
lemma all_eqvt: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
448 |
shows "p \<bullet> (\<forall>x. P x) = (\<forall>x. (p \<bullet> P) x)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
449 |
unfolding permute_fun_def permute_bool_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
450 |
by (auto, drule_tac x="p \<bullet> x" in spec, simp) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
451 |
|
1557
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents:
1305
diff
changeset
|
452 |
lemma permute_boolE: |
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents:
1305
diff
changeset
|
453 |
fixes P::"bool" |
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents:
1305
diff
changeset
|
454 |
shows "p \<bullet> P \<Longrightarrow> P" |
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents:
1305
diff
changeset
|
455 |
by (simp add: permute_bool_def) |
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents:
1305
diff
changeset
|
456 |
|
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents:
1305
diff
changeset
|
457 |
lemma permute_boolI: |
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents:
1305
diff
changeset
|
458 |
fixes P::"bool" |
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents:
1305
diff
changeset
|
459 |
shows "P \<Longrightarrow> p \<bullet> P" |
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents:
1305
diff
changeset
|
460 |
by(simp add: permute_bool_def) |
1062 | 461 |
|
462 |
subsection {* Permutations for sets *} |
|
463 |
||
464 |
lemma permute_set_eq: |
|
465 |
fixes x::"'a::pt" |
|
466 |
and p::"perm" |
|
467 |
shows "(p \<bullet> X) = {p \<bullet> x | x. x \<in> X}" |
|
1879 | 468 |
unfolding permute_fun_def |
469 |
unfolding permute_bool_def |
|
470 |
apply(auto simp add: mem_def) |
|
1062 | 471 |
apply(rule_tac x="- p \<bullet> x" in exI) |
472 |
apply(simp) |
|
473 |
done |
|
474 |
||
475 |
lemma permute_set_eq_image: |
|
476 |
shows "p \<bullet> X = permute p ` X" |
|
1879 | 477 |
unfolding permute_set_eq by auto |
1062 | 478 |
|
479 |
lemma permute_set_eq_vimage: |
|
480 |
shows "p \<bullet> X = permute (- p) -` X" |
|
1879 | 481 |
unfolding permute_fun_def permute_bool_def |
482 |
unfolding vimage_def Collect_def mem_def .. |
|
1062 | 483 |
|
484 |
lemma swap_set_not_in: |
|
485 |
assumes a: "a \<notin> S" "b \<notin> S" |
|
486 |
shows "(a \<rightleftharpoons> b) \<bullet> S = S" |
|
1879 | 487 |
unfolding permute_set_eq |
488 |
using a by (auto simp add: swap_atom) |
|
1062 | 489 |
|
490 |
lemma swap_set_in: |
|
491 |
assumes a: "a \<in> S" "b \<notin> S" "sort_of a = sort_of b" |
|
492 |
shows "(a \<rightleftharpoons> b) \<bullet> S \<noteq> S" |
|
1879 | 493 |
unfolding permute_set_eq |
494 |
using a by (auto simp add: swap_atom) |
|
1062 | 495 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
496 |
lemma mem_permute_iff: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
497 |
shows "(p \<bullet> x) \<in> (p \<bullet> X) \<longleftrightarrow> x \<in> X" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
498 |
unfolding mem_def permute_fun_def permute_bool_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
499 |
by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
500 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
501 |
lemma mem_eqvt: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
502 |
shows "p \<bullet> (x \<in> A) \<longleftrightarrow> (p \<bullet> x) \<in> (p \<bullet> A)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
503 |
unfolding mem_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
504 |
by (simp add: permute_fun_app_eq) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
505 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
506 |
lemma insert_eqvt: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
507 |
shows "p \<bullet> (insert x A) = insert (p \<bullet> x) (p \<bullet> A)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
508 |
unfolding permute_set_eq_image image_insert .. |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
509 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
510 |
|
1062 | 511 |
subsection {* Permutations for units *} |
512 |
||
513 |
instantiation unit :: pt |
|
514 |
begin |
|
515 |
||
516 |
definition "p \<bullet> (u::unit) = u" |
|
517 |
||
1879 | 518 |
instance |
519 |
by (default) (simp_all add: permute_unit_def) |
|
1062 | 520 |
|
521 |
end |
|
522 |
||
523 |
||
524 |
subsection {* Permutations for products *} |
|
525 |
||
2378
2f13fe48c877
updated to new Isabelle; made FSet more "quiet"
Christian Urban <urbanc@in.tum.de>
parents:
2310
diff
changeset
|
526 |
instantiation prod :: (pt, pt) pt |
1062 | 527 |
begin |
528 |
||
529 |
primrec |
|
530 |
permute_prod |
|
531 |
where |
|
532 |
Pair_eqvt: "p \<bullet> (x, y) = (p \<bullet> x, p \<bullet> y)" |
|
533 |
||
534 |
instance |
|
535 |
by default auto |
|
536 |
||
537 |
end |
|
538 |
||
539 |
subsection {* Permutations for sums *} |
|
540 |
||
2378
2f13fe48c877
updated to new Isabelle; made FSet more "quiet"
Christian Urban <urbanc@in.tum.de>
parents:
2310
diff
changeset
|
541 |
instantiation sum :: (pt, pt) pt |
1062 | 542 |
begin |
543 |
||
544 |
primrec |
|
545 |
permute_sum |
|
546 |
where |
|
547 |
"p \<bullet> (Inl x) = Inl (p \<bullet> x)" |
|
548 |
| "p \<bullet> (Inr y) = Inr (p \<bullet> y)" |
|
549 |
||
1879 | 550 |
instance |
551 |
by (default) (case_tac [!] x, simp_all) |
|
1062 | 552 |
|
553 |
end |
|
554 |
||
555 |
subsection {* Permutations for lists *} |
|
556 |
||
557 |
instantiation list :: (pt) pt |
|
558 |
begin |
|
559 |
||
560 |
primrec |
|
561 |
permute_list |
|
562 |
where |
|
563 |
"p \<bullet> [] = []" |
|
564 |
| "p \<bullet> (x # xs) = p \<bullet> x # p \<bullet> xs" |
|
565 |
||
1879 | 566 |
instance |
567 |
by (default) (induct_tac [!] x, simp_all) |
|
1062 | 568 |
|
569 |
end |
|
570 |
||
571 |
subsection {* Permutations for options *} |
|
572 |
||
573 |
instantiation option :: (pt) pt |
|
574 |
begin |
|
575 |
||
576 |
primrec |
|
577 |
permute_option |
|
578 |
where |
|
579 |
"p \<bullet> None = None" |
|
580 |
| "p \<bullet> (Some x) = Some (p \<bullet> x)" |
|
581 |
||
1879 | 582 |
instance |
583 |
by (default) (induct_tac [!] x, simp_all) |
|
1062 | 584 |
|
585 |
end |
|
586 |
||
587 |
subsection {* Permutations for @{typ char}, @{typ nat}, and @{typ int} *} |
|
588 |
||
589 |
instantiation char :: pt |
|
590 |
begin |
|
591 |
||
592 |
definition "p \<bullet> (c::char) = c" |
|
593 |
||
1879 | 594 |
instance |
595 |
by (default) (simp_all add: permute_char_def) |
|
1062 | 596 |
|
597 |
end |
|
598 |
||
599 |
instantiation nat :: pt |
|
600 |
begin |
|
601 |
||
602 |
definition "p \<bullet> (n::nat) = n" |
|
603 |
||
1879 | 604 |
instance |
605 |
by (default) (simp_all add: permute_nat_def) |
|
1062 | 606 |
|
607 |
end |
|
608 |
||
609 |
instantiation int :: pt |
|
610 |
begin |
|
611 |
||
612 |
definition "p \<bullet> (i::int) = i" |
|
613 |
||
1879 | 614 |
instance |
615 |
by (default) (simp_all add: permute_int_def) |
|
1062 | 616 |
|
617 |
end |
|
618 |
||
619 |
||
620 |
section {* Pure types *} |
|
621 |
||
622 |
text {* Pure types will have always empty support. *} |
|
623 |
||
624 |
class pure = pt + |
|
625 |
assumes permute_pure: "p \<bullet> x = x" |
|
626 |
||
627 |
text {* Types @{typ unit} and @{typ bool} are pure. *} |
|
628 |
||
629 |
instance unit :: pure |
|
630 |
proof qed (rule permute_unit_def) |
|
631 |
||
632 |
instance bool :: pure |
|
633 |
proof qed (rule permute_bool_def) |
|
634 |
||
635 |
text {* Other type constructors preserve purity. *} |
|
636 |
||
637 |
instance "fun" :: (pure, pure) pure |
|
638 |
by default (simp add: permute_fun_def permute_pure) |
|
639 |
||
2378
2f13fe48c877
updated to new Isabelle; made FSet more "quiet"
Christian Urban <urbanc@in.tum.de>
parents:
2310
diff
changeset
|
640 |
instance prod :: (pure, pure) pure |
1062 | 641 |
by default (induct_tac x, simp add: permute_pure) |
642 |
||
2378
2f13fe48c877
updated to new Isabelle; made FSet more "quiet"
Christian Urban <urbanc@in.tum.de>
parents:
2310
diff
changeset
|
643 |
instance sum :: (pure, pure) pure |
1062 | 644 |
by default (induct_tac x, simp_all add: permute_pure) |
645 |
||
646 |
instance list :: (pure) pure |
|
647 |
by default (induct_tac x, simp_all add: permute_pure) |
|
648 |
||
649 |
instance option :: (pure) pure |
|
650 |
by default (induct_tac x, simp_all add: permute_pure) |
|
651 |
||
652 |
||
653 |
subsection {* Types @{typ char}, @{typ nat}, and @{typ int} *} |
|
654 |
||
655 |
instance char :: pure |
|
656 |
proof qed (rule permute_char_def) |
|
657 |
||
658 |
instance nat :: pure |
|
659 |
proof qed (rule permute_nat_def) |
|
660 |
||
661 |
instance int :: pure |
|
662 |
proof qed (rule permute_int_def) |
|
663 |
||
664 |
||
665 |
subsection {* Supp, Freshness and Supports *} |
|
666 |
||
667 |
context pt |
|
668 |
begin |
|
669 |
||
670 |
definition |
|
671 |
supp :: "'a \<Rightarrow> atom set" |
|
672 |
where |
|
673 |
"supp x = {a. infinite {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x}}" |
|
674 |
||
675 |
end |
|
676 |
||
677 |
definition |
|
678 |
fresh :: "atom \<Rightarrow> 'a::pt \<Rightarrow> bool" ("_ \<sharp> _" [55, 55] 55) |
|
679 |
where |
|
680 |
"a \<sharp> x \<equiv> a \<notin> supp x" |
|
681 |
||
682 |
lemma supp_conv_fresh: |
|
683 |
shows "supp x = {a. \<not> a \<sharp> x}" |
|
684 |
unfolding fresh_def by simp |
|
685 |
||
686 |
lemma swap_rel_trans: |
|
687 |
assumes "sort_of a = sort_of b" |
|
688 |
assumes "sort_of b = sort_of c" |
|
689 |
assumes "(a \<rightleftharpoons> c) \<bullet> x = x" |
|
690 |
assumes "(b \<rightleftharpoons> c) \<bullet> x = x" |
|
691 |
shows "(a \<rightleftharpoons> b) \<bullet> x = x" |
|
692 |
proof (cases) |
|
693 |
assume "a = b \<or> c = b" |
|
694 |
with assms show "(a \<rightleftharpoons> b) \<bullet> x = x" by auto |
|
695 |
next |
|
696 |
assume *: "\<not> (a = b \<or> c = b)" |
|
697 |
have "((a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c)) \<bullet> x = x" |
|
698 |
using assms by simp |
|
699 |
also have "(a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c) = (a \<rightleftharpoons> b)" |
|
700 |
using assms * by (simp add: swap_triple) |
|
701 |
finally show "(a \<rightleftharpoons> b) \<bullet> x = x" . |
|
702 |
qed |
|
703 |
||
704 |
lemma swap_fresh_fresh: |
|
705 |
assumes a: "a \<sharp> x" |
|
706 |
and b: "b \<sharp> x" |
|
707 |
shows "(a \<rightleftharpoons> b) \<bullet> x = x" |
|
708 |
proof (cases) |
|
709 |
assume asm: "sort_of a = sort_of b" |
|
710 |
have "finite {c. (a \<rightleftharpoons> c) \<bullet> x \<noteq> x}" "finite {c. (b \<rightleftharpoons> c) \<bullet> x \<noteq> x}" |
|
711 |
using a b unfolding fresh_def supp_def by simp_all |
|
712 |
then have "finite ({c. (a \<rightleftharpoons> c) \<bullet> x \<noteq> x} \<union> {c. (b \<rightleftharpoons> c) \<bullet> x \<noteq> x})" by simp |
|
713 |
then obtain c |
|
714 |
where "(a \<rightleftharpoons> c) \<bullet> x = x" "(b \<rightleftharpoons> c) \<bullet> x = x" "sort_of c = sort_of b" |
|
715 |
by (rule obtain_atom) (auto) |
|
716 |
then show "(a \<rightleftharpoons> b) \<bullet> x = x" using asm by (rule_tac swap_rel_trans) (simp_all) |
|
717 |
next |
|
718 |
assume "sort_of a \<noteq> sort_of b" |
|
719 |
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by simp |
|
720 |
qed |
|
721 |
||
722 |
||
723 |
subsection {* supp and fresh are equivariant *} |
|
724 |
||
725 |
lemma finite_Collect_bij: |
|
726 |
assumes a: "bij f" |
|
727 |
shows "finite {x. P (f x)} = finite {x. P x}" |
|
728 |
by (metis a finite_vimage_iff vimage_Collect_eq) |
|
729 |
||
730 |
lemma fresh_permute_iff: |
|
731 |
shows "(p \<bullet> a) \<sharp> (p \<bullet> x) \<longleftrightarrow> a \<sharp> x" |
|
732 |
proof - |
|
733 |
have "(p \<bullet> a) \<sharp> (p \<bullet> x) \<longleftrightarrow> finite {b. (p \<bullet> a \<rightleftharpoons> b) \<bullet> p \<bullet> x \<noteq> p \<bullet> x}" |
|
734 |
unfolding fresh_def supp_def by simp |
|
735 |
also have "\<dots> \<longleftrightarrow> finite {b. (p \<bullet> a \<rightleftharpoons> p \<bullet> b) \<bullet> p \<bullet> x \<noteq> p \<bullet> x}" |
|
1879 | 736 |
using bij_permute by (rule finite_Collect_bij[symmetric]) |
1062 | 737 |
also have "\<dots> \<longleftrightarrow> finite {b. p \<bullet> (a \<rightleftharpoons> b) \<bullet> x \<noteq> p \<bullet> x}" |
738 |
by (simp only: permute_eqvt [of p] swap_eqvt) |
|
739 |
also have "\<dots> \<longleftrightarrow> finite {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x}" |
|
740 |
by (simp only: permute_eq_iff) |
|
741 |
also have "\<dots> \<longleftrightarrow> a \<sharp> x" |
|
742 |
unfolding fresh_def supp_def by simp |
|
1879 | 743 |
finally show "(p \<bullet> a) \<sharp> (p \<bullet> x) \<longleftrightarrow> a \<sharp> x" . |
1062 | 744 |
qed |
745 |
||
746 |
lemma fresh_eqvt: |
|
747 |
shows "p \<bullet> (a \<sharp> x) = (p \<bullet> a) \<sharp> (p \<bullet> x)" |
|
1879 | 748 |
unfolding permute_bool_def |
749 |
by (simp add: fresh_permute_iff) |
|
1062 | 750 |
|
751 |
lemma supp_eqvt: |
|
752 |
fixes p :: "perm" |
|
753 |
and x :: "'a::pt" |
|
754 |
shows "p \<bullet> (supp x) = supp (p \<bullet> x)" |
|
755 |
unfolding supp_conv_fresh |
|
1879 | 756 |
unfolding Collect_def |
757 |
unfolding permute_fun_def |
|
1062 | 758 |
by (simp add: Not_eqvt fresh_eqvt) |
759 |
||
760 |
subsection {* supports *} |
|
761 |
||
762 |
definition |
|
763 |
supports :: "atom set \<Rightarrow> 'a::pt \<Rightarrow> bool" (infixl "supports" 80) |
|
764 |
where |
|
765 |
"S supports x \<equiv> \<forall>a b. (a \<notin> S \<and> b \<notin> S \<longrightarrow> (a \<rightleftharpoons> b) \<bullet> x = x)" |
|
766 |
||
767 |
lemma supp_is_subset: |
|
768 |
fixes S :: "atom set" |
|
769 |
and x :: "'a::pt" |
|
770 |
assumes a1: "S supports x" |
|
771 |
and a2: "finite S" |
|
772 |
shows "(supp x) \<subseteq> S" |
|
773 |
proof (rule ccontr) |
|
1879 | 774 |
assume "\<not> (supp x \<subseteq> S)" |
1062 | 775 |
then obtain a where b1: "a \<in> supp x" and b2: "a \<notin> S" by auto |
1879 | 776 |
from a1 b2 have "\<forall>b. b \<notin> S \<longrightarrow> (a \<rightleftharpoons> b) \<bullet> x = x" unfolding supports_def by auto |
777 |
then have "{b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x} \<subseteq> S" by auto |
|
1062 | 778 |
with a2 have "finite {b. (a \<rightleftharpoons> b)\<bullet>x \<noteq> x}" by (simp add: finite_subset) |
779 |
then have "a \<notin> (supp x)" unfolding supp_def by simp |
|
780 |
with b1 show False by simp |
|
781 |
qed |
|
782 |
||
783 |
lemma supports_finite: |
|
784 |
fixes S :: "atom set" |
|
785 |
and x :: "'a::pt" |
|
786 |
assumes a1: "S supports x" |
|
787 |
and a2: "finite S" |
|
788 |
shows "finite (supp x)" |
|
789 |
proof - |
|
790 |
have "(supp x) \<subseteq> S" using a1 a2 by (rule supp_is_subset) |
|
791 |
then show "finite (supp x)" using a2 by (simp add: finite_subset) |
|
792 |
qed |
|
793 |
||
794 |
lemma supp_supports: |
|
795 |
fixes x :: "'a::pt" |
|
796 |
shows "(supp x) supports x" |
|
1879 | 797 |
unfolding supports_def |
798 |
proof (intro strip) |
|
1062 | 799 |
fix a b |
800 |
assume "a \<notin> (supp x) \<and> b \<notin> (supp x)" |
|
801 |
then have "a \<sharp> x" and "b \<sharp> x" by (simp_all add: fresh_def) |
|
1879 | 802 |
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by (simp add: swap_fresh_fresh) |
1062 | 803 |
qed |
804 |
||
805 |
lemma supp_is_least_supports: |
|
806 |
fixes S :: "atom set" |
|
807 |
and x :: "'a::pt" |
|
808 |
assumes a1: "S supports x" |
|
809 |
and a2: "finite S" |
|
810 |
and a3: "\<And>S'. finite S' \<Longrightarrow> (S' supports x) \<Longrightarrow> S \<subseteq> S'" |
|
811 |
shows "(supp x) = S" |
|
812 |
proof (rule equalityI) |
|
813 |
show "(supp x) \<subseteq> S" using a1 a2 by (rule supp_is_subset) |
|
814 |
with a2 have fin: "finite (supp x)" by (rule rev_finite_subset) |
|
815 |
have "(supp x) supports x" by (rule supp_supports) |
|
816 |
with fin a3 show "S \<subseteq> supp x" by blast |
|
817 |
qed |
|
818 |
||
819 |
lemma subsetCI: |
|
820 |
shows "(\<And>x. x \<in> A \<Longrightarrow> x \<notin> B \<Longrightarrow> False) \<Longrightarrow> A \<subseteq> B" |
|
821 |
by auto |
|
822 |
||
823 |
lemma finite_supp_unique: |
|
824 |
assumes a1: "S supports x" |
|
825 |
assumes a2: "finite S" |
|
826 |
assumes a3: "\<And>a b. \<lbrakk>a \<in> S; b \<notin> S; sort_of a = sort_of b\<rbrakk> \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> x \<noteq> x" |
|
827 |
shows "(supp x) = S" |
|
828 |
using a1 a2 |
|
829 |
proof (rule supp_is_least_supports) |
|
830 |
fix S' |
|
831 |
assume "finite S'" and "S' supports x" |
|
832 |
show "S \<subseteq> S'" |
|
833 |
proof (rule subsetCI) |
|
834 |
fix a |
|
835 |
assume "a \<in> S" and "a \<notin> S'" |
|
836 |
have "finite (S \<union> S')" |
|
837 |
using `finite S` `finite S'` by simp |
|
838 |
then obtain b where "b \<notin> S \<union> S'" and "sort_of b = sort_of a" |
|
839 |
by (rule obtain_atom) |
|
840 |
then have "b \<notin> S" and "b \<notin> S'" and "sort_of a = sort_of b" |
|
841 |
by simp_all |
|
842 |
then have "(a \<rightleftharpoons> b) \<bullet> x = x" |
|
843 |
using `a \<notin> S'` `S' supports x` by (simp add: supports_def) |
|
844 |
moreover have "(a \<rightleftharpoons> b) \<bullet> x \<noteq> x" |
|
845 |
using `a \<in> S` `b \<notin> S` `sort_of a = sort_of b` |
|
846 |
by (rule a3) |
|
847 |
ultimately show "False" by simp |
|
848 |
qed |
|
849 |
qed |
|
850 |
||
2475
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
parents:
2470
diff
changeset
|
851 |
section {* Support w.r.t. relations *} |
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
parents:
2470
diff
changeset
|
852 |
|
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
parents:
2470
diff
changeset
|
853 |
text {* |
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
parents:
2470
diff
changeset
|
854 |
This definition is used for unquotient types, where |
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
parents:
2470
diff
changeset
|
855 |
alpha-equivalence does not coincide with equality. |
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
parents:
2470
diff
changeset
|
856 |
*} |
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
parents:
2470
diff
changeset
|
857 |
|
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
parents:
2470
diff
changeset
|
858 |
definition |
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
parents:
2470
diff
changeset
|
859 |
"supp_rel R x = {a. infinite {b. \<not>(R ((a \<rightleftharpoons> b) \<bullet> x) x)}}" |
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
parents:
2470
diff
changeset
|
860 |
|
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
parents:
2470
diff
changeset
|
861 |
|
486d4647bb37
supp-proofs work except for CoreHaskell and Modules (induct is probably not finding the correct instance)
Christian Urban <urbanc@in.tum.de>
parents:
2470
diff
changeset
|
862 |
|
1062 | 863 |
section {* Finitely-supported types *} |
864 |
||
865 |
class fs = pt + |
|
866 |
assumes finite_supp: "finite (supp x)" |
|
867 |
||
868 |
lemma pure_supp: |
|
869 |
shows "supp (x::'a::pure) = {}" |
|
870 |
unfolding supp_def by (simp add: permute_pure) |
|
871 |
||
872 |
lemma pure_fresh: |
|
873 |
fixes x::"'a::pure" |
|
874 |
shows "a \<sharp> x" |
|
875 |
unfolding fresh_def by (simp add: pure_supp) |
|
876 |
||
877 |
instance pure < fs |
|
878 |
by default (simp add: pure_supp) |
|
879 |
||
880 |
||
881 |
subsection {* Type @{typ atom} is finitely-supported. *} |
|
882 |
||
883 |
lemma supp_atom: |
|
884 |
shows "supp a = {a}" |
|
885 |
apply (rule finite_supp_unique) |
|
886 |
apply (clarsimp simp add: supports_def) |
|
887 |
apply simp |
|
888 |
apply simp |
|
889 |
done |
|
890 |
||
891 |
lemma fresh_atom: |
|
892 |
shows "a \<sharp> b \<longleftrightarrow> a \<noteq> b" |
|
893 |
unfolding fresh_def supp_atom by simp |
|
894 |
||
895 |
instance atom :: fs |
|
896 |
by default (simp add: supp_atom) |
|
897 |
||
1933
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1932
diff
changeset
|
898 |
section {* Support for finite sets of atoms *} |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1932
diff
changeset
|
899 |
|
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
900 |
|
1933
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1932
diff
changeset
|
901 |
lemma supp_finite_atom_set: |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1932
diff
changeset
|
902 |
fixes S::"atom set" |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1932
diff
changeset
|
903 |
assumes "finite S" |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1932
diff
changeset
|
904 |
shows "supp S = S" |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1932
diff
changeset
|
905 |
apply(rule finite_supp_unique) |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1932
diff
changeset
|
906 |
apply(simp add: supports_def) |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1932
diff
changeset
|
907 |
apply(simp add: swap_set_not_in) |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1932
diff
changeset
|
908 |
apply(rule assms) |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1932
diff
changeset
|
909 |
apply(simp add: swap_set_in) |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1932
diff
changeset
|
910 |
done |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1932
diff
changeset
|
911 |
|
1062 | 912 |
section {* Type @{typ perm} is finitely-supported. *} |
913 |
||
914 |
lemma perm_swap_eq: |
|
915 |
shows "(a \<rightleftharpoons> b) \<bullet> p = p \<longleftrightarrow> (p \<bullet> (a \<rightleftharpoons> b)) = (a \<rightleftharpoons> b)" |
|
916 |
unfolding permute_perm_def |
|
917 |
by (metis add_diff_cancel minus_perm_def) |
|
918 |
||
919 |
lemma supports_perm: |
|
920 |
shows "{a. p \<bullet> a \<noteq> a} supports p" |
|
921 |
unfolding supports_def |
|
1879 | 922 |
unfolding perm_swap_eq |
923 |
by (simp add: swap_eqvt) |
|
1062 | 924 |
|
925 |
lemma finite_perm_lemma: |
|
926 |
shows "finite {a::atom. p \<bullet> a \<noteq> a}" |
|
927 |
using finite_Rep_perm [of p] |
|
928 |
unfolding permute_atom_def . |
|
929 |
||
930 |
lemma supp_perm: |
|
931 |
shows "supp p = {a. p \<bullet> a \<noteq> a}" |
|
932 |
apply (rule finite_supp_unique) |
|
933 |
apply (rule supports_perm) |
|
934 |
apply (rule finite_perm_lemma) |
|
935 |
apply (simp add: perm_swap_eq swap_eqvt) |
|
936 |
apply (auto simp add: expand_perm_eq swap_atom) |
|
937 |
done |
|
938 |
||
939 |
lemma fresh_perm: |
|
940 |
shows "a \<sharp> p \<longleftrightarrow> p \<bullet> a = a" |
|
1879 | 941 |
unfolding fresh_def |
942 |
by (simp add: supp_perm) |
|
1062 | 943 |
|
944 |
lemma supp_swap: |
|
945 |
shows "supp (a \<rightleftharpoons> b) = (if a = b \<or> sort_of a \<noteq> sort_of b then {} else {a, b})" |
|
946 |
by (auto simp add: supp_perm swap_atom) |
|
947 |
||
948 |
lemma fresh_zero_perm: |
|
949 |
shows "a \<sharp> (0::perm)" |
|
950 |
unfolding fresh_perm by simp |
|
951 |
||
952 |
lemma supp_zero_perm: |
|
953 |
shows "supp (0::perm) = {}" |
|
954 |
unfolding supp_perm by simp |
|
955 |
||
1087
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
956 |
lemma fresh_plus_perm: |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
957 |
fixes p q::perm |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
958 |
assumes "a \<sharp> p" "a \<sharp> q" |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
959 |
shows "a \<sharp> (p + q)" |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
960 |
using assms |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
961 |
unfolding fresh_def |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
962 |
by (auto simp add: supp_perm) |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
963 |
|
1062 | 964 |
lemma supp_plus_perm: |
965 |
fixes p q::perm |
|
966 |
shows "supp (p + q) \<subseteq> supp p \<union> supp q" |
|
967 |
by (auto simp add: supp_perm) |
|
968 |
||
1087
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
969 |
lemma fresh_minus_perm: |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
970 |
fixes p::perm |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
971 |
shows "a \<sharp> (- p) \<longleftrightarrow> a \<sharp> p" |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
972 |
unfolding fresh_def |
1879 | 973 |
unfolding supp_perm |
974 |
apply(simp) |
|
975 |
apply(metis permute_minus_cancel) |
|
1087
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
976 |
done |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
977 |
|
1062 | 978 |
lemma supp_minus_perm: |
979 |
fixes p::perm |
|
980 |
shows "supp (- p) = supp p" |
|
1087
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
981 |
unfolding supp_conv_fresh |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
982 |
by (simp add: fresh_minus_perm) |
1062 | 983 |
|
984 |
instance perm :: fs |
|
985 |
by default (simp add: supp_perm finite_perm_lemma) |
|
986 |
||
1305
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
987 |
lemma plus_perm_eq: |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
988 |
fixes p q::"perm" |
1879 | 989 |
assumes asm: "supp p \<inter> supp q = {}" |
1305
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
990 |
shows "p + q = q + p" |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
991 |
unfolding expand_perm_eq |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
992 |
proof |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
993 |
fix a::"atom" |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
994 |
show "(p + q) \<bullet> a = (q + p) \<bullet> a" |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
995 |
proof - |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
996 |
{ assume "a \<notin> supp p" "a \<notin> supp q" |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
997 |
then have "(p + q) \<bullet> a = (q + p) \<bullet> a" |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
998 |
by (simp add: supp_perm) |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
999 |
} |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1000 |
moreover |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1001 |
{ assume a: "a \<in> supp p" "a \<notin> supp q" |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1002 |
then have "p \<bullet> a \<in> supp p" by (simp add: supp_perm) |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1003 |
then have "p \<bullet> a \<notin> supp q" using asm by auto |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1004 |
with a have "(p + q) \<bullet> a = (q + p) \<bullet> a" |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1005 |
by (simp add: supp_perm) |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1006 |
} |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1007 |
moreover |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1008 |
{ assume a: "a \<notin> supp p" "a \<in> supp q" |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1009 |
then have "q \<bullet> a \<in> supp q" by (simp add: supp_perm) |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1010 |
then have "q \<bullet> a \<notin> supp p" using asm by auto |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1011 |
with a have "(p + q) \<bullet> a = (q + p) \<bullet> a" |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1012 |
by (simp add: supp_perm) |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1013 |
} |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1014 |
ultimately show "(p + q) \<bullet> a = (q + p) \<bullet> a" |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1015 |
using asm by blast |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1016 |
qed |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1017 |
qed |
1062 | 1018 |
|
1019 |
section {* Finite Support instances for other types *} |
|
1020 |
||
1021 |
subsection {* Type @{typ "'a \<times> 'b"} is finitely-supported. *} |
|
1022 |
||
1023 |
lemma supp_Pair: |
|
1024 |
shows "supp (x, y) = supp x \<union> supp y" |
|
1025 |
by (simp add: supp_def Collect_imp_eq Collect_neg_eq) |
|
1026 |
||
1027 |
lemma fresh_Pair: |
|
1028 |
shows "a \<sharp> (x, y) \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> y" |
|
1029 |
by (simp add: fresh_def supp_Pair) |
|
1030 |
||
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1031 |
lemma supp_Unit: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1032 |
shows "supp () = {}" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1033 |
by (simp add: supp_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1034 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1035 |
lemma fresh_Unit: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1036 |
shows "a \<sharp> ()" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1037 |
by (simp add: fresh_def supp_Unit) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1038 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1039 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1040 |
|
2378
2f13fe48c877
updated to new Isabelle; made FSet more "quiet"
Christian Urban <urbanc@in.tum.de>
parents:
2310
diff
changeset
|
1041 |
instance prod :: (fs, fs) fs |
1062 | 1042 |
apply default |
1043 |
apply (induct_tac x) |
|
1044 |
apply (simp add: supp_Pair finite_supp) |
|
1045 |
done |
|
1046 |
||
1047 |
subsection {* Type @{typ "'a + 'b"} is finitely supported *} |
|
1048 |
||
1049 |
lemma supp_Inl: |
|
1050 |
shows "supp (Inl x) = supp x" |
|
1051 |
by (simp add: supp_def) |
|
1052 |
||
1053 |
lemma supp_Inr: |
|
1054 |
shows "supp (Inr x) = supp x" |
|
1055 |
by (simp add: supp_def) |
|
1056 |
||
1057 |
lemma fresh_Inl: |
|
1058 |
shows "a \<sharp> Inl x \<longleftrightarrow> a \<sharp> x" |
|
1059 |
by (simp add: fresh_def supp_Inl) |
|
1060 |
||
1061 |
lemma fresh_Inr: |
|
1062 |
shows "a \<sharp> Inr y \<longleftrightarrow> a \<sharp> y" |
|
1063 |
by (simp add: fresh_def supp_Inr) |
|
1064 |
||
2378
2f13fe48c877
updated to new Isabelle; made FSet more "quiet"
Christian Urban <urbanc@in.tum.de>
parents:
2310
diff
changeset
|
1065 |
instance sum :: (fs, fs) fs |
1062 | 1066 |
apply default |
1067 |
apply (induct_tac x) |
|
1068 |
apply (simp_all add: supp_Inl supp_Inr finite_supp) |
|
1069 |
done |
|
1070 |
||
1071 |
subsection {* Type @{typ "'a option"} is finitely supported *} |
|
1072 |
||
1073 |
lemma supp_None: |
|
1074 |
shows "supp None = {}" |
|
1075 |
by (simp add: supp_def) |
|
1076 |
||
1077 |
lemma supp_Some: |
|
1078 |
shows "supp (Some x) = supp x" |
|
1079 |
by (simp add: supp_def) |
|
1080 |
||
1081 |
lemma fresh_None: |
|
1082 |
shows "a \<sharp> None" |
|
1083 |
by (simp add: fresh_def supp_None) |
|
1084 |
||
1085 |
lemma fresh_Some: |
|
1086 |
shows "a \<sharp> Some x \<longleftrightarrow> a \<sharp> x" |
|
1087 |
by (simp add: fresh_def supp_Some) |
|
1088 |
||
1089 |
instance option :: (fs) fs |
|
1090 |
apply default |
|
1091 |
apply (induct_tac x) |
|
1092 |
apply (simp_all add: supp_None supp_Some finite_supp) |
|
1093 |
done |
|
1094 |
||
1095 |
subsubsection {* Type @{typ "'a list"} is finitely supported *} |
|
1096 |
||
1097 |
lemma supp_Nil: |
|
1098 |
shows "supp [] = {}" |
|
1099 |
by (simp add: supp_def) |
|
1100 |
||
1101 |
lemma supp_Cons: |
|
1102 |
shows "supp (x # xs) = supp x \<union> supp xs" |
|
1103 |
by (simp add: supp_def Collect_imp_eq Collect_neg_eq) |
|
1104 |
||
1105 |
lemma fresh_Nil: |
|
1106 |
shows "a \<sharp> []" |
|
1107 |
by (simp add: fresh_def supp_Nil) |
|
1108 |
||
1109 |
lemma fresh_Cons: |
|
1110 |
shows "a \<sharp> (x # xs) \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> xs" |
|
1111 |
by (simp add: fresh_def supp_Cons) |
|
1112 |
||
1113 |
instance list :: (fs) fs |
|
1114 |
apply default |
|
1115 |
apply (induct_tac x) |
|
1116 |
apply (simp_all add: supp_Nil supp_Cons finite_supp) |
|
1117 |
done |
|
1118 |
||
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1119 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1120 |
section {* Support and Freshness for Applications *} |
1062 | 1121 |
|
1879 | 1122 |
lemma fresh_conv_MOST: |
1123 |
shows "a \<sharp> x \<longleftrightarrow> (MOST b. (a \<rightleftharpoons> b) \<bullet> x = x)" |
|
1124 |
unfolding fresh_def supp_def |
|
1125 |
unfolding MOST_iff_cofinite by simp |
|
1126 |
||
2003
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
1127 |
lemma supp_subset_fresh: |
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
1128 |
assumes a: "\<And>a. a \<sharp> x \<Longrightarrow> a \<sharp> y" |
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
1129 |
shows "supp y \<subseteq> supp x" |
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
1130 |
using a |
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
1131 |
unfolding fresh_def |
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
1132 |
by blast |
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
1133 |
|
1879 | 1134 |
lemma fresh_fun_app: |
1135 |
assumes "a \<sharp> f" and "a \<sharp> x" |
|
1136 |
shows "a \<sharp> f x" |
|
2003
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
1137 |
using assms |
1879 | 1138 |
unfolding fresh_conv_MOST |
1139 |
unfolding permute_fun_app_eq |
|
1140 |
by (elim MOST_rev_mp, simp) |
|
1141 |
||
1062 | 1142 |
lemma supp_fun_app: |
1143 |
shows "supp (f x) \<subseteq> (supp f) \<union> (supp x)" |
|
1879 | 1144 |
using fresh_fun_app |
1145 |
unfolding fresh_def |
|
1146 |
by auto |
|
1147 |
||
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1148 |
text {* Support of Equivariant Functions *} |
2003
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
1149 |
|
1941 | 1150 |
lemma supp_fun_eqvt: |
2003
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
1151 |
assumes a: "\<And>p. p \<bullet> f = f" |
1941 | 1152 |
shows "supp f = {}" |
1153 |
unfolding supp_def |
|
1154 |
using a by simp |
|
1155 |
||
1062 | 1156 |
lemma fresh_fun_eqvt_app: |
2003
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
1157 |
assumes a: "\<And>p. p \<bullet> f = f" |
1062 | 1158 |
shows "a \<sharp> x \<Longrightarrow> a \<sharp> f x" |
1159 |
proof - |
|
1941 | 1160 |
from a have "supp f = {}" by (simp add: supp_fun_eqvt) |
1879 | 1161 |
then show "a \<sharp> x \<Longrightarrow> a \<sharp> f x" |
1062 | 1162 |
unfolding fresh_def |
2003
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
1163 |
using supp_fun_app by auto |
1062 | 1164 |
qed |
1165 |
||
1962
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1166 |
|
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1167 |
section {* Support of Finite Sets of Finitely Supported Elements *} |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1168 |
|
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1169 |
lemma Union_fresh: |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1170 |
shows "a \<sharp> S \<Longrightarrow> a \<sharp> (\<Union>x \<in> S. supp x)" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1171 |
unfolding Union_image_eq[symmetric] |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1172 |
apply(rule_tac f="\<lambda>S. \<Union> supp ` S" in fresh_fun_eqvt_app) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1173 |
apply(simp add: permute_fun_def UNION_def Collect_def Bex_def ex_eqvt mem_def conj_eqvt) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1174 |
apply(subst permute_fun_app_eq) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1175 |
back |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1176 |
apply(simp add: supp_eqvt) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1177 |
apply(assumption) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1178 |
done |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1179 |
|
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1180 |
lemma Union_supports_set: |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1181 |
shows "(\<Union>x \<in> S. supp x) supports S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1182 |
proof - |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1183 |
{ fix a b |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1184 |
have "\<forall>x \<in> S. (a \<rightleftharpoons> b) \<bullet> x = x \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> S = S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1185 |
unfolding permute_set_eq by force |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1186 |
} |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1187 |
then show "(\<Union>x \<in> S. supp x) supports S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1188 |
unfolding supports_def |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1189 |
by (simp add: fresh_def[symmetric] swap_fresh_fresh) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1190 |
qed |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1191 |
|
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1192 |
lemma Union_of_fin_supp_sets: |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1193 |
fixes S::"('a::fs set)" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1194 |
assumes fin: "finite S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1195 |
shows "finite (\<Union>x\<in>S. supp x)" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1196 |
using fin by (induct) (auto simp add: finite_supp) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1197 |
|
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1198 |
lemma Union_included_in_supp: |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1199 |
fixes S::"('a::fs set)" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1200 |
assumes fin: "finite S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1201 |
shows "(\<Union>x\<in>S. supp x) \<subseteq> supp S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1202 |
proof - |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1203 |
have "(\<Union>x\<in>S. supp x) = supp (\<Union>x\<in>S. supp x)" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1204 |
by (rule supp_finite_atom_set[symmetric]) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1205 |
(rule Union_of_fin_supp_sets[OF fin]) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1206 |
also have "\<dots> \<subseteq> supp S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1207 |
by (rule supp_subset_fresh) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1208 |
(simp add: Union_fresh) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1209 |
finally show "(\<Union>x\<in>S. supp x) \<subseteq> supp S" . |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1210 |
qed |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1211 |
|
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1212 |
lemma supp_of_fin_sets: |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1213 |
fixes S::"('a::fs set)" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1214 |
assumes fin: "finite S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1215 |
shows "(supp S) = (\<Union>x\<in>S. supp x)" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1216 |
apply(rule subset_antisym) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1217 |
apply(rule supp_is_subset) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1218 |
apply(rule Union_supports_set) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1219 |
apply(rule Union_of_fin_supp_sets[OF fin]) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1220 |
apply(rule Union_included_in_supp[OF fin]) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1221 |
done |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1222 |
|
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1223 |
lemma supp_of_fin_union: |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1224 |
fixes S T::"('a::fs) set" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1225 |
assumes fin1: "finite S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1226 |
and fin2: "finite T" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1227 |
shows "supp (S \<union> T) = supp S \<union> supp T" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1228 |
using fin1 fin2 |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1229 |
by (simp add: supp_of_fin_sets) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1230 |
|
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1231 |
lemma supp_of_fin_insert: |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1232 |
fixes S::"('a::fs) set" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1233 |
assumes fin: "finite S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1234 |
shows "supp (insert x S) = supp x \<union> supp S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1235 |
using fin |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1236 |
by (simp add: supp_of_fin_sets) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1237 |
|
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1238 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1239 |
section {* Fresh-Star *} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1240 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1241 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1242 |
text {* The fresh-star generalisation of fresh is used in strong |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1243 |
induction principles. *} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1244 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1245 |
definition |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1246 |
fresh_star :: "atom set \<Rightarrow> 'a::pt \<Rightarrow> bool" ("_ \<sharp>* _" [80,80] 80) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1247 |
where |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1248 |
"as \<sharp>* x \<equiv> \<forall>a \<in> as. a \<sharp> x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1249 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1250 |
lemma fresh_star_prod: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1251 |
fixes as::"atom set" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1252 |
shows "as \<sharp>* (x, y) = (as \<sharp>* x \<and> as \<sharp>* y)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1253 |
by (auto simp add: fresh_star_def fresh_Pair) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1254 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1255 |
lemma fresh_star_union: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1256 |
shows "(as \<union> bs) \<sharp>* x = (as \<sharp>* x \<and> bs \<sharp>* x)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1257 |
by (auto simp add: fresh_star_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1258 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1259 |
lemma fresh_star_insert: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1260 |
shows "(insert a as) \<sharp>* x = (a \<sharp> x \<and> as \<sharp>* x)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1261 |
by (auto simp add: fresh_star_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1262 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1263 |
lemma fresh_star_Un_elim: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1264 |
"((as \<union> bs) \<sharp>* x \<Longrightarrow> PROP C) \<equiv> (as \<sharp>* x \<Longrightarrow> bs \<sharp>* x \<Longrightarrow> PROP C)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1265 |
unfolding fresh_star_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1266 |
apply(rule) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1267 |
apply(erule meta_mp) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1268 |
apply(auto) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1269 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1270 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1271 |
lemma fresh_star_insert_elim: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1272 |
"(insert a as \<sharp>* x \<Longrightarrow> PROP C) \<equiv> (a \<sharp> x \<Longrightarrow> as \<sharp>* x \<Longrightarrow> PROP C)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1273 |
unfolding fresh_star_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1274 |
by rule (simp_all add: fresh_star_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1275 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1276 |
lemma fresh_star_empty_elim: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1277 |
"({} \<sharp>* x \<Longrightarrow> PROP C) \<equiv> PROP C" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1278 |
by (simp add: fresh_star_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1279 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1280 |
lemma fresh_star_unit_elim: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1281 |
shows "(a \<sharp>* () \<Longrightarrow> PROP C) \<equiv> PROP C" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1282 |
by (simp add: fresh_star_def fresh_Unit) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1283 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1284 |
lemma fresh_star_prod_elim: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1285 |
shows "(a \<sharp>* (x, y) \<Longrightarrow> PROP C) \<equiv> (a \<sharp>* x \<Longrightarrow> a \<sharp>* y \<Longrightarrow> PROP C)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1286 |
by (rule, simp_all add: fresh_star_prod) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1287 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1288 |
lemma fresh_star_zero: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1289 |
shows "as \<sharp>* (0::perm)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1290 |
unfolding fresh_star_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1291 |
by (simp add: fresh_zero_perm) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1292 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1293 |
lemma fresh_star_plus: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1294 |
fixes p q::perm |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1295 |
shows "\<lbrakk>a \<sharp>* p; a \<sharp>* q\<rbrakk> \<Longrightarrow> a \<sharp>* (p + q)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1296 |
unfolding fresh_star_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1297 |
by (simp add: fresh_plus_perm) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1298 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1299 |
lemma fresh_star_permute_iff: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1300 |
shows "(p \<bullet> a) \<sharp>* (p \<bullet> x) \<longleftrightarrow> a \<sharp>* x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1301 |
unfolding fresh_star_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1302 |
by (metis mem_permute_iff permute_minus_cancel(1) fresh_permute_iff) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1303 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1304 |
lemma fresh_star_eqvt: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1305 |
shows "(p \<bullet> (as \<sharp>* x)) = (p \<bullet> as) \<sharp>* (p \<bullet> x)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1306 |
unfolding fresh_star_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1307 |
unfolding Ball_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1308 |
apply(simp add: all_eqvt) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1309 |
apply(subst permute_fun_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1310 |
apply(simp add: imp_eqvt fresh_eqvt mem_eqvt) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1311 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1312 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1313 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1314 |
section {* Induction principle for permutations *} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1315 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1316 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1317 |
lemma perm_struct_induct[consumes 1, case_names zero swap]: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1318 |
assumes S: "supp p \<subseteq> S" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1319 |
and zero: "P 0" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1320 |
and swap: "\<And>p a b. \<lbrakk>P p; supp p \<subseteq> S; a \<in> S; b \<in> S; a \<noteq> b; sort_of a = sort_of b\<rbrakk> \<Longrightarrow> P ((a \<rightleftharpoons> b) + p)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1321 |
shows "P p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1322 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1323 |
have "finite (supp p)" by (simp add: finite_supp) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1324 |
then show "P p" using S |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1325 |
proof(induct A\<equiv>"supp p" arbitrary: p rule: finite_psubset_induct) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1326 |
case (psubset p) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1327 |
then have ih: "\<And>q. supp q \<subset> supp p \<Longrightarrow> P q" by auto |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1328 |
have as: "supp p \<subseteq> S" by fact |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1329 |
{ assume "supp p = {}" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1330 |
then have "p = 0" by (simp add: supp_perm expand_perm_eq) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1331 |
then have "P p" using zero by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1332 |
} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1333 |
moreover |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1334 |
{ assume "supp p \<noteq> {}" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1335 |
then obtain a where a0: "a \<in> supp p" by blast |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1336 |
then have a1: "p \<bullet> a \<in> S" "a \<in> S" "sort_of (p \<bullet> a) = sort_of a" "p \<bullet> a \<noteq> a" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1337 |
using as by (auto simp add: supp_atom supp_perm swap_atom) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1338 |
let ?q = "(p \<bullet> a \<rightleftharpoons> a) + p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1339 |
have a2: "supp ?q \<subseteq> supp p" unfolding supp_perm by (auto simp add: swap_atom) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1340 |
moreover |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1341 |
have "a \<notin> supp ?q" by (simp add: supp_perm) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1342 |
then have "supp ?q \<noteq> supp p" using a0 by auto |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1343 |
ultimately have "supp ?q \<subset> supp p" using a2 by auto |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1344 |
then have "P ?q" using ih by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1345 |
moreover |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1346 |
have "supp ?q \<subseteq> S" using as a2 by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1347 |
ultimately have "P ((p \<bullet> a \<rightleftharpoons> a) + ?q)" using as a1 swap by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1348 |
moreover |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1349 |
have "p = (p \<bullet> a \<rightleftharpoons> a) + ?q" by (simp add: expand_perm_eq) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1350 |
ultimately have "P p" by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1351 |
} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1352 |
ultimately show "P p" by blast |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1353 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1354 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1355 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1356 |
lemma perm_simple_struct_induct[case_names zero swap]: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1357 |
assumes zero: "P 0" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1358 |
and swap: "\<And>p a b. \<lbrakk>P p; a \<noteq> b; sort_of a = sort_of b\<rbrakk> \<Longrightarrow> P ((a \<rightleftharpoons> b) + p)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1359 |
shows "P p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1360 |
by (rule_tac S="supp p" in perm_struct_induct) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1361 |
(auto intro: zero swap) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1362 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1363 |
lemma perm_subset_induct[consumes 1, case_names zero swap plus]: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1364 |
assumes S: "supp p \<subseteq> S" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1365 |
assumes zero: "P 0" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1366 |
assumes swap: "\<And>a b. \<lbrakk>sort_of a = sort_of b; a \<noteq> b; a \<in> S; b \<in> S\<rbrakk> \<Longrightarrow> P (a \<rightleftharpoons> b)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1367 |
assumes plus: "\<And>p1 p2. \<lbrakk>P p1; P p2; supp p1 \<subseteq> S; supp p2 \<subseteq> S\<rbrakk> \<Longrightarrow> P (p1 + p2)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1368 |
shows "P p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1369 |
using S |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1370 |
by (induct p rule: perm_struct_induct) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1371 |
(auto intro: zero plus swap simp add: supp_swap) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1372 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1373 |
lemma supp_perm_eq: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1374 |
assumes "(supp x) \<sharp>* p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1375 |
shows "p \<bullet> x = x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1376 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1377 |
from assms have "supp p \<subseteq> {a. a \<sharp> x}" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1378 |
unfolding supp_perm fresh_star_def fresh_def by auto |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1379 |
then show "p \<bullet> x = x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1380 |
proof (induct p rule: perm_struct_induct) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1381 |
case zero |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1382 |
show "0 \<bullet> x = x" by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1383 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1384 |
case (swap p a b) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1385 |
then have "a \<sharp> x" "b \<sharp> x" "p \<bullet> x = x" by simp_all |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1386 |
then show "((a \<rightleftharpoons> b) + p) \<bullet> x = x" by (simp add: swap_fresh_fresh) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1387 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1388 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1389 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1390 |
lemma supp_perm_eq_test: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1391 |
assumes "(supp x) \<sharp>* p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1392 |
shows "p \<bullet> x = x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1393 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1394 |
from assms have "supp p \<subseteq> {a. a \<sharp> x}" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1395 |
unfolding supp_perm fresh_star_def fresh_def by auto |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1396 |
then show "p \<bullet> x = x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1397 |
proof (induct p rule: perm_subset_induct) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1398 |
case zero |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1399 |
show "0 \<bullet> x = x" by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1400 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1401 |
case (swap a b) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1402 |
then have "a \<sharp> x" "b \<sharp> x" by simp_all |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1403 |
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by (simp add: swap_fresh_fresh) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1404 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1405 |
case (plus p1 p2) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1406 |
have "p1 \<bullet> x = x" "p2 \<bullet> x = x" by fact+ |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1407 |
then show "(p1 + p2) \<bullet> x = x" by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1408 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1409 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1410 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1411 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1412 |
section {* Avoiding of atom sets *} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1413 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1414 |
text {* |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1415 |
For every set of atoms, there is another set of atoms |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1416 |
avoiding a finitely supported c and there is a permutation |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1417 |
which 'translates' between both sets. |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1418 |
*} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1419 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1420 |
lemma at_set_avoiding_aux: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1421 |
fixes Xs::"atom set" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1422 |
and As::"atom set" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1423 |
assumes b: "Xs \<subseteq> As" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1424 |
and c: "finite As" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1425 |
shows "\<exists>p. (p \<bullet> Xs) \<inter> As = {} \<and> (supp p) \<subseteq> (Xs \<union> (p \<bullet> Xs))" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1426 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1427 |
from b c have "finite Xs" by (rule finite_subset) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1428 |
then show ?thesis using b |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1429 |
proof (induct rule: finite_subset_induct) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1430 |
case empty |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1431 |
have "0 \<bullet> {} \<inter> As = {}" by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1432 |
moreover |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1433 |
have "supp (0::perm) \<subseteq> {} \<union> 0 \<bullet> {}" by (simp add: supp_zero_perm) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1434 |
ultimately show ?case by blast |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1435 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1436 |
case (insert x Xs) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1437 |
then obtain p where |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1438 |
p1: "(p \<bullet> Xs) \<inter> As = {}" and |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1439 |
p2: "supp p \<subseteq> (Xs \<union> (p \<bullet> Xs))" by blast |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1440 |
from `x \<in> As` p1 have "x \<notin> p \<bullet> Xs" by fast |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1441 |
with `x \<notin> Xs` p2 have "x \<notin> supp p" by fast |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1442 |
hence px: "p \<bullet> x = x" unfolding supp_perm by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1443 |
have "finite (As \<union> p \<bullet> Xs)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1444 |
using `finite As` `finite Xs` |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1445 |
by (simp add: permute_set_eq_image) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1446 |
then obtain y where "y \<notin> (As \<union> p \<bullet> Xs)" "sort_of y = sort_of x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1447 |
by (rule obtain_atom) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1448 |
hence y: "y \<notin> As" "y \<notin> p \<bullet> Xs" "sort_of y = sort_of x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1449 |
by simp_all |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1450 |
let ?q = "(x \<rightleftharpoons> y) + p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1451 |
have q: "?q \<bullet> insert x Xs = insert y (p \<bullet> Xs)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1452 |
unfolding insert_eqvt |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1453 |
using `p \<bullet> x = x` `sort_of y = sort_of x` |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1454 |
using `x \<notin> p \<bullet> Xs` `y \<notin> p \<bullet> Xs` |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1455 |
by (simp add: swap_atom swap_set_not_in) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1456 |
have "?q \<bullet> insert x Xs \<inter> As = {}" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1457 |
using `y \<notin> As` `p \<bullet> Xs \<inter> As = {}` |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1458 |
unfolding q by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1459 |
moreover |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1460 |
have "supp ?q \<subseteq> insert x Xs \<union> ?q \<bullet> insert x Xs" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1461 |
using p2 unfolding q |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1462 |
by (intro subset_trans [OF supp_plus_perm]) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1463 |
(auto simp add: supp_swap) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1464 |
ultimately show ?case by blast |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1465 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1466 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1467 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1468 |
lemma at_set_avoiding: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1469 |
assumes a: "finite Xs" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1470 |
and b: "finite (supp c)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1471 |
obtains p::"perm" where "(p \<bullet> Xs)\<sharp>*c" and "(supp p) \<subseteq> (Xs \<union> (p \<bullet> Xs))" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1472 |
using a b at_set_avoiding_aux [where Xs="Xs" and As="Xs \<union> supp c"] |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1473 |
unfolding fresh_star_def fresh_def by blast |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1474 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1475 |
lemma at_set_avoiding2: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1476 |
assumes "finite xs" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1477 |
and "finite (supp c)" "finite (supp x)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1478 |
and "xs \<sharp>* x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1479 |
shows "\<exists>p. (p \<bullet> xs) \<sharp>* c \<and> supp x \<sharp>* p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1480 |
using assms |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1481 |
apply(erule_tac c="(c, x)" in at_set_avoiding) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1482 |
apply(simp add: supp_Pair) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1483 |
apply(rule_tac x="p" in exI) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1484 |
apply(simp add: fresh_star_prod) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1485 |
apply(subgoal_tac "\<forall>a \<in> supp p. a \<sharp> x") |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1486 |
apply(auto simp add: fresh_star_def fresh_def supp_perm)[1] |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1487 |
apply(auto simp add: fresh_star_def fresh_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1488 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1489 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1490 |
lemma at_set_avoiding2_atom: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1491 |
assumes "finite (supp c)" "finite (supp x)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1492 |
and b: "a \<sharp> x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1493 |
shows "\<exists>p. (p \<bullet> a) \<sharp> c \<and> supp x \<sharp>* p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1494 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1495 |
have a: "{a} \<sharp>* x" unfolding fresh_star_def by (simp add: b) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1496 |
obtain p where p1: "(p \<bullet> {a}) \<sharp>* c" and p2: "supp x \<sharp>* p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1497 |
using at_set_avoiding2[of "{a}" "c" "x"] assms a by blast |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1498 |
have c: "(p \<bullet> a) \<sharp> c" using p1 |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1499 |
unfolding fresh_star_def Ball_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1500 |
by(erule_tac x="p \<bullet> a" in allE) (simp add: permute_set_eq) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1501 |
hence "p \<bullet> a \<sharp> c \<and> supp x \<sharp>* p" using p2 by blast |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1502 |
then show "\<exists>p. (p \<bullet> a) \<sharp> c \<and> supp x \<sharp>* p" by blast |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1503 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1504 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1505 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1506 |
section {* Concrete Atoms Types *} |
1962
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1507 |
|
1972 | 1508 |
text {* |
1509 |
Class @{text at_base} allows types containing multiple sorts of atoms. |
|
1510 |
Class @{text at} only allows types with a single sort. |
|
1511 |
*} |
|
1512 |
||
1962
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1513 |
class at_base = pt + |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1514 |
fixes atom :: "'a \<Rightarrow> atom" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1515 |
assumes atom_eq_iff [simp]: "atom a = atom b \<longleftrightarrow> a = b" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1516 |
assumes atom_eqvt: "p \<bullet> (atom a) = atom (p \<bullet> a)" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1517 |
|
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1518 |
class at = at_base + |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1519 |
assumes sort_of_atom_eq [simp]: "sort_of (atom a) = sort_of (atom b)" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1520 |
|
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1521 |
lemma supp_at_base: |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1522 |
fixes a::"'a::at_base" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1523 |
shows "supp a = {atom a}" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1524 |
by (simp add: supp_atom [symmetric] supp_def atom_eqvt) |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1525 |
|
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1526 |
lemma fresh_at_base: |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1527 |
shows "a \<sharp> b \<longleftrightarrow> a \<noteq> atom b" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1528 |
unfolding fresh_def by (simp add: supp_at_base) |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1529 |
|
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1530 |
instance at_base < fs |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1531 |
proof qed (simp add: supp_at_base) |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1532 |
|
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1533 |
lemma at_base_infinite [simp]: |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1534 |
shows "infinite (UNIV :: 'a::at_base set)" (is "infinite ?U") |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1535 |
proof |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1536 |
obtain a :: 'a where "True" by auto |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1537 |
assume "finite ?U" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1538 |
hence "finite (atom ` ?U)" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1539 |
by (rule finite_imageI) |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1540 |
then obtain b where b: "b \<notin> atom ` ?U" "sort_of b = sort_of (atom a)" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1541 |
by (rule obtain_atom) |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1542 |
from b(2) have "b = atom ((atom a \<rightleftharpoons> b) \<bullet> a)" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1543 |
unfolding atom_eqvt [symmetric] |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1544 |
by (simp add: swap_atom) |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1545 |
hence "b \<in> atom ` ?U" by simp |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1546 |
with b(1) show "False" by simp |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1547 |
qed |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1548 |
|
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1549 |
lemma swap_at_base_simps [simp]: |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1550 |
fixes x y::"'a::at_base" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1551 |
shows "sort_of (atom x) = sort_of (atom y) \<Longrightarrow> (atom x \<rightleftharpoons> atom y) \<bullet> x = y" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1552 |
and "sort_of (atom x) = sort_of (atom y) \<Longrightarrow> (atom x \<rightleftharpoons> atom y) \<bullet> y = x" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1553 |
and "atom x \<noteq> a \<Longrightarrow> atom x \<noteq> b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> x = x" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1554 |
unfolding atom_eq_iff [symmetric] |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1555 |
unfolding atom_eqvt [symmetric] |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1556 |
by simp_all |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1557 |
|
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1558 |
lemma obtain_at_base: |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1559 |
assumes X: "finite X" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1560 |
obtains a::"'a::at_base" where "atom a \<notin> X" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1561 |
proof - |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1562 |
have "inj (atom :: 'a \<Rightarrow> atom)" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1563 |
by (simp add: inj_on_def) |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1564 |
with X have "finite (atom -` X :: 'a set)" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1565 |
by (rule finite_vimageI) |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1566 |
with at_base_infinite have "atom -` X \<noteq> (UNIV :: 'a set)" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1567 |
by auto |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1568 |
then obtain a :: 'a where "atom a \<notin> X" |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1569 |
by auto |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1570 |
thus ?thesis .. |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1571 |
qed |
84a13d1e2511
moved mk_atom into the library; that meant that concrete atom classes need to be in Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1941
diff
changeset
|
1572 |
|
1973
fc5ce7f22b74
use the more general type-class at_base
Christian Urban <urbanc@in.tum.de>
parents:
1972
diff
changeset
|
1573 |
lemma supp_finite_set_at_base: |
1971
8daf6ff5e11a
simpliied and moved the remaining lemmas about the atom-function to Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1962
diff
changeset
|
1574 |
assumes a: "finite S" |
8daf6ff5e11a
simpliied and moved the remaining lemmas about the atom-function to Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1962
diff
changeset
|
1575 |
shows "supp S = atom ` S" |
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1576 |
apply(simp add: supp_of_fin_sets[OF a]) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1577 |
apply(simp add: supp_at_base) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1578 |
apply(auto) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1579 |
done |
1971
8daf6ff5e11a
simpliied and moved the remaining lemmas about the atom-function to Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1962
diff
changeset
|
1580 |
|
2467
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1581 |
section {* Infrastructure for concrete atom types *} |
1971
8daf6ff5e11a
simpliied and moved the remaining lemmas about the atom-function to Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1962
diff
changeset
|
1582 |
|
2467
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1583 |
section {* A swapping operation for concrete atoms *} |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1584 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1585 |
definition |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1586 |
flip :: "'a::at_base \<Rightarrow> 'a \<Rightarrow> perm" ("'(_ \<leftrightarrow> _')") |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1587 |
where |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1588 |
"(a \<leftrightarrow> b) = (atom a \<rightleftharpoons> atom b)" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1589 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1590 |
lemma flip_self [simp]: "(a \<leftrightarrow> a) = 0" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1591 |
unfolding flip_def by (rule swap_self) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1592 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1593 |
lemma flip_commute: "(a \<leftrightarrow> b) = (b \<leftrightarrow> a)" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1594 |
unfolding flip_def by (rule swap_commute) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1595 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1596 |
lemma minus_flip [simp]: "- (a \<leftrightarrow> b) = (a \<leftrightarrow> b)" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1597 |
unfolding flip_def by (rule minus_swap) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1598 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1599 |
lemma add_flip_cancel: "(a \<leftrightarrow> b) + (a \<leftrightarrow> b) = 0" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1600 |
unfolding flip_def by (rule swap_cancel) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1601 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1602 |
lemma permute_flip_cancel [simp]: "(a \<leftrightarrow> b) \<bullet> (a \<leftrightarrow> b) \<bullet> x = x" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1603 |
unfolding permute_plus [symmetric] add_flip_cancel by simp |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1604 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1605 |
lemma permute_flip_cancel2 [simp]: "(a \<leftrightarrow> b) \<bullet> (b \<leftrightarrow> a) \<bullet> x = x" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1606 |
by (simp add: flip_commute) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1607 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1608 |
lemma flip_eqvt: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1609 |
fixes a b c::"'a::at_base" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1610 |
shows "p \<bullet> (a \<leftrightarrow> b) = (p \<bullet> a \<leftrightarrow> p \<bullet> b)" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1611 |
unfolding flip_def |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1612 |
by (simp add: swap_eqvt atom_eqvt) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1613 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1614 |
lemma flip_at_base_simps [simp]: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1615 |
shows "sort_of (atom a) = sort_of (atom b) \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> a = b" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1616 |
and "sort_of (atom a) = sort_of (atom b) \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> b = a" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1617 |
and "\<lbrakk>a \<noteq> c; b \<noteq> c\<rbrakk> \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> c = c" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1618 |
and "sort_of (atom a) \<noteq> sort_of (atom b) \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> x = x" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1619 |
unfolding flip_def |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1620 |
unfolding atom_eq_iff [symmetric] |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1621 |
unfolding atom_eqvt [symmetric] |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1622 |
by simp_all |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1623 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1624 |
text {* the following two lemmas do not hold for at_base, |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1625 |
only for single sort atoms from at *} |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1626 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1627 |
lemma permute_flip_at: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1628 |
fixes a b c::"'a::at" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1629 |
shows "(a \<leftrightarrow> b) \<bullet> c = (if c = a then b else if c = b then a else c)" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1630 |
unfolding flip_def |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1631 |
apply (rule atom_eq_iff [THEN iffD1]) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1632 |
apply (subst atom_eqvt [symmetric]) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1633 |
apply (simp add: swap_atom) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1634 |
done |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1635 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1636 |
lemma flip_at_simps [simp]: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1637 |
fixes a b::"'a::at" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1638 |
shows "(a \<leftrightarrow> b) \<bullet> a = b" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1639 |
and "(a \<leftrightarrow> b) \<bullet> b = a" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1640 |
unfolding permute_flip_at by simp_all |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1641 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1642 |
lemma flip_fresh_fresh: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1643 |
fixes a b::"'a::at_base" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1644 |
assumes "atom a \<sharp> x" "atom b \<sharp> x" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1645 |
shows "(a \<leftrightarrow> b) \<bullet> x = x" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1646 |
using assms |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1647 |
by (simp add: flip_def swap_fresh_fresh) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1648 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1649 |
subsection {* Syntax for coercing at-elements to the atom-type *} |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1650 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1651 |
syntax |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1652 |
"_atom_constrain" :: "logic \<Rightarrow> type \<Rightarrow> logic" ("_:::_" [4, 0] 3) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1653 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1654 |
translations |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1655 |
"_atom_constrain a t" => "CONST atom (_constrain a t)" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1656 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1657 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1658 |
subsection {* A lemma for proving instances of class @{text at}. *} |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1659 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1660 |
setup {* Sign.add_const_constraint (@{const_name "permute"}, NONE) *} |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1661 |
setup {* Sign.add_const_constraint (@{const_name "atom"}, NONE) *} |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1662 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1663 |
text {* |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1664 |
New atom types are defined as subtypes of @{typ atom}. |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1665 |
*} |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1666 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1667 |
lemma exists_eq_simple_sort: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1668 |
shows "\<exists>a. a \<in> {a. sort_of a = s}" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1669 |
by (rule_tac x="Atom s 0" in exI, simp) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1670 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1671 |
lemma exists_eq_sort: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1672 |
shows "\<exists>a. a \<in> {a. sort_of a \<in> range sort_fun}" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1673 |
by (rule_tac x="Atom (sort_fun x) y" in exI, simp) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1674 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1675 |
lemma at_base_class: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1676 |
fixes sort_fun :: "'b \<Rightarrow>atom_sort" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1677 |
fixes Rep :: "'a \<Rightarrow> atom" and Abs :: "atom \<Rightarrow> 'a" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1678 |
assumes type: "type_definition Rep Abs {a. sort_of a \<in> range sort_fun}" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1679 |
assumes atom_def: "\<And>a. atom a = Rep a" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1680 |
assumes permute_def: "\<And>p a. p \<bullet> a = Abs (p \<bullet> Rep a)" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1681 |
shows "OFCLASS('a, at_base_class)" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1682 |
proof |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1683 |
interpret type_definition Rep Abs "{a. sort_of a \<in> range sort_fun}" by (rule type) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1684 |
have sort_of_Rep: "\<And>a. sort_of (Rep a) \<in> range sort_fun" using Rep by simp |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1685 |
fix a b :: 'a and p p1 p2 :: perm |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1686 |
show "0 \<bullet> a = a" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1687 |
unfolding permute_def by (simp add: Rep_inverse) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1688 |
show "(p1 + p2) \<bullet> a = p1 \<bullet> p2 \<bullet> a" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1689 |
unfolding permute_def by (simp add: Abs_inverse sort_of_Rep) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1690 |
show "atom a = atom b \<longleftrightarrow> a = b" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1691 |
unfolding atom_def by (simp add: Rep_inject) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1692 |
show "p \<bullet> atom a = atom (p \<bullet> a)" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1693 |
unfolding permute_def atom_def by (simp add: Abs_inverse sort_of_Rep) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1694 |
qed |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1695 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1696 |
(* |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1697 |
lemma at_class: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1698 |
fixes s :: atom_sort |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1699 |
fixes Rep :: "'a \<Rightarrow> atom" and Abs :: "atom \<Rightarrow> 'a" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1700 |
assumes type: "type_definition Rep Abs {a. sort_of a \<in> range (\<lambda>x::unit. s)}" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1701 |
assumes atom_def: "\<And>a. atom a = Rep a" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1702 |
assumes permute_def: "\<And>p a. p \<bullet> a = Abs (p \<bullet> Rep a)" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1703 |
shows "OFCLASS('a, at_class)" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1704 |
proof |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1705 |
interpret type_definition Rep Abs "{a. sort_of a \<in> range (\<lambda>x::unit. s)}" by (rule type) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1706 |
have sort_of_Rep: "\<And>a. sort_of (Rep a) = s" using Rep by (simp add: image_def) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1707 |
fix a b :: 'a and p p1 p2 :: perm |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1708 |
show "0 \<bullet> a = a" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1709 |
unfolding permute_def by (simp add: Rep_inverse) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1710 |
show "(p1 + p2) \<bullet> a = p1 \<bullet> p2 \<bullet> a" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1711 |
unfolding permute_def by (simp add: Abs_inverse sort_of_Rep) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1712 |
show "sort_of (atom a) = sort_of (atom b)" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1713 |
unfolding atom_def by (simp add: sort_of_Rep) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1714 |
show "atom a = atom b \<longleftrightarrow> a = b" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1715 |
unfolding atom_def by (simp add: Rep_inject) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1716 |
show "p \<bullet> atom a = atom (p \<bullet> a)" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1717 |
unfolding permute_def atom_def by (simp add: Abs_inverse sort_of_Rep) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1718 |
qed |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1719 |
*) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1720 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1721 |
lemma at_class: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1722 |
fixes s :: atom_sort |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1723 |
fixes Rep :: "'a \<Rightarrow> atom" and Abs :: "atom \<Rightarrow> 'a" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1724 |
assumes type: "type_definition Rep Abs {a. sort_of a = s}" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1725 |
assumes atom_def: "\<And>a. atom a = Rep a" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1726 |
assumes permute_def: "\<And>p a. p \<bullet> a = Abs (p \<bullet> Rep a)" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1727 |
shows "OFCLASS('a, at_class)" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1728 |
proof |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1729 |
interpret type_definition Rep Abs "{a. sort_of a = s}" by (rule type) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1730 |
have sort_of_Rep: "\<And>a. sort_of (Rep a) = s" using Rep by (simp add: image_def) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1731 |
fix a b :: 'a and p p1 p2 :: perm |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1732 |
show "0 \<bullet> a = a" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1733 |
unfolding permute_def by (simp add: Rep_inverse) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1734 |
show "(p1 + p2) \<bullet> a = p1 \<bullet> p2 \<bullet> a" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1735 |
unfolding permute_def by (simp add: Abs_inverse sort_of_Rep) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1736 |
show "sort_of (atom a) = sort_of (atom b)" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1737 |
unfolding atom_def by (simp add: sort_of_Rep) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1738 |
show "atom a = atom b \<longleftrightarrow> a = b" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1739 |
unfolding atom_def by (simp add: Rep_inject) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1740 |
show "p \<bullet> atom a = atom (p \<bullet> a)" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1741 |
unfolding permute_def atom_def by (simp add: Abs_inverse sort_of_Rep) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1742 |
qed |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1743 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1744 |
setup {* Sign.add_const_constraint |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1745 |
(@{const_name "permute"}, SOME @{typ "perm \<Rightarrow> 'a::pt \<Rightarrow> 'a"}) *} |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1746 |
setup {* Sign.add_const_constraint |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1747 |
(@{const_name "atom"}, SOME @{typ "'a::at_base \<Rightarrow> atom"}) *} |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1748 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1749 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1750 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1751 |
section {* The freshness lemma according to Andy Pitts *} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1752 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1753 |
lemma freshness_lemma: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1754 |
fixes h :: "'a::at \<Rightarrow> 'b::pt" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1755 |
assumes a: "\<exists>a. atom a \<sharp> (h, h a)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1756 |
shows "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1757 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1758 |
from a obtain b where a1: "atom b \<sharp> h" and a2: "atom b \<sharp> h b" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1759 |
by (auto simp add: fresh_Pair) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1760 |
show "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1761 |
proof (intro exI allI impI) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1762 |
fix a :: 'a |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1763 |
assume a3: "atom a \<sharp> h" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1764 |
show "h a = h b" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1765 |
proof (cases "a = b") |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1766 |
assume "a = b" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1767 |
thus "h a = h b" by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1768 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1769 |
assume "a \<noteq> b" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1770 |
hence "atom a \<sharp> b" by (simp add: fresh_at_base) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1771 |
with a3 have "atom a \<sharp> h b" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1772 |
by (rule fresh_fun_app) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1773 |
with a2 have d1: "(atom b \<rightleftharpoons> atom a) \<bullet> (h b) = (h b)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1774 |
by (rule swap_fresh_fresh) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1775 |
from a1 a3 have d2: "(atom b \<rightleftharpoons> atom a) \<bullet> h = h" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1776 |
by (rule swap_fresh_fresh) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1777 |
from d1 have "h b = (atom b \<rightleftharpoons> atom a) \<bullet> (h b)" by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1778 |
also have "\<dots> = ((atom b \<rightleftharpoons> atom a) \<bullet> h) ((atom b \<rightleftharpoons> atom a) \<bullet> b)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1779 |
by (rule permute_fun_app_eq) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1780 |
also have "\<dots> = h a" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1781 |
using d2 by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1782 |
finally show "h a = h b" by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1783 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1784 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1785 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1786 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1787 |
lemma freshness_lemma_unique: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1788 |
fixes h :: "'a::at \<Rightarrow> 'b::pt" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1789 |
assumes a: "\<exists>a. atom a \<sharp> (h, h a)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1790 |
shows "\<exists>!x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1791 |
proof (rule ex_ex1I) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1792 |
from a show "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1793 |
by (rule freshness_lemma) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1794 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1795 |
fix x y |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1796 |
assume x: "\<forall>a. atom a \<sharp> h \<longrightarrow> h a = x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1797 |
assume y: "\<forall>a. atom a \<sharp> h \<longrightarrow> h a = y" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1798 |
from a x y show "x = y" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1799 |
by (auto simp add: fresh_Pair) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1800 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1801 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1802 |
text {* packaging the freshness lemma into a function *} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1803 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1804 |
definition |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1805 |
fresh_fun :: "('a::at \<Rightarrow> 'b::pt) \<Rightarrow> 'b" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1806 |
where |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1807 |
"fresh_fun h = (THE x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1808 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1809 |
lemma fresh_fun_apply: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1810 |
fixes h :: "'a::at \<Rightarrow> 'b::pt" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1811 |
assumes a: "\<exists>a. atom a \<sharp> (h, h a)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1812 |
assumes b: "atom a \<sharp> h" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1813 |
shows "fresh_fun h = h a" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1814 |
unfolding fresh_fun_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1815 |
proof (rule the_equality) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1816 |
show "\<forall>a'. atom a' \<sharp> h \<longrightarrow> h a' = h a" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1817 |
proof (intro strip) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1818 |
fix a':: 'a |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1819 |
assume c: "atom a' \<sharp> h" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1820 |
from a have "\<exists>x. \<forall>a. atom a \<sharp> h \<longrightarrow> h a = x" by (rule freshness_lemma) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1821 |
with b c show "h a' = h a" by auto |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1822 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1823 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1824 |
fix fr :: 'b |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1825 |
assume "\<forall>a. atom a \<sharp> h \<longrightarrow> h a = fr" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1826 |
with b show "fr = h a" by auto |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1827 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1828 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1829 |
lemma fresh_fun_apply': |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1830 |
fixes h :: "'a::at \<Rightarrow> 'b::pt" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1831 |
assumes a: "atom a \<sharp> h" "atom a \<sharp> h a" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1832 |
shows "fresh_fun h = h a" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1833 |
apply (rule fresh_fun_apply) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1834 |
apply (auto simp add: fresh_Pair intro: a) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1835 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1836 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1837 |
lemma fresh_fun_eqvt: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1838 |
fixes h :: "'a::at \<Rightarrow> 'b::pt" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1839 |
assumes a: "\<exists>a. atom a \<sharp> (h, h a)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1840 |
shows "p \<bullet> (fresh_fun h) = fresh_fun (p \<bullet> h)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1841 |
using a |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1842 |
apply (clarsimp simp add: fresh_Pair) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1843 |
apply (subst fresh_fun_apply', assumption+) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1844 |
apply (drule fresh_permute_iff [where p=p, THEN iffD2]) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1845 |
apply (drule fresh_permute_iff [where p=p, THEN iffD2]) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1846 |
apply (simp add: atom_eqvt permute_fun_app_eq [where f=h]) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1847 |
apply (erule (1) fresh_fun_apply' [symmetric]) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1848 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1849 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1850 |
lemma fresh_fun_supports: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1851 |
fixes h :: "'a::at \<Rightarrow> 'b::pt" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1852 |
assumes a: "\<exists>a. atom a \<sharp> (h, h a)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1853 |
shows "(supp h) supports (fresh_fun h)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1854 |
apply (simp add: supports_def fresh_def [symmetric]) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1855 |
apply (simp add: fresh_fun_eqvt [OF a] swap_fresh_fresh) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1856 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1857 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1858 |
notation fresh_fun (binder "FRESH " 10) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1859 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1860 |
lemma FRESH_f_iff: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1861 |
fixes P :: "'a::at \<Rightarrow> 'b::pure" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1862 |
fixes f :: "'b \<Rightarrow> 'c::pure" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1863 |
assumes P: "finite (supp P)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1864 |
shows "(FRESH x. f (P x)) = f (FRESH x. P x)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1865 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1866 |
obtain a::'a where "atom a \<notin> supp P" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1867 |
using P by (rule obtain_at_base) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1868 |
hence "atom a \<sharp> P" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1869 |
by (simp add: fresh_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1870 |
show "(FRESH x. f (P x)) = f (FRESH x. P x)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1871 |
apply (subst fresh_fun_apply' [where a=a, OF _ pure_fresh]) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1872 |
apply (cut_tac `atom a \<sharp> P`) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1873 |
apply (simp add: fresh_conv_MOST) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1874 |
apply (elim MOST_rev_mp, rule MOST_I, clarify) |
2479
a9b6a00b1ba0
updated to Isabelle Sept 16
Christian Urban <urbanc@in.tum.de>
parents:
2475
diff
changeset
|
1875 |
apply (simp add: permute_fun_def permute_pure fun_eq_iff) |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1876 |
apply (subst fresh_fun_apply' [where a=a, OF `atom a \<sharp> P` pure_fresh]) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1877 |
apply (rule refl) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1878 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1879 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1880 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1881 |
lemma FRESH_binop_iff: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1882 |
fixes P :: "'a::at \<Rightarrow> 'b::pure" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1883 |
fixes Q :: "'a::at \<Rightarrow> 'c::pure" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1884 |
fixes binop :: "'b \<Rightarrow> 'c \<Rightarrow> 'd::pure" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1885 |
assumes P: "finite (supp P)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1886 |
and Q: "finite (supp Q)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1887 |
shows "(FRESH x. binop (P x) (Q x)) = binop (FRESH x. P x) (FRESH x. Q x)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1888 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1889 |
from assms have "finite (supp P \<union> supp Q)" by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1890 |
then obtain a::'a where "atom a \<notin> (supp P \<union> supp Q)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1891 |
by (rule obtain_at_base) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1892 |
hence "atom a \<sharp> P" and "atom a \<sharp> Q" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1893 |
by (simp_all add: fresh_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1894 |
show ?thesis |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1895 |
apply (subst fresh_fun_apply' [where a=a, OF _ pure_fresh]) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1896 |
apply (cut_tac `atom a \<sharp> P` `atom a \<sharp> Q`) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1897 |
apply (simp add: fresh_conv_MOST) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1898 |
apply (elim MOST_rev_mp, rule MOST_I, clarify) |
2479
a9b6a00b1ba0
updated to Isabelle Sept 16
Christian Urban <urbanc@in.tum.de>
parents:
2475
diff
changeset
|
1899 |
apply (simp add: permute_fun_def permute_pure fun_eq_iff) |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1900 |
apply (subst fresh_fun_apply' [where a=a, OF `atom a \<sharp> P` pure_fresh]) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1901 |
apply (subst fresh_fun_apply' [where a=a, OF `atom a \<sharp> Q` pure_fresh]) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1902 |
apply (rule refl) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1903 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1904 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1905 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1906 |
lemma FRESH_conj_iff: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1907 |
fixes P Q :: "'a::at \<Rightarrow> bool" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1908 |
assumes P: "finite (supp P)" and Q: "finite (supp Q)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1909 |
shows "(FRESH x. P x \<and> Q x) \<longleftrightarrow> (FRESH x. P x) \<and> (FRESH x. Q x)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1910 |
using P Q by (rule FRESH_binop_iff) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1911 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1912 |
lemma FRESH_disj_iff: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1913 |
fixes P Q :: "'a::at \<Rightarrow> bool" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1914 |
assumes P: "finite (supp P)" and Q: "finite (supp Q)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1915 |
shows "(FRESH x. P x \<or> Q x) \<longleftrightarrow> (FRESH x. P x) \<or> (FRESH x. Q x)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1916 |
using P Q by (rule FRESH_binop_iff) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1917 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1918 |
|
2467
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1919 |
section {* Library functions for the nominal infrastructure *} |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1920 |
|
1833
2050b5723c04
added a library for basic nominal functions; separated nominal_eqvt file
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
1921 |
use "nominal_library.ML" |
2050b5723c04
added a library for basic nominal functions; separated nominal_eqvt file
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
1922 |
|
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1923 |
|
2467
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1924 |
section {* Automation for creating concrete atom types *} |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1925 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1926 |
text {* at the moment only single-sort concrete atoms are supported *} |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1927 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1928 |
use "nominal_atoms.ML" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1929 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1930 |
|
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1931 |
|
1062 | 1932 |
end |