author | Christian Urban <urbanc@in.tum.de> |
Sun, 18 Apr 2010 09:26:38 +0200 | |
changeset 1867 | f4477d3fe520 |
parent 1866 | 6d4e4bf9bce6 |
child 1869 | b5776e0a015f |
permissions | -rw-r--r-- |
1062 | 1 |
(* Title: Nominal2_Eqvt |
1810
894930834ca8
fixed bug in thmdecls with destructing Trueprop; some initial infrastructure for eqvt-theorems of the form _ ==> _
Christian Urban <urbanc@in.tum.de>
parents:
1803
diff
changeset
|
2 |
Author: Brian Huffman, |
894930834ca8
fixed bug in thmdecls with destructing Trueprop; some initial infrastructure for eqvt-theorems of the form _ ==> _
Christian Urban <urbanc@in.tum.de>
parents:
1803
diff
changeset
|
3 |
Author: Christian Urban |
1062 | 4 |
|
5 |
Equivariance, Supp and Fresh Lemmas for Operators. |
|
1810
894930834ca8
fixed bug in thmdecls with destructing Trueprop; some initial infrastructure for eqvt-theorems of the form _ ==> _
Christian Urban <urbanc@in.tum.de>
parents:
1803
diff
changeset
|
6 |
(Contains many, but not all such lemmas.) |
1062 | 7 |
*) |
8 |
theory Nominal2_Eqvt |
|
1315
43d6e3730353
Add image_eqvt and atom_eqvt to eqvt bases.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1258
diff
changeset
|
9 |
imports Nominal2_Base Nominal2_Atoms |
1062 | 10 |
uses ("nominal_thmdecls.ML") |
11 |
("nominal_permeq.ML") |
|
1833
2050b5723c04
added a library for basic nominal functions; separated nominal_eqvt file
Christian Urban <urbanc@in.tum.de>
parents:
1827
diff
changeset
|
12 |
("nominal_eqvt.ML") |
1062 | 13 |
begin |
14 |
||
1810
894930834ca8
fixed bug in thmdecls with destructing Trueprop; some initial infrastructure for eqvt-theorems of the form _ ==> _
Christian Urban <urbanc@in.tum.de>
parents:
1803
diff
changeset
|
15 |
|
1062 | 16 |
section {* Logical Operators *} |
17 |
||
18 |
lemma eq_eqvt: |
|
19 |
shows "p \<bullet> (x = y) \<longleftrightarrow> (p \<bullet> x) = (p \<bullet> y)" |
|
20 |
unfolding permute_eq_iff permute_bool_def .. |
|
21 |
||
22 |
lemma if_eqvt: |
|
23 |
shows "p \<bullet> (if b then x else y) = (if p \<bullet> b then p \<bullet> x else p \<bullet> y)" |
|
24 |
by (simp add: permute_fun_def permute_bool_def) |
|
25 |
||
26 |
lemma True_eqvt: |
|
27 |
shows "p \<bullet> True = True" |
|
28 |
unfolding permute_bool_def .. |
|
29 |
||
30 |
lemma False_eqvt: |
|
31 |
shows "p \<bullet> False = False" |
|
32 |
unfolding permute_bool_def .. |
|
33 |
||
34 |
lemma imp_eqvt: |
|
35 |
shows "p \<bullet> (A \<longrightarrow> B) = ((p \<bullet> A) \<longrightarrow> (p \<bullet> B))" |
|
36 |
by (simp add: permute_bool_def) |
|
37 |
||
38 |
lemma conj_eqvt: |
|
39 |
shows "p \<bullet> (A \<and> B) = ((p \<bullet> A) \<and> (p \<bullet> B))" |
|
40 |
by (simp add: permute_bool_def) |
|
41 |
||
42 |
lemma disj_eqvt: |
|
43 |
shows "p \<bullet> (A \<or> B) = ((p \<bullet> A) \<or> (p \<bullet> B))" |
|
44 |
by (simp add: permute_bool_def) |
|
45 |
||
46 |
lemma Not_eqvt: |
|
47 |
shows "p \<bullet> (\<not> A) = (\<not> (p \<bullet> A))" |
|
48 |
by (simp add: permute_bool_def) |
|
49 |
||
50 |
lemma all_eqvt: |
|
51 |
shows "p \<bullet> (\<forall>x. P x) = (\<forall>x. (p \<bullet> P) x)" |
|
52 |
unfolding permute_fun_def permute_bool_def |
|
53 |
by (auto, drule_tac x="p \<bullet> x" in spec, simp) |
|
54 |
||
55 |
lemma all_eqvt2: |
|
56 |
shows "p \<bullet> (\<forall>x. P x) = (\<forall>x. p \<bullet> P (- p \<bullet> x))" |
|
57 |
unfolding permute_fun_def permute_bool_def |
|
58 |
by (auto, drule_tac x="p \<bullet> x" in spec, simp) |
|
59 |
||
60 |
lemma ex_eqvt: |
|
61 |
shows "p \<bullet> (\<exists>x. P x) = (\<exists>x. (p \<bullet> P) x)" |
|
62 |
unfolding permute_fun_def permute_bool_def |
|
63 |
by (auto, rule_tac x="p \<bullet> x" in exI, simp) |
|
64 |
||
65 |
lemma ex_eqvt2: |
|
66 |
shows "p \<bullet> (\<exists>x. P x) = (\<exists>x. p \<bullet> P (- p \<bullet> x))" |
|
67 |
unfolding permute_fun_def permute_bool_def |
|
68 |
by (auto, rule_tac x="p \<bullet> x" in exI, simp) |
|
69 |
||
70 |
lemma ex1_eqvt: |
|
71 |
shows "p \<bullet> (\<exists>!x. P x) = (\<exists>!x. (p \<bullet> P) x)" |
|
72 |
unfolding Ex1_def |
|
73 |
by (simp add: ex_eqvt permute_fun_def conj_eqvt all_eqvt imp_eqvt eq_eqvt) |
|
74 |
||
75 |
lemma ex1_eqvt2: |
|
76 |
shows "p \<bullet> (\<exists>!x. P x) = (\<exists>!x. p \<bullet> P (- p \<bullet> x))" |
|
77 |
unfolding Ex1_def ex_eqvt2 conj_eqvt all_eqvt2 imp_eqvt eq_eqvt |
|
78 |
by simp |
|
79 |
||
80 |
lemma the_eqvt: |
|
81 |
assumes unique: "\<exists>!x. P x" |
|
1087
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1079
diff
changeset
|
82 |
shows "(p \<bullet> (THE x. P x)) = (THE x. p \<bullet> P (- p \<bullet> x))" |
1062 | 83 |
apply(rule the1_equality [symmetric]) |
84 |
apply(simp add: ex1_eqvt2[symmetric]) |
|
85 |
apply(simp add: permute_bool_def unique) |
|
86 |
apply(simp add: permute_bool_def) |
|
87 |
apply(rule theI'[OF unique]) |
|
88 |
done |
|
89 |
||
90 |
section {* Set Operations *} |
|
91 |
||
1087
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1079
diff
changeset
|
92 |
lemma mem_permute_iff: |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1079
diff
changeset
|
93 |
shows "(p \<bullet> x) \<in> (p \<bullet> X) \<longleftrightarrow> x \<in> X" |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1079
diff
changeset
|
94 |
unfolding mem_def permute_fun_def permute_bool_def |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1079
diff
changeset
|
95 |
by simp |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1079
diff
changeset
|
96 |
|
1062 | 97 |
lemma mem_eqvt: |
98 |
shows "p \<bullet> (x \<in> A) \<longleftrightarrow> (p \<bullet> x) \<in> (p \<bullet> A)" |
|
1087
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1079
diff
changeset
|
99 |
unfolding mem_permute_iff permute_bool_def by simp |
1062 | 100 |
|
101 |
lemma not_mem_eqvt: |
|
102 |
shows "p \<bullet> (x \<notin> A) \<longleftrightarrow> (p \<bullet> x) \<notin> (p \<bullet> A)" |
|
103 |
unfolding mem_def permute_fun_def by (simp add: Not_eqvt) |
|
104 |
||
105 |
lemma Collect_eqvt: |
|
106 |
shows "p \<bullet> {x. P x} = {x. (p \<bullet> P) x}" |
|
107 |
unfolding Collect_def permute_fun_def .. |
|
108 |
||
109 |
lemma Collect_eqvt2: |
|
110 |
shows "p \<bullet> {x. P x} = {x. p \<bullet> (P (-p \<bullet> x))}" |
|
111 |
unfolding Collect_def permute_fun_def .. |
|
112 |
||
113 |
lemma empty_eqvt: |
|
114 |
shows "p \<bullet> {} = {}" |
|
115 |
unfolding empty_def Collect_eqvt2 False_eqvt .. |
|
116 |
||
117 |
lemma supp_set_empty: |
|
118 |
shows "supp {} = {}" |
|
119 |
by (simp add: supp_def empty_eqvt) |
|
120 |
||
121 |
lemma fresh_set_empty: |
|
122 |
shows "a \<sharp> {}" |
|
123 |
by (simp add: fresh_def supp_set_empty) |
|
124 |
||
125 |
lemma UNIV_eqvt: |
|
126 |
shows "p \<bullet> UNIV = UNIV" |
|
127 |
unfolding UNIV_def Collect_eqvt2 True_eqvt .. |
|
128 |
||
129 |
lemma union_eqvt: |
|
130 |
shows "p \<bullet> (A \<union> B) = (p \<bullet> A) \<union> (p \<bullet> B)" |
|
131 |
unfolding Un_def Collect_eqvt2 disj_eqvt mem_eqvt by simp |
|
132 |
||
133 |
lemma inter_eqvt: |
|
134 |
shows "p \<bullet> (A \<inter> B) = (p \<bullet> A) \<inter> (p \<bullet> B)" |
|
135 |
unfolding Int_def Collect_eqvt2 conj_eqvt mem_eqvt by simp |
|
136 |
||
137 |
lemma Diff_eqvt: |
|
138 |
fixes A B :: "'a::pt set" |
|
139 |
shows "p \<bullet> (A - B) = p \<bullet> A - p \<bullet> B" |
|
140 |
unfolding set_diff_eq Collect_eqvt2 conj_eqvt Not_eqvt mem_eqvt by simp |
|
141 |
||
142 |
lemma Compl_eqvt: |
|
143 |
fixes A :: "'a::pt set" |
|
144 |
shows "p \<bullet> (- A) = - (p \<bullet> A)" |
|
145 |
unfolding Compl_eq_Diff_UNIV Diff_eqvt UNIV_eqvt .. |
|
146 |
||
147 |
lemma insert_eqvt: |
|
148 |
shows "p \<bullet> (insert x A) = insert (p \<bullet> x) (p \<bullet> A)" |
|
149 |
unfolding permute_set_eq_image image_insert .. |
|
150 |
||
151 |
lemma vimage_eqvt: |
|
152 |
shows "p \<bullet> (f -` A) = (p \<bullet> f) -` (p \<bullet> A)" |
|
153 |
unfolding vimage_def permute_fun_def [where f=f] |
|
154 |
unfolding Collect_eqvt2 mem_eqvt .. |
|
155 |
||
156 |
lemma image_eqvt: |
|
157 |
shows "p \<bullet> (f ` A) = (p \<bullet> f) ` (p \<bullet> A)" |
|
158 |
unfolding permute_set_eq_image |
|
159 |
unfolding permute_fun_def [where f=f] |
|
160 |
by (simp add: image_image) |
|
161 |
||
162 |
lemma finite_permute_iff: |
|
163 |
shows "finite (p \<bullet> A) \<longleftrightarrow> finite A" |
|
164 |
unfolding permute_set_eq_vimage |
|
165 |
using bij_permute by (rule finite_vimage_iff) |
|
166 |
||
167 |
lemma finite_eqvt: |
|
168 |
shows "p \<bullet> finite A = finite (p \<bullet> A)" |
|
169 |
unfolding finite_permute_iff permute_bool_def .. |
|
170 |
||
171 |
||
172 |
section {* List Operations *} |
|
173 |
||
174 |
lemma append_eqvt: |
|
175 |
shows "p \<bullet> (xs @ ys) = (p \<bullet> xs) @ (p \<bullet> ys)" |
|
176 |
by (induct xs) auto |
|
177 |
||
178 |
lemma supp_append: |
|
179 |
shows "supp (xs @ ys) = supp xs \<union> supp ys" |
|
180 |
by (induct xs) (auto simp add: supp_Nil supp_Cons) |
|
181 |
||
182 |
lemma fresh_append: |
|
183 |
shows "a \<sharp> (xs @ ys) \<longleftrightarrow> a \<sharp> xs \<and> a \<sharp> ys" |
|
184 |
by (induct xs) (simp_all add: fresh_Nil fresh_Cons) |
|
185 |
||
186 |
lemma rev_eqvt: |
|
187 |
shows "p \<bullet> (rev xs) = rev (p \<bullet> xs)" |
|
188 |
by (induct xs) (simp_all add: append_eqvt) |
|
189 |
||
190 |
lemma supp_rev: |
|
191 |
shows "supp (rev xs) = supp xs" |
|
192 |
by (induct xs) (auto simp add: supp_append supp_Cons supp_Nil) |
|
193 |
||
194 |
lemma fresh_rev: |
|
195 |
shows "a \<sharp> rev xs \<longleftrightarrow> a \<sharp> xs" |
|
196 |
by (induct xs) (auto simp add: fresh_append fresh_Cons fresh_Nil) |
|
197 |
||
198 |
lemma set_eqvt: |
|
199 |
shows "p \<bullet> (set xs) = set (p \<bullet> xs)" |
|
200 |
by (induct xs) (simp_all add: empty_eqvt insert_eqvt) |
|
201 |
||
202 |
(* needs finite support premise |
|
203 |
lemma supp_set: |
|
204 |
fixes x :: "'a::pt" |
|
205 |
shows "supp (set xs) = supp xs" |
|
206 |
*) |
|
207 |
||
1815
4135198bbb8a
moved equivariance of map into Nominal2_Eqvt file
Christian Urban <urbanc@in.tum.de>
parents:
1811
diff
changeset
|
208 |
lemma map_eqvt: |
4135198bbb8a
moved equivariance of map into Nominal2_Eqvt file
Christian Urban <urbanc@in.tum.de>
parents:
1811
diff
changeset
|
209 |
shows "p \<bullet> (map f xs) = map (p \<bullet> f) (p \<bullet> xs)" |
4135198bbb8a
moved equivariance of map into Nominal2_Eqvt file
Christian Urban <urbanc@in.tum.de>
parents:
1811
diff
changeset
|
210 |
by (induct xs) (simp_all, simp only: permute_fun_app_eq) |
1062 | 211 |
|
212 |
section {* Product Operations *} |
|
213 |
||
214 |
lemma fst_eqvt: |
|
215 |
"p \<bullet> (fst x) = fst (p \<bullet> x)" |
|
216 |
by (cases x) simp |
|
217 |
||
218 |
lemma snd_eqvt: |
|
219 |
"p \<bullet> (snd x) = snd (p \<bullet> x)" |
|
220 |
by (cases x) simp |
|
221 |
||
222 |
section {* Units *} |
|
223 |
||
224 |
lemma supp_unit: |
|
225 |
shows "supp () = {}" |
|
226 |
by (simp add: supp_def) |
|
227 |
||
228 |
lemma fresh_unit: |
|
229 |
shows "a \<sharp> ()" |
|
230 |
by (simp add: fresh_def supp_unit) |
|
231 |
||
1800
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
232 |
lemma permute_eqvt_raw: |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
233 |
shows "p \<bullet> permute = permute" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
234 |
apply(simp add: expand_fun_eq permute_fun_def) |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
235 |
apply(subst permute_eqvt) |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
236 |
apply(simp) |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
237 |
done |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
238 |
|
1062 | 239 |
section {* Equivariance automation *} |
240 |
||
241 |
text {* Setup of the theorem attributes @{text eqvt} and @{text eqvt_force} *} |
|
242 |
||
243 |
use "nominal_thmdecls.ML" |
|
244 |
setup "Nominal_ThmDecls.setup" |
|
245 |
||
246 |
lemmas [eqvt] = |
|
247 |
(* connectives *) |
|
248 |
eq_eqvt if_eqvt imp_eqvt disj_eqvt conj_eqvt Not_eqvt |
|
1087
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1079
diff
changeset
|
249 |
True_eqvt False_eqvt ex_eqvt all_eqvt ex1_eqvt |
1062 | 250 |
imp_eqvt [folded induct_implies_def] |
251 |
||
252 |
(* nominal *) |
|
1326 | 253 |
supp_eqvt fresh_eqvt |
1062 | 254 |
|
255 |
(* datatypes *) |
|
1087
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1079
diff
changeset
|
256 |
permute_prod.simps append_eqvt rev_eqvt set_eqvt |
1815
4135198bbb8a
moved equivariance of map into Nominal2_Eqvt file
Christian Urban <urbanc@in.tum.de>
parents:
1811
diff
changeset
|
257 |
map_eqvt fst_eqvt snd_eqvt Pair_eqvt permute_list.simps |
1062 | 258 |
|
259 |
(* sets *) |
|
1087
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1079
diff
changeset
|
260 |
empty_eqvt UNIV_eqvt union_eqvt inter_eqvt mem_eqvt |
1315
43d6e3730353
Add image_eqvt and atom_eqvt to eqvt bases.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1258
diff
changeset
|
261 |
Diff_eqvt Compl_eqvt insert_eqvt Collect_eqvt image_eqvt |
43d6e3730353
Add image_eqvt and atom_eqvt to eqvt bases.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1258
diff
changeset
|
262 |
|
1331
0f329449e304
Fix eqvt for multiple quantifiers.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1326
diff
changeset
|
263 |
atom_eqvt add_perm_eqvt |
1062 | 264 |
|
1800
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
265 |
lemmas [eqvt_raw] = |
1811
ae176476b525
implemented in thmdecls the case where eqvt-lemmas are of the form _ ==> _
Christian Urban <urbanc@in.tum.de>
parents:
1810
diff
changeset
|
266 |
permute_eqvt_raw[THEN eq_reflection] (* the normal version of this lemma loops *) |
1062 | 267 |
|
268 |
text {* helper lemmas for the eqvt_tac *} |
|
269 |
||
270 |
definition |
|
271 |
"unpermute p = permute (- p)" |
|
272 |
||
273 |
lemma eqvt_apply: |
|
274 |
fixes f :: "'a::pt \<Rightarrow> 'b::pt" |
|
275 |
and x :: "'a::pt" |
|
276 |
shows "p \<bullet> (f x) \<equiv> (p \<bullet> f) (p \<bullet> x)" |
|
277 |
unfolding permute_fun_def by simp |
|
278 |
||
279 |
lemma eqvt_lambda: |
|
280 |
fixes f :: "'a::pt \<Rightarrow> 'b::pt" |
|
281 |
shows "p \<bullet> (\<lambda>x. f x) \<equiv> (\<lambda>x. p \<bullet> (f (unpermute p x)))" |
|
282 |
unfolding permute_fun_def unpermute_def by simp |
|
283 |
||
284 |
lemma eqvt_bound: |
|
285 |
shows "p \<bullet> unpermute p x \<equiv> x" |
|
286 |
unfolding unpermute_def by simp |
|
287 |
||
1835
636de31888a6
tuned and removed dead code
Christian Urban <urbanc@in.tum.de>
parents:
1833
diff
changeset
|
288 |
(* provides perm_simp methods *) |
1062 | 289 |
use "nominal_permeq.ML" |
1800
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
290 |
setup Nominal_Permeq.setup |
1062 | 291 |
|
1867
f4477d3fe520
preliminary parser for perm_simp metod
Christian Urban <urbanc@in.tum.de>
parents:
1866
diff
changeset
|
292 |
ML {* |
f4477d3fe520
preliminary parser for perm_simp metod
Christian Urban <urbanc@in.tum.de>
parents:
1866
diff
changeset
|
293 |
val test1 = Scan.optional (Scan.lift (Args.add -- Args.colon) |-- Attrib.thms) []; |
f4477d3fe520
preliminary parser for perm_simp metod
Christian Urban <urbanc@in.tum.de>
parents:
1866
diff
changeset
|
294 |
val test2 = Scan.optional (Scan.lift ((Args.$$$ "exclude") -- Args.colon) |-- |
f4477d3fe520
preliminary parser for perm_simp metod
Christian Urban <urbanc@in.tum.de>
parents:
1866
diff
changeset
|
295 |
(Scan.repeat (Args.const true))) [] |
f4477d3fe520
preliminary parser for perm_simp metod
Christian Urban <urbanc@in.tum.de>
parents:
1866
diff
changeset
|
296 |
*} |
f4477d3fe520
preliminary parser for perm_simp metod
Christian Urban <urbanc@in.tum.de>
parents:
1866
diff
changeset
|
297 |
|
1800
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
298 |
method_setup perm_simp = |
1867
f4477d3fe520
preliminary parser for perm_simp metod
Christian Urban <urbanc@in.tum.de>
parents:
1866
diff
changeset
|
299 |
{* test1 -- test2 >> |
f4477d3fe520
preliminary parser for perm_simp metod
Christian Urban <urbanc@in.tum.de>
parents:
1866
diff
changeset
|
300 |
(fn (thms, consts) => fn ctxt => SIMPLE_METHOD (HEADGOAL (Nominal_Permeq.eqvt_tac ctxt [] consts))) *} |
1800
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
301 |
{* pushes permutations inside *} |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
302 |
|
1801
6d2a39db3862
added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents:
1800
diff
changeset
|
303 |
method_setup perm_strict_simp = |
1867
f4477d3fe520
preliminary parser for perm_simp metod
Christian Urban <urbanc@in.tum.de>
parents:
1866
diff
changeset
|
304 |
{* test1 -- test2 >> |
f4477d3fe520
preliminary parser for perm_simp metod
Christian Urban <urbanc@in.tum.de>
parents:
1866
diff
changeset
|
305 |
(fn (thms, consts) => fn ctxt => SIMPLE_METHOD (HEADGOAL |
f4477d3fe520
preliminary parser for perm_simp metod
Christian Urban <urbanc@in.tum.de>
parents:
1866
diff
changeset
|
306 |
(Nominal_Permeq.eqvt_strict_tac ctxt thms consts))) *} |
1801
6d2a39db3862
added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents:
1800
diff
changeset
|
307 |
{* pushes permutations inside, raises an error if it cannot solve all permutations *} |
6d2a39db3862
added more robust tracing infrastructure; a strict version of the eqvt_tac raises an error if not all permutations cannot be analysed
Christian Urban <urbanc@in.tum.de>
parents:
1800
diff
changeset
|
308 |
|
1800
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
309 |
declare [[trace_eqvt = true]] |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
310 |
|
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
311 |
lemma |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
312 |
fixes B::"'a::pt" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
313 |
shows "p \<bullet> (B = C)" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
314 |
apply(perm_simp) |
1062 | 315 |
oops |
316 |
||
1800
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
317 |
lemma |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
318 |
fixes B::"bool" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
319 |
shows "p \<bullet> (B = C)" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
320 |
apply(perm_simp) |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
321 |
oops |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
322 |
|
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
323 |
lemma |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
324 |
fixes B::"bool" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
325 |
shows "p \<bullet> (A \<longrightarrow> B = C)" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
326 |
apply (perm_simp) |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
327 |
oops |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
328 |
|
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
329 |
lemma |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
330 |
shows "p \<bullet> (\<lambda>(x::'a::pt). A \<longrightarrow> (B::'a \<Rightarrow> bool) x = C) = foo" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
331 |
apply(perm_simp) |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
332 |
oops |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
333 |
|
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
334 |
lemma |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
335 |
shows "p \<bullet> (\<lambda>B::bool. A \<longrightarrow> (B = C)) = foo" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
336 |
apply (perm_simp) |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
337 |
oops |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
338 |
|
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
339 |
lemma |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
340 |
shows "p \<bullet> (\<lambda>x y. \<exists>z. x = z \<and> x = y \<longrightarrow> z \<noteq> x) = foo" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
341 |
apply (perm_simp) |
1062 | 342 |
oops |
343 |
||
1800
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
344 |
lemma |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
345 |
shows "p \<bullet> (\<lambda>f x. f (g (f x))) = foo" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
346 |
apply (perm_simp) |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
347 |
oops |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
348 |
|
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
349 |
lemma |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
350 |
fixes p q::"perm" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
351 |
and x::"'a::pt" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
352 |
shows "p \<bullet> (q \<bullet> x) = foo" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
353 |
apply(perm_simp) |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
354 |
oops |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
355 |
|
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
356 |
lemma |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
357 |
fixes p q r::"perm" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
358 |
and x::"'a::pt" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
359 |
shows "p \<bullet> (q \<bullet> r \<bullet> x) = foo" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
360 |
apply(perm_simp) |
1062 | 361 |
oops |
362 |
||
1800
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
363 |
lemma |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
364 |
fixes p r::"perm" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
365 |
shows "p \<bullet> (\<lambda>q::perm. q \<bullet> (r \<bullet> x)) = foo" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
366 |
apply (perm_simp) |
1062 | 367 |
oops |
368 |
||
1800
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
369 |
lemma |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
370 |
fixes C D::"bool" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
371 |
shows "B (p \<bullet> (C = D))" |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
372 |
apply(perm_simp) |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
373 |
oops |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
374 |
|
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
375 |
declare [[trace_eqvt = false]] |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
376 |
|
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
377 |
text {* Problem: there is no raw eqvt-rule for The *} |
78fdc6b36a1c
changed the eqvt-tac to move only outermost permutations inside; added tracing infrastructure for the eqvt-tac
Christian Urban <urbanc@in.tum.de>
parents:
1774
diff
changeset
|
378 |
lemma "p \<bullet> (THE x. P x) = foo" |
1867
f4477d3fe520
preliminary parser for perm_simp metod
Christian Urban <urbanc@in.tum.de>
parents:
1866
diff
changeset
|
379 |
apply(perm_strict_simp exclude: The) |
f4477d3fe520
preliminary parser for perm_simp metod
Christian Urban <urbanc@in.tum.de>
parents:
1866
diff
changeset
|
380 |
apply(perm_simp exclude: The) |
1062 | 381 |
oops |
382 |
||
1835
636de31888a6
tuned and removed dead code
Christian Urban <urbanc@in.tum.de>
parents:
1833
diff
changeset
|
383 |
(* automatic equivariance procedure for |
636de31888a6
tuned and removed dead code
Christian Urban <urbanc@in.tum.de>
parents:
1833
diff
changeset
|
384 |
inductive definitions *) |
636de31888a6
tuned and removed dead code
Christian Urban <urbanc@in.tum.de>
parents:
1833
diff
changeset
|
385 |
use "nominal_eqvt.ML" |
1833
2050b5723c04
added a library for basic nominal functions; separated nominal_eqvt file
Christian Urban <urbanc@in.tum.de>
parents:
1827
diff
changeset
|
386 |
|
1315
43d6e3730353
Add image_eqvt and atom_eqvt to eqvt bases.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1258
diff
changeset
|
387 |
end |