author | Christian Urban <urbanc@in.tum.de> |
Wed, 28 Apr 2010 08:22:20 +0200 | |
changeset 1971 | 8daf6ff5e11a |
parent 1962 | 84a13d1e2511 |
child 1972 | 40db835442a0 |
permissions | -rw-r--r-- |
1062 | 1 |
(* Title: Nominal2_Atoms |
2 |
Authors: Brian Huffman, Christian Urban |
|
3 |
||
4 |
Definitions for concrete atom types. |
|
5 |
*) |
|
6 |
theory Nominal2_Atoms |
|
7 |
imports Nominal2_Base |
|
1933
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
8 |
Nominal2_Eqvt |
1079
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
9 |
uses ("nominal_atoms.ML") |
1062 | 10 |
begin |
11 |
||
12 |
section {* Concrete atom types *} |
|
13 |
||
14 |
text {* |
|
15 |
Class @{text at_base} allows types containing multiple sorts of atoms. |
|
16 |
Class @{text at} only allows types with a single sort. |
|
17 |
*} |
|
18 |
||
1933
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
19 |
lemma atom_image_cong: |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
20 |
shows "(atom ` X = atom ` Y) = (X = Y)" |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
21 |
apply(rule inj_image_eq_iff) |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
22 |
apply(simp add: inj_on_def) |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
23 |
done |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
24 |
|
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
25 |
lemma atom_image_supp: |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
26 |
"supp S = supp (atom ` S)" |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
27 |
apply(simp add: supp_def) |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
28 |
apply(simp add: image_eqvt) |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
29 |
apply(subst (2) permute_fun_def) |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
30 |
apply(simp add: atom_eqvt) |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
31 |
apply(simp add: atom_image_cong) |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
32 |
done |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
33 |
|
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
34 |
lemma supp_finite_at_set: |
1941 | 35 |
assumes a: "finite S" |
36 |
shows "supp S = atom ` S" |
|
1971
8daf6ff5e11a
simpliied and moved the remaining lemmas about the atom-function to Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1962
diff
changeset
|
37 |
proof - |
8daf6ff5e11a
simpliied and moved the remaining lemmas about the atom-function to Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1962
diff
changeset
|
38 |
have fin: "finite (atom ` S)" |
8daf6ff5e11a
simpliied and moved the remaining lemmas about the atom-function to Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1962
diff
changeset
|
39 |
using a by (simp add: finite_imageI) |
8daf6ff5e11a
simpliied and moved the remaining lemmas about the atom-function to Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1962
diff
changeset
|
40 |
have "supp S = supp (atom ` S)" by (rule atom_image_supp) |
8daf6ff5e11a
simpliied and moved the remaining lemmas about the atom-function to Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1962
diff
changeset
|
41 |
also have "\<dots> = atom ` S" using fin by (simp add: supp_finite_atom_set) |
8daf6ff5e11a
simpliied and moved the remaining lemmas about the atom-function to Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1962
diff
changeset
|
42 |
finally show "supp S = atom ` S" by simp |
1941 | 43 |
qed |
44 |
||
1933
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
45 |
lemma supp_at_insert: |
1971
8daf6ff5e11a
simpliied and moved the remaining lemmas about the atom-function to Nominal2_Base
Christian Urban <urbanc@in.tum.de>
parents:
1962
diff
changeset
|
46 |
fixes a::"'a::at_base" |
1933
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
47 |
assumes a: "finite S" |
9eab1dfc14d2
moved lemmas from FSet.thy to do with atom to Nominal2_Base, and to do with 'a::at set to Nominal2_Atoms; moved Nominal2_Eqvt.thy one up to be loaded before Nominal2_Atoms
Christian Urban <urbanc@in.tum.de>
parents:
1779
diff
changeset
|
48 |
shows "supp (insert a S) = supp a \<union> supp S" |
1941 | 49 |
using a by (simp add: supp_finite_at_set supp_at_base) |
50 |
||
1062 | 51 |
section {* A swapping operation for concrete atoms *} |
52 |
||
53 |
definition |
|
54 |
flip :: "'a::at_base \<Rightarrow> 'a \<Rightarrow> perm" ("'(_ \<leftrightarrow> _')") |
|
55 |
where |
|
56 |
"(a \<leftrightarrow> b) = (atom a \<rightleftharpoons> atom b)" |
|
57 |
||
58 |
lemma flip_self [simp]: "(a \<leftrightarrow> a) = 0" |
|
59 |
unfolding flip_def by (rule swap_self) |
|
60 |
||
61 |
lemma flip_commute: "(a \<leftrightarrow> b) = (b \<leftrightarrow> a)" |
|
62 |
unfolding flip_def by (rule swap_commute) |
|
63 |
||
64 |
lemma minus_flip [simp]: "- (a \<leftrightarrow> b) = (a \<leftrightarrow> b)" |
|
65 |
unfolding flip_def by (rule minus_swap) |
|
66 |
||
67 |
lemma add_flip_cancel: "(a \<leftrightarrow> b) + (a \<leftrightarrow> b) = 0" |
|
68 |
unfolding flip_def by (rule swap_cancel) |
|
69 |
||
70 |
lemma permute_flip_cancel [simp]: "(a \<leftrightarrow> b) \<bullet> (a \<leftrightarrow> b) \<bullet> x = x" |
|
71 |
unfolding permute_plus [symmetric] add_flip_cancel by simp |
|
72 |
||
73 |
lemma permute_flip_cancel2 [simp]: "(a \<leftrightarrow> b) \<bullet> (b \<leftrightarrow> a) \<bullet> x = x" |
|
74 |
by (simp add: flip_commute) |
|
75 |
||
76 |
lemma flip_eqvt: |
|
77 |
fixes a b c::"'a::at_base" |
|
78 |
shows "p \<bullet> (a \<leftrightarrow> b) = (p \<bullet> a \<leftrightarrow> p \<bullet> b)" |
|
79 |
unfolding flip_def |
|
80 |
by (simp add: swap_eqvt atom_eqvt) |
|
81 |
||
82 |
lemma flip_at_base_simps [simp]: |
|
83 |
shows "sort_of (atom a) = sort_of (atom b) \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> a = b" |
|
84 |
and "sort_of (atom a) = sort_of (atom b) \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> b = a" |
|
85 |
and "\<lbrakk>a \<noteq> c; b \<noteq> c\<rbrakk> \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> c = c" |
|
86 |
and "sort_of (atom a) \<noteq> sort_of (atom b) \<Longrightarrow> (a \<leftrightarrow> b) \<bullet> x = x" |
|
87 |
unfolding flip_def |
|
88 |
unfolding atom_eq_iff [symmetric] |
|
89 |
unfolding atom_eqvt [symmetric] |
|
90 |
by simp_all |
|
91 |
||
92 |
text {* the following two lemmas do not hold for at_base, |
|
93 |
only for single sort atoms from at *} |
|
94 |
||
95 |
lemma permute_flip_at: |
|
96 |
fixes a b c::"'a::at" |
|
97 |
shows "(a \<leftrightarrow> b) \<bullet> c = (if c = a then b else if c = b then a else c)" |
|
98 |
unfolding flip_def |
|
99 |
apply (rule atom_eq_iff [THEN iffD1]) |
|
100 |
apply (subst atom_eqvt [symmetric]) |
|
101 |
apply (simp add: swap_atom) |
|
102 |
done |
|
103 |
||
104 |
lemma flip_at_simps [simp]: |
|
105 |
fixes a b::"'a::at" |
|
106 |
shows "(a \<leftrightarrow> b) \<bullet> a = b" |
|
107 |
and "(a \<leftrightarrow> b) \<bullet> b = a" |
|
108 |
unfolding permute_flip_at by simp_all |
|
109 |
||
1499
21dda372fb11
simplified strong induction proof by using flip
Christian Urban <urbanc@in.tum.de>
parents:
1363
diff
changeset
|
110 |
lemma flip_fresh_fresh: |
21dda372fb11
simplified strong induction proof by using flip
Christian Urban <urbanc@in.tum.de>
parents:
1363
diff
changeset
|
111 |
fixes a b::"'a::at_base" |
21dda372fb11
simplified strong induction proof by using flip
Christian Urban <urbanc@in.tum.de>
parents:
1363
diff
changeset
|
112 |
assumes "atom a \<sharp> x" "atom b \<sharp> x" |
21dda372fb11
simplified strong induction proof by using flip
Christian Urban <urbanc@in.tum.de>
parents:
1363
diff
changeset
|
113 |
shows "(a \<leftrightarrow> b) \<bullet> x = x" |
21dda372fb11
simplified strong induction proof by using flip
Christian Urban <urbanc@in.tum.de>
parents:
1363
diff
changeset
|
114 |
using assms |
21dda372fb11
simplified strong induction proof by using flip
Christian Urban <urbanc@in.tum.de>
parents:
1363
diff
changeset
|
115 |
by (simp add: flip_def swap_fresh_fresh) |
1062 | 116 |
|
117 |
subsection {* Syntax for coercing at-elements to the atom-type *} |
|
118 |
||
119 |
syntax |
|
120 |
"_atom_constrain" :: "logic \<Rightarrow> type \<Rightarrow> logic" ("_:::_" [4, 0] 3) |
|
121 |
||
122 |
translations |
|
1569 | 123 |
"_atom_constrain a t" => "CONST atom (_constrain a t)" |
124 |
||
1062 | 125 |
|
126 |
subsection {* A lemma for proving instances of class @{text at}. *} |
|
127 |
||
128 |
setup {* Sign.add_const_constraint (@{const_name "permute"}, NONE) *} |
|
129 |
setup {* Sign.add_const_constraint (@{const_name "atom"}, NONE) *} |
|
130 |
||
131 |
text {* |
|
132 |
New atom types are defined as subtypes of @{typ atom}. |
|
133 |
*} |
|
134 |
||
1079
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
135 |
lemma exists_eq_simple_sort: |
1062 | 136 |
shows "\<exists>a. a \<in> {a. sort_of a = s}" |
137 |
by (rule_tac x="Atom s 0" in exI, simp) |
|
138 |
||
1079
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
139 |
lemma exists_eq_sort: |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
140 |
shows "\<exists>a. a \<in> {a. sort_of a \<in> range sort_fun}" |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
141 |
by (rule_tac x="Atom (sort_fun x) y" in exI, simp) |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
142 |
|
1062 | 143 |
lemma at_base_class: |
1079
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
144 |
fixes sort_fun :: "'b \<Rightarrow>atom_sort" |
1062 | 145 |
fixes Rep :: "'a \<Rightarrow> atom" and Abs :: "atom \<Rightarrow> 'a" |
1079
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
146 |
assumes type: "type_definition Rep Abs {a. sort_of a \<in> range sort_fun}" |
1062 | 147 |
assumes atom_def: "\<And>a. atom a = Rep a" |
148 |
assumes permute_def: "\<And>p a. p \<bullet> a = Abs (p \<bullet> Rep a)" |
|
149 |
shows "OFCLASS('a, at_base_class)" |
|
150 |
proof |
|
1079
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
151 |
interpret type_definition Rep Abs "{a. sort_of a \<in> range sort_fun}" by (rule type) |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
152 |
have sort_of_Rep: "\<And>a. sort_of (Rep a) \<in> range sort_fun" using Rep by simp |
1062 | 153 |
fix a b :: 'a and p p1 p2 :: perm |
154 |
show "0 \<bullet> a = a" |
|
155 |
unfolding permute_def by (simp add: Rep_inverse) |
|
156 |
show "(p1 + p2) \<bullet> a = p1 \<bullet> p2 \<bullet> a" |
|
157 |
unfolding permute_def by (simp add: Abs_inverse sort_of_Rep) |
|
158 |
show "atom a = atom b \<longleftrightarrow> a = b" |
|
159 |
unfolding atom_def by (simp add: Rep_inject) |
|
160 |
show "p \<bullet> atom a = atom (p \<bullet> a)" |
|
161 |
unfolding permute_def atom_def by (simp add: Abs_inverse sort_of_Rep) |
|
162 |
qed |
|
163 |
||
1079
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
164 |
(* |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
165 |
lemma at_class: |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
166 |
fixes s :: atom_sort |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
167 |
fixes Rep :: "'a \<Rightarrow> atom" and Abs :: "atom \<Rightarrow> 'a" |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
168 |
assumes type: "type_definition Rep Abs {a. sort_of a \<in> range (\<lambda>x::unit. s)}" |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
169 |
assumes atom_def: "\<And>a. atom a = Rep a" |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
170 |
assumes permute_def: "\<And>p a. p \<bullet> a = Abs (p \<bullet> Rep a)" |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
171 |
shows "OFCLASS('a, at_class)" |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
172 |
proof |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
173 |
interpret type_definition Rep Abs "{a. sort_of a \<in> range (\<lambda>x::unit. s)}" by (rule type) |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
174 |
have sort_of_Rep: "\<And>a. sort_of (Rep a) = s" using Rep by (simp add: image_def) |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
175 |
fix a b :: 'a and p p1 p2 :: perm |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
176 |
show "0 \<bullet> a = a" |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
177 |
unfolding permute_def by (simp add: Rep_inverse) |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
178 |
show "(p1 + p2) \<bullet> a = p1 \<bullet> p2 \<bullet> a" |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
179 |
unfolding permute_def by (simp add: Abs_inverse sort_of_Rep) |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
180 |
show "sort_of (atom a) = sort_of (atom b)" |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
181 |
unfolding atom_def by (simp add: sort_of_Rep) |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
182 |
show "atom a = atom b \<longleftrightarrow> a = b" |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
183 |
unfolding atom_def by (simp add: Rep_inject) |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
184 |
show "p \<bullet> atom a = atom (p \<bullet> a)" |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
185 |
unfolding permute_def atom_def by (simp add: Abs_inverse sort_of_Rep) |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
186 |
qed |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
187 |
*) |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
188 |
|
1062 | 189 |
lemma at_class: |
190 |
fixes s :: atom_sort |
|
191 |
fixes Rep :: "'a \<Rightarrow> atom" and Abs :: "atom \<Rightarrow> 'a" |
|
192 |
assumes type: "type_definition Rep Abs {a. sort_of a = s}" |
|
193 |
assumes atom_def: "\<And>a. atom a = Rep a" |
|
194 |
assumes permute_def: "\<And>p a. p \<bullet> a = Abs (p \<bullet> Rep a)" |
|
195 |
shows "OFCLASS('a, at_class)" |
|
196 |
proof |
|
197 |
interpret type_definition Rep Abs "{a. sort_of a = s}" by (rule type) |
|
1079
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
198 |
have sort_of_Rep: "\<And>a. sort_of (Rep a) = s" using Rep by (simp add: image_def) |
1062 | 199 |
fix a b :: 'a and p p1 p2 :: perm |
200 |
show "0 \<bullet> a = a" |
|
201 |
unfolding permute_def by (simp add: Rep_inverse) |
|
202 |
show "(p1 + p2) \<bullet> a = p1 \<bullet> p2 \<bullet> a" |
|
203 |
unfolding permute_def by (simp add: Abs_inverse sort_of_Rep) |
|
204 |
show "sort_of (atom a) = sort_of (atom b)" |
|
205 |
unfolding atom_def by (simp add: sort_of_Rep) |
|
206 |
show "atom a = atom b \<longleftrightarrow> a = b" |
|
207 |
unfolding atom_def by (simp add: Rep_inject) |
|
208 |
show "p \<bullet> atom a = atom (p \<bullet> a)" |
|
209 |
unfolding permute_def atom_def by (simp add: Abs_inverse sort_of_Rep) |
|
210 |
qed |
|
211 |
||
212 |
setup {* Sign.add_const_constraint |
|
213 |
(@{const_name "permute"}, SOME @{typ "perm \<Rightarrow> 'a::pt \<Rightarrow> 'a"}) *} |
|
214 |
setup {* Sign.add_const_constraint |
|
215 |
(@{const_name "atom"}, SOME @{typ "'a::at_base \<Rightarrow> atom"}) *} |
|
216 |
||
217 |
section {* Automation for creating concrete atom types *} |
|
218 |
||
219 |
text {* at the moment only single-sort concrete atoms are supported *} |
|
220 |
||
1079
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
221 |
use "nominal_atoms.ML" |
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
222 |
|
c70e7545b738
updated to latest Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
1062
diff
changeset
|
223 |
|
1062 | 224 |
end |