author | Cezary Kaliszyk <kaliszyk@in.tum.de> |
Fri, 19 Feb 2010 17:50:43 +0100 | |
changeset 1200 | a94c04c4a720 |
parent 1199 | 5770c73f2415 |
child 1201 | 6d2200603585 |
permissions | -rw-r--r-- |
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 |
1196
4efbaba9d754
Constructing alpha_inj goal.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1193
diff
changeset
|
2 |
imports "Nominal2_Atoms" "Nominal2_Eqvt" "Nominal2_Supp" "Abs" "Perm" "Fv" "../../Attic/Prove" |
1182
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 |
|
1198
5523d5713a65
Experiments for the pseudo-injectivity tactic.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1197
diff
changeset
|
21 |
print_theorems |
5523d5713a65
Experiments for the pseudo-injectivity tactic.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1197
diff
changeset
|
22 |
|
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
23 |
(* 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
|
24 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
25 |
primrec |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
26 |
bv1 |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
27 |
where |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
28 |
"bv1 (BUnit) = {}" |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
29 |
| "bv1 (BVr x) = {atom x}" |
1183
cb3da5b540f2
Fixed proofs in Terms2 and found a mistake in Terms.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1182
diff
changeset
|
30 |
| "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
|
31 |
|
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
32 |
setup {* snd o define_raw_perms ["rtrm1", "bp"] ["Terms.rtrm1", "Terms.bp"] *} |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
33 |
|
1198
5523d5713a65
Experiments for the pseudo-injectivity tactic.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1197
diff
changeset
|
34 |
local_setup {* |
1199
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
35 |
snd o define_fv_alpha "Terms.rtrm1" |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
36 |
[[[[]], [[], []], [[(NONE, 0)], [(NONE, 0)]], [[(SOME @{term bv1}, 0)], [], [(SOME @{term bv1}, 0)]]], |
1199
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
37 |
[[], [[]], [[], []]]] *} |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
38 |
print_theorems |
1198
5523d5713a65
Experiments for the pseudo-injectivity tactic.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1197
diff
changeset
|
39 |
|
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
40 |
notation |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
41 |
alpha_rtrm1 ("_ \<approx>1 _" [100, 100] 100) and |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
42 |
alpha_bp ("_ \<approx>1b _" [100, 100] 100) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
43 |
thm alpha_rtrm1_alpha_bp.intros |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
44 |
|
1199
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
45 |
local_setup {* (fn ctxt => snd (Local_Theory.note ((@{binding alpha1_inj}, []), (build_alpha_inj @{thms alpha_rtrm1_alpha_bp.intros} @{thms rtrm1.distinct rtrm1.inject bp.distinct bp.inject} @{thms alpha_rtrm1.cases alpha_bp.cases} ctxt)) ctxt)) *} |
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
46 |
thm alpha1_inj |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
47 |
|
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
48 |
lemma alpha_bp_refl: "alpha_bp a a" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
49 |
apply induct |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
50 |
apply (simp_all add: alpha1_inj) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
51 |
done |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
52 |
|
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
53 |
lemma alpha_bp_eq_eq: "alpha_bp a b = (a = b)" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
54 |
apply rule |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
55 |
apply (induct a b rule: alpha_rtrm1_alpha_bp.inducts(2)) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
56 |
apply (simp_all add: alpha_bp_refl) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
57 |
done |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
58 |
|
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
59 |
lemma alpha_bp_eq: "alpha_bp = (op =)" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
60 |
apply (rule ext)+ |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
61 |
apply (rule alpha_bp_eq_eq) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
62 |
done |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
63 |
|
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
64 |
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
|
65 |
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
|
66 |
apply (induct x) |
1183
cb3da5b540f2
Fixed proofs in Terms2 and found a mistake in Terms.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1182
diff
changeset
|
67 |
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
|
68 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
69 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
70 |
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
|
71 |
"(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
|
72 |
"(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
|
73 |
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
|
74 |
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
|
75 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
76 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
77 |
lemma alpha1_eqvt: |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
78 |
"t \<approx>1 s \<Longrightarrow> (pi \<bullet> t) \<approx>1 (pi \<bullet> s)" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
79 |
"alpha_bp a b \<Longrightarrow> alpha_bp (pi \<bullet> a) (pi \<bullet> b)" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
80 |
apply (induct t s and a b rule: alpha_rtrm1_alpha_bp.inducts) |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
81 |
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
|
82 |
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
|
83 |
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
|
84 |
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
|
85 |
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
|
86 |
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
|
87 |
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
|
88 |
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
|
89 |
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
|
90 |
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
|
91 |
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
|
92 |
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
|
93 |
apply (erule exE) |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
94 |
apply (erule exE) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
95 |
apply (rule conjI) |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
96 |
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
|
97 |
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
|
98 |
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
|
99 |
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
|
100 |
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
|
101 |
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
|
102 |
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
|
103 |
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
|
104 |
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
|
105 |
apply(simp add: permute_eqvt[symmetric]) |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
106 |
apply (rule_tac x="pi \<bullet> piaa" in exI) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
107 |
apply (simp add: alpha_gen) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
108 |
apply(erule conjE)+ |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
109 |
apply(rule conjI) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
110 |
apply(rule_tac ?p1="- pi" in permute_eq_iff[THEN iffD1]) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
111 |
apply(simp add: fv_rtrm1_eqvt Diff_eqvt bv1_eqvt) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
112 |
apply(rule conjI) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
113 |
apply(rule_tac ?p1="- pi" in fresh_star_permute_iff[THEN iffD1]) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
114 |
apply(simp add: atom_eqvt fv_rtrm1_eqvt Diff_eqvt bv1_eqvt) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
115 |
apply(simp add: permute_eqvt[symmetric]) |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
116 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
117 |
|
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
118 |
lemma alpha1_equivp: "equivp alpha_rtrm1" |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
119 |
sorry |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
120 |
|
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
121 |
quotient_type trm1 = rtrm1 / alpha_rtrm1 |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
122 |
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
|
123 |
|
1190
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
124 |
local_setup {* |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
125 |
(fn ctxt => ctxt |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
126 |
|> snd o (Quotient_Def.quotient_lift_const ("Vr1", @{term rVr1})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
127 |
|> snd o (Quotient_Def.quotient_lift_const ("Ap1", @{term rAp1})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
128 |
|> snd o (Quotient_Def.quotient_lift_const ("Lm1", @{term rLm1})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
129 |
|> snd o (Quotient_Def.quotient_lift_const ("Lt1", @{term rLt1})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
130 |
|> snd o (Quotient_Def.quotient_lift_const ("fv_trm1", @{term fv_rtrm1}))) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
131 |
*} |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
132 |
print_theorems |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
133 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
134 |
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
|
135 |
shows "t \<approx>1 s \<Longrightarrow> fv_rtrm1 t = fv_rtrm1 s" |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
136 |
apply(induct rule: alpha_rtrm1_alpha_bp.inducts(1)) |
1200
a94c04c4a720
proof cleaning and standardizing.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1199
diff
changeset
|
137 |
apply(simp_all add: fv_rtrm1_fv_bp.simps alpha_gen.simps) |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
138 |
done |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
139 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
140 |
lemma [quot_respect]: |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
141 |
"(op = ===> alpha_rtrm1) rVr1 rVr1" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
142 |
"(alpha_rtrm1 ===> alpha_rtrm1 ===> alpha_rtrm1) rAp1 rAp1" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
143 |
"(op = ===> alpha_rtrm1 ===> alpha_rtrm1) rLm1 rLm1" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
144 |
"(op = ===> alpha_rtrm1 ===> alpha_rtrm1 ===> alpha_rtrm1) rLt1 rLt1" |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
145 |
apply (auto simp add: alpha1_inj) |
1200
a94c04c4a720
proof cleaning and standardizing.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1199
diff
changeset
|
146 |
apply (rule_tac [!] x="0" in exI) |
a94c04c4a720
proof cleaning and standardizing.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1199
diff
changeset
|
147 |
apply (simp_all add: alpha_gen fresh_star_def fresh_zero_perm alpha_rfv1 alpha_bp_eq) |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
148 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
149 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
150 |
lemma [quot_respect]: |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
151 |
"(op = ===> alpha_rtrm1 ===> alpha_rtrm1) permute permute" |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
152 |
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
|
153 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
154 |
lemma [quot_respect]: |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
155 |
"(alpha_rtrm1 ===> op =) fv_rtrm1 fv_rtrm1" |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
156 |
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
|
157 |
|
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_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
|
159 |
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
|
160 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
161 |
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
|
162 |
begin |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
163 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
164 |
quotient_definition |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
165 |
"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
|
166 |
is |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
167 |
"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
|
168 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
169 |
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
|
170 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
171 |
instance |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
172 |
apply default |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
173 |
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
|
174 |
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
|
175 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
176 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
177 |
end |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
178 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
179 |
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
|
180 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
181 |
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
|
182 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
183 |
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
|
184 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
185 |
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
|
186 |
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
|
187 |
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
|
188 |
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
|
189 |
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
|
190 |
apply(clarify) |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
191 |
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
|
192 |
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
|
193 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
194 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
195 |
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
|
196 |
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
|
197 |
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
|
198 |
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
|
199 |
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
|
200 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
201 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
202 |
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
|
203 |
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
|
204 |
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
|
205 |
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
|
206 |
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
|
207 |
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
|
208 |
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
|
209 |
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
|
210 |
apply (simp) |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
211 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
212 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
213 |
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
|
214 |
apply default |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
215 |
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
|
216 |
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
|
217 |
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
|
218 |
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
|
219 |
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
|
220 |
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
|
221 |
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
|
222 |
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
|
223 |
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
|
224 |
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
|
225 |
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
|
226 |
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
|
227 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
228 |
|
1183
cb3da5b540f2
Fixed proofs in Terms2 and found a mistake in Terms.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1182
diff
changeset
|
229 |
lemma fv_eq_bv: "fv_bp bp = bv1 bp" |
cb3da5b540f2
Fixed proofs in Terms2 and found a mistake in Terms.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1182
diff
changeset
|
230 |
apply(induct bp rule: trm1_bp_inducts(2)) |
cb3da5b540f2
Fixed proofs in Terms2 and found a mistake in Terms.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1182
diff
changeset
|
231 |
apply(simp_all) |
cb3da5b540f2
Fixed proofs in Terms2 and found a mistake in Terms.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1182
diff
changeset
|
232 |
done |
cb3da5b540f2
Fixed proofs in Terms2 and found a mistake in Terms.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1182
diff
changeset
|
233 |
|
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
234 |
lemma helper: "{b. \<forall>pi. pi \<bullet> (a \<rightleftharpoons> b) \<bullet> bp \<noteq> bp} = {}" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
235 |
apply auto |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
236 |
apply (rule_tac x="(x \<rightleftharpoons> a)" in exI) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
237 |
apply auto |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
238 |
done |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
239 |
|
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
240 |
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
|
241 |
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
|
242 |
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
|
243 |
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
|
244 |
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
|
245 |
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
|
246 |
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
|
247 |
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
|
248 |
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
|
249 |
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
|
250 |
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
|
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.simps) |
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]) |
1183
cb3da5b540f2
Fixed proofs in Terms2 and found a mistake in Terms.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1182
diff
changeset
|
255 |
apply(subgoal_tac "supp (Lt1 bp rtrm11 rtrm12) = supp(rtrm11) \<union> supp (Abs (bv1 bp) rtrm12)") |
cb3da5b540f2
Fixed proofs in Terms2 and found a mistake in Terms.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1182
diff
changeset
|
256 |
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
|
257 |
apply(simp (no_asm) add: supp_def) |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
258 |
apply(simp add: alpha1_INJ alpha_bp_eq) |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
259 |
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
|
260 |
apply(simp add: alpha_gen) |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
261 |
apply(simp add: supp_eqvt[symmetric] fv_trm1_eqvt[symmetric] bv1_eqvt fv_eq_bv) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
262 |
apply(simp add: Collect_imp_eq Collect_neg_eq fresh_star_def helper) |
1183
cb3da5b540f2
Fixed proofs in Terms2 and found a mistake in Terms.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1182
diff
changeset
|
263 |
done |
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_supp: |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
266 |
"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
|
267 |
"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
|
268 |
"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
|
269 |
"supp (Lt1 b t s) = supp t \<union> (supp s - bv1 b)" |
1183
cb3da5b540f2
Fixed proofs in Terms2 and found a mistake in Terms.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1182
diff
changeset
|
270 |
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
|
271 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
272 |
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
|
273 |
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
|
274 |
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
|
275 |
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
|
276 |
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
|
277 |
shows "P a rtrma" |
1183
cb3da5b540f2
Fixed proofs in Terms2 and found a mistake in Terms.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1182
diff
changeset
|
278 |
sorry |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
279 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
280 |
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
|
281 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
282 |
datatype rtrm2 = |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
283 |
rVr2 "name" |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
284 |
| 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
|
285 |
| 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
|
286 |
| 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
|
287 |
and rassign = |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
288 |
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
|
289 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
290 |
(* 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
|
291 |
primrec |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
292 |
rbv2 |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
293 |
where |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
294 |
"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
|
295 |
|
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
296 |
setup {* snd o define_raw_perms ["rtrm2", "rassign"] ["Terms.rtrm2", "Terms.rassign"] *} |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
297 |
|
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
298 |
local_setup {* snd o define_fv_alpha "Terms.rtrm2" |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
299 |
[[[[]], [[], []], [[(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
|
300 |
[[[], []]]] *} |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
301 |
|
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
302 |
notation |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
303 |
alpha_rtrm2 ("_ \<approx>2 _" [100, 100] 100) and |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
304 |
alpha_rassign ("_ \<approx>2b _" [100, 100] 100) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
305 |
thm alpha_rtrm2_alpha_rassign.intros |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
306 |
|
1199
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
307 |
local_setup {* (fn ctxt => snd (Local_Theory.note ((@{binding alpha2_inj}, []), (build_alpha_inj @{thms alpha_rtrm2_alpha_rassign.intros} @{thms rtrm2.distinct rtrm2.inject rassign.distinct rassign.inject} @{thms alpha_rtrm2.cases alpha_rassign.cases} ctxt)) ctxt)) *} |
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
308 |
thm alpha2_inj |
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
309 |
|
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
310 |
|
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
311 |
lemma alpha2_equivp: |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
312 |
"equivp alpha_rtrm2" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
313 |
"equivp alpha_rassign" |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
314 |
sorry |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
315 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
316 |
quotient_type |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
317 |
trm2 = rtrm2 / alpha_rtrm2 |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
318 |
and |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
319 |
assign = rassign / alpha_rassign |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
320 |
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
|
321 |
|
1190
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
322 |
local_setup {* |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
323 |
(fn ctxt => ctxt |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
324 |
|> snd o (Quotient_Def.quotient_lift_const ("Vr2", @{term rVr2})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
325 |
|> snd o (Quotient_Def.quotient_lift_const ("Ap2", @{term rAp2})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
326 |
|> snd o (Quotient_Def.quotient_lift_const ("Lm2", @{term rLm2})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
327 |
|> snd o (Quotient_Def.quotient_lift_const ("Lt2", @{term rLt2})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
328 |
|> snd o (Quotient_Def.quotient_lift_const ("As", @{term rAs})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
329 |
|> snd o (Quotient_Def.quotient_lift_const ("fv_trm2", @{term fv_rtrm2})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
330 |
|> snd o (Quotient_Def.quotient_lift_const ("bv2", @{term rbv2}))) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
331 |
*} |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
332 |
print_theorems |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
333 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
334 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
335 |
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
|
336 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
337 |
datatype trm3 = |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
338 |
Vr3 "name" |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
339 |
| 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
|
340 |
| 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
|
341 |
| 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
|
342 |
and assigns = |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
343 |
ANil |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
344 |
| 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
|
345 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
346 |
(* 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
|
347 |
primrec |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
348 |
bv3 |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
349 |
where |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
350 |
"bv3 ANil = {}" |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
351 |
| "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
|
352 |
|
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
353 |
setup {* snd o define_raw_perms ["rtrm3", "assigns"] ["Terms.trm3", "Terms.assigns"] *} |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
354 |
|
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
355 |
local_setup {* snd o define_fv_alpha "Terms.trm3" |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
356 |
[[[[]], [[], []], [[(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
|
357 |
[[], [[], [], []]]] *} |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
358 |
print_theorems |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
359 |
|
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
360 |
notation |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
361 |
alpha_trm3 ("_ \<approx>3 _" [100, 100] 100) and |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
362 |
alpha_assigns ("_ \<approx>3a _" [100, 100] 100) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
363 |
thm alpha_trm3_alpha_assigns.intros |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
364 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
365 |
lemma alpha3_equivp: |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
366 |
"equivp alpha_trm3" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
367 |
"equivp alpha_assigns" |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
368 |
sorry |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
369 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
370 |
quotient_type |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
371 |
qtrm3 = trm3 / alpha_trm3 |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
372 |
and |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
373 |
qassigns = assigns / alpha_assigns |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
374 |
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
|
375 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
376 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
377 |
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
|
378 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
379 |
datatype trm4 = |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
380 |
Vr4 "name" |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
381 |
| 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
|
382 |
| 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
|
383 |
print_theorems |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
384 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
385 |
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
|
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 |
|
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
402 |
local_setup {* snd o define_fv_alpha "Terms.trm4" [ |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
403 |
[[[]], [[], []], [[(NONE, 0)], [(NONE, 0)]]], [[], [[], []]] ] *} |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
404 |
print_theorems |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
405 |
|
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
406 |
notation |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
407 |
alpha_trm4 ("_ \<approx>4 _" [100, 100] 100) and |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
408 |
alpha_trm4_list ("_ \<approx>4l _" [100, 100] 100) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
409 |
thm alpha_trm4_alpha_trm4_list.intros |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
410 |
|
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
411 |
lemma alpha4_equivp: "equivp alpha_trm4" sorry |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
412 |
lemma alpha4list_equivp: "equivp alpha_trm4_list" sorry |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
413 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
414 |
quotient_type |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
415 |
qtrm4 = trm4 / alpha_trm4 and |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
416 |
qtrm4list = "trm4 list" / alpha_trm4_list |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
417 |
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
|
418 |
|
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 |
datatype rtrm5 = |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
421 |
rVr5 "name" |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
422 |
| 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
|
423 |
| 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
|
424 |
and rlts = |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
425 |
rLnil |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
426 |
| 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
|
427 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
428 |
primrec |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
429 |
rbv5 |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
430 |
where |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
431 |
"rbv5 rLnil = {}" |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
432 |
| "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
|
433 |
|
1186
166cc41091b9
The alternate version of trm5 with additional binding. All proofs work the same.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1185
diff
changeset
|
434 |
|
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
435 |
setup {* snd o define_raw_perms ["rtrm5", "rlts"] ["Terms.rtrm5", "Terms.rlts"] *} |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
436 |
print_theorems |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
437 |
|
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
438 |
local_setup {* snd o define_fv_alpha "Terms.rtrm5" [ |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
439 |
[[[]], [[], []], [[(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
|
440 |
print_theorems |
1187
3b24f33aedad
Changed back to original version of trm5
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1186
diff
changeset
|
441 |
|
1186
166cc41091b9
The alternate version of trm5 with additional binding. All proofs work the same.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1185
diff
changeset
|
442 |
(* Alternate version with additional binding of name in rlts in rLcons *) |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
443 |
(*local_setup {* snd o define_fv_alpha "Terms.rtrm5" [ |
1186
166cc41091b9
The alternate version of trm5 with additional binding. All proofs work the same.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1185
diff
changeset
|
444 |
[[[]], [[], []], [[(SOME @{term rbv5}, 0)], [(SOME @{term rbv5}, 0)]]], [[], [[(NONE,0)], [], [(NONE,0)]]] ] *} |
1187
3b24f33aedad
Changed back to original version of trm5
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1186
diff
changeset
|
445 |
print_theorems*) |
1186
166cc41091b9
The alternate version of trm5 with additional binding. All proofs work the same.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1185
diff
changeset
|
446 |
|
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
447 |
notation |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
448 |
alpha_rtrm5 ("_ \<approx>5 _" [100, 100] 100) and |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
449 |
alpha_rlts ("_ \<approx>l _" [100, 100] 100) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
450 |
thm alpha_rtrm5_alpha_rlts.intros |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
451 |
|
1199
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
452 |
local_setup {* (fn ctxt => snd (Local_Theory.note ((@{binding alpha5_inj}, []), (build_alpha_inj @{thms alpha_rtrm5_alpha_rlts.intros} @{thms rtrm5.distinct rtrm5.inject rlts.distinct rlts.inject} @{thms alpha_rtrm5.cases alpha_rlts.cases} ctxt)) ctxt)) *} |
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
453 |
thm alpha5_inj |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
454 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
455 |
lemma alpha5_equivps: |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
456 |
shows "equivp alpha_rtrm5" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
457 |
and "equivp alpha_rlts" |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
458 |
sorry |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
459 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
460 |
quotient_type |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
461 |
trm5 = rtrm5 / alpha_rtrm5 |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
462 |
and |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
463 |
lts = rlts / alpha_rlts |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
464 |
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
|
465 |
|
1190
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
466 |
local_setup {* |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
467 |
(fn ctxt => ctxt |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
468 |
|> snd o (Quotient_Def.quotient_lift_const ("Vr5", @{term rVr5})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
469 |
|> snd o (Quotient_Def.quotient_lift_const ("Ap5", @{term rAp5})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
470 |
|> snd o (Quotient_Def.quotient_lift_const ("Lt5", @{term rLt5})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
471 |
|> snd o (Quotient_Def.quotient_lift_const ("Lnil", @{term rLnil})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
472 |
|> snd o (Quotient_Def.quotient_lift_const ("Lcons", @{term rLcons})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
473 |
|> snd o (Quotient_Def.quotient_lift_const ("fv_trm5", @{term fv_rtrm5})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
474 |
|> snd o (Quotient_Def.quotient_lift_const ("fv_lts", @{term fv_rlts})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
475 |
|> snd o (Quotient_Def.quotient_lift_const ("bv5", @{term rbv5}))) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
476 |
*} |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
477 |
print_theorems |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
478 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
479 |
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
|
480 |
"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
|
481 |
sorry |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
482 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
483 |
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
|
484 |
"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
|
485 |
sorry |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
486 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
487 |
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
|
488 |
"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
|
489 |
sorry |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
490 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
491 |
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
|
492 |
"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
|
493 |
"xb \<approx>l ya \<Longrightarrow> (x \<bullet> xb) \<approx>l (x \<bullet> ya)" |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
494 |
apply(induct rule: alpha_rtrm5_alpha_rlts.inducts) |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
495 |
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
|
496 |
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
|
497 |
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
|
498 |
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
|
499 |
apply (rule conjI) |
1199
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
500 |
apply (rule_tac x="x \<bullet> pi" in exI) |
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
501 |
apply (rule conjI) |
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
502 |
apply(rule_tac ?p1="- x" in permute_eq_iff[THEN iffD1]) |
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
503 |
apply(simp add: atom_eqvt Diff_eqvt insert_eqvt set_eqvt empty_eqvt rbv5_eqvt fv_rlts_eqvt) |
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
504 |
apply(rule conjI) |
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
505 |
apply(rule_tac ?p1="- x" in fresh_star_permute_iff[THEN iffD1]) |
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
506 |
apply(simp add: atom_eqvt Diff_eqvt insert_eqvt set_eqvt empty_eqvt rbv5_eqvt fv_rlts_eqvt) |
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
507 |
apply (subst permute_eqvt[symmetric]) |
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
508 |
apply (simp) |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
509 |
apply (rule_tac x="x \<bullet> pia" in exI) |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
510 |
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
|
511 |
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
|
512 |
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
|
513 |
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
|
514 |
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
|
515 |
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
|
516 |
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
|
517 |
apply (simp) |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
518 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
519 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
520 |
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
|
521 |
"(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
|
522 |
"(l \<approx>l m \<Longrightarrow> fv_rlts l = fv_rlts m)" |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
523 |
apply(induct rule: alpha_rtrm5_alpha_rlts.inducts) |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
524 |
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
|
525 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
526 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
527 |
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
|
528 |
shows "x \<approx>l y \<Longrightarrow> rbv5 x = rbv5 y" |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
529 |
apply(induct rule: alpha_rtrm5_alpha_rlts.inducts(2)) |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
530 |
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
|
531 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
532 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
533 |
lemma [quot_respect]: |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
534 |
"(alpha_rlts ===> op =) fv_rlts fv_rlts" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
535 |
"(alpha_rtrm5 ===> op =) fv_rtrm5 fv_rtrm5" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
536 |
"(alpha_rlts ===> op =) rbv5 rbv5" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
537 |
"(op = ===> alpha_rtrm5) rVr5 rVr5" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
538 |
"(alpha_rtrm5 ===> alpha_rtrm5 ===> alpha_rtrm5) rAp5 rAp5" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
539 |
"(alpha_rlts ===> alpha_rtrm5 ===> alpha_rtrm5) rLt5 rLt5" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
540 |
"(op = ===> alpha_rtrm5 ===> alpha_rlts ===> alpha_rlts) rLcons rLcons" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
541 |
"(op = ===> alpha_rtrm5 ===> alpha_rtrm5) permute permute" |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
542 |
"(op = ===> alpha_rlts ===> alpha_rlts) permute permute" |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
543 |
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
|
544 |
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
|
545 |
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
|
546 |
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
|
547 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
548 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
549 |
lemma |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
550 |
shows "(alpha_rlts ===> op =) rbv5 rbv5" |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
551 |
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
|
552 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
553 |
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
|
554 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
555 |
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
|
556 |
begin |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
557 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
558 |
quotient_definition |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
559 |
"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
|
560 |
is |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
561 |
"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
|
562 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
563 |
quotient_definition |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
564 |
"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
|
565 |
is |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
566 |
"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
|
567 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
568 |
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
|
569 |
"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
|
570 |
"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
|
571 |
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
|
572 |
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
|
573 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
574 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
575 |
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
|
576 |
"(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
|
577 |
"(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
|
578 |
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
|
579 |
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
|
580 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
581 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
582 |
instance |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
583 |
apply default |
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: 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
|
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 |
end |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
588 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
589 |
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
|
590 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
591 |
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
|
592 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
593 |
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
|
594 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
595 |
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
|
596 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
597 |
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
|
598 |
"(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
|
599 |
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
|
600 |
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
|
601 |
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
|
602 |
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
|
603 |
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
|
604 |
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
|
605 |
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
|
606 |
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
|
607 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
608 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
609 |
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
|
610 |
"(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
|
611 |
(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
|
612 |
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
|
613 |
apply (rule conjI) |
1199
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
614 |
apply (rule_tac x="(x \<leftrightarrow> y)" in exI) |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
615 |
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
|
616 |
apply (simp add: permute_trm5_lts fresh_star_def) |
1199
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
617 |
apply (rule_tac x="0 :: perm" in exI) |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
618 |
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
|
619 |
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
|
620 |
done |
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 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
623 |
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
|
624 |
"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
|
625 |
(Lt5 (Lcons y (Vr5 x) (Lcons x (Vr5 y) Lnil)) (Ap5 (Vr5 x) (Vr5 y)))" |
1200
a94c04c4a720
proof cleaning and standardizing.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1199
diff
changeset
|
626 |
apply (simp add: alpha5_INJ(3) alpha_gen) |
a94c04c4a720
proof cleaning and standardizing.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1199
diff
changeset
|
627 |
apply (simp add: permute_trm5_lts fresh_star_def alpha5_INJ(5) alpha5_INJ(2) alpha5_INJ(1)) |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
628 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
629 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
630 |
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
|
631 |
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
|
632 |
apply auto |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
633 |
apply (erule alpha_rtrm5.cases) |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
634 |
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
|
635 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
636 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
637 |
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
|
638 |
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
|
639 |
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
|
640 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
641 |
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
|
642 |
"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
|
643 |
(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
|
644 |
(Lt5 (Lcons y (Vr5 z) (Lcons x (Ap5 (Vr5 z) (Vr5 z)) Lnil)) (Ap5 (Vr5 x) (Vr5 y)))" |
1200
a94c04c4a720
proof cleaning and standardizing.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1199
diff
changeset
|
645 |
apply (simp only: alpha5_INJ(3) alpha5_INJ(5) alpha_gen permute_trm5_lts fresh_star_def) |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
646 |
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
|
647 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
648 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
649 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
650 |
(* 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
|
651 |
datatype rtrm6 = |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
652 |
rVr6 "name" |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
653 |
| 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
|
654 |
| 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
|
655 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
656 |
primrec |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
657 |
rbv6 |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
658 |
where |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
659 |
"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
|
660 |
| "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
|
661 |
| "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
|
662 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
663 |
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
|
664 |
print_theorems |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
665 |
|
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
666 |
local_setup {* snd o define_fv_alpha "Terms.rtrm6" [ |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
667 |
[[[]], [[(NONE, 0)], [(NONE, 0)]], [[(SOME @{term rbv6}, 0)], [(SOME @{term rbv6}, 0)]]]] *} |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
668 |
notation alpha_rtrm6 ("_ \<approx>6a _" [100, 100] 100) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
669 |
(* HERE THE RULES DIFFER *) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
670 |
thm alpha_rtrm6.intros |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
671 |
|
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
672 |
inductive |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
673 |
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
|
674 |
where |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
675 |
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
|
676 |
| 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
|
677 |
| 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
|
678 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
679 |
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
|
680 |
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
|
681 |
sorry |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
682 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
683 |
quotient_type |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
684 |
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
|
685 |
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
|
686 |
|
1190
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
687 |
local_setup {* |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
688 |
(fn ctxt => ctxt |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
689 |
|> snd o (Quotient_Def.quotient_lift_const ("Vr6", @{term rVr6})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
690 |
|> snd o (Quotient_Def.quotient_lift_const ("Lm6", @{term rLm6})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
691 |
|> snd o (Quotient_Def.quotient_lift_const ("Lt6", @{term rLt6})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
692 |
|> snd o (Quotient_Def.quotient_lift_const ("fv_trm6", @{term fv_rtrm6})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
693 |
|> snd o (Quotient_Def.quotient_lift_const ("bv6", @{term rbv6}))) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
694 |
*} |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
695 |
print_theorems |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
696 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
697 |
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
|
698 |
"(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
|
699 |
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
|
700 |
sorry |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
701 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
702 |
(* 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
|
703 |
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
|
704 |
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
|
705 |
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
|
706 |
oops |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
707 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
708 |
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
|
709 |
apply simp |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
710 |
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
|
711 |
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
|
712 |
apply simp |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
713 |
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
|
714 |
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
|
715 |
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
|
716 |
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
|
717 |
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
|
718 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
719 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
720 |
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
|
721 |
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
|
722 |
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
|
723 |
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
|
724 |
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
|
725 |
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
|
726 |
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
|
727 |
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
|
728 |
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
|
729 |
apply (simp) |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
730 |
oops |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
731 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
732 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
733 |
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
|
734 |
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
|
735 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
736 |
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
|
737 |
"(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
|
738 |
"(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
|
739 |
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
|
740 |
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
|
741 |
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
|
742 |
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
|
743 |
(* 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
|
744 |
apply clarify |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
745 |
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
|
746 |
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
|
747 |
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
|
748 |
(* 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
|
749 |
oops |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
750 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
751 |
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
|
752 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
753 |
quotient_definition |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
754 |
"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
|
755 |
is |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
756 |
"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
|
757 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
758 |
instance |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
759 |
apply default |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
760 |
sorry |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
761 |
end |
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 |
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
|
764 |
"\<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
|
765 |
\<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
|
766 |
\<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
|
767 |
(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
|
768 |
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
|
769 |
\<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
|
770 |
\<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
|
771 |
(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
|
772 |
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
|
773 |
\<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
|
774 |
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
|
775 |
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
|
776 |
apply injection |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
777 |
(* 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
|
778 |
oops |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
779 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
780 |
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
|
781 |
"\<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
|
782 |
(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
|
783 |
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
|
784 |
apply injection |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
785 |
(* 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
|
786 |
oops |
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 |
|
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 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
791 |
(* 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
|
792 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
793 |
datatype rtrm7 = |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
794 |
rVr7 "name" |
1198
5523d5713a65
Experiments for the pseudo-injectivity tactic.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1197
diff
changeset
|
795 |
| rLm7 "name" "rtrm7" --"bind left in right" |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
796 |
| 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
|
797 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
798 |
primrec |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
799 |
rbv7 |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
800 |
where |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
801 |
"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
|
802 |
| "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
|
803 |
| "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
|
804 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
805 |
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
|
806 |
print_theorems |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
807 |
|
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
808 |
local_setup {* snd o define_fv_alpha "Terms.rtrm7" [ |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
809 |
[[[]], [[(NONE, 0)], [(NONE, 0)]], [[(SOME @{term rbv7}, 0)], [(SOME @{term rbv7}, 0)]]]] *} |
1198
5523d5713a65
Experiments for the pseudo-injectivity tactic.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1197
diff
changeset
|
810 |
print_theorems |
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
811 |
notation |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
812 |
alpha_rtrm7 ("_ \<approx>7a _" [100, 100] 100) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
813 |
(* HERE THE RULES DIFFER *) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
814 |
thm alpha_rtrm7.intros |
1198
5523d5713a65
Experiments for the pseudo-injectivity tactic.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1197
diff
changeset
|
815 |
thm fv_rtrm7.simps |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
816 |
inductive |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
817 |
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
|
818 |
where |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
819 |
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
|
820 |
| 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
|
821 |
| 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
|
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 "(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
|
824 |
apply simp |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
825 |
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
|
826 |
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
|
827 |
apply simp |
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 a3) |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
829 |
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
|
830 |
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
|
831 |
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
|
832 |
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
|
833 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
834 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
835 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
836 |
|
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 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
839 |
datatype rfoo8 = |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
840 |
Foo0 "name" |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
841 |
| 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
|
842 |
and rbar8 = |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
843 |
Bar0 "name" |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
844 |
| 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
|
845 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
846 |
primrec |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
847 |
rbv8 |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
848 |
where |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
849 |
"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
|
850 |
| "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
|
851 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
852 |
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
|
853 |
print_theorems |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
854 |
|
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
855 |
local_setup {* snd o define_fv_alpha "Terms.rfoo8" [ |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
856 |
[[[]], [[(SOME @{term rbv8}, 0)], [(SOME @{term rbv8}, 0)]]], [[[]], [[], [(NONE, 1)], [(NONE, 1)]]]] *} |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
857 |
notation |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
858 |
alpha_rfoo8 ("_ \<approx>f' _" [100, 100] 100) and |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
859 |
alpha_rbar8 ("_ \<approx>b' _" [100, 100] 100) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
860 |
(* HERE THE RULE DIFFERS *) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
861 |
thm alpha_rfoo8_alpha_rbar8.intros |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
862 |
|
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
863 |
|
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
864 |
inductive |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
865 |
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
|
866 |
and |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
867 |
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
|
868 |
where |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
869 |
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
|
870 |
| 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
|
871 |
| 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
|
872 |
| 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
|
873 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
874 |
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
|
875 |
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
|
876 |
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
|
877 |
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
|
878 |
done |
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 |
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
|
881 |
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
|
882 |
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
|
883 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
884 |
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
|
885 |
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
|
886 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
887 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
888 |
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
|
889 |
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
|
890 |
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
|
891 |
apply (simp_all add: alpha_gen fv_rbar8_rsp_hlp) |
1183
cb3da5b540f2
Fixed proofs in Terms2 and found a mistake in Terms.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1182
diff
changeset
|
892 |
apply clarify |
cb3da5b540f2
Fixed proofs in Terms2 and found a mistake in Terms.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1182
diff
changeset
|
893 |
apply (erule alpha8f_alpha8b.inducts(2)) |
cb3da5b540f2
Fixed proofs in Terms2 and found a mistake in Terms.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1182
diff
changeset
|
894 |
apply (simp_all) |
cb3da5b540f2
Fixed proofs in Terms2 and found a mistake in Terms.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1182
diff
changeset
|
895 |
done |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
896 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
897 |
|
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 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
900 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
901 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
902 |
datatype rlam9 = |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
903 |
Var9 "name" |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
904 |
| 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
|
905 |
and rbla9 = |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
906 |
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
|
907 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
908 |
primrec |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
909 |
rbv9 |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
910 |
where |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
911 |
"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
|
912 |
| "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
|
913 |
|
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
914 |
setup {* snd o define_raw_perms ["rlam9", "rbla9"] ["Terms.rlam9", "Terms.rbla9"] *} |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
915 |
print_theorems |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
916 |
|
1193
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
917 |
local_setup {* snd o define_fv_alpha "Terms.rlam9" [ |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
918 |
[[[]], [[(NONE, 0)], [(NONE, 0)]]], [[[(SOME @{term rbv9}, 0)], [(SOME @{term rbv9}, 0)]]]] *} |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
919 |
notation |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
920 |
alpha_rlam9 ("_ \<approx>9l' _" [100, 100] 100) and |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
921 |
alpha_rbla9 ("_ \<approx>9b' _" [100, 100] 100) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
922 |
(* HERE THE RULES DIFFER *) |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
923 |
thm alpha_rlam9_alpha_rbla9.intros |
a228acf2907e
Full alpha equivalence + testing in terms. Some differ but it seems the generated version is more correct.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1190
diff
changeset
|
924 |
|
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
925 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
926 |
inductive |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
927 |
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
|
928 |
and |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
929 |
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
|
930 |
where |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
931 |
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
|
932 |
| 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
|
933 |
| 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
|
934 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
935 |
quotient_type |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
936 |
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
|
937 |
sorry |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
938 |
|
1190
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
939 |
local_setup {* |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
940 |
(fn ctxt => ctxt |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
941 |
|> snd o (Quotient_Def.quotient_lift_const ("qVar9", @{term Var9})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
942 |
|> snd o (Quotient_Def.quotient_lift_const ("qLam9", @{term Lam9})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
943 |
|> snd o (Quotient_Def.quotient_lift_const ("qBla9", @{term Bla9})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
944 |
|> snd o (Quotient_Def.quotient_lift_const ("fv_lam9", @{term fv_rlam9})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
945 |
|> snd o (Quotient_Def.quotient_lift_const ("fv_bla9", @{term fv_rbla9})) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
946 |
|> snd o (Quotient_Def.quotient_lift_const ("bv9", @{term rbv9}))) |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
947 |
*} |
d900d19931fa
Testing auto constant lifting.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1187
diff
changeset
|
948 |
print_theorems |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
949 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
950 |
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
|
951 |
begin |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
952 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
953 |
quotient_definition |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
954 |
"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
|
955 |
is |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
956 |
"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
|
957 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
958 |
quotient_definition |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
959 |
"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
|
960 |
is |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
961 |
"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
|
962 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
963 |
instance |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
964 |
sorry |
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 |
end |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
967 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
968 |
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
|
969 |
\<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
|
970 |
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
|
971 |
apply injection |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
972 |
sorry |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
973 |
|
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 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
981 |
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
|
982 |
datatype ty = |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
983 |
Var "name" |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
984 |
| 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
|
985 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
986 |
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
|
987 |
print_theorems |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
988 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
989 |
datatype tyS = |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
990 |
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
|
991 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
992 |
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
|
993 |
print_theorems |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
994 |
|
1199
5770c73f2415
Automatic production and proving of pseudo-injectivity.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1198
diff
changeset
|
995 |
local_setup {* snd o define_fv_alpha "Terms.ty" [[[[]], [[], []]]] *} |
1182
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
996 |
print_theorems |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
997 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
998 |
(* |
1185
7566b899ca6a
Code for handling atom sets.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1184
diff
changeset
|
999 |
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
|
1000 |
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
|
1001 |
print_theorems |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1002 |
*) |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1003 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1004 |
primrec |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1005 |
fv_tyS |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1006 |
where |
1185
7566b899ca6a
Code for handling atom sets.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1184
diff
changeset
|
1007 |
"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
|
1008 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1009 |
inductive |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1010 |
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
|
1011 |
where |
1185
7566b899ca6a
Code for handling atom sets.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1184
diff
changeset
|
1012 |
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
|
1013 |
\<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
|
1014 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1015 |
lemma |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1016 |
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
|
1017 |
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
|
1018 |
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
|
1019 |
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
|
1020 |
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
|
1021 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1022 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1023 |
lemma |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1024 |
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
|
1025 |
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
|
1026 |
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
|
1027 |
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
|
1028 |
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
|
1029 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1030 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1031 |
lemma |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1032 |
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
|
1033 |
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
|
1034 |
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
|
1035 |
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
|
1036 |
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
|
1037 |
done |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1038 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1039 |
lemma |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1040 |
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
|
1041 |
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
|
1042 |
using a |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1043 |
apply(clarify) |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1044 |
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
|
1045 |
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
|
1046 |
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
|
1047 |
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
|
1048 |
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
|
1049 |
apply(clarify) |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1050 |
apply(simp) |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1051 |
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
|
1052 |
apply(auto) |
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1053 |
done |
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 |
|
3c32f91fa771
Terms2 with bindings for binders synchronized with bindings they are used in.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1056 |
end |