author | Christian Urban <urbanc@in.tum.de> |
Tue, 14 Jun 2011 19:11:44 +0100 | |
changeset 2849 | 31c338d562fd |
parent 2848 | da7e6655cd4c |
child 2868 | 2b8e387d2dfc |
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" |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
11 |
uses ("nominal_basics.ML") |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
12 |
("nominal_thmdecls.ML") |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
13 |
("nominal_permeq.ML") |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
14 |
("nominal_library.ML") |
2467
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
15 |
("nominal_atoms.ML") |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
16 |
("nominal_eqvt.ML") |
1062 | 17 |
begin |
18 |
||
19 |
section {* Atoms and Sorts *} |
|
20 |
||
21 |
text {* A simple implementation for atom_sorts is strings. *} |
|
22 |
(* types atom_sort = string *) |
|
23 |
||
24 |
text {* To deal with Church-like binding we use trees of |
|
25 |
strings as sorts. *} |
|
26 |
||
27 |
datatype atom_sort = Sort "string" "atom_sort list" |
|
28 |
||
29 |
datatype atom = Atom atom_sort nat |
|
30 |
||
31 |
||
32 |
text {* Basic projection function. *} |
|
33 |
||
34 |
primrec |
|
35 |
sort_of :: "atom \<Rightarrow> atom_sort" |
|
36 |
where |
|
2742 | 37 |
"sort_of (Atom s n) = s" |
1062 | 38 |
|
1930
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
39 |
primrec |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
40 |
nat_of :: "atom \<Rightarrow> nat" |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
41 |
where |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
42 |
"nat_of (Atom s n) = n" |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
43 |
|
1062 | 44 |
|
45 |
text {* There are infinitely many atoms of each sort. *} |
|
46 |
lemma INFM_sort_of_eq: |
|
47 |
shows "INFM a. sort_of a = s" |
|
48 |
proof - |
|
49 |
have "INFM i. sort_of (Atom s i) = s" by simp |
|
50 |
moreover have "inj (Atom s)" by (simp add: inj_on_def) |
|
51 |
ultimately show "INFM a. sort_of a = s" by (rule INFM_inj) |
|
52 |
qed |
|
53 |
||
54 |
lemma infinite_sort_of_eq: |
|
55 |
shows "infinite {a. sort_of a = s}" |
|
56 |
using INFM_sort_of_eq unfolding INFM_iff_infinite . |
|
57 |
||
58 |
lemma atom_infinite [simp]: |
|
59 |
shows "infinite (UNIV :: atom set)" |
|
60 |
using subset_UNIV infinite_sort_of_eq |
|
61 |
by (rule infinite_super) |
|
62 |
||
63 |
lemma obtain_atom: |
|
64 |
fixes X :: "atom set" |
|
65 |
assumes X: "finite X" |
|
66 |
obtains a where "a \<notin> X" "sort_of a = s" |
|
67 |
proof - |
|
68 |
from X have "MOST a. a \<notin> X" |
|
69 |
unfolding MOST_iff_cofinite by simp |
|
70 |
with INFM_sort_of_eq |
|
71 |
have "INFM a. sort_of a = s \<and> a \<notin> X" |
|
72 |
by (rule INFM_conjI) |
|
73 |
then obtain a where "a \<notin> X" "sort_of a = s" |
|
74 |
by (auto elim: INFM_E) |
|
75 |
then show ?thesis .. |
|
76 |
qed |
|
77 |
||
1930
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
78 |
lemma atom_components_eq_iff: |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
79 |
fixes a b :: atom |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
80 |
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
|
81 |
by (induct a, induct b, simp) |
f189cf2c0987
moved some lemmas into the right places
Christian Urban <urbanc@in.tum.de>
parents:
1879
diff
changeset
|
82 |
|
2735 | 83 |
|
1062 | 84 |
section {* Sort-Respecting Permutations *} |
85 |
||
86 |
typedef perm = |
|
87 |
"{f. bij f \<and> finite {a. f a \<noteq> a} \<and> (\<forall>a. sort_of (f a) = sort_of a)}" |
|
88 |
proof |
|
89 |
show "id \<in> ?perm" by simp |
|
90 |
qed |
|
91 |
||
92 |
lemma permI: |
|
93 |
assumes "bij f" and "MOST x. f x = x" and "\<And>a. sort_of (f a) = sort_of a" |
|
94 |
shows "f \<in> perm" |
|
95 |
using assms unfolding perm_def MOST_iff_cofinite by simp |
|
96 |
||
97 |
lemma perm_is_bij: "f \<in> perm \<Longrightarrow> bij f" |
|
98 |
unfolding perm_def by simp |
|
99 |
||
100 |
lemma perm_is_finite: "f \<in> perm \<Longrightarrow> finite {a. f a \<noteq> a}" |
|
101 |
unfolding perm_def by simp |
|
102 |
||
103 |
lemma perm_is_sort_respecting: "f \<in> perm \<Longrightarrow> sort_of (f a) = sort_of a" |
|
104 |
unfolding perm_def by simp |
|
105 |
||
106 |
lemma perm_MOST: "f \<in> perm \<Longrightarrow> MOST x. f x = x" |
|
107 |
unfolding perm_def MOST_iff_cofinite by simp |
|
108 |
||
109 |
lemma perm_id: "id \<in> perm" |
|
110 |
unfolding perm_def by simp |
|
111 |
||
112 |
lemma perm_comp: |
|
113 |
assumes f: "f \<in> perm" and g: "g \<in> perm" |
|
114 |
shows "(f \<circ> g) \<in> perm" |
|
115 |
apply (rule permI) |
|
116 |
apply (rule bij_comp) |
|
117 |
apply (rule perm_is_bij [OF g]) |
|
118 |
apply (rule perm_is_bij [OF f]) |
|
119 |
apply (rule MOST_rev_mp [OF perm_MOST [OF g]]) |
|
120 |
apply (rule MOST_rev_mp [OF perm_MOST [OF f]]) |
|
121 |
apply (simp) |
|
122 |
apply (simp add: perm_is_sort_respecting [OF f]) |
|
123 |
apply (simp add: perm_is_sort_respecting [OF g]) |
|
124 |
done |
|
125 |
||
126 |
lemma perm_inv: |
|
127 |
assumes f: "f \<in> perm" |
|
128 |
shows "(inv f) \<in> perm" |
|
129 |
apply (rule permI) |
|
130 |
apply (rule bij_imp_bij_inv) |
|
131 |
apply (rule perm_is_bij [OF f]) |
|
132 |
apply (rule MOST_mono [OF perm_MOST [OF f]]) |
|
133 |
apply (erule subst, rule inv_f_f) |
|
134 |
apply (rule bij_is_inj [OF perm_is_bij [OF f]]) |
|
135 |
apply (rule perm_is_sort_respecting [OF f, THEN sym, THEN trans]) |
|
136 |
apply (simp add: surj_f_inv_f [OF bij_is_surj [OF perm_is_bij [OF f]]]) |
|
137 |
done |
|
138 |
||
139 |
lemma bij_Rep_perm: "bij (Rep_perm p)" |
|
140 |
using Rep_perm [of p] unfolding perm_def by simp |
|
141 |
||
142 |
lemma finite_Rep_perm: "finite {a. Rep_perm p a \<noteq> a}" |
|
143 |
using Rep_perm [of p] unfolding perm_def by simp |
|
144 |
||
145 |
lemma sort_of_Rep_perm: "sort_of (Rep_perm p a) = sort_of a" |
|
146 |
using Rep_perm [of p] unfolding perm_def by simp |
|
147 |
||
148 |
lemma Rep_perm_ext: |
|
149 |
"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
|
150 |
by (simp add: fun_eq_iff Rep_perm_inject [symmetric]) |
1062 | 151 |
|
2560
82e37a4595c7
automated permute_bn functions (raw ones first)
Christian Urban <urbanc@in.tum.de>
parents:
2507
diff
changeset
|
152 |
instance perm :: size .. |
1062 | 153 |
|
2735 | 154 |
|
2732 | 155 |
subsection {* Permutations form a (multiplicative) group *} |
156 |
||
1062 | 157 |
instantiation perm :: group_add |
158 |
begin |
|
159 |
||
160 |
definition |
|
161 |
"0 = Abs_perm id" |
|
162 |
||
163 |
definition |
|
164 |
"- p = Abs_perm (inv (Rep_perm p))" |
|
165 |
||
166 |
definition |
|
167 |
"p + q = Abs_perm (Rep_perm p \<circ> Rep_perm q)" |
|
168 |
||
169 |
definition |
|
170 |
"(p1::perm) - p2 = p1 + - p2" |
|
171 |
||
172 |
lemma Rep_perm_0: "Rep_perm 0 = id" |
|
173 |
unfolding zero_perm_def |
|
174 |
by (simp add: Abs_perm_inverse perm_id) |
|
175 |
||
176 |
lemma Rep_perm_add: |
|
177 |
"Rep_perm (p1 + p2) = Rep_perm p1 \<circ> Rep_perm p2" |
|
178 |
unfolding plus_perm_def |
|
179 |
by (simp add: Abs_perm_inverse perm_comp Rep_perm) |
|
180 |
||
181 |
lemma Rep_perm_uminus: |
|
182 |
"Rep_perm (- p) = inv (Rep_perm p)" |
|
183 |
unfolding uminus_perm_def |
|
184 |
by (simp add: Abs_perm_inverse perm_inv Rep_perm) |
|
185 |
||
186 |
instance |
|
187 |
apply default |
|
188 |
unfolding Rep_perm_inject [symmetric] |
|
189 |
unfolding minus_perm_def |
|
190 |
unfolding Rep_perm_add |
|
191 |
unfolding Rep_perm_uminus |
|
192 |
unfolding Rep_perm_0 |
|
193 |
by (simp_all add: o_assoc inv_o_cancel [OF bij_is_inj [OF bij_Rep_perm]]) |
|
194 |
||
195 |
end |
|
196 |
||
197 |
||
198 |
section {* Implementation of swappings *} |
|
199 |
||
200 |
definition |
|
201 |
swap :: "atom \<Rightarrow> atom \<Rightarrow> perm" ("'(_ \<rightleftharpoons> _')") |
|
202 |
where |
|
203 |
"(a \<rightleftharpoons> b) = |
|
204 |
Abs_perm (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 |
||
208 |
lemma Rep_perm_swap: |
|
209 |
"Rep_perm (a \<rightleftharpoons> b) = |
|
210 |
(if sort_of a = sort_of b |
|
211 |
then (\<lambda>c. if a = c then b else if b = c then a else c) |
|
212 |
else id)" |
|
213 |
unfolding swap_def |
|
214 |
apply (rule Abs_perm_inverse) |
|
215 |
apply (rule permI) |
|
216 |
apply (auto simp add: bij_def inj_on_def surj_def)[1] |
|
217 |
apply (rule MOST_rev_mp [OF MOST_neq(1) [of a]]) |
|
218 |
apply (rule MOST_rev_mp [OF MOST_neq(1) [of b]]) |
|
219 |
apply (simp) |
|
220 |
apply (simp) |
|
221 |
done |
|
222 |
||
223 |
lemmas Rep_perm_simps = |
|
224 |
Rep_perm_0 |
|
225 |
Rep_perm_add |
|
226 |
Rep_perm_uminus |
|
227 |
Rep_perm_swap |
|
228 |
||
229 |
lemma swap_different_sorts [simp]: |
|
230 |
"sort_of a \<noteq> sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) = 0" |
|
231 |
by (rule Rep_perm_ext) (simp add: Rep_perm_simps) |
|
232 |
||
233 |
lemma swap_cancel: |
|
2679
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
234 |
shows "(a \<rightleftharpoons> b) + (a \<rightleftharpoons> b) = 0" |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
235 |
and "(a \<rightleftharpoons> b) + (b \<rightleftharpoons> a) = 0" |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
236 |
by (rule_tac [!] Rep_perm_ext) |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
237 |
(simp_all add: Rep_perm_simps fun_eq_iff) |
1062 | 238 |
|
239 |
lemma swap_self [simp]: |
|
240 |
"(a \<rightleftharpoons> a) = 0" |
|
2479
a9b6a00b1ba0
updated to Isabelle Sept 16
Christian Urban <urbanc@in.tum.de>
parents:
2475
diff
changeset
|
241 |
by (rule Rep_perm_ext, simp add: Rep_perm_simps fun_eq_iff) |
1062 | 242 |
|
243 |
lemma minus_swap [simp]: |
|
244 |
"- (a \<rightleftharpoons> b) = (a \<rightleftharpoons> b)" |
|
2679
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
245 |
by (rule minus_unique [OF swap_cancel(1)]) |
1062 | 246 |
|
247 |
lemma swap_commute: |
|
248 |
"(a \<rightleftharpoons> b) = (b \<rightleftharpoons> a)" |
|
249 |
by (rule Rep_perm_ext) |
|
2479
a9b6a00b1ba0
updated to Isabelle Sept 16
Christian Urban <urbanc@in.tum.de>
parents:
2475
diff
changeset
|
250 |
(simp add: Rep_perm_swap fun_eq_iff) |
1062 | 251 |
|
252 |
lemma swap_triple: |
|
253 |
assumes "a \<noteq> b" and "c \<noteq> b" |
|
254 |
assumes "sort_of a = sort_of b" "sort_of b = sort_of c" |
|
255 |
shows "(a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c) = (a \<rightleftharpoons> b)" |
|
256 |
using assms |
|
257 |
by (rule_tac Rep_perm_ext) |
|
2479
a9b6a00b1ba0
updated to Isabelle Sept 16
Christian Urban <urbanc@in.tum.de>
parents:
2475
diff
changeset
|
258 |
(auto simp add: Rep_perm_simps fun_eq_iff) |
1062 | 259 |
|
260 |
||
261 |
section {* Permutation Types *} |
|
262 |
||
263 |
text {* |
|
264 |
Infix syntax for @{text permute} has higher precedence than |
|
265 |
addition, but lower than unary minus. |
|
266 |
*} |
|
267 |
||
268 |
class pt = |
|
269 |
fixes permute :: "perm \<Rightarrow> 'a \<Rightarrow> 'a" ("_ \<bullet> _" [76, 75] 75) |
|
270 |
assumes permute_zero [simp]: "0 \<bullet> x = x" |
|
271 |
assumes permute_plus [simp]: "(p + q) \<bullet> x = p \<bullet> (q \<bullet> x)" |
|
272 |
begin |
|
273 |
||
274 |
lemma permute_diff [simp]: |
|
275 |
shows "(p - q) \<bullet> x = p \<bullet> - q \<bullet> x" |
|
276 |
unfolding diff_minus by simp |
|
277 |
||
278 |
lemma permute_minus_cancel [simp]: |
|
279 |
shows "p \<bullet> - p \<bullet> x = x" |
|
280 |
and "- p \<bullet> p \<bullet> x = x" |
|
281 |
unfolding permute_plus [symmetric] by simp_all |
|
282 |
||
283 |
lemma permute_swap_cancel [simp]: |
|
284 |
shows "(a \<rightleftharpoons> b) \<bullet> (a \<rightleftharpoons> b) \<bullet> x = x" |
|
285 |
unfolding permute_plus [symmetric] |
|
286 |
by (simp add: swap_cancel) |
|
287 |
||
288 |
lemma permute_swap_cancel2 [simp]: |
|
289 |
shows "(a \<rightleftharpoons> b) \<bullet> (b \<rightleftharpoons> a) \<bullet> x = x" |
|
290 |
unfolding permute_plus [symmetric] |
|
291 |
by (simp add: swap_commute) |
|
292 |
||
293 |
lemma inj_permute [simp]: |
|
294 |
shows "inj (permute p)" |
|
295 |
by (rule inj_on_inverseI) |
|
296 |
(rule permute_minus_cancel) |
|
297 |
||
298 |
lemma surj_permute [simp]: |
|
299 |
shows "surj (permute p)" |
|
300 |
by (rule surjI, rule permute_minus_cancel) |
|
301 |
||
302 |
lemma bij_permute [simp]: |
|
303 |
shows "bij (permute p)" |
|
304 |
by (rule bijI [OF inj_permute surj_permute]) |
|
305 |
||
306 |
lemma inv_permute: |
|
307 |
shows "inv (permute p) = permute (- p)" |
|
308 |
by (rule inv_equality) (simp_all) |
|
309 |
||
310 |
lemma permute_minus: |
|
311 |
shows "permute (- p) = inv (permute p)" |
|
312 |
by (simp add: inv_permute) |
|
313 |
||
314 |
lemma permute_eq_iff [simp]: |
|
315 |
shows "p \<bullet> x = p \<bullet> y \<longleftrightarrow> x = y" |
|
316 |
by (rule inj_permute [THEN inj_eq]) |
|
317 |
||
318 |
end |
|
319 |
||
320 |
subsection {* Permutations for atoms *} |
|
321 |
||
322 |
instantiation atom :: pt |
|
323 |
begin |
|
324 |
||
325 |
definition |
|
1879 | 326 |
"p \<bullet> a = (Rep_perm p) a" |
1062 | 327 |
|
328 |
instance |
|
329 |
apply(default) |
|
330 |
apply(simp_all add: permute_atom_def Rep_perm_simps) |
|
331 |
done |
|
332 |
||
333 |
end |
|
334 |
||
335 |
lemma sort_of_permute [simp]: |
|
336 |
shows "sort_of (p \<bullet> a) = sort_of a" |
|
337 |
unfolding permute_atom_def by (rule sort_of_Rep_perm) |
|
338 |
||
339 |
lemma swap_atom: |
|
340 |
shows "(a \<rightleftharpoons> b) \<bullet> c = |
|
341 |
(if sort_of a = sort_of b |
|
342 |
then (if c = a then b else if c = b then a else c) else c)" |
|
343 |
unfolding permute_atom_def |
|
344 |
by (simp add: Rep_perm_swap) |
|
345 |
||
346 |
lemma swap_atom_simps [simp]: |
|
347 |
"sort_of a = sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> a = b" |
|
348 |
"sort_of a = sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> b = a" |
|
349 |
"c \<noteq> a \<Longrightarrow> c \<noteq> b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> c = c" |
|
350 |
unfolding swap_atom by simp_all |
|
351 |
||
2732 | 352 |
lemma perm_eq_iff: |
1062 | 353 |
fixes p q :: "perm" |
354 |
shows "p = q \<longleftrightarrow> (\<forall>a::atom. p \<bullet> a = q \<bullet> a)" |
|
355 |
unfolding permute_atom_def |
|
356 |
by (metis Rep_perm_ext ext) |
|
357 |
||
358 |
||
359 |
subsection {* Permutations for permutations *} |
|
360 |
||
361 |
instantiation perm :: pt |
|
362 |
begin |
|
363 |
||
364 |
definition |
|
365 |
"p \<bullet> q = p + q - p" |
|
366 |
||
367 |
instance |
|
368 |
apply default |
|
369 |
apply (simp add: permute_perm_def) |
|
370 |
apply (simp add: permute_perm_def diff_minus minus_add add_assoc) |
|
371 |
done |
|
372 |
||
373 |
end |
|
374 |
||
1879 | 375 |
lemma permute_self: |
376 |
shows "p \<bullet> p = p" |
|
377 |
unfolding permute_perm_def |
|
378 |
by (simp add: diff_minus add_assoc) |
|
1062 | 379 |
|
2732 | 380 |
lemma pemute_minus_self: |
381 |
shows "- p \<bullet> p = p" |
|
382 |
unfolding permute_perm_def |
|
383 |
by (simp add: diff_minus add_assoc) |
|
384 |
||
1062 | 385 |
|
386 |
subsection {* Permutations for functions *} |
|
387 |
||
388 |
instantiation "fun" :: (pt, pt) pt |
|
389 |
begin |
|
390 |
||
391 |
definition |
|
392 |
"p \<bullet> f = (\<lambda>x. p \<bullet> (f (- p \<bullet> x)))" |
|
393 |
||
394 |
instance |
|
395 |
apply default |
|
396 |
apply (simp add: permute_fun_def) |
|
397 |
apply (simp add: permute_fun_def minus_add) |
|
398 |
done |
|
399 |
||
400 |
end |
|
401 |
||
402 |
lemma permute_fun_app_eq: |
|
403 |
shows "p \<bullet> (f x) = (p \<bullet> f) (p \<bullet> x)" |
|
1879 | 404 |
unfolding permute_fun_def by simp |
1062 | 405 |
|
2663
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
406 |
|
1062 | 407 |
subsection {* Permutations for booleans *} |
408 |
||
409 |
instantiation bool :: pt |
|
410 |
begin |
|
411 |
||
412 |
definition "p \<bullet> (b::bool) = b" |
|
413 |
||
414 |
instance |
|
415 |
apply(default) |
|
416 |
apply(simp_all add: permute_bool_def) |
|
417 |
done |
|
418 |
||
419 |
end |
|
420 |
||
1557
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents:
1305
diff
changeset
|
421 |
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
|
422 |
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
|
423 |
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
|
424 |
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
|
425 |
|
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
parents:
1305
diff
changeset
|
426 |
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
|
427 |
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
|
428 |
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
|
429 |
by(simp add: permute_bool_def) |
1062 | 430 |
|
431 |
subsection {* Permutations for sets *} |
|
432 |
||
433 |
lemma permute_set_eq: |
|
434 |
fixes x::"'a::pt" |
|
435 |
shows "(p \<bullet> X) = {p \<bullet> x | x. x \<in> X}" |
|
1879 | 436 |
unfolding permute_fun_def |
437 |
unfolding permute_bool_def |
|
438 |
apply(auto simp add: mem_def) |
|
1062 | 439 |
apply(rule_tac x="- p \<bullet> x" in exI) |
440 |
apply(simp) |
|
441 |
done |
|
442 |
||
443 |
lemma permute_set_eq_image: |
|
444 |
shows "p \<bullet> X = permute p ` X" |
|
1879 | 445 |
unfolding permute_set_eq by auto |
1062 | 446 |
|
447 |
lemma permute_set_eq_vimage: |
|
448 |
shows "p \<bullet> X = permute (- p) -` X" |
|
1879 | 449 |
unfolding permute_fun_def permute_bool_def |
450 |
unfolding vimage_def Collect_def mem_def .. |
|
1062 | 451 |
|
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
452 |
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
|
453 |
shows "finite (p \<bullet> X) = finite X" |
2735 | 454 |
unfolding permute_set_eq_vimage |
455 |
using bij_permute by (rule finite_vimage_iff) |
|
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
456 |
|
1062 | 457 |
lemma swap_set_not_in: |
458 |
assumes a: "a \<notin> S" "b \<notin> S" |
|
459 |
shows "(a \<rightleftharpoons> b) \<bullet> S = S" |
|
1879 | 460 |
unfolding permute_set_eq |
461 |
using a by (auto simp add: swap_atom) |
|
1062 | 462 |
|
463 |
lemma swap_set_in: |
|
464 |
assumes a: "a \<in> S" "b \<notin> S" "sort_of a = sort_of b" |
|
465 |
shows "(a \<rightleftharpoons> b) \<bullet> S \<noteq> S" |
|
1879 | 466 |
unfolding permute_set_eq |
467 |
using a by (auto simp add: swap_atom) |
|
1062 | 468 |
|
2669
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
469 |
lemma swap_set_in_eq: |
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
470 |
assumes a: "a \<in> S" "b \<notin> S" "sort_of a = sort_of b" |
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
471 |
shows "(a \<rightleftharpoons> b) \<bullet> S = (S - {a}) \<union> {b}" |
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
472 |
unfolding permute_set_eq |
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
473 |
using a by (auto simp add: swap_atom) |
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
474 |
|
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
475 |
lemma swap_set_both_in: |
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
476 |
assumes a: "a \<in> S" "b \<in> S" |
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
477 |
shows "(a \<rightleftharpoons> b) \<bullet> S = S" |
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
478 |
unfolding permute_set_eq |
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
479 |
using a by (auto simp add: swap_atom) |
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
480 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
481 |
lemma mem_permute_iff: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
482 |
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
|
483 |
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
|
484 |
by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
485 |
|
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
486 |
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
|
487 |
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
|
488 |
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
|
489 |
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
|
490 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
491 |
lemma insert_eqvt: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
492 |
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
|
493 |
unfolding permute_set_eq_image image_insert .. |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
494 |
|
2735 | 495 |
|
496 |
subsection {* Permutations for @{typ unit} *} |
|
1062 | 497 |
|
498 |
instantiation unit :: pt |
|
499 |
begin |
|
500 |
||
501 |
definition "p \<bullet> (u::unit) = u" |
|
502 |
||
1879 | 503 |
instance |
504 |
by (default) (simp_all add: permute_unit_def) |
|
1062 | 505 |
|
506 |
end |
|
507 |
||
508 |
||
509 |
subsection {* Permutations for products *} |
|
510 |
||
2378
2f13fe48c877
updated to new Isabelle; made FSet more "quiet"
Christian Urban <urbanc@in.tum.de>
parents:
2310
diff
changeset
|
511 |
instantiation prod :: (pt, pt) pt |
1062 | 512 |
begin |
513 |
||
514 |
primrec |
|
515 |
permute_prod |
|
516 |
where |
|
517 |
Pair_eqvt: "p \<bullet> (x, y) = (p \<bullet> x, p \<bullet> y)" |
|
518 |
||
519 |
instance |
|
520 |
by default auto |
|
521 |
||
522 |
end |
|
523 |
||
524 |
subsection {* Permutations for sums *} |
|
525 |
||
2378
2f13fe48c877
updated to new Isabelle; made FSet more "quiet"
Christian Urban <urbanc@in.tum.de>
parents:
2310
diff
changeset
|
526 |
instantiation sum :: (pt, pt) pt |
1062 | 527 |
begin |
528 |
||
529 |
primrec |
|
530 |
permute_sum |
|
531 |
where |
|
532 |
"p \<bullet> (Inl x) = Inl (p \<bullet> x)" |
|
533 |
| "p \<bullet> (Inr y) = Inr (p \<bullet> y)" |
|
534 |
||
1879 | 535 |
instance |
536 |
by (default) (case_tac [!] x, simp_all) |
|
1062 | 537 |
|
538 |
end |
|
539 |
||
2735 | 540 |
subsection {* Permutations for @{typ "'a list"} *} |
1062 | 541 |
|
542 |
instantiation list :: (pt) pt |
|
543 |
begin |
|
544 |
||
545 |
primrec |
|
546 |
permute_list |
|
547 |
where |
|
548 |
"p \<bullet> [] = []" |
|
549 |
| "p \<bullet> (x # xs) = p \<bullet> x # p \<bullet> xs" |
|
550 |
||
1879 | 551 |
instance |
552 |
by (default) (induct_tac [!] x, simp_all) |
|
1062 | 553 |
|
554 |
end |
|
555 |
||
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
556 |
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
|
557 |
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
|
558 |
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
|
559 |
|
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
560 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
561 |
|
2735 | 562 |
subsection {* Permutations for @{typ "'a option"} *} |
1062 | 563 |
|
564 |
instantiation option :: (pt) pt |
|
565 |
begin |
|
566 |
||
567 |
primrec |
|
568 |
permute_option |
|
569 |
where |
|
570 |
"p \<bullet> None = None" |
|
571 |
| "p \<bullet> (Some x) = Some (p \<bullet> x)" |
|
572 |
||
1879 | 573 |
instance |
574 |
by (default) (induct_tac [!] x, simp_all) |
|
1062 | 575 |
|
576 |
end |
|
577 |
||
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
578 |
|
2735 | 579 |
subsection {* Permutations for @{typ "'a fset"} *} |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
580 |
|
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
581 |
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
|
582 |
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
|
583 |
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
|
584 |
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
|
585 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
586 |
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
|
587 |
begin |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
588 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
589 |
quotient_definition |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
590 |
"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
|
591 |
is |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
592 |
"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
|
593 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
594 |
instance |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
595 |
proof |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
596 |
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
|
597 |
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
|
598 |
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
|
599 |
qed |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
600 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
601 |
end |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
602 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
603 |
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
|
604 |
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
|
605 |
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
|
606 |
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
|
607 |
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
|
608 |
|
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
609 |
lemma fset_eqvt: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
610 |
shows "p \<bullet> (fset S) = fset (p \<bullet> S)" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
611 |
by (lifting set_eqvt) |
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
612 |
|
2735 | 613 |
|
1062 | 614 |
subsection {* Permutations for @{typ char}, @{typ nat}, and @{typ int} *} |
615 |
||
616 |
instantiation char :: pt |
|
617 |
begin |
|
618 |
||
619 |
definition "p \<bullet> (c::char) = c" |
|
620 |
||
1879 | 621 |
instance |
622 |
by (default) (simp_all add: permute_char_def) |
|
1062 | 623 |
|
624 |
end |
|
625 |
||
626 |
instantiation nat :: pt |
|
627 |
begin |
|
628 |
||
629 |
definition "p \<bullet> (n::nat) = n" |
|
630 |
||
1879 | 631 |
instance |
632 |
by (default) (simp_all add: permute_nat_def) |
|
1062 | 633 |
|
634 |
end |
|
635 |
||
636 |
instantiation int :: pt |
|
637 |
begin |
|
638 |
||
639 |
definition "p \<bullet> (i::int) = i" |
|
640 |
||
1879 | 641 |
instance |
642 |
by (default) (simp_all add: permute_int_def) |
|
1062 | 643 |
|
644 |
end |
|
645 |
||
646 |
||
647 |
section {* Pure types *} |
|
648 |
||
649 |
text {* Pure types will have always empty support. *} |
|
650 |
||
651 |
class pure = pt + |
|
652 |
assumes permute_pure: "p \<bullet> x = x" |
|
653 |
||
654 |
text {* Types @{typ unit} and @{typ bool} are pure. *} |
|
655 |
||
656 |
instance unit :: pure |
|
657 |
proof qed (rule permute_unit_def) |
|
658 |
||
659 |
instance bool :: pure |
|
660 |
proof qed (rule permute_bool_def) |
|
661 |
||
2635
64b4cb2c2bf8
simple cases for string rule inductions
Christian Urban <urbanc@in.tum.de>
parents:
2632
diff
changeset
|
662 |
|
1062 | 663 |
text {* Other type constructors preserve purity. *} |
664 |
||
665 |
instance "fun" :: (pure, pure) pure |
|
666 |
by default (simp add: permute_fun_def permute_pure) |
|
667 |
||
2378
2f13fe48c877
updated to new Isabelle; made FSet more "quiet"
Christian Urban <urbanc@in.tum.de>
parents:
2310
diff
changeset
|
668 |
instance prod :: (pure, pure) pure |
1062 | 669 |
by default (induct_tac x, simp add: permute_pure) |
670 |
||
2378
2f13fe48c877
updated to new Isabelle; made FSet more "quiet"
Christian Urban <urbanc@in.tum.de>
parents:
2310
diff
changeset
|
671 |
instance sum :: (pure, pure) pure |
1062 | 672 |
by default (induct_tac x, simp_all add: permute_pure) |
673 |
||
674 |
instance list :: (pure) pure |
|
675 |
by default (induct_tac x, simp_all add: permute_pure) |
|
676 |
||
677 |
instance option :: (pure) pure |
|
678 |
by default (induct_tac x, simp_all add: permute_pure) |
|
679 |
||
680 |
||
681 |
subsection {* Types @{typ char}, @{typ nat}, and @{typ int} *} |
|
682 |
||
683 |
instance char :: pure |
|
684 |
proof qed (rule permute_char_def) |
|
685 |
||
686 |
instance nat :: pure |
|
687 |
proof qed (rule permute_nat_def) |
|
688 |
||
689 |
instance int :: pure |
|
690 |
proof qed (rule permute_int_def) |
|
691 |
||
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
692 |
|
2735 | 693 |
section {* Infrastructure for Equivariance and Perm_simp *} |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
694 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
695 |
subsection {* Basic functions about permutations *} |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
696 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
697 |
use "nominal_basics.ML" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
698 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
699 |
|
2735 | 700 |
subsection {* Eqvt infrastructure *} |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
701 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
702 |
text {* Setup of the theorem attributes @{text eqvt} and @{text eqvt_raw} *} |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
703 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
704 |
use "nominal_thmdecls.ML" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
705 |
setup "Nominal_ThmDecls.setup" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
706 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
707 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
708 |
lemmas [eqvt] = |
2735 | 709 |
(* pt types *) |
710 |
permute_prod.simps |
|
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
711 |
permute_list.simps |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
712 |
permute_option.simps |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
713 |
permute_sum.simps |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
714 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
715 |
(* sets *) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
716 |
empty_eqvt insert_eqvt set_eqvt |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
717 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
718 |
(* fsets *) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
719 |
permute_fset fset_eqvt |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
720 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
721 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
722 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
723 |
subsection {* perm_simp infrastructure *} |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
724 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
725 |
definition |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
726 |
"unpermute p = permute (- p)" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
727 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
728 |
lemma eqvt_apply: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
729 |
fixes f :: "'a::pt \<Rightarrow> 'b::pt" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
730 |
and x :: "'a::pt" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
731 |
shows "p \<bullet> (f x) \<equiv> (p \<bullet> f) (p \<bullet> x)" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
732 |
unfolding permute_fun_def by simp |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
733 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
734 |
lemma eqvt_lambda: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
735 |
fixes f :: "'a::pt \<Rightarrow> 'b::pt" |
2753
445518561867
eqvt_lambda without eta-expansion
Christian Urban <urbanc@in.tum.de>
parents:
2743
diff
changeset
|
736 |
shows "p \<bullet> f \<equiv> (\<lambda>x. p \<bullet> (f (unpermute p x)))" |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
737 |
unfolding permute_fun_def unpermute_def by simp |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
738 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
739 |
lemma eqvt_bound: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
740 |
shows "p \<bullet> unpermute p x \<equiv> x" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
741 |
unfolding unpermute_def by simp |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
742 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
743 |
text {* provides perm_simp methods *} |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
744 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
745 |
use "nominal_permeq.ML" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
746 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
747 |
method_setup perm_simp = |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
748 |
{* Nominal_Permeq.args_parser >> Nominal_Permeq.perm_simp_meth *} |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
749 |
{* pushes permutations inside. *} |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
750 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
751 |
method_setup perm_strict_simp = |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
752 |
{* Nominal_Permeq.args_parser >> Nominal_Permeq.perm_strict_simp_meth *} |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
753 |
{* pushes permutations inside, raises an error if it cannot solve all permutations. *} |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
754 |
|
2735 | 755 |
|
756 |
subsubsection {* Equivariance for permutations and swapping *} |
|
757 |
||
758 |
lemma permute_eqvt: |
|
759 |
shows "p \<bullet> (q \<bullet> x) = (p \<bullet> q) \<bullet> (p \<bullet> x)" |
|
760 |
unfolding permute_perm_def by simp |
|
761 |
||
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
762 |
(* the normal version of this lemma would cause loops *) |
2776 | 763 |
lemma permute_eqvt_raw [eqvt_raw]: |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
764 |
shows "p \<bullet> permute \<equiv> permute" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
765 |
apply(simp add: fun_eq_iff permute_fun_def) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
766 |
apply(subst permute_eqvt) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
767 |
apply(simp) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
768 |
done |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
769 |
|
2735 | 770 |
lemma zero_perm_eqvt [eqvt]: |
771 |
shows "p \<bullet> (0::perm) = 0" |
|
772 |
unfolding permute_perm_def by simp |
|
773 |
||
774 |
lemma add_perm_eqvt [eqvt]: |
|
775 |
fixes p p1 p2 :: perm |
|
776 |
shows "p \<bullet> (p1 + p2) = p \<bullet> p1 + p \<bullet> p2" |
|
777 |
unfolding permute_perm_def |
|
778 |
by (simp add: perm_eq_iff) |
|
779 |
||
780 |
lemma swap_eqvt [eqvt]: |
|
781 |
shows "p \<bullet> (a \<rightleftharpoons> b) = (p \<bullet> a \<rightleftharpoons> p \<bullet> b)" |
|
782 |
unfolding permute_perm_def |
|
783 |
by (auto simp add: swap_atom perm_eq_iff) |
|
784 |
||
785 |
lemma uminus_eqvt [eqvt]: |
|
786 |
fixes p q::"perm" |
|
787 |
shows "p \<bullet> (- q) = - (p \<bullet> q)" |
|
788 |
unfolding permute_perm_def |
|
789 |
by (simp add: diff_minus minus_add add_assoc) |
|
790 |
||
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
791 |
subsubsection {* Equivariance of Logical Operators *} |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
792 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
793 |
lemma eq_eqvt [eqvt]: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
794 |
shows "p \<bullet> (x = y) \<longleftrightarrow> (p \<bullet> x) = (p \<bullet> y)" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
795 |
unfolding permute_eq_iff permute_bool_def .. |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
796 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
797 |
lemma Not_eqvt [eqvt]: |
2735 | 798 |
shows "p \<bullet> (\<not> A) \<longleftrightarrow> \<not> (p \<bullet> A)" |
799 |
by (simp add: permute_bool_def) |
|
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
800 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
801 |
lemma conj_eqvt [eqvt]: |
2735 | 802 |
shows "p \<bullet> (A \<and> B) \<longleftrightarrow> (p \<bullet> A) \<and> (p \<bullet> B)" |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
803 |
by (simp add: permute_bool_def) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
804 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
805 |
lemma imp_eqvt [eqvt]: |
2735 | 806 |
shows "p \<bullet> (A \<longrightarrow> B) \<longleftrightarrow> (p \<bullet> A) \<longrightarrow> (p \<bullet> B)" |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
807 |
by (simp add: permute_bool_def) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
808 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
809 |
declare imp_eqvt[folded induct_implies_def, eqvt] |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
810 |
|
2743
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
parents:
2742
diff
changeset
|
811 |
lemma all_eqvt [eqvt]: |
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
parents:
2742
diff
changeset
|
812 |
shows "p \<bullet> (\<forall>x. P x) = (\<forall>x. (p \<bullet> P) x)" |
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
parents:
2742
diff
changeset
|
813 |
unfolding All_def |
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
parents:
2742
diff
changeset
|
814 |
by (perm_simp) (rule refl) |
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
parents:
2742
diff
changeset
|
815 |
|
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
parents:
2742
diff
changeset
|
816 |
declare all_eqvt[folded induct_forall_def, eqvt] |
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
parents:
2742
diff
changeset
|
817 |
|
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
818 |
lemma ex_eqvt [eqvt]: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
819 |
shows "p \<bullet> (\<exists>x. P x) = (\<exists>x. (p \<bullet> P) x)" |
2743
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
parents:
2742
diff
changeset
|
820 |
unfolding Ex_def |
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
parents:
2742
diff
changeset
|
821 |
by (perm_simp) (rule refl) |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
822 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
823 |
lemma ex1_eqvt [eqvt]: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
824 |
shows "p \<bullet> (\<exists>!x. P x) = (\<exists>!x. (p \<bullet> P) x)" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
825 |
unfolding Ex1_def |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
826 |
by (perm_simp) (rule refl) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
827 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
828 |
lemma if_eqvt [eqvt]: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
829 |
shows "p \<bullet> (if b then x else y) = (if p \<bullet> b then p \<bullet> x else p \<bullet> y)" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
830 |
by (simp add: permute_fun_def permute_bool_def) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
831 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
832 |
lemma True_eqvt [eqvt]: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
833 |
shows "p \<bullet> True = True" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
834 |
unfolding permute_bool_def .. |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
835 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
836 |
lemma False_eqvt [eqvt]: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
837 |
shows "p \<bullet> False = False" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
838 |
unfolding permute_bool_def .. |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
839 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
840 |
lemma disj_eqvt [eqvt]: |
2735 | 841 |
shows "p \<bullet> (A \<or> B) \<longleftrightarrow> (p \<bullet> A) \<or> (p \<bullet> B)" |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
842 |
by (simp add: permute_bool_def) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
843 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
844 |
lemma all_eqvt2: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
845 |
shows "p \<bullet> (\<forall>x. P x) = (\<forall>x. p \<bullet> P (- p \<bullet> x))" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
846 |
by (perm_simp add: permute_minus_cancel) (rule refl) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
847 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
848 |
lemma ex_eqvt2: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
849 |
shows "p \<bullet> (\<exists>x. P x) = (\<exists>x. p \<bullet> P (- p \<bullet> x))" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
850 |
by (perm_simp add: permute_minus_cancel) (rule refl) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
851 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
852 |
lemma ex1_eqvt2: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
853 |
shows "p \<bullet> (\<exists>!x. P x) = (\<exists>!x. p \<bullet> P (- p \<bullet> x))" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
854 |
by (perm_simp add: permute_minus_cancel) (rule refl) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
855 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
856 |
lemma the_eqvt: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
857 |
assumes unique: "\<exists>!x. P x" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
858 |
shows "(p \<bullet> (THE x. P x)) = (THE x. (p \<bullet> P) x)" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
859 |
apply(rule the1_equality [symmetric]) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
860 |
apply(rule_tac p="-p" in permute_boolE) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
861 |
apply(perm_simp add: permute_minus_cancel) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
862 |
apply(rule unique) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
863 |
apply(rule_tac p="-p" in permute_boolE) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
864 |
apply(perm_simp add: permute_minus_cancel) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
865 |
apply(rule theI'[OF unique]) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
866 |
done |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
867 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
868 |
lemma the_eqvt2: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
869 |
assumes unique: "\<exists>!x. P x" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
870 |
shows "(p \<bullet> (THE x. P x)) = (THE x. p \<bullet> P (- p \<bullet> x))" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
871 |
apply(rule the1_equality [symmetric]) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
872 |
apply(simp add: ex1_eqvt2[symmetric]) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
873 |
apply(simp add: permute_bool_def unique) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
874 |
apply(simp add: permute_bool_def) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
875 |
apply(rule theI'[OF unique]) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
876 |
done |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
877 |
|
2776 | 878 |
subsubsection {* Equivariance of Set operators *} |
879 |
||
880 |
lemma mem_eqvt [eqvt]: |
|
881 |
shows "p \<bullet> (x \<in> A) \<longleftrightarrow> (p \<bullet> x) \<in> (p \<bullet> A)" |
|
882 |
unfolding mem_def |
|
883 |
by (rule permute_fun_app_eq) |
|
884 |
||
885 |
lemma Collect_eqvt [eqvt]: |
|
886 |
shows "p \<bullet> {x. P x} = {x. (p \<bullet> P) x}" |
|
887 |
unfolding Collect_def permute_fun_def .. |
|
888 |
||
889 |
lemma inter_eqvt [eqvt]: |
|
890 |
shows "p \<bullet> (A \<inter> B) = (p \<bullet> A) \<inter> (p \<bullet> B)" |
|
891 |
unfolding Int_def |
|
892 |
by (perm_simp) (rule refl) |
|
2735 | 893 |
|
894 |
lemma Bex_eqvt [eqvt]: |
|
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
895 |
shows "p \<bullet> (\<exists>x \<in> S. P x) = (\<exists>x \<in> (p \<bullet> S). (p \<bullet> P) x)" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
896 |
unfolding Bex_def |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
897 |
by (perm_simp) (rule refl) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
898 |
|
2735 | 899 |
lemma Ball_eqvt [eqvt]: |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
900 |
shows "p \<bullet> (\<forall>x \<in> S. P x) = (\<forall>x \<in> (p \<bullet> S). (p \<bullet> P) x)" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
901 |
unfolding Ball_def |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
902 |
by (perm_simp) (rule refl) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
903 |
|
2776 | 904 |
lemma image_eqvt [eqvt]: |
905 |
shows "p \<bullet> (f ` A) = (p \<bullet> f) ` (p \<bullet> A)" |
|
906 |
unfolding image_def |
|
907 |
by (perm_simp) (rule refl) |
|
908 |
||
2735 | 909 |
lemma UNIV_eqvt [eqvt]: |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
910 |
shows "p \<bullet> UNIV = UNIV" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
911 |
unfolding UNIV_def |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
912 |
by (perm_simp) (rule refl) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
913 |
|
2735 | 914 |
lemma union_eqvt [eqvt]: |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
915 |
shows "p \<bullet> (A \<union> B) = (p \<bullet> A) \<union> (p \<bullet> B)" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
916 |
unfolding Un_def |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
917 |
by (perm_simp) (rule refl) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
918 |
|
2735 | 919 |
lemma Diff_eqvt [eqvt]: |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
920 |
fixes A B :: "'a::pt set" |
2735 | 921 |
shows "p \<bullet> (A - B) = (p \<bullet> A) - (p \<bullet> B)" |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
922 |
unfolding set_diff_eq |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
923 |
by (perm_simp) (rule refl) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
924 |
|
2735 | 925 |
lemma Compl_eqvt [eqvt]: |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
926 |
fixes A :: "'a::pt set" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
927 |
shows "p \<bullet> (- A) = - (p \<bullet> A)" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
928 |
unfolding Compl_eq_Diff_UNIV |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
929 |
by (perm_simp) (rule refl) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
930 |
|
2735 | 931 |
lemma subset_eqvt [eqvt]: |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
932 |
shows "p \<bullet> (S \<subseteq> T) \<longleftrightarrow> (p \<bullet> S) \<subseteq> (p \<bullet> T)" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
933 |
unfolding subset_eq |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
934 |
by (perm_simp) (rule refl) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
935 |
|
2735 | 936 |
lemma psubset_eqvt [eqvt]: |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
937 |
shows "p \<bullet> (S \<subset> T) \<longleftrightarrow> (p \<bullet> S) \<subset> (p \<bullet> T)" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
938 |
unfolding psubset_eq |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
939 |
by (perm_simp) (rule refl) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
940 |
|
2735 | 941 |
lemma vimage_eqvt [eqvt]: |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
942 |
shows "p \<bullet> (f -` A) = (p \<bullet> f) -` (p \<bullet> A)" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
943 |
unfolding vimage_def |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
944 |
by (perm_simp) (rule refl) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
945 |
|
2735 | 946 |
lemma Union_eqvt [eqvt]: |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
947 |
shows "p \<bullet> (\<Union> S) = \<Union> (p \<bullet> S)" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
948 |
unfolding Union_eq |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
949 |
by (perm_simp) (rule refl) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
950 |
|
2777
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
951 |
lemma Inter_eqvt [eqvt]: |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
952 |
shows "p \<bullet> (\<Inter> S) = \<Inter> (p \<bullet> S)" |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
953 |
unfolding Inter_eq |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
954 |
by (perm_simp) (rule refl) |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
955 |
|
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
956 |
|
2735 | 957 |
(* FIXME: eqvt attribute *) |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
958 |
lemma Sigma_eqvt: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
959 |
shows "(p \<bullet> (X \<times> Y)) = (p \<bullet> X) \<times> (p \<bullet> Y)" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
960 |
unfolding Sigma_def |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
961 |
unfolding UNION_eq_Union_image |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
962 |
by (perm_simp) (rule refl) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
963 |
|
2777
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
964 |
text {* |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
965 |
In order to prove that lfp is equivariant we need two |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
966 |
auxiliary classes which specify that (op <=) and |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
967 |
Inf are equivariant. Instances for bool and fun are |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
968 |
given. |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
969 |
*} |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
970 |
|
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
971 |
class le_eqvt = order + |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
972 |
assumes le_eqvt [eqvt]: "p \<bullet> (x \<le> y) = ((p \<bullet> x) \<le> (p \<bullet> (y::('a::{pt, order}))))" |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
973 |
|
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
974 |
class inf_eqvt = complete_lattice + |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
975 |
assumes inf_eqvt [eqvt]: "p \<bullet> (Inf X) = Inf (p \<bullet> (X::('a::{pt, Inf}) set))" |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
976 |
|
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
977 |
instantiation bool :: le_eqvt |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
978 |
begin |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
979 |
|
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
980 |
instance |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
981 |
apply(default) |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
982 |
unfolding le_bool_def |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
983 |
apply(perm_simp) |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
984 |
apply(rule refl) |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
985 |
done |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
986 |
|
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
987 |
end |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
988 |
|
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
989 |
instantiation "fun" :: (pt, le_eqvt) le_eqvt |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
990 |
begin |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
991 |
|
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
992 |
instance |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
993 |
apply(default) |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
994 |
unfolding le_fun_def |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
995 |
apply(perm_simp) |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
996 |
apply(rule refl) |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
997 |
done |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
998 |
|
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
999 |
end |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1000 |
|
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1001 |
instantiation bool :: inf_eqvt |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1002 |
begin |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1003 |
|
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1004 |
instance |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1005 |
apply(default) |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1006 |
unfolding Inf_bool_def |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1007 |
apply(perm_simp) |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1008 |
apply(rule refl) |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1009 |
done |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1010 |
|
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1011 |
end |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1012 |
|
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1013 |
instantiation "fun" :: (pt, inf_eqvt) inf_eqvt |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1014 |
begin |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1015 |
|
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1016 |
instance |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1017 |
apply(default) |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1018 |
unfolding Inf_fun_def |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1019 |
apply(perm_simp) |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1020 |
apply(rule refl) |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1021 |
done |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1022 |
|
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1023 |
end |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1024 |
|
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1025 |
lemma lfp_eqvt [eqvt]: |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1026 |
fixes F::"('a \<Rightarrow> 'b) \<Rightarrow> ('a::pt \<Rightarrow> 'b::{inf_eqvt, le_eqvt})" |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1027 |
shows "p \<bullet> (lfp F) = lfp (p \<bullet> F)" |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1028 |
unfolding lfp_def |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1029 |
by (perm_simp) (rule refl) |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1030 |
|
2735 | 1031 |
lemma finite_eqvt [eqvt]: |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1032 |
shows "p \<bullet> finite A = finite (p \<bullet> A)" |
2777
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1033 |
unfolding finite_def |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1034 |
by (perm_simp) (rule refl) |
75a95431cd8b
proved that lfp is equivariant (that simplifies equivariance proofs of inductively defined predicates)
Christian Urban <urbanc@in.tum.de>
parents:
2771
diff
changeset
|
1035 |
|
2735 | 1036 |
|
1037 |
subsubsection {* Equivariance for product operations *} |
|
1038 |
||
1039 |
lemma fst_eqvt [eqvt]: |
|
2776 | 1040 |
shows "p \<bullet> (fst x) = fst (p \<bullet> x)" |
1041 |
by (cases x) simp |
|
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1042 |
|
2735 | 1043 |
lemma snd_eqvt [eqvt]: |
2776 | 1044 |
shows "p \<bullet> (snd x) = snd (p \<bullet> x)" |
1045 |
by (cases x) simp |
|
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1046 |
|
2735 | 1047 |
lemma split_eqvt [eqvt]: |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1048 |
shows "p \<bullet> (split P x) = split (p \<bullet> P) (p \<bullet> x)" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1049 |
unfolding split_def |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1050 |
by (perm_simp) (rule refl) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1051 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1052 |
|
2735 | 1053 |
subsubsection {* Equivariance for list operations *} |
1054 |
||
1055 |
lemma append_eqvt [eqvt]: |
|
1056 |
shows "p \<bullet> (xs @ ys) = (p \<bullet> xs) @ (p \<bullet> ys)" |
|
1057 |
by (induct xs) auto |
|
1058 |
||
1059 |
lemma rev_eqvt [eqvt]: |
|
1060 |
shows "p \<bullet> (rev xs) = rev (p \<bullet> xs)" |
|
1061 |
by (induct xs) (simp_all add: append_eqvt) |
|
1062 |
||
1063 |
lemma map_eqvt [eqvt]: |
|
1064 |
shows "p \<bullet> (map f xs) = map (p \<bullet> f) (p \<bullet> xs)" |
|
1065 |
by (induct xs) (simp_all, simp only: permute_fun_app_eq) |
|
1066 |
||
1067 |
lemma removeAll_eqvt [eqvt]: |
|
1068 |
shows "p \<bullet> (removeAll x xs) = removeAll (p \<bullet> x) (p \<bullet> xs)" |
|
1069 |
by (induct xs) (auto) |
|
1070 |
||
1071 |
lemma filter_eqvt [eqvt]: |
|
1072 |
shows "p \<bullet> (filter f xs) = filter (p \<bullet> f) (p \<bullet> xs)" |
|
1073 |
apply(induct xs) |
|
1074 |
apply(simp) |
|
1075 |
apply(simp only: filter.simps permute_list.simps if_eqvt) |
|
1076 |
apply(simp only: permute_fun_app_eq) |
|
1077 |
done |
|
1078 |
||
1079 |
lemma distinct_eqvt [eqvt]: |
|
1080 |
shows "p \<bullet> (distinct xs) = distinct (p \<bullet> xs)" |
|
1081 |
apply(induct xs) |
|
1082 |
apply(simp add: permute_bool_def) |
|
1083 |
apply(simp add: conj_eqvt Not_eqvt mem_eqvt set_eqvt) |
|
1084 |
done |
|
1085 |
||
1086 |
lemma length_eqvt [eqvt]: |
|
1087 |
shows "p \<bullet> (length xs) = length (p \<bullet> xs)" |
|
1088 |
by (induct xs) (simp_all add: permute_pure) |
|
1089 |
||
1090 |
||
1091 |
subsubsection {* Equivariance for @{typ "'a fset"} *} |
|
1092 |
||
1093 |
lemma in_fset_eqvt [eqvt]: |
|
1094 |
shows "(p \<bullet> (x |\<in>| S)) = ((p \<bullet> x) |\<in>| (p \<bullet> S))" |
|
1095 |
unfolding in_fset |
|
1096 |
by (perm_simp) (simp) |
|
1097 |
||
1098 |
lemma union_fset_eqvt [eqvt]: |
|
1099 |
shows "(p \<bullet> (S |\<union>| T)) = ((p \<bullet> S) |\<union>| (p \<bullet> T))" |
|
2776 | 1100 |
by (induct S) (simp_all) |
2735 | 1101 |
|
1102 |
lemma map_fset_eqvt [eqvt]: |
|
1103 |
shows "p \<bullet> (map_fset f S) = map_fset (p \<bullet> f) (p \<bullet> S)" |
|
1104 |
by (lifting map_eqvt) |
|
1105 |
||
1106 |
||
1107 |
section {* Supp, Freshness and Supports *} |
|
1062 | 1108 |
|
1109 |
context pt |
|
1110 |
begin |
|
1111 |
||
1112 |
definition |
|
1113 |
supp :: "'a \<Rightarrow> atom set" |
|
1114 |
where |
|
1115 |
"supp x = {a. infinite {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x}}" |
|
1116 |
||
1117 |
definition |
|
2732 | 1118 |
fresh :: "atom \<Rightarrow> 'a \<Rightarrow> bool" ("_ \<sharp> _" [55, 55] 55) |
1062 | 1119 |
where |
1120 |
"a \<sharp> x \<equiv> a \<notin> supp x" |
|
1121 |
||
2732 | 1122 |
end |
1123 |
||
1062 | 1124 |
lemma supp_conv_fresh: |
1125 |
shows "supp x = {a. \<not> a \<sharp> x}" |
|
1126 |
unfolding fresh_def by simp |
|
1127 |
||
1128 |
lemma swap_rel_trans: |
|
1129 |
assumes "sort_of a = sort_of b" |
|
1130 |
assumes "sort_of b = sort_of c" |
|
1131 |
assumes "(a \<rightleftharpoons> c) \<bullet> x = x" |
|
1132 |
assumes "(b \<rightleftharpoons> c) \<bullet> x = x" |
|
1133 |
shows "(a \<rightleftharpoons> b) \<bullet> x = x" |
|
1134 |
proof (cases) |
|
1135 |
assume "a = b \<or> c = b" |
|
1136 |
with assms show "(a \<rightleftharpoons> b) \<bullet> x = x" by auto |
|
1137 |
next |
|
1138 |
assume *: "\<not> (a = b \<or> c = b)" |
|
1139 |
have "((a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c)) \<bullet> x = x" |
|
1140 |
using assms by simp |
|
1141 |
also have "(a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c) = (a \<rightleftharpoons> b)" |
|
1142 |
using assms * by (simp add: swap_triple) |
|
1143 |
finally show "(a \<rightleftharpoons> b) \<bullet> x = x" . |
|
1144 |
qed |
|
1145 |
||
1146 |
lemma swap_fresh_fresh: |
|
1147 |
assumes a: "a \<sharp> x" |
|
1148 |
and b: "b \<sharp> x" |
|
1149 |
shows "(a \<rightleftharpoons> b) \<bullet> x = x" |
|
1150 |
proof (cases) |
|
1151 |
assume asm: "sort_of a = sort_of b" |
|
1152 |
have "finite {c. (a \<rightleftharpoons> c) \<bullet> x \<noteq> x}" "finite {c. (b \<rightleftharpoons> c) \<bullet> x \<noteq> x}" |
|
1153 |
using a b unfolding fresh_def supp_def by simp_all |
|
1154 |
then have "finite ({c. (a \<rightleftharpoons> c) \<bullet> x \<noteq> x} \<union> {c. (b \<rightleftharpoons> c) \<bullet> x \<noteq> x})" by simp |
|
1155 |
then obtain c |
|
1156 |
where "(a \<rightleftharpoons> c) \<bullet> x = x" "(b \<rightleftharpoons> c) \<bullet> x = x" "sort_of c = sort_of b" |
|
1157 |
by (rule obtain_atom) (auto) |
|
1158 |
then show "(a \<rightleftharpoons> b) \<bullet> x = x" using asm by (rule_tac swap_rel_trans) (simp_all) |
|
1159 |
next |
|
1160 |
assume "sort_of a \<noteq> sort_of b" |
|
1161 |
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by simp |
|
1162 |
qed |
|
1163 |
||
1164 |
||
1165 |
subsection {* supp and fresh are equivariant *} |
|
1166 |
||
2760
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
2753
diff
changeset
|
1167 |
|
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
2753
diff
changeset
|
1168 |
lemma supp_eqvt [eqvt]: |
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
2753
diff
changeset
|
1169 |
shows "p \<bullet> (supp x) = supp (p \<bullet> x)" |
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
2753
diff
changeset
|
1170 |
unfolding supp_def |
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
2753
diff
changeset
|
1171 |
by (perm_simp) |
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
2753
diff
changeset
|
1172 |
(simp only: permute_eqvt[symmetric]) |
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
2753
diff
changeset
|
1173 |
|
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
2753
diff
changeset
|
1174 |
lemma fresh_eqvt [eqvt]: |
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
2753
diff
changeset
|
1175 |
shows "p \<bullet> (a \<sharp> x) = (p \<bullet> a) \<sharp> (p \<bullet> x)" |
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
2753
diff
changeset
|
1176 |
unfolding fresh_def |
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
2753
diff
changeset
|
1177 |
by (perm_simp) (rule refl) |
1062 | 1178 |
|
1179 |
lemma fresh_permute_iff: |
|
1180 |
shows "(p \<bullet> a) \<sharp> (p \<bullet> x) \<longleftrightarrow> a \<sharp> x" |
|
2760
8f833ebc4b58
eqvt of supp and fresh is proved using equivariance infrastructure
Christian Urban <urbanc@in.tum.de>
parents:
2753
diff
changeset
|
1181 |
by (simp only: fresh_eqvt[symmetric] permute_bool_def) |
1062 | 1182 |
|
2683
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
1183 |
lemma fresh_permute_left: |
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
1184 |
shows "a \<sharp> p \<bullet> x \<longleftrightarrow> - p \<bullet> a \<sharp> x" |
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
1185 |
proof |
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
1186 |
assume "a \<sharp> p \<bullet> x" |
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
1187 |
then have "- p \<bullet> a \<sharp> - p \<bullet> p \<bullet> x" by (simp only: fresh_permute_iff) |
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
1188 |
then show "- p \<bullet> a \<sharp> x" by simp |
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
1189 |
next |
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
1190 |
assume "- p \<bullet> a \<sharp> x" |
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
1191 |
then have "p \<bullet> - p \<bullet> a \<sharp> p \<bullet> x" by (simp only: fresh_permute_iff) |
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
1192 |
then show "a \<sharp> p \<bullet> x" by simp |
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
1193 |
qed |
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
1194 |
|
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
1195 |
|
2735 | 1196 |
section {* supports *} |
1062 | 1197 |
|
1198 |
definition |
|
1199 |
supports :: "atom set \<Rightarrow> 'a::pt \<Rightarrow> bool" (infixl "supports" 80) |
|
1200 |
where |
|
1201 |
"S supports x \<equiv> \<forall>a b. (a \<notin> S \<and> b \<notin> S \<longrightarrow> (a \<rightleftharpoons> b) \<bullet> x = x)" |
|
1202 |
||
1203 |
lemma supp_is_subset: |
|
1204 |
fixes S :: "atom set" |
|
1205 |
and x :: "'a::pt" |
|
1206 |
assumes a1: "S supports x" |
|
1207 |
and a2: "finite S" |
|
1208 |
shows "(supp x) \<subseteq> S" |
|
1209 |
proof (rule ccontr) |
|
1879 | 1210 |
assume "\<not> (supp x \<subseteq> S)" |
1062 | 1211 |
then obtain a where b1: "a \<in> supp x" and b2: "a \<notin> S" by auto |
1879 | 1212 |
from a1 b2 have "\<forall>b. b \<notin> S \<longrightarrow> (a \<rightleftharpoons> b) \<bullet> x = x" unfolding supports_def by auto |
1213 |
then have "{b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x} \<subseteq> S" by auto |
|
2732 | 1214 |
with a2 have "finite {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x}" by (simp add: finite_subset) |
1062 | 1215 |
then have "a \<notin> (supp x)" unfolding supp_def by simp |
1216 |
with b1 show False by simp |
|
1217 |
qed |
|
1218 |
||
1219 |
lemma supports_finite: |
|
1220 |
fixes S :: "atom set" |
|
1221 |
and x :: "'a::pt" |
|
1222 |
assumes a1: "S supports x" |
|
1223 |
and a2: "finite S" |
|
1224 |
shows "finite (supp x)" |
|
1225 |
proof - |
|
1226 |
have "(supp x) \<subseteq> S" using a1 a2 by (rule supp_is_subset) |
|
1227 |
then show "finite (supp x)" using a2 by (simp add: finite_subset) |
|
1228 |
qed |
|
1229 |
||
1230 |
lemma supp_supports: |
|
1231 |
fixes x :: "'a::pt" |
|
1232 |
shows "(supp x) supports x" |
|
1879 | 1233 |
unfolding supports_def |
1234 |
proof (intro strip) |
|
1062 | 1235 |
fix a b |
1236 |
assume "a \<notin> (supp x) \<and> b \<notin> (supp x)" |
|
1237 |
then have "a \<sharp> x" and "b \<sharp> x" by (simp_all add: fresh_def) |
|
1879 | 1238 |
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by (simp add: swap_fresh_fresh) |
1062 | 1239 |
qed |
1240 |
||
1241 |
lemma supp_is_least_supports: |
|
1242 |
fixes S :: "atom set" |
|
1243 |
and x :: "'a::pt" |
|
1244 |
assumes a1: "S supports x" |
|
1245 |
and a2: "finite S" |
|
1246 |
and a3: "\<And>S'. finite S' \<Longrightarrow> (S' supports x) \<Longrightarrow> S \<subseteq> S'" |
|
1247 |
shows "(supp x) = S" |
|
1248 |
proof (rule equalityI) |
|
1249 |
show "(supp x) \<subseteq> S" using a1 a2 by (rule supp_is_subset) |
|
1250 |
with a2 have fin: "finite (supp x)" by (rule rev_finite_subset) |
|
1251 |
have "(supp x) supports x" by (rule supp_supports) |
|
1252 |
with fin a3 show "S \<subseteq> supp x" by blast |
|
1253 |
qed |
|
1254 |
||
1255 |
lemma subsetCI: |
|
1256 |
shows "(\<And>x. x \<in> A \<Longrightarrow> x \<notin> B \<Longrightarrow> False) \<Longrightarrow> A \<subseteq> B" |
|
1257 |
by auto |
|
1258 |
||
1259 |
lemma finite_supp_unique: |
|
1260 |
assumes a1: "S supports x" |
|
1261 |
assumes a2: "finite S" |
|
1262 |
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" |
|
1263 |
shows "(supp x) = S" |
|
1264 |
using a1 a2 |
|
1265 |
proof (rule supp_is_least_supports) |
|
1266 |
fix S' |
|
1267 |
assume "finite S'" and "S' supports x" |
|
1268 |
show "S \<subseteq> S'" |
|
1269 |
proof (rule subsetCI) |
|
1270 |
fix a |
|
1271 |
assume "a \<in> S" and "a \<notin> S'" |
|
1272 |
have "finite (S \<union> S')" |
|
1273 |
using `finite S` `finite S'` by simp |
|
1274 |
then obtain b where "b \<notin> S \<union> S'" and "sort_of b = sort_of a" |
|
1275 |
by (rule obtain_atom) |
|
1276 |
then have "b \<notin> S" and "b \<notin> S'" and "sort_of a = sort_of b" |
|
1277 |
by simp_all |
|
1278 |
then have "(a \<rightleftharpoons> b) \<bullet> x = x" |
|
1279 |
using `a \<notin> S'` `S' supports x` by (simp add: supports_def) |
|
1280 |
moreover have "(a \<rightleftharpoons> b) \<bullet> x \<noteq> x" |
|
1281 |
using `a \<in> S` `b \<notin> S` `sort_of a = sort_of b` |
|
1282 |
by (rule a3) |
|
1283 |
ultimately show "False" by simp |
|
1284 |
qed |
|
1285 |
qed |
|
1286 |
||
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
|
1287 |
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
|
1288 |
|
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
|
1289 |
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
|
1290 |
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
|
1291 |
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
|
1292 |
*} |
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
|
1293 |
|
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
|
1294 |
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
|
1295 |
"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
|
1296 |
|
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
|
1297 |
|
2735 | 1298 |
|
1062 | 1299 |
section {* Finitely-supported types *} |
1300 |
||
1301 |
class fs = pt + |
|
1302 |
assumes finite_supp: "finite (supp x)" |
|
1303 |
||
1304 |
lemma pure_supp: |
|
2735 | 1305 |
fixes x::"'a::pure" |
1306 |
shows "supp x = {}" |
|
1062 | 1307 |
unfolding supp_def by (simp add: permute_pure) |
1308 |
||
1309 |
lemma pure_fresh: |
|
1310 |
fixes x::"'a::pure" |
|
1311 |
shows "a \<sharp> x" |
|
1312 |
unfolding fresh_def by (simp add: pure_supp) |
|
1313 |
||
1314 |
instance pure < fs |
|
1315 |
by default (simp add: pure_supp) |
|
1316 |
||
1317 |
||
1318 |
subsection {* Type @{typ atom} is finitely-supported. *} |
|
1319 |
||
1320 |
lemma supp_atom: |
|
1321 |
shows "supp a = {a}" |
|
1322 |
apply (rule finite_supp_unique) |
|
1323 |
apply (clarsimp simp add: supports_def) |
|
1324 |
apply simp |
|
1325 |
apply simp |
|
1326 |
done |
|
1327 |
||
1328 |
lemma fresh_atom: |
|
1329 |
shows "a \<sharp> b \<longleftrightarrow> a \<noteq> b" |
|
1330 |
unfolding fresh_def supp_atom by simp |
|
1331 |
||
1332 |
instance atom :: fs |
|
1333 |
by default (simp add: supp_atom) |
|
1334 |
||
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
|
1335 |
|
1062 | 1336 |
section {* Type @{typ perm} is finitely-supported. *} |
1337 |
||
1338 |
lemma perm_swap_eq: |
|
1339 |
shows "(a \<rightleftharpoons> b) \<bullet> p = p \<longleftrightarrow> (p \<bullet> (a \<rightleftharpoons> b)) = (a \<rightleftharpoons> b)" |
|
1340 |
unfolding permute_perm_def |
|
1341 |
by (metis add_diff_cancel minus_perm_def) |
|
1342 |
||
1343 |
lemma supports_perm: |
|
1344 |
shows "{a. p \<bullet> a \<noteq> a} supports p" |
|
1345 |
unfolding supports_def |
|
1879 | 1346 |
unfolding perm_swap_eq |
1347 |
by (simp add: swap_eqvt) |
|
1062 | 1348 |
|
1349 |
lemma finite_perm_lemma: |
|
1350 |
shows "finite {a::atom. p \<bullet> a \<noteq> a}" |
|
1351 |
using finite_Rep_perm [of p] |
|
1352 |
unfolding permute_atom_def . |
|
1353 |
||
1354 |
lemma supp_perm: |
|
1355 |
shows "supp p = {a. p \<bullet> a \<noteq> a}" |
|
1356 |
apply (rule finite_supp_unique) |
|
1357 |
apply (rule supports_perm) |
|
1358 |
apply (rule finite_perm_lemma) |
|
1359 |
apply (simp add: perm_swap_eq swap_eqvt) |
|
2732 | 1360 |
apply (auto simp add: perm_eq_iff swap_atom) |
1062 | 1361 |
done |
1362 |
||
1363 |
lemma fresh_perm: |
|
1364 |
shows "a \<sharp> p \<longleftrightarrow> p \<bullet> a = a" |
|
1879 | 1365 |
unfolding fresh_def |
1366 |
by (simp add: supp_perm) |
|
1062 | 1367 |
|
1368 |
lemma supp_swap: |
|
1369 |
shows "supp (a \<rightleftharpoons> b) = (if a = b \<or> sort_of a \<noteq> sort_of b then {} else {a, b})" |
|
1370 |
by (auto simp add: supp_perm swap_atom) |
|
1371 |
||
1372 |
lemma fresh_zero_perm: |
|
1373 |
shows "a \<sharp> (0::perm)" |
|
1374 |
unfolding fresh_perm by simp |
|
1375 |
||
1376 |
lemma supp_zero_perm: |
|
1377 |
shows "supp (0::perm) = {}" |
|
1378 |
unfolding supp_perm by simp |
|
1379 |
||
1087
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1380 |
lemma fresh_plus_perm: |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1381 |
fixes p q::perm |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1382 |
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
|
1383 |
shows "a \<sharp> (p + q)" |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1384 |
using assms |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1385 |
unfolding fresh_def |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1386 |
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
|
1387 |
|
1062 | 1388 |
lemma supp_plus_perm: |
1389 |
fixes p q::perm |
|
1390 |
shows "supp (p + q) \<subseteq> supp p \<union> supp q" |
|
1391 |
by (auto simp add: supp_perm) |
|
1392 |
||
1087
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1393 |
lemma fresh_minus_perm: |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1394 |
fixes p::perm |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1395 |
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
|
1396 |
unfolding fresh_def |
1879 | 1397 |
unfolding supp_perm |
1398 |
apply(simp) |
|
1399 |
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
|
1400 |
done |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1401 |
|
1062 | 1402 |
lemma supp_minus_perm: |
1403 |
fixes p::perm |
|
1404 |
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
|
1405 |
unfolding supp_conv_fresh |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
1406 |
by (simp add: fresh_minus_perm) |
1062 | 1407 |
|
1305
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1408 |
lemma plus_perm_eq: |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1409 |
fixes p q::"perm" |
1879 | 1410 |
assumes asm: "supp p \<inter> supp q = {}" |
2776 | 1411 |
shows "p + q = q + p" |
2732 | 1412 |
unfolding perm_eq_iff |
1305
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1413 |
proof |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1414 |
fix a::"atom" |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1415 |
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
|
1416 |
proof - |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1417 |
{ 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
|
1418 |
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
|
1419 |
by (simp add: supp_perm) |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1420 |
} |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1421 |
moreover |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1422 |
{ 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
|
1423 |
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
|
1424 |
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
|
1425 |
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
|
1426 |
by (simp add: supp_perm) |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1427 |
} |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1428 |
moreover |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1429 |
{ 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
|
1430 |
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
|
1431 |
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
|
1432 |
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
|
1433 |
by (simp add: supp_perm) |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1434 |
} |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1435 |
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
|
1436 |
using asm by blast |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1437 |
qed |
61319a9af976
updated (added lemma about commuting permutations)
Christian Urban <urbanc@in.tum.de>
parents:
1258
diff
changeset
|
1438 |
qed |
1062 | 1439 |
|
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1440 |
lemma supp_plus_perm_eq: |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1441 |
fixes p q::perm |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1442 |
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
|
1443 |
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
|
1444 |
proof - |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1445 |
{ fix a::"atom" |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1446 |
assume "a \<in> supp p" |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1447 |
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
|
1448 |
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
|
1449 |
by (simp add: supp_perm) |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1450 |
} |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1451 |
moreover |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1452 |
{ fix a::"atom" |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1453 |
assume "a \<in> supp q" |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1454 |
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
|
1455 |
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
|
1456 |
by (simp add: supp_perm) |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1457 |
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
|
1458 |
by metis |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1459 |
} |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1460 |
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
|
1461 |
by blast |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1462 |
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
|
1463 |
by blast |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1464 |
qed |
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1465 |
|
2735 | 1466 |
instance perm :: fs |
1467 |
by default (simp add: supp_perm finite_perm_lemma) |
|
1468 |
||
1469 |
||
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
1470 |
|
1062 | 1471 |
section {* Finite Support instances for other types *} |
1472 |
||
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1473 |
|
1062 | 1474 |
subsection {* Type @{typ "'a \<times> 'b"} is finitely-supported. *} |
1475 |
||
1476 |
lemma supp_Pair: |
|
1477 |
shows "supp (x, y) = supp x \<union> supp y" |
|
1478 |
by (simp add: supp_def Collect_imp_eq Collect_neg_eq) |
|
1479 |
||
1480 |
lemma fresh_Pair: |
|
1481 |
shows "a \<sharp> (x, y) \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> y" |
|
1482 |
by (simp add: fresh_def supp_Pair) |
|
1483 |
||
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1484 |
lemma supp_Unit: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1485 |
shows "supp () = {}" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1486 |
by (simp add: supp_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1487 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1488 |
lemma fresh_Unit: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1489 |
shows "a \<sharp> ()" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1490 |
by (simp add: fresh_def supp_Unit) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1491 |
|
2378
2f13fe48c877
updated to new Isabelle; made FSet more "quiet"
Christian Urban <urbanc@in.tum.de>
parents:
2310
diff
changeset
|
1492 |
instance prod :: (fs, fs) fs |
1062 | 1493 |
apply default |
2776 | 1494 |
apply (case_tac x) |
1062 | 1495 |
apply (simp add: supp_Pair finite_supp) |
1496 |
done |
|
1497 |
||
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1498 |
|
1062 | 1499 |
subsection {* Type @{typ "'a + 'b"} is finitely supported *} |
1500 |
||
1501 |
lemma supp_Inl: |
|
1502 |
shows "supp (Inl x) = supp x" |
|
1503 |
by (simp add: supp_def) |
|
1504 |
||
1505 |
lemma supp_Inr: |
|
1506 |
shows "supp (Inr x) = supp x" |
|
1507 |
by (simp add: supp_def) |
|
1508 |
||
1509 |
lemma fresh_Inl: |
|
1510 |
shows "a \<sharp> Inl x \<longleftrightarrow> a \<sharp> x" |
|
1511 |
by (simp add: fresh_def supp_Inl) |
|
1512 |
||
1513 |
lemma fresh_Inr: |
|
1514 |
shows "a \<sharp> Inr y \<longleftrightarrow> a \<sharp> y" |
|
1515 |
by (simp add: fresh_def supp_Inr) |
|
1516 |
||
2378
2f13fe48c877
updated to new Isabelle; made FSet more "quiet"
Christian Urban <urbanc@in.tum.de>
parents:
2310
diff
changeset
|
1517 |
instance sum :: (fs, fs) fs |
1062 | 1518 |
apply default |
2776 | 1519 |
apply (case_tac x) |
1062 | 1520 |
apply (simp_all add: supp_Inl supp_Inr finite_supp) |
1521 |
done |
|
1522 |
||
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1523 |
|
1062 | 1524 |
subsection {* Type @{typ "'a option"} is finitely supported *} |
1525 |
||
1526 |
lemma supp_None: |
|
1527 |
shows "supp None = {}" |
|
1528 |
by (simp add: supp_def) |
|
1529 |
||
1530 |
lemma supp_Some: |
|
1531 |
shows "supp (Some x) = supp x" |
|
1532 |
by (simp add: supp_def) |
|
1533 |
||
1534 |
lemma fresh_None: |
|
1535 |
shows "a \<sharp> None" |
|
1536 |
by (simp add: fresh_def supp_None) |
|
1537 |
||
1538 |
lemma fresh_Some: |
|
1539 |
shows "a \<sharp> Some x \<longleftrightarrow> a \<sharp> x" |
|
1540 |
by (simp add: fresh_def supp_Some) |
|
1541 |
||
1542 |
instance option :: (fs) fs |
|
1543 |
apply default |
|
1544 |
apply (induct_tac x) |
|
1545 |
apply (simp_all add: supp_None supp_Some finite_supp) |
|
1546 |
done |
|
1547 |
||
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1548 |
|
1062 | 1549 |
subsubsection {* Type @{typ "'a list"} is finitely supported *} |
1550 |
||
1551 |
lemma supp_Nil: |
|
1552 |
shows "supp [] = {}" |
|
1553 |
by (simp add: supp_def) |
|
1554 |
||
2776 | 1555 |
lemma fresh_Nil: |
1556 |
shows "a \<sharp> []" |
|
1557 |
by (simp add: fresh_def supp_Nil) |
|
1558 |
||
1062 | 1559 |
lemma supp_Cons: |
1560 |
shows "supp (x # xs) = supp x \<union> supp xs" |
|
1561 |
by (simp add: supp_def Collect_imp_eq Collect_neg_eq) |
|
1562 |
||
2776 | 1563 |
lemma fresh_Cons: |
1564 |
shows "a \<sharp> (x # xs) \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> xs" |
|
1565 |
by (simp add: fresh_def supp_Cons) |
|
1566 |
||
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1567 |
lemma supp_append: |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1568 |
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
|
1569 |
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
|
1570 |
|
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1571 |
lemma fresh_append: |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1572 |
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
|
1573 |
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
|
1574 |
|
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1575 |
lemma supp_rev: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1576 |
shows "supp (rev xs) = supp xs" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1577 |
by (induct xs) (auto simp add: supp_append supp_Cons supp_Nil) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1578 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1579 |
lemma fresh_rev: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1580 |
shows "a \<sharp> rev xs \<longleftrightarrow> a \<sharp> xs" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1581 |
by (induct xs) (auto simp add: fresh_append fresh_Cons fresh_Nil) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1582 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1583 |
lemma supp_removeAll: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1584 |
fixes x::"atom" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1585 |
shows "supp (removeAll x xs) = supp xs - {x}" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1586 |
by (induct xs) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1587 |
(auto simp add: supp_Nil supp_Cons supp_atom) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1588 |
|
2735 | 1589 |
lemma supp_of_atom_list: |
1590 |
fixes as::"atom list" |
|
1591 |
shows "supp as = set as" |
|
1592 |
by (induct as) |
|
1593 |
(simp_all add: supp_Nil supp_Cons supp_atom) |
|
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1594 |
|
1062 | 1595 |
instance list :: (fs) fs |
1596 |
apply default |
|
1597 |
apply (induct_tac x) |
|
1598 |
apply (simp_all add: supp_Nil supp_Cons finite_supp) |
|
1599 |
done |
|
1600 |
||
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1601 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1602 |
section {* Support and Freshness for Applications *} |
1062 | 1603 |
|
1879 | 1604 |
lemma fresh_conv_MOST: |
1605 |
shows "a \<sharp> x \<longleftrightarrow> (MOST b. (a \<rightleftharpoons> b) \<bullet> x = x)" |
|
1606 |
unfolding fresh_def supp_def |
|
1607 |
unfolding MOST_iff_cofinite by simp |
|
1608 |
||
1609 |
lemma fresh_fun_app: |
|
1610 |
assumes "a \<sharp> f" and "a \<sharp> x" |
|
1611 |
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
|
1612 |
using assms |
1879 | 1613 |
unfolding fresh_conv_MOST |
2732 | 1614 |
unfolding permute_fun_app_eq |
2776 | 1615 |
by (elim MOST_rev_mp) (simp) |
1879 | 1616 |
|
1062 | 1617 |
lemma supp_fun_app: |
1618 |
shows "supp (f x) \<subseteq> (supp f) \<union> (supp x)" |
|
1879 | 1619 |
using fresh_fun_app |
1620 |
unfolding fresh_def |
|
1621 |
by auto |
|
1622 |
||
2732 | 1623 |
|
2735 | 1624 |
subsection {* Equivariance Predicate @{text eqvt} and @{text eqvt_at}*} |
2663
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1625 |
|
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1626 |
definition |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1627 |
"eqvt f \<equiv> \<forall>p. p \<bullet> f = f" |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1628 |
|
2735 | 1629 |
text {* equivariance of a function at a given argument *} |
1630 |
||
1631 |
definition |
|
1632 |
"eqvt_at f x \<equiv> \<forall>p. p \<bullet> (f x) = f (p \<bullet> x)" |
|
1633 |
||
2663
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1634 |
lemma eqvtI: |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1635 |
shows "(\<And>p. p \<bullet> f \<equiv> f) \<Longrightarrow> eqvt f" |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1636 |
unfolding eqvt_def |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1637 |
by simp |
2003
b53e98bfb298
added lemmas establishing the support of finite sets of finitely supported elements
Christian Urban <urbanc@in.tum.de>
parents:
1973
diff
changeset
|
1638 |
|
1941 | 1639 |
lemma supp_fun_eqvt: |
2663
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1640 |
assumes a: "eqvt f" |
1941 | 1641 |
shows "supp f = {}" |
2663
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1642 |
using a |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1643 |
unfolding eqvt_def |
1941 | 1644 |
unfolding supp_def |
2663
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1645 |
by simp |
1941 | 1646 |
|
1062 | 1647 |
lemma fresh_fun_eqvt_app: |
2663
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1648 |
assumes a: "eqvt f" |
1062 | 1649 |
shows "a \<sharp> x \<Longrightarrow> a \<sharp> f x" |
1650 |
proof - |
|
1941 | 1651 |
from a have "supp f = {}" by (simp add: supp_fun_eqvt) |
1879 | 1652 |
then show "a \<sharp> x \<Longrightarrow> a \<sharp> f x" |
1062 | 1653 |
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
|
1654 |
using supp_fun_app by auto |
1062 | 1655 |
qed |
1656 |
||
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1657 |
lemma supp_fun_app_eqvt: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1658 |
assumes a: "eqvt f" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1659 |
shows "supp (f x) \<subseteq> supp x" |
2735 | 1660 |
using fresh_fun_eqvt_app[OF a] |
1661 |
unfolding fresh_def |
|
1662 |
by auto |
|
2663
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1663 |
|
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1664 |
lemma supp_eqvt_at: |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1665 |
assumes asm: "eqvt_at f x" |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1666 |
and fin: "finite (supp x)" |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1667 |
shows "supp (f x) \<subseteq> supp x" |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1668 |
apply(rule supp_is_subset) |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1669 |
unfolding supports_def |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1670 |
unfolding fresh_def[symmetric] |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1671 |
using asm |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1672 |
apply(simp add: eqvt_at_def) |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1673 |
apply(simp add: swap_fresh_fresh) |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1674 |
apply(rule fin) |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1675 |
done |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1676 |
|
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1677 |
lemma finite_supp_eqvt_at: |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1678 |
assumes asm: "eqvt_at f x" |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1679 |
and fin: "finite (supp x)" |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1680 |
shows "finite (supp (f x))" |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1681 |
apply(rule finite_subset) |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1682 |
apply(rule supp_eqvt_at[OF asm fin]) |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1683 |
apply(rule fin) |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1684 |
done |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1685 |
|
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1686 |
lemma fresh_eqvt_at: |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1687 |
assumes asm: "eqvt_at f x" |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1688 |
and fin: "finite (supp x)" |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1689 |
and fresh: "a \<sharp> x" |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1690 |
shows "a \<sharp> f x" |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1691 |
using fresh |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1692 |
unfolding fresh_def |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1693 |
using supp_eqvt_at[OF asm fin] |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1694 |
by auto |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1695 |
|
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1696 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1697 |
subsection {* helper functions for nominal_functions *} |
2663
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1698 |
|
2818
8fe80e9f796d
added a more general lemma fro fundef_ex1
Christian Urban <urbanc@in.tum.de>
parents:
2810
diff
changeset
|
1699 |
lemma THE_defaultI2: |
2849 | 1700 |
assumes "\<exists>!x. P x" "\<And>x. P x \<Longrightarrow> Q x" |
2818
8fe80e9f796d
added a more general lemma fro fundef_ex1
Christian Urban <urbanc@in.tum.de>
parents:
2810
diff
changeset
|
1701 |
shows "Q (THE_default d P)" |
8fe80e9f796d
added a more general lemma fro fundef_ex1
Christian Urban <urbanc@in.tum.de>
parents:
2810
diff
changeset
|
1702 |
by (iprover intro: assms THE_defaultI') |
8fe80e9f796d
added a more general lemma fro fundef_ex1
Christian Urban <urbanc@in.tum.de>
parents:
2810
diff
changeset
|
1703 |
|
2663
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1704 |
lemma the_default_eqvt: |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1705 |
assumes unique: "\<exists>!x. P x" |
2848
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
parents:
2847
diff
changeset
|
1706 |
shows "(p \<bullet> (THE_default d P)) = (THE_default (p \<bullet> d) (p \<bullet> P))" |
2663
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1707 |
apply(rule THE_default1_equality [symmetric]) |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1708 |
apply(rule_tac p="-p" in permute_boolE) |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1709 |
apply(simp add: ex1_eqvt) |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1710 |
apply(rule unique) |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1711 |
apply(rule_tac p="-p" in permute_boolE) |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1712 |
apply(rule subst[OF permute_fun_app_eq]) |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1713 |
apply(simp) |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1714 |
apply(rule THE_defaultI'[OF unique]) |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1715 |
done |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1716 |
|
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1717 |
lemma fundef_ex1_eqvt: |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1718 |
fixes x::"'a::pt" |
2848
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
parents:
2847
diff
changeset
|
1719 |
assumes f_def: "f == (\<lambda>x::'a. THE_default (d x) (G x))" |
2663
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1720 |
assumes eqvt: "eqvt G" |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1721 |
assumes ex1: "\<exists>!y. G x y" |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1722 |
shows "(p \<bullet> (f x)) = f (p \<bullet> x)" |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1723 |
apply(simp only: f_def) |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1724 |
apply(subst the_default_eqvt) |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1725 |
apply(rule ex1) |
2848
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
parents:
2847
diff
changeset
|
1726 |
apply(rule THE_default1_equality [symmetric]) |
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
parents:
2847
diff
changeset
|
1727 |
apply(rule_tac p="-p" in permute_boolE) |
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
parents:
2847
diff
changeset
|
1728 |
apply(perm_simp add: permute_minus_cancel) |
2849 | 1729 |
using eqvt[simplified eqvt_def] |
2848
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
parents:
2847
diff
changeset
|
1730 |
apply(simp) |
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
parents:
2847
diff
changeset
|
1731 |
apply(rule ex1) |
2849 | 1732 |
apply(rule THE_defaultI2) |
2848
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
parents:
2847
diff
changeset
|
1733 |
apply(rule_tac p="-p" in permute_boolE) |
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
parents:
2847
diff
changeset
|
1734 |
apply(perm_simp add: permute_minus_cancel) |
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
parents:
2847
diff
changeset
|
1735 |
apply(rule ex1) |
2849 | 1736 |
apply(perm_simp) |
1737 |
using eqvt[simplified eqvt_def] |
|
2848
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
parents:
2847
diff
changeset
|
1738 |
apply(simp) |
2663
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1739 |
done |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1740 |
|
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1741 |
lemma fundef_ex1_eqvt_at: |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1742 |
fixes x::"'a::pt" |
2848
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
parents:
2847
diff
changeset
|
1743 |
assumes f_def: "f == (\<lambda>x::'a. THE_default (d x) (G x))" |
2663
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1744 |
assumes eqvt: "eqvt G" |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1745 |
assumes ex1: "\<exists>!y. G x y" |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1746 |
shows "eqvt_at f x" |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1747 |
unfolding eqvt_at_def |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1748 |
using assms |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1749 |
by (auto intro: fundef_ex1_eqvt) |
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
1750 |
|
2818
8fe80e9f796d
added a more general lemma fro fundef_ex1
Christian Urban <urbanc@in.tum.de>
parents:
2810
diff
changeset
|
1751 |
lemma fundef_ex1_prop: |
8fe80e9f796d
added a more general lemma fro fundef_ex1
Christian Urban <urbanc@in.tum.de>
parents:
2810
diff
changeset
|
1752 |
fixes x::"'a::pt" |
2848
da7e6655cd4c
fixed the problem when giving a complex default-term; the fundef lemmas in Nominal_Base were not general enough
Christian Urban <urbanc@in.tum.de>
parents:
2847
diff
changeset
|
1753 |
assumes f_def: "f == (\<lambda>x::'a. THE_default (d x) (G x))" |
2820
77e1d9f2925e
slightly stronger property in fundef_ex_prop
Christian Urban <urbanc@in.tum.de>
parents:
2818
diff
changeset
|
1754 |
assumes P_all: "\<And>x y. G x y \<Longrightarrow> P x y" |
2818
8fe80e9f796d
added a more general lemma fro fundef_ex1
Christian Urban <urbanc@in.tum.de>
parents:
2810
diff
changeset
|
1755 |
assumes ex1: "\<exists>!y. G x y" |
2820
77e1d9f2925e
slightly stronger property in fundef_ex_prop
Christian Urban <urbanc@in.tum.de>
parents:
2818
diff
changeset
|
1756 |
shows "P x (f x)" |
2818
8fe80e9f796d
added a more general lemma fro fundef_ex1
Christian Urban <urbanc@in.tum.de>
parents:
2810
diff
changeset
|
1757 |
unfolding f_def |
8fe80e9f796d
added a more general lemma fro fundef_ex1
Christian Urban <urbanc@in.tum.de>
parents:
2810
diff
changeset
|
1758 |
using ex1 |
8fe80e9f796d
added a more general lemma fro fundef_ex1
Christian Urban <urbanc@in.tum.de>
parents:
2810
diff
changeset
|
1759 |
apply(erule_tac ex1E) |
8fe80e9f796d
added a more general lemma fro fundef_ex1
Christian Urban <urbanc@in.tum.de>
parents:
2810
diff
changeset
|
1760 |
apply(rule THE_defaultI2) |
8fe80e9f796d
added a more general lemma fro fundef_ex1
Christian Urban <urbanc@in.tum.de>
parents:
2810
diff
changeset
|
1761 |
apply(blast) |
8fe80e9f796d
added a more general lemma fro fundef_ex1
Christian Urban <urbanc@in.tum.de>
parents:
2810
diff
changeset
|
1762 |
apply(rule P_all) |
8fe80e9f796d
added a more general lemma fro fundef_ex1
Christian Urban <urbanc@in.tum.de>
parents:
2810
diff
changeset
|
1763 |
apply(assumption) |
8fe80e9f796d
added a more general lemma fro fundef_ex1
Christian Urban <urbanc@in.tum.de>
parents:
2810
diff
changeset
|
1764 |
done |
8fe80e9f796d
added a more general lemma fro fundef_ex1
Christian Urban <urbanc@in.tum.de>
parents:
2810
diff
changeset
|
1765 |
|
2735 | 1766 |
|
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1767 |
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
|
1768 |
|
2657
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1769 |
text {* support and freshness for atom sets *} |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1770 |
|
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1771 |
lemma supp_finite_atom_set: |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1772 |
fixes S::"atom set" |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1773 |
assumes "finite S" |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1774 |
shows "supp S = S" |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1775 |
apply(rule finite_supp_unique) |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1776 |
apply(simp add: supports_def) |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1777 |
apply(simp add: swap_set_not_in) |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1778 |
apply(rule assms) |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1779 |
apply(simp add: swap_set_in) |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1780 |
done |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1781 |
|
2742 | 1782 |
lemma supp_cofinite_atom_set: |
1783 |
fixes S::"atom set" |
|
1784 |
assumes "finite (UNIV - S)" |
|
1785 |
shows "supp S = (UNIV - S)" |
|
1786 |
apply(rule finite_supp_unique) |
|
1787 |
apply(simp add: supports_def) |
|
1788 |
apply(simp add: swap_set_both_in) |
|
1789 |
apply(rule assms) |
|
1790 |
apply(subst swap_commute) |
|
1791 |
apply(simp add: swap_set_in) |
|
1792 |
done |
|
1793 |
||
2657
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1794 |
lemma fresh_finite_atom_set: |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1795 |
fixes S::"atom set" |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1796 |
assumes "finite S" |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1797 |
shows "a \<sharp> S \<longleftrightarrow> a \<notin> S" |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1798 |
unfolding fresh_def |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1799 |
by (simp add: supp_finite_atom_set[OF assms]) |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
1800 |
|
2679
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
1801 |
lemma fresh_minus_atom_set: |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
1802 |
fixes S::"atom set" |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
1803 |
assumes "finite S" |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
1804 |
shows "a \<sharp> S - T \<longleftrightarrow> (a \<notin> T \<longrightarrow> a \<sharp> S)" |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
1805 |
unfolding fresh_def |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
1806 |
by (auto simp add: supp_finite_atom_set assms) |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
1807 |
|
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1808 |
lemma Union_supports_set: |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1809 |
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
|
1810 |
proof - |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1811 |
{ fix a b |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1812 |
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
|
1813 |
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
|
1814 |
} |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1815 |
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
|
1816 |
unfolding supports_def |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1817 |
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
|
1818 |
qed |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1819 |
|
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1820 |
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
|
1821 |
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
|
1822 |
assumes fin: "finite S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1823 |
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
|
1824 |
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
|
1825 |
|
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1826 |
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
|
1827 |
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
|
1828 |
assumes fin: "finite S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1829 |
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
|
1830 |
proof - |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1831 |
have eqvt: "eqvt (\<lambda>S. \<Union> supp ` S)" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1832 |
unfolding eqvt_def |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1833 |
by (perm_simp) (simp) |
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1834 |
have "(\<Union>x\<in>S. supp x) = supp (\<Union>x\<in>S. supp x)" |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1835 |
by (rule supp_finite_atom_set[symmetric]) (rule Union_of_finite_supp_sets[OF fin]) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1836 |
also have "\<dots> = supp ((\<lambda>S. \<Union> supp ` S) S)" by simp |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1837 |
also have "\<dots> \<subseteq> supp S" using eqvt |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1838 |
by (rule supp_fun_app_eqvt) |
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1839 |
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
|
1840 |
qed |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1841 |
|
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1842 |
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
|
1843 |
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
|
1844 |
assumes fin: "finite S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1845 |
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
|
1846 |
apply(rule subset_antisym) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1847 |
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
|
1848 |
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
|
1849 |
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
|
1850 |
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
|
1851 |
done |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1852 |
|
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1853 |
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
|
1854 |
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
|
1855 |
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
|
1856 |
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
|
1857 |
using assms |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1858 |
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
|
1859 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1860 |
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
|
1861 |
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
|
1862 |
assumes fin1: "finite S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1863 |
and fin2: "finite T" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1864 |
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
|
1865 |
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
|
1866 |
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
|
1867 |
|
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1868 |
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
|
1869 |
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
|
1870 |
assumes fin: "finite S" |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
1871 |
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
|
1872 |
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
|
1873 |
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
|
1874 |
|
2588
8f5420681039
completed the strong exhausts rules for Foo2 using general lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2587
diff
changeset
|
1875 |
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
|
1876 |
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
|
1877 |
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
|
1878 |
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
|
1879 |
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
|
1880 |
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
|
1881 |
|
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1882 |
lemma supp_set_empty: |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1883 |
shows "supp {} = {}" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1884 |
unfolding supp_def |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1885 |
by (simp add: empty_eqvt) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1886 |
|
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1887 |
lemma fresh_set_empty: |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1888 |
shows "a \<sharp> {}" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1889 |
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
|
1890 |
|
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1891 |
lemma supp_set: |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1892 |
fixes xs :: "('a::fs) list" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1893 |
shows "supp (set xs) = supp xs" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1894 |
apply(induct xs) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1895 |
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
|
1896 |
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
|
1897 |
done |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1898 |
|
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1899 |
lemma fresh_set: |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1900 |
fixes xs :: "('a::fs) list" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1901 |
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
|
1902 |
unfolding fresh_def |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1903 |
by (simp add: supp_set) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
1904 |
|
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1905 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1906 |
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
|
1907 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1908 |
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
|
1909 |
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
|
1910 |
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
|
1911 |
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
|
1912 |
|
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1913 |
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
|
1914 |
shows "supp {||} = {}" |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1915 |
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
|
1916 |
by simp |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1917 |
|
2641
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1918 |
lemma fresh_empty_fset: |
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1919 |
shows "a \<sharp> {||}" |
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1920 |
unfolding fresh_def |
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1921 |
by (simp) |
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1922 |
|
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1923 |
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
|
1924 |
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
|
1925 |
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
|
1926 |
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
|
1927 |
apply(subst supp_fset[symmetric]) |
2587
78623a0f294b
tuned proof to reduce number of warnings
Christian Urban <urbanc@in.tum.de>
parents:
2586
diff
changeset
|
1928 |
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
|
1929 |
done |
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1930 |
|
2641
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1931 |
lemma fresh_insert_fset: |
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1932 |
fixes x::"'a::fs" |
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1933 |
and S::"'a fset" |
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1934 |
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
|
1935 |
unfolding fresh_def |
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1936 |
by (simp) |
592d17e26e09
some further lemmas for fsets
Christian Urban <urbanc@in.tum.de>
parents:
2635
diff
changeset
|
1937 |
|
2565
6bf332360510
moved most material fron Nominal2_FSet into the Nominal_Base theory
Christian Urban <urbanc@in.tum.de>
parents:
2560
diff
changeset
|
1938 |
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
|
1939 |
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
|
1940 |
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
|
1941 |
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
|
1942 |
|
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1943 |
lemma supp_union_fset: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1944 |
fixes S T::"'a::fs fset" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1945 |
shows "supp (S |\<union>| T) = supp S \<union> supp T" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1946 |
by (induct S) (auto) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1947 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1948 |
lemma fresh_union_fset: |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1949 |
fixes S T::"'a::fs fset" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1950 |
shows "a \<sharp> S |\<union>| T \<longleftrightarrow> a \<sharp> S \<and> a \<sharp> T" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1951 |
unfolding fresh_def |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1952 |
by (simp add: supp_union_fset) |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1953 |
|
2735 | 1954 |
instance fset :: (fs) fs |
1955 |
apply (default) |
|
1956 |
apply (rule fset_finite_supp) |
|
1957 |
done |
|
1958 |
||
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
1959 |
|
2632
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1960 |
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
|
1961 |
|
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1962 |
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
|
1963 |
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
|
1964 |
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
|
1965 |
|
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1966 |
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
|
1967 |
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
|
1968 |
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
|
1969 |
|
2632
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1970 |
(* 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
|
1971 |
(* 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
|
1972 |
lemma [simp]: |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1973 |
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
|
1974 |
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
|
1975 |
|
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1976 |
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
|
1977 |
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
|
1978 |
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
|
1979 |
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
|
1980 |
|
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1981 |
ML {* |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1982 |
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
|
1983 |
*} |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1984 |
|
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1985 |
declaration {* fn _ => |
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
1986 |
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
|
1987 |
*} |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1988 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1989 |
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
|
1990 |
induction principles. *} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1991 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1992 |
definition |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1993 |
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
|
1994 |
where |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
1995 |
"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
|
1996 |
|
2507 | 1997 |
lemma fresh_star_supp_conv: |
1998 |
shows "supp x \<sharp>* y \<Longrightarrow> supp y \<sharp>* x" |
|
1999 |
by (auto simp add: fresh_star_def fresh_def) |
|
2000 |
||
2675
68ccf847507d
defined properly substitution
Christian Urban <urbanc@in.tum.de>
parents:
2672
diff
changeset
|
2001 |
lemma fresh_star_perm_set_conv: |
68ccf847507d
defined properly substitution
Christian Urban <urbanc@in.tum.de>
parents:
2672
diff
changeset
|
2002 |
fixes p::"perm" |
68ccf847507d
defined properly substitution
Christian Urban <urbanc@in.tum.de>
parents:
2672
diff
changeset
|
2003 |
assumes fresh: "as \<sharp>* p" |
68ccf847507d
defined properly substitution
Christian Urban <urbanc@in.tum.de>
parents:
2672
diff
changeset
|
2004 |
and fin: "finite as" |
68ccf847507d
defined properly substitution
Christian Urban <urbanc@in.tum.de>
parents:
2672
diff
changeset
|
2005 |
shows "supp p \<sharp>* as" |
68ccf847507d
defined properly substitution
Christian Urban <urbanc@in.tum.de>
parents:
2672
diff
changeset
|
2006 |
apply(rule fresh_star_supp_conv) |
68ccf847507d
defined properly substitution
Christian Urban <urbanc@in.tum.de>
parents:
2672
diff
changeset
|
2007 |
apply(simp add: supp_finite_atom_set fin fresh) |
68ccf847507d
defined properly substitution
Christian Urban <urbanc@in.tum.de>
parents:
2672
diff
changeset
|
2008 |
done |
68ccf847507d
defined properly substitution
Christian Urban <urbanc@in.tum.de>
parents:
2672
diff
changeset
|
2009 |
|
2679
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2010 |
lemma fresh_star_atom_set_conv: |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2011 |
assumes fresh: "as \<sharp>* bs" |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2012 |
and fin: "finite as" "finite bs" |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2013 |
shows "bs \<sharp>* as" |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2014 |
using fresh |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2015 |
unfolding fresh_star_def fresh_def |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2016 |
by (auto simp add: supp_finite_atom_set fin) |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2017 |
|
2730
eebc24b9cf39
added a lemma about fresh_star and Abs
Christian Urban <urbanc@in.tum.de>
parents:
2708
diff
changeset
|
2018 |
lemma atom_fresh_star_disjoint: |
eebc24b9cf39
added a lemma about fresh_star and Abs
Christian Urban <urbanc@in.tum.de>
parents:
2708
diff
changeset
|
2019 |
assumes fin: "finite bs" |
eebc24b9cf39
added a lemma about fresh_star and Abs
Christian Urban <urbanc@in.tum.de>
parents:
2708
diff
changeset
|
2020 |
shows "as \<sharp>* bs \<longleftrightarrow> (as \<inter> bs = {})" |
eebc24b9cf39
added a lemma about fresh_star and Abs
Christian Urban <urbanc@in.tum.de>
parents:
2708
diff
changeset
|
2021 |
|
eebc24b9cf39
added a lemma about fresh_star and Abs
Christian Urban <urbanc@in.tum.de>
parents:
2708
diff
changeset
|
2022 |
unfolding fresh_star_def fresh_def |
eebc24b9cf39
added a lemma about fresh_star and Abs
Christian Urban <urbanc@in.tum.de>
parents:
2708
diff
changeset
|
2023 |
by (auto simp add: supp_finite_atom_set fin) |
eebc24b9cf39
added a lemma about fresh_star and Abs
Christian Urban <urbanc@in.tum.de>
parents:
2708
diff
changeset
|
2024 |
|
2675
68ccf847507d
defined properly substitution
Christian Urban <urbanc@in.tum.de>
parents:
2672
diff
changeset
|
2025 |
|
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
2026 |
lemma fresh_star_Pair: |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2027 |
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
|
2028 |
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
|
2029 |
|
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
2030 |
lemma fresh_star_list: |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
2031 |
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
|
2032 |
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
|
2033 |
and "as \<sharp>* []" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
2034 |
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
|
2035 |
|
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
2036 |
lemma fresh_star_set: |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
2037 |
fixes xs::"('a::fs) list" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
2038 |
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
|
2039 |
unfolding fresh_star_def |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
2040 |
by (simp add: fresh_set) |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
2041 |
|
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
|
2042 |
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
|
2043 |
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
|
2044 |
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
|
2045 |
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
|
2046 |
|
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
parents:
2609
diff
changeset
|
2047 |
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
|
2048 |
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
|
2049 |
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
|
2050 |
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
|
2051 |
|
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
2052 |
lemma fresh_star_Un: |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2053 |
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
|
2054 |
by (auto simp add: fresh_star_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2055 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2056 |
lemma fresh_star_insert: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2057 |
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
|
2058 |
by (auto simp add: fresh_star_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2059 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2060 |
lemma fresh_star_Un_elim: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2061 |
"((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
|
2062 |
unfolding fresh_star_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2063 |
apply(rule) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2064 |
apply(erule meta_mp) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2065 |
apply(auto) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2066 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2067 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2068 |
lemma fresh_star_insert_elim: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2069 |
"(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
|
2070 |
unfolding fresh_star_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2071 |
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
|
2072 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2073 |
lemma fresh_star_empty_elim: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2074 |
"({} \<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
|
2075 |
by (simp add: fresh_star_def) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2076 |
|
2632
e8732350a29f
added small example for strong inductions; functions still need a sorry
Christian Urban <urbanc@in.tum.de>
parents:
2614
diff
changeset
|
2077 |
lemma fresh_star_Unit_elim: |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2078 |
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
|
2079 |
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
|
2080 |
|
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
2081 |
lemma fresh_star_Pair_elim: |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2082 |
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
|
2083 |
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
|
2084 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2085 |
lemma fresh_star_zero: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2086 |
shows "as \<sharp>* (0::perm)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2087 |
unfolding fresh_star_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2088 |
by (simp add: fresh_zero_perm) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2089 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2090 |
lemma fresh_star_plus: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2091 |
fixes p q::perm |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2092 |
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
|
2093 |
unfolding fresh_star_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2094 |
by (simp add: fresh_plus_perm) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2095 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2096 |
lemma fresh_star_permute_iff: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2097 |
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
|
2098 |
unfolding fresh_star_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2099 |
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
|
2100 |
|
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
2101 |
lemma fresh_star_eqvt [eqvt]: |
2663
54aade5d0fe6
moved high level code from LamTest into the main libraries.
Christian Urban <urbanc@in.tum.de>
parents:
2659
diff
changeset
|
2102 |
shows "p \<bullet> (as \<sharp>* x) \<longleftrightarrow> (p \<bullet> as) \<sharp>* (p \<bullet> x)" |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2103 |
unfolding fresh_star_def |
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
2104 |
by (perm_simp) (rule refl) |
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
2105 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2106 |
|
2735 | 2107 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2108 |
section {* Induction principle for permutations *} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2109 |
|
2776 | 2110 |
lemma smaller_supp: |
2111 |
assumes a: "a \<in> supp p" |
|
2112 |
shows "supp ((p \<bullet> a \<rightleftharpoons> a) + p) \<subset> supp p" |
|
2113 |
proof - |
|
2114 |
have "supp ((p \<bullet> a \<rightleftharpoons> a) + p) \<subseteq> supp p" |
|
2115 |
unfolding supp_perm by (auto simp add: swap_atom) |
|
2116 |
moreover |
|
2117 |
have "a \<notin> supp ((p \<bullet> a \<rightleftharpoons> a) + p)" by (simp add: supp_perm) |
|
2118 |
then have "supp ((p \<bullet> a \<rightleftharpoons> a) + p) \<noteq> supp p" using a by auto |
|
2119 |
ultimately |
|
2120 |
show "supp ((p \<bullet> a \<rightleftharpoons> a) + p) \<subset> supp p" by auto |
|
2121 |
qed |
|
2122 |
||
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2123 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2124 |
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
|
2125 |
assumes S: "supp p \<subseteq> S" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2126 |
and zero: "P 0" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2127 |
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
|
2128 |
shows "P p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2129 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2130 |
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
|
2131 |
then show "P p" using S |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2132 |
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
|
2133 |
case (psubset p) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2134 |
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
|
2135 |
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
|
2136 |
{ assume "supp p = {}" |
2732 | 2137 |
then have "p = 0" by (simp add: supp_perm perm_eq_iff) |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2138 |
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
|
2139 |
} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2140 |
moreover |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2141 |
{ assume "supp p \<noteq> {}" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2142 |
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
|
2143 |
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
|
2144 |
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
|
2145 |
let ?q = "(p \<bullet> a \<rightleftharpoons> a) + p" |
2776 | 2146 |
have a2: "supp ?q \<subset> supp p" using a0 smaller_supp by simp |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2147 |
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
|
2148 |
moreover |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2149 |
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
|
2150 |
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
|
2151 |
moreover |
2732 | 2152 |
have "p = (p \<bullet> a \<rightleftharpoons> a) + ?q" by (simp add: perm_eq_iff) |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2153 |
ultimately have "P p" by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2154 |
} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2155 |
ultimately show "P p" by blast |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2156 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2157 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2158 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2159 |
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
|
2160 |
assumes zero: "P 0" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2161 |
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
|
2162 |
shows "P p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2163 |
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
|
2164 |
(auto intro: zero swap) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2165 |
|
2669
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
2166 |
lemma perm_struct_induct2[consumes 1, case_names zero swap plus]: |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2167 |
assumes S: "supp p \<subseteq> S" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2168 |
assumes zero: "P 0" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2169 |
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
|
2170 |
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
|
2171 |
shows "P p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2172 |
using S |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2173 |
by (induct p rule: perm_struct_induct) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2174 |
(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
|
2175 |
|
2669
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
2176 |
lemma perm_simple_struct_induct2[case_names zero swap plus]: |
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
2177 |
assumes zero: "P 0" |
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
2178 |
assumes swap: "\<And>a b. \<lbrakk>sort_of a = sort_of b; a \<noteq> b\<rbrakk> \<Longrightarrow> P (a \<rightleftharpoons> b)" |
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
2179 |
assumes plus: "\<And>p1 p2. \<lbrakk>P p1; P p2\<rbrakk> \<Longrightarrow> P (p1 + p2)" |
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
2180 |
shows "P p" |
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
2181 |
by (rule_tac S="supp p" in perm_struct_induct2) |
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
2182 |
(auto intro: zero swap plus) |
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
2183 |
|
2679
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2184 |
lemma supp_perm_singleton: |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2185 |
fixes p::"perm" |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2186 |
shows "supp p \<subseteq> {b} \<longleftrightarrow> p = 0" |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2187 |
proof - |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2188 |
{ assume "supp p \<subseteq> {b}" |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2189 |
then have "p = 0" |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2190 |
by (induct p rule: perm_struct_induct) (simp_all) |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2191 |
} |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2192 |
then show "supp p \<subseteq> {b} \<longleftrightarrow> p = 0" by (auto simp add: supp_zero_perm) |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2193 |
qed |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2194 |
|
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2195 |
lemma supp_perm_pair: |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2196 |
fixes p::"perm" |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2197 |
shows "supp p \<subseteq> {a, b} \<longleftrightarrow> p = 0 \<or> p = (b \<rightleftharpoons> a)" |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2198 |
proof - |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2199 |
{ assume "supp p \<subseteq> {a, b}" |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2200 |
then have "p = 0 \<or> p = (b \<rightleftharpoons> a)" |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2201 |
apply (induct p rule: perm_struct_induct) |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2202 |
apply (auto simp add: swap_cancel supp_zero_perm supp_swap) |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2203 |
apply (simp add: swap_commute) |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2204 |
done |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2205 |
} |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2206 |
then show "supp p \<subseteq> {a, b} \<longleftrightarrow> p = 0 \<or> p = (b \<rightleftharpoons> a)" |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2207 |
by (auto simp add: supp_zero_perm supp_swap split: if_splits) |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2208 |
qed |
e003e5e36bae
added Minimal file to test things
Christian Urban <urbanc@in.tum.de>
parents:
2675
diff
changeset
|
2209 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2210 |
lemma supp_perm_eq: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2211 |
assumes "(supp x) \<sharp>* p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2212 |
shows "p \<bullet> x = x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2213 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2214 |
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
|
2215 |
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
|
2216 |
then show "p \<bullet> x = x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2217 |
proof (induct p rule: perm_struct_induct) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2218 |
case zero |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2219 |
show "0 \<bullet> x = x" by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2220 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2221 |
case (swap p a b) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2222 |
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
|
2223 |
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
|
2224 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2225 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2226 |
|
2776 | 2227 |
text {* same lemma as above, but proved with a different induction principle *} |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2228 |
lemma supp_perm_eq_test: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2229 |
assumes "(supp x) \<sharp>* p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2230 |
shows "p \<bullet> x = x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2231 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2232 |
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
|
2233 |
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
|
2234 |
then show "p \<bullet> x = x" |
2669
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
parents:
2668
diff
changeset
|
2235 |
proof (induct p rule: perm_struct_induct2) |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2236 |
case zero |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2237 |
show "0 \<bullet> x = x" by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2238 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2239 |
case (swap a b) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2240 |
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
|
2241 |
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
|
2242 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2243 |
case (plus p1 p2) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2244 |
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
|
2245 |
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
|
2246 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2247 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2248 |
|
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
2249 |
lemma perm_supp_eq: |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
2250 |
assumes a: "(supp p) \<sharp>* x" |
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
2251 |
shows "p \<bullet> x = x" |
2776 | 2252 |
proof - |
2253 |
from assms have "supp p \<subseteq> {a. a \<sharp> x}" |
|
2254 |
unfolding supp_perm fresh_star_def fresh_def by auto |
|
2255 |
then show "p \<bullet> x = x" |
|
2256 |
proof (induct p rule: perm_struct_induct2) |
|
2257 |
case zero |
|
2258 |
show "0 \<bullet> x = x" by simp |
|
2259 |
next |
|
2260 |
case (swap a b) |
|
2261 |
then have "a \<sharp> x" "b \<sharp> x" by simp_all |
|
2262 |
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by (simp add: swap_fresh_fresh) |
|
2263 |
next |
|
2264 |
case (plus p1 p2) |
|
2265 |
have "p1 \<bullet> x = x" "p2 \<bullet> x = x" by fact+ |
|
2266 |
then show "(p1 + p2) \<bullet> x = x" by simp |
|
2267 |
qed |
|
2268 |
qed |
|
2269 |
||
2591
35c570891a3a
isarfied some of the high-level proofs
Christian Urban <urbanc@in.tum.de>
parents:
2589
diff
changeset
|
2270 |
|
2659
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2271 |
lemma supp_perm_perm_eq: |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2272 |
assumes a: "\<forall>a \<in> supp x. p \<bullet> a = q \<bullet> a" |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2273 |
shows "p \<bullet> x = q \<bullet> x" |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2274 |
proof - |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2275 |
from a have "\<forall>a \<in> supp x. (-q + p) \<bullet> a = a" by simp |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2276 |
then have "\<forall>a \<in> supp x. a \<notin> supp (-q + p)" |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2277 |
unfolding supp_perm by simp |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2278 |
then have "supp x \<sharp>* (-q + p)" |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2279 |
unfolding fresh_star_def fresh_def by simp |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2280 |
then have "(-q + p) \<bullet> x = x" by (simp only: supp_perm_eq) |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2281 |
then show "p \<bullet> x = q \<bullet> x" |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2282 |
by (metis permute_minus_cancel permute_plus) |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2283 |
qed |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2284 |
|
2668
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2285 |
lemma atom_set_perm_eq: |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2286 |
assumes a: "as \<sharp>* p" |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2287 |
shows "p \<bullet> as = as" |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2288 |
proof - |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2289 |
from a have "supp p \<subseteq> {a. a \<notin> as}" |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2290 |
unfolding supp_perm fresh_star_def fresh_def by auto |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2291 |
then show "p \<bullet> as = as" |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2292 |
proof (induct p rule: perm_struct_induct) |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2293 |
case zero |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2294 |
show "0 \<bullet> as = as" by simp |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2295 |
next |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2296 |
case (swap p a b) |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2297 |
then have "a \<notin> as" "b \<notin> as" "p \<bullet> as = as" by simp_all |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2298 |
then show "((a \<rightleftharpoons> b) + p) \<bullet> as = as" by (simp add: swap_set_not_in) |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2299 |
qed |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2300 |
qed |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2301 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2302 |
section {* Avoiding of atom sets *} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2303 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2304 |
text {* |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2305 |
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
|
2306 |
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
|
2307 |
which 'translates' between both sets. |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2308 |
*} |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2309 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2310 |
lemma at_set_avoiding_aux: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2311 |
fixes Xs::"atom set" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2312 |
and As::"atom set" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2313 |
assumes b: "Xs \<subseteq> As" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2314 |
and c: "finite As" |
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
2315 |
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
|
2316 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2317 |
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
|
2318 |
then show ?thesis using b |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2319 |
proof (induct rule: finite_subset_induct) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2320 |
case empty |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2321 |
have "0 \<bullet> {} \<inter> As = {}" by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2322 |
moreover |
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
2323 |
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
|
2324 |
ultimately show ?case by blast |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2325 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2326 |
case (insert x Xs) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2327 |
then obtain p where |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2328 |
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
|
2329 |
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
|
2330 |
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
|
2331 |
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
|
2332 |
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
|
2333 |
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
|
2334 |
using `finite As` `finite Xs` |
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
2335 |
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
|
2336 |
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
|
2337 |
by (rule obtain_atom) |
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
2338 |
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
|
2339 |
by simp_all |
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
2340 |
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
|
2341 |
by (auto simp add: supp_perm) |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2342 |
let ?q = "(x \<rightleftharpoons> y) + p" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2343 |
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
|
2344 |
unfolding insert_eqvt |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2345 |
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
|
2346 |
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
|
2347 |
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
|
2348 |
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
|
2349 |
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
|
2350 |
unfolding q by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2351 |
moreover |
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
2352 |
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
|
2353 |
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
|
2354 |
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
|
2355 |
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
|
2356 |
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
|
2357 |
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
|
2358 |
by auto |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2359 |
ultimately show ?case by blast |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2360 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2361 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2362 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2363 |
lemma at_set_avoiding: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2364 |
assumes a: "finite Xs" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2365 |
and b: "finite (supp c)" |
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
2366 |
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
|
2367 |
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
|
2368 |
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
|
2369 |
|
2589
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
2370 |
lemma at_set_avoiding1: |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
2371 |
assumes "finite xs" |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
2372 |
and "finite (supp c)" |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
2373 |
shows "\<exists>p. (p \<bullet> xs) \<sharp>* c" |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
2374 |
using assms |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
2375 |
apply(erule_tac c="c" in at_set_avoiding) |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
2376 |
apply(auto) |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
2377 |
done |
9781db0e2196
completed proofs in Foo2
Christian Urban <urbanc@in.tum.de>
parents:
2588
diff
changeset
|
2378 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2379 |
lemma at_set_avoiding2: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2380 |
assumes "finite xs" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2381 |
and "finite (supp c)" "finite (supp x)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2382 |
and "xs \<sharp>* x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2383 |
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
|
2384 |
using assms |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2385 |
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
|
2386 |
apply(simp add: supp_Pair) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2387 |
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
|
2388 |
apply(simp add: fresh_star_Pair) |
2507 | 2389 |
apply(rule fresh_star_supp_conv) |
2390 |
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
|
2391 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2392 |
|
2573 | 2393 |
lemma at_set_avoiding3: |
2394 |
assumes "finite xs" |
|
2395 |
and "finite (supp c)" "finite (supp x)" |
|
2396 |
and "xs \<sharp>* x" |
|
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
2397 |
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
|
2398 |
using assms |
3ebc7ecfb0dd
disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents:
2573
diff
changeset
|
2399 |
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
|
2400 |
apply(simp add: supp_Pair) |
3ebc7ecfb0dd
disabled the Foo examples, because of heavy work
Christian Urban <urbanc@in.tum.de>
parents:
2573
diff
changeset
|
2401 |
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
|
2402 |
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
|
2403 |
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
|
2404 |
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
|
2405 |
done |
2573 | 2406 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2407 |
lemma at_set_avoiding2_atom: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2408 |
assumes "finite (supp c)" "finite (supp x)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2409 |
and b: "a \<sharp> x" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2410 |
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
|
2411 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2412 |
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
|
2413 |
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
|
2414 |
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
|
2415 |
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
|
2416 |
unfolding fresh_star_def Ball_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2417 |
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
|
2418 |
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
|
2419 |
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
|
2420 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2421 |
|
2614
0d7a1703fe28
a stronger statement for at_set_avoiding
Christian Urban <urbanc@in.tum.de>
parents:
2611
diff
changeset
|
2422 |
|
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2423 |
section {* Renaming permutations *} |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2424 |
|
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2425 |
lemma set_renaming_perm: |
2659
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2426 |
assumes b: "finite bs" |
2668
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2427 |
shows "\<exists>q. (\<forall>b \<in> bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> bs \<union> (p \<bullet> bs)" |
2659
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2428 |
using b |
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2429 |
proof (induct) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2430 |
case empty |
2668
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2431 |
have "(\<forall>b \<in> {}. 0 \<bullet> b = p \<bullet> b) \<and> supp (0::perm) \<subseteq> {} \<union> p \<bullet> {}" |
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2432 |
by (simp add: permute_set_eq supp_perm) |
2668
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2433 |
then show "\<exists>q. (\<forall>b \<in> {}. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> {} \<union> p \<bullet> {}" by blast |
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2434 |
next |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2435 |
case (insert a bs) |
2668
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2436 |
then have " \<exists>q. (\<forall>b \<in> bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> bs \<union> p \<bullet> bs" by simp |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2437 |
then obtain q where *: "\<forall>b \<in> bs. q \<bullet> b = p \<bullet> b" and **: "supp q \<subseteq> bs \<union> p \<bullet> bs" |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2438 |
by (metis empty_subsetI insert(3) supp_swap) |
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2439 |
{ assume 1: "q \<bullet> a = p \<bullet> a" |
2668
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2440 |
have "\<forall>b \<in> (insert a bs). q \<bullet> b = p \<bullet> b" using 1 * by simp |
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2441 |
moreover |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2442 |
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
|
2443 |
using ** by (auto simp add: insert_eqvt) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2444 |
ultimately |
2668
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2445 |
have "\<exists>q. (\<forall>b \<in> insert a bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs" by blast |
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2446 |
} |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2447 |
moreover |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2448 |
{ 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
|
2449 |
def q' \<equiv> "((q \<bullet> a) \<rightleftharpoons> (p \<bullet> a)) + q" |
2668
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2450 |
have "\<forall>b \<in> insert a bs. q' \<bullet> b = p \<bullet> b" using 2 * `a \<notin> bs` unfolding q'_def |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2451 |
by (auto simp add: swap_atom) |
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2452 |
moreover |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2453 |
{ have "{q \<bullet> a, p \<bullet> a} \<subseteq> insert a bs \<union> p \<bullet> insert a bs" |
2659
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2454 |
using ** |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2455 |
apply (auto simp add: supp_perm insert_eqvt) |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2456 |
apply (subgoal_tac "q \<bullet> a \<in> bs \<union> p \<bullet> bs") |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2457 |
apply(auto)[1] |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2458 |
apply(subgoal_tac "q \<bullet> a \<in> {a. q \<bullet> a \<noteq> a}") |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2459 |
apply(blast) |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2460 |
apply(simp) |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2461 |
done |
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2462 |
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
|
2463 |
moreover |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2464 |
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
|
2465 |
using ** by (auto simp add: insert_eqvt) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2466 |
ultimately |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2467 |
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
|
2468 |
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
|
2469 |
} |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2470 |
ultimately |
2668
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2471 |
have "\<exists>q. (\<forall>b \<in> insert a bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs" by blast |
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2472 |
} |
2668
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2473 |
ultimately show "\<exists>q. (\<forall>b \<in> insert a bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> insert a bs \<union> p \<bullet> insert a bs" |
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2474 |
by blast |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2475 |
qed |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2476 |
|
2672
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2477 |
lemma set_renaming_perm2: |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2478 |
shows "\<exists>q. (\<forall>b \<in> bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> bs \<union> (p \<bullet> bs)" |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2479 |
proof - |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2480 |
have "finite (bs \<inter> supp p)" by (simp add: finite_supp) |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2481 |
then obtain q |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2482 |
where *: "\<forall>b \<in> bs \<inter> supp p. q \<bullet> b = p \<bullet> b" and **: "supp q \<subseteq> (bs \<inter> supp p) \<union> (p \<bullet> (bs \<inter> supp p))" |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2483 |
using set_renaming_perm by blast |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2484 |
from ** have "supp q \<subseteq> bs \<union> (p \<bullet> bs)" by (auto simp add: inter_eqvt) |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2485 |
moreover |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2486 |
have "\<forall>b \<in> bs - supp p. q \<bullet> b = p \<bullet> b" |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2487 |
apply(auto) |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2488 |
apply(subgoal_tac "b \<notin> supp q") |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2489 |
apply(simp add: fresh_def[symmetric]) |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2490 |
apply(simp add: fresh_perm) |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2491 |
apply(clarify) |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2492 |
apply(rotate_tac 2) |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2493 |
apply(drule subsetD[OF **]) |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2494 |
apply(simp add: inter_eqvt supp_eqvt permute_self) |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2495 |
done |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2496 |
ultimately have "(\<forall>b \<in> bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> bs \<union> (p \<bullet> bs)" using * by auto |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2497 |
then show "\<exists>q. (\<forall>b \<in> bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> bs \<union> (p \<bullet> bs)" by blast |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2498 |
qed |
7e7662890477
removed finiteness assumption from set_rename_perm
Christian Urban <urbanc@in.tum.de>
parents:
2669
diff
changeset
|
2499 |
|
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2500 |
lemma list_renaming_perm: |
2668
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2501 |
shows "\<exists>q. (\<forall>b \<in> set bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> set bs \<union> (p \<bullet> set bs)" |
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2502 |
proof (induct bs) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2503 |
case (Cons a bs) |
2668
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2504 |
then have " \<exists>q. (\<forall>b \<in> set bs. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> set bs \<union> p \<bullet> (set bs)" by simp |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2505 |
then obtain q where *: "\<forall>b \<in> set bs. q \<bullet> b = p \<bullet> b" and **: "supp q \<subseteq> set bs \<union> p \<bullet> (set bs)" |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2506 |
by (blast) |
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2507 |
{ assume 1: "a \<in> set bs" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2508 |
have "q \<bullet> a = p \<bullet> a" using * 1 by (induct bs) (auto) |
2668
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2509 |
then have "\<forall>b \<in> set (a # bs). q \<bullet> b = p \<bullet> b" using * by simp |
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2510 |
moreover |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2511 |
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
|
2512 |
ultimately |
2668
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2513 |
have "\<exists>q. (\<forall>b \<in> set (a # bs). q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))" by blast |
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2514 |
} |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2515 |
moreover |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2516 |
{ assume 2: "a \<notin> set bs" |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2517 |
def q' \<equiv> "((q \<bullet> a) \<rightleftharpoons> (p \<bullet> a)) + q" |
2668
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2518 |
have "\<forall>b \<in> set (a # bs). q' \<bullet> b = p \<bullet> b" |
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2519 |
unfolding q'_def using 2 * `a \<notin> set bs` by (auto simp add: swap_atom) |
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2520 |
moreover |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2521 |
{ have "{q \<bullet> a, p \<bullet> a} \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))" |
2659
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2522 |
using ** |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2523 |
apply (auto simp add: supp_perm insert_eqvt) |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2524 |
apply (subgoal_tac "q \<bullet> a \<in> set bs \<union> p \<bullet> set bs") |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2525 |
apply(auto)[1] |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2526 |
apply(subgoal_tac "q \<bullet> a \<in> {a. q \<bullet> a \<noteq> a}") |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2527 |
apply(blast) |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2528 |
apply(simp) |
619ecb57db38
strengthened renaming lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2657
diff
changeset
|
2529 |
done |
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2530 |
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
|
2531 |
moreover |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2532 |
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
|
2533 |
using ** by (auto simp add: insert_eqvt) |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2534 |
ultimately |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2535 |
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
|
2536 |
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
|
2537 |
} |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2538 |
ultimately |
2668
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2539 |
have "\<exists>q. (\<forall>b \<in> set (a # bs). q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))" by blast |
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2540 |
} |
2668
92c001d93225
modified the renaming_perm lemmas
Christian Urban <urbanc@in.tum.de>
parents:
2663
diff
changeset
|
2541 |
ultimately show "\<exists>q. (\<forall>b \<in> set (a # bs). q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> set (a # bs) \<union> p \<bullet> (set (a # bs))" |
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2542 |
by blast |
2771
66ef2a2c64fb
more to the pearl paper
Christian Urban <urbanc@in.tum.de>
parents:
2760
diff
changeset
|
2543 |
next |
66ef2a2c64fb
more to the pearl paper
Christian Urban <urbanc@in.tum.de>
parents:
2760
diff
changeset
|
2544 |
case Nil |
66ef2a2c64fb
more to the pearl paper
Christian Urban <urbanc@in.tum.de>
parents:
2760
diff
changeset
|
2545 |
have "(\<forall>b \<in> set []. 0 \<bullet> b = p \<bullet> b) \<and> supp (0::perm) \<subseteq> set [] \<union> p \<bullet> set []" |
66ef2a2c64fb
more to the pearl paper
Christian Urban <urbanc@in.tum.de>
parents:
2760
diff
changeset
|
2546 |
by (simp add: supp_zero_perm) |
66ef2a2c64fb
more to the pearl paper
Christian Urban <urbanc@in.tum.de>
parents:
2760
diff
changeset
|
2547 |
then show "\<exists>q. (\<forall>b \<in> set []. q \<bullet> b = p \<bullet> b) \<and> supp q \<subseteq> set [] \<union> p \<bullet> (set [])" by blast |
2599
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2548 |
qed |
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2549 |
|
d6fe94028a5d
moved general theorems into the libraries
Christian Urban <urbanc@in.tum.de>
parents:
2591
diff
changeset
|
2550 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2551 |
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
|
2552 |
|
1972 | 2553 |
text {* |
2554 |
Class @{text at_base} allows types containing multiple sorts of atoms. |
|
2555 |
Class @{text at} only allows types with a single sort. |
|
2556 |
*} |
|
2557 |
||
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
|
2558 |
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
|
2559 |
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
|
2560 |
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
|
2561 |
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
|
2562 |
|
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
2563 |
declare atom_eqvt[eqvt] |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
2564 |
|
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
|
2565 |
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
|
2566 |
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
|
2567 |
|
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
|
2568 |
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
|
2569 |
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
|
2570 |
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
|
2571 |
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
|
2572 |
|
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
|
2573 |
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
|
2574 |
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
|
2575 |
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
|
2576 |
|
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
|
2577 |
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
|
2578 |
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
|
2579 |
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
|
2580 |
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
|
2581 |
|
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
|
2582 |
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
|
2583 |
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
|
2584 |
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
|
2585 |
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
|
2586 |
|
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
|
2587 |
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
|
2588 |
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
|
2589 |
|
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
|
2590 |
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
|
2591 |
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
|
2592 |
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
|
2593 |
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
|
2594 |
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
|
2595 |
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
|
2596 |
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
|
2597 |
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
|
2598 |
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
|
2599 |
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
|
2600 |
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
|
2601 |
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
|
2602 |
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
|
2603 |
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
|
2604 |
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
|
2605 |
|
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
|
2606 |
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
|
2607 |
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
|
2608 |
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
|
2609 |
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
|
2610 |
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
|
2611 |
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
|
2612 |
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
|
2613 |
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
|
2614 |
|
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
|
2615 |
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
|
2616 |
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
|
2617 |
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
|
2618 |
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
|
2619 |
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
|
2620 |
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
|
2621 |
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
|
2622 |
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
|
2623 |
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
|
2624 |
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
|
2625 |
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
|
2626 |
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
|
2627 |
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
|
2628 |
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
|
2629 |
|
2685
1df873b63cb2
added obtain_fresh lemma; tuned Lambda.thy
Christian Urban <urbanc@in.tum.de>
parents:
2683
diff
changeset
|
2630 |
lemma obtain_fresh': |
1df873b63cb2
added obtain_fresh lemma; tuned Lambda.thy
Christian Urban <urbanc@in.tum.de>
parents:
2683
diff
changeset
|
2631 |
assumes fin: "finite (supp x)" |
1df873b63cb2
added obtain_fresh lemma; tuned Lambda.thy
Christian Urban <urbanc@in.tum.de>
parents:
2683
diff
changeset
|
2632 |
obtains a::"'a::at_base" where "atom a \<sharp> x" |
1df873b63cb2
added obtain_fresh lemma; tuned Lambda.thy
Christian Urban <urbanc@in.tum.de>
parents:
2683
diff
changeset
|
2633 |
using obtain_at_base[where X="supp x"] |
1df873b63cb2
added obtain_fresh lemma; tuned Lambda.thy
Christian Urban <urbanc@in.tum.de>
parents:
2683
diff
changeset
|
2634 |
by (auto simp add: fresh_def fin) |
1df873b63cb2
added obtain_fresh lemma; tuned Lambda.thy
Christian Urban <urbanc@in.tum.de>
parents:
2683
diff
changeset
|
2635 |
|
1df873b63cb2
added obtain_fresh lemma; tuned Lambda.thy
Christian Urban <urbanc@in.tum.de>
parents:
2683
diff
changeset
|
2636 |
lemma obtain_fresh: |
1df873b63cb2
added obtain_fresh lemma; tuned Lambda.thy
Christian Urban <urbanc@in.tum.de>
parents:
2683
diff
changeset
|
2637 |
fixes x::"'b::fs" |
1df873b63cb2
added obtain_fresh lemma; tuned Lambda.thy
Christian Urban <urbanc@in.tum.de>
parents:
2683
diff
changeset
|
2638 |
obtains a::"'a::at_base" where "atom a \<sharp> x" |
1df873b63cb2
added obtain_fresh lemma; tuned Lambda.thy
Christian Urban <urbanc@in.tum.de>
parents:
2683
diff
changeset
|
2639 |
by (rule obtain_fresh') (auto simp add: finite_supp) |
1df873b63cb2
added obtain_fresh lemma; tuned Lambda.thy
Christian Urban <urbanc@in.tum.de>
parents:
2683
diff
changeset
|
2640 |
|
1973
fc5ce7f22b74
use the more general type-class at_base
Christian Urban <urbanc@in.tum.de>
parents:
1972
diff
changeset
|
2641 |
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
|
2642 |
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
|
2643 |
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
|
2644 |
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
|
2645 |
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
|
2646 |
apply(auto) |
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
2647 |
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
|
2648 |
|
2743
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
parents:
2742
diff
changeset
|
2649 |
(* FIXME |
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
parents:
2742
diff
changeset
|
2650 |
lemma supp_cofinite_set_at_base: |
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
parents:
2742
diff
changeset
|
2651 |
assumes a: "finite (UNIV - S)" |
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
parents:
2742
diff
changeset
|
2652 |
shows "supp S = atom ` (UNIV - S)" |
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
parents:
2742
diff
changeset
|
2653 |
apply(rule finite_supp_unique) |
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
parents:
2742
diff
changeset
|
2654 |
*) |
7085ab735de7
equivariance for All and Ex can be proved in terms of their definition
Christian Urban <urbanc@in.tum.de>
parents:
2742
diff
changeset
|
2655 |
|
2657
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
2656 |
lemma fresh_finite_set_at_base: |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
2657 |
fixes a::"'a::at_base" |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
2658 |
assumes a: "finite S" |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
2659 |
shows "atom a \<sharp> S \<longleftrightarrow> a \<notin> S" |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
2660 |
unfolding fresh_def |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
2661 |
apply(simp add: supp_finite_set_at_base[OF a]) |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
2662 |
apply(subst inj_image_mem_iff) |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
2663 |
apply(simp add: inj_on_def) |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
2664 |
apply(simp) |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
2665 |
done |
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
2666 |
|
2776 | 2667 |
lemma fresh_at_base_permute_iff [simp]: |
2683
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
2668 |
fixes a::"'a::at_base" |
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
2669 |
shows "atom (p \<bullet> a) \<sharp> p \<bullet> x \<longleftrightarrow> atom a \<sharp> x" |
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
2670 |
unfolding atom_eqvt[symmetric] |
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
2671 |
by (simp add: fresh_permute_iff) |
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
2672 |
|
2657
1ea9c059fc0f
a few lemmas about freshness for at and at_base
Christian Urban <urbanc@in.tum.de>
parents:
2641
diff
changeset
|
2673 |
|
2467
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2674 |
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
|
2675 |
|
2467
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2676 |
definition |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2677 |
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
|
2678 |
where |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2679 |
"(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
|
2680 |
|
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
2681 |
|
2467
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2682 |
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
|
2683 |
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
|
2684 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2685 |
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
|
2686 |
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
|
2687 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2688 |
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
|
2689 |
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
|
2690 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2691 |
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
|
2692 |
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
|
2693 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2694 |
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
|
2695 |
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
|
2696 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2697 |
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
|
2698 |
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
|
2699 |
|
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
2700 |
lemma flip_eqvt [eqvt]: |
2467
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2701 |
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
|
2702 |
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
|
2703 |
unfolding flip_def |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2704 |
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
|
2705 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2706 |
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
|
2707 |
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
|
2708 |
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
|
2709 |
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
|
2710 |
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
|
2711 |
unfolding flip_def |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2712 |
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
|
2713 |
unfolding atom_eqvt [symmetric] |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2714 |
by simp_all |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2715 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2716 |
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
|
2717 |
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
|
2718 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2719 |
lemma permute_flip_at: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2720 |
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
|
2721 |
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
|
2722 |
unfolding flip_def |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2723 |
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
|
2724 |
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
|
2725 |
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
|
2726 |
done |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2727 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2728 |
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
|
2729 |
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
|
2730 |
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
|
2731 |
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
|
2732 |
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
|
2733 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2734 |
lemma flip_fresh_fresh: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2735 |
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
|
2736 |
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
|
2737 |
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
|
2738 |
using assms |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2739 |
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
|
2740 |
|
2683
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
2741 |
|
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
2742 |
|
2467
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2743 |
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
|
2744 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2745 |
syntax |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2746 |
"_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
|
2747 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2748 |
translations |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2749 |
"_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
|
2750 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2751 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2752 |
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
|
2753 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2754 |
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
|
2755 |
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
|
2756 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2757 |
text {* |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2758 |
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
|
2759 |
*} |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2760 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2761 |
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
|
2762 |
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
|
2763 |
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
|
2764 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2765 |
lemma exists_eq_sort: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2766 |
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
|
2767 |
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
|
2768 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2769 |
lemma at_base_class: |
2847 | 2770 |
fixes sort_fun :: "'b \<Rightarrow> atom_sort" |
2467
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2771 |
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
|
2772 |
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
|
2773 |
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
|
2774 |
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
|
2775 |
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
|
2776 |
proof |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2777 |
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
|
2778 |
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
|
2779 |
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
|
2780 |
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
|
2781 |
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
|
2782 |
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
|
2783 |
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
|
2784 |
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
|
2785 |
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
|
2786 |
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
|
2787 |
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
|
2788 |
qed |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2789 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2790 |
(* |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2791 |
lemma at_class: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2792 |
fixes s :: atom_sort |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2793 |
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
|
2794 |
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
|
2795 |
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
|
2796 |
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
|
2797 |
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
|
2798 |
proof |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2799 |
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
|
2800 |
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
|
2801 |
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
|
2802 |
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
|
2803 |
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
|
2804 |
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
|
2805 |
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
|
2806 |
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
|
2807 |
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
|
2808 |
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
|
2809 |
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
|
2810 |
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
|
2811 |
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
|
2812 |
qed |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2813 |
*) |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2814 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2815 |
lemma at_class: |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2816 |
fixes s :: atom_sort |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2817 |
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
|
2818 |
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
|
2819 |
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
|
2820 |
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
|
2821 |
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
|
2822 |
proof |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2823 |
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
|
2824 |
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
|
2825 |
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
|
2826 |
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
|
2827 |
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
|
2828 |
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
|
2829 |
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
|
2830 |
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
|
2831 |
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
|
2832 |
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
|
2833 |
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
|
2834 |
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
|
2835 |
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
|
2836 |
qed |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2837 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2838 |
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
|
2839 |
(@{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
|
2840 |
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
|
2841 |
(@{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
|
2842 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
2843 |
|
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2844 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2845 |
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
|
2846 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2847 |
lemma freshness_lemma: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2848 |
fixes h :: "'a::at \<Rightarrow> 'b::pt" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2849 |
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
|
2850 |
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
|
2851 |
proof - |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2852 |
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
|
2853 |
by (auto simp add: fresh_Pair) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2854 |
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
|
2855 |
proof (intro exI allI impI) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2856 |
fix a :: 'a |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2857 |
assume a3: "atom a \<sharp> h" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2858 |
show "h a = h b" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2859 |
proof (cases "a = b") |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2860 |
assume "a = b" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2861 |
thus "h a = h b" by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2862 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2863 |
assume "a \<noteq> b" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2864 |
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
|
2865 |
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
|
2866 |
by (rule fresh_fun_app) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2867 |
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
|
2868 |
by (rule swap_fresh_fresh) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2869 |
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
|
2870 |
by (rule swap_fresh_fresh) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2871 |
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
|
2872 |
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
|
2873 |
by (rule permute_fun_app_eq) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2874 |
also have "\<dots> = h a" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2875 |
using d2 by simp |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2876 |
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
|
2877 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2878 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2879 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2880 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2881 |
lemma freshness_lemma_unique: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2882 |
fixes h :: "'a::at \<Rightarrow> 'b::pt" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2883 |
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
|
2884 |
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
|
2885 |
proof (rule ex_ex1I) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2886 |
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
|
2887 |
by (rule freshness_lemma) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2888 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2889 |
fix x y |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2890 |
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
|
2891 |
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
|
2892 |
from a x y show "x = y" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2893 |
by (auto simp add: fresh_Pair) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2894 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2895 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2896 |
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
|
2897 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2898 |
definition |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2899 |
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
|
2900 |
where |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2901 |
"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
|
2902 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2903 |
lemma fresh_fun_apply: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2904 |
fixes h :: "'a::at \<Rightarrow> 'b::pt" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2905 |
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
|
2906 |
assumes b: "atom a \<sharp> h" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2907 |
shows "fresh_fun h = h a" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2908 |
unfolding fresh_fun_def |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2909 |
proof (rule the_equality) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2910 |
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
|
2911 |
proof (intro strip) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2912 |
fix a':: 'a |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2913 |
assume c: "atom a' \<sharp> h" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2914 |
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
|
2915 |
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
|
2916 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2917 |
next |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2918 |
fix fr :: 'b |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2919 |
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
|
2920 |
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
|
2921 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2922 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2923 |
lemma fresh_fun_apply': |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2924 |
fixes h :: "'a::at \<Rightarrow> 'b::pt" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2925 |
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
|
2926 |
shows "fresh_fun h = h a" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2927 |
apply (rule fresh_fun_apply) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2928 |
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
|
2929 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2930 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2931 |
lemma fresh_fun_eqvt: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2932 |
fixes h :: "'a::at \<Rightarrow> 'b::pt" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2933 |
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
|
2934 |
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
|
2935 |
using a |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2936 |
apply (clarsimp simp add: fresh_Pair) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2937 |
apply (subst fresh_fun_apply', assumption+) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2938 |
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
|
2939 |
apply (drule fresh_permute_iff [where p=p, THEN iffD2]) |
2683
42c0d011a177
ported some of the old proofs to serve as testcases
Christian Urban <urbanc@in.tum.de>
parents:
2679
diff
changeset
|
2940 |
apply (simp only: atom_eqvt permute_fun_app_eq [where f=h]) |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2941 |
apply (erule (1) fresh_fun_apply' [symmetric]) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2942 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2943 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2944 |
lemma fresh_fun_supports: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2945 |
fixes h :: "'a::at \<Rightarrow> 'b::pt" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2946 |
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
|
2947 |
shows "(supp h) supports (fresh_fun h)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2948 |
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
|
2949 |
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
|
2950 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2951 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2952 |
notation fresh_fun (binder "FRESH " 10) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2953 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2954 |
lemma FRESH_f_iff: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2955 |
fixes P :: "'a::at \<Rightarrow> 'b::pure" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2956 |
fixes f :: "'b \<Rightarrow> 'c::pure" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2957 |
assumes P: "finite (supp P)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2958 |
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
|
2959 |
proof - |
2685
1df873b63cb2
added obtain_fresh lemma; tuned Lambda.thy
Christian Urban <urbanc@in.tum.de>
parents:
2683
diff
changeset
|
2960 |
obtain a::'a where "atom a \<sharp> P" using P by (rule obtain_fresh') |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2961 |
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
|
2962 |
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
|
2963 |
apply (cut_tac `atom a \<sharp> P`) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2964 |
apply (simp add: fresh_conv_MOST) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2965 |
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
|
2966 |
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
|
2967 |
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
|
2968 |
apply (rule refl) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2969 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2970 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2971 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2972 |
lemma FRESH_binop_iff: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2973 |
fixes P :: "'a::at \<Rightarrow> 'b::pure" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2974 |
fixes Q :: "'a::at \<Rightarrow> 'c::pure" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2975 |
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
|
2976 |
assumes P: "finite (supp P)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2977 |
and Q: "finite (supp Q)" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2978 |
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
|
2979 |
proof - |
2685
1df873b63cb2
added obtain_fresh lemma; tuned Lambda.thy
Christian Urban <urbanc@in.tum.de>
parents:
2683
diff
changeset
|
2980 |
from assms have "finite (supp (P, Q))" by (simp add: supp_Pair) |
1df873b63cb2
added obtain_fresh lemma; tuned Lambda.thy
Christian Urban <urbanc@in.tum.de>
parents:
2683
diff
changeset
|
2981 |
then obtain a::'a where "atom a \<sharp> (P, Q)" by (rule obtain_fresh') |
1df873b63cb2
added obtain_fresh lemma; tuned Lambda.thy
Christian Urban <urbanc@in.tum.de>
parents:
2683
diff
changeset
|
2982 |
then have "atom a \<sharp> P" and "atom a \<sharp> Q" by (simp_all add: fresh_Pair) |
2470
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2983 |
show ?thesis |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2984 |
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
|
2985 |
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
|
2986 |
apply (simp add: fresh_conv_MOST) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2987 |
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
|
2988 |
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
|
2989 |
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
|
2990 |
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
|
2991 |
apply (rule refl) |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2992 |
done |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2993 |
qed |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2994 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2995 |
lemma FRESH_conj_iff: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2996 |
fixes P Q :: "'a::at \<Rightarrow> bool" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
2997 |
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
|
2998 |
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
|
2999 |
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
|
3000 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
3001 |
lemma FRESH_disj_iff: |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
3002 |
fixes P Q :: "'a::at \<Rightarrow> bool" |
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
3003 |
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
|
3004 |
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
|
3005 |
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
|
3006 |
|
bdb1eab47161
moved everything out of Nominal_Supp
Christian Urban <urbanc@in.tum.de>
parents:
2467
diff
changeset
|
3007 |
|
2467
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
3008 |
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
|
3009 |
|
1833
2050b5723c04
added a library for basic nominal functions; separated nominal_eqvt file
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
3010 |
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
|
3011 |
|
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
3012 |
|
2467
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
3013 |
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
|
3014 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
3015 |
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
|
3016 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
3017 |
use "nominal_atoms.ML" |
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
3018 |
|
67b3933c3190
got rid of Nominal_Atoms (folded into Nominal2_Base)
Christian Urban <urbanc@in.tum.de>
parents:
2466
diff
changeset
|
3019 |
|
2733
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
3020 |
section {* automatic equivariance procedure for inductive definitions *} |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
3021 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
3022 |
use "nominal_eqvt.ML" |
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
3023 |
|
5f6fefdbf055
split the library into a basics file; merged Nominal_Eqvt into Nominal_Base
Christian Urban <urbanc@in.tum.de>
parents:
2732
diff
changeset
|
3024 |
|
2466
47c840599a6b
cleaned a bit various thy-files in Nominal-General
Christian Urban <urbanc@in.tum.de>
parents:
2378
diff
changeset
|
3025 |
|
1062 | 3026 |
end |