| author | Cezary Kaliszyk <kaliszyk@in.tum.de> | 
| Tue, 02 Feb 2010 12:36:01 +0100 | |
| changeset 1025 | 559419060d99 | 
| parent 1013 | e63838c26f28 | 
| child 1061 | 8de99358f309 | 
| permissions | -rw-r--r-- | 
| 
947
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
1  | 
(* Title: Nominal2_Base  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
2  | 
Authors: Brian Huffman, Christian Urban  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
3  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
4  | 
Basic definitions and lemma infrastructure for  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
5  | 
Nominal Isabelle.  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
6  | 
*)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
7  | 
theory Nominal2_Base  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
8  | 
imports Main Infinite_Set  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
9  | 
begin  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
10  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
11  | 
section {* Atoms and Sorts *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
12  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
13  | 
text {* A simple implementation for atom_sorts is strings. *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
14  | 
(* types atom_sort = string *)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
15  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
16  | 
text {* To deal with Church-like binding we use trees of  
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
17  | 
strings as sorts. *}  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
18  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
19  | 
datatype atom_sort = Sort "string" "atom_sort list"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
20  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
21  | 
datatype atom = Atom atom_sort nat  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
22  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
23  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
24  | 
text {* Basic projection function. *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
25  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
26  | 
primrec  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
27  | 
sort_of :: "atom \<Rightarrow> atom_sort"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
28  | 
where  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
29  | 
"sort_of (Atom s i) = s"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
30  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
31  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
32  | 
text {* There are infinitely many atoms of each sort. *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
33  | 
lemma INFM_sort_of_eq:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
34  | 
shows "INFM a. sort_of a = s"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
35  | 
proof -  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
36  | 
have "INFM i. sort_of (Atom s i) = s" by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
37  | 
moreover have "inj (Atom s)" by (simp add: inj_on_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
38  | 
ultimately show "INFM a. sort_of a = s" by (rule INFM_inj)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
39  | 
qed  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
40  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
41  | 
lemma infinite_sort_of_eq:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
42  | 
  shows "infinite {a. sort_of a = s}"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
43  | 
using INFM_sort_of_eq unfolding INFM_iff_infinite .  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
44  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
45  | 
lemma atom_infinite [simp]:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
46  | 
shows "infinite (UNIV :: atom set)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
47  | 
using subset_UNIV infinite_sort_of_eq  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
48  | 
by (rule infinite_super)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
49  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
50  | 
lemma obtain_atom:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
51  | 
fixes X :: "atom set"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
52  | 
assumes X: "finite X"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
53  | 
obtains a where "a \<notin> X" "sort_of a = s"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
54  | 
proof -  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
55  | 
from X have "MOST a. a \<notin> X"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
56  | 
unfolding MOST_iff_cofinite by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
57  | 
with INFM_sort_of_eq  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
58  | 
have "INFM a. sort_of a = s \<and> a \<notin> X"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
59  | 
by (rule INFM_conjI)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
60  | 
then obtain a where "a \<notin> X" "sort_of a = s"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
61  | 
by (auto elim: INFM_E)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
62  | 
then show ?thesis ..  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
63  | 
qed  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
64  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
65  | 
section {* Sort-Respecting Permutations *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
66  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
67  | 
typedef perm =  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
68  | 
  "{f. bij f \<and> finite {a. f a \<noteq> a} \<and> (\<forall>a. sort_of (f a) = sort_of a)}"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
69  | 
proof  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
70  | 
show "id \<in> ?perm" by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
71  | 
qed  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
72  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
73  | 
lemma permI:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
74  | 
assumes "bij f" and "MOST x. f x = x" and "\<And>a. sort_of (f a) = sort_of a"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
75  | 
shows "f \<in> perm"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
76  | 
using assms unfolding perm_def MOST_iff_cofinite by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
77  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
78  | 
lemma perm_is_bij: "f \<in> perm \<Longrightarrow> bij f"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
79  | 
unfolding perm_def by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
80  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
81  | 
lemma perm_is_finite: "f \<in> perm \<Longrightarrow> finite {a. f a \<noteq> a}"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
82  | 
unfolding perm_def by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
83  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
84  | 
lemma perm_is_sort_respecting: "f \<in> perm \<Longrightarrow> sort_of (f a) = sort_of a"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
85  | 
unfolding perm_def by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
86  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
87  | 
lemma perm_MOST: "f \<in> perm \<Longrightarrow> MOST x. f x = x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
88  | 
unfolding perm_def MOST_iff_cofinite by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
89  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
90  | 
lemma perm_id: "id \<in> perm"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
91  | 
unfolding perm_def by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
92  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
93  | 
lemma perm_comp:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
94  | 
assumes f: "f \<in> perm" and g: "g \<in> perm"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
95  | 
shows "(f \<circ> g) \<in> perm"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
96  | 
apply (rule permI)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
97  | 
apply (rule bij_comp)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
98  | 
apply (rule perm_is_bij [OF g])  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
99  | 
apply (rule perm_is_bij [OF f])  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
100  | 
apply (rule MOST_rev_mp [OF perm_MOST [OF g]])  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
101  | 
apply (rule MOST_rev_mp [OF perm_MOST [OF f]])  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
102  | 
apply (simp)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
103  | 
apply (simp add: perm_is_sort_respecting [OF f])  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
104  | 
apply (simp add: perm_is_sort_respecting [OF g])  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
105  | 
done  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
106  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
107  | 
lemma perm_inv:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
108  | 
assumes f: "f \<in> perm"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
109  | 
shows "(inv f) \<in> perm"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
110  | 
apply (rule permI)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
111  | 
apply (rule bij_imp_bij_inv)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
112  | 
apply (rule perm_is_bij [OF f])  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
113  | 
apply (rule MOST_mono [OF perm_MOST [OF f]])  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
114  | 
apply (erule subst, rule inv_f_f)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
115  | 
apply (rule bij_is_inj [OF perm_is_bij [OF f]])  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
116  | 
apply (rule perm_is_sort_respecting [OF f, THEN sym, THEN trans])  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
117  | 
apply (simp add: surj_f_inv_f [OF bij_is_surj [OF perm_is_bij [OF f]]])  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
118  | 
done  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
119  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
120  | 
lemma bij_Rep_perm: "bij (Rep_perm p)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
121  | 
using Rep_perm [of p] unfolding perm_def by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
122  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
123  | 
lemma finite_Rep_perm: "finite {a. Rep_perm p a \<noteq> a}"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
124  | 
using Rep_perm [of p] unfolding perm_def by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
125  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
126  | 
lemma sort_of_Rep_perm: "sort_of (Rep_perm p a) = sort_of a"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
127  | 
using Rep_perm [of p] unfolding perm_def by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
128  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
129  | 
lemma Rep_perm_ext:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
130  | 
"Rep_perm p1 = Rep_perm p2 \<Longrightarrow> p1 = p2"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
131  | 
by (simp add: expand_fun_eq Rep_perm_inject [symmetric])  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
132  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
133  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
134  | 
subsection {* Permutations form a group *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
135  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
136  | 
instantiation perm :: group_add  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
137  | 
begin  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
138  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
139  | 
definition  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
140  | 
"0 = Abs_perm id"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
141  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
142  | 
definition  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
143  | 
"- p = Abs_perm (inv (Rep_perm p))"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
144  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
145  | 
definition  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
146  | 
"p + q = Abs_perm (Rep_perm p \<circ> Rep_perm q)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
147  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
148  | 
definition  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
149  | 
"(p1::perm) - p2 = p1 + - p2"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
150  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
151  | 
lemma Rep_perm_0: "Rep_perm 0 = id"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
152  | 
unfolding zero_perm_def  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
153  | 
by (simp add: Abs_perm_inverse perm_id)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
154  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
155  | 
lemma Rep_perm_add:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
156  | 
"Rep_perm (p1 + p2) = Rep_perm p1 \<circ> Rep_perm p2"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
157  | 
unfolding plus_perm_def  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
158  | 
by (simp add: Abs_perm_inverse perm_comp Rep_perm)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
159  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
160  | 
lemma Rep_perm_uminus:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
161  | 
"Rep_perm (- p) = inv (Rep_perm p)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
162  | 
unfolding uminus_perm_def  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
163  | 
by (simp add: Abs_perm_inverse perm_inv Rep_perm)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
164  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
165  | 
instance  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
166  | 
apply default  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
167  | 
unfolding Rep_perm_inject [symmetric]  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
168  | 
unfolding minus_perm_def  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
169  | 
unfolding Rep_perm_add  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
170  | 
unfolding Rep_perm_uminus  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
171  | 
unfolding Rep_perm_0  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
172  | 
by (simp_all add: o_assoc inv_o_cancel [OF bij_is_inj [OF bij_Rep_perm]])  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
173  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
174  | 
end  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
175  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
176  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
177  | 
section {* Implementation of swappings *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
178  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
179  | 
definition  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
180  | 
  swap :: "atom \<Rightarrow> atom \<Rightarrow> perm" ("'(_ \<rightleftharpoons> _')")
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
181  | 
where  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
182  | 
"(a \<rightleftharpoons> b) =  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
183  | 
Abs_perm (if sort_of a = sort_of b  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
184  | 
then (\<lambda>c. if a = c then b else if b = c then a else c)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
185  | 
else id)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
186  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
187  | 
lemma Rep_perm_swap:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
188  | 
"Rep_perm (a \<rightleftharpoons> b) =  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
189  | 
(if sort_of a = sort_of b  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
190  | 
then (\<lambda>c. if a = c then b else if b = c then a else c)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
191  | 
else id)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
192  | 
unfolding swap_def  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
193  | 
apply (rule Abs_perm_inverse)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
194  | 
apply (rule permI)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
195  | 
apply (auto simp add: bij_def inj_on_def surj_def)[1]  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
196  | 
apply (rule MOST_rev_mp [OF MOST_neq(1) [of a]])  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
197  | 
apply (rule MOST_rev_mp [OF MOST_neq(1) [of b]])  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
198  | 
apply (simp)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
199  | 
apply (simp)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
200  | 
done  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
201  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
202  | 
lemmas Rep_perm_simps =  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
203  | 
Rep_perm_0  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
204  | 
Rep_perm_add  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
205  | 
Rep_perm_uminus  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
206  | 
Rep_perm_swap  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
207  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
208  | 
lemma swap_different_sorts [simp]:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
209  | 
"sort_of a \<noteq> sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) = 0"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
210  | 
by (rule Rep_perm_ext) (simp add: Rep_perm_simps)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
211  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
212  | 
lemma swap_cancel:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
213  | 
"(a \<rightleftharpoons> b) + (a \<rightleftharpoons> b) = 0"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
214  | 
by (rule Rep_perm_ext)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
215  | 
(simp add: Rep_perm_simps expand_fun_eq)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
216  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
217  | 
lemma swap_self [simp]:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
218  | 
"(a \<rightleftharpoons> a) = 0"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
219  | 
by (rule Rep_perm_ext, simp add: Rep_perm_simps expand_fun_eq)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
220  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
221  | 
lemma minus_swap [simp]:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
222  | 
"- (a \<rightleftharpoons> b) = (a \<rightleftharpoons> b)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
223  | 
by (rule minus_unique [OF swap_cancel])  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
224  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
225  | 
lemma swap_commute:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
226  | 
"(a \<rightleftharpoons> b) = (b \<rightleftharpoons> a)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
227  | 
by (rule Rep_perm_ext)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
228  | 
(simp add: Rep_perm_swap expand_fun_eq)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
229  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
230  | 
lemma swap_triple:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
231  | 
assumes "a \<noteq> b" and "c \<noteq> b"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
232  | 
assumes "sort_of a = sort_of b" "sort_of b = sort_of c"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
233  | 
shows "(a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c) = (a \<rightleftharpoons> b)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
234  | 
using assms  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
235  | 
by (rule_tac Rep_perm_ext)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
236  | 
(auto simp add: Rep_perm_simps expand_fun_eq)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
237  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
238  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
239  | 
section {* Permutation Types *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
240  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
241  | 
text {*
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
242  | 
  Infix syntax for @{text permute} has higher precedence than
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
243  | 
addition, but lower than unary minus.  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
244  | 
*}  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
245  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
246  | 
class pt =  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
247  | 
  fixes permute :: "perm \<Rightarrow> 'a \<Rightarrow> 'a" ("_ \<bullet> _" [76, 75] 75)
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
248  | 
assumes permute_zero [simp]: "0 \<bullet> x = x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
249  | 
assumes permute_plus [simp]: "(p + q) \<bullet> x = p \<bullet> (q \<bullet> x)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
250  | 
begin  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
251  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
252  | 
lemma permute_diff [simp]:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
253  | 
shows "(p - q) \<bullet> x = p \<bullet> - q \<bullet> x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
254  | 
unfolding diff_minus by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
255  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
256  | 
lemma permute_minus_cancel [simp]:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
257  | 
shows "p \<bullet> - p \<bullet> x = x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
258  | 
and "- p \<bullet> p \<bullet> x = x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
259  | 
unfolding permute_plus [symmetric] by simp_all  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
260  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
261  | 
lemma permute_swap_cancel [simp]:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
262  | 
shows "(a \<rightleftharpoons> b) \<bullet> (a \<rightleftharpoons> b) \<bullet> x = x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
263  | 
unfolding permute_plus [symmetric]  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
264  | 
by (simp add: swap_cancel)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
265  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
266  | 
lemma permute_swap_cancel2 [simp]:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
267  | 
shows "(a \<rightleftharpoons> b) \<bullet> (b \<rightleftharpoons> a) \<bullet> x = x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
268  | 
unfolding permute_plus [symmetric]  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
269  | 
by (simp add: swap_commute)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
270  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
271  | 
lemma inj_permute [simp]:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
272  | 
shows "inj (permute p)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
273  | 
by (rule inj_on_inverseI)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
274  | 
(rule permute_minus_cancel)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
275  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
276  | 
lemma surj_permute [simp]:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
277  | 
shows "surj (permute p)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
278  | 
by (rule surjI, rule permute_minus_cancel)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
279  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
280  | 
lemma bij_permute [simp]:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
281  | 
shows "bij (permute p)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
282  | 
by (rule bijI [OF inj_permute surj_permute])  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
283  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
284  | 
lemma inv_permute:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
285  | 
shows "inv (permute p) = permute (- p)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
286  | 
by (rule inv_equality) (simp_all)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
287  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
288  | 
lemma permute_minus:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
289  | 
shows "permute (- p) = inv (permute p)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
290  | 
by (simp add: inv_permute)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
291  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
292  | 
lemma permute_eq_iff [simp]:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
293  | 
shows "p \<bullet> x = p \<bullet> y \<longleftrightarrow> x = y"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
294  | 
by (rule inj_permute [THEN inj_eq])  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
295  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
296  | 
end  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
297  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
298  | 
subsection {* Permutations for atoms *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
299  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
300  | 
instantiation atom :: pt  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
301  | 
begin  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
302  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
303  | 
definition  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
304  | 
"p \<bullet> a = Rep_perm p a"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
305  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
306  | 
instance  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
307  | 
apply(default)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
308  | 
apply(simp_all add: permute_atom_def Rep_perm_simps)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
309  | 
done  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
310  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
311  | 
end  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
312  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
313  | 
lemma sort_of_permute [simp]:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
314  | 
shows "sort_of (p \<bullet> a) = sort_of a"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
315  | 
unfolding permute_atom_def by (rule sort_of_Rep_perm)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
316  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
317  | 
lemma swap_atom:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
318  | 
shows "(a \<rightleftharpoons> b) \<bullet> c =  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
319  | 
(if sort_of a = sort_of b  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
320  | 
then (if c = a then b else if c = b then a else c) else c)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
321  | 
unfolding permute_atom_def  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
322  | 
by (simp add: Rep_perm_swap)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
323  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
324  | 
lemma swap_atom_simps [simp]:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
325  | 
"sort_of a = sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> a = b"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
326  | 
"sort_of a = sort_of b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> b = a"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
327  | 
"c \<noteq> a \<Longrightarrow> c \<noteq> b \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> c = c"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
328  | 
unfolding swap_atom by simp_all  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
329  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
330  | 
lemma expand_perm_eq:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
331  | 
fixes p q :: "perm"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
332  | 
shows "p = q \<longleftrightarrow> (\<forall>a::atom. p \<bullet> a = q \<bullet> a)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
333  | 
unfolding permute_atom_def  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
334  | 
by (metis Rep_perm_ext ext)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
335  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
336  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
337  | 
subsection {* Permutations for permutations *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
338  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
339  | 
instantiation perm :: pt  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
340  | 
begin  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
341  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
342  | 
definition  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
343  | 
"p \<bullet> q = p + q - p"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
344  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
345  | 
instance  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
346  | 
apply default  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
347  | 
apply (simp add: permute_perm_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
348  | 
apply (simp add: permute_perm_def diff_minus minus_add add_assoc)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
349  | 
done  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
350  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
351  | 
end  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
352  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
353  | 
lemma permute_self: "p \<bullet> p = p"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
354  | 
unfolding permute_perm_def by (simp add: diff_minus add_assoc)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
355  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
356  | 
lemma permute_eqvt:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
357  | 
shows "p \<bullet> (q \<bullet> x) = (p \<bullet> q) \<bullet> (p \<bullet> x)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
358  | 
unfolding permute_perm_def by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
359  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
360  | 
lemma zero_perm_eqvt:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
361  | 
shows "p \<bullet> (0::perm) = 0"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
362  | 
unfolding permute_perm_def by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
363  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
364  | 
lemma add_perm_eqvt:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
365  | 
fixes p p1 p2 :: perm  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
366  | 
shows "p \<bullet> (p1 + p2) = p \<bullet> p1 + p \<bullet> p2"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
367  | 
unfolding permute_perm_def  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
368  | 
by (simp add: expand_perm_eq)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
369  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
370  | 
lemma swap_eqvt:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
371  | 
shows "p \<bullet> (a \<rightleftharpoons> b) = (p \<bullet> a \<rightleftharpoons> p \<bullet> b)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
372  | 
unfolding permute_perm_def  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
373  | 
by (auto simp add: swap_atom expand_perm_eq)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
374  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
375  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
376  | 
subsection {* Permutations for functions *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
377  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
378  | 
instantiation "fun" :: (pt, pt) pt  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
379  | 
begin  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
380  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
381  | 
definition  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
382  | 
"p \<bullet> f = (\<lambda>x. p \<bullet> (f (- p \<bullet> x)))"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
383  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
384  | 
instance  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
385  | 
apply default  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
386  | 
apply (simp add: permute_fun_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
387  | 
apply (simp add: permute_fun_def minus_add)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
388  | 
done  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
389  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
390  | 
end  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
391  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
392  | 
lemma permute_fun_app_eq:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
393  | 
shows "p \<bullet> (f x) = (p \<bullet> f) (p \<bullet> x)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
394  | 
unfolding permute_fun_def by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
395  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
396  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
397  | 
subsection {* Permutations for booleans *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
398  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
399  | 
instantiation bool :: pt  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
400  | 
begin  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
401  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
402  | 
definition "p \<bullet> (b::bool) = b"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
403  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
404  | 
instance  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
405  | 
apply(default)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
406  | 
apply(simp_all add: permute_bool_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
407  | 
done  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
408  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
409  | 
end  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
410  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
411  | 
lemma Not_eqvt:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
412  | 
shows "p \<bullet> (\<not> A) = (\<not> (p \<bullet> A))"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
413  | 
by (simp add: permute_bool_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
414  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
415  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
416  | 
subsection {* Permutations for sets *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
417  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
418  | 
lemma permute_set_eq:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
419  | 
fixes x::"'a::pt"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
420  | 
and p::"perm"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
421  | 
  shows "(p \<bullet> X) = {p \<bullet> x | x. x \<in> X}"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
422  | 
apply(auto simp add: permute_fun_def permute_bool_def mem_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
423  | 
apply(rule_tac x="- p \<bullet> x" in exI)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
424  | 
apply(simp)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
425  | 
done  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
426  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
427  | 
lemma permute_set_eq_image:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
428  | 
shows "p \<bullet> X = permute p ` X"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
429  | 
unfolding permute_set_eq by auto  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
430  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
431  | 
lemma permute_set_eq_vimage:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
432  | 
shows "p \<bullet> X = permute (- p) -` X"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
433  | 
unfolding permute_fun_def permute_bool_def  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
434  | 
unfolding vimage_def Collect_def mem_def ..  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
435  | 
|
| 1013 | 436  | 
lemma swap_set_not_in:  | 
437  | 
assumes a: "a \<notin> S" "b \<notin> S"  | 
|
438  | 
shows "(a \<rightleftharpoons> b) \<bullet> S = S"  | 
|
439  | 
using a by (auto simp add: permute_set_eq swap_atom)  | 
|
440  | 
||
441  | 
lemma swap_set_in:  | 
|
442  | 
assumes a: "a \<in> S" "b \<notin> S" "sort_of a = sort_of b"  | 
|
443  | 
shows "(a \<rightleftharpoons> b) \<bullet> S \<noteq> S"  | 
|
444  | 
using a by (auto simp add: permute_set_eq swap_atom)  | 
|
445  | 
||
446  | 
||
| 
947
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
447  | 
subsection {* Permutations for units *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
448  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
449  | 
instantiation unit :: pt  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
450  | 
begin  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
451  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
452  | 
definition "p \<bullet> (u::unit) = u"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
453  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
454  | 
instance proof  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
455  | 
qed (simp_all add: permute_unit_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
456  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
457  | 
end  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
458  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
459  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
460  | 
subsection {* Permutations for products *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
461  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
462  | 
instantiation "*" :: (pt, pt) pt  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
463  | 
begin  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
464  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
465  | 
primrec  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
466  | 
permute_prod  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
467  | 
where  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
468  | 
Pair_eqvt: "p \<bullet> (x, y) = (p \<bullet> x, p \<bullet> y)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
469  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
470  | 
instance  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
471  | 
by default auto  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
472  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
473  | 
end  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
474  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
475  | 
subsection {* Permutations for sums *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
476  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
477  | 
instantiation "+" :: (pt, pt) pt  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
478  | 
begin  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
479  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
480  | 
primrec  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
481  | 
permute_sum  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
482  | 
where  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
483  | 
"p \<bullet> (Inl x) = Inl (p \<bullet> x)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
484  | 
| "p \<bullet> (Inr y) = Inr (p \<bullet> y)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
485  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
486  | 
instance proof  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
487  | 
qed (case_tac [!] x, simp_all)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
488  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
489  | 
end  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
490  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
491  | 
subsection {* Permutations for lists *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
492  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
493  | 
instantiation list :: (pt) pt  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
494  | 
begin  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
495  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
496  | 
primrec  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
497  | 
permute_list  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
498  | 
where  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
499  | 
"p \<bullet> [] = []"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
500  | 
| "p \<bullet> (x # xs) = p \<bullet> x # p \<bullet> xs"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
501  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
502  | 
instance proof  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
503  | 
qed (induct_tac [!] x, simp_all)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
504  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
505  | 
end  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
506  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
507  | 
subsection {* Permutations for options *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
508  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
509  | 
instantiation option :: (pt) pt  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
510  | 
begin  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
511  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
512  | 
primrec  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
513  | 
permute_option  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
514  | 
where  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
515  | 
"p \<bullet> None = None"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
516  | 
| "p \<bullet> (Some x) = Some (p \<bullet> x)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
517  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
518  | 
instance proof  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
519  | 
qed (induct_tac [!] x, simp_all)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
520  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
521  | 
end  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
522  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
523  | 
subsection {* Permutations for @{typ char}, @{typ nat}, and @{typ int} *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
524  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
525  | 
instantiation char :: pt  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
526  | 
begin  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
527  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
528  | 
definition "p \<bullet> (c::char) = c"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
529  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
530  | 
instance proof  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
531  | 
qed (simp_all add: permute_char_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
532  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
533  | 
end  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
534  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
535  | 
instantiation nat :: pt  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
536  | 
begin  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
537  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
538  | 
definition "p \<bullet> (n::nat) = n"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
539  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
540  | 
instance proof  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
541  | 
qed (simp_all add: permute_nat_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
542  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
543  | 
end  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
544  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
545  | 
instantiation int :: pt  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
546  | 
begin  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
547  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
548  | 
definition "p \<bullet> (i::int) = i"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
549  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
550  | 
instance proof  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
551  | 
qed (simp_all add: permute_int_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
552  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
553  | 
end  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
554  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
555  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
556  | 
section {* Pure types *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
557  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
558  | 
text {* Pure types will have always empty support. *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
559  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
560  | 
class pure = pt +  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
561  | 
assumes permute_pure: "p \<bullet> x = x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
562  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
563  | 
text {* Types @{typ unit} and @{typ bool} are pure. *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
564  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
565  | 
instance unit :: pure  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
566  | 
proof qed (rule permute_unit_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
567  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
568  | 
instance bool :: pure  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
569  | 
proof qed (rule permute_bool_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
570  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
571  | 
text {* Other type constructors preserve purity. *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
572  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
573  | 
instance "fun" :: (pure, pure) pure  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
574  | 
by default (simp add: permute_fun_def permute_pure)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
575  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
576  | 
instance "*" :: (pure, pure) pure  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
577  | 
by default (induct_tac x, simp add: permute_pure)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
578  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
579  | 
instance "+" :: (pure, pure) pure  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
580  | 
by default (induct_tac x, simp_all add: permute_pure)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
581  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
582  | 
instance list :: (pure) pure  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
583  | 
by default (induct_tac x, simp_all add: permute_pure)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
584  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
585  | 
instance option :: (pure) pure  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
586  | 
by default (induct_tac x, simp_all add: permute_pure)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
587  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
588  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
589  | 
subsection {* Types @{typ char}, @{typ nat}, and @{typ int} *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
590  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
591  | 
instance char :: pure  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
592  | 
proof qed (rule permute_char_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
593  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
594  | 
instance nat :: pure  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
595  | 
proof qed (rule permute_nat_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
596  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
597  | 
instance int :: pure  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
598  | 
proof qed (rule permute_int_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
599  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
600  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
601  | 
subsection {* Supp, Freshness and Supports *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
602  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
603  | 
context pt  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
604  | 
begin  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
605  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
606  | 
definition  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
607  | 
supp :: "'a \<Rightarrow> atom set"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
608  | 
where  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
609  | 
  "supp x = {a. infinite {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x}}"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
610  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
611  | 
end  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
612  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
613  | 
definition  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
614  | 
  fresh :: "atom \<Rightarrow> 'a::pt \<Rightarrow> bool" ("_ \<sharp> _" [55, 55] 55)
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
615  | 
where  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
616  | 
"a \<sharp> x \<equiv> a \<notin> supp x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
617  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
618  | 
lemma supp_conv_fresh:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
619  | 
  shows "supp x = {a. \<not> a \<sharp> x}"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
620  | 
unfolding fresh_def by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
621  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
622  | 
lemma swap_rel_trans:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
623  | 
assumes "sort_of a = sort_of b"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
624  | 
assumes "sort_of b = sort_of c"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
625  | 
assumes "(a \<rightleftharpoons> c) \<bullet> x = x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
626  | 
assumes "(b \<rightleftharpoons> c) \<bullet> x = x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
627  | 
shows "(a \<rightleftharpoons> b) \<bullet> x = x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
628  | 
proof (cases)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
629  | 
assume "a = b \<or> c = b"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
630  | 
with assms show "(a \<rightleftharpoons> b) \<bullet> x = x" by auto  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
631  | 
next  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
632  | 
assume *: "\<not> (a = b \<or> c = b)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
633  | 
have "((a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c)) \<bullet> x = x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
634  | 
using assms by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
635  | 
also have "(a \<rightleftharpoons> c) + (b \<rightleftharpoons> c) + (a \<rightleftharpoons> c) = (a \<rightleftharpoons> b)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
636  | 
using assms * by (simp add: swap_triple)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
637  | 
finally show "(a \<rightleftharpoons> b) \<bullet> x = x" .  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
638  | 
qed  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
639  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
640  | 
lemma swap_fresh_fresh:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
641  | 
assumes a: "a \<sharp> x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
642  | 
and b: "b \<sharp> x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
643  | 
shows "(a \<rightleftharpoons> b) \<bullet> x = x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
644  | 
proof (cases)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
645  | 
assume asm: "sort_of a = sort_of b"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
646  | 
  have "finite {c. (a \<rightleftharpoons> c) \<bullet> x \<noteq> x}" "finite {c. (b \<rightleftharpoons> c) \<bullet> x \<noteq> x}" 
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
647  | 
using a b unfolding fresh_def supp_def by simp_all  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
648  | 
  then have "finite ({c. (a \<rightleftharpoons> c) \<bullet> x \<noteq> x} \<union> {c. (b \<rightleftharpoons> c) \<bullet> x \<noteq> x})" by simp
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
649  | 
then obtain c  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
650  | 
where "(a \<rightleftharpoons> c) \<bullet> x = x" "(b \<rightleftharpoons> c) \<bullet> x = x" "sort_of c = sort_of b"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
651  | 
by (rule obtain_atom) (auto)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
652  | 
then show "(a \<rightleftharpoons> b) \<bullet> x = x" using asm by (rule_tac swap_rel_trans) (simp_all)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
653  | 
next  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
654  | 
assume "sort_of a \<noteq> sort_of b"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
655  | 
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
656  | 
qed  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
657  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
658  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
659  | 
subsection {* supp and fresh are equivariant *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
660  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
661  | 
lemma finite_Collect_bij:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
662  | 
assumes a: "bij f"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
663  | 
  shows "finite {x. P (f x)} = finite {x. P x}"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
664  | 
by (metis a finite_vimage_iff vimage_Collect_eq)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
665  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
666  | 
lemma fresh_permute_iff:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
667  | 
shows "(p \<bullet> a) \<sharp> (p \<bullet> x) \<longleftrightarrow> a \<sharp> x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
668  | 
proof -  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
669  | 
  have "(p \<bullet> a) \<sharp> (p \<bullet> x) \<longleftrightarrow> finite {b. (p \<bullet> a \<rightleftharpoons> b) \<bullet> p \<bullet> x \<noteq> p \<bullet> x}"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
670  | 
unfolding fresh_def supp_def by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
671  | 
  also have "\<dots> \<longleftrightarrow> finite {b. (p \<bullet> a \<rightleftharpoons> p \<bullet> b) \<bullet> p \<bullet> x \<noteq> p \<bullet> x}"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
672  | 
using bij_permute by (rule finite_Collect_bij [symmetric])  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
673  | 
  also have "\<dots> \<longleftrightarrow> finite {b. p \<bullet> (a \<rightleftharpoons> b) \<bullet> x \<noteq> p \<bullet> x}"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
674  | 
by (simp only: permute_eqvt [of p] swap_eqvt)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
675  | 
  also have "\<dots> \<longleftrightarrow> finite {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x}"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
676  | 
by (simp only: permute_eq_iff)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
677  | 
also have "\<dots> \<longleftrightarrow> a \<sharp> x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
678  | 
unfolding fresh_def supp_def by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
679  | 
finally show ?thesis .  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
680  | 
qed  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
681  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
682  | 
lemma fresh_eqvt:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
683  | 
shows "p \<bullet> (a \<sharp> x) = (p \<bullet> a) \<sharp> (p \<bullet> x)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
684  | 
by (simp add: permute_bool_def fresh_permute_iff)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
685  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
686  | 
lemma supp_eqvt:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
687  | 
fixes p :: "perm"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
688  | 
and x :: "'a::pt"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
689  | 
shows "p \<bullet> (supp x) = supp (p \<bullet> x)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
690  | 
unfolding supp_conv_fresh  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
691  | 
unfolding permute_fun_def Collect_def  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
692  | 
by (simp add: Not_eqvt fresh_eqvt)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
693  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
694  | 
subsection {* supports *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
695  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
696  | 
definition  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
697  | 
supports :: "atom set \<Rightarrow> 'a::pt \<Rightarrow> bool" (infixl "supports" 80)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
698  | 
where  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
699  | 
"S supports x \<equiv> \<forall>a b. (a \<notin> S \<and> b \<notin> S \<longrightarrow> (a \<rightleftharpoons> b) \<bullet> x = x)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
700  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
701  | 
lemma supp_is_subset:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
702  | 
fixes S :: "atom set"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
703  | 
and x :: "'a::pt"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
704  | 
assumes a1: "S supports x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
705  | 
and a2: "finite S"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
706  | 
shows "(supp x) \<subseteq> S"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
707  | 
proof (rule ccontr)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
708  | 
assume "\<not>(supp x \<subseteq> S)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
709  | 
then obtain a where b1: "a \<in> supp x" and b2: "a \<notin> S" by auto  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
710  | 
from a1 b2 have "\<forall>b. b \<notin> S \<longrightarrow> (a \<rightleftharpoons> b) \<bullet> x = x" by (unfold supports_def) (auto)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
711  | 
  hence "{b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x} \<subseteq> S" by auto
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
712  | 
  with a2 have "finite {b. (a \<rightleftharpoons> b)\<bullet>x \<noteq> x}" by (simp add: finite_subset)
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
713  | 
then have "a \<notin> (supp x)" unfolding supp_def by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
714  | 
with b1 show False by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
715  | 
qed  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
716  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
717  | 
lemma supports_finite:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
718  | 
fixes S :: "atom set"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
719  | 
and x :: "'a::pt"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
720  | 
assumes a1: "S supports x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
721  | 
and a2: "finite S"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
722  | 
shows "finite (supp x)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
723  | 
proof -  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
724  | 
have "(supp x) \<subseteq> S" using a1 a2 by (rule supp_is_subset)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
725  | 
then show "finite (supp x)" using a2 by (simp add: finite_subset)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
726  | 
qed  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
727  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
728  | 
lemma supp_supports:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
729  | 
fixes x :: "'a::pt"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
730  | 
shows "(supp x) supports x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
731  | 
proof (unfold supports_def, intro strip)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
732  | 
fix a b  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
733  | 
assume "a \<notin> (supp x) \<and> b \<notin> (supp x)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
734  | 
then have "a \<sharp> x" and "b \<sharp> x" by (simp_all add: fresh_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
735  | 
then show "(a \<rightleftharpoons> b) \<bullet> x = x" by (rule swap_fresh_fresh)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
736  | 
qed  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
737  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
738  | 
lemma supp_is_least_supports:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
739  | 
fixes S :: "atom set"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
740  | 
and x :: "'a::pt"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
741  | 
assumes a1: "S supports x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
742  | 
and a2: "finite S"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
743  | 
and a3: "\<And>S'. finite S' \<Longrightarrow> (S' supports x) \<Longrightarrow> S \<subseteq> S'"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
744  | 
shows "(supp x) = S"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
745  | 
proof (rule equalityI)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
746  | 
show "(supp x) \<subseteq> S" using a1 a2 by (rule supp_is_subset)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
747  | 
with a2 have fin: "finite (supp x)" by (rule rev_finite_subset)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
748  | 
have "(supp x) supports x" by (rule supp_supports)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
749  | 
with fin a3 show "S \<subseteq> supp x" by blast  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
750  | 
qed  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
751  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
752  | 
lemma subsetCI:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
753  | 
shows "(\<And>x. x \<in> A \<Longrightarrow> x \<notin> B \<Longrightarrow> False) \<Longrightarrow> A \<subseteq> B"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
754  | 
by auto  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
755  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
756  | 
lemma finite_supp_unique:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
757  | 
assumes a1: "S supports x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
758  | 
assumes a2: "finite S"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
759  | 
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"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
760  | 
shows "(supp x) = S"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
761  | 
using a1 a2  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
762  | 
proof (rule supp_is_least_supports)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
763  | 
fix S'  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
764  | 
assume "finite S'" and "S' supports x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
765  | 
show "S \<subseteq> S'"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
766  | 
proof (rule subsetCI)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
767  | 
fix a  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
768  | 
assume "a \<in> S" and "a \<notin> S'"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
769  | 
have "finite (S \<union> S')"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
770  | 
using `finite S` `finite S'` by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
771  | 
then obtain b where "b \<notin> S \<union> S'" and "sort_of b = sort_of a"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
772  | 
by (rule obtain_atom)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
773  | 
then have "b \<notin> S" and "b \<notin> S'" and "sort_of a = sort_of b"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
774  | 
by simp_all  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
775  | 
then have "(a \<rightleftharpoons> b) \<bullet> x = x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
776  | 
using `a \<notin> S'` `S' supports x` by (simp add: supports_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
777  | 
moreover have "(a \<rightleftharpoons> b) \<bullet> x \<noteq> x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
778  | 
using `a \<in> S` `b \<notin> S` `sort_of a = sort_of b`  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
779  | 
by (rule a3)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
780  | 
ultimately show "False" by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
781  | 
qed  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
782  | 
qed  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
783  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
784  | 
section {* Finitely-supported types *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
785  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
786  | 
class fs = pt +  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
787  | 
assumes finite_supp: "finite (supp x)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
788  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
789  | 
lemma pure_supp:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
790  | 
  shows "supp (x::'a::pure) = {}"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
791  | 
unfolding supp_def by (simp add: permute_pure)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
792  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
793  | 
lemma pure_fresh:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
794  | 
fixes x::"'a::pure"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
795  | 
shows "a \<sharp> x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
796  | 
unfolding fresh_def by (simp add: pure_supp)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
797  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
798  | 
instance pure < fs  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
799  | 
by default (simp add: pure_supp)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
800  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
801  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
802  | 
subsection  {* Type @{typ atom} is finitely-supported. *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
803  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
804  | 
lemma supp_atom:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
805  | 
  shows "supp a = {a}"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
806  | 
apply (rule finite_supp_unique)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
807  | 
apply (clarsimp simp add: supports_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
808  | 
apply simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
809  | 
apply simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
810  | 
done  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
811  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
812  | 
lemma fresh_atom:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
813  | 
shows "a \<sharp> b \<longleftrightarrow> a \<noteq> b"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
814  | 
unfolding fresh_def supp_atom by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
815  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
816  | 
instance atom :: fs  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
817  | 
by default (simp add: supp_atom)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
818  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
819  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
820  | 
section {* Type @{typ perm} is finitely-supported. *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
821  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
822  | 
lemma perm_swap_eq:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
823  | 
shows "(a \<rightleftharpoons> b) \<bullet> p = p \<longleftrightarrow> (p \<bullet> (a \<rightleftharpoons> b)) = (a \<rightleftharpoons> b)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
824  | 
unfolding permute_perm_def  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
825  | 
by (metis add_diff_cancel minus_perm_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
826  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
827  | 
lemma supports_perm:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
828  | 
  shows "{a. p \<bullet> a \<noteq> a} supports p"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
829  | 
unfolding supports_def  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
830  | 
by (simp add: perm_swap_eq swap_eqvt)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
831  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
832  | 
lemma finite_perm_lemma:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
833  | 
  shows "finite {a::atom. p \<bullet> a \<noteq> a}"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
834  | 
using finite_Rep_perm [of p]  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
835  | 
unfolding permute_atom_def .  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
836  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
837  | 
lemma supp_perm:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
838  | 
  shows "supp p = {a. p \<bullet> a \<noteq> a}"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
839  | 
apply (rule finite_supp_unique)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
840  | 
apply (rule supports_perm)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
841  | 
apply (rule finite_perm_lemma)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
842  | 
apply (simp add: perm_swap_eq swap_eqvt)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
843  | 
apply (auto simp add: expand_perm_eq swap_atom)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
844  | 
done  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
845  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
846  | 
lemma fresh_perm:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
847  | 
shows "a \<sharp> p \<longleftrightarrow> p \<bullet> a = a"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
848  | 
unfolding fresh_def by (simp add: supp_perm)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
849  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
850  | 
lemma supp_swap:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
851  | 
  shows "supp (a \<rightleftharpoons> b) = (if a = b \<or> sort_of a \<noteq> sort_of b then {} else {a, b})"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
852  | 
by (auto simp add: supp_perm swap_atom)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
853  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
854  | 
lemma fresh_zero_perm:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
855  | 
shows "a \<sharp> (0::perm)"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
856  | 
unfolding fresh_perm by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
857  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
858  | 
lemma supp_zero_perm:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
859  | 
  shows "supp (0::perm) = {}"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
860  | 
unfolding supp_perm by simp  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
861  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
862  | 
lemma supp_plus_perm:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
863  | 
fixes p q::perm  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
864  | 
shows "supp (p + q) \<subseteq> supp p \<union> supp q"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
865  | 
by (auto simp add: supp_perm)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
866  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
867  | 
lemma supp_minus_perm:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
868  | 
fixes p::perm  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
869  | 
shows "supp (- p) = supp p"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
870  | 
apply(auto simp add: supp_perm)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
871  | 
apply(metis permute_minus_cancel)+  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
872  | 
done  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
873  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
874  | 
instance perm :: fs  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
875  | 
by default (simp add: supp_perm finite_perm_lemma)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
876  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
877  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
878  | 
section {* Finite Support instances for other types *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
879  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
880  | 
subsection {* Type @{typ "'a \<times> 'b"} is finitely-supported. *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
881  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
882  | 
lemma supp_Pair:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
883  | 
shows "supp (x, y) = supp x \<union> supp y"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
884  | 
by (simp add: supp_def Collect_imp_eq Collect_neg_eq)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
885  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
886  | 
lemma fresh_Pair:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
887  | 
shows "a \<sharp> (x, y) \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> y"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
888  | 
by (simp add: fresh_def supp_Pair)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
889  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
890  | 
instance "*" :: (fs, fs) fs  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
891  | 
apply default  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
892  | 
apply (induct_tac x)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
893  | 
apply (simp add: supp_Pair finite_supp)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
894  | 
done  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
895  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
896  | 
subsection {* Type @{typ "'a + 'b"} is finitely supported *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
897  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
898  | 
lemma supp_Inl:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
899  | 
shows "supp (Inl x) = supp x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
900  | 
by (simp add: supp_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
901  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
902  | 
lemma supp_Inr:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
903  | 
shows "supp (Inr x) = supp x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
904  | 
by (simp add: supp_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
905  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
906  | 
lemma fresh_Inl:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
907  | 
shows "a \<sharp> Inl x \<longleftrightarrow> a \<sharp> x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
908  | 
by (simp add: fresh_def supp_Inl)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
909  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
910  | 
lemma fresh_Inr:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
911  | 
shows "a \<sharp> Inr y \<longleftrightarrow> a \<sharp> y"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
912  | 
by (simp add: fresh_def supp_Inr)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
913  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
914  | 
instance "+" :: (fs, fs) fs  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
915  | 
apply default  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
916  | 
apply (induct_tac x)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
917  | 
apply (simp_all add: supp_Inl supp_Inr finite_supp)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
918  | 
done  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
919  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
920  | 
subsection {* Type @{typ "'a option"} is finitely supported *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
921  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
922  | 
lemma supp_None:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
923  | 
  shows "supp None = {}"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
924  | 
by (simp add: supp_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
925  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
926  | 
lemma supp_Some:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
927  | 
shows "supp (Some x) = supp x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
928  | 
by (simp add: supp_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
929  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
930  | 
lemma fresh_None:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
931  | 
shows "a \<sharp> None"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
932  | 
by (simp add: fresh_def supp_None)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
933  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
934  | 
lemma fresh_Some:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
935  | 
shows "a \<sharp> Some x \<longleftrightarrow> a \<sharp> x"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
936  | 
by (simp add: fresh_def supp_Some)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
937  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
938  | 
instance option :: (fs) fs  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
939  | 
apply default  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
940  | 
apply (induct_tac x)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
941  | 
apply (simp_all add: supp_None supp_Some finite_supp)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
942  | 
done  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
943  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
944  | 
subsubsection {* Type @{typ "'a list"} is finitely supported *}
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
945  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
946  | 
lemma supp_Nil:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
947  | 
  shows "supp [] = {}"
 | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
948  | 
by (simp add: supp_def)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
949  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
950  | 
lemma supp_Cons:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
951  | 
shows "supp (x # xs) = supp x \<union> supp xs"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
952  | 
by (simp add: supp_def Collect_imp_eq Collect_neg_eq)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
953  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
954  | 
lemma fresh_Nil:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
955  | 
shows "a \<sharp> []"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
956  | 
by (simp add: fresh_def supp_Nil)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
957  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
958  | 
lemma fresh_Cons:  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
959  | 
shows "a \<sharp> (x # xs) \<longleftrightarrow> a \<sharp> x \<and> a \<sharp> xs"  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
960  | 
by (simp add: fresh_def supp_Cons)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
961  | 
|
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
962  | 
instance list :: (fs) fs  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
963  | 
apply default  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
964  | 
apply (induct_tac x)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
965  | 
apply (simp_all add: supp_Nil supp_Cons finite_supp)  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
966  | 
done  | 
| 
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
967  | 
|
| 1013 | 968  | 
section {* Support and freshness for applications *}
 | 
| 
1008
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
969  | 
|
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
970  | 
lemma supp_fun_app:  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
971  | 
shows "supp (f x) \<subseteq> (supp f) \<union> (supp x)"  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
972  | 
proof (rule subsetCI)  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
973  | 
fix a::"atom"  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
974  | 
assume a: "a \<in> supp (f x)"  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
975  | 
assume b: "a \<notin> supp f \<union> supp x"  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
976  | 
  then have "finite {b. (a \<rightleftharpoons> b) \<bullet> f \<noteq> f}" "finite {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x}" 
 | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
977  | 
unfolding supp_def by auto  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
978  | 
  then have "finite ({b. (a \<rightleftharpoons> b) \<bullet> f \<noteq> f} \<union> {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x})" by simp
 | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
979  | 
moreover  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
980  | 
  have "{b. ((a \<rightleftharpoons> b) \<bullet> f) ((a \<rightleftharpoons> b) \<bullet> x) \<noteq> f x} \<subseteq> ({b. (a \<rightleftharpoons> b) \<bullet> f \<noteq> f} \<union> {b. (a \<rightleftharpoons> b) \<bullet> x \<noteq> x})"
 | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
981  | 
by auto  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
982  | 
  ultimately have "finite {b. ((a \<rightleftharpoons> b) \<bullet> f) ((a \<rightleftharpoons> b) \<bullet> x) \<noteq> f x}"
 | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
983  | 
using finite_subset by auto  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
984  | 
then have "a \<notin> supp (f x)" unfolding supp_def  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
985  | 
by (simp add: permute_fun_app_eq)  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
986  | 
with a show "False" by simp  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
987  | 
qed  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
988  | 
|
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
989  | 
lemma fresh_fun_app:  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
990  | 
shows "a \<sharp> (f, x) \<Longrightarrow> a \<sharp> f x"  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
991  | 
unfolding fresh_def  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
992  | 
using supp_fun_app  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
993  | 
by (auto simp add: supp_Pair)  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
994  | 
|
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
995  | 
lemma fresh_fun_eqvt_app:  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
996  | 
assumes a: "\<forall>p. p \<bullet> f = f"  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
997  | 
shows "a \<sharp> x \<Longrightarrow> a \<sharp> f x"  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
998  | 
proof -  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
999  | 
  from a have b: "supp f = {}"
 | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
1000  | 
unfolding supp_def by simp  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
1001  | 
show "a \<sharp> x \<Longrightarrow> a \<sharp> f x"  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
1002  | 
unfolding fresh_def  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
1003  | 
using supp_fun_app b  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
1004  | 
by auto  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
1005  | 
qed  | 
| 
 
7c633507a809
updated from huffman - repo
 
Christian Urban <urbanc@in.tum.de> 
parents: 
947 
diff
changeset
 | 
1006  | 
|
| 
947
 
fa810f01f7b5
added an LamEx example together with the new nominal infrastructure
 
Christian Urban <urbanc@in.tum.de> 
parents:  
diff
changeset
 | 
1007  | 
end  |