author | Christian Urban <urbanc@in.tum.de> |
Thu, 06 Jan 2011 13:28:04 +0000 | |
changeset 2641 | 592d17e26e09 |
parent 2635 | 64b4cb2c2bf8 |
child 2657 | 1ea9c059fc0f |
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 |
|
2635
64b4cb2c2bf8
simple cases for string rule inductions
Christian Urban <urbanc@in.tum.de>
parents:
2632
diff
changeset
|
8 |
imports Main |
64b4cb2c2bf8
simple cases for string rule inductions
Christian Urban <urbanc@in.tum.de>
parents:
2632
diff
changeset
|
9 |
"~~/src/HOL/Library/Infinite_Set" |
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
10 |
"~~/src/HOL/Quotient_Examples/FSet" |
1833
2050b5723c04
added a library for basic nominal functions; separated nominal_eqvt file
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
11 |
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
|
12 |
("nominal_atoms.ML") |
1062 | 13 |
begin |
14 |
||
15 |
section {* Atoms and Sorts *} |
|
16 |
||
17 |
text {* A simple implementation for atom_sorts is strings. *} |
|
18 |
(* types atom_sort = string *) |
|
19 |
||
20 |
text {* To deal with Church-like binding we use trees of |
|
21 |
strings as sorts. *} |
|
22 |
||
23 |
datatype atom_sort = Sort "string" "atom_sort list" |
|
24 |
||
25 |
datatype atom = Atom atom_sort nat |
|
26 |
||
27 |
||
28 |
text {* Basic projection function. *} |
|
29 |
||
30 |
primrec |
|
31 |
sort_of :: "atom \<Rightarrow> atom_sort" |
|
32 |
where |
|
33 |
"sort_of (Atom s i) = s" |
|
34 |
||
1930
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
35 |
primrec |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
36 |
nat_of :: "atom \<Rightarrow> nat" |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
37 |
where |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
38 |
"nat_of (Atom s n) = n" |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
39 |
|
1062 | 40 |
|
41 |
text {* There are infinitely many atoms of each sort. *} |
|
42 |
lemma INFM_sort_of_eq: |
|
43 |
shows "INFM a. sort_of a = s" |
|
44 |
proof - |
|
45 |
have "INFM i. sort_of (Atom s i) = s" by simp |
|
46 |
moreover have "inj (Atom s)" by (simp add: inj_on_def) |
|
47 |
ultimately show "INFM a. sort_of a = s" by (rule INFM_inj) |
|
48 |
qed |
|
49 |
||
50 |
lemma infinite_sort_of_eq: |
|
51 |
shows "infinite {a. sort_of a = s}" |
|
52 |
using INFM_sort_of_eq unfolding INFM_iff_infinite . |
|
53 |
||
54 |
lemma atom_infinite [simp]: |
|
55 |
shows "infinite (UNIV :: atom set)" |
|
56 |
using subset_UNIV infinite_sort_of_eq |
|
57 |
by (rule infinite_super) |
|
58 |
||
59 |
lemma obtain_atom: |
|
60 |
fixes X :: "atom set" |
|
61 |
assumes X: "finite X" |
|
62 |
obtains a where "a \<notin> X" "sort_of a = s" |
|
63 |
proof - |
|
64 |
from X have "MOST a. a \<notin> X" |
|
65 |
unfolding MOST_iff_cofinite by simp |
|
66 |
with INFM_sort_of_eq |
|
67 |
have "INFM a. sort_of a = s \<and> a \<notin> X" |
|
68 |
by (rule INFM_conjI) |
|
69 |
then obtain a where "a \<notin> X" "sort_of a = s" |
|
70 |
by (auto elim: INFM_E) |
|
71 |
then show ?thesis .. |
|
72 |
qed |
|
73 |
||
1930
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
74 |
lemma atom_components_eq_iff: |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
75 |
fixes a b :: atom |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
76 |
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
|
77 |
by (induct a, induct b, simp) |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
78 |
|
1062 | 79 |
section {* Sort-Respecting Permutations *} |
80 |
||
81 |
typedef perm = |
|
82 |
"{f. bij f \<and> finite {a. f a \<noteq> a} \<and> (\<forall>a. sort_of (f a) = sort_of a)}" |
|
83 |
proof |
|
84 |
show "id \<in> ?perm" by simp |
|
85 |
qed |
|
86 |
||
87 |
lemma permI: |
|
88 |
assumes "bij f" and "MOST x. f x = x" and "\<And>a. sort_of (f a) = sort_of a" |
|
89 |
shows "f \<in> perm" |
|
90 |
using assms unfolding perm_def MOST_iff_cofinite by simp |
|
91 |
||
92 |
lemma perm_is_bij: "f \<in> perm \<Longrightarrow> bij f" |
|
93 |
unfolding perm_def by simp |
|
94 |
||
95 |
lemma perm_is_finite: "f \<in> perm \<Longrightarrow> finite {a. f a \<noteq> a}" |
|
96 |
unfolding perm_def by simp |
|
97 |
||
98 |
lemma perm_is_sort_respecting: "f \<in> perm \<Longrightarrow> sort_of (f a) = sort_of a" |
|
99 |
unfolding perm_def by simp |
|
100 |
||
101 |
lemma perm_MOST: "f \<in> perm \<Longrightarrow> MOST x. f x = x" |
|
102 |
unfolding perm_def MOST_iff_cofinite by simp |
|
103 |
||
104 |
lemma perm_id: "id \<in> perm" |
|
105 |
unfolding perm_def by simp |
|
106 |
||
107 |
lemma perm_comp: |
|
108 |
assumes f: "f \<in> perm" and g: "g \<in> perm" |
|
109 |
shows "(f \<circ> g) \<in> perm" |
|
110 |
apply (rule permI) |
|
111 |
apply (rule bij_comp) |
|
112 |
apply (rule perm_is_bij [OF g]) |
|
113 |
apply (rule perm_is_bij [OF f]) |
|
114 |
apply (rule MOST_rev_mp [OF perm_MOST [OF g]]) |
|
115 |
apply (rule MOST_rev_mp [OF perm_MOST [OF f]]) |
|
116 |
apply (simp) |
|
117 |
apply (simp add: perm_is_sort_respecting [OF f]) |
|
118 |
apply (simp add: perm_is_sort_respecting [OF g]) |
|
119 |
done |
|
120 |
||
121 |
lemma perm_inv: |
|
122 |
assumes f: "f \<in> perm" |
|
123 |
shows "(inv f) \<in> perm" |
|
124 |
apply (rule permI) |
|
125 |
apply (rule bij_imp_bij_inv) |
|
126 |
apply (rule perm_is_bij [OF f]) |
|
127 |
apply (rule MOST_mono [OF perm_MOST [OF f]]) |
|
128 |
apply (erule subst, rule inv_f_f) |
|
129 |
apply (rule bij_is_inj [OF perm_is_bij [OF f]]) |
|
130 |
apply (rule perm_is_sort_respecting [OF f, THEN sym, THEN trans]) |
|
131 |
apply (simp add: surj_f_inv_f [OF bij_is_surj [OF perm_is_bij [OF f]]]) |
|
132 |
done |
|
133 |
||
134 |
lemma bij_Rep_perm: "bij (Rep_perm p)" |
|
135 |
using Rep_perm [of p] unfolding perm_def by simp |
|
136 |
||
137 |
lemma finite_Rep_perm: "finite {a. Rep_perm p a \<noteq> a}" |
|
138 |
using Rep_perm [of p] unfolding perm_def by simp |
|
139 |
||
140 |
lemma sort_of_Rep_perm: "sort_of (Rep_perm p a) = sort_of a" |
|
141 |
using Rep_perm [of p] unfolding perm_def by simp |
|
142 |
||
143 |
lemma Rep_perm_ext: |
|
144 |
"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
|
145 |
by (simp add: fun_eq_iff Rep_perm_inject [symmetric]) |
1062 | 146 |
|
2560
82e37a4595c7
automated permute_bn functions (raw ones first)
Christian Urban <urbanc@in.tum.de>
parents:
2507
diff
changeset
|
147 |
instance perm :: size .. |
1062 | 148 |
|
149 |
subsection {* Permutations form a group *} |
|
150 |
||
151 |
instantiation perm :: group_add |
|
152 |
begin |
|
153 |
||
154 |
definition |
|
155 |
"0 = Abs_perm id" |
|
156 |
||
157 |
definition |
|
158 |
"- p = Abs_perm (inv (Rep_perm p))" |
|
159 |
||
160 |
definition |
|
161 |
"p + q = Abs_perm (Rep_perm p \<circ> Rep_perm q)" |
|
162 |
||
163 |
definition |
|
164 |
"(p1::perm) - p2 = p1 + - p2" |
|
165 |
||
166 |
lemma Rep_perm_0: "Rep_perm 0 = id" |
|
167 |
unfolding zero_perm_def |
|
168 |
by (simp add: Abs_perm_inverse perm_id) |
|
169 |
||
170 |
lemma Rep_perm_add: |
|
171 |
"Rep_perm (p1 + p2) = Rep_perm p1 \<circ> Rep_perm p2" |
|
172 |
unfolding plus_perm_def |
|
173 |
by (simp add: Abs_perm_inverse perm_comp Rep_perm) |
|
174 |
||
175 |
lemma Rep_perm_uminus: |
|
176 |
"Rep_perm (- p) = inv (Rep_perm p)" |
|
177 |
unfolding uminus_perm_def |
|
178 |
by (simp add: Abs_perm_inverse perm_inv Rep_perm) |
|
179 |
||
180 |
instance |
|
181 |
apply default |
|
182 |
unfolding Rep_perm_inject [symmetric] |
|
183 |
unfolding minus_perm_def |
|
184 |
unfolding Rep_perm_add |
|
185 |
unfolding Rep_perm_uminus |
|
186 |
unfolding Rep_perm_0 |
|
187 |
by (simp_all add: o_assoc inv_o_cancel [OF bij_is_inj [OF bij_Rep_perm]]) |
|
188 |
||
189 |
end |
|
190 |
||
191 |
||
192 |
section {* Implementation of swappings *} |
|
193 |
||
194 |
definition |
|
195 |
swap :: "atom \<Rightarrow> atom \<Rightarrow> perm" ("'(_ \<rightleftharpoons> _')") |
|
196 |
where |
|
197 |
"(a \<rightleftharpoons> b) = |
|
198 |
Abs_perm (if sort_of a = sort_of b |
|
199 |
then (\<lambda>c. if a = c then b else if b = c then a else c) |
|
200 |
else id)" |
|
201 |
||
202 |
lemma Rep_perm_swap: |
|
203 |
"Rep_perm (a \<rightleftharpoons> b) = |
|
204 |
(if sort_of a = sort_of b |
|
205 |
then (\<lambda>c. if a = c then b else if b = c then a else c) |
|
206 |
else id)" |
|
207 |
unfolding swap_def |
|
208 |
apply (rule Abs_perm_inverse) |
|
209 |
apply (rule permI) |
|
210 |
apply (auto simp add: bij_def inj_on_def surj_def)[1] |
|
211 |
apply (rule MOST_rev_mp [OF MOST_neq(1) [of a]]) |
|
212 |
apply (rule MOST_rev_mp [OF MOST_neq(1) [of b]]) |
|
213 |
apply (simp) |
|
214 |
apply (simp) |
|
215 |
done |
|
216 |
||
217 |
lemmas Rep_perm_simps = |
|
218 |
Rep_perm_0 |
|
219 |
Rep_perm_add |
|
220 |
Rep_perm_uminus |
|
221 |
Rep_perm_swap |
|
222 |
||
223 |
lemma swap_different_sorts [simp]: |
|
224 |
"sort_of a \<noteq> sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) = 0" |
|
225 |
by (rule Rep_perm_ext) (simp add: Rep_perm_simps) |
|
226 |
||
227 |
lemma swap_cancel: |
|
228 |
"(a \<rightleftharpoons> b) + (a \<rightleftharpoons> b) = 0" |
|
1879 | 229 |
by (rule Rep_perm_ext) |
2479
a9b6a00b1ba0
updated to Isabelle Sept 16
Christian Urban <urbanc@in.tum.de>
parents:
2475
diff
changeset
|
230 |
(simp add: Rep_perm_simps fun_eq_iff) |
1062 | 231 |
|
232 |
lemma swap_self [simp]: |
|
233 |
"(a \<rightleftharpoons> a) = 0" |
|
2479
a9b6a00b1ba0
updated to Isabelle Sept 16
Christian Urban <urbanc@in.tum.de>
parents:
2475
diff
changeset
|
234 |
by (rule Rep_perm_ext, simp add: Rep_perm_simps fun_eq_iff) |
1062 | 235 |
|
236 |
lemma minus_swap [simp]: |
|
237 |
"- (a \<rightleftharpoons> b) = (a \<rightleftharpoons> b)" |
|
238 |
by (rule minus_unique [OF swap_cancel]) |
|
239 |
||
240 |
lemma swap_commute: |
|
241 |
"(a \<rightleftharpoons> b) = (b \<rightleftharpoons> a)" |
|
242 |
by (rule Rep_perm_ext) |
|
2479
a9b6a00b1ba0
updated to Isabelle Sept 16
Christian Urban <urbanc@in.tum.de>
parents:
2475
diff
changeset
|
243 |
(simp add: Rep_perm_swap fun_eq_iff) |
1062 | 244 |
|
245 |
lemma swap_triple: |
|
246 |
assumes "a \<noteq> b" and "c \<noteq> b" |
|
247 |
assumes "sort_of a = sort_of b" "sort_of b = sort_of c" |
|
248 |
shows "(a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c) = (a \<rightleftharpoons> b)" |
|
249 |
using assms |
|
250 |
by (rule_tac Rep_perm_ext) |
|
2479
a9b6a00b1ba0
updated to Isabelle Sept 16
Christian Urban <urbanc@in.tum.de>
parents:
2475
diff
changeset
|
251 |
(auto simp add: Rep_perm_simps fun_eq_iff) |
1062 | 252 |
|
253 |
||
254 |
section {* Permutation Types *} |
|
255 |
||
256 |
text {* |
|
257 |
Infix syntax for @{text permute} has higher precedence than |
|
258 |
addition, but lower than unary minus. |
|
259 |
*} |
|
260 |
||
261 |
class pt = |
|
262 |
fixes permute :: "perm \<Rightarrow> 'a \<Rightarrow> 'a" ("_ \<bullet> _" [76, 75] 75) |
|
263 |
assumes permute_zero [simp]: "0 \<bullet> x = x" |
|
264 |
assumes permute_plus [simp]: "(p + q) \<bullet> x = p \<bullet> (q \<bullet> x)" |
|
265 |
begin |
|
266 |
||
267 |
lemma permute_diff [simp]: |
|
268 |
shows "(p - q) \<bullet> x = p \<bullet> - q \<bullet> x" |
|
269 |
unfolding diff_minus by simp |
|
270 |
||
271 |
lemma permute_minus_cancel [simp]: |
|
272 |
shows "p \<bullet> - p \<bullet> x = x" |
|
273 |
and "- p \<bullet> p \<bullet> x = x" |
|
274 |
unfolding permute_plus [symmetric] by simp_all |
|
275 |
||
276 |
lemma permute_swap_cancel [simp]: |
|
277 |
shows "(a \<rightleftharpoons> b) \<bullet> (a \<rightleftharpoons> b) \<bullet> x = x" |
|
278 |
unfolding permute_plus [symmetric] |
|
279 |
by (simp add: swap_cancel) |
|
280 |
||
281 |
lemma permute_swap_cancel2 [simp]: |
|
282 |
shows "(a \<rightleftharpoons> b) \<bullet> (b \<rightleftharpoons> a) \<bullet> x = x" |
|
283 |
unfolding permute_plus [symmetric] |
|
284 |
by (simp add: swap_commute) |
|
285 |
||
286 |
lemma inj_permute [simp]: |
|
287 |
shows "inj (permute p)" |
|
288 |
by (rule inj_on_inverseI) |
|
289 |
(rule permute_minus_cancel) |
|
290 |
||
291 |
lemma surj_permute [simp]: |
|
292 |
shows "surj (permute p)" |
|
293 |
by (rule surjI, rule permute_minus_cancel) |
|
294 |
||
295 |
lemma bij_permute [simp]: |
|
296 |
shows "bij (permute p)" |
|
297 |
by (rule bijI [OF inj_permute surj_permute]) |
|
298 |
||
299 |
lemma inv_permute: |
|
300 |
shows "inv (permute p) = permute (- p)" |
|
301 |
by (rule inv_equality) (simp_all) |
|
302 |
||
303 |
lemma permute_minus: |
|
304 |
shows "permute (- p) = inv (permute p)" |
|
305 |
by (simp add: inv_permute) |
|
306 |
||
307 |
lemma permute_eq_iff [simp]: |
|
308 |
shows "p \<bullet> x = p \<bullet> y \<longleftrightarrow> x = y" |
|
309 |
by (rule inj_permute [THEN inj_eq]) |
|
310 |
||
311 |
end |
|
312 |
||
313 |
subsection {* Permutations for atoms *} |
|
314 |
||
315 |
instantiation atom :: pt |
|
316 |
begin |
|
317 |
||
318 |
definition |
|
1879 | 319 |
"p \<bullet> a = (Rep_perm p) a" |
1062 | 320 |
|
321 |
instance |
|
322 |
apply(default) |
|
323 |
apply(simp_all add: permute_atom_def Rep_perm_simps) |
|
324 |
done |
|
325 |
||
326 |
end |
|
327 |
||
328 |
lemma sort_of_permute [simp]: |
|
329 |
shows "sort_of (p \<bullet> a) = sort_of a" |
|
330 |
unfolding permute_atom_def by (rule sort_of_Rep_perm) |
|
331 |
||
332 |
lemma swap_atom: |
|
333 |
shows "(a \<rightleftharpoons> b) \<bullet> c = |
|
334 |
(if sort_of a = sort_of b |
|
335 |
then (if c = a then b else if c = b then a else c) else c)" |
|
336 |
unfolding permute_atom_def |
|
337 |
by (simp add: Rep_perm_swap) |
|
338 |
||
339 |
lemma swap_atom_simps [simp]: |
|
340 |
"sort_of a = sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> a = b" |
|
341 |
"sort_of a = sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> b = a" |
|
342 |
"c \<noteq> a \<Longrightarrow> c \<noteq> b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> c = c" |
|
343 |
unfolding swap_atom by simp_all |
|
344 |
||
345 |
lemma expand_perm_eq: |
|
346 |
fixes p q :: "perm" |
|
347 |
shows "p = q \<longleftrightarrow> (\<forall>a::atom. p \<bullet> a = q \<bullet> a)" |
|
348 |
unfolding permute_atom_def |
|
349 |
by (metis Rep_perm_ext ext) |
|
350 |
||
351 |
||
352 |
subsection {* Permutations for permutations *} |
|
353 |
||
354 |
instantiation perm :: pt |
|
355 |
begin |
|
356 |
||
357 |
definition |
|
358 |
"p \<bullet> q = p + q - p" |
|
359 |
||
360 |
instance |
|
361 |
apply default |
|
362 |
apply (simp add: permute_perm_def) |
|
363 |
apply (simp add: permute_perm_def diff_minus minus_add add_assoc) |
|
364 |
done |
|
365 |
||
366 |
end |
|
367 |
||
1879 | 368 |
lemma permute_self: |
369 |
shows "p \<bullet> p = p" |
|
370 |
unfolding permute_perm_def |
|
371 |
by (simp add: diff_minus add_assoc) |
|
1062 | 372 |
|
373 |
lemma permute_eqvt: |
|
374 |
shows "p \<bullet> (q \<bullet> x) = (p \<bullet> q) \<bullet> (p \<bullet> x)" |
|
375 |
unfolding permute_perm_def by simp |
|
376 |
||
377 |
lemma zero_perm_eqvt: |
|
378 |
shows "p \<bullet> (0::perm) = 0" |
|
379 |
unfolding permute_perm_def by simp |
|
380 |
||
381 |
lemma add_perm_eqvt: |
|
382 |
fixes p p1 p2 :: perm |
|
383 |
shows "p \<bullet> (p1 + p2) = p \<bullet> p1 + p \<bullet> p2" |
|
384 |
unfolding permute_perm_def |
|
385 |
by (simp add: expand_perm_eq) |
|
386 |
||
387 |
lemma swap_eqvt: |
|
388 |
shows "p \<bullet> (a \<rightleftharpoons> b) = (p \<bullet> a \<rightleftharpoons> p \<bullet> b)" |
|
389 |
unfolding permute_perm_def |
|
390 |
by (auto simp add: swap_atom expand_perm_eq) |
|
391 |
||
2310 | 392 |
lemma uminus_eqvt: |
393 |
fixes p q::"perm" |
|
394 |
shows "p \<bullet> (- q) = - (p \<bullet> q)" |
|
395 |
unfolding permute_perm_def |
|
396 |
by (simp add: diff_minus minus_add add_assoc) |
|
1062 | 397 |
|
398 |
subsection {* Permutations for functions *} |
|
399 |
||
400 |
instantiation "fun" :: (pt, pt) pt |
|
401 |
begin |
|
402 |
||
403 |
definition |
|
404 |
"p \<bullet> f = (\<lambda>x. p \<bullet> (f (- p \<bullet> x)))" |
|
405 |
||
406 |
instance |
|
407 |
apply default |
|
408 |
apply (simp add: permute_fun_def) |
|
409 |
apply (simp add: permute_fun_def minus_add) |
|
410 |
done |
|
411 |
||
412 |
end |
|
413 |
||
414 |
lemma permute_fun_app_eq: |
|
415 |
shows "p \<bullet> (f x) = (p \<bullet> f) (p \<bullet> x)" |
|
1879 | 416 |
unfolding permute_fun_def by simp |
1062 | 417 |
|
418 |
subsection {* Permutations for booleans *} |
|
419 |
||
420 |
instantiation bool :: pt |
|
421 |
begin |
|
422 |
||
423 |
definition "p \<bullet> (b::bool) = b" |
|
424 |
||
425 |
instance |
|
426 |
apply(default) |
|
427 |
apply(simp_all add: permute_bool_def) |
|
428 |
done |
|
429 |
||
430 |
end |
|
431 |
||
432 |
lemma Not_eqvt: |
|
433 |
shows "p \<bullet> (\<not> A) = (\<not> (p \<bullet> A))" |
|
434 |
by (simp add: permute_bool_def) |
|
435 |
||
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
436 |
lemma conj_eqvt: |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
437 |
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
|
438 |
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
|
439 |
|
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
440 |
lemma imp_eqvt: |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
441 |
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
|
442 |
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
|
443 |
|
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
444 |
lemma ex_eqvt: |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
445 |
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
|
446 |
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
|
447 |
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
|
448 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
449 |
lemma all_eqvt: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
450 |
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
|
451 |
unfolding permute_fun_def permute_bool_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
452 |
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
|
453 |
|
1557
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents:
1305
diff
changeset
|
454 |
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
|
455 |
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
|
456 |
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
|
457 |
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
|
458 |
|
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents:
1305
diff
changeset
|
459 |
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
|
460 |
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
|
461 |
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
|
462 |
by(simp add: permute_bool_def) |
1062 | 463 |
|
464 |
subsection {* Permutations for sets *} |
|
465 |
||
466 |
lemma permute_set_eq: |
|
467 |
fixes x::"'a::pt" |
|
468 |
and p::"perm" |
|
469 |
shows "(p \<bullet> X) = {p \<bullet> x | x. x \<in> X}" |
|
1879 | 470 |
unfolding permute_fun_def |
471 |
unfolding permute_bool_def |
|
472 |
apply(auto simp add: mem_def) |
|
1062 | 473 |
apply(rule_tac x="- p \<bullet> x" in exI) |
474 |
apply(simp) |
|
475 |
done |
|
476 |
||
477 |
lemma permute_set_eq_image: |
|
478 |
shows "p \<bullet> X = permute p ` X" |
|
1879 | 479 |
unfolding permute_set_eq by auto |
1062 | 480 |
|
481 |
lemma permute_set_eq_vimage: |
|
482 |
shows "p \<bullet> X = permute (- p) -` X" |
|
1879 | 483 |
unfolding permute_fun_def permute_bool_def |
484 |
unfolding vimage_def Collect_def mem_def .. |
|
1062 | 485 |
|
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
486 |
lemma permute_finite [simp]: |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
487 |
shows "finite (p \<bullet> X) = finite X" |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
488 |
apply(simp add: permute_set_eq_image) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
489 |
apply(rule iffI) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
490 |
apply(drule finite_imageD) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
491 |
using inj_permute[where p="p"] |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
492 |
apply(simp add: inj_on_def) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
493 |
apply(assumption) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
494 |
apply(rule finite_imageI) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
495 |
apply(assumption) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
496 |
done |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
497 |
|
1062 | 498 |
lemma swap_set_not_in: |
499 |
assumes a: "a \<notin> S" "b \<notin> S" |
|
500 |
shows "(a \<rightleftharpoons> b) \<bullet> S = S" |
|
1879 | 501 |
unfolding permute_set_eq |
502 |
using a by (auto simp add: swap_atom) |
|
1062 | 503 |
|
504 |
lemma swap_set_in: |
|
505 |
assumes a: "a \<in> S" "b \<notin> S" "sort_of a = sort_of b" |
|
506 |
shows "(a \<rightleftharpoons> b) \<bullet> S \<noteq> S" |
|
1879 | 507 |
unfolding permute_set_eq |
508 |
using a by (auto simp add: swap_atom) |
|
1062 | 509 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
510 |
lemma mem_permute_iff: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
511 |
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
|
512 |
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
|
513 |
by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
514 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
515 |
lemma mem_eqvt: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
516 |
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
|
517 |
unfolding mem_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
518 |
by (simp add: permute_fun_app_eq) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
519 |
|
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
520 |
lemma empty_eqvt: |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
521 |
shows "p \<bullet> {} = {}" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
522 |
unfolding empty_def Collect_def |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
523 |
by (simp add: permute_fun_def permute_bool_def) |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
524 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
525 |
lemma insert_eqvt: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
526 |
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
|
527 |
unfolding permute_set_eq_image image_insert .. |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
528 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
529 |
|
1062 | 530 |
subsection {* Permutations for units *} |
531 |
||
532 |
instantiation unit :: pt |
|
533 |
begin |
|
534 |
||
535 |
definition "p \<bullet> (u::unit) = u" |
|
536 |
||
1879 | 537 |
instance |
538 |
by (default) (simp_all add: permute_unit_def) |
|
1062 | 539 |
|
540 |
end |
|
541 |
||
542 |
||
543 |
subsection {* Permutations for products *} |
|
544 |
||
2378
2f13fe48c877
updated to new Isabelle; made FSet more "quiet"
Christian Urban <urbanc@in.tum.de>
parents:
2310
diff
changeset
|
545 |
instantiation prod :: (pt, pt) pt |
1062 | 546 |
begin |
547 |
||
548 |
primrec |
|
549 |
permute_prod |
|
550 |
where |
|
551 |
Pair_eqvt: "p \<bullet> (x, y) = (p \<bullet> x, p \<bullet> y)" |
|
552 |
||
553 |
instance |
|
554 |
by default auto |
|
555 |
||
556 |
end |
|
557 |
||
558 |
subsection {* Permutations for sums *} |
|
559 |
||
2378
2f13fe48c877
updated to new Isabelle; made FSet more "quiet"
Christian Urban <urbanc@in.tum.de>
parents:
2310
diff
changeset
|
560 |
instantiation sum :: (pt, pt) pt |
1062 | 561 |
begin |
562 |
||
563 |
primrec |
|
564 |
permute_sum |
|
565 |
where |
|
566 |
"p \<bullet> (Inl x) = Inl (p \<bullet> x)" |
|
567 |
| "p \<bullet> (Inr y) = Inr (p \<bullet> y)" |
|
568 |
||
1879 | 569 |
instance |
570 |
by (default) (case_tac [!] x, simp_all) |
|
1062 | 571 |
|
572 |
end |
|
573 |
||
574 |
subsection {* Permutations for lists *} |
|
575 |
||
576 |
instantiation list :: (pt) pt |
|
577 |
begin |
|
578 |
||
579 |
primrec |
|
580 |
permute_list |
|
581 |
where |
|
582 |
"p \<bullet> [] = []" |
|
583 |
| "p \<bullet> (x # xs) = p \<bullet> x # p \<bullet> xs" |
|
584 |
||
1879 | 585 |
instance |
586 |
by (default) (induct_tac [!] x, simp_all) |
|
1062 | 587 |
|
588 |
end |
|
589 |
||
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
590 |
lemma set_eqvt: |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
591 |
shows "p \<bullet> (set xs) = set (p \<bullet> xs)" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
592 |
by (induct xs) (simp_all add: empty_eqvt insert_eqvt) |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
593 |
|
1062 | 594 |
subsection {* Permutations for options *} |
595 |
||
596 |
instantiation option :: (pt) pt |
|
597 |
begin |
|
598 |
||
599 |
primrec |
|
600 |
permute_option |
|
601 |
where |
|
602 |
"p \<bullet> None = None" |
|
603 |
| "p \<bullet> (Some x) = Some (p \<bullet> x)" |
|
604 |
||
1879 | 605 |
instance |
606 |
by (default) (induct_tac [!] x, simp_all) |
|
1062 | 607 |
|
608 |
end |
|
609 |
||
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
610 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
611 |
subsection {* Permutations for fsets *} |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
612 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
613 |
lemma permute_fset_rsp[quot_respect]: |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
614 |
shows "(op = ===> list_eq ===> list_eq) permute permute" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
615 |
unfolding fun_rel_def |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
616 |
by (simp add: set_eqvt[symmetric]) |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
617 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
618 |
instantiation fset :: (pt) pt |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
619 |
begin |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
620 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
621 |
quotient_definition |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
622 |
"permute_fset :: perm \<Rightarrow> 'a fset \<Rightarrow> 'a fset" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
623 |
is |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
624 |
"permute :: perm \<Rightarrow> 'a list \<Rightarrow> 'a list" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
625 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
626 |
instance |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
627 |
proof |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
628 |
fix x :: "'a fset" and p q :: "perm" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
629 |
show "0 \<bullet> x = x" by (descending) (simp) |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
630 |
show "(p + q) \<bullet> x = p \<bullet> q \<bullet> x" by (descending) (simp) |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
631 |
qed |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
632 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
633 |
end |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
634 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
635 |
lemma permute_fset [simp]: |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
636 |
fixes S::"('a::pt) fset" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
637 |
shows "(p \<bullet> {||}) = ({||} ::('a::pt) fset)" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
638 |
and "(p \<bullet> insert_fset x S) = insert_fset (p \<bullet> x) (p \<bullet> S)" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
639 |
by (lifting permute_list.simps) |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
640 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
641 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
642 |
|
1062 | 643 |
subsection {* Permutations for @{typ char}, @{typ nat}, and @{typ int} *} |
644 |
||
645 |
instantiation char :: pt |
|
646 |
begin |
|
647 |
||
648 |
definition "p \<bullet> (c::char) = c" |
|
649 |
||
1879 | 650 |
instance |
651 |
by (default) (simp_all add: permute_char_def) |
|
1062 | 652 |
|
653 |
end |
|
654 |
||
655 |
instantiation nat :: pt |
|
656 |
begin |
|
657 |
||
658 |
definition "p \<bullet> (n::nat) = n" |
|
659 |
||
1879 | 660 |
instance |
661 |
by (default) (simp_all add: permute_nat_def) |
|
1062 | 662 |
|
663 |
end |
|
664 |
||
665 |
instantiation int :: pt |
|
666 |
begin |
|
667 |
||
668 |
definition "p \<bullet> (i::int) = i" |
|
669 |
||
1879 | 670 |
instance |
671 |
by (default) (simp_all add: permute_int_def) |
|
1062 | 672 |
|
673 |
end |
|
674 |
||
675 |
||
676 |
section {* Pure types *} |
|
677 |
||
678 |
text {* Pure types will have always empty support. *} |
|
679 |
||
680 |
class pure = pt + |
|
681 |
assumes permute_pure: "p \<bullet> x = x" |
|
682 |
||
683 |
text {* Types @{typ unit} and @{typ bool} are pure. *} |
|
684 |
||
685 |
instance unit :: pure |
|
686 |
proof qed (rule permute_unit_def) |
|
687 |
||
688 |
instance bool :: pure |
|
689 |
proof qed (rule permute_bool_def) |
|
690 |
||
2635
64b4cb2c2bf8
simple cases for string rule inductions
Christian Urban <urbanc@in.tum.de>
parents:
2632
diff
changeset
|
691 |
|
1062 | 692 |
text {* Other type constructors preserve purity. *} |
693 |
||
694 |
instance "fun" :: (pure, pure) pure |
|
695 |
by default (simp add: permute_fun_def permute_pure) |
|
696 |
||
2378
2f13fe48c877
updated to new Isabelle; made FSet more "quiet"
Christian Urban <urbanc@in.tum.de>
parents:
2310
diff
changeset
|
697 |
instance prod :: (pure, pure) pure |
1062 | 698 |
by default (induct_tac x, simp add: permute_pure) |
699 |
||
2378
2f13fe48c877
updated to new Isabelle; made FSet more "quiet"
Christian Urban <urbanc@in.tum.de>
parents:
2310
diff
changeset
|
700 |
instance sum :: (pure, pure) pure |
1062 | 701 |
by default (induct_tac x, simp_all add: permute_pure) |
702 |
||
703 |
instance list :: (pure) pure |
|
704 |
by default (induct_tac x, simp_all add: permute_pure) |
|
705 |
||
706 |
instance option :: (pure) pure |
|
707 |
by default (induct_tac x, simp_all add: permute_pure) |
|
708 |
||
709 |
||
710 |
subsection {* Types @{typ char}, @{typ nat}, and @{typ int} *} |
|
711 |
||
712 |
instance char :: pure |
|
713 |
proof qed (rule permute_char_def) |
|
714 |
||
715 |
instance nat :: pure |
|
716 |
proof qed (rule permute_nat_def) |
|
717 |
||
718 |
instance int :: pure |
|
719 |
proof qed (rule permute_int_def) |
|
720 |
||
721 |
||
722 |
subsection {* Supp, Freshness and Supports *} |
|
723 |
||
724 |
context pt |
|
725 |
begin |
|
726 |
||
727 |
definition |
|
728 |
supp :: "'a \<Rightarrow> atom set" |
|
729 |
where |
|
730 |
"supp x = {a. infinite {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x}}" |
|
731 |
||
732 |
end |
|
733 |
||
734 |
definition |
|
735 |
fresh :: "atom \<Rightarrow> 'a::pt \<Rightarrow> bool" ("_ \<sharp> _" [55, 55] 55) |
|
736 |
where |
|
737 |
"a \<sharp> x \<equiv> a \<notin> supp x" |
|
738 |
||
739 |
lemma supp_conv_fresh: |
|
740 |
shows "supp x = {a. \<not> a \<sharp> x}" |
|
741 |
unfolding fresh_def by simp |
|
742 |
||
743 |
lemma swap_rel_trans: |
|
744 |
assumes "sort_of a = sort_of b" |
|
745 |
assumes "sort_of b = sort_of c" |
|
746 |
assumes "(a \<rightleftharpoons> c) \<bullet> x = x" |
|
747 |
assumes "(b \<rightleftharpoons> c) \<bullet> x = x" |
|
748 |
shows "(a \<rightleftharpoons> b) \<bullet> x = x" |
|
749 |
proof (cases) |
|
750 |
assume "a = b \<or> c = b" |
|
751 |
with assms show "(a \<rightleftharpoons> b) \<bullet> x = x" by auto |
|
752 |
next |
|
753 |
assume *: "\<not> (a = b \<or> c = b)" |
|
754 |
have "((a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c)) \<bullet> x = x" |
|
755 |
using assms by simp |
|
756 |
also have "(a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c) = (a \<rightleftharpoons> b)" |
|
757 |
using assms * by (simp add: swap_triple) |
|
758 |
finally show "(a \<rightleftharpoons> b) \<bullet> x = x" . |
|
759 |
qed |
|
760 |
||
761 |
lemma swap_fresh_fresh: |
|
762 |
assumes a: "a \<sharp> x" |
|
763 |
and b: "b \<sharp> x" |
|
764 |
shows "(a \<rightleftharpoons> b) \<bullet> x = x" |
|
765 |
proof (cases) |
|
766 |
assume asm: "sort_of a = sort_of b" |
|
767 |
have "finite {c. (a \<rightleftharpoons> c) \<bullet> x \<noteq> x}" "finite {c. (b \<rightleftharpoons> c) \<bullet> x \<noteq> x}" |
|
768 |
using a b unfolding fresh_def supp_def by simp_all |
|
769 |
then have "finite ({c. (a \<rightleftharpoons> c) \<bullet> x \<noteq> x} \<union> {c. (b \<rightleftharpoons> c) \<bullet> x \<noteq> x})" by simp |
|
770 |
then obtain c |
|
771 |
where "(a \<rightleftharpoons> c) \<bullet> x = x" "(b \<rightleftharpoons> c) \<bullet> x = x" "sort_of c = sort_of b" |
|
772 |
by (rule obtain_atom) (auto) |
|
773 |
then show "(a \<rightleftharpoons> b) \<bullet> x = x" using asm by (rule_tac swap_rel_trans) (simp_all) |
|
774 |
next |
|
775 |
assume "sort_of a \<noteq> sort_of b" |
|
776 |
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by simp |
|
777 |
qed |
|
778 |
||
779 |
||
780 |
subsection {* supp and fresh are equivariant *} |
|
781 |
||
782 |
lemma finite_Collect_bij: |
|
783 |
assumes a: "bij f" |
|
784 |
shows "finite {x. P (f x)} = finite {x. P x}" |
|
785 |
by (metis a finite_vimage_iff vimage_Collect_eq) |
|
786 |
||
787 |
lemma fresh_permute_iff: |
|
788 |
shows "(p \<bullet> a) \<sharp> (p \<bullet> x) \<longleftrightarrow> a \<sharp> x" |
|
789 |
proof - |
|
790 |
have "(p \<bullet> a) \<sharp> (p \<bullet> x) \<longleftrightarrow> finite {b. (p \<bullet> a \<rightleftharpoons> b) \<bullet> p \<bullet> x \<noteq> p \<bullet> x}" |
|
791 |
unfolding fresh_def supp_def by simp |
|
792 |
also have "\<dots> \<longleftrightarrow> finite {b. (p \<bullet> a \<rightleftharpoons> p \<bullet> b) \<bullet> p \<bullet> x \<noteq> p \<bullet> x}" |
|
1879 | 793 |
using bij_permute by (rule finite_Collect_bij[symmetric]) |
1062 | 794 |
also have "\<dots> \<longleftrightarrow> finite {b. p \<bullet> (a \<rightleftharpoons> b) \<bullet> x \<noteq> p \<bullet> x}" |
795 |
by (simp only: permute_eqvt [of p] swap_eqvt) |
|
796 |
also have "\<dots> \<longleftrightarrow> finite {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x}" |
|
797 |
by (simp only: permute_eq_iff) |
|
798 |
also have "\<dots> \<longleftrightarrow> a \<sharp> x" |
|
799 |
unfolding fresh_def supp_def by simp |
|
1879 | 800 |
finally show "(p \<bullet> a) \<sharp> (p \<bullet> x) \<longleftrightarrow> a \<sharp> x" . |
1062 | 801 |
qed |
802 |
||
803 |
lemma fresh_eqvt: |
|
804 |
shows "p \<bullet> (a \<sharp> x) = (p \<bullet> a) \<sharp> (p \<bullet> x)" |
|
1879 | 805 |
unfolding permute_bool_def |
806 |
by (simp add: fresh_permute_iff) |
|
1062 | 807 |
|
808 |
lemma supp_eqvt: |
|
809 |
fixes p :: "perm" |
|
810 |
and x :: "'a::pt" |
|
811 |
shows "p \<bullet> (supp x) = supp (p \<bullet> x)" |
|
812 |
unfolding supp_conv_fresh |
|
1879 | 813 |
unfolding Collect_def |
814 |
unfolding permute_fun_def |
|
1062 | 815 |
by (simp add: Not_eqvt fresh_eqvt) |
816 |
||
817 |
subsection {* supports *} |
|
818 |
||
819 |
definition |
|
820 |
supports :: "atom set \<Rightarrow> 'a::pt \<Rightarrow> bool" (infixl "supports" 80) |
|
821 |
where |
|
822 |
"S supports x \<equiv> \<forall>a b. (a \<notin> S \<and> b \<notin> S \<longrightarrow> (a \<rightleftharpoons> b) \<bullet> x = x)" |
|
823 |
||
824 |
lemma supp_is_subset: |
|
825 |
fixes S :: "atom set" |
|
826 |
and x :: "'a::pt" |
|
827 |
assumes a1: "S supports x" |
|
828 |
and a2: "finite S" |
|
829 |
shows "(supp x) \<subseteq> S" |
|
830 |
proof (rule ccontr) |
|
1879 | 831 |
assume "\<not> (supp x \<subseteq> S)" |
1062 | 832 |
then obtain a where b1: "a \<in> supp x" and b2: "a \<notin> S" by auto |
1879 | 833 |
from a1 b2 have "\<forall>b. b \<notin> S \<longrightarrow> (a \<rightleftharpoons> b) \<bullet> x = x" unfolding supports_def by auto |
834 |
then have "{b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x} \<subseteq> S" by auto |
|
1062 | 835 |
with a2 have "finite {b. (a \<rightleftharpoons> b)\<bullet>x \<noteq> x}" by (simp add: finite_subset) |
836 |
then have "a \<notin> (supp x)" unfolding supp_def by simp |
|
837 |
with b1 show False by simp |
|
838 |
qed |
|
839 |
||
840 |
lemma supports_finite: |
|
841 |
fixes S :: "atom set" |
|
842 |
and x :: "'a::pt" |
|
843 |
assumes a1: "S supports x" |
|
844 |
and a2: "finite S" |
|
845 |
shows "finite (supp x)" |
|
846 |
proof - |
|
847 |
have "(supp x) \<subseteq> S" using a1 a2 by (rule supp_is_subset) |
|
848 |
then show "finite (supp x)" using a2 by (simp add: finite_subset) |
|
849 |
qed |
|
850 |
||
851 |
lemma supp_supports: |
|
852 |
fixes x :: "'a::pt" |
|
853 |
shows "(supp x) supports x" |
|
1879 | 854 |
unfolding supports_def |
855 |
proof (intro strip) |
|
1062 | 856 |
fix a b |
857 |
assume "a \<notin> (supp x) \<and> b \<notin> (supp x)" |
|
858 |
then have "a \<sharp> x" and "b \<sharp> x" by (simp_all add: fresh_def) |
|
1879 | 859 |
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by (simp add: swap_fresh_fresh) |
1062 | 860 |
qed |
861 |
||
862 |
lemma supp_is_least_supports: |
|
863 |
fixes S :: "atom set" |
|
864 |
and x :: "'a::pt" |
|
865 |
assumes a1: "S supports x" |
|
866 |
and a2: "finite S" |
|
867 |
and a3: "\<And>S'. finite S' \<Longrightarrow> (S' supports x) \<Longrightarrow> S \<subseteq> S'" |
|
868 |
shows "(supp x) = S" |
|
869 |
proof (rule equalityI) |
|
870 |
show "(supp x) \<subseteq> S" using a1 a2 by (rule supp_is_subset) |
|
871 |
with a2 have fin: "finite (supp x)" by (rule rev_finite_subset) |
|
872 |
have "(supp x) supports x" by (rule supp_supports) |
|
873 |
with fin a3 show "S \<subseteq> supp x" by blast |
|
874 |
qed |
|
875 |
||
876 |
lemma subsetCI: |
|
877 |
shows "(\<And>x. x \<in> A \<Longrightarrow> x \<notin> B \<Longrightarrow> False) \<Longrightarrow> A \<subseteq> B" |
|
878 |
by auto |
|
879 |
||
880 |
lemma finite_supp_unique: |
|
881 |
assumes a1: "S supports x" |
|
882 |
assumes a2: "finite S" |
|
883 |
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" |
|
884 |
shows "(supp x) = S" |
|
885 |
using a1 a2 |
|
886 |
proof (rule supp_is_least_supports) |
|
887 |
fix S' |
|
888 |
assume "finite S'" and "S' supports x" |
|
889 |
show "S \<subseteq> S'" |
|
890 |
proof (rule subsetCI) |
|
891 |
fix a |
|
892 |
assume "a \<in> S" and "a \<notin> S'" |
|
893 |
have "finite (S \<union> S')" |
|
894 |
using `finite S` `finite S'` by simp |
|
895 |
then obtain b where "b \<notin> S \<union> S'" and "sort_of b = sort_of a" |
|
896 |
by (rule obtain_atom) |
|
897 |
then have "b \<notin> S" and "b \<notin> S'" and "sort_of a = sort_of b" |
|
898 |
by simp_all |
|
899 |
then have "(a \<rightleftharpoons> b) \<bullet> x = x" |
|
900 |
using `a \<notin> S'` `S' supports x` by (simp add: supports_def) |
|
901 |
moreover have "(a \<rightleftharpoons> b) \<bullet> x \<noteq> x" |
|
902 |
using `a \<in> S` `b \<notin> S` `sort_of a = sort_of b` |
|
903 |
by (rule a3) |
|
904 |
ultimately show "False" by simp |
|
905 |
qed |
|
906 |
qed |
|
907 |
||
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
|
908 |
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
|
909 |
|
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
|
910 |
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
|
911 |
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
|
912 |
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
|
913 |
*} |
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
|
914 |
|
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
|
915 |
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
|
916 |
"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
|
917 |
|
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
|
918 |
|
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
|
919 |
|
1062 | 920 |
section {* Finitely-supported types *} |
921 |
||
922 |
class fs = pt + |
|
923 |
assumes finite_supp: "finite (supp x)" |
|
924 |
||
925 |
lemma pure_supp: |
|
926 |
shows "supp (x::'a::pure) = {}" |
|
927 |
unfolding supp_def by (simp add: permute_pure) |
|
928 |
||
929 |
lemma pure_fresh: |
|
930 |
fixes x::"'a::pure" |
|
931 |
shows "a \<sharp> x" |
|
932 |
unfolding fresh_def by (simp add: pure_supp) |
|
933 |
||
934 |
instance pure < fs |
|
935 |
by default (simp add: pure_supp) |
|
936 |
||
937 |
||
938 |
subsection {* Type @{typ atom} is finitely-supported. *} |
|
939 |
||
940 |
lemma supp_atom: |
|
941 |
shows "supp a = {a}" |
|
942 |
apply (rule finite_supp_unique) |
|
943 |
apply (clarsimp simp add: supports_def) |
|
944 |
apply simp |
|
945 |
apply simp |
|
946 |
done |
|
947 |
||
948 |
lemma fresh_atom: |
|
949 |
shows "a \<sharp> b \<longleftrightarrow> a \<noteq> b" |
|
950 |
unfolding fresh_def supp_atom by simp |
|
951 |
||
952 |
instance atom :: fs |
|
953 |
by default (simp add: supp_atom) |
|
954 |
||
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
|
955 |
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
|
956 |
|
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
|
957 |
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
|
958 |
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
|
959 |
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
|
960 |
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
|
961 |
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
|
962 |
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
|
963 |
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
|
964 |
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
|
965 |
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
|
966 |
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
|
967 |
|
1062 | 968 |
section {* Type @{typ perm} is finitely-supported. *} |
969 |
||
970 |
lemma perm_swap_eq: |
|
971 |
shows "(a \<rightleftharpoons> b) \<bullet> p = p \<longleftrightarrow> (p \<bullet> (a \<rightleftharpoons> b)) = (a \<rightleftharpoons> b)" |
|
972 |
unfolding permute_perm_def |
|
973 |
by (metis add_diff_cancel minus_perm_def) |
|
974 |
||
975 |
lemma supports_perm: |
|
976 |
shows "{a. p \<bullet> a \<noteq> a} supports p" |
|
977 |
unfolding supports_def |
|
1879 | 978 |
unfolding perm_swap_eq |
979 |
by (simp add: swap_eqvt) |
|
1062 | 980 |
|
981 |
lemma finite_perm_lemma: |
|
982 |
shows "finite {a::atom. p \<bullet> a \<noteq> a}" |
|
983 |
using finite_Rep_perm [of p] |
|
984 |
unfolding permute_atom_def . |
|
985 |
||
986 |
lemma supp_perm: |
|
987 |
shows "supp p = {a. p \<bullet> a \<noteq> a}" |
|
988 |
apply (rule finite_supp_unique) |
|
989 |
apply (rule supports_perm) |
|
990 |
apply (rule finite_perm_lemma) |
|
991 |
apply (simp add: perm_swap_eq swap_eqvt) |
|
992 |
apply (auto simp add: expand_perm_eq swap_atom) |
|
993 |
done |
|
994 |
||
995 |
lemma fresh_perm: |
|
996 |
shows "a \<sharp> p \<longleftrightarrow> p \<bullet> a = a" |
|
1879 | 997 |
unfolding fresh_def |
998 |
by (simp add: supp_perm) |
|
1062 | 999 |
|
1000 |
lemma supp_swap: |
|
1001 |
shows "supp (a \<rightleftharpoons> b) = (if a = b \<or> sort_of a \<noteq> sort_of b then {} else {a, b})" |
|
1002 |
by (auto simp add: supp_perm swap_atom) |
|
1003 |
||
1004 |
lemma fresh_zero_perm: |
|
1005 |
shows "a \<sharp> (0::perm)" |
|
1006 |
unfolding fresh_perm by simp |
|
1007 |
||
1008 |
lemma supp_zero_perm: |
|
1009 |
shows "supp (0::perm) = {}" |
|
1010 |
unfolding supp_perm by simp |
|
1011 |
||
1087
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1012 |
lemma fresh_plus_perm: |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1013 |
fixes p q::perm |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1014 |
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
|
1015 |
shows "a \<sharp> (p + q)" |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1016 |
using assms |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1017 |
unfolding fresh_def |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1018 |
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
|
1019 |
|
1062 | 1020 |
lemma supp_plus_perm: |
1021 |
fixes p q::perm |
|
1022 |
shows "supp (p + q) \<subseteq> supp p \<union> supp q" |
|
1023 |
by (auto simp add: supp_perm) |
|
1024 |
||
1087
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1025 |
lemma fresh_minus_perm: |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1026 |
fixes p::perm |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1027 |
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
|
1028 |
unfolding fresh_def |
1879 | 1029 |
unfolding supp_perm |
1030 |
apply(simp) |
|
1031 |
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
|
1032 |
done |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1033 |
|
1062 | 1034 |
lemma supp_minus_perm: |
1035 |
fixes p::perm |
|
1036 |
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
|
1037 |
unfolding supp_conv_fresh |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1038 |
by (simp add: fresh_minus_perm) |
1062 | 1039 |
|
1040 |
instance perm :: fs |
|
1041 |
by default (simp add: supp_perm finite_perm_lemma) |
|
1042 |
||
1305
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1043 |
lemma plus_perm_eq: |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1044 |
fixes p q::"perm" |
1879 | 1045 |
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
|
1046 |
shows "p + q = q + p" |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1047 |
unfolding expand_perm_eq |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1048 |
proof |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1049 |
fix a::"atom" |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1050 |
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
|
1051 |
proof - |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1052 |
{ 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
|
1053 |
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
|
1054 |
by (simp add: supp_perm) |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1055 |
} |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1056 |
moreover |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1057 |
{ 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
|
1058 |
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
|
1059 |
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
|
1060 |
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
|
1061 |
by (simp add: supp_perm) |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1062 |
} |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1063 |
moreover |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1064 |
{ 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
|
1065 |
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
|
1066 |
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
|
1067 |
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
|
1068 |
by (simp add: supp_perm) |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1069 |
} |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1070 |
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
|
1071 |
using asm by blast |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1072 |
qed |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1073 |
qed |
1062 | 1074 |
|
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1075 |
lemma supp_plus_perm_eq: |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1076 |
fixes p q::perm |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1077 |
assumes asm: "supp p \<inter> supp q = {}" |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1078 |
shows "supp (p + q) = supp p \<union> supp q" |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1079 |
proof - |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1080 |
{ fix a::"atom" |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1081 |
assume "a \<in> supp p" |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1082 |
then have "a \<notin> supp q" using asm by auto |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1083 |
then have "a \<in> supp (p + q)" using `a \<in> supp p` |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1084 |
by (simp add: supp_perm) |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1085 |
} |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1086 |
moreover |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1087 |
{ fix a::"atom" |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1088 |
assume "a \<in> supp q" |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1089 |
then have "a \<notin> supp p" using asm by auto |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1090 |
then have "a \<in> supp (q + p)" using `a \<in> supp q` |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1091 |
by (simp add: supp_perm) |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1092 |
then have "a \<in> supp (p + q)" using asm plus_perm_eq |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1093 |
by metis |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1094 |
} |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1095 |
ultimately have "supp p \<union> supp q \<subseteq> supp (p + q)" |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1096 |
by blast |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1097 |
then show "supp (p + q) = supp p \<union> supp q" using supp_plus_perm |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1098 |
by blast |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1099 |
qed |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1100 |
|
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1101 |
|
1062 | 1102 |
section {* Finite Support instances for other types *} |
1103 |
||
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1104 |
|
1062 | 1105 |
subsection {* Type @{typ "'a \<times> 'b"} is finitely-supported. *} |
1106 |
||
1107 |
lemma supp_Pair: |
|
1108 |
shows "supp (x, y) = supp x \<union> supp y" |
|
1109 |
by (simp add: supp_def Collect_imp_eq Collect_neg_eq) |
|
1110 |
||
1111 |
lemma fresh_Pair: |
|
1112 |
shows "a \<sharp> (x, y) \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> y" |
|
1113 |
by (simp add: fresh_def supp_Pair) |
|
1114 |
||
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1115 |
lemma supp_Unit: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1116 |
shows "supp () = {}" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1117 |
by (simp add: supp_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1118 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1119 |
lemma fresh_Unit: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1120 |
shows "a \<sharp> ()" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1121 |
by (simp add: fresh_def supp_Unit) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1122 |
|
2378
2f13fe48c877
updated to new Isabelle; made FSet more "quiet"
Christian Urban <urbanc@in.tum.de>
parents:
2310
diff
changeset
|
1123 |
instance prod :: (fs, fs) fs |
1062 | 1124 |
apply default |
1125 |
apply (induct_tac x) |
|
1126 |
apply (simp add: supp_Pair finite_supp) |
|
1127 |
done |
|
1128 |
||
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1129 |
|
1062 | 1130 |
subsection {* Type @{typ "'a + 'b"} is finitely supported *} |
1131 |
||
1132 |
lemma supp_Inl: |
|
1133 |
shows "supp (Inl x) = supp x" |
|
1134 |
by (simp add: supp_def) |
|
1135 |
||
1136 |
lemma supp_Inr: |
|
1137 |
shows "supp (Inr x) = supp x" |
|
1138 |
by (simp add: supp_def) |
|
1139 |
||
1140 |
lemma fresh_Inl: |
|
1141 |
shows "a \<sharp> Inl x \<longleftrightarrow> a \<sharp> x" |
|
1142 |
by (simp add: fresh_def supp_Inl) |
|
1143 |
||
1144 |
lemma fresh_Inr: |
|
1145 |
shows "a \<sharp> Inr y \<longleftrightarrow> a \<sharp> y" |
|
1146 |
by (simp add: fresh_def supp_Inr) |
|
1147 |
||
2378
2f13fe48c877
updated to new Isabelle; made FSet more "quiet"
Christian Urban <urbanc@in.tum.de>
parents:
2310
diff
changeset
|
1148 |
instance sum :: (fs, fs) fs |
1062 | 1149 |
apply default |
1150 |
apply (induct_tac x) |
|
1151 |
apply (simp_all add: supp_Inl supp_Inr finite_supp) |
|
1152 |
done |
|
1153 |
||
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1154 |
|
1062 | 1155 |
subsection {* Type @{typ "'a option"} is finitely supported *} |
1156 |
||
1157 |
lemma supp_None: |
|
1158 |
shows "supp None = {}" |
|
1159 |
by (simp add: supp_def) |
|
1160 |
||
1161 |
lemma supp_Some: |
|
1162 |
shows "supp (Some x) = supp x" |
|
1163 |
by (simp add: supp_def) |
|
1164 |
||
1165 |
lemma fresh_None: |
|
1166 |
shows "a \<sharp> None" |
|
1167 |
by (simp add: fresh_def supp_None) |
|
1168 |
||
1169 |
lemma fresh_Some: |
|
1170 |
shows "a \<sharp> Some x \<longleftrightarrow> a \<sharp> x" |
|
1171 |
by (simp add: fresh_def supp_Some) |
|
1172 |
||
1173 |
instance option :: (fs) fs |
|
1174 |
apply default |
|
1175 |
apply (induct_tac x) |
|
1176 |
apply (simp_all add: supp_None supp_Some finite_supp) |
|
1177 |
done |
|
1178 |
||
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1179 |
|
1062 | 1180 |
subsubsection {* Type @{typ "'a list"} is finitely supported *} |
1181 |
||
1182 |
lemma supp_Nil: |
|
1183 |
shows "supp [] = {}" |
|
1184 |
by (simp add: supp_def) |
|
1185 |
||
1186 |
lemma supp_Cons: |
|
1187 |
shows "supp (x # xs) = supp x \<union> supp xs" |
|
1188 |
by (simp add: supp_def Collect_imp_eq Collect_neg_eq) |
|
1189 |
||
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1190 |
lemma supp_append: |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1191 |
shows "supp (xs @ ys) = supp xs \<union> supp ys" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1192 |
by (induct xs) (auto simp add: supp_Nil supp_Cons) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1193 |
|
1062 | 1194 |
lemma fresh_Nil: |
1195 |
shows "a \<sharp> []" |
|
1196 |
by (simp add: fresh_def supp_Nil) |
|
1197 |
||
1198 |
lemma fresh_Cons: |
|
1199 |
shows "a \<sharp> (x # xs) \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> xs" |
|
1200 |
by (simp add: fresh_def supp_Cons) |
|
1201 |
||
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1202 |
lemma fresh_append: |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1203 |
shows "a \<sharp> (xs @ ys) \<longleftrightarrow> a \<sharp> xs \<and> a \<sharp> ys" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1204 |
by (induct xs) (simp_all add: fresh_Nil fresh_Cons) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1205 |
|
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1206 |
|
1062 | 1207 |
instance list :: (fs) fs |
1208 |
apply default |
|
1209 |
apply (induct_tac x) |
|
1210 |
apply (simp_all add: supp_Nil supp_Cons finite_supp) |
|
1211 |
done |
|
1212 |
||
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
1213 |
lemma supp_of_atom_list: |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
1214 |
fixes as::"atom list" |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
1215 |
shows "supp as = set as" |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
1216 |
by (induct as) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
1217 |
(simp_all add: supp_Nil supp_Cons supp_atom) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
1218 |
|
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1219 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1220 |
section {* Support and Freshness for Applications *} |
1062 | 1221 |
|
1879 | 1222 |
lemma fresh_conv_MOST: |
1223 |
shows "a \<sharp> x \<longleftrightarrow> (MOST b. (a \<rightleftharpoons> b) \<bullet> x = x)" |
|
1224 |
unfolding fresh_def supp_def |
|
1225 |
unfolding MOST_iff_cofinite by simp |
|
1226 |
||
2003
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
1227 |
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
|
1228 |
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
|
1229 |
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
|
1230 |
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
|
1231 |
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
|
1232 |
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
|
1233 |
|
1879 | 1234 |
lemma fresh_fun_app: |
1235 |
assumes "a \<sharp> f" and "a \<sharp> x" |
|
1236 |
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
|
1237 |
using assms |
1879 | 1238 |
unfolding fresh_conv_MOST |
1239 |
unfolding permute_fun_app_eq |
|
1240 |
by (elim MOST_rev_mp, simp) |
|
1241 |
||
1062 | 1242 |
lemma supp_fun_app: |
1243 |
shows "supp (f x) \<subseteq> (supp f) \<union> (supp x)" |
|
1879 | 1244 |
using fresh_fun_app |
1245 |
unfolding fresh_def |
|
1246 |
by auto |
|
1247 |
||
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1248 |
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
|
1249 |
|
1941 | 1250 |
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
|
1251 |
assumes a: "\<And>p. p \<bullet> f = f" |
1941 | 1252 |
shows "supp f = {}" |
1253 |
unfolding supp_def |
|
1254 |
using a by simp |
|
1255 |
||
1062 | 1256 |
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
|
1257 |
assumes a: "\<And>p. p \<bullet> f = f" |
1062 | 1258 |
shows "a \<sharp> x \<Longrightarrow> a \<sharp> f x" |
1259 |
proof - |
|
1941 | 1260 |
from a have "supp f = {}" by (simp add: supp_fun_eqvt) |
1879 | 1261 |
then show "a \<sharp> x \<Longrightarrow> a \<sharp> f x" |
1062 | 1262 |
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
|
1263 |
using supp_fun_app by auto |
1062 | 1264 |
qed |
1265 |
||
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
|
1266 |
|
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1267 |
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
|
1268 |
|
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1269 |
lemma Union_fresh: |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1270 |
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
|
1271 |
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
|
1272 |
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
|
1273 |
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
|
1274 |
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
|
1275 |
back |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1276 |
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
|
1277 |
apply(assumption) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1278 |
done |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1279 |
|
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1280 |
lemma Union_supports_set: |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1281 |
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
|
1282 |
proof - |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1283 |
{ fix a b |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1284 |
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
|
1285 |
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
|
1286 |
} |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1287 |
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
|
1288 |
unfolding supports_def |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1289 |
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
|
1290 |
qed |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1291 |
|
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1292 |
lemma Union_of_finite_supp_sets: |
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1293 |
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
|
1294 |
assumes fin: "finite S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1295 |
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
|
1296 |
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
|
1297 |
|
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1298 |
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
|
1299 |
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
|
1300 |
assumes fin: "finite S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1301 |
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
|
1302 |
proof - |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1303 |
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
|
1304 |
by (rule supp_finite_atom_set[symmetric]) |
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1305 |
(rule Union_of_finite_supp_sets[OF fin]) |
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1306 |
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
|
1307 |
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
|
1308 |
(simp add: Union_fresh) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1309 |
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
|
1310 |
qed |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1311 |
|
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1312 |
lemma supp_of_finite_sets: |
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1313 |
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
|
1314 |
assumes fin: "finite S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1315 |
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
|
1316 |
apply(rule subset_antisym) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1317 |
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
|
1318 |
apply(rule Union_supports_set) |
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1319 |
apply(rule Union_of_finite_supp_sets[OF fin]) |
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1320 |
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
|
1321 |
done |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1322 |
|
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1323 |
lemma finite_sets_supp: |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1324 |
fixes S::"('a::fs set)" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1325 |
assumes "finite S" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1326 |
shows "finite (supp S)" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1327 |
using assms |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1328 |
by (simp only: supp_of_finite_sets Union_of_finite_supp_sets) |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1329 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1330 |
lemma supp_of_finite_union: |
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1331 |
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
|
1332 |
assumes fin1: "finite S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1333 |
and fin2: "finite T" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1334 |
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
|
1335 |
using fin1 fin2 |
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1336 |
by (simp add: supp_of_finite_sets) |
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1337 |
|
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1338 |
lemma supp_of_finite_insert: |
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1339 |
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
|
1340 |
assumes fin: "finite S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1341 |
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
|
1342 |
using fin |
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1343 |
by (simp add: supp_of_finite_sets) |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1344 |
|
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
1345 |
lemma fresh_finite_insert: |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
1346 |
fixes S::"('a::fs) set" |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
1347 |
assumes fin: "finite S" |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
1348 |
shows "a \<sharp> (insert x S) \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> S" |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
1349 |
using fin unfolding fresh_def |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
1350 |
by (simp add: supp_of_finite_insert) |
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
1351 |
|
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1352 |
lemma supp_set_empty: |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1353 |
shows "supp {} = {}" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1354 |
unfolding supp_def |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1355 |
by (simp add: empty_eqvt) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1356 |
|
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1357 |
lemma fresh_set_empty: |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1358 |
shows "a \<sharp> {}" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1359 |
by (simp add: fresh_def supp_set_empty) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1360 |
|
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1361 |
lemma supp_set: |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1362 |
fixes xs :: "('a::fs) list" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1363 |
shows "supp (set xs) = supp xs" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1364 |
apply(induct xs) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1365 |
apply(simp add: supp_set_empty supp_Nil) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1366 |
apply(simp add: supp_Cons supp_of_finite_insert) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1367 |
done |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1368 |
|
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1369 |
lemma fresh_set: |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1370 |
fixes xs :: "('a::fs) list" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1371 |
shows "a \<sharp> (set xs) \<longleftrightarrow> a \<sharp> xs" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1372 |
unfolding fresh_def |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1373 |
by (simp add: supp_set) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1374 |
|
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1375 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1376 |
subsection {* Type @{typ "'a fset"} is finitely supported *} |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1377 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1378 |
lemma fset_eqvt: |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1379 |
shows "p \<bullet> (fset S) = fset (p \<bullet> S)" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1380 |
by (lifting set_eqvt) |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1381 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1382 |
lemma supp_fset [simp]: |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1383 |
shows "supp (fset S) = supp S" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1384 |
unfolding supp_def |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1385 |
by (simp add: fset_eqvt fset_cong) |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1386 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1387 |
lemma supp_empty_fset [simp]: |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1388 |
shows "supp {||} = {}" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1389 |
unfolding supp_def |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1390 |
by simp |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1391 |
|
2641
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1392 |
lemma fresh_empty_fset: |
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1393 |
shows "a \<sharp> {||}" |
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1394 |
unfolding fresh_def |
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1395 |
by (simp) |
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1396 |
|
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1397 |
lemma supp_insert_fset [simp]: |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1398 |
fixes x::"'a::fs" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1399 |
and S::"'a fset" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1400 |
shows "supp (insert_fset x S) = supp x \<union> supp S" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1401 |
apply(subst supp_fset[symmetric]) |
2587
78623a0f294b
tuned proof to reduce number of warnings
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
1402 |
apply(simp add: supp_of_finite_insert) |
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1403 |
done |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1404 |
|
2641
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1405 |
lemma fresh_insert_fset: |
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1406 |
fixes x::"'a::fs" |
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1407 |
and S::"'a fset" |
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1408 |
shows "a \<sharp> insert_fset x S \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> S" |
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1409 |
unfolding fresh_def |
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1410 |
by (simp) |
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1411 |
|
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1412 |
lemma fset_finite_supp: |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1413 |
fixes S::"('a::fs) fset" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1414 |
shows "finite (supp S)" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1415 |
by (induct S) (simp_all add: finite_supp) |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1416 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1417 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1418 |
instance fset :: (fs) fs |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1419 |
apply (default) |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1420 |
apply (rule fset_finite_supp) |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1421 |
done |
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1422 |
|
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1423 |
|
2632
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1424 |
section {* Freshness and Fresh-Star *} |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1425 |
|
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1426 |
lemma fresh_Unit_elim: |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1427 |
shows "(a \<sharp> () \<Longrightarrow> PROP C) \<equiv> PROP C" |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1428 |
by (simp add: fresh_Unit) |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1429 |
|
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1430 |
lemma fresh_Pair_elim: |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1431 |
shows "(a \<sharp> (x, y) \<Longrightarrow> PROP C) \<equiv> (a \<sharp> x \<Longrightarrow> a \<sharp> y \<Longrightarrow> PROP C)" |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1432 |
by rule (simp_all add: fresh_Pair) |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1433 |
|
2632
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1434 |
(* this rule needs to be added before the fresh_prodD is *) |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1435 |
(* added to the simplifier with mksimps *) |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1436 |
lemma [simp]: |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1437 |
shows "a \<sharp> x1 \<Longrightarrow> a \<sharp> x2 \<Longrightarrow> a \<sharp> (x1, x2)" |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1438 |
by (simp add: fresh_Pair) |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1439 |
|
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1440 |
lemma fresh_PairD: |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1441 |
shows "a \<sharp> (x, y) \<Longrightarrow> a \<sharp> x" |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1442 |
and "a \<sharp> (x, y) \<Longrightarrow> a \<sharp> y" |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1443 |
by (simp_all add: fresh_Pair) |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1444 |
|
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1445 |
ML {* |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1446 |
val mksimps_pairs = (@{const_name Nominal2_Base.fresh}, @{thms fresh_PairD}) :: mksimps_pairs; |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1447 |
*} |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1448 |
|
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1449 |
declaration {* fn _ => |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1450 |
Simplifier.map_ss (fn ss => ss setmksimps (mksimps mksimps_pairs)) |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1451 |
*} |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1452 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1453 |
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
|
1454 |
induction principles. *} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1455 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1456 |
definition |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1457 |
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
|
1458 |
where |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1459 |
"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
|
1460 |
|
2507 | 1461 |
lemma fresh_star_supp_conv: |
1462 |
shows "supp x \<sharp>* y \<Longrightarrow> supp y \<sharp>* x" |
|
1463 |
by (auto simp add: fresh_star_def fresh_def) |
|
1464 |
||
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1465 |
lemma fresh_star_Pair: |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1466 |
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
|
1467 |
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
|
1468 |
|
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1469 |
lemma fresh_star_list: |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1470 |
shows "as \<sharp>* (xs @ ys) \<longleftrightarrow> as \<sharp>* xs \<and> as \<sharp>* ys" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1471 |
and "as \<sharp>* (x # xs) \<longleftrightarrow> as \<sharp>* x \<and> as \<sharp>* xs" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1472 |
and "as \<sharp>* []" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1473 |
by (auto simp add: fresh_star_def fresh_Nil fresh_Cons fresh_append) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1474 |
|
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1475 |
lemma fresh_star_set: |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1476 |
fixes xs::"('a::fs) list" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1477 |
shows "as \<sharp>* set xs \<longleftrightarrow> as \<sharp>* xs" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1478 |
unfolding fresh_star_def |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1479 |
by (simp add: fresh_set) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1480 |
|
2611
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
parents:
2609
diff
changeset
|
1481 |
lemma fresh_star_singleton: |
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
parents:
2609
diff
changeset
|
1482 |
fixes a::"atom" |
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
parents:
2609
diff
changeset
|
1483 |
shows "as \<sharp>* {a} \<longleftrightarrow> as \<sharp>* a" |
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
parents:
2609
diff
changeset
|
1484 |
by (simp add: fresh_star_def fresh_finite_insert fresh_set_empty) |
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
parents:
2609
diff
changeset
|
1485 |
|
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
parents:
2609
diff
changeset
|
1486 |
lemma fresh_star_fset: |
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
parents:
2609
diff
changeset
|
1487 |
fixes xs::"('a::fs) list" |
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
parents:
2609
diff
changeset
|
1488 |
shows "as \<sharp>* fset S \<longleftrightarrow> as \<sharp>* S" |
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
parents:
2609
diff
changeset
|
1489 |
by (simp add: fresh_star_def fresh_def) |
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
parents:
2609
diff
changeset
|
1490 |
|
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1491 |
lemma fresh_star_Un: |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1492 |
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
|
1493 |
by (auto simp add: fresh_star_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1494 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1495 |
lemma fresh_star_insert: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1496 |
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
|
1497 |
by (auto simp add: fresh_star_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1498 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1499 |
lemma fresh_star_Un_elim: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1500 |
"((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
|
1501 |
unfolding fresh_star_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1502 |
apply(rule) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1503 |
apply(erule meta_mp) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1504 |
apply(auto) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1505 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1506 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1507 |
lemma fresh_star_insert_elim: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1508 |
"(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
|
1509 |
unfolding fresh_star_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1510 |
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
|
1511 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1512 |
lemma fresh_star_empty_elim: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1513 |
"({} \<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
|
1514 |
by (simp add: fresh_star_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1515 |
|
2632
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1516 |
lemma fresh_star_Unit_elim: |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1517 |
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
|
1518 |
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
|
1519 |
|
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1520 |
lemma fresh_star_Pair_elim: |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1521 |
shows "(a \<sharp>* (x, y) \<Longrightarrow> PROP C) \<equiv> (a \<sharp>* x \<Longrightarrow> a \<sharp>* y \<Longrightarrow> PROP C)" |
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1522 |
by (rule, simp_all add: fresh_star_Pair) |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1523 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1524 |
lemma fresh_star_zero: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1525 |
shows "as \<sharp>* (0::perm)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1526 |
unfolding fresh_star_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1527 |
by (simp add: fresh_zero_perm) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1528 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1529 |
lemma fresh_star_plus: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1530 |
fixes p q::perm |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1531 |
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
|
1532 |
unfolding fresh_star_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1533 |
by (simp add: fresh_plus_perm) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1534 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1535 |
lemma fresh_star_permute_iff: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1536 |
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
|
1537 |
unfolding fresh_star_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1538 |
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
|
1539 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1540 |
lemma fresh_star_eqvt: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1541 |
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
|
1542 |
unfolding fresh_star_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1543 |
unfolding Ball_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1544 |
apply(simp add: all_eqvt) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1545 |
apply(subst permute_fun_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1546 |
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
|
1547 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1548 |
|
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1549 |
lemma at_fresh_star_inter: |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1550 |
assumes a: "(p \<bullet> bs) \<sharp>* bs" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1551 |
and b: "finite bs" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1552 |
shows "p \<bullet> bs \<inter> bs = {}" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1553 |
using a b |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1554 |
unfolding fresh_star_def |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1555 |
unfolding fresh_def |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1556 |
by (auto simp add: supp_finite_atom_set) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1557 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1558 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1559 |
section {* Induction principle for permutations *} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1560 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1561 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1562 |
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
|
1563 |
assumes S: "supp p \<subseteq> S" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1564 |
and zero: "P 0" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1565 |
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
|
1566 |
shows "P p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1567 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1568 |
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
|
1569 |
then show "P p" using S |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1570 |
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
|
1571 |
case (psubset p) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1572 |
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
|
1573 |
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
|
1574 |
{ assume "supp p = {}" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1575 |
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
|
1576 |
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
|
1577 |
} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1578 |
moreover |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1579 |
{ assume "supp p \<noteq> {}" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1580 |
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
|
1581 |
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
|
1582 |
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
|
1583 |
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
|
1584 |
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
|
1585 |
moreover |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1586 |
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
|
1587 |
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
|
1588 |
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
|
1589 |
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
|
1590 |
moreover |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1591 |
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
|
1592 |
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
|
1593 |
moreover |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1594 |
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
|
1595 |
ultimately have "P p" by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1596 |
} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1597 |
ultimately show "P p" by blast |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1598 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1599 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1600 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1601 |
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
|
1602 |
assumes zero: "P 0" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1603 |
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
|
1604 |
shows "P p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1605 |
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
|
1606 |
(auto intro: zero swap) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1607 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1608 |
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
|
1609 |
assumes S: "supp p \<subseteq> S" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1610 |
assumes zero: "P 0" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1611 |
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
|
1612 |
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
|
1613 |
shows "P p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1614 |
using S |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1615 |
by (induct p rule: perm_struct_induct) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1616 |
(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
|
1617 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1618 |
lemma supp_perm_eq: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1619 |
assumes "(supp x) \<sharp>* p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1620 |
shows "p \<bullet> x = x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1621 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1622 |
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
|
1623 |
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
|
1624 |
then show "p \<bullet> x = x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1625 |
proof (induct p rule: perm_struct_induct) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1626 |
case zero |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1627 |
show "0 \<bullet> x = x" by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1628 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1629 |
case (swap p a b) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1630 |
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
|
1631 |
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
|
1632 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1633 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1634 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1635 |
lemma supp_perm_eq_test: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1636 |
assumes "(supp x) \<sharp>* p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1637 |
shows "p \<bullet> x = x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1638 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1639 |
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
|
1640 |
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
|
1641 |
then show "p \<bullet> x = x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1642 |
proof (induct p rule: perm_subset_induct) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1643 |
case zero |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1644 |
show "0 \<bullet> x = x" by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1645 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1646 |
case (swap a b) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1647 |
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
|
1648 |
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
|
1649 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1650 |
case (plus p1 p2) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1651 |
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
|
1652 |
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
|
1653 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1654 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1655 |
|
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1656 |
lemma perm_supp_eq: |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1657 |
assumes a: "(supp p) \<sharp>* x" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1658 |
shows "p \<bullet> x = x" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1659 |
by (rule supp_perm_eq) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1660 |
(simp add: fresh_star_supp_conv a) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1661 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1662 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1663 |
section {* Avoiding of atom sets *} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1664 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1665 |
text {* |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1666 |
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
|
1667 |
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
|
1668 |
which 'translates' between both sets. |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1669 |
*} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1670 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1671 |
lemma at_set_avoiding_aux: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1672 |
fixes Xs::"atom set" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1673 |
and As::"atom set" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1674 |
assumes b: "Xs \<subseteq> As" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1675 |
and c: "finite As" |
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1676 |
shows "\<exists>p. (p \<bullet> Xs) \<inter> As = {} \<and> (supp p) = (Xs \<union> (p \<bullet> Xs))" |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1677 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1678 |
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
|
1679 |
then show ?thesis using b |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1680 |
proof (induct rule: finite_subset_induct) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1681 |
case empty |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1682 |
have "0 \<bullet> {} \<inter> As = {}" by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1683 |
moreover |
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1684 |
have "supp (0::perm) = {} \<union> 0 \<bullet> {}" by (simp add: supp_zero_perm) |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1685 |
ultimately show ?case by blast |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1686 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1687 |
case (insert x Xs) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1688 |
then obtain p where |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1689 |
p1: "(p \<bullet> Xs) \<inter> As = {}" and |
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1690 |
p2: "supp p = (Xs \<union> (p \<bullet> Xs))" by blast |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1691 |
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
|
1692 |
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
|
1693 |
hence px: "p \<bullet> x = x" unfolding supp_perm by simp |
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1694 |
have "finite (As \<union> p \<bullet> Xs \<union> supp p)" |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1695 |
using `finite As` `finite Xs` |
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1696 |
by (simp add: permute_set_eq_image finite_supp) |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1697 |
then obtain y where "y \<notin> (As \<union> p \<bullet> Xs \<union> supp p)" "sort_of y = sort_of x" |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1698 |
by (rule obtain_atom) |
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1699 |
hence y: "y \<notin> As" "y \<notin> p \<bullet> Xs" "y \<notin> supp p" "sort_of y = sort_of x" |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1700 |
by simp_all |
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1701 |
hence py: "p \<bullet> y = y" "x \<noteq> y" using `x \<in> As` |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1702 |
by (auto simp add: supp_perm) |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1703 |
let ?q = "(x \<rightleftharpoons> y) + p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1704 |
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
|
1705 |
unfolding insert_eqvt |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1706 |
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
|
1707 |
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
|
1708 |
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
|
1709 |
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
|
1710 |
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
|
1711 |
unfolding q by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1712 |
moreover |
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1713 |
have "supp (x \<rightleftharpoons> y) \<inter> supp p = {}" using px py `sort_of y = sort_of x` |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1714 |
unfolding supp_swap by (simp add: supp_perm) |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1715 |
then have "supp ?q = (supp (x \<rightleftharpoons> y) \<union> supp p)" |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1716 |
by (simp add: supp_plus_perm_eq) |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1717 |
then have "supp ?q = insert x Xs \<union> ?q \<bullet> insert x Xs" |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1718 |
using p2 `sort_of y = sort_of x` `x \<noteq> y` unfolding q supp_swap |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1719 |
by auto |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1720 |
ultimately show ?case by blast |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1721 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1722 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1723 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1724 |
lemma at_set_avoiding: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1725 |
assumes a: "finite Xs" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1726 |
and b: "finite (supp c)" |
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1727 |
obtains p::"perm" where "(p \<bullet> Xs)\<sharp>*c" and "(supp p) = (Xs \<union> (p \<bullet> Xs))" |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1728 |
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
|
1729 |
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
|
1730 |
|
2589
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
1731 |
lemma at_set_avoiding1: |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
1732 |
assumes "finite xs" |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
1733 |
and "finite (supp c)" |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
1734 |
shows "\<exists>p. (p \<bullet> xs) \<sharp>* c" |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
1735 |
using assms |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
1736 |
apply(erule_tac c="c" in at_set_avoiding) |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
1737 |
apply(auto) |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
1738 |
done |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
1739 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1740 |
lemma at_set_avoiding2: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1741 |
assumes "finite xs" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1742 |
and "finite (supp c)" "finite (supp x)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1743 |
and "xs \<sharp>* x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1744 |
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
|
1745 |
using assms |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1746 |
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
|
1747 |
apply(simp add: supp_Pair) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1748 |
apply(rule_tac x="p" in exI) |
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1749 |
apply(simp add: fresh_star_Pair) |
2507 | 1750 |
apply(rule fresh_star_supp_conv) |
1751 |
apply(auto simp add: fresh_star_def) |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1752 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1753 |
|
2573 | 1754 |
lemma at_set_avoiding3: |
1755 |
assumes "finite xs" |
|
1756 |
and "finite (supp c)" "finite (supp x)" |
|
1757 |
and "xs \<sharp>* x" |
|
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1758 |
shows "\<exists>p. (p \<bullet> xs) \<sharp>* c \<and> supp x \<sharp>* p \<and> supp p = xs \<union> (p \<bullet> xs)" |
2586
3ebc7ecfb0dd
disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents:
2573
diff
changeset
|
1759 |
using assms |
3ebc7ecfb0dd
disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents:
2573
diff
changeset
|
1760 |
apply(erule_tac c="(c, x)" in at_set_avoiding) |
3ebc7ecfb0dd
disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents:
2573
diff
changeset
|
1761 |
apply(simp add: supp_Pair) |
3ebc7ecfb0dd
disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents:
2573
diff
changeset
|
1762 |
apply(rule_tac x="p" in exI) |
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1763 |
apply(simp add: fresh_star_Pair) |
2586
3ebc7ecfb0dd
disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents:
2573
diff
changeset
|
1764 |
apply(rule fresh_star_supp_conv) |
3ebc7ecfb0dd
disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents:
2573
diff
changeset
|
1765 |
apply(auto simp add: fresh_star_def) |
3ebc7ecfb0dd
disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents:
2573
diff
changeset
|
1766 |
done |
2573 | 1767 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1768 |
lemma at_set_avoiding2_atom: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1769 |
assumes "finite (supp c)" "finite (supp x)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1770 |
and b: "a \<sharp> x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1771 |
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
|
1772 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1773 |
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
|
1774 |
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
|
1775 |
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
|
1776 |
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
|
1777 |
unfolding fresh_star_def Ball_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1778 |
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
|
1779 |
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
|
1780 |
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
|
1781 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1782 |
|
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1783 |
|
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1784 |
section {* Renaming permutations *} |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1785 |
|
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1786 |
lemma set_renaming_perm: |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1787 |
assumes a: "p \<bullet> bs \<inter> bs = {}" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1788 |
and b: "finite bs" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1789 |
shows "\<exists>q. q \<bullet> bs = p \<bullet> bs \<and> supp q \<subseteq> bs \<union> (p \<bullet> bs)" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1790 |
using b a |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1791 |
proof (induct) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1792 |
case empty |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1793 |
have "0 \<bullet> {} = p \<bullet> {} \<and> supp (0::perm) \<subseteq> {} \<union> p \<bullet> {}" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1794 |
by (simp add: permute_set_eq supp_perm) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1795 |
then show "\<exists>q. q \<bullet> {} = p \<bullet> {} \<and> supp q \<subseteq> {} \<union> p \<bullet> {}" by blast |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1796 |
next |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1797 |
case (insert a bs) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1798 |
then have " \<exists>q. q \<bullet> bs = p \<bullet> bs \<and> supp q \<subseteq> bs \<union> p \<bullet> bs" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1799 |
by (simp add: insert_eqvt) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1800 |
then obtain q where *: "q \<bullet> bs = p \<bullet> bs" and **: "supp q \<subseteq> bs \<union> p \<bullet> bs" by blast |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1801 |
{ assume 1: "q \<bullet> a = p \<bullet> a" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1802 |
have "q \<bullet> insert a bs = p \<bullet> insert a bs" using 1 * by (simp add: insert_eqvt) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1803 |
moreover |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1804 |
have "supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1805 |
using ** by (auto simp add: insert_eqvt) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1806 |
ultimately |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1807 |
have "\<exists>q. q \<bullet> insert a bs = p \<bullet> insert a bs \<and> supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs" by blast |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1808 |
} |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1809 |
moreover |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1810 |
{ assume 2: "q \<bullet> a \<noteq> p \<bullet> a" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1811 |
def q' \<equiv> "((q \<bullet> a) \<rightleftharpoons> (p \<bullet> a)) + q" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1812 |
{ have "(q \<bullet> a) \<notin> (p \<bullet> bs)" using `a \<notin> bs` *[symmetric] by (simp add: mem_permute_iff) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1813 |
moreover |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1814 |
have "(p \<bullet> a) \<notin> (p \<bullet> bs)" using `a \<notin> bs` by (simp add: mem_permute_iff) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1815 |
ultimately |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1816 |
have "q' \<bullet> insert a bs = p \<bullet> insert a bs" using 2 * unfolding q'_def |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1817 |
by (simp add: insert_eqvt swap_set_not_in) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1818 |
} |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1819 |
moreover |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1820 |
{ have "{q \<bullet> a, p \<bullet> a} \<subseteq> insert a bs \<union> p \<bullet> insert a bs" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1821 |
using ** `a \<notin> bs` `p \<bullet> insert a bs \<inter> insert a bs = {}` |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1822 |
by (auto simp add: supp_perm insert_eqvt) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1823 |
then have "supp (q \<bullet> a \<rightleftharpoons> p \<bullet> a) \<subseteq> insert a bs \<union> p \<bullet> insert a bs" by (simp add: supp_swap) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1824 |
moreover |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1825 |
have "supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1826 |
using ** by (auto simp add: insert_eqvt) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1827 |
ultimately |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1828 |
have "supp q' \<subseteq> insert a bs \<union> p \<bullet> insert a bs" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1829 |
unfolding q'_def using supp_plus_perm by blast |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1830 |
} |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1831 |
ultimately |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1832 |
have "\<exists>q. q \<bullet> insert a bs = p \<bullet> insert a bs \<and> supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs" by blast |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1833 |
} |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1834 |
ultimately show "\<exists>q. q \<bullet> insert a bs = p \<bullet> insert a bs \<and> supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1835 |
by blast |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1836 |
qed |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1837 |
|
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1838 |
|
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1839 |
lemma list_renaming_perm: |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1840 |
fixes bs::"atom list" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1841 |
assumes a: "(p \<bullet> (set bs)) \<inter> (set bs) = {}" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1842 |
shows "\<exists>q. q \<bullet> bs = p \<bullet> bs \<and> supp q \<subseteq> (set bs) \<union> (p \<bullet> (set bs))" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1843 |
using a |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1844 |
proof (induct bs) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1845 |
case Nil |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1846 |
have "0 \<bullet> [] = p \<bullet> [] \<and> supp (0::perm) \<subseteq> set [] \<union> p \<bullet> set []" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1847 |
by (simp add: permute_set_eq supp_perm) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1848 |
then show "\<exists>q. q \<bullet> [] = p \<bullet> [] \<and> supp q \<subseteq> set [] \<union> p \<bullet> (set [])" by blast |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1849 |
next |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1850 |
case (Cons a bs) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1851 |
then have " \<exists>q. q \<bullet> bs = p \<bullet> bs \<and> supp q \<subseteq> set bs \<union> p \<bullet> (set bs)" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1852 |
by (simp add: insert_eqvt) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1853 |
then obtain q where *: "q \<bullet> bs = p \<bullet> bs" and **: "supp q \<subseteq> set bs \<union> p \<bullet> (set bs)" by blast |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1854 |
{ assume 1: "a \<in> set bs" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1855 |
have "q \<bullet> a = p \<bullet> a" using * 1 by (induct bs) (auto) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1856 |
then have "q \<bullet> (a # bs) = p \<bullet> (a # bs)" using * by simp |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1857 |
moreover |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1858 |
have "supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))" using ** by (auto simp add: insert_eqvt) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1859 |
ultimately |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1860 |
have "\<exists>q. q \<bullet> (a # bs) = p \<bullet> (a # bs) \<and> supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))" by blast |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1861 |
} |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1862 |
moreover |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1863 |
{ assume 2: "a \<notin> set bs" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1864 |
def q' \<equiv> "((q \<bullet> a) \<rightleftharpoons> (p \<bullet> a)) + q" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1865 |
{ have "(q \<bullet> a) \<sharp> (p \<bullet> bs)" using `a \<notin> set bs` *[symmetric] |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1866 |
by (simp add: fresh_permute_iff) (simp add: fresh_def supp_of_atom_list) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1867 |
moreover |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1868 |
have "(p \<bullet> a) \<sharp> (p \<bullet> bs)" using `a \<notin> set bs` |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1869 |
by (simp add: fresh_permute_iff) (simp add: fresh_def supp_of_atom_list) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1870 |
ultimately |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1871 |
have "q' \<bullet> (a # bs) = p \<bullet> (a # bs)" using 2 * unfolding q'_def |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1872 |
by (simp add: swap_fresh_fresh) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1873 |
} |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1874 |
moreover |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1875 |
{ have "{q \<bullet> a, p \<bullet> a} \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1876 |
using ** `a \<notin> set bs` `p \<bullet> (set (a # bs)) \<inter> set (a # bs) = {}` |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1877 |
by (auto simp add: supp_perm insert_eqvt) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1878 |
then have "supp (q \<bullet> a \<rightleftharpoons> p \<bullet> a) \<subseteq> set (a # bs) \<union> p \<bullet> set (a # bs)" by (simp add: supp_swap) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1879 |
moreover |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1880 |
have "supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1881 |
using ** by (auto simp add: insert_eqvt) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1882 |
ultimately |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1883 |
have "supp q' \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1884 |
unfolding q'_def using supp_plus_perm by blast |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1885 |
} |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1886 |
ultimately |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1887 |
have "\<exists>q. q \<bullet> (a # bs) = p \<bullet> (a # bs) \<and> supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))" by blast |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1888 |
} |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1889 |
ultimately show "\<exists>q. q \<bullet> (a # bs) = p \<bullet> (a # bs) \<and> supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1890 |
by blast |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1891 |
qed |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1892 |
|
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
1893 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1894 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1895 |
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
|
1896 |
|
1972 | 1897 |
text {* |
1898 |
Class @{text at_base} allows types containing multiple sorts of atoms. |
|
1899 |
Class @{text at} only allows types with a single sort. |
|
1900 |
*} |
|
1901 |
||
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
|
1902 |
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
|
1903 |
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
|
1904 |
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
|
1905 |
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
|
1906 |
|
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
|
1907 |
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
|
1908 |
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
|
1909 |
|
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
|
1910 |
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
|
1911 |
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
|
1912 |
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
|
1913 |
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
|
1914 |
|
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
|
1915 |
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
|
1916 |
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
|
1917 |
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
|
1918 |
|
2609
666ffc8a92a9
freshness theorem in strong exhausts; (temporarily includes a cheat_tac to make all tests go through)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
1919 |
lemma fresh_atom_at_base: |
666ffc8a92a9
freshness theorem in strong exhausts; (temporarily includes a cheat_tac to make all tests go through)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
1920 |
fixes b::"'a::at_base" |
666ffc8a92a9
freshness theorem in strong exhausts; (temporarily includes a cheat_tac to make all tests go through)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
1921 |
shows "a \<sharp> atom b \<longleftrightarrow> a \<sharp> b" |
666ffc8a92a9
freshness theorem in strong exhausts; (temporarily includes a cheat_tac to make all tests go through)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
1922 |
by (simp add: fresh_def supp_at_base supp_atom) |
666ffc8a92a9
freshness theorem in strong exhausts; (temporarily includes a cheat_tac to make all tests go through)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
1923 |
|
2611
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
parents:
2609
diff
changeset
|
1924 |
lemma fresh_star_atom_at_base: |
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
parents:
2609
diff
changeset
|
1925 |
fixes b::"'a::at_base" |
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
parents:
2609
diff
changeset
|
1926 |
shows "as \<sharp>* atom b \<longleftrightarrow> as \<sharp>* b" |
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
parents:
2609
diff
changeset
|
1927 |
by (simp add: fresh_star_def fresh_atom_at_base) |
2609
666ffc8a92a9
freshness theorem in strong exhausts; (temporarily includes a cheat_tac to make all tests go through)
Christian Urban <urbanc@in.tum.de>
parents:
2599
diff
changeset
|
1928 |
|
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
|
1929 |
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
|
1930 |
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
|
1931 |
|
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
|
1932 |
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
|
1933 |
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
|
1934 |
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
|
1935 |
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
|
1936 |
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
|
1937 |
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
|
1938 |
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
|
1939 |
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
|
1940 |
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
|
1941 |
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
|
1942 |
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
|
1943 |
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
|
1944 |
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
|
1945 |
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
|
1946 |
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
|
1947 |
|
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
|
1948 |
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
|
1949 |
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
|
1950 |
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
|
1951 |
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
|
1952 |
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
|
1953 |
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
|
1954 |
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
|
1955 |
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
|
1956 |
|
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
|
1957 |
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
|
1958 |
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
|
1959 |
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
|
1960 |
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
|
1961 |
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
|
1962 |
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
|
1963 |
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
|
1964 |
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
|
1965 |
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
|
1966 |
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
|
1967 |
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
|
1968 |
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
|
1969 |
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
|
1970 |
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
|
1971 |
|
1973
fc5ce7f22b74
use the more general type-class at_base
Christian Urban <urbanc@in.tum.de>
parents:
1972
diff
changeset
|
1972 |
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
|
1973 |
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
|
1974 |
shows "supp S = atom ` S" |
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1975 |
apply(simp add: supp_of_finite_sets[OF a]) |
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1976 |
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
|
1977 |
apply(auto) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1978 |
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
|
1979 |
|
2467
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1980 |
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
|
1981 |
|
2467
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1982 |
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
|
1983 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1984 |
definition |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1985 |
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
|
1986 |
where |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1987 |
"(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
|
1988 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1989 |
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
|
1990 |
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
|
1991 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1992 |
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
|
1993 |
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
|
1994 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1995 |
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
|
1996 |
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
|
1997 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
1998 |
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
|
1999 |
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
|
2000 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2001 |
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
|
2002 |
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
|
2003 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2004 |
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
|
2005 |
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
|
2006 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2007 |
lemma flip_eqvt: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2008 |
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
|
2009 |
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
|
2010 |
unfolding flip_def |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2011 |
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
|
2012 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2013 |
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
|
2014 |
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
|
2015 |
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
|
2016 |
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
|
2017 |
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
|
2018 |
unfolding flip_def |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2019 |
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
|
2020 |
unfolding atom_eqvt [symmetric] |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2021 |
by simp_all |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2022 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2023 |
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
|
2024 |
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
|
2025 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2026 |
lemma permute_flip_at: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2027 |
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
|
2028 |
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
|
2029 |
unfolding flip_def |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2030 |
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
|
2031 |
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
|
2032 |
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
|
2033 |
done |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2034 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2035 |
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
|
2036 |
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
|
2037 |
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
|
2038 |
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
|
2039 |
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
|
2040 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2041 |
lemma flip_fresh_fresh: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2042 |
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
|
2043 |
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
|
2044 |
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
|
2045 |
using assms |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2046 |
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
|
2047 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2048 |
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
|
2049 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2050 |
syntax |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2051 |
"_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
|
2052 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2053 |
translations |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2054 |
"_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
|
2055 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2056 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2057 |
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
|
2058 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2059 |
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
|
2060 |
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
|
2061 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2062 |
text {* |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2063 |
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
|
2064 |
*} |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2065 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2066 |
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
|
2067 |
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
|
2068 |
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
|
2069 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2070 |
lemma exists_eq_sort: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2071 |
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
|
2072 |
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
|
2073 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2074 |
lemma at_base_class: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2075 |
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
|
2076 |
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
|
2077 |
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
|
2078 |
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
|
2079 |
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
|
2080 |
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
|
2081 |
proof |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2082 |
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
|
2083 |
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
|
2084 |
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
|
2085 |
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
|
2086 |
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
|
2087 |
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
|
2088 |
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
|
2089 |
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
|
2090 |
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
|
2091 |
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
|
2092 |
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
|
2093 |
qed |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2094 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2095 |
(* |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2096 |
lemma at_class: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2097 |
fixes s :: atom_sort |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2098 |
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
|
2099 |
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
|
2100 |
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
|
2101 |
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
|
2102 |
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
|
2103 |
proof |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2104 |
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
|
2105 |
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
|
2106 |
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
|
2107 |
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
|
2108 |
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
|
2109 |
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
|
2110 |
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
|
2111 |
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
|
2112 |
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
|
2113 |
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
|
2114 |
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
|
2115 |
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
|
2116 |
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
|
2117 |
qed |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2118 |
*) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2119 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2120 |
lemma at_class: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2121 |
fixes s :: atom_sort |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2122 |
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
|
2123 |
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
|
2124 |
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
|
2125 |
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
|
2126 |
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
|
2127 |
proof |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2128 |
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
|
2129 |
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
|
2130 |
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
|
2131 |
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
|
2132 |
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
|
2133 |
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
|
2134 |
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
|
2135 |
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
|
2136 |
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
|
2137 |
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
|
2138 |
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
|
2139 |
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
|
2140 |
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
|
2141 |
qed |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2142 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2143 |
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
|
2144 |
(@{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
|
2145 |
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
|
2146 |
(@{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
|
2147 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2148 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2149 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2150 |
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
|
2151 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2152 |
lemma freshness_lemma: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2153 |
fixes h :: "'a::at \<Rightarrow> 'b::pt" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2154 |
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
|
2155 |
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
|
2156 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2157 |
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
|
2158 |
by (auto simp add: fresh_Pair) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2159 |
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
|
2160 |
proof (intro exI allI impI) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2161 |
fix a :: 'a |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2162 |
assume a3: "atom a \<sharp> h" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2163 |
show "h a = h b" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2164 |
proof (cases "a = b") |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2165 |
assume "a = b" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2166 |
thus "h a = h b" by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2167 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2168 |
assume "a \<noteq> b" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2169 |
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
|
2170 |
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
|
2171 |
by (rule fresh_fun_app) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2172 |
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
|
2173 |
by (rule swap_fresh_fresh) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2174 |
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
|
2175 |
by (rule swap_fresh_fresh) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2176 |
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
|
2177 |
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
|
2178 |
by (rule permute_fun_app_eq) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2179 |
also have "\<dots> = h a" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2180 |
using d2 by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2181 |
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
|
2182 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2183 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2184 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2185 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2186 |
lemma freshness_lemma_unique: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2187 |
fixes h :: "'a::at \<Rightarrow> 'b::pt" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2188 |
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
|
2189 |
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
|
2190 |
proof (rule ex_ex1I) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2191 |
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
|
2192 |
by (rule freshness_lemma) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2193 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2194 |
fix x y |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2195 |
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
|
2196 |
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
|
2197 |
from a x y show "x = y" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2198 |
by (auto simp add: fresh_Pair) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2199 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2200 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2201 |
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
|
2202 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2203 |
definition |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2204 |
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
|
2205 |
where |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2206 |
"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
|
2207 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2208 |
lemma fresh_fun_apply: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2209 |
fixes h :: "'a::at \<Rightarrow> 'b::pt" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2210 |
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
|
2211 |
assumes b: "atom a \<sharp> h" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2212 |
shows "fresh_fun h = h a" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2213 |
unfolding fresh_fun_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2214 |
proof (rule the_equality) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2215 |
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
|
2216 |
proof (intro strip) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2217 |
fix a':: 'a |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2218 |
assume c: "atom a' \<sharp> h" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2219 |
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
|
2220 |
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
|
2221 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2222 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2223 |
fix fr :: 'b |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2224 |
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
|
2225 |
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
|
2226 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2227 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2228 |
lemma fresh_fun_apply': |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2229 |
fixes h :: "'a::at \<Rightarrow> 'b::pt" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2230 |
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
|
2231 |
shows "fresh_fun h = h a" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2232 |
apply (rule fresh_fun_apply) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2233 |
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
|
2234 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2235 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2236 |
lemma fresh_fun_eqvt: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2237 |
fixes h :: "'a::at \<Rightarrow> 'b::pt" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2238 |
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
|
2239 |
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
|
2240 |
using a |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2241 |
apply (clarsimp simp add: fresh_Pair) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2242 |
apply (subst fresh_fun_apply', assumption+) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2243 |
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
|
2244 |
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
|
2245 |
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
|
2246 |
apply (erule (1) fresh_fun_apply' [symmetric]) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2247 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2248 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2249 |
lemma fresh_fun_supports: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2250 |
fixes h :: "'a::at \<Rightarrow> 'b::pt" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2251 |
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
|
2252 |
shows "(supp h) supports (fresh_fun h)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2253 |
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
|
2254 |
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
|
2255 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2256 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2257 |
notation fresh_fun (binder "FRESH " 10) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2258 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2259 |
lemma FRESH_f_iff: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2260 |
fixes P :: "'a::at \<Rightarrow> 'b::pure" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2261 |
fixes f :: "'b \<Rightarrow> 'c::pure" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2262 |
assumes P: "finite (supp P)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2263 |
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
|
2264 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2265 |
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
|
2266 |
using P by (rule obtain_at_base) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2267 |
hence "atom a \<sharp> P" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2268 |
by (simp add: fresh_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2269 |
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
|
2270 |
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
|
2271 |
apply (cut_tac `atom a \<sharp> P`) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2272 |
apply (simp add: fresh_conv_MOST) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2273 |
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
|
2274 |
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
|
2275 |
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
|
2276 |
apply (rule refl) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2277 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2278 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2279 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2280 |
lemma FRESH_binop_iff: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2281 |
fixes P :: "'a::at \<Rightarrow> 'b::pure" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2282 |
fixes Q :: "'a::at \<Rightarrow> 'c::pure" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2283 |
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
|
2284 |
assumes P: "finite (supp P)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2285 |
and Q: "finite (supp Q)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2286 |
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
|
2287 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2288 |
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
|
2289 |
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
|
2290 |
by (rule obtain_at_base) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2291 |
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
|
2292 |
by (simp_all add: fresh_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2293 |
show ?thesis |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2294 |
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
|
2295 |
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
|
2296 |
apply (simp add: fresh_conv_MOST) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2297 |
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
|
2298 |
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
|
2299 |
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
|
2300 |
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
|
2301 |
apply (rule refl) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2302 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2303 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2304 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2305 |
lemma FRESH_conj_iff: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2306 |
fixes P Q :: "'a::at \<Rightarrow> bool" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2307 |
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
|
2308 |
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
|
2309 |
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
|
2310 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2311 |
lemma FRESH_disj_iff: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2312 |
fixes P Q :: "'a::at \<Rightarrow> bool" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2313 |
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
|
2314 |
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
|
2315 |
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
|
2316 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2317 |
|
2467
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2318 |
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
|
2319 |
|
1833
2050b5723c04
added a library for basic nominal functions; separated nominal_eqvt file
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
2320 |
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
|
2321 |
|
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
2322 |
|
2467
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2323 |
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
|
2324 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2325 |
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
|
2326 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2327 |
use "nominal_atoms.ML" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2328 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2329 |
|
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
2330 |
|
1062 | 2331 |
end |