950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 1
theory Terms
1028
+ − 2
imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "../QuotMain" "Abs"
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 3
begin
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 4
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 5
atom_decl name
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 6
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 7
text {* primrec seems to be genarally faster than fun *}
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 8
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 9
section {*** lets with binding patterns ***}
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 10
1028
+ − 11
datatype rtrm1 =
+ − 12
rVr1 "name"
+ − 13
| rAp1 "rtrm1" "rtrm1"
+ − 14
| rLm1 "name" "rtrm1" --"name is bound in trm1"
+ − 15
| rLt1 "bp" "rtrm1" "rtrm1" --"all variables in bp are bound in the 2nd trm1"
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 16
and bp =
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 17
BUnit
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 18
| BVr "name"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 19
| BPr "bp" "bp"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 20
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 21
(* to be given by the user *)
1029
+ − 22
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 23
primrec
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 24
bv1
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 25
where
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 26
"bv1 (BUnit) = {}"
957
+ − 27
| "bv1 (BVr x) = {atom x}"
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 28
| "bv1 (BPr bp1 bp2) = (bv1 bp1) \<union> (bv1 bp1)"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 29
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 30
(* needs to be calculated by the package *)
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 31
primrec
1028
+ − 32
rfv_trm1 and rfv_bp
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 33
where
1028
+ − 34
"rfv_trm1 (rVr1 x) = {atom x}"
+ − 35
| "rfv_trm1 (rAp1 t1 t2) = (rfv_trm1 t1) \<union> (rfv_trm1 t2)"
+ − 36
| "rfv_trm1 (rLm1 x t) = (rfv_trm1 t) - {atom x}"
+ − 37
| "rfv_trm1 (rLt1 bp t1 t2) = (rfv_trm1 t1) \<union> (rfv_trm1 t2 - bv1 bp)"
+ − 38
| "rfv_bp (BUnit) = {}"
+ − 39
| "rfv_bp (BVr x) = {atom x}"
+ − 40
| "rfv_bp (BPr b1 b2) = (rfv_bp b1) \<union> (rfv_bp b2)"
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 41
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 42
(* needs to be stated by the package *)
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 43
instantiation
1028
+ − 44
rtrm1 and bp :: pt
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 45
begin
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 46
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 47
primrec
1028
+ − 48
permute_rtrm1 and permute_bp
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 49
where
1028
+ − 50
"permute_rtrm1 pi (rVr1 a) = rVr1 (pi \<bullet> a)"
+ − 51
| "permute_rtrm1 pi (rAp1 t1 t2) = rAp1 (permute_rtrm1 pi t1) (permute_rtrm1 pi t2)"
+ − 52
| "permute_rtrm1 pi (rLm1 a t) = rLm1 (pi \<bullet> a) (permute_rtrm1 pi t)"
+ − 53
| "permute_rtrm1 pi (rLt1 bp t1 t2) = rLt1 (permute_bp pi bp) (permute_rtrm1 pi t1) (permute_rtrm1 pi t2)"
957
+ − 54
| "permute_bp pi (BUnit) = BUnit"
+ − 55
| "permute_bp pi (BVr a) = BVr (pi \<bullet> a)"
+ − 56
| "permute_bp pi (BPr bp1 bp2) = BPr (permute_bp pi bp1) (permute_bp pi bp2)"
+ − 57
1028
+ − 58
lemma pt_rtrm1_bp_zero:
+ − 59
fixes t::rtrm1
957
+ − 60
and b::bp
+ − 61
shows "0 \<bullet> t = t"
+ − 62
and "0 \<bullet> b = b"
1028
+ − 63
apply(induct t and b rule: rtrm1_bp.inducts)
957
+ − 64
apply(simp_all)
+ − 65
done
+ − 66
1028
+ − 67
lemma pt_rtrm1_bp_plus:
+ − 68
fixes t::rtrm1
957
+ − 69
and b::bp
+ − 70
shows "((p + q) \<bullet> t) = p \<bullet> (q \<bullet> t)"
+ − 71
and "((p + q) \<bullet> b) = p \<bullet> (q \<bullet> b)"
1028
+ − 72
apply(induct t and b rule: rtrm1_bp.inducts)
957
+ − 73
apply(simp_all)
+ − 74
done
+ − 75
+ − 76
instance
+ − 77
apply default
1028
+ − 78
apply(simp_all add: pt_rtrm1_bp_zero pt_rtrm1_bp_plus)
957
+ − 79
done
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 80
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 81
end
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 82
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 83
inductive
1028
+ − 84
alpha1 :: "rtrm1 \<Rightarrow> rtrm1 \<Rightarrow> bool" ("_ \<approx>1 _" [100, 100] 100)
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 85
where
1028
+ − 86
a1: "a = b \<Longrightarrow> (rVr1 a) \<approx>1 (rVr1 b)"
+ − 87
| a2: "\<lbrakk>t1 \<approx>1 t2; s1 \<approx>1 s2\<rbrakk> \<Longrightarrow> rAp1 t1 s1 \<approx>1 rAp1 t2 s2"
+ − 88
| a3: "(\<exists>pi. (({atom aa}, t) \<approx>gen alpha1 rfv_trm1 pi ({atom ab}, s))) \<Longrightarrow> rLm1 aa t \<approx>1 rLm1 ab s"
+ − 89
| a4: "t1 \<approx>1 t2 \<Longrightarrow> (\<exists>pi. (((bv1 b1), s1) \<approx>gen alpha1 rfv_trm1 pi ((bv1 b2), s2))) \<Longrightarrow> rLt1 b1 t1 s1 \<approx>1 rLt1 b2 t2 s2"
+ − 90
1029
+ − 91
lemma alpha1_inj:
1028
+ − 92
"(rVr1 a \<approx>1 rVr1 b) = (a = b)"
+ − 93
"(rAp1 t1 s1 \<approx>1 rAp1 t2 s2) = (t1 \<approx>1 t2 \<and> s1 \<approx>1 s2)"
+ − 94
"(rLm1 aa t \<approx>1 rLm1 ab s) = (\<exists>pi. (({atom aa}, t) \<approx>gen alpha1 rfv_trm1 pi ({atom ab}, s)))"
+ − 95
"(rLt1 b1 t1 s1 \<approx>1 rLt1 b2 t2 s2) = (t1 \<approx>1 t2 \<and> (\<exists>pi. (((bv1 b1), s1) \<approx>gen alpha1 rfv_trm1 pi ((bv1 b2), s2))))"
+ − 96
apply -
+ − 97
apply rule apply (erule alpha1.cases) apply (simp_all add: alpha1.intros)
+ − 98
apply rule apply (erule alpha1.cases) apply (simp_all add: alpha1.intros)
+ − 99
apply rule apply (erule alpha1.cases) apply (simp_all add: alpha1.intros)
+ − 100
apply rule apply (erule alpha1.cases) apply (simp_all add: alpha1.intros)
+ − 101
done
+ − 102
1030
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 103
(* Shouyld we derive it? But bv is given by the user? *)
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 104
lemma bv1_eqvt[eqvt]:
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 105
shows "(pi \<bullet> bv1 x) = bv1 (pi \<bullet> x)"
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 106
apply (induct x)
1043
+ − 107
apply (simp_all add: empty_eqvt insert_eqvt atom_eqvt)
1030
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 108
done
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 109
1031
+ − 110
lemma rfv_trm1_eqvt[eqvt]:
+ − 111
shows "(pi\<bullet>rfv_trm1 t) = rfv_trm1 (pi\<bullet>t)"
+ − 112
apply (induct t)
1043
+ − 113
apply (simp_all add: insert_eqvt atom_eqvt empty_eqvt union_eqvt Diff_eqvt bv1_eqvt)
1031
+ − 114
done
+ − 115
+ − 116
1028
+ − 117
lemma alpha1_eqvt:
+ − 118
shows "t \<approx>1 s \<Longrightarrow> (pi \<bullet> t) \<approx>1 (pi \<bullet> s)"
1031
+ − 119
apply (induct t s rule: alpha1.inducts)
+ − 120
apply (simp_all add:eqvts alpha1_inj)
1033
+ − 121
apply (erule exE)
+ − 122
apply (rule_tac x="pi \<bullet> pia" in exI)
+ − 123
apply (simp add: alpha_gen)
+ − 124
apply(erule conjE)+
+ − 125
apply(rule conjI)
+ − 126
apply(rule_tac ?p1="- pi" in permute_eq_iff[THEN iffD1])
1043
+ − 127
apply(simp add: atom_eqvt Diff_eqvt insert_eqvt empty_eqvt rfv_trm1_eqvt)
1033
+ − 128
apply(rule conjI)
+ − 129
apply(rule_tac ?p1="- pi" in fresh_star_permute_iff[THEN iffD1])
1043
+ − 130
apply(simp add: atom_eqvt Diff_eqvt rfv_trm1_eqvt insert_eqvt empty_eqvt)
1033
+ − 131
apply(simp add: permute_eqvt[symmetric])
+ − 132
apply (erule exE)
+ − 133
apply (rule_tac x="pi \<bullet> pia" in exI)
+ − 134
apply (simp add: alpha_gen)
+ − 135
apply(erule conjE)+
+ − 136
apply(rule conjI)
+ − 137
apply(rule_tac ?p1="- pi" in permute_eq_iff[THEN iffD1])
1043
+ − 138
apply(simp add: rfv_trm1_eqvt Diff_eqvt bv1_eqvt)
1033
+ − 139
apply(rule conjI)
+ − 140
apply(rule_tac ?p1="- pi" in fresh_star_permute_iff[THEN iffD1])
1043
+ − 141
apply(simp add: atom_eqvt rfv_trm1_eqvt Diff_eqvt bv1_eqvt)
1033
+ − 142
apply(simp add: permute_eqvt[symmetric])
+ − 143
done
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 144
957
+ − 145
lemma alpha1_equivp: "equivp alpha1"
+ − 146
sorry
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 147
1028
+ − 148
quotient_type trm1 = rtrm1 / alpha1
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 149
by (rule alpha1_equivp)
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 150
1028
+ − 151
quotient_definition
+ − 152
"Vr1 :: name \<Rightarrow> trm1"
+ − 153
as
+ − 154
"rVr1"
+ − 155
1029
+ − 156
quotient_definition
+ − 157
"Ap1 :: trm1 \<Rightarrow> trm1 \<Rightarrow> trm1"
+ − 158
as
+ − 159
"rAp1"
+ − 160
+ − 161
quotient_definition
+ − 162
"Lm1 :: name \<Rightarrow> trm1 \<Rightarrow> trm1"
+ − 163
as
+ − 164
"rLm1"
+ − 165
+ − 166
quotient_definition
+ − 167
"Lt1 :: bp \<Rightarrow> trm1 \<Rightarrow> trm1 \<Rightarrow> trm1"
+ − 168
as
+ − 169
"rLt1"
+ − 170
+ − 171
quotient_definition
+ − 172
"fv_trm1 :: trm1 \<Rightarrow> atom set"
+ − 173
as
+ − 174
"rfv_trm1"
+ − 175
+ − 176
lemma alpha_rfv1:
+ − 177
shows "t \<approx>1 s \<Longrightarrow> rfv_trm1 t = rfv_trm1 s"
+ − 178
apply(induct rule: alpha1.induct)
+ − 179
apply(simp_all add: alpha_gen.simps)
+ − 180
done
+ − 181
+ − 182
lemma [quot_respect]:
+ − 183
"(op = ===> alpha1) rVr1 rVr1"
+ − 184
"(alpha1 ===> alpha1 ===> alpha1) rAp1 rAp1"
+ − 185
"(op = ===> alpha1 ===> alpha1) rLm1 rLm1"
+ − 186
"(op = ===> alpha1 ===> alpha1 ===> alpha1) rLt1 rLt1"
+ − 187
apply (auto intro: alpha1.intros)
+ − 188
apply(rule a3) apply (rule_tac x="0" in exI)
+ − 189
apply (simp add: fresh_star_def fresh_zero_perm alpha_rfv1 alpha_gen)
+ − 190
apply(rule a4) apply assumption apply (rule_tac x="0" in exI)
+ − 191
apply (simp add: fresh_star_def fresh_zero_perm alpha_rfv1 alpha_gen)
+ − 192
done
+ − 193
+ − 194
lemma [quot_respect]:
+ − 195
"(op = ===> alpha1 ===> alpha1) permute permute"
+ − 196
apply auto
+ − 197
apply (rule alpha1_eqvt)
+ − 198
apply simp
+ − 199
done
+ − 200
+ − 201
lemma [quot_respect]:
+ − 202
"(alpha1 ===> op =) rfv_trm1 rfv_trm1"
+ − 203
apply (simp add: alpha_rfv1)
+ − 204
done
+ − 205
1073
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 206
lemmas trm1_bp_induct = rtrm1_bp.induct[quot_lifted]
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 207
lemmas trm1_bp_inducts = rtrm1_bp.inducts[quot_lifted]
1029
+ − 208
+ − 209
instantiation trm1 and bp :: pt
+ − 210
begin
+ − 211
+ − 212
quotient_definition
+ − 213
"permute_trm1 :: perm \<Rightarrow> trm1 \<Rightarrow> trm1"
+ − 214
as
+ − 215
"permute :: perm \<Rightarrow> rtrm1 \<Rightarrow> rtrm1"
+ − 216
+ − 217
instance
+ − 218
apply default
+ − 219
apply(induct_tac [!] x rule: trm1_bp_inducts(1))
1073
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 220
apply(simp_all add: permute_rtrm1_permute_bp.simps[quot_lifted])
1029
+ − 221
done
+ − 222
+ − 223
end
+ − 224
1073
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 225
lemmas permute_trm1[simp] = permute_rtrm1_permute_bp.simps[quot_lifted]
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 226
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 227
lemmas fv_trm1 = rfv_trm1_rfv_bp.simps[quot_lifted]
1029
+ − 228
1073
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 229
lemmas fv_trm1_eqvt = rfv_trm1_eqvt[quot_lifted]
1029
+ − 230
1073
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 231
lemmas alpha1_INJ = alpha1_inj[unfolded alpha_gen, quot_lifted, folded alpha_gen]
1029
+ − 232
1031
+ − 233
lemma lm1_supp_pre:
+ − 234
shows "(supp (atom x, t)) supports (Lm1 x t) "
+ − 235
apply(simp add: supports_def)
+ − 236
apply(fold fresh_def)
+ − 237
apply(simp add: fresh_Pair swap_fresh_fresh)
+ − 238
apply(clarify)
+ − 239
apply(subst swap_at_base_simps(3))
+ − 240
apply(simp_all add: fresh_atom)
+ − 241
done
+ − 242
+ − 243
lemma lt1_supp_pre:
+ − 244
shows "(supp (x, t, s)) supports (Lt1 t x s) "
+ − 245
apply(simp add: supports_def)
+ − 246
apply(fold fresh_def)
+ − 247
apply(simp add: fresh_Pair swap_fresh_fresh)
+ − 248
done
+ − 249
+ − 250
lemma bp_supp: "finite (supp (bp :: bp))"
+ − 251
apply (induct bp)
+ − 252
apply(simp_all add: supp_def)
+ − 253
apply (fold supp_def)
+ − 254
apply (simp add: supp_at_base)
+ − 255
apply(simp add: Collect_imp_eq)
+ − 256
apply(simp add: Collect_neg_eq[symmetric])
+ − 257
apply (fold supp_def)
+ − 258
apply (simp)
+ − 259
done
+ − 260
1030
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 261
instance trm1 :: fs
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 262
apply default
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 263
apply(induct_tac x rule: trm1_bp_inducts(1))
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 264
apply(simp_all)
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 265
apply(simp add: supp_def alpha1_INJ eqvts)
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 266
apply(simp add: supp_def[symmetric] supp_at_base)
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 267
apply(simp only: supp_def alpha1_INJ eqvts permute_trm1)
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 268
apply(simp add: Collect_imp_eq Collect_neg_eq)
1031
+ − 269
apply(rule supports_finite)
+ − 270
apply(rule lm1_supp_pre)
+ − 271
apply(simp add: supp_Pair supp_atom)
+ − 272
apply(rule supports_finite)
+ − 273
apply(rule lt1_supp_pre)
+ − 274
apply(simp add: supp_Pair supp_atom bp_supp)
+ − 275
done
1030
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 276
1029
+ − 277
lemma supp_fv:
+ − 278
shows "supp t = fv_trm1 t"
+ − 279
apply(induct t rule: trm1_bp_inducts(1))
1030
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 280
apply(simp_all)
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 281
apply(simp add: supp_def permute_trm1 alpha1_INJ fv_trm1)
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 282
apply(simp only: supp_at_base[simplified supp_def])
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 283
apply(simp add: supp_def permute_trm1 alpha1_INJ fv_trm1)
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 284
apply(simp add: Collect_imp_eq Collect_neg_eq)
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 285
apply(subgoal_tac "supp (Lm1 name rtrm1) = supp (Abs {atom name} rtrm1)")
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 286
apply(simp add: supp_Abs fv_trm1)
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 287
apply(simp (no_asm) add: supp_def permute_set_eq atom_eqvt)
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 288
apply(simp add: alpha1_INJ)
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 289
apply(simp add: Abs_eq_iff)
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 290
apply(simp add: alpha_gen.simps)
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 291
apply(simp add: supp_eqvt[symmetric] fv_trm1_eqvt[symmetric])
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 292
apply(subgoal_tac "supp (Lt1 bp rtrm11 rtrm12) = supp(rtrm11) \<union> supp (Abs (bv1 bp) rtrm12)")
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 293
apply(simp add: supp_Abs fv_trm1)
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 294
apply(simp (no_asm) add: supp_def)
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 295
apply(simp add: alpha1_INJ)
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 296
apply(simp add: Abs_eq_iff)
1033
+ − 297
apply(simp add: alpha_gen)
1030
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 298
apply(simp add: supp_eqvt[symmetric] fv_trm1_eqvt[symmetric] bv1_eqvt)
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 299
apply(simp add: Collect_imp_eq Collect_neg_eq)
07f97267a392
Finished the supp_fv proof; first proof that analyses the structure of 'Let' :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 300
done
1029
+ − 301
1032
135bf399c036
The trm1_support lemma explicitly and stated a strong induction principle.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 302
lemma trm1_supp:
135bf399c036
The trm1_support lemma explicitly and stated a strong induction principle.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 303
"supp (Vr1 x) = {atom x}"
135bf399c036
The trm1_support lemma explicitly and stated a strong induction principle.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 304
"supp (Ap1 t1 t2) = supp t1 \<union> supp t2"
135bf399c036
The trm1_support lemma explicitly and stated a strong induction principle.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 305
"supp (Lm1 x t) = (supp t) - {atom x}"
135bf399c036
The trm1_support lemma explicitly and stated a strong induction principle.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 306
"supp (Lt1 b t s) = supp t \<union> (supp s - bv1 b)"
135bf399c036
The trm1_support lemma explicitly and stated a strong induction principle.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 307
by (simp_all only: supp_fv fv_trm1)
135bf399c036
The trm1_support lemma explicitly and stated a strong induction principle.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 308
135bf399c036
The trm1_support lemma explicitly and stated a strong induction principle.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 309
lemma trm1_induct_strong:
135bf399c036
The trm1_support lemma explicitly and stated a strong induction principle.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 310
assumes "\<And>name b. P b (Vr1 name)"
135bf399c036
The trm1_support lemma explicitly and stated a strong induction principle.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 311
and "\<And>rtrm11 rtrm12 b. \<lbrakk>\<And>c. P c rtrm11; \<And>c. P c rtrm12\<rbrakk> \<Longrightarrow> P b (Ap1 rtrm11 rtrm12)"
135bf399c036
The trm1_support lemma explicitly and stated a strong induction principle.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 312
and "\<And>name rtrm1 b. \<lbrakk>\<And>c. P c rtrm1; (atom name) \<sharp> b\<rbrakk> \<Longrightarrow> P b (Lm1 name rtrm1)"
135bf399c036
The trm1_support lemma explicitly and stated a strong induction principle.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 313
and "\<And>bp rtrm11 rtrm12 b. \<lbrakk>\<And>c. P c rtrm11; \<And>c. P c rtrm12; bp1 bp \<sharp>* b\<rbrakk> \<Longrightarrow> P b (Lt1 bp rtrm11 rtrm12)"
135bf399c036
The trm1_support lemma explicitly and stated a strong induction principle.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 314
shows "P a rtrma"
1035
+ − 315
sorry
1032
135bf399c036
The trm1_support lemma explicitly and stated a strong induction principle.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 316
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 317
section {*** lets with single assignments ***}
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 318
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 319
datatype trm2 =
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 320
Vr2 "name"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 321
| Ap2 "trm2" "trm2"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 322
| Lm2 "name" "trm2"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 323
| Lt2 "assign" "trm2"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 324
and assign =
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 325
As "name" "trm2"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 326
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 327
(* to be given by the user *)
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 328
primrec
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 329
bv2
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 330
where
957
+ − 331
"bv2 (As x t) = {atom x}"
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 332
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 333
(* needs to be calculated by the package *)
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 334
primrec
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 335
fv_trm2 and fv_assign
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 336
where
957
+ − 337
"fv_trm2 (Vr2 x) = {atom x}"
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 338
| "fv_trm2 (Ap2 t1 t2) = (fv_trm2 t1) \<union> (fv_trm2 t2)"
957
+ − 339
| "fv_trm2 (Lm2 x t) = (fv_trm2 t) - {atom x}"
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 340
| "fv_trm2 (Lt2 as t) = (fv_trm2 t - bv2 as) \<union> (fv_assign as)"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 341
| "fv_assign (As x t) = (fv_trm2 t)"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 342
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 343
(* needs to be stated by the package *)
957
+ − 344
instantiation
+ − 345
trm2 and assign :: pt
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 346
begin
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 347
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 348
primrec
957
+ − 349
permute_trm2 and permute_assign
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 350
where
957
+ − 351
"permute_trm2 pi (Vr2 a) = Vr2 (pi \<bullet> a)"
+ − 352
| "permute_trm2 pi (Ap2 t1 t2) = Ap2 (permute_trm2 pi t1) (permute_trm2 pi t2)"
+ − 353
| "permute_trm2 pi (Lm2 a t) = Lm2 (pi \<bullet> a) (permute_trm2 pi t)"
+ − 354
| "permute_trm2 pi (Lt2 as t) = Lt2 (permute_assign pi as) (permute_trm2 pi t)"
+ − 355
| "permute_assign pi (As a t) = As (pi \<bullet> a) (permute_trm2 pi t)"
+ − 356
+ − 357
lemma pt_trm2_assign_zero:
+ − 358
fixes t::trm2
+ − 359
and b::assign
+ − 360
shows "0 \<bullet> t = t"
+ − 361
and "0 \<bullet> b = b"
+ − 362
apply(induct t and b rule: trm2_assign.inducts)
+ − 363
apply(simp_all)
+ − 364
done
+ − 365
+ − 366
lemma pt_trm2_assign_plus:
+ − 367
fixes t::trm2
+ − 368
and b::assign
+ − 369
shows "((p + q) \<bullet> t) = p \<bullet> (q \<bullet> t)"
+ − 370
and "((p + q) \<bullet> b) = p \<bullet> (q \<bullet> b)"
+ − 371
apply(induct t and b rule: trm2_assign.inducts)
+ − 372
apply(simp_all)
+ − 373
done
+ − 374
+ − 375
instance
+ − 376
apply default
+ − 377
apply(simp_all add: pt_trm2_assign_zero pt_trm2_assign_plus)
+ − 378
done
+ − 379
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 380
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 381
end
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 382
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 383
inductive
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 384
alpha2 :: "trm2 \<Rightarrow> trm2 \<Rightarrow> bool" ("_ \<approx>2 _" [100, 100] 100)
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 385
where
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 386
a1: "a = b \<Longrightarrow> (Vr2 a) \<approx>2 (Vr2 b)"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 387
| a2: "\<lbrakk>t1 \<approx>2 t2; s1 \<approx>2 s2\<rbrakk> \<Longrightarrow> Ap2 t1 s1 \<approx>2 Ap2 t2 s2"
957
+ − 388
| a3: "\<exists>pi. (fv_trm2 t - {atom a} = fv_trm2 s - {atom b} \<and>
+ − 389
(fv_trm2 t - {atom a})\<sharp>* pi \<and>
+ − 390
(pi \<bullet> t) \<approx>2 s \<and>
+ − 391
(pi \<bullet> a) = b)
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 392
\<Longrightarrow> Lm2 a t \<approx>2 Lm2 b s"
957
+ − 393
| a4: "\<exists>pi. (
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 394
fv_trm2 t1 - fv_assign b1 = fv_trm2 t2 - fv_assign b2 \<and>
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 395
(fv_trm2 t1 - fv_assign b1) \<sharp>* pi \<and>
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 396
pi \<bullet> t1 = t2 (* \<and> (pi \<bullet> b1 = b2) *)
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 397
) \<Longrightarrow> Lt2 b1 t1 \<approx>2 Lt2 b2 t2"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 398
957
+ − 399
lemma alpha2_equivp: "equivp alpha2"
+ − 400
sorry
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 401
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 402
quotient_type qtrm2 = trm2 / alpha2
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 403
by (rule alpha2_equivp)
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 404
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 405
section {*** lets with many assignments ***}
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 406
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 407
datatype trm3 =
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 408
Vr3 "name"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 409
| Ap3 "trm3" "trm3"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 410
| Lm3 "name" "trm3"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 411
| Lt3 "assigns" "trm3"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 412
and assigns =
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 413
ANil
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 414
| ACons "name" "trm3" "assigns"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 415
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 416
(* to be given by the user *)
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 417
primrec
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 418
bv3
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 419
where
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 420
"bv3 ANil = {}"
957
+ − 421
| "bv3 (ACons x t as) = {atom x} \<union> (bv3 as)"
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 422
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 423
primrec
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 424
fv_trm3 and fv_assigns
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 425
where
957
+ − 426
"fv_trm3 (Vr3 x) = {atom x}"
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 427
| "fv_trm3 (Ap3 t1 t2) = (fv_trm3 t1) \<union> (fv_trm3 t2)"
957
+ − 428
| "fv_trm3 (Lm3 x t) = (fv_trm3 t) - {atom x}"
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 429
| "fv_trm3 (Lt3 as t) = (fv_trm3 t - bv3 as) \<union> (fv_assigns as)"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 430
| "fv_assigns (ANil) = {}"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 431
| "fv_assigns (ACons x t as) = (fv_trm3 t) \<union> (fv_assigns as)"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 432
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 433
(* needs to be stated by the package *)
957
+ − 434
instantiation
+ − 435
trm3 and assigns :: pt
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 436
begin
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 437
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 438
primrec
957
+ − 439
permute_trm3 and permute_assigns
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 440
where
957
+ − 441
"permute_trm3 pi (Vr3 a) = Vr3 (pi \<bullet> a)"
+ − 442
| "permute_trm3 pi (Ap3 t1 t2) = Ap3 (permute_trm3 pi t1) (permute_trm3 pi t2)"
+ − 443
| "permute_trm3 pi (Lm3 a t) = Lm3 (pi \<bullet> a) (permute_trm3 pi t)"
+ − 444
| "permute_trm3 pi (Lt3 as t) = Lt3 (permute_assigns pi as) (permute_trm3 pi t)"
+ − 445
| "permute_assigns pi (ANil) = ANil"
+ − 446
| "permute_assigns pi (ACons a t as) = ACons (pi \<bullet> a) (permute_trm3 pi t) (permute_assigns pi as)"
+ − 447
+ − 448
lemma pt_trm3_assigns_zero:
+ − 449
fixes t::trm3
+ − 450
and b::assigns
+ − 451
shows "0 \<bullet> t = t"
+ − 452
and "0 \<bullet> b = b"
+ − 453
apply(induct t and b rule: trm3_assigns.inducts)
+ − 454
apply(simp_all)
+ − 455
done
+ − 456
+ − 457
lemma pt_trm3_assigns_plus:
+ − 458
fixes t::trm3
+ − 459
and b::assigns
+ − 460
shows "((p + q) \<bullet> t) = p \<bullet> (q \<bullet> t)"
+ − 461
and "((p + q) \<bullet> b) = p \<bullet> (q \<bullet> b)"
+ − 462
apply(induct t and b rule: trm3_assigns.inducts)
+ − 463
apply(simp_all)
+ − 464
done
+ − 465
+ − 466
instance
+ − 467
apply default
+ − 468
apply(simp_all add: pt_trm3_assigns_zero pt_trm3_assigns_plus)
+ − 469
done
+ − 470
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 471
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 472
end
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 473
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 474
inductive
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 475
alpha3 :: "trm3 \<Rightarrow> trm3 \<Rightarrow> bool" ("_ \<approx>3 _" [100, 100] 100)
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 476
where
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 477
a1: "a = b \<Longrightarrow> (Vr3 a) \<approx>3 (Vr3 b)"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 478
| a2: "\<lbrakk>t1 \<approx>3 t2; s1 \<approx>3 s2\<rbrakk> \<Longrightarrow> Ap3 t1 s1 \<approx>3 Ap3 t2 s2"
957
+ − 479
| a3: "\<exists>pi. (fv_trm3 t - {atom a} = fv_trm3 s - {atom b} \<and>
+ − 480
(fv_trm3 t - {atom a})\<sharp>* pi \<and>
+ − 481
(pi \<bullet> t) \<approx>3 s \<and>
+ − 482
(pi \<bullet> a) = b)
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 483
\<Longrightarrow> Lm3 a t \<approx>3 Lm3 b s"
957
+ − 484
| a4: "\<exists>pi. (
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 485
fv_trm3 t1 - fv_assigns b1 = fv_trm3 t2 - fv_assigns b2 \<and>
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 486
(fv_trm3 t1 - fv_assigns b1) \<sharp>* pi \<and>
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 487
pi \<bullet> t1 = t2 (* \<and> (pi \<bullet> b1 = b2) *)
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 488
) \<Longrightarrow> Lt3 b1 t1 \<approx>3 Lt3 b2 t2"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 489
957
+ − 490
lemma alpha3_equivp: "equivp alpha3"
+ − 491
sorry
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 492
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 493
quotient_type qtrm3 = trm3 / alpha3
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 494
by (rule alpha3_equivp)
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 495
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 496
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 497
section {*** lam with indirect list recursion ***}
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 498
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 499
datatype trm4 =
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 500
Vr4 "name"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 501
| Ap4 "trm4" "trm4 list"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 502
| Lm4 "name" "trm4"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 503
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 504
thm trm4.recs
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 505
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 506
primrec
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 507
fv_trm4 and fv_trm4_list
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 508
where
957
+ − 509
"fv_trm4 (Vr4 x) = {atom x}"
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 510
| "fv_trm4 (Ap4 t ts) = (fv_trm4 t) \<union> (fv_trm4_list ts)"
957
+ − 511
| "fv_trm4 (Lm4 x t) = (fv_trm4 t) - {atom x}"
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 512
| "fv_trm4_list ([]) = {}"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 513
| "fv_trm4_list (t#ts) = (fv_trm4 t) \<union> (fv_trm4_list ts)"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 514
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 515
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 516
(* needs to be stated by the package *)
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 517
(* there cannot be a clause for lists, as *)
957
+ − 518
(* permuteutations are already defined in Nominal (also functions, options, and so on) *)
+ − 519
instantiation
+ − 520
trm4 :: pt
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 521
begin
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 522
957
+ − 523
(* does not work yet *)
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 524
primrec
963
+ − 525
permute_trm4 and permute_trm4_list
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 526
where
957
+ − 527
"permute_trm4 pi (Vr4 a) = Vr4 (pi \<bullet> a)"
963
+ − 528
| "permute_trm4 pi (Ap4 t ts) = Ap4 (permute_trm4 pi t) (permute_trm4_list pi ts)"
957
+ − 529
| "permute_trm4 pi (Lm4 a t) = Lm4 (pi \<bullet> a) (permute_trm4 pi t)"
963
+ − 530
| "permute_trm4_list pi ([]) = []"
+ − 531
| "permute_trm4_list pi (t#ts) = (permute_trm4 pi t) # (permute_trm4_list pi ts)"
+ − 532
+ − 533
lemma pt_trm4_list_zero:
+ − 534
fixes t::trm4
+ − 535
and ts::"trm4 list"
+ − 536
shows "0 \<bullet> t = t"
+ − 537
and "permute_trm4_list 0 ts = ts"
+ − 538
apply(induct t and ts rule: trm4.inducts)
+ − 539
apply(simp_all)
+ − 540
done
+ − 541
+ − 542
lemma pt_trm4_list_plus:
+ − 543
fixes t::trm4
+ − 544
and ts::"trm4 list"
+ − 545
shows "((p + q) \<bullet> t) = p \<bullet> (q \<bullet> t)"
+ − 546
and "(permute_trm4_list (p + q) ts) = permute_trm4_list p (permute_trm4_list q ts)"
+ − 547
apply(induct t and ts rule: trm4.inducts)
+ − 548
apply(simp_all)
+ − 549
done
+ − 550
+ − 551
+ − 552
instance
+ − 553
apply(default)
+ − 554
apply(simp_all add: pt_trm4_list_zero pt_trm4_list_plus)
+ − 555
done
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 556
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 557
end
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 558
963
+ − 559
(* "repairing" of the permute function *)
+ − 560
lemma repaired:
+ − 561
fixes ts::"trm4 list"
+ − 562
shows "permute_trm4_list p ts = p \<bullet> ts"
+ − 563
apply(induct ts)
+ − 564
apply(simp_all)
+ − 565
done
+ − 566
976
+ − 567
thm permute_trm4_permute_trm4_list.simps
963
+ − 568
thm permute_trm4_permute_trm4_list.simps[simplified repaired]
+ − 569
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 570
inductive
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 571
alpha4 :: "trm4 \<Rightarrow> trm4 \<Rightarrow> bool" ("_ \<approx>4 _" [100, 100] 100)
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 572
and alpha4list :: "trm4 list \<Rightarrow> trm4 list \<Rightarrow> bool" ("_ \<approx>4list _" [100, 100] 100)
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 573
where
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 574
a1: "a = b \<Longrightarrow> (Vr4 a) \<approx>4 (Vr4 b)"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 575
| a2: "\<lbrakk>t1 \<approx>4 t2; s1 \<approx>4list s2\<rbrakk> \<Longrightarrow> Ap4 t1 s1 \<approx>4 Ap4 t2 s2"
963
+ − 576
| a4: "\<exists>pi. (fv_trm4 t - {atom a} = fv_trm4 s - {atom b} \<and>
+ − 577
(fv_trm4 t - {atom a})\<sharp>* pi \<and>
+ − 578
(pi \<bullet> t) \<approx>4 s \<and>
+ − 579
(pi \<bullet> a) = b)
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 580
\<Longrightarrow> Lm4 a t \<approx>4 Lm4 b s"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 581
| a5: "[] \<approx>4list []"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 582
| a6: "\<lbrakk>t \<approx>4 s; ts \<approx>4list ss\<rbrakk> \<Longrightarrow> (t#ts) \<approx>4list (s#ss)"
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 583
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 584
lemma alpha4_equivp: "equivp alpha4" sorry
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 585
lemma alpha4list_equivp: "equivp alpha4list" sorry
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 586
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 587
quotient_type
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 588
qtrm4 = trm4 / alpha4 and
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 589
qtrm4list = "trm4 list" / alpha4list
1042
+ − 590
by (simp_all add: alpha4_equivp alpha4list_equivp)
1036
aaac8274f08c
The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 591
aaac8274f08c
The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 592
1035
+ − 593
datatype rtrm5 =
+ − 594
rVr5 "name"
+ − 595
| rAp5 "rtrm5" "rtrm5"
+ − 596
| rLt5 "rlts" "rtrm5"
+ − 597
and rlts =
+ − 598
rLnil
+ − 599
| rLcons "name" "rtrm5" "rlts"
+ − 600
+ − 601
primrec
1050
+ − 602
rbv5
1035
+ − 603
where
1050
+ − 604
"rbv5 rLnil = {}"
+ − 605
| "rbv5 (rLcons n t ltl) = {atom n} \<union> (rbv5 ltl)"
1035
+ − 606
+ − 607
primrec
+ − 608
rfv_trm5 and rfv_lts
+ − 609
where
+ − 610
"rfv_trm5 (rVr5 n) = {atom n}"
+ − 611
| "rfv_trm5 (rAp5 t s) = (rfv_trm5 t) \<union> (rfv_trm5 s)"
1050
+ − 612
| "rfv_trm5 (rLt5 lts t) = (rfv_trm5 t - rbv5 lts) \<union> (rfv_lts lts - rbv5 lts)"
1035
+ − 613
| "rfv_lts (rLnil) = {}"
+ − 614
| "rfv_lts (rLcons n t ltl) = (rfv_trm5 t) \<union> (rfv_lts ltl)"
+ − 615
+ − 616
instantiation
+ − 617
rtrm5 and rlts :: pt
+ − 618
begin
+ − 619
+ − 620
primrec
+ − 621
permute_rtrm5 and permute_rlts
+ − 622
where
+ − 623
"permute_rtrm5 pi (rVr5 a) = rVr5 (pi \<bullet> a)"
+ − 624
| "permute_rtrm5 pi (rAp5 t1 t2) = rAp5 (permute_rtrm5 pi t1) (permute_rtrm5 pi t2)"
1050
+ − 625
| "permute_rtrm5 pi (rLt5 ls t) = rLt5 (permute_rlts pi ls) (permute_rtrm5 pi t)"
1035
+ − 626
| "permute_rlts pi (rLnil) = rLnil"
+ − 627
| "permute_rlts pi (rLcons n t ls) = rLcons (pi \<bullet> n) (permute_rtrm5 pi t) (permute_rlts pi ls)"
+ − 628
+ − 629
lemma pt_rtrm5_zero:
+ − 630
fixes t::rtrm5
+ − 631
and l::rlts
+ − 632
shows "0 \<bullet> t = t"
+ − 633
and "0 \<bullet> l = l"
+ − 634
apply(induct t and l rule: rtrm5_rlts.inducts)
+ − 635
apply(simp_all)
+ − 636
done
+ − 637
+ − 638
lemma pt_rtrm5_plus:
+ − 639
fixes t::rtrm5
+ − 640
and l::rlts
+ − 641
shows "((p + q) \<bullet> t) = p \<bullet> (q \<bullet> t)"
+ − 642
and "((p + q) \<bullet> l) = p \<bullet> (q \<bullet> l)"
+ − 643
apply(induct t and l rule: rtrm5_rlts.inducts)
+ − 644
apply(simp_all)
+ − 645
done
+ − 646
+ − 647
instance
+ − 648
apply default
+ − 649
apply(simp_all add: pt_rtrm5_zero pt_rtrm5_plus)
+ − 650
done
+ − 651
950
98764f25f012
added Terms to Nominal - Instantiation of two types does not work (ask Florian)
Christian Urban <urbanc@in.tum.de>
parents:
diff
changeset
+ − 652
end
1035
+ − 653
1036
aaac8274f08c
The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 654
inductive
aaac8274f08c
The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 655
alpha5 :: "rtrm5 \<Rightarrow> rtrm5 \<Rightarrow> bool" ("_ \<approx>5 _" [100, 100] 100)
aaac8274f08c
The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 656
and
aaac8274f08c
The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 657
alphalts :: "rlts \<Rightarrow> rlts \<Rightarrow> bool" ("_ \<approx>l _" [100, 100] 100)
aaac8274f08c
The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 658
where
aaac8274f08c
The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 659
a1: "a = b \<Longrightarrow> (rVr5 a) \<approx>5 (rVr5 b)"
aaac8274f08c
The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 660
| a2: "\<lbrakk>t1 \<approx>5 t2; s1 \<approx>5 s2\<rbrakk> \<Longrightarrow> rAp5 t1 s1 \<approx>5 rAp5 t2 s2"
1057
+ − 661
| a3: "\<lbrakk>\<exists>pi. ((rbv5 l1, t1) \<approx>gen alpha5 rfv_trm5 pi (rbv5 l2, t2));
+ − 662
\<exists>pi. ((rbv5 l1, l1) \<approx>gen alphalts rfv_lts pi (rbv5 l2, l2))\<rbrakk>
1036
aaac8274f08c
The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 663
\<Longrightarrow> rLt5 l1 t1 \<approx>5 rLt5 l2 t2"
aaac8274f08c
The alpha-equivalence relation for let-rec. Not sure if correct...
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 664
| a4: "rLnil \<approx>l rLnil"
1040
+ − 665
| a5: "ls1 \<approx>l ls2 \<Longrightarrow> t1 \<approx>5 t2 \<Longrightarrow> n1 = n2 \<Longrightarrow> rLcons n1 t1 ls1 \<approx>l rLcons n2 t2 ls2"
+ − 666
+ − 667
print_theorems
1035
+ − 668
1040
+ − 669
lemma alpha5_inj:
+ − 670
"((rVr5 a) \<approx>5 (rVr5 b)) = (a = b)"
+ − 671
"(rAp5 t1 s1 \<approx>5 rAp5 t2 s2) = (t1 \<approx>5 t2 \<and> s1 \<approx>5 s2)"
1057
+ − 672
"(rLt5 l1 t1 \<approx>5 rLt5 l2 t2) = ((\<exists>pi. ((rbv5 l1, t1) \<approx>gen alpha5 rfv_trm5 pi (rbv5 l2, t2))) \<and>
+ − 673
(\<exists>pi. ((rbv5 l1, l1) \<approx>gen alphalts rfv_lts pi (rbv5 l2, l2))))"
1040
+ − 674
"rLnil \<approx>l rLnil"
1057
+ − 675
"(rLcons n1 t1 ls1 \<approx>l rLcons n2 t2 ls2) = (n1 = n2 \<and> ls1 \<approx>l ls2 \<and> t1 \<approx>5 t2)"
1040
+ − 676
apply -
+ − 677
apply (simp_all add: alpha5_alphalts.intros)
+ − 678
apply rule
+ − 679
apply (erule alpha5.cases)
+ − 680
apply (simp_all add: alpha5_alphalts.intros)
+ − 681
apply rule
+ − 682
apply (erule alpha5.cases)
+ − 683
apply (simp_all add: alpha5_alphalts.intros)
+ − 684
apply rule
+ − 685
apply (erule alpha5.cases)
+ − 686
apply (simp_all add: alpha5_alphalts.intros)
+ − 687
apply rule
+ − 688
apply (erule alphalts.cases)
+ − 689
apply (simp_all add: alpha5_alphalts.intros)
+ − 690
done
+ − 691
+ − 692
lemma alpha5_equivps:
+ − 693
shows "equivp alpha5"
+ − 694
and "equivp alphalts"
+ − 695
sorry
+ − 696
+ − 697
quotient_type
+ − 698
trm5 = rtrm5 / alpha5
+ − 699
and
+ − 700
lts = rlts / alphalts
+ − 701
by (auto intro: alpha5_equivps)
+ − 702
1046
+ − 703
quotient_definition
+ − 704
"Vr5 :: name \<Rightarrow> trm5"
+ − 705
as
+ − 706
"rVr5"
+ − 707
+ − 708
quotient_definition
+ − 709
"Ap5 :: trm5 \<Rightarrow> trm5 \<Rightarrow> trm5"
+ − 710
as
+ − 711
"rAp5"
+ − 712
+ − 713
quotient_definition
+ − 714
"Lt5 :: lts \<Rightarrow> trm5 \<Rightarrow> trm5"
+ − 715
as
+ − 716
"rLt5"
+ − 717
+ − 718
quotient_definition
+ − 719
"Lnil :: lts"
+ − 720
as
+ − 721
"rLnil"
+ − 722
+ − 723
quotient_definition
+ − 724
"Lcons :: name \<Rightarrow> trm5 \<Rightarrow> lts \<Rightarrow> lts"
+ − 725
as
+ − 726
"rLcons"
+ − 727
+ − 728
quotient_definition
+ − 729
"fv_trm5 :: trm5 \<Rightarrow> atom set"
+ − 730
as
+ − 731
"rfv_trm5"
+ − 732
+ − 733
quotient_definition
1050
+ − 734
"fv_lts :: lts \<Rightarrow> atom set"
1046
+ − 735
as
+ − 736
"rfv_lts"
+ − 737
1050
+ − 738
quotient_definition
+ − 739
"bv5 :: lts \<Rightarrow> atom set"
+ − 740
as
+ − 741
"rbv5"
+ − 742
+ − 743
lemma alpha5_rfv:
+ − 744
"(t \<approx>5 s \<Longrightarrow> rfv_trm5 t = rfv_trm5 s)"
+ − 745
"(l \<approx>l m \<Longrightarrow> rfv_lts l = rfv_lts m)"
+ − 746
apply(induct rule: alpha5_alphalts.inducts)
+ − 747
apply(simp_all add: alpha_gen)
+ − 748
done
+ − 749
+ − 750
lemma [quot_respect]:
+ − 751
"(op = ===> alpha5 ===> alpha5) permute permute"
+ − 752
"(op = ===> alphalts ===> alphalts) permute permute"
+ − 753
"(op = ===> alpha5) rVr5 rVr5"
+ − 754
"(alpha5 ===> alpha5 ===> alpha5) rAp5 rAp5"
+ − 755
"(alphalts ===> alpha5 ===> alpha5) rLt5 rLt5"
+ − 756
"(alphalts ===> alpha5 ===> alpha5) rLt5 rLt5"
+ − 757
"(op = ===> alpha5 ===> alphalts ===> alphalts) rLcons rLcons"
+ − 758
"(alpha5 ===> op =) rfv_trm5 rfv_trm5"
+ − 759
"(alphalts ===> op =) rfv_lts rfv_lts"
+ − 760
"(alphalts ===> op =) rbv5 rbv5"
+ − 761
sorry
+ − 762
1053
+ − 763
lemma bv_list_rsp:
1055
+ − 764
shows "x \<approx>l y \<Longrightarrow> rbv5 x = rbv5 y"
+ − 765
apply(induct rule: alpha5_alphalts.inducts(2))
1053
+ − 766
apply(simp_all)
+ − 767
done
+ − 768
1057
+ − 769
1053
+ − 770
lemma
+ − 771
shows "(alphalts ===> op =) rbv5 rbv5"
+ − 772
by (simp add: bv_list_rsp)
+ − 773
1073
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 774
lemmas trm5_lts_inducts = rtrm5_rlts.inducts[quot_lifted]
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 775
1050
+ − 776
instantiation trm5 and lts :: pt
+ − 777
begin
+ − 778
+ − 779
quotient_definition
+ − 780
"permute_trm5 :: perm \<Rightarrow> trm5 \<Rightarrow> trm5"
+ − 781
as
+ − 782
"permute :: perm \<Rightarrow> rtrm5 \<Rightarrow> rtrm5"
+ − 783
+ − 784
quotient_definition
+ − 785
"permute_lts :: perm \<Rightarrow> lts \<Rightarrow> lts"
+ − 786
as
+ − 787
"permute :: perm \<Rightarrow> rlts \<Rightarrow> rlts"
+ − 788
+ − 789
lemma trm5_lts_zero:
+ − 790
"0 \<bullet> (x\<Colon>trm5) = x"
+ − 791
"0 \<bullet> (y\<Colon>lts) = y"
1073
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 792
apply(induct x and y rule: trm5_lts_inducts)
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 793
apply(simp_all add: permute_rtrm5_permute_rlts.simps[quot_lifted])
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 794
done
1050
+ − 795
+ − 796
lemma trm5_lts_plus:
+ − 797
"(p + q) \<bullet> (x\<Colon>trm5) = p \<bullet> q \<bullet> x"
+ − 798
"(p + q) \<bullet> (y\<Colon>lts) = p \<bullet> q \<bullet> y"
1073
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 799
apply(induct x and y rule: trm5_lts_inducts)
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 800
apply(simp_all add: permute_rtrm5_permute_rlts.simps[quot_lifted])
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 801
done
1050
+ − 802
+ − 803
instance
+ − 804
apply default
+ − 805
apply (simp_all add: trm5_lts_zero trm5_lts_plus)
+ − 806
done
1040
+ − 807
1035
+ − 808
end
1050
+ − 809
1073
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 810
lemmas permute_trm5_lts = permute_rtrm5_permute_rlts.simps[quot_lifted]
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 811
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 812
lemmas alpha5_INJ = alpha5_inj[unfolded alpha_gen, quot_lifted, folded alpha_gen]
1050
+ − 813
1073
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 814
lemmas bv5[simp] = rbv5.simps[quot_lifted]
1050
+ − 815
1073
53350d409473
Cleaned Terms using [lifted] and found a workaround for the instantiation problem.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 816
lemmas fv_trm5_lts[simp] = rfv_trm5_rfv_lts.simps[quot_lifted]
1050
+ − 817
+ − 818
lemma lets_ok:
+ − 819
"(Lt5 (Lcons x (Vr5 x) Lnil) (Vr5 x)) = (Lt5 (Lcons y (Vr5 y) Lnil) (Vr5 y))"
+ − 820
apply (subst alpha5_INJ)
1057
+ − 821
apply (rule conjI)
+ − 822
apply (rule_tac x="(x \<leftrightarrow> y)" in exI)
+ − 823
apply (simp only: alpha_gen)
+ − 824
apply (simp add: permute_trm5_lts fresh_star_def)
1050
+ − 825
apply (rule_tac x="(x \<leftrightarrow> y)" in exI)
+ − 826
apply (simp only: alpha_gen)
1052
+ − 827
apply (simp add: permute_trm5_lts fresh_star_def)
+ − 828
done
1050
+ − 829
1058
+ − 830
lemma lets_ok2:
+ − 831
"(Lt5 (Lcons x (Vr5 x) (Lcons y (Vr5 y) Lnil)) (Ap5 (Vr5 x) (Vr5 y))) =
+ − 832
(Lt5 (Lcons y (Vr5 y) (Lcons x (Vr5 x) Lnil)) (Ap5 (Vr5 x) (Vr5 y)))"
+ − 833
apply (subst alpha5_INJ)
+ − 834
apply (rule conjI)
+ − 835
apply (rule_tac x="0 :: perm" in exI)
+ − 836
apply (simp only: alpha_gen)
+ − 837
apply (simp add: permute_trm5_lts fresh_star_def)
+ − 838
apply (rule_tac x="(x \<leftrightarrow> y)" in exI)
+ − 839
apply (simp only: alpha_gen)
+ − 840
apply (simp add: permute_trm5_lts fresh_star_def)
+ − 841
done
+ − 842
+ − 843
1057
+ − 844
lemma lets_not_ok1:
1056
+ − 845
"x \<noteq> y \<Longrightarrow> (Lt5 (Lcons x (Vr5 x) (Lcons y (Vr5 y) Lnil)) (Ap5 (Vr5 x) (Vr5 y))) \<noteq>
1057
+ − 846
(Lt5 (Lcons y (Vr5 x) (Lcons x (Vr5 y) Lnil)) (Ap5 (Vr5 x) (Vr5 y)))"
+ − 847
apply (subst alpha5_INJ(3))
+ − 848
apply(clarify)
1056
+ − 849
apply (simp add: alpha_gen)
+ − 850
apply (simp add: permute_trm5_lts fresh_star_def)
1057
+ − 851
apply (simp add: alpha5_INJ(5))
+ − 852
apply(clarify)
+ − 853
apply (simp add: alpha5_INJ(2))
+ − 854
apply (simp only: alpha5_INJ(1))
1056
+ − 855
done
+ − 856
1058
+ − 857
lemma distinct_helper:
+ − 858
shows "\<not>(rVr5 x \<approx>5 rAp5 y z)"
+ − 859
apply auto
+ − 860
apply (erule alpha5.cases)
+ − 861
apply (simp_all only: rtrm5.distinct)
+ − 862
done
1057
+ − 863
1058
+ − 864
lemma distinct_helper2:
+ − 865
shows "(Vr5 x) \<noteq> (Ap5 y z)"
+ − 866
by (lifting distinct_helper)
1057
+ − 867
1058
+ − 868
lemma lets_nok:
+ − 869
"x \<noteq> y \<Longrightarrow> x \<noteq> z \<Longrightarrow> z \<noteq> y \<Longrightarrow>
+ − 870
(Lt5 (Lcons x (Ap5 (Vr5 z) (Vr5 z)) (Lcons y (Vr5 z) Lnil)) (Ap5 (Vr5 x) (Vr5 y))) \<noteq>
+ − 871
(Lt5 (Lcons y (Vr5 z) (Lcons x (Ap5 (Vr5 z) (Vr5 z)) Lnil)) (Ap5 (Vr5 x) (Vr5 y)))"
+ − 872
apply (subst alpha5_INJ)
+ − 873
apply (simp only: alpha_gen permute_trm5_lts fresh_star_def)
+ − 874
apply (subst alpha5_INJ(5))
+ − 875
apply (subst alpha5_INJ(5))
+ − 876
apply (simp add: distinct_helper2)
+ − 877
done
1057
+ − 878
1048
+ − 879
text {* type schemes *}
+ − 880
datatype ty =
+ − 881
Var "name"
+ − 882
| Fun "ty" "ty"
+ − 883
+ − 884
instantiation
+ − 885
ty :: pt
+ − 886
begin
+ − 887
+ − 888
primrec
+ − 889
permute_ty
+ − 890
where
+ − 891
"permute_ty pi (Var a) = Var (pi \<bullet> a)"
+ − 892
| "permute_ty pi (Fun T1 T2) = Fun (permute_ty pi T1) (permute_ty pi T2)"
1046
+ − 893
1048
+ − 894
lemma pt_ty_zero:
+ − 895
fixes T::ty
+ − 896
shows "0 \<bullet> T = T"
+ − 897
apply(induct T rule: ty.inducts)
+ − 898
apply(simp_all)
+ − 899
done
1046
+ − 900
1048
+ − 901
lemma pt_ty_plus:
+ − 902
fixes T::ty
+ − 903
shows "((p + q) \<bullet> T) = p \<bullet> (q \<bullet> T)"
+ − 904
apply(induct T rule: ty.inducts)
+ − 905
apply(simp_all)
+ − 906
done
+ − 907
+ − 908
instance
+ − 909
apply default
+ − 910
apply(simp_all add: pt_ty_zero pt_ty_plus)
+ − 911
done
1046
+ − 912
1035
+ − 913
end
1048
+ − 914
+ − 915
datatype tyS =
+ − 916
All "name set" "ty"
1046
+ − 917
1048
+ − 918
instantiation
+ − 919
tyS :: pt
+ − 920
begin
+ − 921
+ − 922
primrec
+ − 923
permute_tyS
+ − 924
where
+ − 925
"permute_tyS pi (All xs T) = All (pi \<bullet> xs) (pi \<bullet> T)"
1046
+ − 926
1048
+ − 927
lemma pt_tyS_zero:
+ − 928
fixes T::tyS
+ − 929
shows "0 \<bullet> T = T"
+ − 930
apply(induct T rule: tyS.inducts)
+ − 931
apply(simp_all)
+ − 932
done
1046
+ − 933
1048
+ − 934
lemma pt_tyS_plus:
+ − 935
fixes T::tyS
+ − 936
shows "((p + q) \<bullet> T) = p \<bullet> (q \<bullet> T)"
+ − 937
apply(induct T rule: tyS.inducts)
+ − 938
apply(simp_all)
+ − 939
done
+ − 940
+ − 941
instance
+ − 942
apply default
+ − 943
apply(simp_all add: pt_tyS_zero pt_tyS_plus)
+ − 944
done
+ − 945
+ − 946
end
1046
+ − 947
1040
+ − 948
1048
+ − 949
abbreviation
+ − 950
"atoms xs \<equiv> {atom x| x. x \<in> xs}"
+ − 951
+ − 952
primrec
+ − 953
rfv_ty
+ − 954
where
+ − 955
"rfv_ty (Var n) = {atom n}"
+ − 956
| "rfv_ty (Fun T1 T2) = (rfv_ty T1) \<union> (rfv_ty T2)"
+ − 957
+ − 958
primrec
+ − 959
rfv_tyS
+ − 960
where
+ − 961
"rfv_tyS (All xs T) = (rfv_ty T - atoms xs)"
+ − 962
+ − 963
inductive
+ − 964
alpha_tyS :: "tyS \<Rightarrow> tyS \<Rightarrow> bool" ("_ \<approx>tyS _" [100, 100] 100)
+ − 965
where
+ − 966
a1: "\<exists>pi. ((atoms xs1, T1) \<approx>gen (op =) rfv_ty pi (atoms xs2, T2))
+ − 967
\<Longrightarrow> All xs1 T1 \<approx>tyS All xs2 T2"
+ − 968
+ − 969
lemma
+ − 970
shows "All {a, b} (Fun (Var a) (Var b)) \<approx>tyS All {b, a} (Fun (Var a) (Var b))"
+ − 971
apply(rule a1)
+ − 972
apply(simp add: alpha_gen)
+ − 973
apply(rule_tac x="0::perm" in exI)
+ − 974
apply(simp add: fresh_star_def)
+ − 975
done
+ − 976
+ − 977
lemma
+ − 978
shows "All {a, b} (Fun (Var a) (Var b)) \<approx>tyS All {a, b} (Fun (Var b) (Var a))"
+ − 979
apply(rule a1)
+ − 980
apply(simp add: alpha_gen)
+ − 981
apply(rule_tac x="(atom a \<rightleftharpoons> atom b)" in exI)
+ − 982
apply(simp add: fresh_star_def)
+ − 983
done
+ − 984
+ − 985
lemma
+ − 986
shows "All {a, b, c} (Fun (Var a) (Var b)) \<approx>tyS All {a, b} (Fun (Var a) (Var b))"
+ − 987
apply(rule a1)
+ − 988
apply(simp add: alpha_gen)
+ − 989
apply(rule_tac x="0::perm" in exI)
+ − 990
apply(simp add: fresh_star_def)
+ − 991
done
+ − 992
+ − 993
lemma
+ − 994
assumes a: "a \<noteq> b"
+ − 995
shows "\<not>(All {a, b} (Fun (Var a) (Var b)) \<approx>tyS All {c} (Fun (Var c) (Var c)))"
+ − 996
using a
+ − 997
apply(clarify)
+ − 998
apply(erule alpha_tyS.cases)
+ − 999
apply(simp add: alpha_gen)
+ − 1000
apply(erule conjE)+
+ − 1001
apply(erule exE)
+ − 1002
apply(erule conjE)+
+ − 1003
apply(clarify)
+ − 1004
apply(simp)
+ − 1005
apply(simp add: fresh_star_def)
+ − 1006
apply(auto)
+ − 1007
done
1051
+ − 1008
1048
+ − 1009
1035
+ − 1010
end