author | Cezary Kaliszyk <kaliszyk@in.tum.de> |
Tue, 20 Dec 2011 16:12:32 +0900 | |
changeset 3080 | 9253984db291 |
parent 3079 | a303ef51cd97 |
child 3081 | 660a4f5adee8 |
permissions | -rw-r--r-- |
3078
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
1 |
theory BetaCR |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
2 |
imports |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
3 |
"../Nominal2" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
4 |
begin |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
5 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
6 |
atom_decl name |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
7 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
8 |
nominal_datatype lam = |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
9 |
Var "name" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
10 |
| App "lam" "lam" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
11 |
| Lam x::"name" l::"lam" binds x in l ("Lam [_]. _" [100, 100] 100) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
12 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
13 |
nominal_primrec |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
14 |
subst :: "lam \<Rightarrow> name \<Rightarrow> lam \<Rightarrow> lam" ("_ [_ ::= _]" [90, 90, 90] 90) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
15 |
where |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
16 |
"(Var x)[y ::= s] = (if x = y then s else (Var x))" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
17 |
| "(App t1 t2)[y ::= s] = App (t1[y ::= s]) (t2[y ::= s])" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
18 |
| "atom x \<sharp> (y, s) \<Longrightarrow> (Lam [x]. t)[y ::= s] = Lam [x].(t[y ::= s])" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
19 |
unfolding eqvt_def subst_graph_def |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
20 |
apply (rule, perm_simp, rule) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
21 |
apply(rule TrueI) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
22 |
apply(auto simp add: lam.distinct lam.eq_iff) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
23 |
apply(rule_tac y="a" and c="(aa, b)" in lam.strong_exhaust) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
24 |
apply(blast)+ |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
25 |
apply(simp_all add: fresh_star_def fresh_Pair_elim) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
26 |
apply (erule_tac c="(ya,sa)" in Abs_lst1_fcb2) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
27 |
apply(simp_all add: Abs_fresh_iff) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
28 |
apply(simp add: fresh_star_def fresh_Pair) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
29 |
apply(simp add: eqvt_at_def atom_eqvt fresh_star_Pair perm_supp_eq) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
30 |
apply(simp add: eqvt_at_def atom_eqvt fresh_star_Pair perm_supp_eq) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
31 |
done |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
32 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
33 |
termination (eqvt) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
34 |
by lexicographic_order |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
35 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
36 |
lemma fresh_fact: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
37 |
fixes z::"name" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
38 |
assumes a: "atom z \<sharp> s" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
39 |
and b: "z = y \<or> atom z \<sharp> t" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
40 |
shows "atom z \<sharp> t[y ::= s]" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
41 |
using a b |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
42 |
by (nominal_induct t avoiding: z y s rule: lam.strong_induct) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
43 |
(auto simp add: lam.fresh fresh_at_base) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
44 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
45 |
inductive |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
46 |
beta :: "lam \<Rightarrow> lam \<Rightarrow> bool" (" _ \<longrightarrow>b _" [80,80] 80) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
47 |
where |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
48 |
b1[intro]: "t1 \<longrightarrow>b t2 \<Longrightarrow> App t1 s \<longrightarrow>b App t2 s" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
49 |
| b2[intro]: "s1 \<longrightarrow>b s2 \<Longrightarrow> App t s1 \<longrightarrow>b App t s2" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
50 |
| b3[intro]: "t1 \<longrightarrow>b t2 \<Longrightarrow> Lam [x]. t1 \<longrightarrow>b Lam [x]. t2" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
51 |
| b4[intro]: "atom x \<sharp> s \<Longrightarrow> App (Lam [x]. t) s \<longrightarrow>b t[x ::= s]" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
52 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
53 |
equivariance beta |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
54 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
55 |
(* HERE 1 *) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
56 |
nominal_inductive beta |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
57 |
avoids b3: x |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
58 |
by (simp_all add: fresh_star_def fresh_Pair lam.fresh fresh_fact) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
59 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
60 |
(* This also works, but we cannot have them together: *) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
61 |
(*nominal_inductive beta |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
62 |
avoids b4: x |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
63 |
by (simp_all add: fresh_star_def fresh_Pair lam.fresh fresh_fact)*) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
64 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
65 |
(* But I need a combination, possibly with an 'and' syntax: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
66 |
nominal_inductive beta |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
67 |
avoids b3: x and b4: x |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
68 |
by (simp_all add: fresh_star_def fresh_Pair lam.fresh fresh_fact) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
69 |
*) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
70 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
71 |
(* The combination should look like this: *) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
72 |
lemma beta_strong_induct: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
73 |
assumes "x1 \<longrightarrow>b x2" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
74 |
and "\<And>t1 t2 s c. \<lbrakk> t1 \<longrightarrow>b t2; \<And>c. P c t1 t2\<rbrakk> \<Longrightarrow> P c (App t1 s) (App t2 s)" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
75 |
and "\<And>s1 s2 t c. \<lbrakk> s1 \<longrightarrow>b s2; \<And>c. P c s1 s2\<rbrakk> \<Longrightarrow> P c (App t s1) (App t s2)" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
76 |
and "\<And>t1 t2 x c. \<lbrakk>{atom x} \<sharp>* c; t1 \<longrightarrow>b t2; \<And>c. P c t1 t2\<rbrakk> \<Longrightarrow> P c (Lam [x]. t1) (Lam [x]. t2)" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
77 |
and "\<And>x s t c. \<lbrakk>{atom x} \<sharp>* c; atom x \<sharp> s\<rbrakk> \<Longrightarrow> P c (App (Lam [x]. t) s) (t [x ::= s])" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
78 |
shows "P (c\<Colon>'a\<Colon>fs) x1 x2" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
79 |
sorry |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
80 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
81 |
inductive |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
82 |
beta_star :: "lam \<Rightarrow> lam \<Rightarrow> bool" (" _ \<longrightarrow>b* _" [80,80] 80) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
83 |
where |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
84 |
bs1[intro, simp]: "M \<longrightarrow>b* M" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
85 |
| bs2[intro]: "\<lbrakk>M1\<longrightarrow>b* M2; M2 \<longrightarrow>b M3\<rbrakk> \<Longrightarrow> M1 \<longrightarrow>b* M3" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
86 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
87 |
lemma beta_star_trans: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
88 |
assumes "A \<longrightarrow>b* B" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
89 |
and "B \<longrightarrow>b* C" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
90 |
shows "A \<longrightarrow>b* C" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
91 |
using assms(2) assms(1) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
92 |
by induct auto |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
93 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
94 |
(* HERE 2: Does not work:*) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
95 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
96 |
(* equivariance beta_star *) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
97 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
98 |
(* proved manually below. *) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
99 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
100 |
lemma eqvt_helper: "x1 \<longrightarrow>b* x2 \<Longrightarrow> (p \<bullet> x1) \<longrightarrow>b* (p \<bullet> x2)" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
101 |
apply (erule beta_star.induct) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
102 |
apply auto |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
103 |
using eqvt(1) bs2 |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
104 |
by blast |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
105 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
106 |
lemma [eqvt]: "p \<bullet> (x1 \<longrightarrow>b* x2) = ((p \<bullet> x1) \<longrightarrow>b* (p \<bullet> x2))" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
107 |
apply rule |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
108 |
apply (drule permute_boolE) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
109 |
apply (erule eqvt_helper) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
110 |
apply (intro permute_boolI) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
111 |
apply (drule_tac p="-p" in eqvt_helper) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
112 |
by simp |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
113 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
114 |
definition |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
115 |
equ :: "lam \<Rightarrow> lam \<Rightarrow> bool" ("_ \<approx> _") |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
116 |
where |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
117 |
"t \<approx> s \<longleftrightarrow> (\<exists>r. t \<longrightarrow>b* r \<and> s \<longrightarrow>b* r)" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
118 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
119 |
lemma equ_refl: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
120 |
shows "t \<approx> t" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
121 |
unfolding equ_def by auto |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
122 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
123 |
lemma equ_sym: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
124 |
assumes "t \<approx> s" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
125 |
shows "s \<approx> t" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
126 |
using assms unfolding equ_def |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
127 |
by auto |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
128 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
129 |
(* can be ported from nominal1 *) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
130 |
lemma cr: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
131 |
assumes "t \<longrightarrow>b* t1" and "t \<longrightarrow>b* t2" shows "\<exists>t3. t1 \<longrightarrow>b* t3 \<and> t2 \<longrightarrow>b* t3" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
132 |
sorry |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
133 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
134 |
lemma equ_trans: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
135 |
assumes "A \<approx> B" "B \<approx> C" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
136 |
shows "A \<approx> C" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
137 |
using assms unfolding equ_def |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
138 |
proof (elim exE conjE) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
139 |
fix D E |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
140 |
assume a: "A \<longrightarrow>b* D" "B \<longrightarrow>b* D" "B \<longrightarrow>b* E" "C \<longrightarrow>b* E" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
141 |
then obtain F where "D \<longrightarrow>b* F" "E \<longrightarrow>b* F" using cr by blast |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
142 |
then have "A \<longrightarrow>b* F \<and> C \<longrightarrow>b* F" using a beta_star_trans by blast |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
143 |
then show "\<exists>F. A \<longrightarrow>b* F \<and> C \<longrightarrow>b* F" by blast |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
144 |
qed |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
145 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
146 |
lemma App_beta: "A \<longrightarrow>b* B \<Longrightarrow> C \<longrightarrow>b* D \<Longrightarrow> App A C \<longrightarrow>b* App B D" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
147 |
apply (erule beta_star.induct) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
148 |
apply auto |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
149 |
apply (erule beta_star.induct) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
150 |
apply auto |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
151 |
done |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
152 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
153 |
lemma Lam_beta: "A \<longrightarrow>b* B \<Longrightarrow> Lam [x]. A \<longrightarrow>b* Lam [x]. B" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
154 |
by (erule beta_star.induct) auto |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
155 |
|
3080
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
156 |
lemma Lam_rsp: "A \<approx> B \<Longrightarrow> Lam [x]. A \<approx> Lam [x]. B" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
157 |
unfolding equ_def |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
158 |
apply auto |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
159 |
apply (rule_tac x="Lam [x]. r" in exI) |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
160 |
apply (auto simp add: Lam_beta) |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
161 |
done |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
162 |
|
3078
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
163 |
lemma [quot_respect]: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
164 |
shows "(op = ===> equ) Var Var" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
165 |
and "(equ ===> equ ===> equ) App App" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
166 |
and "(op = ===> equ ===> equ) BetaCR.Lam BetaCR.Lam" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
167 |
unfolding fun_rel_def equ_def |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
168 |
apply auto |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
169 |
apply (rule_tac x="App r ra" in exI) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
170 |
apply (auto simp add: App_beta) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
171 |
apply (rule_tac x="Lam [x]. r" in exI) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
172 |
apply (auto simp add: Lam_beta) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
173 |
done |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
174 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
175 |
lemma beta_subst1_pre: "B \<longrightarrow>b C \<Longrightarrow> A [x ::= B] \<longrightarrow>b* A [x ::= C]" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
176 |
by (nominal_induct A avoiding: x B C rule: lam.strong_induct) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
177 |
(auto simp add: App_beta Lam_beta) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
178 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
179 |
lemma beta_subst1: "B \<longrightarrow>b* C \<Longrightarrow> A [x ::= B] \<longrightarrow>b* A [x ::= C]" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
180 |
apply (erule beta_star.induct) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
181 |
apply auto |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
182 |
apply (subgoal_tac "A [x ::= M2] \<longrightarrow>b* A [x ::= M3]") |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
183 |
apply (rotate_tac 1) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
184 |
apply (erule beta_star_trans) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
185 |
apply assumption |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
186 |
apply (simp add: beta_subst1_pre) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
187 |
done |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
188 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
189 |
lemma forget: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
190 |
shows "atom x \<sharp> t \<Longrightarrow> t[x ::= s] = t" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
191 |
by (nominal_induct t avoiding: x s rule: lam.strong_induct) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
192 |
(auto simp add: lam.fresh fresh_at_base) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
193 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
194 |
lemma substitution_lemma: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
195 |
assumes a: "x \<noteq> y" "atom x \<sharp> u" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
196 |
shows "t[x ::= s][y ::= u] = t[y ::= u][x ::= s[y ::= u]]" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
197 |
using a |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
198 |
by (nominal_induct t avoiding: x y s u rule: lam.strong_induct) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
199 |
(auto simp add: fresh_fact forget) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
200 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
201 |
lemma beta_subst2_pre: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
202 |
assumes "A \<longrightarrow>b B" shows "A [x ::= C] \<longrightarrow>b* B [x ::= C]" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
203 |
using assms |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
204 |
(* HERE 3: nominal_induct doesn't work - leaves the assumption *) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
205 |
(* apply (nominal_induct avoiding: x C rule: beta_strong_induct)*) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
206 |
apply - |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
207 |
apply (erule beta_strong_induct[of A B "\<lambda>c A B. A [(fst c) ::= (snd c)] \<longrightarrow>b* B [(fst c) ::= (snd c)]" "(x, C)", simplified]) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
208 |
apply (auto simp add: App_beta fresh_star_def fresh_Pair Lam_beta)[3] |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
209 |
apply (subst substitution_lemma) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
210 |
apply (auto simp add: fresh_star_def fresh_Pair fresh_at_base)[2] |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
211 |
apply (auto simp add: fresh_star_def fresh_Pair) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
212 |
apply (rule beta_star.intros) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
213 |
defer |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
214 |
apply (subst beta.intros) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
215 |
apply (auto simp add: fresh_fact) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
216 |
done |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
217 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
218 |
lemma beta_subst2: "A \<longrightarrow>b* B \<Longrightarrow> A [x ::= C] \<longrightarrow>b* B [x ::= C]" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
219 |
apply (erule beta_star.induct) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
220 |
apply auto |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
221 |
apply (subgoal_tac "M2[x ::= C] \<longrightarrow>b* M3[x ::= C]") |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
222 |
apply (rotate_tac 1) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
223 |
apply (erule beta_star_trans) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
224 |
apply assumption |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
225 |
apply (simp add: beta_subst2_pre) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
226 |
done |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
227 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
228 |
lemma beta_subst: "A \<longrightarrow>b* B \<Longrightarrow> C \<longrightarrow>b* D \<Longrightarrow> A [x ::= C] \<longrightarrow>b* B [x ::= D]" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
229 |
using beta_subst1 beta_subst2 beta_star_trans by metis |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
230 |
|
3080
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
231 |
lemma subst_rsp_pre: |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
232 |
"x \<approx> y \<Longrightarrow> xb \<approx> ya \<Longrightarrow> x [xa ::= xb] \<approx> y [xa ::= ya]" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
233 |
unfolding equ_def |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
234 |
apply auto |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
235 |
apply (rule_tac x="r [xa ::= ra]" in exI) |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
236 |
apply (simp add: beta_subst) |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
237 |
done |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
238 |
|
3078
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
239 |
lemma [quot_respect]: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
240 |
shows "(equ ===> op = ===> equ ===> equ) subst subst" |
3080
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
241 |
unfolding fun_rel_def by (auto simp add: subst_rsp_pre) |
3078
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
242 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
243 |
lemma [quot_respect]: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
244 |
shows "(op = ===> equ ===> equ) permute permute" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
245 |
unfolding fun_rel_def equ_def |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
246 |
apply (auto intro: eqvts) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
247 |
apply (rule_tac x="x \<bullet> r" in exI) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
248 |
using eqvts(1) permute_boolI by metis |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
249 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
250 |
quotient_type qlam = lam / equ |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
251 |
by (auto intro!: equivpI reflpI sympI transpI simp add: equ_refl equ_sym) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
252 |
(erule equ_trans, assumption) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
253 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
254 |
quotient_definition "QVar::name \<Rightarrow> qlam" is Var |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
255 |
quotient_definition "QApp::qlam \<Rightarrow> qlam \<Rightarrow> qlam" is App |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
256 |
quotient_definition QLam ("QLam [_]._") |
3079 | 257 |
where "QLam::name \<Rightarrow> qlam \<Rightarrow> qlam" is BetaCR.Lam |
3078
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
258 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
259 |
lemmas qlam_strong_induct = lam.strong_induct[quot_lifted] |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
260 |
lemmas qlam_induct = lam.induct[quot_lifted] |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
261 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
262 |
instantiation qlam :: pt |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
263 |
begin |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
264 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
265 |
quotient_definition "permute_qlam::perm \<Rightarrow> qlam \<Rightarrow> qlam" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
266 |
is "permute::perm \<Rightarrow> lam \<Rightarrow> lam" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
267 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
268 |
instance |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
269 |
apply default |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
270 |
apply(descending) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
271 |
apply(simp) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
272 |
apply(rule equ_refl) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
273 |
apply(descending) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
274 |
apply(simp) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
275 |
apply(rule equ_refl) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
276 |
done |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
277 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
278 |
end |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
279 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
280 |
lemma qlam_perm[simp, eqvt]: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
281 |
shows "p \<bullet> (QVar x) = QVar (p \<bullet> x)" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
282 |
and "p \<bullet> (QApp t s) = QApp (p \<bullet> t) (p \<bullet> s)" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
283 |
and "p \<bullet> (QLam [x].t) = QLam [p \<bullet> x].(p \<bullet> t)" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
284 |
by(descending, simp add: equ_refl)+ |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
285 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
286 |
lemma qlam_supports: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
287 |
shows "{atom x} supports (QVar x)" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
288 |
and "supp (t, s) supports (QApp t s)" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
289 |
and "supp (x, t) supports (QLam [x].t)" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
290 |
unfolding supports_def fresh_def[symmetric] |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
291 |
by (auto simp add: swap_fresh_fresh) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
292 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
293 |
lemma qlam_fs: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
294 |
fixes t::"qlam" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
295 |
shows "finite (supp t)" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
296 |
apply(induct t rule: qlam_induct) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
297 |
apply(rule supports_finite) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
298 |
apply(rule qlam_supports) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
299 |
apply(simp) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
300 |
apply(rule supports_finite) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
301 |
apply(rule qlam_supports) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
302 |
apply(simp add: supp_Pair) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
303 |
apply(rule supports_finite) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
304 |
apply(rule qlam_supports) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
305 |
apply(simp add: supp_Pair finite_supp) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
306 |
done |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
307 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
308 |
instantiation qlam :: fs |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
309 |
begin |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
310 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
311 |
instance |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
312 |
apply(default) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
313 |
apply(rule qlam_fs) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
314 |
done |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
315 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
316 |
end |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
317 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
318 |
quotient_definition subst_qlam ("_[_ ::q= _]") |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
319 |
where "subst_qlam::qlam \<Rightarrow> name \<Rightarrow> qlam \<Rightarrow> qlam" is subst |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
320 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
321 |
definition |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
322 |
"Supp t = \<Inter>{supp s | s. s \<approx> t}" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
323 |
|
3080
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
324 |
lemma Supp_rsp: |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
325 |
"a \<approx> b \<Longrightarrow> Supp a = Supp b" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
326 |
unfolding Supp_def |
3078
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
327 |
apply(rule_tac f="Inter" in arg_cong) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
328 |
apply(auto) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
329 |
apply (metis equ_trans) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
330 |
by (metis equivp_def qlam_equivp) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
331 |
|
3080
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
332 |
lemma [quot_respect]: |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
333 |
shows "(equ ===> op=) Supp Supp" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
334 |
unfolding fun_rel_def by (auto simp add: Supp_rsp) |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
335 |
|
3078
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
336 |
quotient_definition "supp_qlam::qlam \<Rightarrow> atom set" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
337 |
is "Supp::lam \<Rightarrow> atom set" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
338 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
339 |
lemma Supp_supp: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
340 |
"Supp t \<subseteq> supp t" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
341 |
unfolding Supp_def |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
342 |
apply(auto) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
343 |
apply(drule_tac x="supp t" in spec) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
344 |
apply(auto simp add: equ_refl) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
345 |
done |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
346 |
|
3080
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
347 |
lemma supp_subst: |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
348 |
shows "supp (t[x ::= s]) \<subseteq> (supp t - {atom x}) \<union> supp s" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
349 |
by (induct t x s rule: subst.induct) (auto simp add: lam.supp supp_at_base) |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
350 |
|
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
351 |
lemma supp_beta: "x \<longrightarrow>b r \<Longrightarrow> supp r \<subseteq> supp x" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
352 |
apply (induct rule: beta.induct) |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
353 |
apply (simp_all add: lam.supp) |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
354 |
apply blast+ |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
355 |
using supp_subst by blast |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
356 |
|
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
357 |
lemma supp_beta_star: "x \<longrightarrow>b* r \<Longrightarrow> supp r \<subseteq> supp x" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
358 |
apply (erule beta_star.induct) |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
359 |
apply auto |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
360 |
using supp_beta by blast |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
361 |
|
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
362 |
lemma supp_equ: "x \<approx> y \<Longrightarrow> \<exists>z. z \<approx> x \<and> supp z \<subseteq> supp x \<inter> supp y" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
363 |
unfolding equ_def |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
364 |
apply (simp (no_asm) only: equ_def[symmetric]) |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
365 |
apply (elim exE) |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
366 |
apply (rule_tac x=r in exI) |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
367 |
apply rule |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
368 |
apply (metis bs1 equ_def) |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
369 |
using supp_beta_star by blast |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
370 |
|
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
371 |
lemma supp_psubset: "Supp x \<subset> supp x \<Longrightarrow> \<exists>t. t \<approx> x \<and> supp t \<subset> supp x" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
372 |
proof - |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
373 |
assume "Supp x \<subset> supp x" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
374 |
then obtain a where "a \<in> supp x" "a \<notin> Supp x" by blast |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
375 |
then obtain y where nin: "y \<approx> x" "a \<notin> supp y" unfolding Supp_def by blast |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
376 |
then obtain t where eq: "t \<approx> x" "supp t \<subseteq> supp x \<inter> supp y" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
377 |
using supp_equ equ_sym by blast |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
378 |
then have "supp t \<subset> supp x" using nin |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
379 |
by (metis `(a\<Colon>atom) \<in> supp (x\<Colon>lam)` le_infE psubset_eq set_rev_mp) |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
380 |
then show "\<exists>t. t \<approx> x \<and> supp t \<subset> supp x" using eq by blast |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
381 |
qed |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
382 |
|
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
383 |
lemma Supp_exists: "\<exists>t. supp t = Supp t \<and> t \<approx> x" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
384 |
proof - |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
385 |
have "\<And>fs x. supp x = fs \<Longrightarrow> \<exists>t. supp t = Supp t \<and> t \<approx> x" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
386 |
proof - |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
387 |
fix fs |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
388 |
show "\<And>x. supp x = fs \<Longrightarrow> \<exists>t\<Colon>lam. supp t = Supp t \<and> t \<approx> x" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
389 |
proof (cases "finite fs") |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
390 |
case True |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
391 |
assume fs: "finite fs" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
392 |
then show "\<And>x. supp x = fs \<Longrightarrow> \<exists>t\<Colon>lam. supp t = Supp t \<and> t \<approx> x" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
393 |
proof (induct fs rule: finite_psubset_induct, clarify) |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
394 |
fix A :: "atom set" fix x :: lam |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
395 |
assume IH: "\<And>B xa. \<lbrakk>B \<subset> supp x; supp xa = B\<rbrakk> \<Longrightarrow> \<exists>t\<Colon>lam. supp t = Supp t \<and> t \<approx> xa" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
396 |
show "\<exists>t\<Colon>lam. supp t = Supp t \<and> t \<approx> x" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
397 |
proof (cases "supp x = Supp x") |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
398 |
assume "supp x = Supp x" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
399 |
then show "\<exists>t\<Colon>lam. supp t = Supp t \<and> t \<approx> x" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
400 |
by (rule_tac x="x" in exI) (simp add: equ_refl) |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
401 |
next |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
402 |
assume "supp x \<noteq> Supp x" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
403 |
then have "Supp x \<subset> supp x" using Supp_supp by blast |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
404 |
then obtain y where a1: "supp y \<subset> supp x" "y \<approx> x" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
405 |
using supp_psubset by blast |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
406 |
then obtain t where "supp t = Supp t \<and> t \<approx> y" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
407 |
using IH[of "supp y" y] by blast |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
408 |
then show "\<exists>t\<Colon>lam. supp t = Supp t \<and> t \<approx> x" using a1 equ_trans |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
409 |
by blast |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
410 |
qed |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
411 |
qed |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
412 |
next |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
413 |
case False |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
414 |
fix x :: lam |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
415 |
assume "supp x = fs" "infinite fs" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
416 |
then show "\<exists>t\<Colon>lam. supp t = Supp t \<and> t \<approx> x" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
417 |
by (auto simp add: finite_supp) |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
418 |
qed simp |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
419 |
qed |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
420 |
then show "\<exists>t\<Colon>lam. supp t = Supp t \<and> t \<approx> x" by blast |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
421 |
qed |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
422 |
|
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
423 |
lemma subst3: "x \<noteq> y \<and> atom x \<notin> Supp s \<Longrightarrow> Lam [x]. t [y ::= s] \<approx> Lam [x]. (t [y ::= s])" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
424 |
proof - |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
425 |
assume as: "x \<noteq> y \<and> atom x \<notin> Supp s" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
426 |
obtain s' where s: "supp s' = Supp s'" "s' \<approx> s" using Supp_exists[of s] by blast |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
427 |
then have lhs: "Lam [x]. t [y ::= s] \<approx> Lam [x]. t [y ::= s']" using subst_rsp_pre equ_refl equ_sym by blast |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
428 |
have supp: "Supp s' = Supp s" using Supp_rsp s(2) by blast |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
429 |
have lhs_rhs: "Lam [x]. t [y ::= s'] = Lam [x]. (t [y ::= s'])" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
430 |
by (simp add: fresh_def supp_Pair s supp as supp_at_base) |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
431 |
have "t [y ::= s'] \<approx> t [y ::= s]" |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
432 |
using subst_rsp_pre[OF equ_refl s(2)] . |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
433 |
with Lam_rsp have rhs: "Lam [x]. (t [y ::= s']) \<approx> Lam [x]. (t [y ::= s])" . |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
434 |
show ?thesis |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
435 |
using lhs[unfolded lhs_rhs] rhs equ_trans by blast |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
436 |
qed |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
437 |
|
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
438 |
thm subst3[quot_lifted] |
9253984db291
Lift substitution of an Abstraction for BetaCR :)
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
3079
diff
changeset
|
439 |
|
3078
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
440 |
lemma Supp_Lam: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
441 |
"atom a \<notin> Supp (Lam [a].t)" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
442 |
proof - |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
443 |
have "atom a \<notin> supp (Lam [a].t)" by (simp add: lam.supp) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
444 |
then show ?thesis using Supp_supp |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
445 |
by blast |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
446 |
qed |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
447 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
448 |
lemma [eqvt]: "(p \<bullet> (a \<approx> b)) = ((p \<bullet> a) \<approx> (p \<bullet> b))" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
449 |
unfolding equ_def |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
450 |
by perm_simp rule |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
451 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
452 |
lemma [eqvt]: "p \<bullet> (Supp x) = Supp (p \<bullet> x)" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
453 |
unfolding Supp_def |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
454 |
by perm_simp rule |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
455 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
456 |
lemmas s = Supp_Lam[quot_lifted] |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
457 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
458 |
lemma var_beta_pre: "s \<longrightarrow>b* r \<Longrightarrow> s = Var name \<Longrightarrow> r = Var name" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
459 |
apply (induct rule: beta_star.induct) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
460 |
apply simp |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
461 |
apply (subgoal_tac "M2 = Var name") |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
462 |
apply (thin_tac "M1 \<longrightarrow>b* M2") |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
463 |
apply (thin_tac "M1 = Var name") |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
464 |
apply (thin_tac "M1 = Var name \<Longrightarrow> M2 = Var name") |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
465 |
defer |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
466 |
apply simp |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
467 |
apply (erule_tac beta.cases) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
468 |
apply simp_all |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
469 |
done |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
470 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
471 |
lemma var_beta: "Var name \<longrightarrow>b* r \<longleftrightarrow> r = Var name" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
472 |
by (auto simp add: var_beta_pre) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
473 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
474 |
lemma qlam_eq_iff: |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
475 |
"(QVar n = QVar m) = (n = m)" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
476 |
apply descending unfolding equ_def var_beta by auto |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
477 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
478 |
lemma "supp (QVar n) = {atom n}" |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
479 |
unfolding supp_def |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
480 |
apply simp |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
481 |
unfolding qlam_eq_iff |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
482 |
apply (fold supp_def) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
483 |
apply (simp add: supp_at_base) |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
484 |
done |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
485 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
486 |
end |
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
487 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
488 |
|
abf147627b4b
Retry Beta using a reduction relation and its reflexive-symmetric-transitive closure.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
diff
changeset
|
489 |