2568
8193bbaa07fe
merged Nominal-General directory into Nominal; renamed Abs.thy to Nominal2_Abs.thy
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 1
theory Nominal2_Abs
8193bbaa07fe
merged Nominal-General directory into Nominal; renamed Abs.thy to Nominal2_Abs.thy
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 2
imports "Nominal2_Base"
2635
+ − 3
"~~/src/HOL/Quotient"
+ − 4
"~~/src/HOL/Library/Quotient_List"
+ − 5
"~~/src/HOL/Library/Quotient_Product"
1440
+ − 6
begin
+ − 7
2473
+ − 8
+ − 9
section {* Abstractions *}
+ − 10
1440
+ − 11
fun
2469
+ − 12
alpha_set
1440
+ − 13
where
2469
+ − 14
alpha_set[simp del]:
+ − 15
"alpha_set (bs, x) R f pi (cs, y) \<longleftrightarrow>
1465
+ − 16
f x - bs = f y - cs \<and>
+ − 17
(f x - bs) \<sharp>* pi \<and>
+ − 18
R (pi \<bullet> x) y \<and>
+ − 19
pi \<bullet> bs = cs"
1440
+ − 20
1557
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 21
fun
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 22
alpha_res
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 23
where
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 24
alpha_res[simp del]:
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 25
"alpha_res (bs, x) R f pi (cs, y) \<longleftrightarrow>
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 26
f x - bs = f y - cs \<and>
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 27
(f x - bs) \<sharp>* pi \<and>
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 28
R (pi \<bullet> x) y"
1440
+ − 29
1557
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 30
fun
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 31
alpha_lst
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 32
where
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 33
alpha_lst[simp del]:
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 34
"alpha_lst (bs, x) R f pi (cs, y) \<longleftrightarrow>
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 35
f x - set bs = f y - set cs \<and>
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 36
(f x - set bs) \<sharp>* pi \<and>
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 37
R (pi \<bullet> x) y \<and>
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 38
pi \<bullet> bs = cs"
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 39
2469
+ − 40
lemmas alphas = alpha_set.simps alpha_res.simps alpha_lst.simps
1557
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 41
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 42
notation
2469
+ − 43
alpha_set ("_ \<approx>set _ _ _ _" [100, 100, 100, 100, 100] 100) and
1557
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 44
alpha_res ("_ \<approx>res _ _ _ _" [100, 100, 100, 100, 100] 100) and
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 45
alpha_lst ("_ \<approx>lst _ _ _ _" [100, 100, 100, 100, 100] 100)
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 46
2385
+ − 47
section {* Mono *}
+ − 48
1557
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 49
lemma [mono]:
2469
+ − 50
shows "R1 \<le> R2 \<Longrightarrow> alpha_set bs R1 \<le> alpha_set bs R2"
1557
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 51
and "R1 \<le> R2 \<Longrightarrow> alpha_res bs R1 \<le> alpha_res bs R2"
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 52
and "R1 \<le> R2 \<Longrightarrow> alpha_lst cs R1 \<le> alpha_lst cs R2"
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 53
by (case_tac [!] bs, case_tac [!] cs)
fee2389789ad
moved infinite_Un into mainstream Isabelle; moved permute_boolI/E lemmas
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 54
(auto simp add: le_fun_def le_bool_def alphas)
1440
+ − 55
2385
+ − 56
section {* Equivariance *}
+ − 57
+ − 58
lemma alpha_eqvt[eqvt]:
2469
+ − 59
shows "(bs, x) \<approx>set R f q (cs, y) \<Longrightarrow> (p \<bullet> bs, p \<bullet> x) \<approx>set (p \<bullet> R) (p \<bullet> f) (p \<bullet> q) (p \<bullet> cs, p \<bullet> y)"
2311
+ − 60
and "(bs, x) \<approx>res R f q (cs, y) \<Longrightarrow> (p \<bullet> bs, p \<bullet> x) \<approx>res (p \<bullet> R) (p \<bullet> f) (p \<bullet> q) (p \<bullet> cs, p \<bullet> y)"
+ − 61
and "(ds, x) \<approx>lst R f q (es, y) \<Longrightarrow> (p \<bullet> ds, p \<bullet> x) \<approx>lst (p \<bullet> R) (p \<bullet> f) (p \<bullet> q) (p \<bullet> es, p \<bullet> y)"
+ − 62
unfolding alphas
+ − 63
unfolding permute_eqvt[symmetric]
+ − 64
unfolding set_eqvt[symmetric]
+ − 65
unfolding permute_fun_app_eq[symmetric]
+ − 66
unfolding Diff_eqvt[symmetric]
3004
+ − 67
unfolding eq_eqvt[symmetric]
+ − 68
unfolding fresh_star_eqvt[symmetric]
+ − 69
by (auto simp add: permute_bool_def)
2311
+ − 70
2385
+ − 71
+ − 72
section {* Equivalence *}
+ − 73
+ − 74
lemma alpha_refl:
2311
+ − 75
assumes a: "R x x"
2469
+ − 76
shows "(bs, x) \<approx>set R f 0 (bs, x)"
2311
+ − 77
and "(bs, x) \<approx>res R f 0 (bs, x)"
+ − 78
and "(cs, x) \<approx>lst R f 0 (cs, x)"
+ − 79
using a
+ − 80
unfolding alphas
+ − 81
unfolding fresh_star_def
+ − 82
by (simp_all add: fresh_zero_perm)
+ − 83
2385
+ − 84
lemma alpha_sym:
2311
+ − 85
assumes a: "R (p \<bullet> x) y \<Longrightarrow> R (- p \<bullet> y) x"
2469
+ − 86
shows "(bs, x) \<approx>set R f p (cs, y) \<Longrightarrow> (cs, y) \<approx>set R f (- p) (bs, x)"
2311
+ − 87
and "(bs, x) \<approx>res R f p (cs, y) \<Longrightarrow> (cs, y) \<approx>res R f (- p) (bs, x)"
+ − 88
and "(ds, x) \<approx>lst R f p (es, y) \<Longrightarrow> (es, y) \<approx>lst R f (- p) (ds, x)"
+ − 89
unfolding alphas fresh_star_def
+ − 90
using a
+ − 91
by (auto simp add: fresh_minus_perm)
+ − 92
2385
+ − 93
lemma alpha_trans:
+ − 94
assumes a: "\<lbrakk>R (p \<bullet> x) y; R (q \<bullet> y) z\<rbrakk> \<Longrightarrow> R ((q + p) \<bullet> x) z"
2469
+ − 95
shows "\<lbrakk>(bs, x) \<approx>set R f p (cs, y); (cs, y) \<approx>set R f q (ds, z)\<rbrakk> \<Longrightarrow> (bs, x) \<approx>set R f (q + p) (ds, z)"
2385
+ − 96
and "\<lbrakk>(bs, x) \<approx>res R f p (cs, y); (cs, y) \<approx>res R f q (ds, z)\<rbrakk> \<Longrightarrow> (bs, x) \<approx>res R f (q + p) (ds, z)"
+ − 97
and "\<lbrakk>(es, x) \<approx>lst R f p (gs, y); (gs, y) \<approx>lst R f q (hs, z)\<rbrakk> \<Longrightarrow> (es, x) \<approx>lst R f (q + p) (hs, z)"
+ − 98
using a
+ − 99
unfolding alphas fresh_star_def
+ − 100
by (simp_all add: fresh_plus_perm)
+ − 101
+ − 102
lemma alpha_sym_eqvt:
2311
+ − 103
assumes a: "R (p \<bullet> x) y \<Longrightarrow> R y (p \<bullet> x)"
+ − 104
and b: "p \<bullet> R = R"
2469
+ − 105
shows "(bs, x) \<approx>set R f p (cs, y) \<Longrightarrow> (cs, y) \<approx>set R f (- p) (bs, x)"
2311
+ − 106
and "(bs, x) \<approx>res R f p (cs, y) \<Longrightarrow> (cs, y) \<approx>res R f (- p) (bs, x)"
2313
+ − 107
and "(ds, x) \<approx>lst R f p (es, y) \<Longrightarrow> (es, y) \<approx>lst R f (- p) (ds, x)"
2385
+ − 108
apply(auto intro!: alpha_sym)
2313
+ − 109
apply(drule_tac [!] a)
+ − 110
apply(rule_tac [!] p="p" in permute_boolE)
+ − 111
apply(perm_simp add: permute_minus_cancel b)
+ − 112
apply(assumption)
+ − 113
apply(perm_simp add: permute_minus_cancel b)
+ − 114
apply(assumption)
+ − 115
apply(perm_simp add: permute_minus_cancel b)
+ − 116
apply(assumption)
+ − 117
done
2311
+ − 118
2469
+ − 119
lemma alpha_set_trans_eqvt:
+ − 120
assumes b: "(cs, y) \<approx>set R f q (ds, z)"
+ − 121
and a: "(bs, x) \<approx>set R f p (cs, y)"
2313
+ − 122
and d: "q \<bullet> R = R"
+ − 123
and c: "\<lbrakk>R (p \<bullet> x) y; R y (- q \<bullet> z)\<rbrakk> \<Longrightarrow> R (p \<bullet> x) (- q \<bullet> z)"
2469
+ − 124
shows "(bs, x) \<approx>set R f (q + p) (ds, z)"
2385
+ − 125
apply(rule alpha_trans)
2313
+ − 126
defer
+ − 127
apply(rule a)
+ − 128
apply(rule b)
+ − 129
apply(drule c)
+ − 130
apply(rule_tac p="q" in permute_boolE)
+ − 131
apply(perm_simp add: permute_minus_cancel d)
+ − 132
apply(assumption)
+ − 133
apply(rotate_tac -1)
+ − 134
apply(drule_tac p="q" in permute_boolI)
+ − 135
apply(perm_simp add: permute_minus_cancel d)
+ − 136
apply(simp add: permute_eqvt[symmetric])
+ − 137
done
+ − 138
+ − 139
lemma alpha_res_trans_eqvt:
+ − 140
assumes b: "(cs, y) \<approx>res R f q (ds, z)"
+ − 141
and a: "(bs, x) \<approx>res R f p (cs, y)"
+ − 142
and d: "q \<bullet> R = R"
+ − 143
and c: "\<lbrakk>R (p \<bullet> x) y; R y (- q \<bullet> z)\<rbrakk> \<Longrightarrow> R (p \<bullet> x) (- q \<bullet> z)"
+ − 144
shows "(bs, x) \<approx>res R f (q + p) (ds, z)"
2385
+ − 145
apply(rule alpha_trans)
2313
+ − 146
defer
+ − 147
apply(rule a)
+ − 148
apply(rule b)
+ − 149
apply(drule c)
+ − 150
apply(rule_tac p="q" in permute_boolE)
+ − 151
apply(perm_simp add: permute_minus_cancel d)
+ − 152
apply(assumption)
+ − 153
apply(rotate_tac -1)
+ − 154
apply(drule_tac p="q" in permute_boolI)
+ − 155
apply(perm_simp add: permute_minus_cancel d)
+ − 156
apply(simp add: permute_eqvt[symmetric])
+ − 157
done
+ − 158
+ − 159
lemma alpha_lst_trans_eqvt:
+ − 160
assumes b: "(cs, y) \<approx>lst R f q (ds, z)"
+ − 161
and a: "(bs, x) \<approx>lst R f p (cs, y)"
+ − 162
and d: "q \<bullet> R = R"
+ − 163
and c: "\<lbrakk>R (p \<bullet> x) y; R y (- q \<bullet> z)\<rbrakk> \<Longrightarrow> R (p \<bullet> x) (- q \<bullet> z)"
+ − 164
shows "(bs, x) \<approx>lst R f (q + p) (ds, z)"
2385
+ − 165
apply(rule alpha_trans)
2313
+ − 166
defer
+ − 167
apply(rule a)
+ − 168
apply(rule b)
+ − 169
apply(drule c)
+ − 170
apply(rule_tac p="q" in permute_boolE)
+ − 171
apply(perm_simp add: permute_minus_cancel d)
+ − 172
apply(assumption)
+ − 173
apply(rotate_tac -1)
+ − 174
apply(drule_tac p="q" in permute_boolI)
+ − 175
apply(perm_simp add: permute_minus_cancel d)
+ − 176
apply(simp add: permute_eqvt[symmetric])
+ − 177
done
+ − 178
2469
+ − 179
lemmas alpha_trans_eqvt = alpha_set_trans_eqvt alpha_res_trans_eqvt alpha_lst_trans_eqvt
2313
+ − 180
2311
+ − 181
+ − 182
section {* General Abstractions *}
+ − 183
1440
+ − 184
fun
2469
+ − 185
alpha_abs_set
1440
+ − 186
where
1666
+ − 187
[simp del]:
2469
+ − 188
"alpha_abs_set (bs, x) (cs, y) \<longleftrightarrow> (\<exists>p. (bs, x) \<approx>set (op=) supp p (cs, y))"
1440
+ − 189
1657
+ − 190
fun
+ − 191
alpha_abs_lst
+ − 192
where
1666
+ − 193
[simp del]:
1657
+ − 194
"alpha_abs_lst (bs, x) (cs, y) \<longleftrightarrow> (\<exists>p. (bs, x) \<approx>lst (op=) supp p (cs, y))"
+ − 195
+ − 196
fun
+ − 197
alpha_abs_res
+ − 198
where
1666
+ − 199
[simp del]:
1657
+ − 200
"alpha_abs_res (bs, x) (cs, y) \<longleftrightarrow> (\<exists>p. (bs, x) \<approx>res (op=) supp p (cs, y))"
+ − 201
1440
+ − 202
notation
2469
+ − 203
alpha_abs_set (infix "\<approx>abs'_set" 50) and
1666
+ − 204
alpha_abs_lst (infix "\<approx>abs'_lst" 50) and
+ − 205
alpha_abs_res (infix "\<approx>abs'_res" 50)
1657
+ − 206
2469
+ − 207
lemmas alphas_abs = alpha_abs_set.simps alpha_abs_res.simps alpha_abs_lst.simps
1657
+ − 208
2385
+ − 209
1657
+ − 210
lemma alphas_abs_refl:
2469
+ − 211
shows "(bs, x) \<approx>abs_set (bs, x)"
1657
+ − 212
and "(bs, x) \<approx>abs_res (bs, x)"
+ − 213
and "(cs, x) \<approx>abs_lst (cs, x)"
+ − 214
unfolding alphas_abs
+ − 215
unfolding alphas
+ − 216
unfolding fresh_star_def
+ − 217
by (rule_tac [!] x="0" in exI)
+ − 218
(simp_all add: fresh_zero_perm)
+ − 219
+ − 220
lemma alphas_abs_sym:
2469
+ − 221
shows "(bs, x) \<approx>abs_set (cs, y) \<Longrightarrow> (cs, y) \<approx>abs_set (bs, x)"
1657
+ − 222
and "(bs, x) \<approx>abs_res (cs, y) \<Longrightarrow> (cs, y) \<approx>abs_res (bs, x)"
+ − 223
and "(ds, x) \<approx>abs_lst (es, y) \<Longrightarrow> (es, y) \<approx>abs_lst (ds, x)"
+ − 224
unfolding alphas_abs
+ − 225
unfolding alphas
+ − 226
unfolding fresh_star_def
+ − 227
by (erule_tac [!] exE, rule_tac [!] x="-p" in exI)
+ − 228
(auto simp add: fresh_minus_perm)
1440
+ − 229
1657
+ − 230
lemma alphas_abs_trans:
2469
+ − 231
shows "\<lbrakk>(bs, x) \<approx>abs_set (cs, y); (cs, y) \<approx>abs_set (ds, z)\<rbrakk> \<Longrightarrow> (bs, x) \<approx>abs_set (ds, z)"
1657
+ − 232
and "\<lbrakk>(bs, x) \<approx>abs_res (cs, y); (cs, y) \<approx>abs_res (ds, z)\<rbrakk> \<Longrightarrow> (bs, x) \<approx>abs_res (ds, z)"
+ − 233
and "\<lbrakk>(es, x) \<approx>abs_lst (gs, y); (gs, y) \<approx>abs_lst (hs, z)\<rbrakk> \<Longrightarrow> (es, x) \<approx>abs_lst (hs, z)"
+ − 234
unfolding alphas_abs
+ − 235
unfolding alphas
+ − 236
unfolding fresh_star_def
+ − 237
apply(erule_tac [!] exE, erule_tac [!] exE)
+ − 238
apply(rule_tac [!] x="pa + p" in exI)
+ − 239
by (simp_all add: fresh_plus_perm)
+ − 240
+ − 241
lemma alphas_abs_eqvt:
2469
+ − 242
shows "(bs, x) \<approx>abs_set (cs, y) \<Longrightarrow> (p \<bullet> bs, p \<bullet> x) \<approx>abs_set (p \<bullet> cs, p \<bullet> y)"
1657
+ − 243
and "(bs, x) \<approx>abs_res (cs, y) \<Longrightarrow> (p \<bullet> bs, p \<bullet> x) \<approx>abs_res (p \<bullet> cs, p \<bullet> y)"
+ − 244
and "(ds, x) \<approx>abs_lst (es, y) \<Longrightarrow> (p \<bullet> ds, p \<bullet> x) \<approx>abs_lst (p \<bullet> es, p \<bullet> y)"
+ − 245
unfolding alphas_abs
+ − 246
unfolding alphas
+ − 247
unfolding set_eqvt[symmetric]
+ − 248
unfolding supp_eqvt[symmetric]
+ − 249
unfolding Diff_eqvt[symmetric]
+ − 250
apply(erule_tac [!] exE)
+ − 251
apply(rule_tac [!] x="p \<bullet> pa" in exI)
+ − 252
by (auto simp add: fresh_star_permute_iff permute_eqvt[symmetric])
+ − 253
2668
+ − 254
+ − 255
section {* Strengthening the equivalence *}
+ − 256
+ − 257
lemma disjoint_right_eq:
+ − 258
assumes a: "A \<union> B1 = A \<union> B2"
+ − 259
and b: "A \<inter> B1 = {}" "A \<inter> B2 = {}"
+ − 260
shows "B1 = B2"
+ − 261
using a b
+ − 262
by (metis Int_Un_distrib2 Int_absorb2 Int_commute Un_upper2)
+ − 263
+ − 264
lemma supp_property_res:
+ − 265
assumes a: "(as, x) \<approx>res (op =) supp p (as', x')"
+ − 266
shows "p \<bullet> (supp x \<inter> as) = supp x' \<inter> as'"
+ − 267
proof -
+ − 268
from a have "(supp x - as) \<sharp>* p" by (auto simp only: alphas)
+ − 269
then have *: "p \<bullet> (supp x - as) = (supp x - as)"
+ − 270
by (simp add: atom_set_perm_eq)
+ − 271
have "(supp x' - as') \<union> (supp x' \<inter> as') = supp x'" by auto
+ − 272
also have "\<dots> = supp (p \<bullet> x)" using a by (simp add: alphas)
+ − 273
also have "\<dots> = p \<bullet> (supp x)" by (simp add: supp_eqvt)
+ − 274
also have "\<dots> = p \<bullet> ((supp x - as) \<union> (supp x \<inter> as))" by auto
+ − 275
also have "\<dots> = (p \<bullet> (supp x - as)) \<union> (p \<bullet> (supp x \<inter> as))" by (simp add: union_eqvt)
+ − 276
also have "\<dots> = (supp x - as) \<union> (p \<bullet> (supp x \<inter> as))" using * by simp
+ − 277
also have "\<dots> = (supp x' - as') \<union> (p \<bullet> (supp x \<inter> as))" using a by (simp add: alphas)
+ − 278
finally have "(supp x' - as') \<union> (supp x' \<inter> as') = (supp x' - as') \<union> (p \<bullet> (supp x \<inter> as))" .
+ − 279
moreover
+ − 280
have "(supp x' - as') \<inter> (supp x' \<inter> as') = {}" by auto
+ − 281
moreover
+ − 282
have "(supp x - as) \<inter> (supp x \<inter> as) = {}" by auto
+ − 283
then have "p \<bullet> ((supp x - as) \<inter> (supp x \<inter> as) = {})" by (simp add: permute_bool_def)
+ − 284
then have "(p \<bullet> (supp x - as)) \<inter> (p \<bullet> (supp x \<inter> as)) = {}" by (perm_simp) (simp)
+ − 285
then have "(supp x - as) \<inter> (p \<bullet> (supp x \<inter> as)) = {}" using * by simp
+ − 286
then have "(supp x' - as') \<inter> (p \<bullet> (supp x \<inter> as)) = {}" using a by (simp add: alphas)
+ − 287
ultimately show "p \<bullet> (supp x \<inter> as) = supp x' \<inter> as'"
+ − 288
by (auto dest: disjoint_right_eq)
2712
+ − 289
qed
2668
+ − 290
2674
+ − 291
lemma alpha_abs_res_stronger1_aux:
2671
+ − 292
assumes asm: "(as, x) \<approx>res (op =) supp p' (as', x')"
2669
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 293
shows "\<exists>p. (as, x) \<approx>res (op =) supp p (as', x') \<and> supp p \<subseteq> (supp x \<inter> as) \<union> (supp x' \<inter> as')"
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 294
proof -
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 295
from asm have 0: "(supp x - as) \<sharp>* p'" by (auto simp only: alphas)
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 296
then have #: "p' \<bullet> (supp x - as) = (supp x - as)"
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 297
by (simp add: atom_set_perm_eq)
2673
+ − 298
obtain p where *: "\<forall>b \<in> supp x. p \<bullet> b = p' \<bullet> b" and **: "supp p \<subseteq> supp x \<union> p' \<bullet> supp x"
+ − 299
using set_renaming_perm2 by blast
2669
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 300
from * have a: "p \<bullet> x = p' \<bullet> x" using supp_perm_perm_eq by auto
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 301
from 0 have 1: "(supp x - as) \<sharp>* p" using *
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 302
by (auto simp add: fresh_star_def fresh_perm)
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 303
then have 2: "(supp x - as) \<inter> supp p = {}"
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 304
by (auto simp add: fresh_star_def fresh_def)
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 305
have b: "supp x = (supp x - as) \<union> (supp x \<inter> as)" by auto
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 306
have "supp p \<subseteq> supp x \<union> p' \<bullet> supp x" using ** by simp
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 307
also have "\<dots> = (supp x - as) \<union> (supp x \<inter> as) \<union> (p' \<bullet> ((supp x - as) \<union> (supp x \<inter> as)))"
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 308
using b by simp
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 309
also have "\<dots> = (supp x - as) \<union> (supp x \<inter> as) \<union> ((p' \<bullet> (supp x - as)) \<union> (p' \<bullet> (supp x \<inter> as)))"
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 310
by (simp add: union_eqvt)
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 311
also have "\<dots> = (supp x - as) \<union> (supp x \<inter> as) \<union> (p' \<bullet> (supp x \<inter> as))"
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 312
using # by auto
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 313
also have "\<dots> = (supp x - as) \<union> (supp x \<inter> as) \<union> (supp x' \<inter> as')" using asm
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 314
by (simp add: supp_property_res)
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 315
finally have "supp p \<subseteq> (supp x - as) \<union> (supp x \<inter> as) \<union> (supp x' \<inter> as')" .
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 316
then
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 317
have "supp p \<subseteq> (supp x \<inter> as) \<union> (supp x' \<inter> as')" using 2 by auto
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 318
moreover
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 319
have "(as, x) \<approx>res (op =) supp p (as', x')" using asm 1 a by (simp add: alphas)
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 320
ultimately
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 321
show "\<exists>p. (as, x) \<approx>res (op =) supp p (as', x') \<and> supp p \<subseteq> (supp x \<inter> as) \<union> (supp x' \<inter> as')" by blast
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 322
qed
1d1772a89026
the function translating lambda terms to locally nameless lambda terms; still needs a stronger abs_eq_iff lemma...at the moment only proved for restrictions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 323
2712
+ − 324
lemma alpha_abs_res_minimal:
+ − 325
assumes asm: "(as, x) \<approx>res (op =) supp p (as', x')"
+ − 326
shows "(as \<inter> supp x, x) \<approx>res (op =) supp p (as' \<inter> supp x', x')"
+ − 327
using asm unfolding alpha_res by (auto simp add: Diff_Int)
+ − 328
+ − 329
lemma alpha_abs_res_abs_set:
+ − 330
assumes asm: "(as, x) \<approx>res (op =) supp p (as', x')"
+ − 331
shows "(as \<inter> supp x, x) \<approx>set (op =) supp p (as' \<inter> supp x', x')"
+ − 332
proof -
+ − 333
have c: "p \<bullet> x = x'"
+ − 334
using alpha_abs_res_minimal[OF asm] unfolding alpha_res by clarify
+ − 335
then have a: "supp x - as \<inter> supp x = supp (p \<bullet> x) - as' \<inter> supp (p \<bullet> x)"
+ − 336
using alpha_abs_res_minimal[OF asm] by (simp add: alpha_res)
+ − 337
have b: "(supp x - as \<inter> supp x) \<sharp>* p"
+ − 338
using alpha_abs_res_minimal[OF asm] unfolding alpha_res by clarify
+ − 339
have "p \<bullet> (as \<inter> supp x) = as' \<inter> supp (p \<bullet> x)"
+ − 340
by (metis Int_commute asm c supp_property_res)
+ − 341
then show ?thesis using a b c unfolding alpha_set by simp
+ − 342
qed
+ − 343
2713
a84999edbcb3
More properties that relate abs_res and abs_set. Also abs_res with less binders.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 344
lemma alpha_abs_set_abs_res:
a84999edbcb3
More properties that relate abs_res and abs_set. Also abs_res with less binders.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 345
assumes asm: "(as \<inter> supp x, x) \<approx>set (op =) supp p (as' \<inter> supp x', x')"
a84999edbcb3
More properties that relate abs_res and abs_set. Also abs_res with less binders.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 346
shows "(as, x) \<approx>res (op =) supp p (as', x')"
a84999edbcb3
More properties that relate abs_res and abs_set. Also abs_res with less binders.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 347
using asm unfolding alphas by (auto simp add: Diff_Int)
a84999edbcb3
More properties that relate abs_res and abs_set. Also abs_res with less binders.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 348
2674
+ − 349
lemma alpha_abs_res_stronger1:
+ − 350
assumes asm: "(as, x) \<approx>res (op =) supp p' (as', x')"
+ − 351
shows "\<exists>p. (as, x) \<approx>res (op =) supp p (as', x') \<and> supp p \<subseteq> as \<union> as'"
+ − 352
using alpha_abs_res_stronger1_aux[OF asm] by auto
+ − 353
2671
+ − 354
lemma alpha_abs_set_stronger1:
2673
+ − 355
assumes asm: "(as, x) \<approx>set (op =) supp p' (as', x')"
2671
+ − 356
shows "\<exists>p. (as, x) \<approx>set (op =) supp p (as', x') \<and> supp p \<subseteq> as \<union> as'"
+ − 357
proof -
+ − 358
from asm have 0: "(supp x - as) \<sharp>* p'" by (auto simp only: alphas)
+ − 359
then have #: "p' \<bullet> (supp x - as) = (supp x - as)"
+ − 360
by (simp add: atom_set_perm_eq)
2673
+ − 361
obtain p where *: "\<forall>b \<in> (supp x \<union> as). p \<bullet> b = p' \<bullet> b"
+ − 362
and **: "supp p \<subseteq> (supp x \<union> as) \<union> p' \<bullet> (supp x \<union> as)"
+ − 363
using set_renaming_perm2 by blast
2671
+ − 364
from * have "\<forall>b \<in> supp x. p \<bullet> b = p' \<bullet> b" by blast
+ − 365
then have a: "p \<bullet> x = p' \<bullet> x" using supp_perm_perm_eq by auto
+ − 366
from * have "\<forall>b \<in> as. p \<bullet> b = p' \<bullet> b" by blast
2673
+ − 367
then have zb: "p \<bullet> as = p' \<bullet> as"
+ − 368
apply(auto simp add: permute_set_eq)
+ − 369
apply(rule_tac x="xa" in exI)
+ − 370
apply(simp)
+ − 371
done
2671
+ − 372
have zc: "p' \<bullet> as = as'" using asm by (simp add: alphas)
+ − 373
from 0 have 1: "(supp x - as) \<sharp>* p" using *
+ − 374
by (auto simp add: fresh_star_def fresh_perm)
+ − 375
then have 2: "(supp x - as) \<inter> supp p = {}"
+ − 376
by (auto simp add: fresh_star_def fresh_def)
+ − 377
have b: "supp x = (supp x - as) \<union> (supp x \<inter> as)" by auto
+ − 378
have "supp p \<subseteq> supp x \<union> as \<union> p' \<bullet> supp x \<union> p' \<bullet> as" using ** using union_eqvt by blast
+ − 379
also have "\<dots> = (supp x - as) \<union> (supp x \<inter> as) \<union> as \<union> (p' \<bullet> ((supp x - as) \<union> (supp x \<inter> as))) \<union> p' \<bullet> as"
+ − 380
using b by simp
2673
+ − 381
also have "\<dots> = (supp x - as) \<union> (supp x \<inter> as) \<union> as \<union>
+ − 382
((p' \<bullet> (supp x - as)) \<union> (p' \<bullet> (supp x \<inter> as))) \<union> p' \<bullet> as" by (simp add: union_eqvt)
2671
+ − 383
also have "\<dots> = (supp x - as) \<union> (supp x \<inter> as) \<union> as \<union> (p' \<bullet> (supp x \<inter> as)) \<union> p' \<bullet> as"
+ − 384
using # by auto
+ − 385
also have "\<dots> = (supp x - as) \<union> (supp x \<inter> as) \<union> as \<union> p' \<bullet> ((supp x \<inter> as) \<union> as)" using union_eqvt
+ − 386
by auto
+ − 387
also have "\<dots> = (supp x - as) \<union> (supp x \<inter> as) \<union> as \<union> p' \<bullet> as"
+ − 388
by (metis Int_commute Un_commute sup_inf_absorb)
2673
+ − 389
also have "\<dots> = (supp x - as) \<union> as \<union> p' \<bullet> as" by blast
2671
+ − 390
finally have "supp p \<subseteq> (supp x - as) \<union> as \<union> p' \<bullet> as" .
+ − 391
then have "supp p \<subseteq> as \<union> p' \<bullet> as" using 2 by blast
+ − 392
moreover
+ − 393
have "(as, x) \<approx>set (op =) supp p (as', x')" using asm 1 a zb by (simp add: alphas)
+ − 394
ultimately
+ − 395
show "\<exists>p. (as, x) \<approx>set (op =) supp p (as', x') \<and> supp p \<subseteq> as \<union> as'" using zc by blast
+ − 396
qed
+ − 397
2674
+ − 398
lemma alpha_abs_lst_stronger1:
+ − 399
assumes asm: "(as, x) \<approx>lst (op =) supp p' (as', x')"
+ − 400
shows "\<exists>p. (as, x) \<approx>lst (op =) supp p (as', x') \<and> supp p \<subseteq> set as \<union> set as'"
+ − 401
proof -
+ − 402
from asm have 0: "(supp x - set as) \<sharp>* p'" by (auto simp only: alphas)
+ − 403
then have #: "p' \<bullet> (supp x - set as) = (supp x - set as)"
+ − 404
by (simp add: atom_set_perm_eq)
+ − 405
obtain p where *: "\<forall>b \<in> (supp x \<union> set as). p \<bullet> b = p' \<bullet> b"
+ − 406
and **: "supp p \<subseteq> (supp x \<union> set as) \<union> p' \<bullet> (supp x \<union> set as)"
+ − 407
using set_renaming_perm2 by blast
+ − 408
from * have "\<forall>b \<in> supp x. p \<bullet> b = p' \<bullet> b" by blast
+ − 409
then have a: "p \<bullet> x = p' \<bullet> x" using supp_perm_perm_eq by auto
+ − 410
from * have "\<forall>b \<in> set as. p \<bullet> b = p' \<bullet> b" by blast
+ − 411
then have zb: "p \<bullet> as = p' \<bullet> as" by (induct as) (auto)
+ − 412
have zc: "p' \<bullet> set as = set as'" using asm by (simp add: alphas set_eqvt)
+ − 413
from 0 have 1: "(supp x - set as) \<sharp>* p" using *
+ − 414
by (auto simp add: fresh_star_def fresh_perm)
+ − 415
then have 2: "(supp x - set as) \<inter> supp p = {}"
+ − 416
by (auto simp add: fresh_star_def fresh_def)
+ − 417
have b: "supp x = (supp x - set as) \<union> (supp x \<inter> set as)" by auto
+ − 418
have "supp p \<subseteq> supp x \<union> set as \<union> p' \<bullet> supp x \<union> p' \<bullet> set as" using ** using union_eqvt by blast
+ − 419
also have "\<dots> = (supp x - set as) \<union> (supp x \<inter> set as) \<union> set as \<union>
+ − 420
(p' \<bullet> ((supp x - set as) \<union> (supp x \<inter> set as))) \<union> p' \<bullet> set as" using b by simp
+ − 421
also have "\<dots> = (supp x - set as) \<union> (supp x \<inter> set as) \<union> set as \<union>
+ − 422
((p' \<bullet> (supp x - set as)) \<union> (p' \<bullet> (supp x \<inter> set as))) \<union> p' \<bullet> set as" by (simp add: union_eqvt)
+ − 423
also have "\<dots> = (supp x - set as) \<union> (supp x \<inter> set as) \<union> set as \<union>
+ − 424
(p' \<bullet> (supp x \<inter> set as)) \<union> p' \<bullet> set as" using # by auto
+ − 425
also have "\<dots> = (supp x - set as) \<union> (supp x \<inter> set as) \<union> set as \<union> p' \<bullet> ((supp x \<inter> set as) \<union> set as)"
+ − 426
using union_eqvt by auto
+ − 427
also have "\<dots> = (supp x - set as) \<union> (supp x \<inter> set as) \<union> set as \<union> p' \<bullet> set as"
+ − 428
by (metis Int_commute Un_commute sup_inf_absorb)
+ − 429
also have "\<dots> = (supp x - set as) \<union> set as \<union> p' \<bullet> set as" by blast
+ − 430
finally have "supp p \<subseteq> (supp x - set as) \<union> set as \<union> p' \<bullet> set as" .
+ − 431
then have "supp p \<subseteq> set as \<union> p' \<bullet> set as" using 2 by blast
+ − 432
moreover
+ − 433
have "(as, x) \<approx>lst (op =) supp p (as', x')" using asm 1 a zb by (simp add: alphas)
+ − 434
ultimately
+ − 435
show "\<exists>p. (as, x) \<approx>lst (op =) supp p (as', x') \<and> supp p \<subseteq> set as \<union> set as'" using zc by blast
+ − 436
qed
2668
+ − 437
2674
+ − 438
lemma alphas_abs_stronger:
+ − 439
shows "(as, x) \<approx>abs_set (as', x') \<longleftrightarrow> (\<exists>p. (as, x) \<approx>set (op =) supp p (as', x') \<and> supp p \<subseteq> as \<union> as')"
+ − 440
and "(as, x) \<approx>abs_res (as', x') \<longleftrightarrow> (\<exists>p. (as, x) \<approx>res (op =) supp p (as', x') \<and> supp p \<subseteq> as \<union> as')"
+ − 441
and "(bs, x) \<approx>abs_lst (bs', x') \<longleftrightarrow>
+ − 442
(\<exists>p. (bs, x) \<approx>lst (op =) supp p (bs', x') \<and> supp p \<subseteq> set bs \<union> set bs')"
+ − 443
apply(rule iffI)
+ − 444
apply(auto simp add: alphas_abs alpha_abs_set_stronger1)[1]
+ − 445
apply(auto simp add: alphas_abs)[1]
+ − 446
apply(rule iffI)
+ − 447
apply(auto simp add: alphas_abs alpha_abs_res_stronger1)[1]
+ − 448
apply(auto simp add: alphas_abs)[1]
+ − 449
apply(rule iffI)
+ − 450
apply(auto simp add: alphas_abs alpha_abs_lst_stronger1)[1]
+ − 451
apply(auto simp add: alphas_abs)[1]
+ − 452
done
2668
+ − 453
3058
+ − 454
lemma alpha_res_alpha_set:
+ − 455
"(bs, x) \<approx>res op = supp p (cs, y) \<longleftrightarrow> (bs \<inter> supp x, x) \<approx>set op = supp p (cs \<inter> supp y, y)"
+ − 456
using alpha_abs_set_abs_res alpha_abs_res_abs_set by blast
+ − 457
2668
+ − 458
section {* Quotient types *}
+ − 459
1657
+ − 460
quotient_type
2469
+ − 461
'a abs_set = "(atom set \<times> 'a::pt)" / "alpha_abs_set"
1657
+ − 462
and 'b abs_res = "(atom set \<times> 'b::pt)" / "alpha_abs_res"
+ − 463
and 'c abs_lst = "(atom list \<times> 'c::pt)" / "alpha_abs_lst"
+ − 464
apply(rule_tac [!] equivpI)
2592
+ − 465
unfolding reflp_def refl_on_def symp_def sym_def transp_def trans_def
1657
+ − 466
by (auto intro: alphas_abs_sym alphas_abs_refl alphas_abs_trans simp only:)
1440
+ − 467
+ − 468
quotient_definition
2469
+ − 469
Abs_set ("[_]set. _" [60, 60] 60)
1932
+ − 470
where
2469
+ − 471
"Abs_set::atom set \<Rightarrow> ('a::pt) \<Rightarrow> 'a abs_set"
1440
+ − 472
is
+ − 473
"Pair::atom set \<Rightarrow> ('a::pt) \<Rightarrow> (atom set \<times> 'a)"
+ − 474
1657
+ − 475
quotient_definition
1932
+ − 476
Abs_res ("[_]res. _" [60, 60] 60)
+ − 477
where
1657
+ − 478
"Abs_res::atom set \<Rightarrow> ('a::pt) \<Rightarrow> 'a abs_res"
+ − 479
is
+ − 480
"Pair::atom set \<Rightarrow> ('a::pt) \<Rightarrow> (atom set \<times> 'a)"
+ − 481
+ − 482
quotient_definition
1932
+ − 483
Abs_lst ("[_]lst. _" [60, 60] 60)
+ − 484
where
1657
+ − 485
"Abs_lst::atom list \<Rightarrow> ('a::pt) \<Rightarrow> 'a abs_lst"
+ − 486
is
+ − 487
"Pair::atom list \<Rightarrow> ('a::pt) \<Rightarrow> (atom list \<times> 'a)"
+ − 488
1440
+ − 489
lemma [quot_respect]:
2469
+ − 490
shows "(op= ===> op= ===> alpha_abs_set) Pair Pair"
1657
+ − 491
and "(op= ===> op= ===> alpha_abs_res) Pair Pair"
+ − 492
and "(op= ===> op= ===> alpha_abs_lst) Pair Pair"
+ − 493
unfolding fun_rel_def
2385
+ − 494
by (auto intro: alphas_abs_refl)
1440
+ − 495
+ − 496
lemma [quot_respect]:
2469
+ − 497
shows "(op= ===> alpha_abs_set ===> alpha_abs_set) permute permute"
1657
+ − 498
and "(op= ===> alpha_abs_res ===> alpha_abs_res) permute permute"
+ − 499
and "(op= ===> alpha_abs_lst ===> alpha_abs_lst) permute permute"
+ − 500
unfolding fun_rel_def
+ − 501
by (auto intro: alphas_abs_eqvt simp only: Pair_eqvt)
1440
+ − 502
2491
+ − 503
lemma Abs_eq_iff:
3058
+ − 504
shows "[bs]set. x = [bs']set. y \<longleftrightarrow> (\<exists>p. (bs, x) \<approx>set (op =) supp p (bs', y))"
+ − 505
and "[bs]res. x = [bs']res. y \<longleftrightarrow> (\<exists>p. (bs, x) \<approx>res (op =) supp p (bs', y))"
+ − 506
and "[cs]lst. x = [cs']lst. y \<longleftrightarrow> (\<exists>p. (cs, x) \<approx>lst (op =) supp p (cs', y))"
2491
+ − 507
by (lifting alphas_abs)
+ − 508
2674
+ − 509
lemma Abs_eq_iff2:
3058
+ − 510
shows "[bs]set. x = [bs']set. y \<longleftrightarrow> (\<exists>p. (bs, x) \<approx>set (op=) supp p (bs', y) \<and> supp p \<subseteq> bs \<union> bs')"
+ − 511
and "[bs]res. x = [bs']res. y \<longleftrightarrow> (\<exists>p. (bs, x) \<approx>res (op=) supp p (bs', y) \<and> supp p \<subseteq> bs \<union> bs')"
+ − 512
and "[cs]lst. x = [cs']lst. y \<longleftrightarrow> (\<exists>p. (cs, x) \<approx>lst (op=) supp p (cs', y) \<and> supp p \<subseteq> set cs \<union> set cs')"
2674
+ − 513
by (lifting alphas_abs_stronger)
+ − 514
3024
+ − 515
2713
a84999edbcb3
More properties that relate abs_res and abs_set. Also abs_res with less binders.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 516
lemma Abs_eq_res_set:
3058
+ − 517
shows "[bs]res. x = [cs]res. y \<longleftrightarrow> [bs \<inter> supp x]set. x = [cs \<inter> supp y]set. y"
3024
+ − 518
unfolding Abs_eq_iff alpha_res_alpha_set by rule
2713
a84999edbcb3
More properties that relate abs_res and abs_set. Also abs_res with less binders.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 519
a84999edbcb3
More properties that relate abs_res and abs_set. Also abs_res with less binders.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 520
lemma Abs_eq_res_supp:
a84999edbcb3
More properties that relate abs_res and abs_set. Also abs_res with less binders.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 521
assumes asm: "supp x \<subseteq> bs"
3058
+ − 522
shows "[as]res. x = [as \<inter> bs]res. x"
2713
a84999edbcb3
More properties that relate abs_res and abs_set. Also abs_res with less binders.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 523
unfolding Abs_eq_iff alphas
a84999edbcb3
More properties that relate abs_res and abs_set. Also abs_res with less binders.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 524
apply (rule_tac x="0::perm" in exI)
a84999edbcb3
More properties that relate abs_res and abs_set. Also abs_res with less binders.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 525
apply (simp add: fresh_star_zero)
a84999edbcb3
More properties that relate abs_res and abs_set. Also abs_res with less binders.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 526
using asm by blast
a84999edbcb3
More properties that relate abs_res and abs_set. Also abs_res with less binders.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 527
2491
+ − 528
lemma Abs_exhausts:
3058
+ − 529
shows "(\<And>as (x::'a::pt). y1 = [as]set. x \<Longrightarrow> P1) \<Longrightarrow> P1"
+ − 530
and "(\<And>as (x::'a::pt). y2 = [as]res. x \<Longrightarrow> P2) \<Longrightarrow> P2"
+ − 531
and "(\<And>bs (x::'a::pt). y3 = [bs]lst. x \<Longrightarrow> P3) \<Longrightarrow> P3"
1686
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 532
by (lifting prod.exhaust[where 'a="atom set" and 'b="'a"]
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 533
prod.exhaust[where 'a="atom set" and 'b="'a"]
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 534
prod.exhaust[where 'a="atom list" and 'b="'a"])
1440
+ − 535
2679
+ − 536
2469
+ − 537
instantiation abs_set :: (pt) pt
1440
+ − 538
begin
+ − 539
+ − 540
quotient_definition
2469
+ − 541
"permute_abs_set::perm \<Rightarrow> ('a::pt abs_set) \<Rightarrow> 'a abs_set"
1440
+ − 542
is
+ − 543
"permute:: perm \<Rightarrow> (atom set \<times> 'a::pt) \<Rightarrow> (atom set \<times> 'a::pt)"
+ − 544
2491
+ − 545
lemma permute_Abs_set[simp]:
1558
+ − 546
fixes x::"'a::pt"
3058
+ − 547
shows "(p \<bullet> ([as]set. x)) = [p \<bullet> as]set. (p \<bullet> x)"
1657
+ − 548
by (lifting permute_prod.simps[where 'a="atom set" and 'b="'a"])
1440
+ − 549
+ − 550
instance
+ − 551
apply(default)
2491
+ − 552
apply(case_tac [!] x rule: Abs_exhausts(1))
1657
+ − 553
apply(simp_all)
+ − 554
done
+ − 555
+ − 556
end
+ − 557
+ − 558
instantiation abs_res :: (pt) pt
+ − 559
begin
+ − 560
+ − 561
quotient_definition
+ − 562
"permute_abs_res::perm \<Rightarrow> ('a::pt abs_res) \<Rightarrow> 'a abs_res"
+ − 563
is
+ − 564
"permute:: perm \<Rightarrow> (atom set \<times> 'a::pt) \<Rightarrow> (atom set \<times> 'a::pt)"
+ − 565
+ − 566
lemma permute_Abs_res[simp]:
+ − 567
fixes x::"'a::pt"
3058
+ − 568
shows "(p \<bullet> ([as]res. x)) = [p \<bullet> as]res. (p \<bullet> x)"
1657
+ − 569
by (lifting permute_prod.simps[where 'a="atom set" and 'b="'a"])
+ − 570
+ − 571
instance
+ − 572
apply(default)
2491
+ − 573
apply(case_tac [!] x rule: Abs_exhausts(2))
1657
+ − 574
apply(simp_all)
+ − 575
done
+ − 576
+ − 577
end
+ − 578
+ − 579
instantiation abs_lst :: (pt) pt
+ − 580
begin
+ − 581
+ − 582
quotient_definition
+ − 583
"permute_abs_lst::perm \<Rightarrow> ('a::pt abs_lst) \<Rightarrow> 'a abs_lst"
+ − 584
is
+ − 585
"permute:: perm \<Rightarrow> (atom list \<times> 'a::pt) \<Rightarrow> (atom list \<times> 'a::pt)"
+ − 586
+ − 587
lemma permute_Abs_lst[simp]:
+ − 588
fixes x::"'a::pt"
3058
+ − 589
shows "(p \<bullet> ([as]lst. x)) = [p \<bullet> as]lst. (p \<bullet> x)"
1657
+ − 590
by (lifting permute_prod.simps[where 'a="atom list" and 'b="'a"])
+ − 591
+ − 592
instance
+ − 593
apply(default)
2491
+ − 594
apply(case_tac [!] x rule: Abs_exhausts(3))
1440
+ − 595
apply(simp_all)
+ − 596
done
+ − 597
+ − 598
end
+ − 599
2491
+ − 600
lemmas permute_Abs[eqvt] = permute_Abs_set permute_Abs_res permute_Abs_lst
1657
+ − 601
2385
+ − 602
2491
+ − 603
lemma Abs_swap1:
1662
+ − 604
assumes a1: "a \<notin> (supp x) - bs"
+ − 605
and a2: "b \<notin> (supp x) - bs"
3058
+ − 606
shows "[bs]set. x = [(a \<rightleftharpoons> b) \<bullet> bs]set. ((a \<rightleftharpoons> b) \<bullet> x)"
+ − 607
and "[bs]res. x = [(a \<rightleftharpoons> b) \<bullet> bs]res. ((a \<rightleftharpoons> b) \<bullet> x)"
2491
+ − 608
unfolding Abs_eq_iff
1662
+ − 609
unfolding alphas
+ − 610
unfolding supp_eqvt[symmetric] Diff_eqvt[symmetric]
+ − 611
unfolding fresh_star_def fresh_def
+ − 612
unfolding swap_set_not_in[OF a1 a2]
+ − 613
using a1 a2
+ − 614
by (rule_tac [!] x="(a \<rightleftharpoons> b)" in exI)
+ − 615
(auto simp add: supp_perm swap_atom)
+ − 616
2491
+ − 617
lemma Abs_swap2:
1662
+ − 618
assumes a1: "a \<notin> (supp x) - (set bs)"
+ − 619
and a2: "b \<notin> (supp x) - (set bs)"
3058
+ − 620
shows "[bs]lst. x = [(a \<rightleftharpoons> b) \<bullet> bs]lst. ((a \<rightleftharpoons> b) \<bullet> x)"
2491
+ − 621
unfolding Abs_eq_iff
1662
+ − 622
unfolding alphas
+ − 623
unfolding supp_eqvt[symmetric] Diff_eqvt[symmetric] set_eqvt[symmetric]
+ − 624
unfolding fresh_star_def fresh_def
+ − 625
unfolding swap_set_not_in[OF a1 a2]
+ − 626
using a1 a2
+ − 627
by (rule_tac [!] x="(a \<rightleftharpoons> b)" in exI)
+ − 628
(auto simp add: supp_perm swap_atom)
+ − 629
2491
+ − 630
lemma Abs_supports:
3058
+ − 631
shows "((supp x) - as) supports ([as]set. x)"
+ − 632
and "((supp x) - as) supports ([as]res. x)"
+ − 633
and "((supp x) - set bs) supports ([bs]lst. x)"
1662
+ − 634
unfolding supports_def
2491
+ − 635
unfolding permute_Abs
+ − 636
by (simp_all add: Abs_swap1[symmetric] Abs_swap2[symmetric])
1657
+ − 637
1686
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 638
function
2469
+ − 639
supp_set :: "('a::pt) abs_set \<Rightarrow> atom set"
1686
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 640
where
3058
+ − 641
"supp_set ([as]set. x) = supp x - as"
2491
+ − 642
apply(case_tac x rule: Abs_exhausts(1))
1686
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 643
apply(simp)
2491
+ − 644
apply(simp add: Abs_eq_iff alphas_abs alphas)
1686
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 645
done
1657
+ − 646
2469
+ − 647
termination supp_set
3058
+ − 648
by lexicographic_order
1440
+ − 649
1686
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 650
function
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 651
supp_res :: "('a::pt) abs_res \<Rightarrow> atom set"
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 652
where
3058
+ − 653
"supp_res ([as]res. x) = supp x - as"
2491
+ − 654
apply(case_tac x rule: Abs_exhausts(2))
1686
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 655
apply(simp)
2491
+ − 656
apply(simp add: Abs_eq_iff alphas_abs alphas)
1686
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 657
done
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 658
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 659
termination supp_res
3058
+ − 660
by lexicographic_order
1440
+ − 661
1686
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 662
function
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 663
supp_lst :: "('a::pt) abs_lst \<Rightarrow> atom set"
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 664
where
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 665
"supp_lst (Abs_lst cs x) = (supp x) - (set cs)"
2491
+ − 666
apply(case_tac x rule: Abs_exhausts(3))
1686
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 667
apply(simp)
2491
+ − 668
apply(simp add: Abs_eq_iff alphas_abs alphas)
1686
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 669
done
1440
+ − 670
3058
+ − 671
termination supp_lst
+ − 672
by lexicographic_order
1686
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 673
2663
+ − 674
lemma supp_funs_eqvt[eqvt]:
2469
+ − 675
shows "(p \<bullet> supp_set x) = supp_set (p \<bullet> x)"
1657
+ − 676
and "(p \<bullet> supp_res y) = supp_res (p \<bullet> y)"
+ − 677
and "(p \<bullet> supp_lst z) = supp_lst (p \<bullet> z)"
2491
+ − 678
apply(case_tac x rule: Abs_exhausts(1))
1686
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 679
apply(simp add: supp_eqvt Diff_eqvt)
2491
+ − 680
apply(case_tac y rule: Abs_exhausts(2))
1686
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 681
apply(simp add: supp_eqvt Diff_eqvt)
2491
+ − 682
apply(case_tac z rule: Abs_exhausts(3))
1686
7b3dd407f6b3
got rid of the aux-function on the raw level, by defining it with function on the quotient level
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 683
apply(simp add: supp_eqvt Diff_eqvt set_eqvt)
1440
+ − 684
done
+ − 685
2491
+ − 686
lemma Abs_fresh_aux:
3058
+ − 687
shows "a \<sharp> [bs]set. x \<Longrightarrow> a \<sharp> supp_set ([bs]set. x)"
+ − 688
and "a \<sharp> [bs]res. x \<Longrightarrow> a \<sharp> supp_res ([bs]res. x)"
+ − 689
and "a \<sharp> [cs]lst. x \<Longrightarrow> a \<sharp> supp_lst ([cs]lst. x)"
1932
+ − 690
by (rule_tac [!] fresh_fun_eqvt_app)
2663
+ − 691
(auto simp only: eqvt_def eqvts_raw)
1657
+ − 692
2491
+ − 693
lemma Abs_supp_subset1:
1657
+ − 694
assumes a: "finite (supp x)"
3058
+ − 695
shows "(supp x) - as \<subseteq> supp ([as]set. x)"
+ − 696
and "(supp x) - as \<subseteq> supp ([as]res. x)"
+ − 697
and "(supp x) - (set bs) \<subseteq> supp ([bs]lst. x)"
1657
+ − 698
unfolding supp_conv_fresh
2491
+ − 699
by (auto dest!: Abs_fresh_aux)
1932
+ − 700
(simp_all add: fresh_def supp_finite_atom_set a)
1440
+ − 701
2491
+ − 702
lemma Abs_supp_subset2:
1657
+ − 703
assumes a: "finite (supp x)"
3058
+ − 704
shows "supp ([as]set. x) \<subseteq> (supp x) - as"
+ − 705
and "supp ([as]res. x) \<subseteq> (supp x) - as"
+ − 706
and "supp ([bs]lst. x) \<subseteq> (supp x) - (set bs)"
1932
+ − 707
by (rule_tac [!] supp_is_subset)
2491
+ − 708
(simp_all add: Abs_supports a)
1478
+ − 709
2491
+ − 710
lemma Abs_finite_supp:
1657
+ − 711
assumes a: "finite (supp x)"
3058
+ − 712
shows "supp ([as]set. x) = (supp x) - as"
+ − 713
and "supp ([as]res. x) = (supp x) - as"
+ − 714
and "supp ([bs]lst. x) = (supp x) - (set bs)"
+ − 715
using Abs_supp_subset1[OF a] Abs_supp_subset2[OF a]
+ − 716
by blast+
1440
+ − 717
2491
+ − 718
lemma supp_Abs:
1440
+ − 719
fixes x::"'a::fs"
3058
+ − 720
shows "supp ([as]set. x) = (supp x) - as"
+ − 721
and "supp ([as]res. x) = (supp x) - as"
+ − 722
and "supp ([bs]lst. x) = (supp x) - (set bs)"
+ − 723
by (simp_all add: Abs_finite_supp finite_supp)
1440
+ − 724
2469
+ − 725
instance abs_set :: (fs) fs
1440
+ − 726
apply(default)
2491
+ − 727
apply(case_tac x rule: Abs_exhausts(1))
+ − 728
apply(simp add: supp_Abs finite_supp)
1440
+ − 729
done
+ − 730
1657
+ − 731
instance abs_res :: (fs) fs
+ − 732
apply(default)
2491
+ − 733
apply(case_tac x rule: Abs_exhausts(2))
+ − 734
apply(simp add: supp_Abs finite_supp)
1657
+ − 735
done
+ − 736
+ − 737
instance abs_lst :: (fs) fs
+ − 738
apply(default)
2491
+ − 739
apply(case_tac x rule: Abs_exhausts(3))
+ − 740
apply(simp add: supp_Abs finite_supp)
1440
+ − 741
done
+ − 742
2491
+ − 743
lemma Abs_fresh_iff:
1657
+ − 744
fixes x::"'a::fs"
3058
+ − 745
shows "a \<sharp> [bs]set. x \<longleftrightarrow> a \<in> bs \<or> (a \<notin> bs \<and> a \<sharp> x)"
+ − 746
and "a \<sharp> [bs]res. x \<longleftrightarrow> a \<in> bs \<or> (a \<notin> bs \<and> a \<sharp> x)"
+ − 747
and "a \<sharp> [cs]lst. x \<longleftrightarrow> a \<in> (set cs) \<or> (a \<notin> (set cs) \<and> a \<sharp> x)"
1657
+ − 748
unfolding fresh_def
2491
+ − 749
unfolding supp_Abs
1657
+ − 750
by auto
1460
+ − 751
2591
+ − 752
lemma Abs_fresh_star_iff:
+ − 753
fixes x::"'a::fs"
3058
+ − 754
shows "as \<sharp>* ([bs]set. x) \<longleftrightarrow> (as - bs) \<sharp>* x"
+ − 755
and "as \<sharp>* ([bs]res. x) \<longleftrightarrow> (as - bs) \<sharp>* x"
+ − 756
and "as \<sharp>* ([cs]lst. x) \<longleftrightarrow> (as - set cs) \<sharp>* x"
2591
+ − 757
unfolding fresh_star_def
+ − 758
by (auto simp add: Abs_fresh_iff)
+ − 759
2491
+ − 760
lemma Abs_fresh_star:
+ − 761
fixes x::"'a::fs"
3058
+ − 762
shows "as \<subseteq> as' \<Longrightarrow> as \<sharp>* ([as']set. x)"
+ − 763
and "as \<subseteq> as' \<Longrightarrow> as \<sharp>* ([as']res. x)"
+ − 764
and "bs \<subseteq> set bs' \<Longrightarrow> bs \<sharp>* ([bs']lst. x)"
2491
+ − 765
unfolding fresh_star_def
2584
+ − 766
by(auto simp add: Abs_fresh_iff)
2468
+ − 767
2730
+ − 768
lemma Abs_fresh_star2:
+ − 769
fixes x::"'a::fs"
3058
+ − 770
shows "as \<inter> bs = {} \<Longrightarrow> as \<sharp>* ([bs]set. x) \<longleftrightarrow> as \<sharp>* x"
+ − 771
and "as \<inter> bs = {} \<Longrightarrow> as \<sharp>* ([bs]res. x) \<longleftrightarrow> as \<sharp>* x"
+ − 772
and "cs \<inter> set ds = {} \<Longrightarrow> cs \<sharp>* ([ds]lst. x) \<longleftrightarrow> cs \<sharp>* x"
2730
+ − 773
unfolding fresh_star_def Abs_fresh_iff
+ − 774
by auto
+ − 775
+ − 776
3058
+ − 777
section {* Abstractions of single atoms *}
+ − 778
2679
+ − 779
lemma Abs1_eq:
+ − 780
fixes x::"'a::fs"
+ − 781
shows "Abs_set {a} x = Abs_set {a} y \<longleftrightarrow> x = y"
+ − 782
and "Abs_res {a} x = Abs_res {a} y \<longleftrightarrow> x = y"
+ − 783
and "Abs_lst [c] x = Abs_lst [c] y \<longleftrightarrow> x = y"
+ − 784
unfolding Abs_eq_iff2 alphas
+ − 785
apply(simp_all add: supp_perm_singleton fresh_star_def fresh_zero_perm)
+ − 786
apply(blast)+
+ − 787
done
+ − 788
+ − 789
lemma Abs1_eq_iff:
+ − 790
fixes x::"'a::fs"
+ − 791
assumes "sort_of a = sort_of b"
+ − 792
and "sort_of c = sort_of d"
+ − 793
shows "Abs_set {a} x = Abs_set {b} y \<longleftrightarrow> (a = b \<and> x = y) \<or> (a \<noteq> b \<and> x = (a \<rightleftharpoons> b) \<bullet> y \<and> a \<sharp> y)"
+ − 794
and "Abs_res {a} x = Abs_res {b} y \<longleftrightarrow> (a = b \<and> x = y) \<or> (a \<noteq> b \<and> x = (a \<rightleftharpoons> b) \<bullet> y \<and> a \<sharp> y)"
+ − 795
and "Abs_lst [c] x = Abs_lst [d] y \<longleftrightarrow> (c = d \<and> x = y) \<or> (c \<noteq> d \<and> x = (c \<rightleftharpoons> d) \<bullet> y \<and> c \<sharp> y)"
+ − 796
proof -
+ − 797
{ assume "a = b"
2683
+ − 798
then have "Abs_set {a} x = Abs_set {b} y \<longleftrightarrow> (a = b \<and> x = y)" by (simp add: Abs1_eq)
2679
+ − 799
}
+ − 800
moreover
+ − 801
{ assume *: "a \<noteq> b" and **: "Abs_set {a} x = Abs_set {b} y"
+ − 802
have #: "a \<sharp> Abs_set {b} y" by (simp add: **[symmetric] Abs_fresh_iff)
+ − 803
have "Abs_set {a} ((a \<rightleftharpoons> b) \<bullet> y) = (a \<rightleftharpoons> b) \<bullet> (Abs_set {b} y)" by (simp add: permute_set_eq assms)
+ − 804
also have "\<dots> = Abs_set {b} y"
+ − 805
by (rule swap_fresh_fresh) (simp add: #, simp add: Abs_fresh_iff)
+ − 806
also have "\<dots> = Abs_set {a} x" using ** by simp
+ − 807
finally have "a \<noteq> b \<and> x = (a \<rightleftharpoons> b) \<bullet> y \<and> a \<sharp> y" using # * by (simp add: Abs1_eq Abs_fresh_iff)
+ − 808
}
+ − 809
moreover
+ − 810
{ assume *: "a \<noteq> b" and **: "x = (a \<rightleftharpoons> b) \<bullet> y \<and> a \<sharp> y"
+ − 811
have "Abs_set {a} x = Abs_set {a} ((a \<rightleftharpoons> b) \<bullet> y)" using ** by simp
+ − 812
also have "\<dots> = (a \<rightleftharpoons> b) \<bullet> Abs_set {b} y" by (simp add: permute_set_eq assms)
+ − 813
also have "\<dots> = Abs_set {b} y"
+ − 814
by (rule swap_fresh_fresh) (simp add: Abs_fresh_iff **, simp add: Abs_fresh_iff)
+ − 815
finally have "Abs_set {a} x = Abs_set {b} y" .
+ − 816
}
+ − 817
ultimately
+ − 818
show "Abs_set {a} x = Abs_set {b} y \<longleftrightarrow> (a = b \<and> x = y) \<or> (a \<noteq> b \<and> x = (a \<rightleftharpoons> b) \<bullet> y \<and> a \<sharp> y)"
+ − 819
by blast
+ − 820
next
+ − 821
{ assume "a = b"
2683
+ − 822
then have "Abs_res {a} x = Abs_res {b} y \<longleftrightarrow> (a = b \<and> x = y)" by (simp add: Abs1_eq)
2679
+ − 823
}
+ − 824
moreover
+ − 825
{ assume *: "a \<noteq> b" and **: "Abs_res {a} x = Abs_res {b} y"
+ − 826
have #: "a \<sharp> Abs_res {b} y" by (simp add: **[symmetric] Abs_fresh_iff)
+ − 827
have "Abs_res {a} ((a \<rightleftharpoons> b) \<bullet> y) = (a \<rightleftharpoons> b) \<bullet> (Abs_res {b} y)" by (simp add: permute_set_eq assms)
+ − 828
also have "\<dots> = Abs_res {b} y"
+ − 829
by (rule swap_fresh_fresh) (simp add: #, simp add: Abs_fresh_iff)
+ − 830
also have "\<dots> = Abs_res {a} x" using ** by simp
+ − 831
finally have "a \<noteq> b \<and> x = (a \<rightleftharpoons> b) \<bullet> y \<and> a \<sharp> y" using # * by (simp add: Abs1_eq Abs_fresh_iff)
+ − 832
}
+ − 833
moreover
+ − 834
{ assume *: "a \<noteq> b" and **: "x = (a \<rightleftharpoons> b) \<bullet> y \<and> a \<sharp> y"
+ − 835
have "Abs_res {a} x = Abs_res {a} ((a \<rightleftharpoons> b) \<bullet> y)" using ** by simp
+ − 836
also have "\<dots> = (a \<rightleftharpoons> b) \<bullet> Abs_res {b} y" by (simp add: permute_set_eq assms)
+ − 837
also have "\<dots> = Abs_res {b} y"
+ − 838
by (rule swap_fresh_fresh) (simp add: Abs_fresh_iff **, simp add: Abs_fresh_iff)
+ − 839
finally have "Abs_res {a} x = Abs_res {b} y" .
+ − 840
}
+ − 841
ultimately
+ − 842
show "Abs_res {a} x = Abs_res {b} y \<longleftrightarrow> (a = b \<and> x = y) \<or> (a \<noteq> b \<and> x = (a \<rightleftharpoons> b) \<bullet> y \<and> a \<sharp> y)"
+ − 843
by blast
+ − 844
next
+ − 845
{ assume "c = d"
2683
+ − 846
then have "Abs_lst [c] x = Abs_lst [d] y \<longleftrightarrow> (c = d \<and> x = y)" by (simp add: Abs1_eq)
2679
+ − 847
}
+ − 848
moreover
+ − 849
{ assume *: "c \<noteq> d" and **: "Abs_lst [c] x = Abs_lst [d] y"
+ − 850
have #: "c \<sharp> Abs_lst [d] y" by (simp add: **[symmetric] Abs_fresh_iff)
+ − 851
have "Abs_lst [c] ((c \<rightleftharpoons> d) \<bullet> y) = (c \<rightleftharpoons> d) \<bullet> (Abs_lst [d] y)" by (simp add: assms)
+ − 852
also have "\<dots> = Abs_lst [d] y"
+ − 853
by (rule swap_fresh_fresh) (simp add: #, simp add: Abs_fresh_iff)
+ − 854
also have "\<dots> = Abs_lst [c] x" using ** by simp
+ − 855
finally have "c \<noteq> d \<and> x = (c \<rightleftharpoons> d) \<bullet> y \<and> c \<sharp> y" using # * by (simp add: Abs1_eq Abs_fresh_iff)
+ − 856
}
+ − 857
moreover
+ − 858
{ assume *: "c \<noteq> d" and **: "x = (c \<rightleftharpoons> d) \<bullet> y \<and> c \<sharp> y"
+ − 859
have "Abs_lst [c] x = Abs_lst [c] ((c \<rightleftharpoons> d) \<bullet> y)" using ** by simp
+ − 860
also have "\<dots> = (c \<rightleftharpoons> d) \<bullet> Abs_lst [d] y" by (simp add: assms)
+ − 861
also have "\<dots> = Abs_lst [d] y"
+ − 862
by (rule swap_fresh_fresh) (simp add: Abs_fresh_iff **, simp add: Abs_fresh_iff)
+ − 863
finally have "Abs_lst [c] x = Abs_lst [d] y" .
+ − 864
}
+ − 865
ultimately
+ − 866
show "Abs_lst [c] x = Abs_lst [d] y \<longleftrightarrow> (c = d \<and> x = y) \<or> (c \<noteq> d \<and> x = (c \<rightleftharpoons> d) \<bullet> y \<and> c \<sharp> y)"
+ − 867
by blast
+ − 868
qed
+ − 869
2683
+ − 870
lemma Abs1_eq_iff':
+ − 871
fixes x::"'a::fs"
+ − 872
assumes "sort_of a = sort_of b"
+ − 873
and "sort_of c = sort_of d"
+ − 874
shows "Abs_set {a} x = Abs_set {b} y \<longleftrightarrow> (a = b \<and> x = y) \<or> (a \<noteq> b \<and> (b \<rightleftharpoons> a) \<bullet> x = y \<and> b \<sharp> x)"
+ − 875
and "Abs_res {a} x = Abs_res {b} y \<longleftrightarrow> (a = b \<and> x = y) \<or> (a \<noteq> b \<and> (b \<rightleftharpoons> a) \<bullet> x = y \<and> b \<sharp> x)"
+ − 876
and "Abs_lst [c] x = Abs_lst [d] y \<longleftrightarrow> (c = d \<and> x = y) \<or> (c \<noteq> d \<and> (d \<rightleftharpoons> c) \<bullet> x = y \<and> d \<sharp> x)"
+ − 877
using assms by (auto simp add: Abs1_eq_iff fresh_permute_left)
+ − 878
2468
+ − 879
2599
+ − 880
subsection {* Renaming of bodies of abstractions *}
+ − 881
+ − 882
lemma Abs_rename_set:
+ − 883
fixes x::"'a::fs"
2659
+ − 884
assumes a: "(p \<bullet> bs) \<sharp>* x"
3060
+ − 885
(*and b: "finite bs"*)
2616
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 886
shows "\<exists>q. [bs]set. x = [p \<bullet> bs]set. (q \<bullet> x) \<and> q \<bullet> bs = p \<bullet> bs"
2599
+ − 887
proof -
3058
+ − 888
from set_renaming_perm2
2668
+ − 889
obtain q where *: "\<forall>b \<in> bs. q \<bullet> b = p \<bullet> b" and **: "supp q \<subseteq> bs \<union> (p \<bullet> bs)" by blast
3060
+ − 890
have ***: "q \<bullet> bs = p \<bullet> bs" using *
+ − 891
unfolding permute_set_eq_image image_def by auto
2599
+ − 892
have "[bs]set. x = q \<bullet> ([bs]set. x)"
+ − 893
apply(rule perm_supp_eq[symmetric])
+ − 894
using a **
+ − 895
unfolding Abs_fresh_star_iff
+ − 896
unfolding fresh_star_def
+ − 897
by auto
+ − 898
also have "\<dots> = [q \<bullet> bs]set. (q \<bullet> x)" by simp
2668
+ − 899
finally have "[bs]set. x = [p \<bullet> bs]set. (q \<bullet> x)" by (simp add: ***)
+ − 900
then show "\<exists>q. [bs]set. x = [p \<bullet> bs]set. (q \<bullet> x) \<and> q \<bullet> bs = p \<bullet> bs" using *** by metis
2599
+ − 901
qed
+ − 902
+ − 903
lemma Abs_rename_res:
+ − 904
fixes x::"'a::fs"
2659
+ − 905
assumes a: "(p \<bullet> bs) \<sharp>* x"
3060
+ − 906
(*and b: "finite bs"*)
2616
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 907
shows "\<exists>q. [bs]res. x = [p \<bullet> bs]res. (q \<bullet> x) \<and> q \<bullet> bs = p \<bullet> bs"
2599
+ − 908
proof -
3058
+ − 909
from set_renaming_perm2
2668
+ − 910
obtain q where *: "\<forall>b \<in> bs. q \<bullet> b = p \<bullet> b" and **: "supp q \<subseteq> bs \<union> (p \<bullet> bs)" by blast
3060
+ − 911
have ***: "q \<bullet> bs = p \<bullet> bs" using *
+ − 912
unfolding permute_set_eq_image image_def by auto
2599
+ − 913
have "[bs]res. x = q \<bullet> ([bs]res. x)"
+ − 914
apply(rule perm_supp_eq[symmetric])
+ − 915
using a **
+ − 916
unfolding Abs_fresh_star_iff
+ − 917
unfolding fresh_star_def
+ − 918
by auto
+ − 919
also have "\<dots> = [q \<bullet> bs]res. (q \<bullet> x)" by simp
2668
+ − 920
finally have "[bs]res. x = [p \<bullet> bs]res. (q \<bullet> x)" by (simp add: ***)
+ − 921
then show "\<exists>q. [bs]res. x = [p \<bullet> bs]res. (q \<bullet> x) \<and> q \<bullet> bs = p \<bullet> bs" using *** by metis
2599
+ − 922
qed
+ − 923
2611
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 924
lemma Abs_rename_lst:
2599
+ − 925
fixes x::"'a::fs"
2659
+ − 926
assumes a: "(p \<bullet> (set bs)) \<sharp>* x"
2616
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 927
shows "\<exists>q. [bs]lst. x = [p \<bullet> bs]lst. (q \<bullet> x) \<and> q \<bullet> bs = p \<bullet> bs"
2599
+ − 928
proof -
3058
+ − 929
from list_renaming_perm
2668
+ − 930
obtain q where *: "\<forall>b \<in> set bs. q \<bullet> b = p \<bullet> b" and **: "supp q \<subseteq> set bs \<union> (p \<bullet> set bs)" by blast
+ − 931
have ***: "q \<bullet> bs = p \<bullet> bs" using * by (induct bs) (simp_all add: insert_eqvt)
2599
+ − 932
have "[bs]lst. x = q \<bullet> ([bs]lst. x)"
+ − 933
apply(rule perm_supp_eq[symmetric])
+ − 934
using a **
+ − 935
unfolding Abs_fresh_star_iff
+ − 936
unfolding fresh_star_def
+ − 937
by auto
+ − 938
also have "\<dots> = [q \<bullet> bs]lst. (q \<bullet> x)" by simp
2668
+ − 939
finally have "[bs]lst. x = [p \<bullet> bs]lst. (q \<bullet> x)" by (simp add: ***)
+ − 940
then show "\<exists>q. [bs]lst. x = [p \<bullet> bs]lst. (q \<bullet> x) \<and> q \<bullet> bs = p \<bullet> bs" using *** by metis
2599
+ − 941
qed
+ − 942
+ − 943
2616
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 944
text {* for deep recursive binders *}
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 945
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 946
lemma Abs_rename_set':
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 947
fixes x::"'a::fs"
2659
+ − 948
assumes a: "(p \<bullet> bs) \<sharp>* x"
3060
+ − 949
(*and b: "finite bs"*)
2616
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 950
shows "\<exists>q. [bs]set. x = [q \<bullet> bs]set. (q \<bullet> x) \<and> q \<bullet> bs = p \<bullet> bs"
3060
+ − 951
using Abs_rename_set[OF a] by metis
2616
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 952
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 953
lemma Abs_rename_res':
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 954
fixes x::"'a::fs"
2659
+ − 955
assumes a: "(p \<bullet> bs) \<sharp>* x"
3060
+ − 956
(*and b: "finite bs"*)
2616
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 957
shows "\<exists>q. [bs]res. x = [q \<bullet> bs]res. (q \<bullet> x) \<and> q \<bullet> bs = p \<bullet> bs"
3060
+ − 958
using Abs_rename_res[OF a] by metis
2616
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 959
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 960
lemma Abs_rename_lst':
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 961
fixes x::"'a::fs"
2659
+ − 962
assumes a: "(p \<bullet> (set bs)) \<sharp>* x"
2616
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 963
shows "\<exists>q. [bs]lst. x = [q \<bullet> bs]lst. (q \<bullet> x) \<and> q \<bullet> bs = p \<bullet> bs"
dd7490fdd998
all examples for strong exhausts work; recursive binders need to be treated differently; still unclean version with lots of diagnostic code
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 964
using Abs_rename_lst[OF a] by metis
2599
+ − 965
2468
+ − 966
section {* Infrastructure for building tuples of relations and functions *}
+ − 967
2385
+ − 968
fun
+ − 969
prod_fv :: "('a \<Rightarrow> atom set) \<Rightarrow> ('b \<Rightarrow> atom set) \<Rightarrow> ('a \<times> 'b) \<Rightarrow> atom set"
+ − 970
where
+ − 971
"prod_fv fv1 fv2 (x, y) = fv1 x \<union> fv2 y"
+ − 972
+ − 973
definition
+ − 974
prod_alpha :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('b \<Rightarrow> 'b \<Rightarrow> bool) \<Rightarrow> ('a \<times> 'b \<Rightarrow> 'a \<times> 'b \<Rightarrow> bool)"
+ − 975
where
+ − 976
"prod_alpha = prod_rel"
+ − 977
+ − 978
lemma [quot_respect]:
+ − 979
shows "((R1 ===> op =) ===> (R2 ===> op =) ===> prod_rel R1 R2 ===> op =) prod_fv prod_fv"
2559
add799cf0817
adapted to changes by Florian on the quotient package and removed local fix for function package
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 980
unfolding fun_rel_def
add799cf0817
adapted to changes by Florian on the quotient package and removed local fix for function package
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 981
unfolding prod_rel_def
2385
+ − 982
by auto
+ − 983
+ − 984
lemma [quot_preserve]:
+ − 985
assumes q1: "Quotient R1 abs1 rep1"
+ − 986
and q2: "Quotient R2 abs2 rep2"
2574
+ − 987
shows "((abs1 ---> id) ---> (abs2 ---> id) ---> map_pair rep1 rep2 ---> id) prod_fv = prod_fv"
2479
+ − 988
by (simp add: fun_eq_iff Quotient_abs_rep[OF q1] Quotient_abs_rep[OF q2])
2385
+ − 989
+ − 990
lemma [mono]:
+ − 991
shows "A <= B \<Longrightarrow> C <= D ==> prod_alpha A C <= prod_alpha B D"
+ − 992
unfolding prod_alpha_def
+ − 993
by auto
+ − 994
+ − 995
lemma [eqvt]:
+ − 996
shows "p \<bullet> prod_alpha A B x y = prod_alpha (p \<bullet> A) (p \<bullet> B) (p \<bullet> x) (p \<bullet> y)"
+ − 997
unfolding prod_alpha_def
2559
add799cf0817
adapted to changes by Florian on the quotient package and removed local fix for function package
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 998
unfolding prod_rel_def
2385
+ − 999
by (perm_simp) (rule refl)
+ − 1000
+ − 1001
lemma [eqvt]:
+ − 1002
shows "p \<bullet> prod_fv A B (x, y) = prod_fv (p \<bullet> A) (p \<bullet> B) (p \<bullet> x, p \<bullet> y)"
+ − 1003
unfolding prod_fv.simps
+ − 1004
by (perm_simp) (rule refl)
+ − 1005
2489
+ − 1006
lemma prod_fv_supp:
+ − 1007
shows "prod_fv supp supp = supp"
+ − 1008
by (rule ext)
+ − 1009
(auto simp add: prod_fv.simps supp_Pair)
+ − 1010
+ − 1011
lemma prod_alpha_eq:
+ − 1012
shows "prod_alpha (op=) (op=) = (op=)"
2843
+ − 1013
unfolding prod_alpha_def
+ − 1014
by (auto intro!: ext)
+ − 1015
2385
+ − 1016
1440
+ − 1017
end
+ − 1018