1436
+ − 1
theory Abs_res
1128
+ − 2
imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "../Quotient" "../Quotient_Product"
984
+ − 3
begin
+ − 4
1006
+ − 5
fun
+ − 6
alpha_gen
984
+ − 7
where
1006
+ − 8
alpha_gen[simp del]:
1089
+ − 9
"alpha_gen (bs, x) R f pi (cs, y) \<longleftrightarrow> f x - bs = f y - cs \<and> (f x - bs) \<sharp>* pi \<and> R (pi \<bullet> x) y"
995
ee0619b5adff
introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 10
ee0619b5adff
introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 11
notation
1026
+ − 12
alpha_gen ("_ \<approx>gen _ _ _ _" [100, 100, 100, 100, 100] 100)
995
ee0619b5adff
introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 13
1005
9d5d9e7ff71b
Monotonicity of ~~gen, needed for using it in inductive definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 14
lemma [mono]: "R1 \<le> R2 \<Longrightarrow> alpha_gen x R1 \<le> alpha_gen x R2"
9d5d9e7ff71b
Monotonicity of ~~gen, needed for using it in inductive definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 15
by (cases x) (auto simp add: le_fun_def le_bool_def alpha_gen.simps)
9d5d9e7ff71b
Monotonicity of ~~gen, needed for using it in inductive definitions.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 16
995
ee0619b5adff
introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 17
lemma alpha_gen_refl:
ee0619b5adff
introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 18
assumes a: "R x x"
ee0619b5adff
introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 19
shows "(bs, x) \<approx>gen R f 0 (bs, x)"
ee0619b5adff
introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 20
using a by (simp add: alpha_gen fresh_star_def fresh_zero_perm)
ee0619b5adff
introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 21
ee0619b5adff
introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 22
lemma alpha_gen_sym:
ee0619b5adff
introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 23
assumes a: "(bs, x) \<approx>gen R f p (cs, y)"
ee0619b5adff
introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 24
and b: "R (p \<bullet> x) y \<Longrightarrow> R (- p \<bullet> y) x"
ee0619b5adff
introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 25
shows "(cs, y) \<approx>gen R f (- p) (bs, x)"
ee0619b5adff
introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 26
using a b by (simp add: alpha_gen fresh_star_def fresh_def supp_minus_perm)
ee0619b5adff
introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 27
1095
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 28
lemma alpha_gen_trans:
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 29
assumes a: "(bs, x) \<approx>gen R f p1 (cs, y)"
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 30
and b: "(cs, y) \<approx>gen R f p2 (ds, z)"
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 31
and c: "\<lbrakk>R (p1 \<bullet> x) y; R (p2 \<bullet> y) z\<rbrakk> \<Longrightarrow> R ((p2 + p1) \<bullet> x) z"
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 32
shows "(bs, x) \<approx>gen R f (p2 + p1) (ds, z)"
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 33
using a b c using supp_plus_perm
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 34
apply(simp add: alpha_gen fresh_star_def fresh_def)
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 35
apply(blast)
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 36
done
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 37
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 38
lemma alpha_gen_eqvt:
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 39
assumes a: "(bs, x) \<approx>gen R f q (cs, y)"
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 40
and b: "R (q \<bullet> x) y \<Longrightarrow> R (p \<bullet> (q \<bullet> x)) (p \<bullet> y)"
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 41
and c: "p \<bullet> (f x) = f (p \<bullet> x)"
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 42
and d: "p \<bullet> (f y) = f (p \<bullet> y)"
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 43
shows "(p \<bullet> bs, p \<bullet> x) \<approx>gen R f (p \<bullet> q) (p \<bullet> cs, p \<bullet> y)"
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 44
using a b
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 45
apply(simp add: alpha_gen c[symmetric] d[symmetric] Diff_eqvt[symmetric])
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 46
apply(simp add: permute_eqvt[symmetric])
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 47
apply(simp add: fresh_star_permute_iff)
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 48
apply(clarsimp)
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 49
done
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 50
1210
+ − 51
lemma alpha_gen_compose_sym:
1301
+ − 52
fixes pi
+ − 53
assumes b: "(aa, t) \<approx>gen (\<lambda>x1 x2. R x1 x2 \<and> R x2 x1) f pi (ab, s)"
1210
+ − 54
and a: "\<And>pi t s. (R t s \<Longrightarrow> R (pi \<bullet> t) (pi \<bullet> s))"
1301
+ − 55
shows "(ab, s) \<approx>gen R f (- pi) (aa, t)"
1210
+ − 56
using b apply -
1021
+ − 57
apply(simp add: alpha_gen.simps)
+ − 58
apply(erule conjE)+
+ − 59
apply(rule conjI)
+ − 60
apply(simp add: fresh_star_def fresh_minus_perm)
+ − 61
apply(subgoal_tac "R (- pi \<bullet> s) ((- pi) \<bullet> (pi \<bullet> t))")
+ − 62
apply simp
+ − 63
apply(rule a)
+ − 64
apply assumption
+ − 65
done
+ − 66
1210
+ − 67
lemma alpha_gen_compose_trans:
1301
+ − 68
fixes pi pia
+ − 69
assumes b: "(aa, t) \<approx>gen (\<lambda>x1 x2. R x1 x2 \<and> (\<forall>x. R x2 x \<longrightarrow> R x1 x)) f pi (ab, ta)"
+ − 70
and c: "(ab, ta) \<approx>gen R f pia (ac, sa)"
1210
+ − 71
and a: "\<And>pi t s. (R t s \<Longrightarrow> R (pi \<bullet> t) (pi \<bullet> s))"
1301
+ − 72
shows "(aa, t) \<approx>gen R f (pia + pi) (ac, sa)"
1210
+ − 73
using b c apply -
1021
+ − 74
apply(simp add: alpha_gen.simps)
+ − 75
apply(erule conjE)+
+ − 76
apply(simp add: fresh_star_plus)
+ − 77
apply(drule_tac x="- pia \<bullet> sa" in spec)
+ − 78
apply(drule mp)
+ − 79
apply(rotate_tac 4)
+ − 80
apply(drule_tac pi="- pia" in a)
+ − 81
apply(simp)
+ − 82
apply(rotate_tac 6)
+ − 83
apply(drule_tac pi="pia" in a)
+ − 84
apply(simp)
+ − 85
done
+ − 86
1255
+ − 87
lemma alpha_gen_compose_eqvt:
1300
+ − 88
fixes pia
+ − 89
assumes b: "(g d, t) \<approx>gen (\<lambda>x1 x2. R x1 x2 \<and> R (pi \<bullet> x1) (pi \<bullet> x2)) f pia (g e, s)"
1255
+ − 90
and c: "\<And>y. pi \<bullet> (g y) = g (pi \<bullet> y)"
+ − 91
and a: "\<And>x. pi \<bullet> (f x) = f (pi \<bullet> x)"
1300
+ − 92
shows "(g (pi \<bullet> d), pi \<bullet> t) \<approx>gen R f (pi \<bullet> pia) (g (pi \<bullet> e), pi \<bullet> s)"
1255
+ − 93
using b
1039
+ − 94
apply -
1024
+ − 95
apply(simp add: alpha_gen.simps)
+ − 96
apply(erule conjE)+
1034
+ − 97
apply(rule conjI)
1024
+ − 98
apply(rule_tac ?p1="- pi" in permute_eq_iff[THEN iffD1])
1255
+ − 99
apply(simp add: a[symmetric] atom_eqvt Diff_eqvt insert_eqvt set_eqvt empty_eqvt c[symmetric])
1024
+ − 100
apply(rule conjI)
+ − 101
apply(rule_tac ?p1="- pi" in fresh_star_permute_iff[THEN iffD1])
1255
+ − 102
apply(simp add: a[symmetric] atom_eqvt Diff_eqvt insert_eqvt set_eqvt empty_eqvt c[symmetric])
1024
+ − 103
apply(subst permute_eqvt[symmetric])
+ − 104
apply(simp)
+ − 105
done
+ − 106
995
ee0619b5adff
introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 107
fun
1007
+ − 108
alpha_abs
995
ee0619b5adff
introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 109
where
1007
+ − 110
"alpha_abs (bs, x) (cs, y) = (\<exists>p. (bs, x) \<approx>gen (op=) supp p (cs, y))"
986
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 111
1006
+ − 112
notation
1007
+ − 113
alpha_abs ("_ \<approx>abs _")
984
+ − 114
1014
+ − 115
lemma alpha_abs_swap:
986
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 116
assumes a1: "a \<notin> (supp x) - bs"
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 117
and a2: "b \<notin> (supp x) - bs"
1007
+ − 118
shows "(bs, x) \<approx>abs ((a \<rightleftharpoons> b) \<bullet> bs, (a \<rightleftharpoons> b) \<bullet> x)"
1014
+ − 119
apply(simp)
+ − 120
apply(rule_tac x="(a \<rightleftharpoons> b)" in exI)
+ − 121
apply(simp add: alpha_gen)
+ − 122
apply(simp add: supp_eqvt[symmetric] Diff_eqvt[symmetric])
+ − 123
apply(simp add: swap_set_not_in[OF a1 a2])
+ − 124
apply(subgoal_tac "supp (a \<rightleftharpoons> b) \<subseteq> {a, b}")
+ − 125
using a1 a2
+ − 126
apply(simp add: fresh_star_def fresh_def)
+ − 127
apply(blast)
+ − 128
apply(simp add: supp_swap)
+ − 129
done
986
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 130
1436
+ − 131
lemma alpha_gen_swap_fun:
+ − 132
assumes f_eqvt: "\<And>pi. (pi \<bullet> (f x)) = f (pi \<bullet> x)"
+ − 133
assumes a1: "a \<notin> (f x) - bs"
+ − 134
and a2: "b \<notin> (f x) - bs"
+ − 135
shows "\<exists>pi. (bs, x) \<approx>gen (op=) f pi ((a \<rightleftharpoons> b) \<bullet> bs, (a \<rightleftharpoons> b) \<bullet> x)"
+ − 136
apply(rule_tac x="(a \<rightleftharpoons> b)" in exI)
+ − 137
apply(simp add: alpha_gen)
+ − 138
apply(simp add: f_eqvt[symmetric] Diff_eqvt[symmetric])
+ − 139
apply(simp add: swap_set_not_in[OF a1 a2])
+ − 140
apply(subgoal_tac "supp (a \<rightleftharpoons> b) \<subseteq> {a, b}")
+ − 141
using a1 a2
+ − 142
apply(simp add: fresh_star_def fresh_def)
+ − 143
apply(blast)
+ − 144
apply(simp add: supp_swap)
+ − 145
done
+ − 146
+ − 147
986
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 148
fun
1014
+ − 149
supp_abs_fun
986
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 150
where
1014
+ − 151
"supp_abs_fun (bs, x) = (supp x) - bs"
986
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 152
1014
+ − 153
lemma supp_abs_fun_lemma:
1007
+ − 154
assumes a: "x \<approx>abs y"
1014
+ − 155
shows "supp_abs_fun x = supp_abs_fun y"
+ − 156
using a
+ − 157
apply(induct rule: alpha_abs.induct)
+ − 158
apply(simp add: alpha_gen)
+ − 159
done
986
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 160
1007
+ − 161
quotient_type 'a abs = "(atom set \<times> 'a::pt)" / "alpha_abs"
986
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 162
apply(rule equivpI)
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 163
unfolding reflp_def symp_def transp_def
1006
+ − 164
apply(simp_all)
1089
+ − 165
(* refl *)
1006
+ − 166
apply(clarify)
+ − 167
apply(rule exI)
+ − 168
apply(rule alpha_gen_refl)
+ − 169
apply(simp)
1089
+ − 170
(* symm *)
1006
+ − 171
apply(clarify)
+ − 172
apply(rule exI)
+ − 173
apply(rule alpha_gen_sym)
+ − 174
apply(assumption)
+ − 175
apply(clarsimp)
1089
+ − 176
(* trans *)
1006
+ − 177
apply(clarify)
+ − 178
apply(rule exI)
+ − 179
apply(rule alpha_gen_trans)
+ − 180
apply(assumption)
+ − 181
apply(assumption)
+ − 182
apply(simp)
986
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 183
done
984
+ − 184
+ − 185
quotient_definition
1139
+ − 186
"Abs::atom set \<Rightarrow> ('a::pt) \<Rightarrow> 'a abs"
+ − 187
is
+ − 188
"Pair::atom set \<Rightarrow> ('a::pt) \<Rightarrow> (atom set \<times> 'a)"
984
+ − 189
+ − 190
lemma [quot_respect]:
1007
+ − 191
shows "((op =) ===> (op =) ===> alpha_abs) Pair Pair"
1014
+ − 192
apply(clarsimp)
+ − 193
apply(rule exI)
+ − 194
apply(rule alpha_gen_refl)
+ − 195
apply(simp)
+ − 196
done
984
+ − 197
+ − 198
lemma [quot_respect]:
1007
+ − 199
shows "((op =) ===> alpha_abs ===> alpha_abs) permute permute"
1014
+ − 200
apply(clarsimp)
+ − 201
apply(rule exI)
+ − 202
apply(rule alpha_gen_eqvt)
+ − 203
apply(assumption)
+ − 204
apply(simp_all add: supp_eqvt)
+ − 205
done
986
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 206
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 207
lemma [quot_respect]:
1014
+ − 208
shows "(alpha_abs ===> (op =)) supp_abs_fun supp_abs_fun"
+ − 209
apply(simp add: supp_abs_fun_lemma)
+ − 210
done
984
+ − 211
1007
+ − 212
lemma abs_induct:
+ − 213
"\<lbrakk>\<And>as (x::'a::pt). P (Abs as x)\<rbrakk> \<Longrightarrow> P t"
1014
+ − 214
apply(lifting prod.induct[where 'a="atom set" and 'b="'a"])
+ − 215
done
984
+ − 216
1089
+ − 217
(* TEST case *)
+ − 218
lemmas abs_induct2 = prod.induct[where 'a="atom set" and 'b="'a::pt", quot_lifted]
+ − 219
thm abs_induct abs_induct2
+ − 220
1007
+ − 221
instantiation abs :: (pt) pt
984
+ − 222
begin
+ − 223
+ − 224
quotient_definition
1007
+ − 225
"permute_abs::perm \<Rightarrow> ('a::pt abs) \<Rightarrow> 'a abs"
1139
+ − 226
is
1006
+ − 227
"permute:: perm \<Rightarrow> (atom set \<times> 'a::pt) \<Rightarrow> (atom set \<times> 'a::pt)"
984
+ − 228
+ − 229
lemma permute_ABS [simp]:
995
ee0619b5adff
introduced a generic alpha (but not sure whether it is helpful)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 230
fixes x::"'a::pt" (* ??? has to be 'a \<dots> 'b does not work *)
1007
+ − 231
shows "(p \<bullet> (Abs as x)) = Abs (p \<bullet> as) (p \<bullet> x)"
1014
+ − 232
by (lifting permute_prod.simps(1)[where 'a="atom set" and 'b="'a"])
984
+ − 233
+ − 234
instance
+ − 235
apply(default)
1007
+ − 236
apply(induct_tac [!] x rule: abs_induct)
984
+ − 237
apply(simp_all)
+ − 238
done
+ − 239
+ − 240
end
986
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 241
1014
+ − 242
quotient_definition
+ − 243
"supp_Abs_fun :: ('a::pt) abs \<Rightarrow> atom \<Rightarrow> bool"
1139
+ − 244
is
1014
+ − 245
"supp_abs_fun"
+ − 246
+ − 247
lemma supp_Abs_fun_simp:
+ − 248
shows "supp_Abs_fun (Abs bs x) = (supp x) - bs"
+ − 249
by (lifting supp_abs_fun.simps(1))
+ − 250
1095
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 251
lemma supp_Abs_fun_eqvt [eqvt]:
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 252
shows "(p \<bullet> supp_Abs_fun x) = supp_Abs_fun (p \<bullet> x)"
1014
+ − 253
apply(induct_tac x rule: abs_induct)
+ − 254
apply(simp add: supp_Abs_fun_simp supp_eqvt Diff_eqvt)
+ − 255
done
+ − 256
+ − 257
lemma supp_Abs_fun_fresh:
+ − 258
shows "a \<sharp> Abs bs x \<Longrightarrow> a \<sharp> supp_Abs_fun (Abs bs x)"
+ − 259
apply(rule fresh_fun_eqvt_app)
1095
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 260
apply(simp add: eqvts_raw)
1014
+ − 261
apply(simp)
+ − 262
done
+ − 263
+ − 264
lemma Abs_swap:
986
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 265
assumes a1: "a \<notin> (supp x) - bs"
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 266
and a2: "b \<notin> (supp x) - bs"
1007
+ − 267
shows "(Abs bs x) = (Abs ((a \<rightleftharpoons> b) \<bullet> bs) ((a \<rightleftharpoons> b) \<bullet> x))"
1014
+ − 268
using a1 a2 by (lifting alpha_abs_swap)
986
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 269
1007
+ − 270
lemma Abs_supports:
+ − 271
shows "((supp x) - as) supports (Abs as x)"
1014
+ − 272
unfolding supports_def
+ − 273
apply(clarify)
+ − 274
apply(simp (no_asm))
+ − 275
apply(subst Abs_swap[symmetric])
+ − 276
apply(simp_all)
+ − 277
done
986
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 278
1014
+ − 279
lemma supp_Abs_subset1:
+ − 280
fixes x::"'a::fs"
+ − 281
shows "(supp x) - as \<subseteq> supp (Abs as x)"
+ − 282
apply(simp add: supp_conv_fresh)
+ − 283
apply(auto)
+ − 284
apply(drule_tac supp_Abs_fun_fresh)
+ − 285
apply(simp only: supp_Abs_fun_simp)
+ − 286
apply(simp add: fresh_def)
+ − 287
apply(simp add: supp_finite_atom_set finite_supp)
+ − 288
done
1006
+ − 289
1014
+ − 290
lemma supp_Abs_subset2:
986
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 291
fixes x::"'a::fs"
1014
+ − 292
shows "supp (Abs as x) \<subseteq> (supp x) - as"
+ − 293
apply(rule supp_is_subset)
+ − 294
apply(rule Abs_supports)
+ − 295
apply(simp add: finite_supp)
+ − 296
done
986
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 297
1007
+ − 298
lemma supp_Abs:
986
98375dde48fc
general abstraction operator and complete characterisation of its support and freshness
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 299
fixes x::"'a::fs"
1007
+ − 300
shows "supp (Abs as x) = (supp x) - as"
1014
+ − 301
apply(rule_tac subset_antisym)
+ − 302
apply(rule supp_Abs_subset2)
+ − 303
apply(rule supp_Abs_subset1)
+ − 304
done
984
+ − 305
1007
+ − 306
instance abs :: (fs) fs
1014
+ − 307
apply(default)
+ − 308
apply(induct_tac x rule: abs_induct)
+ − 309
apply(simp add: supp_Abs)
+ − 310
apply(simp add: finite_supp)
+ − 311
done
984
+ − 312
1014
+ − 313
lemma Abs_fresh_iff:
984
+ − 314
fixes x::"'a::fs"
1095
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 315
shows "a \<sharp> Abs bs x \<longleftrightarrow> a \<in> bs \<or> (a \<notin> bs \<and> a \<sharp> x)"
1014
+ − 316
apply(simp add: fresh_def)
+ − 317
apply(simp add: supp_Abs)
+ − 318
apply(auto)
+ − 319
done
984
+ − 320
1014
+ − 321
lemma Abs_eq_iff:
1095
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 322
shows "Abs bs x = Abs cs y \<longleftrightarrow> (\<exists>p. (bs, x) \<approx>gen (op =) supp p (cs, y))"
1014
+ − 323
by (lifting alpha_abs.simps(1))
984
+ − 324
1015
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 325
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 326
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 327
(*
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 328
below is a construction site for showing that in the
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 329
single-binder case, the old and new alpha equivalence
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 330
coincide
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 331
*)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 332
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 333
fun
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 334
alpha1
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 335
where
1095
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 336
"alpha1 (a, x) (b, y) \<longleftrightarrow> (a = b \<and> x = y) \<or> (a \<noteq> b \<and> x = (a \<rightleftharpoons> b) \<bullet> y \<and> a \<sharp> y)"
1015
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 337
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 338
notation
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 339
alpha1 ("_ \<approx>abs1 _")
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 340
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 341
fun
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 342
alpha2
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 343
where
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 344
"alpha2 (a, x) (b, y) \<longleftrightarrow> (\<exists>c. c \<sharp> (a,b,x,y) \<and> ((c \<rightleftharpoons> a) \<bullet> x) = ((c \<rightleftharpoons> b) \<bullet> y))"
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 345
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 346
notation
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 347
alpha2 ("_ \<approx>abs2 _")
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 348
1095
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 349
lemma qq:
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 350
fixes S::"atom set"
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 351
assumes a: "supp p \<inter> S = {}"
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 352
shows "p \<bullet> S = S"
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 353
using a
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 354
apply(simp add: supp_perm permute_set_eq)
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 355
apply(auto)
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 356
apply(simp only: disjoint_iff_not_equal)
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 357
apply(simp)
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 358
apply (metis permute_atom_def_raw)
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 359
apply(rule_tac x="(- p) \<bullet> x" in exI)
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 360
apply(simp)
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 361
apply(simp only: disjoint_iff_not_equal)
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 362
apply(simp)
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 363
apply(metis permute_minus_cancel)
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 364
done
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 365
1436
+ − 366
lemma alpha_old_new:
1015
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 367
assumes a: "(a, x) \<approx>abs1 (b, y)" "sort_of a = sort_of b"
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 368
shows "({a}, x) \<approx>abs ({b}, y)"
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 369
using a
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 370
apply(simp)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 371
apply(erule disjE)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 372
apply(simp)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 373
apply(rule exI)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 374
apply(rule alpha_gen_refl)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 375
apply(simp)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 376
apply(rule_tac x="(a \<rightleftharpoons> b)" in exI)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 377
apply(simp add: alpha_gen)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 378
apply(simp add: fresh_def)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 379
apply(rule conjI)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 380
apply(rule_tac ?p1="(a \<rightleftharpoons> b)" in permute_eq_iff[THEN iffD1])
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 381
apply(rule trans)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 382
apply(simp add: Diff_eqvt supp_eqvt)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 383
apply(subst swap_set_not_in)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 384
back
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 385
apply(simp)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 386
apply(simp)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 387
apply(simp add: permute_set_eq)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 388
apply(rule_tac ?p1="(a \<rightleftharpoons> b)" in fresh_star_permute_iff[THEN iffD1])
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 389
apply(simp add: permute_self)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 390
apply(simp add: Diff_eqvt supp_eqvt)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 391
apply(simp add: permute_set_eq)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 392
apply(subgoal_tac "supp (a \<rightleftharpoons> b) \<subseteq> {a, b}")
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 393
apply(simp add: fresh_star_def fresh_def)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 394
apply(blast)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 395
apply(simp add: supp_swap)
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 396
done
683483199a5d
added a single-binder alpha equivalence; showed one half of the equivalence proof between general and single binder case
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 397
1350
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 398
lemma perm_zero:
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 399
assumes a: "\<forall>x::atom. p \<bullet> x = x"
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 400
shows "p = 0"
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 401
using a
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 402
by (simp add: expand_perm_eq)
1327
+ − 403
1350
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 404
fun
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 405
add_perm
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 406
where
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 407
"add_perm [] = 0"
1351
+ − 408
| "add_perm ((a, b) # xs) = (a \<rightleftharpoons> b) + add_perm xs"
+ − 409
+ − 410
fun
+ − 411
elem_perm
+ − 412
where
+ − 413
"elem_perm [] = {}"
+ − 414
| "elem_perm ((a, b) # xs) = {a, b} \<union> elem_perm xs"
+ − 415
1350
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 416
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 417
lemma add_perm_apend:
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 418
shows "add_perm (xs @ ys) = add_perm xs + add_perm ys"
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 419
apply(induct xs arbitrary: ys)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 420
apply(auto simp add: add_assoc)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 421
done
1095
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 422
1351
+ − 423
lemma perm_list_exists:
1350
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 424
fixes p::perm
1351
+ − 425
shows "\<exists>xs. p = add_perm xs \<and> supp xs \<subseteq> supp p"
1350
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 426
apply(induct p taking: "\<lambda>p::perm. card (supp p)" rule: measure_induct)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 427
apply(rename_tac p)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 428
apply(case_tac "supp p = {}")
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 429
apply(simp)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 430
apply(simp add: supp_perm)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 431
apply(drule perm_zero)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 432
apply(simp)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 433
apply(rule_tac x="[]" in exI)
1351
+ − 434
apply(simp add: supp_Nil)
1350
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 435
apply(subgoal_tac "\<exists>x. x \<in> supp p")
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 436
defer
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 437
apply(auto)[1]
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 438
apply(erule exE)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 439
apply(drule_tac x="p + (((- p) \<bullet> x) \<rightleftharpoons> x)" in spec)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 440
apply(drule mp)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 441
defer
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 442
apply(erule exE)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 443
apply(rule_tac x="xs @ [((- p) \<bullet> x, x)]" in exI)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 444
apply(simp add: add_perm_apend)
1351
+ − 445
apply(erule conjE)
1350
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 446
apply(drule sym)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 447
apply(simp)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 448
apply(simp add: expand_perm_eq)
1351
+ − 449
apply(simp add: supp_append)
+ − 450
apply(simp add: supp_perm supp_Cons supp_Nil supp_Pair supp_atom)
+ − 451
apply(rule conjI)
+ − 452
prefer 2
+ − 453
apply(auto)[1]
+ − 454
apply (metis left_minus minus_unique permute_atom_def_raw permute_minus_cancel(2))
+ − 455
defer
1350
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 456
apply(rule psubset_card_mono)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 457
apply(simp add: finite_supp)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 458
apply(rule psubsetI)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 459
defer
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 460
apply(subgoal_tac "x \<notin> supp (p + (- p \<bullet> x \<rightleftharpoons> x))")
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 461
apply(blast)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 462
apply(simp add: supp_perm)
1351
+ − 463
defer
+ − 464
apply(auto simp add: supp_perm)[1]
+ − 465
apply(case_tac "x = xa")
+ − 466
apply(simp)
+ − 467
apply(case_tac "((- p) \<bullet> x) = xa")
+ − 468
apply(simp)
+ − 469
apply(case_tac "sort_of xa = sort_of x")
+ − 470
apply(simp)
+ − 471
apply(auto)[1]
+ − 472
apply(simp)
+ − 473
apply(simp)
+ − 474
apply(subgoal_tac "{a. p \<bullet> (- p \<bullet> x \<rightleftharpoons> x) \<bullet> a \<noteq> a} \<subseteq> {a. p \<bullet> a \<noteq> a}")
+ − 475
apply(blast)
+ − 476
apply(auto simp add: supp_perm)[1]
1350
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 477
apply(case_tac "x = xa")
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 478
apply(simp)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 479
apply(case_tac "((- p) \<bullet> x) = xa")
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 480
apply(simp)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 481
apply(case_tac "sort_of xa = sort_of x")
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 482
apply(simp)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 483
apply(auto)[1]
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 484
apply(simp)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 485
apply(simp)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 486
done
1095
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 487
1351
+ − 488
lemma tt0:
+ − 489
fixes p::perm
+ − 490
shows "(supp x) \<sharp>* p \<Longrightarrow> \<forall>a \<in> supp p. a \<sharp> x"
+ − 491
apply(auto simp add: fresh_star_def supp_perm fresh_def)
+ − 492
done
+ − 493
+ − 494
lemma uu0:
+ − 495
shows "(\<forall>a \<in> elem_perm xs. a \<sharp> x) \<Longrightarrow> (add_perm xs \<bullet> x) = x"
1350
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 496
apply(induct xs rule: add_perm.induct)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 497
apply(simp)
1351
+ − 498
apply(simp add: swap_fresh_fresh)
+ − 499
done
+ − 500
+ − 501
lemma yy0:
+ − 502
fixes xs::"(atom \<times> atom) list"
+ − 503
shows "supp xs = elem_perm xs"
+ − 504
apply(induct xs rule: elem_perm.induct)
+ − 505
apply(auto simp add: supp_Nil supp_Cons supp_Pair supp_atom)
+ − 506
done
+ − 507
+ − 508
lemma tt1:
+ − 509
shows "(supp x) \<sharp>* p \<Longrightarrow> p \<bullet> x = x"
+ − 510
apply(drule tt0)
+ − 511
apply(subgoal_tac "\<exists>xs. p = add_perm xs \<and> supp xs \<subseteq> supp p")
+ − 512
prefer 2
+ − 513
apply(rule perm_list_exists)
+ − 514
apply(erule exE)
+ − 515
apply(simp only: yy0)
+ − 516
apply(rule uu0)
+ − 517
apply(auto)
+ − 518
done
1095
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 519
1350
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 520
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 521
lemma perm_induct_test:
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 522
fixes P :: "perm => bool"
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 523
assumes fin: "finite (supp p)"
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 524
assumes zero: "P 0"
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 525
assumes swap: "\<And>a b. \<lbrakk>sort_of a = sort_of b; a \<noteq> b\<rbrakk> \<Longrightarrow> P (a \<rightleftharpoons> b)"
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 526
assumes plus: "\<And>p1 p2. \<lbrakk>supp p1 \<inter> supp p2 = {}; P p1; P p2\<rbrakk> \<Longrightarrow> P (p1 + p2)"
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 527
shows "P p"
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 528
using fin
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 529
apply(induct F\<equiv>"supp p" arbitrary: p rule: finite_induct)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 530
apply(simp add: supp_perm)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 531
apply(drule perm_zero)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 532
apply(simp add: zero)
5b31e49678fc
added a lemma that permutations can be represented as sums of swapping
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 533
apply(rotate_tac 3)
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 534
oops
1095
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 535
lemma tt:
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 536
"(supp x) \<sharp>* p \<Longrightarrow> p \<bullet> x = x"
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 537
oops
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 538
1095
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 539
lemma yy:
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 540
assumes "S1 - {x} = S2 - {x}" "x \<in> S1" "x \<in> S2"
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 541
shows "S1 = S2"
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 542
using assms
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 543
apply (metis insert_Diff_single insert_absorb)
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 544
done
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 545
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 546
lemma permute_boolI:
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 547
fixes P::"bool"
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 548
shows "p \<bullet> P \<Longrightarrow> P"
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 549
apply(simp add: permute_bool_def)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 550
done
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 551
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 552
lemma permute_boolE:
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 553
fixes P::"bool"
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 554
shows "P \<Longrightarrow> p \<bullet> P"
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 555
apply(simp add: permute_bool_def)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 556
done
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 557
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 558
lemma kk:
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 559
assumes a: "p \<bullet> x = y"
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 560
shows "\<forall>a \<in> supp x. (p \<bullet> a) \<in> supp y"
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 561
using a
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 562
apply(auto)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 563
apply(rule_tac p="- p" in permute_boolI)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 564
apply(simp add: mem_eqvt supp_eqvt)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 565
done
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 566
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 567
lemma ww:
1423
+ − 568
assumes "a \<notin> supp x" "b \<in> supp x" "a \<noteq> b" "sort_of a = sort_of b"
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 569
shows "((a \<rightleftharpoons> b) \<bullet> x) \<noteq> x"
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 570
apply(subgoal_tac "(supp x) supports x")
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 571
apply(simp add: supports_def)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 572
using assms
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 573
apply -
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 574
apply(drule_tac x="a" in spec)
1423
+ − 575
defer
+ − 576
apply(rule supp_supports)
+ − 577
apply(auto)
+ − 578
apply(rotate_tac 1)
+ − 579
apply(drule_tac p="(a \<rightleftharpoons> b)" in permute_boolE)
+ − 580
apply(simp add: mem_eqvt supp_eqvt)
+ − 581
done
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 582
1423
+ − 583
lemma alpha_abs_sym:
+ − 584
assumes a: "({a}, x) \<approx>abs ({b}, y)"
+ − 585
shows "({b}, y) \<approx>abs ({a}, x)"
1095
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 586
using a
1423
+ − 587
apply(simp)
+ − 588
apply(erule exE)
+ − 589
apply(rule_tac x="- p" in exI)
+ − 590
apply(simp add: alpha_gen)
+ − 591
apply(simp add: fresh_star_def fresh_minus_perm)
+ − 592
apply (metis permute_minus_cancel(2))
+ − 593
done
+ − 594
+ − 595
lemma alpha_abs_trans:
+ − 596
assumes a: "({a1}, x1) \<approx>abs ({a2}, x2)"
+ − 597
assumes b: "({a2}, x2) \<approx>abs ({a3}, x3)"
+ − 598
shows "({a1}, x1) \<approx>abs ({a3}, x3)"
+ − 599
using a b
+ − 600
apply(simp)
+ − 601
apply(erule exE)+
+ − 602
apply(rule_tac x="pa + p" in exI)
+ − 603
apply(simp add: alpha_gen)
+ − 604
apply(simp add: fresh_star_def fresh_plus_perm)
+ − 605
done
+ − 606
+ − 607
lemma alpha_equal:
+ − 608
assumes a: "({a}, x) \<approx>abs ({a}, y)"
+ − 609
shows "(a, x) \<approx>abs1 (a, y)"
+ − 610
using a
1095
8441b4b2469d
a few more attempts to show the equivalence between old and new way of defining alpha-equivalence
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 611
apply(simp)
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 612
apply(erule exE)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 613
apply(simp add: alpha_gen)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 614
apply(erule conjE)+
1423
+ − 615
apply(case_tac "a \<notin> supp x")
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 616
apply(simp)
1423
+ − 617
apply(subgoal_tac "supp x \<sharp>* p")
+ − 618
apply(drule tt1)
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 619
apply(simp)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 620
apply(simp)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 621
apply(simp)
1423
+ − 622
apply(case_tac "a \<notin> supp y")
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 623
apply(simp)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 624
apply(drule tt1)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 625
apply(clarify)
1423
+ − 626
apply(simp (no_asm_use))
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 627
apply(simp)
1423
+ − 628
apply(simp)
+ − 629
apply(drule yy)
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 630
apply(simp)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 631
apply(simp)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 632
apply(simp)
1423
+ − 633
apply(case_tac "a \<sharp> p")
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 634
apply(subgoal_tac "supp y \<sharp>* p")
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 635
apply(drule tt1)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 636
apply(clarify)
1423
+ − 637
apply(simp (no_asm_use))
+ − 638
apply(metis)
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 639
apply(auto simp add: fresh_star_def)[1]
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 640
apply(frule_tac kk)
1423
+ − 641
apply(drule_tac x="a" in bspec)
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 642
apply(simp)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 643
apply(simp add: fresh_def)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 644
apply(simp add: supp_perm)
1423
+ − 645
apply(subgoal_tac "((p \<bullet> a) \<sharp> p)")
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 646
apply(simp add: fresh_def supp_perm)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 647
apply(simp add: fresh_star_def)
1423
+ − 648
done
+ − 649
+ − 650
lemma alpha_unequal:
+ − 651
assumes a: "({a}, x) \<approx>abs ({b}, y)" "sort_of a = sort_of b" "a \<noteq> b"
+ − 652
shows "(a, x) \<approx>abs1 (b, y)"
+ − 653
using a
+ − 654
apply -
+ − 655
apply(subgoal_tac "a \<notin> supp x - {a}")
+ − 656
apply(subgoal_tac "b \<notin> supp x - {a}")
+ − 657
defer
+ − 658
apply(simp add: alpha_gen)
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 659
apply(simp)
1423
+ − 660
apply(drule_tac alpha_abs_swap)
+ − 661
apply(assumption)
+ − 662
apply(simp only: insert_eqvt empty_eqvt swap_atom_simps)
+ − 663
apply(drule alpha_abs_sym)
+ − 664
apply(rotate_tac 4)
+ − 665
apply(drule_tac alpha_abs_trans)
+ − 666
apply(assumption)
+ − 667
apply(drule alpha_equal)
+ − 668
apply(simp)
+ − 669
apply(rule_tac p="(a \<rightleftharpoons> b)" in permute_boolI)
+ − 670
apply(simp add: fresh_eqvt)
+ − 671
apply(simp add: fresh_def)
+ − 672
done
+ − 673
+ − 674
lemma alpha_new_old:
+ − 675
assumes a: "({a}, x) \<approx>abs ({b}, y)" "sort_of a = sort_of b"
+ − 676
shows "(a, x) \<approx>abs1 (b, y)"
+ − 677
using a
+ − 678
apply(case_tac "a=b")
+ − 679
apply(simp only: alpha_equal)
+ − 680
apply(drule alpha_unequal)
1403
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 681
apply(simp)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 682
apply(simp)
4a10338c2535
almost done with showing the equivalence between old and new alpha-equivalence (one subgoal remaining)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 683
apply(simp)
1423
+ − 684
done
1312
+ − 685
+ − 686
fun
+ − 687
distinct_perms
+ − 688
where
+ − 689
"distinct_perms [] = True"
+ − 690
| "distinct_perms (p # ps) = (supp p \<inter> supp ps = {} \<and> distinct_perms ps)"
+ − 691
1431
+ − 692
(* support of concrete atom sets *)
+ − 693
+ − 694
lemma atom_eqvt_raw:
+ − 695
fixes p::"perm"
+ − 696
shows "(p \<bullet> atom) = atom"
+ − 697
by (simp add: expand_fun_eq permute_fun_def atom_eqvt)
+ − 698
+ − 699
lemma atom_image_cong:
+ − 700
shows "(atom ` X = atom ` Y) = (X = Y)"
+ − 701
apply(rule inj_image_eq_iff)
+ − 702
apply(simp add: inj_on_def)
+ − 703
done
+ − 704
1433
+ − 705
lemma supp_atom_image:
1432
b41de1879dae
generalised the supp for atoms to all concrete atoms (not just names)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 706
fixes as::"'a::at_base set"
1431
+ − 707
shows "supp (atom ` as) = supp as"
+ − 708
apply(simp add: supp_def)
+ − 709
apply(simp add: image_eqvt)
+ − 710
apply(simp add: atom_eqvt_raw)
+ − 711
apply(simp add: atom_image_cong)
+ − 712
done
+ − 713
1433
+ − 714
lemma swap_atom_image_fresh: "\<lbrakk>a \<sharp> atom ` (fn :: ('a :: at_base set)); b \<sharp> atom ` fn\<rbrakk> \<Longrightarrow> (a \<rightleftharpoons> b) \<bullet> fn = fn"
+ − 715
apply (simp add: fresh_def)
+ − 716
apply (simp add: supp_atom_image)
+ − 717
apply (fold fresh_def)
+ − 718
apply (simp add: swap_fresh_fresh)
+ − 719
done
1312
+ − 720
+ − 721
989
af02b193a19a
the supp of a lambda can now be characterised, *provided* the notion of free variables coincides with support on lambda terms
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 722
end
988
a987b5acadc8
improved the proof slightly by defining alpha as a function and completely characterised the equality between two abstractions
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 723