1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1
theory Terms
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 2
imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "Abs" "Perm" "Fv"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 3
begin
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 4
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 5
atom_decl name
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 6
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 7
text {* primrec seems to be genarally faster than fun *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 8
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 9
section {*** lets with binding patterns ***}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 10
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 11
datatype rtrm1 =
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 12
rVr1 "name"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 13
| rAp1 "rtrm1" "rtrm1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 14
| rLm1 "name" "rtrm1" --"name is bound in trm1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 15
| rLt1 "bp" "rtrm1" "rtrm1" --"all variables in bp are bound in the 2nd trm1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 16
and bp =
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 17
BUnit
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 18
| BVr "name"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 19
| BPr "bp" "bp"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 20
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 21
(* to be given by the user *)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 22
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 23
primrec
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 24
bv1
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 25
where
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 26
"bv1 (BUnit) = {}"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 27
| "bv1 (BVr x) = {atom x}"
1183
+ − 28
| "bv1 (BPr bp1 bp2) = (bv1 bp1) \<union> (bv1 bp2)"
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 29
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 30
local_setup {* define_raw_fv "Terms.rtrm1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 31
[[[[]], [[], []], [[(NONE, 0)], [(NONE, 0)]], [[(SOME @{term bv1}, 0)], [], [(SOME @{term bv1}, 0)]]],
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 32
[[], [[]], [[], []]]] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 33
print_theorems
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 34
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 35
setup {* snd o define_raw_perms ["rtrm1", "bp"] ["Terms.rtrm1", "Terms.bp"] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 36
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 37
inductive
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 38
alpha1 :: "rtrm1 \<Rightarrow> rtrm1 \<Rightarrow> bool" ("_ \<approx>1 _" [100, 100] 100)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 39
where
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 40
a1: "a = b \<Longrightarrow> (rVr1 a) \<approx>1 (rVr1 b)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 41
| a2: "\<lbrakk>t1 \<approx>1 t2; s1 \<approx>1 s2\<rbrakk> \<Longrightarrow> rAp1 t1 s1 \<approx>1 rAp1 t2 s2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 42
| a3: "(\<exists>pi. (({atom aa}, t) \<approx>gen alpha1 fv_rtrm1 pi ({atom ab}, s))) \<Longrightarrow> rLm1 aa t \<approx>1 rLm1 ab s"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 43
| a4: "t1 \<approx>1 t2 \<Longrightarrow> (\<exists>pi. (((bv1 b1), s1) \<approx>gen alpha1 fv_rtrm1 pi ((bv1 b2), s2))) \<Longrightarrow> rLt1 b1 t1 s1 \<approx>1 rLt1 b2 t2 s2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 44
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 45
lemma alpha1_inj:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 46
"(rVr1 a \<approx>1 rVr1 b) = (a = b)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 47
"(rAp1 t1 s1 \<approx>1 rAp1 t2 s2) = (t1 \<approx>1 t2 \<and> s1 \<approx>1 s2)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 48
"(rLm1 aa t \<approx>1 rLm1 ab s) = (\<exists>pi. (({atom aa}, t) \<approx>gen alpha1 fv_rtrm1 pi ({atom ab}, s)))"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 49
"(rLt1 b1 t1 s1 \<approx>1 rLt1 b2 t2 s2) = (t1 \<approx>1 t2 \<and> (\<exists>pi. (((bv1 b1), s1) \<approx>gen alpha1 fv_rtrm1 pi ((bv1 b2), s2))))"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 50
apply -
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 51
apply rule apply (erule alpha1.cases) apply (simp_all add: alpha1.intros)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 52
apply rule apply (erule alpha1.cases) apply (simp_all add: alpha1.intros)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 53
apply rule apply (erule alpha1.cases) apply (simp_all add: alpha1.intros)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 54
apply rule apply (erule alpha1.cases) apply (simp_all add: alpha1.intros)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 55
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 56
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 57
(* Shouyld we derive it? But bv is given by the user? *)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 58
lemma bv1_eqvt[eqvt]:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 59
shows "(pi \<bullet> bv1 x) = bv1 (pi \<bullet> x)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 60
apply (induct x)
1183
+ − 61
apply (simp_all add: empty_eqvt insert_eqvt atom_eqvt eqvts)
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 62
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 63
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 64
lemma fv_rtrm1_eqvt[eqvt]:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 65
"(pi\<bullet>fv_rtrm1 t) = fv_rtrm1 (pi\<bullet>t)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 66
"(pi\<bullet>fv_bp b) = fv_bp (pi\<bullet>b)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 67
apply (induct t and b)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 68
apply (simp_all add: insert_eqvt atom_eqvt empty_eqvt union_eqvt Diff_eqvt bv1_eqvt)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 69
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 70
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 71
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 72
lemma alpha1_eqvt:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 73
shows "t \<approx>1 s \<Longrightarrow> (pi \<bullet> t) \<approx>1 (pi \<bullet> s)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 74
apply (induct t s rule: alpha1.inducts)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 75
apply (simp_all add:eqvts alpha1_inj)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 76
apply (erule exE)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 77
apply (rule_tac x="pi \<bullet> pia" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 78
apply (simp add: alpha_gen)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 79
apply(erule conjE)+
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 80
apply(rule conjI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 81
apply(rule_tac ?p1="- pi" in permute_eq_iff[THEN iffD1])
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 82
apply(simp add: atom_eqvt Diff_eqvt insert_eqvt empty_eqvt fv_rtrm1_eqvt)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 83
apply(rule conjI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 84
apply(rule_tac ?p1="- pi" in fresh_star_permute_iff[THEN iffD1])
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 85
apply(simp add: atom_eqvt Diff_eqvt fv_rtrm1_eqvt insert_eqvt empty_eqvt)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 86
apply(simp add: permute_eqvt[symmetric])
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 87
apply (erule exE)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 88
apply (rule_tac x="pi \<bullet> pia" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 89
apply (simp add: alpha_gen)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 90
apply(erule conjE)+
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 91
apply(rule conjI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 92
apply(rule_tac ?p1="- pi" in permute_eq_iff[THEN iffD1])
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 93
apply(simp add: fv_rtrm1_eqvt Diff_eqvt bv1_eqvt)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 94
apply(rule conjI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 95
apply(rule_tac ?p1="- pi" in fresh_star_permute_iff[THEN iffD1])
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 96
apply(simp add: atom_eqvt fv_rtrm1_eqvt Diff_eqvt bv1_eqvt)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 97
apply(simp add: permute_eqvt[symmetric])
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 98
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 99
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 100
lemma alpha1_equivp: "equivp alpha1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 101
sorry
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 102
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 103
quotient_type trm1 = rtrm1 / alpha1
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 104
by (rule alpha1_equivp)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 105
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 106
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 107
"Vr1 :: name \<Rightarrow> trm1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 108
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 109
"rVr1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 110
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 111
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 112
"Ap1 :: trm1 \<Rightarrow> trm1 \<Rightarrow> trm1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 113
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 114
"rAp1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 115
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 116
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 117
"Lm1 :: name \<Rightarrow> trm1 \<Rightarrow> trm1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 118
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 119
"rLm1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 120
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 121
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 122
"Lt1 :: bp \<Rightarrow> trm1 \<Rightarrow> trm1 \<Rightarrow> trm1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 123
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 124
"rLt1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 125
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 126
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 127
"fv_trm1 :: trm1 \<Rightarrow> atom set"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 128
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 129
"fv_rtrm1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 130
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 131
lemma alpha_rfv1:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 132
shows "t \<approx>1 s \<Longrightarrow> fv_rtrm1 t = fv_rtrm1 s"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 133
apply(induct rule: alpha1.induct)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 134
apply(simp_all add: alpha_gen.simps)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 135
sorry
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 136
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 137
lemma [quot_respect]:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 138
"(op = ===> alpha1) rVr1 rVr1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 139
"(alpha1 ===> alpha1 ===> alpha1) rAp1 rAp1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 140
"(op = ===> alpha1 ===> alpha1) rLm1 rLm1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 141
"(op = ===> alpha1 ===> alpha1 ===> alpha1) rLt1 rLt1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 142
apply (auto simp add: alpha1_inj)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 143
apply (rule_tac x="0" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 144
apply (simp add: fresh_star_def fresh_zero_perm alpha_rfv1 alpha_gen)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 145
apply (rule_tac x="0" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 146
apply (simp add: alpha_gen fresh_star_def fresh_zero_perm alpha_rfv1)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 147
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 148
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 149
lemma [quot_respect]:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 150
"(op = ===> alpha1 ===> alpha1) permute permute"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 151
by (simp add: alpha1_eqvt)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 152
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 153
lemma [quot_respect]:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 154
"(alpha1 ===> op =) fv_rtrm1 fv_rtrm1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 155
by (simp add: alpha_rfv1)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 156
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 157
lemmas trm1_bp_induct = rtrm1_bp.induct[quot_lifted]
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 158
lemmas trm1_bp_inducts = rtrm1_bp.inducts[quot_lifted]
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 159
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 160
instantiation trm1 and bp :: pt
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 161
begin
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 162
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 163
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 164
"permute_trm1 :: perm \<Rightarrow> trm1 \<Rightarrow> trm1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 165
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 166
"permute :: perm \<Rightarrow> rtrm1 \<Rightarrow> rtrm1"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 167
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 168
lemmas permute_trm1[simp] = permute_rtrm1_permute_bp.simps[quot_lifted]
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 169
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 170
instance
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 171
apply default
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 172
apply(induct_tac [!] x rule: trm1_bp_inducts(1))
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 173
apply(simp_all)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 174
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 175
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 176
end
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 177
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 178
lemmas fv_trm1 = fv_rtrm1_fv_bp.simps[quot_lifted]
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 179
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 180
lemmas fv_trm1_eqvt = fv_rtrm1_eqvt[quot_lifted]
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 181
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 182
lemmas alpha1_INJ = alpha1_inj[unfolded alpha_gen, quot_lifted, folded alpha_gen]
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 183
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 184
lemma lm1_supp_pre:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 185
shows "(supp (atom x, t)) supports (Lm1 x t) "
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 186
apply(simp add: supports_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 187
apply(fold fresh_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 188
apply(simp add: fresh_Pair swap_fresh_fresh)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 189
apply(clarify)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 190
apply(subst swap_at_base_simps(3))
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 191
apply(simp_all add: fresh_atom)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 192
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 193
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 194
lemma lt1_supp_pre:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 195
shows "(supp (x, t, s)) supports (Lt1 t x s) "
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 196
apply(simp add: supports_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 197
apply(fold fresh_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 198
apply(simp add: fresh_Pair swap_fresh_fresh)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 199
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 200
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 201
lemma bp_supp: "finite (supp (bp :: bp))"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 202
apply (induct bp)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 203
apply(simp_all add: supp_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 204
apply (fold supp_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 205
apply (simp add: supp_at_base)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 206
apply(simp add: Collect_imp_eq)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 207
apply(simp add: Collect_neg_eq[symmetric])
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 208
apply (fold supp_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 209
apply (simp)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 210
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 211
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 212
instance trm1 :: fs
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 213
apply default
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 214
apply(induct_tac x rule: trm1_bp_inducts(1))
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 215
apply(simp_all)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 216
apply(simp add: supp_def alpha1_INJ eqvts)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 217
apply(simp add: supp_def[symmetric] supp_at_base)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 218
apply(simp only: supp_def alpha1_INJ eqvts permute_trm1)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 219
apply(simp add: Collect_imp_eq Collect_neg_eq)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 220
apply(rule supports_finite)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 221
apply(rule lm1_supp_pre)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 222
apply(simp add: supp_Pair supp_atom)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 223
apply(rule supports_finite)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 224
apply(rule lt1_supp_pre)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 225
apply(simp add: supp_Pair supp_atom bp_supp)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 226
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 227
1183
+ − 228
lemma fv_eq_bv: "fv_bp bp = bv1 bp"
+ − 229
apply(induct bp rule: trm1_bp_inducts(2))
+ − 230
apply(simp_all)
+ − 231
done
+ − 232
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 233
lemma supp_fv:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 234
shows "supp t = fv_trm1 t"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 235
apply(induct t rule: trm1_bp_inducts(1))
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 236
apply(simp_all)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 237
apply(simp add: supp_def permute_trm1 alpha1_INJ fv_trm1)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 238
apply(simp only: supp_at_base[simplified supp_def])
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 239
apply(simp add: supp_def permute_trm1 alpha1_INJ fv_trm1)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 240
apply(simp add: Collect_imp_eq Collect_neg_eq)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 241
apply(subgoal_tac "supp (Lm1 name rtrm1) = supp (Abs {atom name} rtrm1)")
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 242
apply(simp add: supp_Abs fv_trm1)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 243
apply(simp (no_asm) add: supp_def permute_set_eq atom_eqvt)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 244
apply(simp add: alpha1_INJ)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 245
apply(simp add: Abs_eq_iff)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 246
apply(simp add: alpha_gen.simps)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 247
apply(simp add: supp_eqvt[symmetric] fv_trm1_eqvt[symmetric])
1183
+ − 248
apply(subgoal_tac "supp (Lt1 bp rtrm11 rtrm12) = supp(rtrm11) \<union> supp (Abs (bv1 bp) rtrm12)")
+ − 249
apply(simp add: supp_Abs fv_trm1 fv_eq_bv)
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 250
apply(simp (no_asm) add: supp_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 251
apply(simp add: alpha1_INJ)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 252
apply(simp add: Abs_eq_iff)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 253
apply(simp add: alpha_gen)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 254
apply(simp add: supp_eqvt[symmetric] fv_trm1_eqvt[symmetric] bv1_eqvt)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 255
apply(simp add: Collect_imp_eq Collect_neg_eq)
1183
+ − 256
done
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 257
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 258
lemma trm1_supp:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 259
"supp (Vr1 x) = {atom x}"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 260
"supp (Ap1 t1 t2) = supp t1 \<union> supp t2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 261
"supp (Lm1 x t) = (supp t) - {atom x}"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 262
"supp (Lt1 b t s) = supp t \<union> (supp s - bv1 b)"
1183
+ − 263
by (simp_all add: supp_fv fv_trm1 fv_eq_bv)
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 264
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 265
lemma trm1_induct_strong:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 266
assumes "\<And>name b. P b (Vr1 name)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 267
and "\<And>rtrm11 rtrm12 b. \<lbrakk>\<And>c. P c rtrm11; \<And>c. P c rtrm12\<rbrakk> \<Longrightarrow> P b (Ap1 rtrm11 rtrm12)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 268
and "\<And>name rtrm1 b. \<lbrakk>\<And>c. P c rtrm1; (atom name) \<sharp> b\<rbrakk> \<Longrightarrow> P b (Lm1 name rtrm1)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 269
and "\<And>bp rtrm11 rtrm12 b. \<lbrakk>\<And>c. P c rtrm11; \<And>c. P c rtrm12; bv1 bp \<sharp>* b\<rbrakk> \<Longrightarrow> P b (Lt1 bp rtrm11 rtrm12)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 270
shows "P a rtrma"
1183
+ − 271
sorry
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 272
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 273
section {*** lets with single assignments ***}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 274
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 275
datatype rtrm2 =
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 276
rVr2 "name"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 277
| rAp2 "rtrm2" "rtrm2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 278
| rLm2 "name" "rtrm2" --"bind (name) in (rtrm2)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 279
| rLt2 "rassign" "rtrm2" --"bind (bv2 rassign) in (rtrm2)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 280
and rassign =
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 281
rAs "name" "rtrm2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 282
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 283
(* to be given by the user *)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 284
primrec
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 285
rbv2
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 286
where
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 287
"rbv2 (rAs x t) = {atom x}"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 288
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 289
local_setup {* define_raw_fv "Terms.rtrm2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 290
[[[[]], [[], []], [[(NONE, 0)], [(NONE, 0)]], [[(SOME @{term rbv2}, 0)], [(SOME @{term rbv2}, 0)]]],
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 291
[[[], []]]] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 292
print_theorems
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 293
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 294
setup {* snd o define_raw_perms ["rtrm2", "rassign"] ["Terms.rtrm2", "Terms.rassign"] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 295
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 296
inductive
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 297
alpha2 :: "rtrm2 \<Rightarrow> rtrm2 \<Rightarrow> bool" ("_ \<approx>2 _" [100, 100] 100)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 298
and
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 299
alpha2a :: "rassign \<Rightarrow> rassign \<Rightarrow> bool" ("_ \<approx>2a _" [100, 100] 100)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 300
where
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 301
a1: "a = b \<Longrightarrow> (rVr2 a) \<approx>2 (rVr2 b)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 302
| a2: "\<lbrakk>t1 \<approx>2 t2; s1 \<approx>2 s2\<rbrakk> \<Longrightarrow> rAp2 t1 s1 \<approx>2 rAp2 t2 s2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 303
| a3: "(\<exists>pi. (({atom a}, t) \<approx>gen alpha2 fv_rtrm2 pi ({atom b}, s))) \<Longrightarrow> rLm2 a t \<approx>2 rLm2 b s"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 304
| a4: "\<lbrakk>\<exists>pi. ((rbv2 bt, t) \<approx>gen alpha2 fv_rtrm2 pi ((rbv2 bs), s));
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 305
\<exists>pi. ((rbv2 bt, bt) \<approx>gen alpha2a fv_rassign pi (rbv2 bs, bs))\<rbrakk>
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 306
\<Longrightarrow> rLt2 bt t \<approx>2 rLt2 bs s"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 307
| a5: "\<lbrakk>a = b; t \<approx>2 s\<rbrakk> \<Longrightarrow> rAs a t \<approx>2a rAs b s" (* This way rbv2 can be lifted *)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 308
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 309
lemma alpha2_equivp:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 310
"equivp alpha2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 311
"equivp alpha2a"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 312
sorry
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 313
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 314
quotient_type
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 315
trm2 = rtrm2 / alpha2
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 316
and
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 317
assign = rassign / alpha2a
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 318
by (auto intro: alpha2_equivp)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 319
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 320
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 321
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 322
section {*** lets with many assignments ***}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 323
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 324
datatype trm3 =
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 325
Vr3 "name"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 326
| Ap3 "trm3" "trm3"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 327
| Lm3 "name" "trm3" --"bind (name) in (trm3)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 328
| Lt3 "assigns" "trm3" --"bind (bv3 assigns) in (trm3)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 329
and assigns =
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 330
ANil
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 331
| ACons "name" "trm3" "assigns"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 332
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 333
(* to be given by the user *)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 334
primrec
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 335
bv3
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 336
where
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 337
"bv3 ANil = {}"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 338
| "bv3 (ACons x t as) = {atom x} \<union> (bv3 as)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 339
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 340
local_setup {* define_raw_fv "Terms.trm3"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 341
[[[[]], [[], []], [[(NONE, 0)], [(NONE, 0)]], [[(SOME @{term bv3}, 0)], [(SOME @{term bv3}, 0)]]],
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 342
[[], [[], [], []]]] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 343
print_theorems
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 344
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 345
setup {* snd o define_raw_perms ["rtrm3", "assigns"] ["Terms.trm3", "Terms.assigns"] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 346
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 347
inductive
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 348
alpha3 :: "trm3 \<Rightarrow> trm3 \<Rightarrow> bool" ("_ \<approx>3 _" [100, 100] 100)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 349
and
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 350
alpha3a :: "assigns \<Rightarrow> assigns \<Rightarrow> bool" ("_ \<approx>3a _" [100, 100] 100)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 351
where
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 352
a1: "a = b \<Longrightarrow> (Vr3 a) \<approx>3 (Vr3 b)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 353
| a2: "\<lbrakk>t1 \<approx>3 t2; s1 \<approx>3 s2\<rbrakk> \<Longrightarrow> Ap3 t1 s1 \<approx>3 Ap3 t2 s2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 354
| a3: "(\<exists>pi. (({atom a}, t) \<approx>gen alpha3 fv_rtrm3 pi ({atom b}, s))) \<Longrightarrow> Lm3 a t \<approx>3 Lm3 b s"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 355
| a4: "\<lbrakk>\<exists>pi. ((bv3 bt, t) \<approx>gen alpha3 fv_trm3 pi ((bv3 bs), s));
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 356
\<exists>pi. ((bv3 bt, bt) \<approx>gen alpha3a fv_assign pi (bv3 bs, bs))\<rbrakk>
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 357
\<Longrightarrow> Lt3 bt t \<approx>3 Lt3 bs s"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 358
| a5: "ANil \<approx>3a ANil"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 359
| a6: "\<lbrakk>a = b; t \<approx>3 s; tt \<approx>3a st\<rbrakk> \<Longrightarrow> ACons a t tt \<approx>3a ACons b s st"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 360
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 361
lemma alpha3_equivp:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 362
"equivp alpha3"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 363
"equivp alpha3a"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 364
sorry
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 365
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 366
quotient_type
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 367
qtrm3 = trm3 / alpha3
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 368
and
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 369
qassigns = assigns / alpha3a
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 370
by (auto intro: alpha3_equivp)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 371
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 372
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 373
section {*** lam with indirect list recursion ***}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 374
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 375
datatype trm4 =
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 376
Vr4 "name"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 377
| Ap4 "trm4" "trm4 list"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 378
| Lm4 "name" "trm4" --"bind (name) in (trm)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 379
print_theorems
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 380
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 381
thm trm4.recs
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 382
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 383
local_setup {* define_raw_fv "Terms.trm4" [
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 384
[[[]], [[], []], [[(NONE, 0)], [(NONE, 0)]]], [[], [[], []]] ] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 385
print_theorems
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 386
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 387
(* there cannot be a clause for lists, as *)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 388
(* permutations are already defined in Nominal (also functions, options, and so on) *)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 389
setup {* snd o define_raw_perms ["trm4"] ["Terms.trm4"] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 390
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 391
(* "repairing" of the permute function *)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 392
lemma repaired:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 393
fixes ts::"trm4 list"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 394
shows "permute_trm4_list p ts = p \<bullet> ts"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 395
apply(induct ts)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 396
apply(simp_all)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 397
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 398
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 399
thm permute_trm4_permute_trm4_list.simps
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 400
thm permute_trm4_permute_trm4_list.simps[simplified repaired]
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 401
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 402
inductive
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 403
alpha4 :: "trm4 \<Rightarrow> trm4 \<Rightarrow> bool" ("_ \<approx>4 _" [100, 100] 100)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 404
and alpha4list :: "trm4 list \<Rightarrow> trm4 list \<Rightarrow> bool" ("_ \<approx>4list _" [100, 100] 100)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 405
where
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 406
a1: "a = b \<Longrightarrow> (Vr4 a) \<approx>4 (Vr4 b)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 407
| a2: "\<lbrakk>t1 \<approx>4 t2; s1 \<approx>4list s2\<rbrakk> \<Longrightarrow> Ap4 t1 s1 \<approx>4 Ap4 t2 s2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 408
| a3: "(\<exists>pi. (({atom a}, t) \<approx>gen alpha4 fv_rtrm4 pi ({atom b}, s))) \<Longrightarrow> Lm4 a t \<approx>4 Lm4 b s"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 409
| a5: "[] \<approx>4list []"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 410
| a6: "\<lbrakk>t \<approx>4 s; ts \<approx>4list ss\<rbrakk> \<Longrightarrow> (t#ts) \<approx>4list (s#ss)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 411
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 412
lemma alpha4_equivp: "equivp alpha4" sorry
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 413
lemma alpha4list_equivp: "equivp alpha4list" sorry
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 414
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 415
quotient_type
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 416
qtrm4 = trm4 / alpha4 and
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 417
qtrm4list = "trm4 list" / alpha4list
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 418
by (simp_all add: alpha4_equivp alpha4list_equivp)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 419
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 420
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 421
datatype rtrm5 =
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 422
rVr5 "name"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 423
| rAp5 "rtrm5" "rtrm5"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 424
| rLt5 "rlts" "rtrm5" --"bind (bv5 lts) in (rtrm5)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 425
and rlts =
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 426
rLnil
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 427
| rLcons "name" "rtrm5" "rlts"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 428
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 429
primrec
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 430
rbv5
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 431
where
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 432
"rbv5 rLnil = {}"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 433
| "rbv5 (rLcons n t ltl) = {atom n} \<union> (rbv5 ltl)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 434
1186
166cc41091b9
The alternate version of trm5 with additional binding. All proofs work the same.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 435
166cc41091b9
The alternate version of trm5 with additional binding. All proofs work the same.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 436
(*
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 437
local_setup {* define_raw_fv "Terms.rtrm5" [
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 438
[[[]], [[], []], [[(SOME @{term rbv5}, 0)], [(SOME @{term rbv5}, 0)]]], [[], [[], [], []]] ] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 439
print_theorems
1186
166cc41091b9
The alternate version of trm5 with additional binding. All proofs work the same.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 440
*)
166cc41091b9
The alternate version of trm5 with additional binding. All proofs work the same.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 441
(* Alternate version with additional binding of name in rlts in rLcons *)
166cc41091b9
The alternate version of trm5 with additional binding. All proofs work the same.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 442
local_setup {* define_raw_fv "Terms.rtrm5" [
166cc41091b9
The alternate version of trm5 with additional binding. All proofs work the same.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 443
[[[]], [[], []], [[(SOME @{term rbv5}, 0)], [(SOME @{term rbv5}, 0)]]], [[], [[(NONE,0)], [], [(NONE,0)]]] ] *}
166cc41091b9
The alternate version of trm5 with additional binding. All proofs work the same.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 444
print_theorems
166cc41091b9
The alternate version of trm5 with additional binding. All proofs work the same.
Cezary Kaliszyk <kaliszyk@in.tum.de>
diff
changeset
+ − 445
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 446
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 447
setup {* snd o define_raw_perms ["rtrm5", "rlts"] ["Terms.rtrm5", "Terms.rlts"] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 448
print_theorems
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 449
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 450
inductive
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 451
alpha5 :: "rtrm5 \<Rightarrow> rtrm5 \<Rightarrow> bool" ("_ \<approx>5 _" [100, 100] 100)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 452
and
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 453
alphalts :: "rlts \<Rightarrow> rlts \<Rightarrow> bool" ("_ \<approx>l _" [100, 100] 100)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 454
where
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 455
a1: "a = b \<Longrightarrow> (rVr5 a) \<approx>5 (rVr5 b)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 456
| a2: "\<lbrakk>t1 \<approx>5 t2; s1 \<approx>5 s2\<rbrakk> \<Longrightarrow> rAp5 t1 s1 \<approx>5 rAp5 t2 s2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 457
| a3: "\<lbrakk>\<exists>pi. ((rbv5 l1, t1) \<approx>gen alpha5 fv_rtrm5 pi (rbv5 l2, t2));
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 458
\<exists>pi. ((rbv5 l1, l1) \<approx>gen alphalts fv_rlts pi (rbv5 l2, l2))\<rbrakk>
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 459
\<Longrightarrow> rLt5 l1 t1 \<approx>5 rLt5 l2 t2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 460
| a4: "rLnil \<approx>l rLnil"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 461
| a5: "ls1 \<approx>l ls2 \<Longrightarrow> t1 \<approx>5 t2 \<Longrightarrow> n1 = n2 \<Longrightarrow> rLcons n1 t1 ls1 \<approx>l rLcons n2 t2 ls2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 462
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 463
print_theorems
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 464
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 465
lemma alpha5_inj:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 466
"((rVr5 a) \<approx>5 (rVr5 b)) = (a = b)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 467
"(rAp5 t1 s1 \<approx>5 rAp5 t2 s2) = (t1 \<approx>5 t2 \<and> s1 \<approx>5 s2)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 468
"(rLt5 l1 t1 \<approx>5 rLt5 l2 t2) = ((\<exists>pi. ((rbv5 l1, t1) \<approx>gen alpha5 fv_rtrm5 pi (rbv5 l2, t2))) \<and>
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 469
(\<exists>pi. ((rbv5 l1, l1) \<approx>gen alphalts fv_rlts pi (rbv5 l2, l2))))"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 470
"rLnil \<approx>l rLnil"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 471
"(rLcons n1 t1 ls1 \<approx>l rLcons n2 t2 ls2) = (n1 = n2 \<and> ls1 \<approx>l ls2 \<and> t1 \<approx>5 t2)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 472
apply -
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 473
apply (simp_all add: alpha5_alphalts.intros)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 474
apply rule
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 475
apply (erule alpha5.cases)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 476
apply (simp_all add: alpha5_alphalts.intros)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 477
apply rule
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 478
apply (erule alpha5.cases)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 479
apply (simp_all add: alpha5_alphalts.intros)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 480
apply rule
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 481
apply (erule alpha5.cases)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 482
apply (simp_all add: alpha5_alphalts.intros)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 483
apply rule
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 484
apply (erule alphalts.cases)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 485
apply (simp_all add: alpha5_alphalts.intros)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 486
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 487
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 488
lemma alpha5_equivps:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 489
shows "equivp alpha5"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 490
and "equivp alphalts"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 491
sorry
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 492
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 493
quotient_type
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 494
trm5 = rtrm5 / alpha5
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 495
and
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 496
lts = rlts / alphalts
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 497
by (auto intro: alpha5_equivps)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 498
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 499
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 500
"Vr5 :: name \<Rightarrow> trm5"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 501
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 502
"rVr5"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 503
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 504
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 505
"Ap5 :: trm5 \<Rightarrow> trm5 \<Rightarrow> trm5"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 506
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 507
"rAp5"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 508
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 509
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 510
"Lt5 :: lts \<Rightarrow> trm5 \<Rightarrow> trm5"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 511
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 512
"rLt5"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 513
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 514
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 515
"Lnil :: lts"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 516
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 517
"rLnil"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 518
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 519
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 520
"Lcons :: name \<Rightarrow> trm5 \<Rightarrow> lts \<Rightarrow> lts"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 521
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 522
"rLcons"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 523
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 524
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 525
"fv_trm5 :: trm5 \<Rightarrow> atom set"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 526
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 527
"fv_rtrm5"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 528
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 529
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 530
"fv_lts :: lts \<Rightarrow> atom set"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 531
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 532
"fv_rlts"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 533
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 534
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 535
"bv5 :: lts \<Rightarrow> atom set"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 536
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 537
"rbv5"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 538
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 539
lemma rbv5_eqvt:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 540
"pi \<bullet> (rbv5 x) = rbv5 (pi \<bullet> x)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 541
sorry
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 542
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 543
lemma fv_rtrm5_eqvt:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 544
"pi \<bullet> (fv_rtrm5 x) = fv_rtrm5 (pi \<bullet> x)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 545
sorry
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 546
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 547
lemma fv_rlts_eqvt:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 548
"pi \<bullet> (fv_rlts x) = fv_rlts (pi \<bullet> x)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 549
sorry
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 550
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 551
lemma alpha5_eqvt:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 552
"xa \<approx>5 y \<Longrightarrow> (x \<bullet> xa) \<approx>5 (x \<bullet> y)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 553
"xb \<approx>l ya \<Longrightarrow> (x \<bullet> xb) \<approx>l (x \<bullet> ya)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 554
apply(induct rule: alpha5_alphalts.inducts)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 555
apply (simp_all add: alpha5_inj)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 556
apply (erule exE)+
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 557
apply(unfold alpha_gen)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 558
apply (erule conjE)+
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 559
apply (rule conjI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 560
apply (rule_tac x="x \<bullet> pi" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 561
apply (rule conjI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 562
apply(rule_tac ?p1="- x" in permute_eq_iff[THEN iffD1])
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 563
apply(simp add: atom_eqvt Diff_eqvt insert_eqvt set_eqvt empty_eqvt rbv5_eqvt fv_rtrm5_eqvt)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 564
apply(rule conjI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 565
apply(rule_tac ?p1="- x" in fresh_star_permute_iff[THEN iffD1])
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 566
apply(simp add: atom_eqvt Diff_eqvt insert_eqvt set_eqvt empty_eqvt rbv5_eqvt fv_rtrm5_eqvt)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 567
apply (subst permute_eqvt[symmetric])
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 568
apply (simp)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 569
apply (rule_tac x="x \<bullet> pia" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 570
apply (rule conjI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 571
apply(rule_tac ?p1="- x" in permute_eq_iff[THEN iffD1])
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 572
apply(simp add: atom_eqvt Diff_eqvt insert_eqvt set_eqvt empty_eqvt rbv5_eqvt fv_rlts_eqvt)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 573
apply(rule conjI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 574
apply(rule_tac ?p1="- x" in fresh_star_permute_iff[THEN iffD1])
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 575
apply(simp add: atom_eqvt Diff_eqvt insert_eqvt set_eqvt empty_eqvt rbv5_eqvt fv_rlts_eqvt)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 576
apply (subst permute_eqvt[symmetric])
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 577
apply (simp)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 578
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 579
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 580
lemma alpha5_rfv:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 581
"(t \<approx>5 s \<Longrightarrow> fv_rtrm5 t = fv_rtrm5 s)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 582
"(l \<approx>l m \<Longrightarrow> fv_rlts l = fv_rlts m)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 583
apply(induct rule: alpha5_alphalts.inducts)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 584
apply(simp_all add: alpha_gen)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 585
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 586
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 587
lemma bv_list_rsp:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 588
shows "x \<approx>l y \<Longrightarrow> rbv5 x = rbv5 y"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 589
apply(induct rule: alpha5_alphalts.inducts(2))
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 590
apply(simp_all)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 591
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 592
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 593
lemma [quot_respect]:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 594
"(alphalts ===> op =) fv_rlts fv_rlts"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 595
"(alpha5 ===> op =) fv_rtrm5 fv_rtrm5"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 596
"(alphalts ===> op =) rbv5 rbv5"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 597
"(op = ===> alpha5) rVr5 rVr5"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 598
"(alpha5 ===> alpha5 ===> alpha5) rAp5 rAp5"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 599
"(alphalts ===> alpha5 ===> alpha5) rLt5 rLt5"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 600
"(alphalts ===> alpha5 ===> alpha5) rLt5 rLt5"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 601
"(op = ===> alpha5 ===> alphalts ===> alphalts) rLcons rLcons"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 602
"(op = ===> alpha5 ===> alpha5) permute permute"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 603
"(op = ===> alphalts ===> alphalts) permute permute"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 604
apply (simp_all add: alpha5_inj alpha5_rfv alpha5_eqvt bv_list_rsp)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 605
apply (clarify) apply (rule conjI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 606
apply (rule_tac x="0" in exI) apply (simp add: fresh_star_def fresh_zero_perm alpha_gen alpha5_rfv)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 607
apply (rule_tac x="0" in exI) apply (simp add: fresh_star_def fresh_zero_perm alpha_gen alpha5_rfv)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 608
apply (clarify) apply (rule conjI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 609
apply (rule_tac x="0" in exI) apply (simp add: fresh_star_def fresh_zero_perm alpha_gen alpha5_rfv)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 610
apply (rule_tac x="0" in exI) apply (simp add: fresh_star_def fresh_zero_perm alpha_gen alpha5_rfv)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 611
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 612
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 613
lemma
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 614
shows "(alphalts ===> op =) rbv5 rbv5"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 615
by (simp add: bv_list_rsp)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 616
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 617
lemmas trm5_lts_inducts = rtrm5_rlts.inducts[quot_lifted]
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 618
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 619
instantiation trm5 and lts :: pt
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 620
begin
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 621
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 622
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 623
"permute_trm5 :: perm \<Rightarrow> trm5 \<Rightarrow> trm5"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 624
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 625
"permute :: perm \<Rightarrow> rtrm5 \<Rightarrow> rtrm5"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 626
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 627
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 628
"permute_lts :: perm \<Rightarrow> lts \<Rightarrow> lts"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 629
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 630
"permute :: perm \<Rightarrow> rlts \<Rightarrow> rlts"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 631
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 632
lemma trm5_lts_zero:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 633
"0 \<bullet> (x\<Colon>trm5) = x"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 634
"0 \<bullet> (y\<Colon>lts) = y"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 635
apply(induct x and y rule: trm5_lts_inducts)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 636
apply(simp_all add: permute_rtrm5_permute_rlts.simps[quot_lifted])
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 637
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 638
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 639
lemma trm5_lts_plus:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 640
"(p + q) \<bullet> (x\<Colon>trm5) = p \<bullet> q \<bullet> x"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 641
"(p + q) \<bullet> (y\<Colon>lts) = p \<bullet> q \<bullet> y"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 642
apply(induct x and y rule: trm5_lts_inducts)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 643
apply(simp_all add: permute_rtrm5_permute_rlts.simps[quot_lifted])
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 644
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 645
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 646
instance
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 647
apply default
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 648
apply (simp_all add: trm5_lts_zero trm5_lts_plus)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 649
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 650
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 651
end
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 652
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 653
lemmas permute_trm5_lts = permute_rtrm5_permute_rlts.simps[quot_lifted]
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 654
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 655
lemmas alpha5_INJ = alpha5_inj[unfolded alpha_gen, quot_lifted, folded alpha_gen]
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 656
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 657
lemmas bv5[simp] = rbv5.simps[quot_lifted]
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 658
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 659
lemmas fv_trm5_lts[simp] = fv_rtrm5_fv_rlts.simps[quot_lifted]
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 660
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 661
lemma lets_ok:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 662
"(Lt5 (Lcons x (Vr5 x) Lnil) (Vr5 x)) = (Lt5 (Lcons y (Vr5 y) Lnil) (Vr5 y))"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 663
apply (subst alpha5_INJ)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 664
apply (rule conjI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 665
apply (rule_tac x="(x \<leftrightarrow> y)" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 666
apply (simp only: alpha_gen)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 667
apply (simp add: permute_trm5_lts fresh_star_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 668
apply (rule_tac x="(x \<leftrightarrow> y)" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 669
apply (simp only: alpha_gen)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 670
apply (simp add: permute_trm5_lts fresh_star_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 671
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 672
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 673
lemma lets_ok2:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 674
"(Lt5 (Lcons x (Vr5 x) (Lcons y (Vr5 y) Lnil)) (Ap5 (Vr5 x) (Vr5 y))) =
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 675
(Lt5 (Lcons y (Vr5 y) (Lcons x (Vr5 x) Lnil)) (Ap5 (Vr5 x) (Vr5 y)))"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 676
apply (subst alpha5_INJ)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 677
apply (rule conjI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 678
apply (rule_tac x="0 :: perm" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 679
apply (simp only: alpha_gen)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 680
apply (simp add: permute_trm5_lts fresh_star_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 681
apply (rule_tac x="(x \<leftrightarrow> y)" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 682
apply (simp only: alpha_gen)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 683
apply (simp add: permute_trm5_lts fresh_star_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 684
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 685
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 686
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 687
lemma lets_not_ok1:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 688
"x \<noteq> y \<Longrightarrow> (Lt5 (Lcons x (Vr5 x) (Lcons y (Vr5 y) Lnil)) (Ap5 (Vr5 x) (Vr5 y))) \<noteq>
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 689
(Lt5 (Lcons y (Vr5 x) (Lcons x (Vr5 y) Lnil)) (Ap5 (Vr5 x) (Vr5 y)))"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 690
apply (subst alpha5_INJ(3))
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 691
apply(clarify)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 692
apply (simp add: alpha_gen)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 693
apply (simp add: permute_trm5_lts fresh_star_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 694
apply (simp add: alpha5_INJ(5))
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 695
apply(clarify)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 696
apply (simp add: alpha5_INJ(2))
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 697
apply (simp only: alpha5_INJ(1))
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 698
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 699
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 700
lemma distinct_helper:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 701
shows "\<not>(rVr5 x \<approx>5 rAp5 y z)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 702
apply auto
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 703
apply (erule alpha5.cases)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 704
apply (simp_all only: rtrm5.distinct)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 705
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 706
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 707
lemma distinct_helper2:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 708
shows "(Vr5 x) \<noteq> (Ap5 y z)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 709
by (lifting distinct_helper)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 710
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 711
lemma lets_nok:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 712
"x \<noteq> y \<Longrightarrow> x \<noteq> z \<Longrightarrow> z \<noteq> y \<Longrightarrow>
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 713
(Lt5 (Lcons x (Ap5 (Vr5 z) (Vr5 z)) (Lcons y (Vr5 z) Lnil)) (Ap5 (Vr5 x) (Vr5 y))) \<noteq>
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 714
(Lt5 (Lcons y (Vr5 z) (Lcons x (Ap5 (Vr5 z) (Vr5 z)) Lnil)) (Ap5 (Vr5 x) (Vr5 y)))"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 715
apply (subst alpha5_INJ)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 716
apply (simp only: alpha_gen permute_trm5_lts fresh_star_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 717
apply (subst alpha5_INJ(5))
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 718
apply (subst alpha5_INJ(5))
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 719
apply (simp add: distinct_helper2)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 720
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 721
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 722
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 723
(* example with a bn function defined over the type itself *)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 724
datatype rtrm6 =
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 725
rVr6 "name"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 726
| rLm6 "name" "rtrm6"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 727
| rLt6 "rtrm6" "rtrm6" --"bind (bv6 left) in (right)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 728
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 729
primrec
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 730
rbv6
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 731
where
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 732
"rbv6 (rVr6 n) = {}"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 733
| "rbv6 (rLm6 n t) = {atom n} \<union> rbv6 t"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 734
| "rbv6 (rLt6 l r) = rbv6 l \<union> rbv6 r"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 735
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 736
local_setup {* define_raw_fv "Terms.rtrm6" [
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 737
[[[]], [[(NONE, 0)], [(NONE, 0)]], [[(SOME @{term rbv6}, 0)], [(SOME @{term rbv6}, 0)]]]] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 738
print_theorems
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 739
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 740
setup {* snd o define_raw_perms ["rtrm6"] ["Terms.rtrm6"] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 741
print_theorems
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 742
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 743
inductive
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 744
alpha6 :: "rtrm6 \<Rightarrow> rtrm6 \<Rightarrow> bool" ("_ \<approx>6 _" [100, 100] 100)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 745
where
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 746
a1: "a = b \<Longrightarrow> (rVr6 a) \<approx>6 (rVr6 b)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 747
| a2: "(\<exists>pi. (({atom a}, t) \<approx>gen alpha6 fv_rtrm6 pi ({atom b}, s))) \<Longrightarrow> rLm6 a t \<approx>6 rLm6 b s"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 748
| a3: "(\<exists>pi. (((rbv6 t1), s1) \<approx>gen alpha6 fv_rtrm6 pi ((rbv6 t2), s2))) \<Longrightarrow> rLt6 t1 s1 \<approx>6 rLt6 t2 s2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 749
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 750
lemma alpha6_equivps:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 751
shows "equivp alpha6"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 752
sorry
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 753
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 754
quotient_type
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 755
trm6 = rtrm6 / alpha6
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 756
by (auto intro: alpha6_equivps)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 757
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 758
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 759
"Vr6 :: name \<Rightarrow> trm6"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 760
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 761
"rVr6"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 762
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 763
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 764
"Lm6 :: name \<Rightarrow> trm6 \<Rightarrow> trm6"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 765
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 766
"rLm6"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 767
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 768
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 769
"Lt6 :: trm6 \<Rightarrow> trm6 \<Rightarrow> trm6"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 770
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 771
"rLt6"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 772
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 773
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 774
"fv_trm6 :: trm6 \<Rightarrow> atom set"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 775
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 776
"fv_rtrm6"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 777
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 778
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 779
"bv6 :: trm6 \<Rightarrow> atom set"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 780
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 781
"rbv6"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 782
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 783
lemma [quot_respect]:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 784
"(op = ===> alpha6 ===> alpha6) permute permute"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 785
apply auto (* will work with eqvt *)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 786
sorry
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 787
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 788
(* Definitely not true , see lemma below *)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 789
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 790
lemma [quot_respect]:"(alpha6 ===> op =) rbv6 rbv6"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 791
apply simp apply clarify
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 792
apply (erule alpha6.induct)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 793
oops
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 794
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 795
lemma "(a :: name) \<noteq> b \<Longrightarrow> \<not> (alpha6 ===> op =) rbv6 rbv6"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 796
apply simp
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 797
apply (rule_tac x="rLm6 (a::name) (rVr6 (a :: name))" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 798
apply (rule_tac x="rLm6 (b::name) (rVr6 (b :: name))" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 799
apply simp
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 800
apply (rule a2)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 801
apply (rule_tac x="(a \<leftrightarrow> b)" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 802
apply (simp add: alpha_gen fresh_star_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 803
apply (rule a1)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 804
apply (rule refl)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 805
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 806
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 807
lemma [quot_respect]:"(alpha6 ===> op =) fv_rtrm6 fv_rtrm6"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 808
apply simp apply clarify
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 809
apply (induct_tac x y rule: alpha6.induct)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 810
apply simp_all
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 811
apply (erule exE)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 812
apply (simp_all add: alpha_gen)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 813
apply (erule conjE)+
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 814
apply (erule exE)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 815
apply (erule conjE)+
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 816
apply (simp)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 817
oops
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 818
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 819
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 820
lemma [quot_respect]: "(op = ===> alpha6) rVr6 rVr6"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 821
by (simp_all add: a1)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 822
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 823
lemma [quot_respect]:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 824
"(op = ===> alpha6 ===> alpha6) rLm6 rLm6"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 825
"(alpha6 ===> alpha6 ===> alpha6) rLt6 rLt6"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 826
apply simp_all apply (clarify)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 827
apply (rule a2)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 828
apply (rule_tac x="0::perm" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 829
apply (simp add: alpha_gen)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 830
(* needs rfv6_rsp *) defer
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 831
apply clarify
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 832
apply (rule a3)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 833
apply (rule_tac x="0::perm" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 834
apply (simp add: alpha_gen)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 835
(* needs rbv6_rsp *)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 836
oops
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 837
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 838
instantiation trm6 :: pt begin
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 839
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 840
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 841
"permute_trm6 :: perm \<Rightarrow> trm6 \<Rightarrow> trm6"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 842
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 843
"permute :: perm \<Rightarrow> rtrm6 \<Rightarrow> rtrm6"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 844
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 845
instance
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 846
apply default
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 847
sorry
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 848
end
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 849
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 850
lemma lifted_induct:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 851
"\<lbrakk>x1 = x2; \<And>a b. a = b \<Longrightarrow> P (Vr6 a) (Vr6 b);
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 852
\<And>a t b s.
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 853
\<exists>pi. fv_trm6 t - {atom a} = fv_trm6 s - {atom b} \<and>
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 854
(fv_trm6 t - {atom a}) \<sharp>* pi \<and> pi \<bullet> t = s \<and> P (pi \<bullet> t) s \<Longrightarrow>
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 855
P (Lm6 a t) (Lm6 b s);
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 856
\<And>t1 s1 t2 s2.
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 857
\<exists>pi. fv_trm6 s1 - bv6 t1 = fv_trm6 s2 - bv6 t2 \<and>
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 858
(fv_trm6 s1 - bv6 t1) \<sharp>* pi \<and> pi \<bullet> s1 = s2 \<and> P (pi \<bullet> s1) s2 \<Longrightarrow>
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 859
P (Lt6 t1 s1) (Lt6 t2 s2)\<rbrakk>
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 860
\<Longrightarrow> P x1 x2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 861
unfolding alpha_gen
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 862
apply (lifting alpha6.induct[unfolded alpha_gen])
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 863
apply injection
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 864
(* notice unsolvable goals: (alpha6 ===> op =) rbv6 rbv6 *)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 865
oops
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 866
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 867
lemma lifted_inject_a3:
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 868
"\<exists>pi. fv_trm6 s1 - bv6 t1 = fv_trm6 s2 - bv6 t2 \<and>
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 869
(fv_trm6 s1 - bv6 t1) \<sharp>* pi \<and> pi \<bullet> s1 = s2 \<Longrightarrow> Lt6 t1 s1 = Lt6 t2 s2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 870
apply(lifting a3[unfolded alpha_gen])
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 871
apply injection
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 872
(* notice unsolvable goals: (alpha6 ===> op =) rbv6 rbv6 *)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 873
oops
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 874
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 875
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 876
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 877
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 878
(* example with a respectful bn function defined over the type itself *)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 879
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 880
datatype rtrm7 =
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 881
rVr7 "name"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 882
| rLm7 "name" "rtrm7"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 883
| rLt7 "rtrm7" "rtrm7" --"bind (bv7 left) in (right)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 884
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 885
primrec
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 886
rbv7
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 887
where
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 888
"rbv7 (rVr7 n) = {atom n}"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 889
| "rbv7 (rLm7 n t) = rbv7 t - {atom n}"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 890
| "rbv7 (rLt7 l r) = rbv7 l \<union> rbv7 r"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 891
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 892
local_setup {* define_raw_fv "Terms.rtrm7" [
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 893
[[[]], [[(NONE, 0)], [(NONE, 0)]], [[(SOME @{term rbv7}, 0)], [(SOME @{term rbv7}, 0)]]]] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 894
print_theorems
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 895
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 896
setup {* snd o define_raw_perms ["rtrm7"] ["Terms.rtrm7"] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 897
print_theorems
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 898
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 899
inductive
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 900
alpha7 :: "rtrm7 \<Rightarrow> rtrm7 \<Rightarrow> bool" ("_ \<approx>7 _" [100, 100] 100)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 901
where
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 902
a1: "a = b \<Longrightarrow> (rVr7 a) \<approx>7 (rVr7 b)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 903
| a2: "(\<exists>pi. (({atom a}, t) \<approx>gen alpha7 fv_rtrm7 pi ({atom b}, s))) \<Longrightarrow> rLm7 a t \<approx>7 rLm7 b s"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 904
| a3: "(\<exists>pi. (((rbv7 t1), s1) \<approx>gen alpha7 fv_rtrm7 pi ((rbv7 t2), s2))) \<Longrightarrow> rLt7 t1 s1 \<approx>7 rLt7 t2 s2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 905
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 906
lemma "(x::name) \<noteq> y \<Longrightarrow> \<not> (alpha7 ===> op =) rbv7 rbv7"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 907
apply simp
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 908
apply (rule_tac x="rLt7 (rVr7 x) (rVr7 x)" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 909
apply (rule_tac x="rLt7 (rVr7 y) (rVr7 y)" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 910
apply simp
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 911
apply (rule a3)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 912
apply (rule_tac x="(x \<leftrightarrow> y)" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 913
apply (simp_all add: alpha_gen fresh_star_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 914
apply (rule a1)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 915
apply (rule refl)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 916
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 917
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 918
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 919
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 920
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 921
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 922
datatype rfoo8 =
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 923
Foo0 "name"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 924
| Foo1 "rbar8" "rfoo8" --"bind bv(bar) in foo"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 925
and rbar8 =
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 926
Bar0 "name"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 927
| Bar1 "name" "name" "rbar8" --"bind second name in b"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 928
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 929
primrec
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 930
rbv8
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 931
where
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 932
"rbv8 (Bar0 x) = {}"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 933
| "rbv8 (Bar1 v x b) = {atom v}"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 934
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 935
local_setup {* define_raw_fv "Terms.rfoo8" [
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 936
[[[]], [[(SOME @{term rbv8}, 0)], [(SOME @{term rbv8}, 0)]]], [[[]], [[], [(NONE, 1)], [(NONE, 1)]]]] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 937
print_theorems
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 938
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 939
setup {* snd o define_raw_perms ["rfoo8", "rbar8"] ["Terms.rfoo8", "Terms.rbar8"] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 940
print_theorems
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 941
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 942
inductive
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 943
alpha8f :: "rfoo8 \<Rightarrow> rfoo8 \<Rightarrow> bool" ("_ \<approx>f _" [100, 100] 100)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 944
and
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 945
alpha8b :: "rbar8 \<Rightarrow> rbar8 \<Rightarrow> bool" ("_ \<approx>b _" [100, 100] 100)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 946
where
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 947
a1: "a = b \<Longrightarrow> (Foo0 a) \<approx>f (Foo0 b)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 948
| a2: "a = b \<Longrightarrow> (Bar0 a) \<approx>b (Bar0 b)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 949
| a3: "b1 \<approx>b b2 \<Longrightarrow> (\<exists>pi. (((rbv8 b1), t1) \<approx>gen alpha8f fv_rfoo8 pi ((rbv8 b2), t2))) \<Longrightarrow> Foo1 b1 t1 \<approx>f Foo1 b2 t2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 950
| a4: "v1 = v2 \<Longrightarrow> (\<exists>pi. (({atom x1}, t1) \<approx>gen alpha8b fv_rbar8 pi ({atom x2}, t2))) \<Longrightarrow> Bar1 v1 x1 t1 \<approx>b Bar1 v2 x2 t2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 951
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 952
lemma "(alpha8b ===> op =) rbv8 rbv8"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 953
apply simp apply clarify
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 954
apply (erule alpha8f_alpha8b.inducts(2))
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 955
apply (simp_all)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 956
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 957
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 958
lemma fv_rbar8_rsp_hlp: "x \<approx>b y \<Longrightarrow> fv_rbar8 x = fv_rbar8 y"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 959
apply (erule alpha8f_alpha8b.inducts(2))
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 960
apply (simp_all add: alpha_gen)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 961
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 962
lemma "(alpha8b ===> op =) fv_rbar8 fv_rbar8"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 963
apply simp apply clarify apply (simp add: fv_rbar8_rsp_hlp)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 964
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 965
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 966
lemma "(alpha8f ===> op =) fv_rfoo8 fv_rfoo8"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 967
apply simp apply clarify
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 968
apply (erule alpha8f_alpha8b.inducts(1))
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 969
apply (simp_all add: alpha_gen fv_rbar8_rsp_hlp)
1183
+ − 970
apply clarify
+ − 971
apply (erule alpha8f_alpha8b.inducts(2))
+ − 972
apply (simp_all)
+ − 973
done
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 974
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 975
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 976
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 977
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 978
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 979
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 980
datatype rlam9 =
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 981
Var9 "name"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 982
| Lam9 "name" "rlam9" --"bind name in rlam"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 983
and rbla9 =
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 984
Bla9 "rlam9" "rlam9" --"bind bv(first) in second"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 985
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 986
primrec
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 987
rbv9
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 988
where
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 989
"rbv9 (Var9 x) = {}"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 990
| "rbv9 (Lam9 x b) = {atom x}"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 991
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 992
local_setup {* define_raw_fv "Terms.rlam9" [
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 993
[[[]], [[(NONE, 0)], [(NONE, 0)]]], [[[(SOME @{term rbv9}, 0)], [(SOME @{term rbv9}, 0)]]]] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 994
print_theorems
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 995
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 996
setup {* snd o define_raw_perms ["rlam9", "rbla9"] ["Terms.rlam9", "Terms.rbla9"] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 997
print_theorems
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 998
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 999
inductive
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1000
alpha9l :: "rlam9 \<Rightarrow> rlam9 \<Rightarrow> bool" ("_ \<approx>9l _" [100, 100] 100)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1001
and
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1002
alpha9b :: "rbla9 \<Rightarrow> rbla9 \<Rightarrow> bool" ("_ \<approx>9b _" [100, 100] 100)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1003
where
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1004
a1: "a = b \<Longrightarrow> (Var9 a) \<approx>9l (Var9 b)"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1005
| a4: "(\<exists>pi. (({atom x1}, t1) \<approx>gen alpha9l fv_rlam9 pi ({atom x2}, t2))) \<Longrightarrow> Lam9 x1 t1 \<approx>9l Lam9 x2 t2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1006
| a3: "b1 \<approx>9l b2 \<Longrightarrow> (\<exists>pi. (((rbv9 b1), t1) \<approx>gen alpha9l fv_rlam9 pi ((rbv9 b2), t2))) \<Longrightarrow> Bla9 b1 t1 \<approx>9b Bla9 b2 t2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1007
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1008
quotient_type
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1009
lam9 = rlam9 / alpha9l and bla9 = rbla9 / alpha9b
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1010
sorry
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1011
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1012
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1013
"qVar9 :: name \<Rightarrow> lam9"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1014
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1015
"Var9"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1016
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1017
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1018
"qLam :: name \<Rightarrow> lam9 \<Rightarrow> lam9"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1019
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1020
"Lam9"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1021
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1022
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1023
"qBla9 :: lam9 \<Rightarrow> lam9 \<Rightarrow> bla9"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1024
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1025
"Bla9"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1026
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1027
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1028
"fv_lam9 :: lam9 \<Rightarrow> atom set"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1029
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1030
"fv_rlam9"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1031
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1032
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1033
"fv_bla9 :: bla9 \<Rightarrow> atom set"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1034
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1035
"fv_rbla9"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1036
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1037
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1038
"bv9 :: lam9 \<Rightarrow> atom set"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1039
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1040
"rbv9"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1041
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1042
instantiation lam9 and bla9 :: pt
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1043
begin
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1044
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1045
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1046
"permute_lam9 :: perm \<Rightarrow> lam9 \<Rightarrow> lam9"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1047
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1048
"permute :: perm \<Rightarrow> rlam9 \<Rightarrow> rlam9"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1049
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1050
quotient_definition
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1051
"permute_bla9 :: perm \<Rightarrow> bla9 \<Rightarrow> bla9"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1052
is
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1053
"permute :: perm \<Rightarrow> rbla9 \<Rightarrow> rbla9"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1054
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1055
instance
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1056
sorry
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1057
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1058
end
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1059
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1060
lemma "\<lbrakk>b1 = b2; \<exists>pi. fv_lam9 t1 - bv9 b1 = fv_lam9 t2 - bv9 b2 \<and> (fv_lam9 t1 - bv9 b1) \<sharp>* pi \<and> pi \<bullet> t1 = t2\<rbrakk>
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1061
\<Longrightarrow> qBla9 b1 t1 = qBla9 b2 t2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1062
apply (lifting a3[unfolded alpha_gen])
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1063
apply injection
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1064
sorry
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1065
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1066
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1067
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1068
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1069
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1070
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1071
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1072
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1073
text {* type schemes *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1074
datatype ty =
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1075
Var "name"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1076
| Fun "ty" "ty"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1077
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1078
setup {* snd o define_raw_perms ["ty"] ["Terms.ty"] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1079
print_theorems
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1080
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1081
datatype tyS =
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1082
All "name set" "ty"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1083
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1084
setup {* snd o define_raw_perms ["tyS"] ["Terms.tyS"] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1085
print_theorems
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1086
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1087
local_setup {* define_raw_fv "Terms.ty" [[[[]], [[], []]]] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1088
print_theorems
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1089
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1090
(*
1185
+ − 1091
Doesnot work yet since we do not refer to fv_ty
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1092
local_setup {* define_raw_fv "Terms.tyS" [[[[], []]]] *}
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1093
print_theorems
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1094
*)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1095
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1096
primrec
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1097
fv_tyS
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1098
where
1185
+ − 1099
"fv_tyS (All xs T) = (fv_ty T - atom ` xs)"
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1100
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1101
inductive
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1102
alpha_tyS :: "tyS \<Rightarrow> tyS \<Rightarrow> bool" ("_ \<approx>tyS _" [100, 100] 100)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1103
where
1185
+ − 1104
a1: "\<exists>pi. ((atom ` xs1, T1) \<approx>gen (op =) fv_ty pi (atom ` xs2, T2))
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1105
\<Longrightarrow> All xs1 T1 \<approx>tyS All xs2 T2"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1106
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1107
lemma
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1108
shows "All {a, b} (Fun (Var a) (Var b)) \<approx>tyS All {b, a} (Fun (Var a) (Var b))"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1109
apply(rule a1)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1110
apply(simp add: alpha_gen)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1111
apply(rule_tac x="0::perm" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1112
apply(simp add: fresh_star_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1113
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1114
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1115
lemma
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1116
shows "All {a, b} (Fun (Var a) (Var b)) \<approx>tyS All {a, b} (Fun (Var b) (Var a))"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1117
apply(rule a1)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1118
apply(simp add: alpha_gen)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1119
apply(rule_tac x="(atom a \<rightleftharpoons> atom b)" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1120
apply(simp add: fresh_star_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1121
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1122
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1123
lemma
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1124
shows "All {a, b, c} (Fun (Var a) (Var b)) \<approx>tyS All {a, b} (Fun (Var a) (Var b))"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1125
apply(rule a1)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1126
apply(simp add: alpha_gen)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1127
apply(rule_tac x="0::perm" in exI)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1128
apply(simp add: fresh_star_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1129
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1130
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1131
lemma
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1132
assumes a: "a \<noteq> b"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1133
shows "\<not>(All {a, b} (Fun (Var a) (Var b)) \<approx>tyS All {c} (Fun (Var c) (Var c)))"
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1134
using a
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1135
apply(clarify)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1136
apply(erule alpha_tyS.cases)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1137
apply(simp add: alpha_gen)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1138
apply(erule conjE)+
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1139
apply(erule exE)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1140
apply(erule conjE)+
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1141
apply(clarify)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1142
apply(simp)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1143
apply(simp add: fresh_star_def)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1144
apply(auto)
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1145
done
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1146
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1147
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
+ − 1148
end