author | Christian Urban <urbanc@in.tum.de> |
Sun, 11 Apr 2010 22:48:49 +0200 | |
changeset 1810 | 894930834ca8 |
parent 1803 | ed46cf122016 |
child 1811 | ae176476b525 |
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") |
|
12 |
begin |
|
13 |
||
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
|
14 |
lemma r: "x = x" |
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 |
apply(auto) |
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
|
16 |
done |
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
|
17 |
|
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
|
18 |
ML {* |
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
|
19 |
prop_of @{thm r} |
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
|
20 |
*} |
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
|
21 |
|
1062 | 22 |
section {* Logical Operators *} |
23 |
||
24 |
lemma eq_eqvt: |
|
25 |
shows "p \<bullet> (x = y) \<longleftrightarrow> (p \<bullet> x) = (p \<bullet> y)" |
|
26 |
unfolding permute_eq_iff permute_bool_def .. |
|
27 |
||
28 |
lemma if_eqvt: |
|
29 |
shows "p \<bullet> (if b then x else y) = (if p \<bullet> b then p \<bullet> x else p \<bullet> y)" |
|
30 |
by (simp add: permute_fun_def permute_bool_def) |
|
31 |
||
32 |
lemma True_eqvt: |
|
33 |
shows "p \<bullet> True = True" |
|
34 |
unfolding permute_bool_def .. |
|
35 |
||
36 |
lemma False_eqvt: |
|
37 |
shows "p \<bullet> False = False" |
|
38 |
unfolding permute_bool_def .. |
|
39 |
||
40 |
lemma imp_eqvt: |
|
41 |
shows "p \<bullet> (A \<longrightarrow> B) = ((p \<bullet> A) \<longrightarrow> (p \<bullet> B))" |
|
42 |
by (simp add: permute_bool_def) |
|
43 |
||
44 |
lemma conj_eqvt: |
|
45 |
shows "p \<bullet> (A \<and> B) = ((p \<bullet> A) \<and> (p \<bullet> B))" |
|
46 |
by (simp add: permute_bool_def) |
|
47 |
||
48 |
lemma disj_eqvt: |
|
49 |
shows "p \<bullet> (A \<or> B) = ((p \<bullet> A) \<or> (p \<bullet> B))" |
|
50 |
by (simp add: permute_bool_def) |
|
51 |
||
52 |
lemma Not_eqvt: |
|
53 |
shows "p \<bullet> (\<not> A) = (\<not> (p \<bullet> A))" |
|
54 |
by (simp add: permute_bool_def) |
|
55 |
||
56 |
lemma all_eqvt: |
|
57 |
shows "p \<bullet> (\<forall>x. P x) = (\<forall>x. (p \<bullet> P) x)" |
|
58 |
unfolding permute_fun_def permute_bool_def |
|
59 |
by (auto, drule_tac x="p \<bullet> x" in spec, simp) |
|
60 |
||
61 |
lemma all_eqvt2: |
|
62 |
shows "p \<bullet> (\<forall>x. P x) = (\<forall>x. p \<bullet> P (- p \<bullet> x))" |
|
63 |
unfolding permute_fun_def permute_bool_def |
|
64 |
by (auto, drule_tac x="p \<bullet> x" in spec, simp) |
|
65 |
||
66 |
lemma ex_eqvt: |
|
67 |
shows "p \<bullet> (\<exists>x. P x) = (\<exists>x. (p \<bullet> P) x)" |
|
68 |
unfolding permute_fun_def permute_bool_def |
|
69 |
by (auto, rule_tac x="p \<bullet> x" in exI, simp) |
|
70 |
||
71 |
lemma ex_eqvt2: |
|
72 |
shows "p \<bullet> (\<exists>x. P x) = (\<exists>x. p \<bullet> P (- p \<bullet> x))" |
|
73 |
unfolding permute_fun_def permute_bool_def |
|
74 |
by (auto, rule_tac x="p \<bullet> x" in exI, simp) |
|
75 |
||
76 |
lemma ex1_eqvt: |
|
77 |
shows "p \<bullet> (\<exists>!x. P x) = (\<exists>!x. (p \<bullet> P) x)" |
|
78 |
unfolding Ex1_def |
|
79 |
by (simp add: ex_eqvt permute_fun_def conj_eqvt all_eqvt imp_eqvt eq_eqvt) |
|
80 |
||
81 |
lemma ex1_eqvt2: |
|
82 |
shows "p \<bullet> (\<exists>!x. P x) = (\<exists>!x. p \<bullet> P (- p \<bullet> x))" |
|
83 |
unfolding Ex1_def ex_eqvt2 conj_eqvt all_eqvt2 imp_eqvt eq_eqvt |
|
84 |
by simp |
|
85 |
||
86 |
lemma the_eqvt: |
|
87 |
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
|
88 |
shows "(p \<bullet> (THE x. P x)) = (THE x. p \<bullet> P (- p \<bullet> x))" |
1062 | 89 |
apply(rule the1_equality [symmetric]) |
90 |
apply(simp add: ex1_eqvt2[symmetric]) |
|
91 |
apply(simp add: permute_bool_def unique) |
|
92 |
apply(simp add: permute_bool_def) |
|
93 |
apply(rule theI'[OF unique]) |
|
94 |
done |
|
95 |
||
96 |
section {* Set Operations *} |
|
97 |
||
1087
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1079
diff
changeset
|
98 |
lemma mem_permute_iff: |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1079
diff
changeset
|
99 |
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
|
100 |
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
|
101 |
by simp |
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1079
diff
changeset
|
102 |
|
1062 | 103 |
lemma mem_eqvt: |
104 |
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
|
105 |
unfolding mem_permute_iff permute_bool_def by simp |
1062 | 106 |
|
107 |
lemma not_mem_eqvt: |
|
108 |
shows "p \<bullet> (x \<notin> A) \<longleftrightarrow> (p \<bullet> x) \<notin> (p \<bullet> A)" |
|
109 |
unfolding mem_def permute_fun_def by (simp add: Not_eqvt) |
|
110 |
||
111 |
lemma Collect_eqvt: |
|
112 |
shows "p \<bullet> {x. P x} = {x. (p \<bullet> P) x}" |
|
113 |
unfolding Collect_def permute_fun_def .. |
|
114 |
||
115 |
lemma Collect_eqvt2: |
|
116 |
shows "p \<bullet> {x. P x} = {x. p \<bullet> (P (-p \<bullet> x))}" |
|
117 |
unfolding Collect_def permute_fun_def .. |
|
118 |
||
119 |
lemma empty_eqvt: |
|
120 |
shows "p \<bullet> {} = {}" |
|
121 |
unfolding empty_def Collect_eqvt2 False_eqvt .. |
|
122 |
||
123 |
lemma supp_set_empty: |
|
124 |
shows "supp {} = {}" |
|
125 |
by (simp add: supp_def empty_eqvt) |
|
126 |
||
127 |
lemma fresh_set_empty: |
|
128 |
shows "a \<sharp> {}" |
|
129 |
by (simp add: fresh_def supp_set_empty) |
|
130 |
||
131 |
lemma UNIV_eqvt: |
|
132 |
shows "p \<bullet> UNIV = UNIV" |
|
133 |
unfolding UNIV_def Collect_eqvt2 True_eqvt .. |
|
134 |
||
135 |
lemma union_eqvt: |
|
136 |
shows "p \<bullet> (A \<union> B) = (p \<bullet> A) \<union> (p \<bullet> B)" |
|
137 |
unfolding Un_def Collect_eqvt2 disj_eqvt mem_eqvt by simp |
|
138 |
||
139 |
lemma inter_eqvt: |
|
140 |
shows "p \<bullet> (A \<inter> B) = (p \<bullet> A) \<inter> (p \<bullet> B)" |
|
141 |
unfolding Int_def Collect_eqvt2 conj_eqvt mem_eqvt by simp |
|
142 |
||
143 |
lemma Diff_eqvt: |
|
144 |
fixes A B :: "'a::pt set" |
|
145 |
shows "p \<bullet> (A - B) = p \<bullet> A - p \<bullet> B" |
|
146 |
unfolding set_diff_eq Collect_eqvt2 conj_eqvt Not_eqvt mem_eqvt by simp |
|
147 |
||
148 |
lemma Compl_eqvt: |
|
149 |
fixes A :: "'a::pt set" |
|
150 |
shows "p \<bullet> (- A) = - (p \<bullet> A)" |
|
151 |
unfolding Compl_eq_Diff_UNIV Diff_eqvt UNIV_eqvt .. |
|
152 |
||
153 |
lemma insert_eqvt: |
|
154 |
shows "p \<bullet> (insert x A) = insert (p \<bullet> x) (p \<bullet> A)" |
|
155 |
unfolding permute_set_eq_image image_insert .. |
|
156 |
||
157 |
lemma vimage_eqvt: |
|
158 |
shows "p \<bullet> (f -` A) = (p \<bullet> f) -` (p \<bullet> A)" |
|
159 |
unfolding vimage_def permute_fun_def [where f=f] |
|
160 |
unfolding Collect_eqvt2 mem_eqvt .. |
|
161 |
||
162 |
lemma image_eqvt: |
|
163 |
shows "p \<bullet> (f ` A) = (p \<bullet> f) ` (p \<bullet> A)" |
|
164 |
unfolding permute_set_eq_image |
|
165 |
unfolding permute_fun_def [where f=f] |
|
166 |
by (simp add: image_image) |
|
167 |
||
168 |
lemma finite_permute_iff: |
|
169 |
shows "finite (p \<bullet> A) \<longleftrightarrow> finite A" |
|
170 |
unfolding permute_set_eq_vimage |
|
171 |
using bij_permute by (rule finite_vimage_iff) |
|
172 |
||
173 |
lemma finite_eqvt: |
|
174 |
shows "p \<bullet> finite A = finite (p \<bullet> A)" |
|
175 |
unfolding finite_permute_iff permute_bool_def .. |
|
176 |
||
177 |
||
178 |
section {* List Operations *} |
|
179 |
||
180 |
lemma append_eqvt: |
|
181 |
shows "p \<bullet> (xs @ ys) = (p \<bullet> xs) @ (p \<bullet> ys)" |
|
182 |
by (induct xs) auto |
|
183 |
||
184 |
lemma supp_append: |
|
185 |
shows "supp (xs @ ys) = supp xs \<union> supp ys" |
|
186 |
by (induct xs) (auto simp add: supp_Nil supp_Cons) |
|
187 |
||
188 |
lemma fresh_append: |
|
189 |
shows "a \<sharp> (xs @ ys) \<longleftrightarrow> a \<sharp> xs \<and> a \<sharp> ys" |
|
190 |
by (induct xs) (simp_all add: fresh_Nil fresh_Cons) |
|
191 |
||
192 |
lemma rev_eqvt: |
|
193 |
shows "p \<bullet> (rev xs) = rev (p \<bullet> xs)" |
|
194 |
by (induct xs) (simp_all add: append_eqvt) |
|
195 |
||
196 |
lemma supp_rev: |
|
197 |
shows "supp (rev xs) = supp xs" |
|
198 |
by (induct xs) (auto simp add: supp_append supp_Cons supp_Nil) |
|
199 |
||
200 |
lemma fresh_rev: |
|
201 |
shows "a \<sharp> rev xs \<longleftrightarrow> a \<sharp> xs" |
|
202 |
by (induct xs) (auto simp add: fresh_append fresh_Cons fresh_Nil) |
|
203 |
||
204 |
lemma set_eqvt: |
|
205 |
shows "p \<bullet> (set xs) = set (p \<bullet> xs)" |
|
206 |
by (induct xs) (simp_all add: empty_eqvt insert_eqvt) |
|
207 |
||
208 |
(* needs finite support premise |
|
209 |
lemma supp_set: |
|
210 |
fixes x :: "'a::pt" |
|
211 |
shows "supp (set xs) = supp xs" |
|
212 |
*) |
|
213 |
||
214 |
||
215 |
section {* Product Operations *} |
|
216 |
||
217 |
lemma fst_eqvt: |
|
218 |
"p \<bullet> (fst x) = fst (p \<bullet> x)" |
|
219 |
by (cases x) simp |
|
220 |
||
221 |
lemma snd_eqvt: |
|
222 |
"p \<bullet> (snd x) = snd (p \<bullet> x)" |
|
223 |
by (cases x) simp |
|
224 |
||
225 |
section {* Units *} |
|
226 |
||
227 |
lemma supp_unit: |
|
228 |
shows "supp () = {}" |
|
229 |
by (simp add: supp_def) |
|
230 |
||
231 |
lemma fresh_unit: |
|
232 |
shows "a \<sharp> ()" |
|
233 |
by (simp add: fresh_def supp_unit) |
|
234 |
||
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
|
235 |
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
|
236 |
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
|
237 |
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
|
238 |
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
|
239 |
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
|
240 |
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
|
241 |
|
1062 | 242 |
section {* Equivariance automation *} |
243 |
||
244 |
text {* Setup of the theorem attributes @{text eqvt} and @{text eqvt_force} *} |
|
245 |
||
246 |
use "nominal_thmdecls.ML" |
|
247 |
setup "Nominal_ThmDecls.setup" |
|
248 |
||
249 |
lemmas [eqvt] = |
|
250 |
(* connectives *) |
|
251 |
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
|
252 |
True_eqvt False_eqvt ex_eqvt all_eqvt ex1_eqvt |
1062 | 253 |
imp_eqvt [folded induct_implies_def] |
254 |
||
255 |
(* nominal *) |
|
1326 | 256 |
supp_eqvt fresh_eqvt |
1062 | 257 |
|
258 |
(* datatypes *) |
|
1087
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1079
diff
changeset
|
259 |
permute_prod.simps append_eqvt rev_eqvt set_eqvt |
1803
ed46cf122016
used warning instead of tracing (does not seem to produce stable output)
Christian Urban <urbanc@in.tum.de>
parents:
1801
diff
changeset
|
260 |
fst_eqvt snd_eqvt Pair_eqvt permute_list.simps |
1062 | 261 |
|
262 |
(* sets *) |
|
1087
bb7f4457091a
moved some lemmas to Nominal; updated all files
Christian Urban <urbanc@in.tum.de>
parents:
1079
diff
changeset
|
263 |
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
|
264 |
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
|
265 |
|
1331
0f329449e304
Fix eqvt for multiple quantifiers.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1326
diff
changeset
|
266 |
atom_eqvt add_perm_eqvt |
1062 | 267 |
|
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
|
268 |
lemmas [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
|
269 |
permute_eqvt_raw[THEN eq_reflection] (* the normal version of this lemma loops *) |
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
|
270 |
|
1062 | 271 |
thm eqvts |
272 |
thm eqvts_raw |
|
273 |
||
274 |
text {* helper lemmas for the eqvt_tac *} |
|
275 |
||
276 |
definition |
|
277 |
"unpermute p = permute (- p)" |
|
278 |
||
279 |
lemma eqvt_apply: |
|
280 |
fixes f :: "'a::pt \<Rightarrow> 'b::pt" |
|
281 |
and x :: "'a::pt" |
|
282 |
shows "p \<bullet> (f x) \<equiv> (p \<bullet> f) (p \<bullet> x)" |
|
283 |
unfolding permute_fun_def by simp |
|
284 |
||
285 |
lemma eqvt_lambda: |
|
286 |
fixes f :: "'a::pt \<Rightarrow> 'b::pt" |
|
287 |
shows "p \<bullet> (\<lambda>x. f x) \<equiv> (\<lambda>x. p \<bullet> (f (unpermute p x)))" |
|
288 |
unfolding permute_fun_def unpermute_def by simp |
|
289 |
||
290 |
lemma eqvt_bound: |
|
291 |
shows "p \<bullet> unpermute p x \<equiv> x" |
|
292 |
unfolding unpermute_def by simp |
|
293 |
||
294 |
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
|
295 |
setup Nominal_Permeq.setup |
1062 | 296 |
|
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
|
297 |
method_setup perm_simp = |
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
|
298 |
{* Attrib.thms >> |
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
|
299 |
(fn thms => fn ctxt => SIMPLE_METHOD (HEADGOAL (Nominal_Permeq.eqvt_tac ctxt thms ["The"]))) *} |
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
|
300 |
{* 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
|
301 |
|
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
|
302 |
method_setup perm_strict_simp = |
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 |
{* Attrib.thms >> |
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
|
304 |
(fn thms => fn ctxt => SIMPLE_METHOD (HEADGOAL (Nominal_Permeq.eqvt_strict_tac ctxt thms ["The"]))) *} |
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
|
305 |
{* 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
|
306 |
|
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
|
307 |
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
|
308 |
|
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 |
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
|
310 |
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
|
311 |
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
|
312 |
apply(perm_simp) |
1062 | 313 |
oops |
314 |
||
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
|
315 |
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
|
316 |
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
|
317 |
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
|
318 |
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
|
319 |
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
|
320 |
|
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 |
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
|
322 |
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
|
323 |
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
|
324 |
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
|
325 |
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
|
326 |
|
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 |
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
|
328 |
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
|
329 |
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
|
330 |
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
|
331 |
|
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 |
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
|
333 |
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
|
334 |
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
|
335 |
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
|
336 |
|
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 |
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
|
338 |
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
|
339 |
apply (perm_simp) |
1062 | 340 |
oops |
341 |
||
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
|
342 |
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
|
343 |
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
|
344 |
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
|
345 |
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
|
346 |
|
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 |
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
|
348 |
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
|
349 |
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
|
350 |
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
|
351 |
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
|
352 |
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
|
353 |
|
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 |
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
|
355 |
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
|
356 |
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
|
357 |
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
|
358 |
apply(perm_simp) |
1062 | 359 |
oops |
360 |
||
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
|
361 |
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
|
362 |
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
|
363 |
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
|
364 |
apply (perm_simp) |
1062 | 365 |
oops |
366 |
||
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
|
367 |
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
|
368 |
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
|
369 |
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
|
370 |
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
|
371 |
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
|
372 |
|
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 |
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
|
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 |
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
|
376 |
lemma "p \<bullet> (THE x. P 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
|
377 |
apply(perm_simp) |
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
|
378 |
(* apply(perm_strict_simp) *) |
1062 | 379 |
oops |
380 |
||
381 |
||
1315
43d6e3730353
Add image_eqvt and atom_eqvt to eqvt bases.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1258
diff
changeset
|
382 |
end |