| author | urbanc |
| Wed, 28 Mar 2007 18:25:23 +0200 | |
| changeset 22541 | c33b542394f3 |
| parent 22540 | e4817fa0f6a1 |
| child 22542 | 8279a25ad0ae |
| permissions | -rw-r--r-- |
| 18269 | 1 |
(* $Id$ *) |
| 18106 | 2 |
|
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
3 |
theory CR |
| 21138 | 4 |
imports Lam_Funs |
| 18106 | 5 |
begin |
6 |
||
| 18269 | 7 |
text {* The Church-Rosser proof from Barendregt's book *}
|
8 |
||
|
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
9 |
lemma forget: |
|
20955
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
10 |
assumes asm: "x\<sharp>L" |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
11 |
shows "L[x::=P] = L" |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
12 |
using asm |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
13 |
proof (nominal_induct L avoiding: x P rule: lam.induct) |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
14 |
case (Var z) |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
15 |
have "x\<sharp>Var z" by fact |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
16 |
thus "(Var z)[x::=P] = (Var z)" by (simp add: fresh_atm) |
| 18106 | 17 |
next |
|
20955
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
18 |
case (App M1 M2) |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
19 |
have "x\<sharp>App M1 M2" by fact |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
20 |
moreover |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
21 |
have ih1: "x\<sharp>M1 \<Longrightarrow> M1[x::=P] = M1" by fact |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
22 |
moreover |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
23 |
have ih1: "x\<sharp>M2 \<Longrightarrow> M2[x::=P] = M2" by fact |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
24 |
ultimately show "(App M1 M2)[x::=P] = (App M1 M2)" by simp |
| 18106 | 25 |
next |
|
20955
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
26 |
case (Lam z M) |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
27 |
have vc: "z\<sharp>x" "z\<sharp>P" by fact |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
28 |
have ih: "x\<sharp>M \<Longrightarrow> M[x::=P] = M" by fact |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
29 |
have asm: "x\<sharp>Lam [z].M" by fact |
| 21101 | 30 |
then have "x\<sharp>M" using vc by (simp add: fresh_atm abs_fresh) |
31 |
then have "M[x::=P] = M" using ih by simp |
|
32 |
then show "(Lam [z].M)[x::=P] = Lam [z].M" using vc by simp |
|
| 18106 | 33 |
qed |
34 |
||
| 18378 | 35 |
lemma forget_automatic: |
|
20955
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
36 |
assumes asm: "x\<sharp>L" |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
37 |
shows "L[x::=P] = L" |
| 21101 | 38 |
using asm |
39 |
by (nominal_induct L avoiding: x P rule: lam.induct) |
|
40 |
(auto simp add: abs_fresh fresh_atm) |
|
| 18106 | 41 |
|
|
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
42 |
lemma fresh_fact: |
|
20955
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
43 |
fixes z::"name" |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
44 |
assumes asms: "z\<sharp>N" "z\<sharp>L" |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
45 |
shows "z\<sharp>(N[y::=L])" |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
46 |
using asms |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
47 |
proof (nominal_induct N avoiding: z y L rule: lam.induct) |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
48 |
case (Var u) |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
49 |
have "z\<sharp>(Var u)" "z\<sharp>L" by fact |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
50 |
thus "z\<sharp>((Var u)[y::=L])" by simp |
|
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
51 |
next |
|
20955
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
52 |
case (App N1 N2) |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
53 |
have ih1: "\<lbrakk>z\<sharp>N1; z\<sharp>L\<rbrakk> \<Longrightarrow> z\<sharp>N1[y::=L]" by fact |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
54 |
moreover |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
55 |
have ih2: "\<lbrakk>z\<sharp>N2; z\<sharp>L\<rbrakk> \<Longrightarrow> z\<sharp>N2[y::=L]" by fact |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
56 |
moreover |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
57 |
have "z\<sharp>App N1 N2" "z\<sharp>L" by fact |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
58 |
ultimately show "z\<sharp>((App N1 N2)[y::=L])" by simp |
|
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
59 |
next |
|
20955
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
60 |
case (Lam u N1) |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
61 |
have vc: "u\<sharp>z" "u\<sharp>y" "u\<sharp>L" by fact |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
62 |
have "z\<sharp>Lam [u].N1" by fact |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
63 |
hence "z\<sharp>N1" using vc by (simp add: abs_fresh fresh_atm) |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
64 |
moreover |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
65 |
have ih: "\<lbrakk>z\<sharp>N1; z\<sharp>L\<rbrakk> \<Longrightarrow> z\<sharp>(N1[y::=L])" by fact |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
66 |
moreover |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
67 |
have "z\<sharp>L" by fact |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
68 |
ultimately show "z\<sharp>(Lam [u].N1)[y::=L]" using vc by (simp add: abs_fresh) |
|
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
69 |
qed |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
70 |
|
| 18378 | 71 |
lemma fresh_fact_automatic: |
|
20955
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
72 |
fixes z::"name" |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
73 |
assumes asms: "z\<sharp>N" "z\<sharp>L" |
|
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
74 |
shows "z\<sharp>(N[y::=L])" |
| 21101 | 75 |
using asms |
76 |
by (nominal_induct N avoiding: z y L rule: lam.induct) |
|
77 |
(auto simp add: abs_fresh fresh_atm) |
|
| 18106 | 78 |
|
| 22540 | 79 |
lemma fresh_fact': |
80 |
fixes a::"name" |
|
81 |
assumes a: "a\<sharp>t2" |
|
82 |
shows "a\<sharp>t1[a::=t2]" |
|
83 |
using a |
|
84 |
by (nominal_induct t1 avoiding: a t2 rule: lam.induct) |
|
85 |
(auto simp add: abs_fresh fresh_atm) |
|
86 |
||
|
20955
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
87 |
lemma substitution_lemma: |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
88 |
assumes a: "x\<noteq>y" |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
89 |
and b: "x\<sharp>L" |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
90 |
shows "M[x::=N][y::=L] = M[y::=L][x::=N[y::=L]]" |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
91 |
using a b |
|
18659
2ff0ae57431d
changes to make use of the new induction principle proved by
urbanc
parents:
18378
diff
changeset
|
92 |
proof (nominal_induct M avoiding: x y N L rule: lam.induct) |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
93 |
case (Var z) (* case 1: Variables*) |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
94 |
have "x\<noteq>y" by fact |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
95 |
have "x\<sharp>L" by fact |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
96 |
show "Var z[x::=N][y::=L] = Var z[y::=L][x::=N[y::=L]]" (is "?LHS = ?RHS") |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
97 |
proof - |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
98 |
{ (*Case 1.1*)
|
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
99 |
assume "z=x" |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
100 |
have "(1)": "?LHS = N[y::=L]" using `z=x` by simp |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
101 |
have "(2)": "?RHS = N[y::=L]" using `z=x` `x\<noteq>y` by simp |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
102 |
from "(1)" "(2)" have "?LHS = ?RHS" by simp |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
103 |
} |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
104 |
moreover |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
105 |
{ (*Case 1.2*)
|
|
20955
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
106 |
assume "z=y" and "z\<noteq>x" |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
107 |
have "(1)": "?LHS = L" using `z\<noteq>x` `z=y` by force |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
108 |
have "(2)": "?RHS = L[x::=N[y::=L]]" using `z=y` by force |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
109 |
have "(3)": "L[x::=N[y::=L]] = L" using `x\<sharp>L` by (simp add: forget) |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
110 |
from "(1)" "(2)" "(3)" have "?LHS = ?RHS" by simp |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
111 |
} |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
112 |
moreover |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
113 |
{ (*Case 1.3*)
|
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
114 |
assume "z\<noteq>x" and "z\<noteq>y" |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
115 |
have "(1)": "?LHS = Var z" using `z\<noteq>x` `z\<noteq>y` by force |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
116 |
have "(2)": "?RHS = Var z" using `z\<noteq>x` `z\<noteq>y` by force |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
117 |
from "(1)" "(2)" have "?LHS = ?RHS" by simp |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
118 |
} |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
119 |
ultimately show "?LHS = ?RHS" by blast |
| 18106 | 120 |
qed |
121 |
next |
|
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
122 |
case (Lam z M1) (* case 2: lambdas *) |
|
20955
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
123 |
have ih: "\<lbrakk>x\<noteq>y; x\<sharp>L\<rbrakk> \<Longrightarrow> M1[x::=N][y::=L] = M1[y::=L][x::=N[y::=L]]" by fact |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
124 |
have "x\<noteq>y" by fact |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
125 |
have "x\<sharp>L" by fact |
| 19477 | 126 |
have fs: "z\<sharp>x" "z\<sharp>y" "z\<sharp>N" "z\<sharp>L" by fact |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
127 |
hence "z\<sharp>N[y::=L]" by (simp add: fresh_fact) |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
128 |
show "(Lam [z].M1)[x::=N][y::=L] = (Lam [z].M1)[y::=L][x::=N[y::=L]]" (is "?LHS=?RHS") |
|
20955
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
129 |
proof - |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
130 |
have "?LHS = Lam [z].(M1[x::=N][y::=L])" using `z\<sharp>x` `z\<sharp>y` `z\<sharp>N` `z\<sharp>L` by simp |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
131 |
also from ih have "\<dots> = Lam [z].(M1[y::=L][x::=N[y::=L]])" using `x\<noteq>y` `x\<sharp>L` by simp |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
132 |
also have "\<dots> = (Lam [z].(M1[y::=L]))[x::=N[y::=L]]" using `z\<sharp>x` `z\<sharp>N[y::=L]` by simp |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
133 |
also have "\<dots> = ?RHS" using `z\<sharp>y` `z\<sharp>L` by simp |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
134 |
finally show "?LHS = ?RHS" . |
| 18106 | 135 |
qed |
136 |
next |
|
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
137 |
case (App M1 M2) (* case 3: applications *) |
| 21101 | 138 |
thus "(App M1 M2)[x::=N][y::=L] = (App M1 M2)[y::=L][x::=N[y::=L]]" by simp |
| 18106 | 139 |
qed |
140 |
||
|
20955
65a9a30b8ece
made some proof look more like the ones in Barendregt
urbanc
parents:
20503
diff
changeset
|
141 |
lemma substitution_lemma_automatic: |
|
19172
ad36a9b42cf3
made some small changes to generate nicer latex-output
urbanc
parents:
18882
diff
changeset
|
142 |
assumes asm: "x\<noteq>y" "x\<sharp>L" |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
143 |
shows "M[x::=N][y::=L] = M[y::=L][x::=N[y::=L]]" |
| 21101 | 144 |
using asm |
145 |
by (nominal_induct M avoiding: x y N L rule: lam.induct) |
|
146 |
(auto simp add: fresh_fact forget) |
|
| 18106 | 147 |
|
148 |
section {* Beta Reduction *}
|
|
149 |
||
| 21101 | 150 |
inductive2 |
151 |
"Beta" :: "lam\<Rightarrow>lam\<Rightarrow>bool" (" _ \<longrightarrow>\<^isub>\<beta> _" [80,80] 80)
|
|
| 21366 | 152 |
where |
153 |
b1[intro]: "s1\<longrightarrow>\<^isub>\<beta>s2 \<Longrightarrow> (App s1 t)\<longrightarrow>\<^isub>\<beta>(App s2 t)" |
|
154 |
| b2[intro]: "s1\<longrightarrow>\<^isub>\<beta>s2 \<Longrightarrow> (App t s1)\<longrightarrow>\<^isub>\<beta>(App t s2)" |
|
155 |
| b3[intro]: "s1\<longrightarrow>\<^isub>\<beta>s2 \<Longrightarrow> (Lam [a].s1)\<longrightarrow>\<^isub>\<beta> (Lam [a].s2)" |
|
| 22540 | 156 |
| b4[intro]: "a\<sharp>s2 \<Longrightarrow> (App (Lam [a].s1) s2)\<longrightarrow>\<^isub>\<beta>(s1[a::=s2])" |
157 |
||
158 |
nominal_inductive Beta |
|
159 |
by (simp_all add: abs_fresh fresh_fact') |
|
| 18106 | 160 |
|
| 21101 | 161 |
inductive2 |
162 |
"Beta_star" :: "lam\<Rightarrow>lam\<Rightarrow>bool" (" _ \<longrightarrow>\<^isub>\<beta>\<^sup>* _" [80,80] 80)
|
|
| 21366 | 163 |
where |
164 |
bs1[intro, simp]: "M \<longrightarrow>\<^isub>\<beta>\<^sup>* M" |
|
165 |
| bs2[intro]: "\<lbrakk>M1\<longrightarrow>\<^isub>\<beta>\<^sup>* M2; M2 \<longrightarrow>\<^isub>\<beta> M3\<rbrakk> \<Longrightarrow> M1 \<longrightarrow>\<^isub>\<beta>\<^sup>* M3" |
|
| 21101 | 166 |
|
| 22540 | 167 |
equivariance Beta_star |
168 |
||
| 21101 | 169 |
lemma beta_star_trans: |
170 |
assumes a1: "M1\<longrightarrow>\<^isub>\<beta>\<^sup>* M2" |
|
171 |
and a2: "M2\<longrightarrow>\<^isub>\<beta>\<^sup>* M3" |
|
172 |
shows "M1 \<longrightarrow>\<^isub>\<beta>\<^sup>* M3" |
|
173 |
using a2 a1 |
|
174 |
by (induct) (auto) |
|
175 |
||
| 18106 | 176 |
section {* One-Reduction *}
|
177 |
||
| 21101 | 178 |
inductive2 |
179 |
One :: "lam\<Rightarrow>lam\<Rightarrow>bool" (" _ \<longrightarrow>\<^isub>1 _" [80,80] 80)
|
|
| 21366 | 180 |
where |
181 |
o1[intro!]: "M\<longrightarrow>\<^isub>1M" |
|
182 |
| o2[simp,intro!]: "\<lbrakk>t1\<longrightarrow>\<^isub>1t2;s1\<longrightarrow>\<^isub>1s2\<rbrakk> \<Longrightarrow> (App t1 s1)\<longrightarrow>\<^isub>1(App t2 s2)" |
|
183 |
| o3[simp,intro!]: "s1\<longrightarrow>\<^isub>1s2 \<Longrightarrow> (Lam [a].s1)\<longrightarrow>\<^isub>1(Lam [a].s2)" |
|
| 22540 | 184 |
| o4[simp,intro!]: "\<lbrakk>a\<sharp>(s1,s2); s1\<longrightarrow>\<^isub>1s2;t1\<longrightarrow>\<^isub>1t2\<rbrakk> \<Longrightarrow> (App (Lam [a].t1) s1)\<longrightarrow>\<^isub>1(t2[a::=s2])" |
185 |
||
186 |
nominal_inductive One |
|
187 |
by (simp_all add: abs_fresh fresh_fact') |
|
| 18106 | 188 |
|
| 21101 | 189 |
inductive2 |
190 |
"One_star" :: "lam\<Rightarrow>lam\<Rightarrow>bool" (" _ \<longrightarrow>\<^isub>1\<^sup>* _" [80,80] 80)
|
|
| 21366 | 191 |
where |
192 |
os1[intro, simp]: "M \<longrightarrow>\<^isub>1\<^sup>* M" |
|
193 |
| os2[intro]: "\<lbrakk>M1\<longrightarrow>\<^isub>1\<^sup>* M2; M2 \<longrightarrow>\<^isub>1 M3\<rbrakk> \<Longrightarrow> M1 \<longrightarrow>\<^isub>1\<^sup>* M3" |
|
| 21101 | 194 |
|
| 22540 | 195 |
equivariance One_star |
| 18106 | 196 |
|
| 21101 | 197 |
lemma one_star_trans: |
198 |
assumes a1: "M1\<longrightarrow>\<^isub>1\<^sup>* M2" |
|
199 |
and a2: "M2\<longrightarrow>\<^isub>1\<^sup>* M3" |
|
200 |
shows "M1\<longrightarrow>\<^isub>1\<^sup>* M3" |
|
201 |
using a2 a1 |
|
202 |
by (induct) (auto) |
|
203 |
||
|
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
204 |
lemma one_fresh_preserv: |
| 18378 | 205 |
fixes a :: "name" |
| 18106 | 206 |
assumes a: "t\<longrightarrow>\<^isub>1s" |
|
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
207 |
and b: "a\<sharp>t" |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
208 |
shows "a\<sharp>s" |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
209 |
using a b |
| 18106 | 210 |
proof (induct) |
|
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
211 |
case o1 thus ?case by simp |
| 18106 | 212 |
next |
|
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
213 |
case o2 thus ?case by simp |
| 18106 | 214 |
next |
| 21101 | 215 |
case (o3 s1 s2 c) |
|
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
216 |
have ih: "a\<sharp>s1 \<Longrightarrow> a\<sharp>s2" by fact |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
217 |
have c: "a\<sharp>Lam [c].s1" by fact |
| 18106 | 218 |
show ?case |
|
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
219 |
proof (cases "a=c") |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
220 |
assume "a=c" thus "a\<sharp>Lam [c].s2" by (simp add: abs_fresh) |
| 18106 | 221 |
next |
|
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
222 |
assume d: "a\<noteq>c" |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
223 |
with c have "a\<sharp>s1" by (simp add: abs_fresh) |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
224 |
hence "a\<sharp>s2" using ih by simp |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
225 |
thus "a\<sharp>Lam [c].s2" using d by (simp add: abs_fresh) |
| 18106 | 226 |
qed |
227 |
next |
|
| 22540 | 228 |
case (o4 c t1 t2 s1 s2) |
|
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
229 |
have i1: "a\<sharp>t1 \<Longrightarrow> a\<sharp>t2" by fact |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
230 |
have i2: "a\<sharp>s1 \<Longrightarrow> a\<sharp>s2" by fact |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
231 |
have as: "a\<sharp>App (Lam [c].s1) t1" by fact |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
232 |
hence c1: "a\<sharp>Lam [c].s1" and c2: "a\<sharp>t1" by (simp add: fresh_prod)+ |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
233 |
from c2 i1 have c3: "a\<sharp>t2" by simp |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
234 |
show "a\<sharp>s2[c::=t2]" |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
235 |
proof (cases "a=c") |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
236 |
assume "a=c" |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
237 |
thus "a\<sharp>s2[c::=t2]" using c3 by (simp add: fresh_fact') |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
238 |
next |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
239 |
assume d1: "a\<noteq>c" |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
240 |
from c1 d1 have "a\<sharp>s1" by (simp add: abs_fresh) |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
241 |
hence "a\<sharp>s2" using i2 by simp |
|
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
242 |
thus "a\<sharp>s2[c::=t2]" using c3 by (simp add: fresh_fact) |
| 18106 | 243 |
qed |
244 |
qed |
|
245 |
||
| 22540 | 246 |
lemma subst_rename: |
247 |
assumes a: "c\<sharp>t1" |
|
248 |
shows "t1[a::=t2] = ([(c,a)]\<bullet>t1)[c::=t2]" |
|
249 |
using a |
|
250 |
by (nominal_induct t1 avoiding: a c t2 rule: lam.induct) |
|
251 |
(auto simp add: calc_atm fresh_atm abs_fresh) |
|
252 |
||
| 18106 | 253 |
lemma one_abs: |
254 |
fixes t :: "lam" |
|
255 |
and t':: "lam" |
|
256 |
and a :: "name" |
|
| 21101 | 257 |
assumes a: "(Lam [a].t)\<longrightarrow>\<^isub>1t'" |
258 |
shows "\<exists>t''. t'=Lam [a].t'' \<and> t\<longrightarrow>\<^isub>1t''" |
|
259 |
using a |
|
260 |
apply - |
|
261 |
apply(ind_cases2 "(Lam [a].t)\<longrightarrow>\<^isub>1t'") |
|
| 18106 | 262 |
apply(auto simp add: lam.distinct lam.inject alpha) |
263 |
apply(rule_tac x="[(a,aa)]\<bullet>s2" in exI) |
|
264 |
apply(rule conjI) |
|
265 |
apply(rule pt_bij2[OF pt_name_inst, OF at_name_inst, symmetric]) |
|
266 |
apply(simp) |
|
267 |
apply(rule pt_name3) |
|
268 |
apply(rule at_ds5[OF at_name_inst]) |
|
269 |
apply(frule_tac a="a" in one_fresh_preserv) |
|
270 |
apply(assumption) |
|
271 |
apply(rule conjI) |
|
272 |
apply(simp add: pt_fresh_left[OF pt_name_inst, OF at_name_inst]) |
|
273 |
apply(simp add: calc_atm) |
|
| 22540 | 274 |
apply(force intro!: One_eqvt) |
| 18106 | 275 |
done |
276 |
||
277 |
lemma one_app: |
|
| 21101 | 278 |
assumes a: "App t1 t2 \<longrightarrow>\<^isub>1 t'" |
279 |
shows "(\<exists>s1 s2. t' = App s1 s2 \<and> t1 \<longrightarrow>\<^isub>1 s1 \<and> t2 \<longrightarrow>\<^isub>1 s2) \<or> |
|
| 22540 | 280 |
(\<exists>a s s1 s2. t1 = Lam [a].s \<and> a\<sharp>(t2,s2) \<and> t' = s1[a::=s2] \<and> s \<longrightarrow>\<^isub>1 s1 \<and> t2 \<longrightarrow>\<^isub>1 s2)" |
| 21101 | 281 |
using a |
282 |
apply - |
|
| 21366 | 283 |
apply(ind_cases2 "App t1 t2 \<longrightarrow>\<^isub>1 t'") |
| 18106 | 284 |
apply(auto simp add: lam.distinct lam.inject) |
285 |
done |
|
286 |
||
287 |
lemma one_red: |
|
| 21101 | 288 |
assumes a: "App (Lam [a].t1) t2 \<longrightarrow>\<^isub>1 M" |
289 |
shows "(\<exists>s1 s2. M = App (Lam [a].s1) s2 \<and> t1 \<longrightarrow>\<^isub>1 s1 \<and> t2 \<longrightarrow>\<^isub>1 s2) \<or> |
|
290 |
(\<exists>s1 s2. M = s1[a::=s2] \<and> t1 \<longrightarrow>\<^isub>1 s1 \<and> t2 \<longrightarrow>\<^isub>1 s2)" |
|
291 |
using a |
|
292 |
apply - |
|
| 21366 | 293 |
apply(ind_cases2 "App (Lam [a].t1) t2 \<longrightarrow>\<^isub>1 M") |
| 18106 | 294 |
apply(simp_all add: lam.inject) |
295 |
apply(force) |
|
296 |
apply(erule conjE) |
|
297 |
apply(drule sym[of "Lam [a].t1"]) |
|
298 |
apply(simp) |
|
299 |
apply(drule one_abs) |
|
300 |
apply(erule exE) |
|
301 |
apply(simp) |
|
302 |
apply(force simp add: alpha) |
|
303 |
apply(erule conjE) |
|
304 |
apply(simp add: lam.inject alpha) |
|
305 |
apply(erule disjE) |
|
306 |
apply(simp) |
|
307 |
apply(force) |
|
308 |
apply(simp) |
|
309 |
apply(rule disjI2) |
|
310 |
apply(rule_tac x="[(a,aa)]\<bullet>t2a" in exI) |
|
311 |
apply(rule_tac x="s2" in exI) |
|
312 |
apply(auto) |
|
313 |
apply(subgoal_tac "a\<sharp>t2a")(*A*) |
|
314 |
apply(simp add: subst_rename) |
|
315 |
(*A*) |
|
316 |
apply(force intro: one_fresh_preserv) |
|
| 22540 | 317 |
apply(force intro: One_eqvt) |
| 18106 | 318 |
done |
319 |
||
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
320 |
text {* first case in Lemma 3.2.4*}
|
| 18106 | 321 |
|
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
322 |
lemma one_subst_aux: |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
323 |
assumes a: "N\<longrightarrow>\<^isub>1N'" |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
324 |
shows "M[x::=N] \<longrightarrow>\<^isub>1 M[x::=N']" |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
325 |
using a |
|
18659
2ff0ae57431d
changes to make use of the new induction principle proved by
urbanc
parents:
18378
diff
changeset
|
326 |
proof (nominal_induct M avoiding: x N N' rule: lam.induct) |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
327 |
case (Var y) |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
328 |
show "Var y[x::=N] \<longrightarrow>\<^isub>1 Var y[x::=N']" by (cases "x=y", auto) |
| 18106 | 329 |
next |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
330 |
case (App P Q) (* application case - third line *) |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
331 |
thus "(App P Q)[x::=N] \<longrightarrow>\<^isub>1 (App P Q)[x::=N']" using o2 by simp |
| 18106 | 332 |
next |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
333 |
case (Lam y P) (* abstraction case - fourth line *) |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
334 |
thus "(Lam [y].P)[x::=N] \<longrightarrow>\<^isub>1 (Lam [y].P)[x::=N']" using o3 by simp |
| 18106 | 335 |
qed |
336 |
||
| 18378 | 337 |
lemma one_subst_aux_automatic: |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
338 |
assumes a: "N\<longrightarrow>\<^isub>1N'" |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
339 |
shows "M[x::=N] \<longrightarrow>\<^isub>1 M[x::=N']" |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
340 |
using a |
|
18659
2ff0ae57431d
changes to make use of the new induction principle proved by
urbanc
parents:
18378
diff
changeset
|
341 |
apply(nominal_induct M avoiding: x N N' rule: lam.induct) |
| 18106 | 342 |
apply(auto simp add: fresh_prod fresh_atm) |
343 |
done |
|
344 |
||
|
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
345 |
lemma one_subst: |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
346 |
assumes a: "M\<longrightarrow>\<^isub>1M'" |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
347 |
and b: "N\<longrightarrow>\<^isub>1N'" |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
348 |
shows "M[x::=N]\<longrightarrow>\<^isub>1M'[x::=N']" |
|
18773
0eabf66582d0
the additional freshness-condition in the one-induction
urbanc
parents:
18659
diff
changeset
|
349 |
using a b |
| 22540 | 350 |
proof (nominal_induct M M' avoiding: N N' x rule: One.strong_induct) |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
351 |
case (o1 M) |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
352 |
thus ?case by (simp add: one_subst_aux) |
| 18106 | 353 |
next |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
354 |
case (o2 M1 M2 N1 N2) |
| 18106 | 355 |
thus ?case by simp |
356 |
next |
|
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
357 |
case (o3 a M1 M2) |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
358 |
thus ?case by simp |
| 18106 | 359 |
next |
| 22540 | 360 |
case (o4 a N1 N2 M1 M2 N N' x) |
361 |
have vc: "a\<sharp>N" "a\<sharp>N'" "a\<sharp>x" "a\<sharp>N1" "a\<sharp>N2" by fact |
|
362 |
have asm: "N\<longrightarrow>\<^isub>1N'" by fact |
|
| 18106 | 363 |
show ?case |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
364 |
proof - |
| 22540 | 365 |
have "(App (Lam [a].M1) N1)[x::=N] = App (Lam [a].(M1[x::=N])) (N1[x::=N])" using vc by simp |
|
21143
56695d1f45cf
changed a misplaced "also" to a "moreover" (caused a loop somehow)
urbanc
parents:
21138
diff
changeset
|
366 |
moreover have "App (Lam [a].(M1[x::=N])) (N1[x::=N]) \<longrightarrow>\<^isub>1 M2[x::=N'][a::=N2[x::=N']]" |
| 22540 | 367 |
using o4 asm by (simp add: fresh_fact) |
|
21143
56695d1f45cf
changed a misplaced "also" to a "moreover" (caused a loop somehow)
urbanc
parents:
21138
diff
changeset
|
368 |
moreover have "M2[x::=N'][a::=N2[x::=N']] = M2[a::=N2][x::=N']" |
| 22540 | 369 |
using vc by (simp add: substitution_lemma fresh_atm) |
| 18106 | 370 |
ultimately show "(App (Lam [a].M1) N1)[x::=N] \<longrightarrow>\<^isub>1 M2[a::=N2][x::=N']" by simp |
371 |
qed |
|
372 |
qed |
|
373 |
||
| 18378 | 374 |
lemma one_subst_automatic: |
| 18106 | 375 |
assumes a: "M\<longrightarrow>\<^isub>1M'" |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
376 |
and b: "N\<longrightarrow>\<^isub>1N'" |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
377 |
shows "M[x::=N]\<longrightarrow>\<^isub>1M'[x::=N']" |
|
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
378 |
using a b |
| 22540 | 379 |
apply(nominal_induct M M' avoiding: N N' x rule: One.strong_induct) |
380 |
apply(auto simp add: one_subst_aux substitution_lemma fresh_atm fresh_fact) |
|
| 18106 | 381 |
done |
382 |
||
383 |
lemma diamond[rule_format]: |
|
384 |
fixes M :: "lam" |
|
385 |
and M1:: "lam" |
|
386 |
assumes a: "M\<longrightarrow>\<^isub>1M1" |
|
| 18344 | 387 |
and b: "M\<longrightarrow>\<^isub>1M2" |
388 |
shows "\<exists>M3. M1\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3" |
|
389 |
using a b |
|
| 22540 | 390 |
proof (nominal_induct avoiding: M1 M2 rule: One.strong_induct) |
| 18106 | 391 |
case (o1 M) (* case 1 --- M1 = M *) |
| 18344 | 392 |
thus "\<exists>M3. M\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3" by blast |
| 18106 | 393 |
next |
| 22540 | 394 |
case (o4 x Q Q' P P') (* case 2 --- a beta-reduction occurs*) |
395 |
have vc: "x\<sharp>Q" "x\<sharp>Q'" by fact |
|
| 18344 | 396 |
have i1: "\<And>M2. Q \<longrightarrow>\<^isub>1M2 \<Longrightarrow> (\<exists>M3. Q'\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3)" by fact |
397 |
have i2: "\<And>M2. P \<longrightarrow>\<^isub>1M2 \<Longrightarrow> (\<exists>M3. P'\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3)" by fact |
|
398 |
have "App (Lam [x].P) Q \<longrightarrow>\<^isub>1 M2" by fact |
|
399 |
hence "(\<exists>P' Q'. M2 = App (Lam [x].P') Q' \<and> P\<longrightarrow>\<^isub>1P' \<and> Q\<longrightarrow>\<^isub>1Q') \<or> |
|
400 |
(\<exists>P' Q'. M2 = P'[x::=Q'] \<and> P\<longrightarrow>\<^isub>1P' \<and> Q\<longrightarrow>\<^isub>1Q')" by (simp add: one_red) |
|
401 |
moreover (* subcase 2.1 *) |
|
402 |
{ assume "\<exists>P' Q'. M2 = App (Lam [x].P') Q' \<and> P\<longrightarrow>\<^isub>1P' \<and> Q\<longrightarrow>\<^isub>1Q'"
|
|
403 |
then obtain P'' and Q'' where |
|
404 |
b1: "M2=App (Lam [x].P'') Q''" and b2: "P\<longrightarrow>\<^isub>1P''" and b3: "Q\<longrightarrow>\<^isub>1Q''" by blast |
|
405 |
from b2 i2 have "(\<exists>M3. P'\<longrightarrow>\<^isub>1M3 \<and> P''\<longrightarrow>\<^isub>1M3)" by simp |
|
406 |
then obtain P''' where |
|
407 |
c1: "P'\<longrightarrow>\<^isub>1P'''" and c2: "P''\<longrightarrow>\<^isub>1P'''" by force |
|
408 |
from b3 i1 have "(\<exists>M3. Q'\<longrightarrow>\<^isub>1M3 \<and> Q''\<longrightarrow>\<^isub>1M3)" by simp |
|
409 |
then obtain Q''' where |
|
410 |
d1: "Q'\<longrightarrow>\<^isub>1Q'''" and d2: "Q''\<longrightarrow>\<^isub>1Q'''" by force |
|
411 |
from c1 c2 d1 d2 |
|
412 |
have "P'[x::=Q']\<longrightarrow>\<^isub>1P'''[x::=Q'''] \<and> App (Lam [x].P'') Q'' \<longrightarrow>\<^isub>1 P'''[x::=Q''']" |
|
| 22540 | 413 |
using vc b3 by (auto simp add: one_subst one_fresh_preserv) |
| 18344 | 414 |
hence "\<exists>M3. P'[x::=Q']\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3" using b1 by blast |
415 |
} |
|
416 |
moreover (* subcase 2.2 *) |
|
417 |
{ assume "\<exists>P' Q'. M2 = P'[x::=Q'] \<and> P\<longrightarrow>\<^isub>1P' \<and> Q\<longrightarrow>\<^isub>1Q'"
|
|
418 |
then obtain P'' Q'' where |
|
419 |
b1: "M2=P''[x::=Q'']" and b2: "P\<longrightarrow>\<^isub>1P''" and b3: "Q\<longrightarrow>\<^isub>1Q''" by blast |
|
420 |
from b2 i2 have "(\<exists>M3. P'\<longrightarrow>\<^isub>1M3 \<and> P''\<longrightarrow>\<^isub>1M3)" by simp |
|
421 |
then obtain P''' where |
|
422 |
c1: "P'\<longrightarrow>\<^isub>1P'''" and c2: "P''\<longrightarrow>\<^isub>1P'''" by blast |
|
423 |
from b3 i1 have "(\<exists>M3. Q'\<longrightarrow>\<^isub>1M3 \<and> Q''\<longrightarrow>\<^isub>1M3)" by simp |
|
424 |
then obtain Q''' where |
|
425 |
d1: "Q'\<longrightarrow>\<^isub>1Q'''" and d2: "Q''\<longrightarrow>\<^isub>1Q'''" by blast |
|
426 |
from c1 c2 d1 d2 |
|
427 |
have "P'[x::=Q']\<longrightarrow>\<^isub>1P'''[x::=Q'''] \<and> P''[x::=Q'']\<longrightarrow>\<^isub>1P'''[x::=Q''']" |
|
428 |
by (force simp add: one_subst) |
|
429 |
hence "\<exists>M3. P'[x::=Q']\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3" using b1 by blast |
|
430 |
} |
|
431 |
ultimately show "\<exists>M3. P'[x::=Q']\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3" by blast |
|
| 18106 | 432 |
next |
| 21101 | 433 |
case (o2 P P' Q Q') (* case 3 *) |
| 18344 | 434 |
have i0: "P\<longrightarrow>\<^isub>1P'" by fact |
| 22540 | 435 |
have i0': "Q\<longrightarrow>\<^isub>1Q'" by fact |
| 18344 | 436 |
have i1: "\<And>M2. Q \<longrightarrow>\<^isub>1M2 \<Longrightarrow> (\<exists>M3. Q'\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3)" by fact |
437 |
have i2: "\<And>M2. P \<longrightarrow>\<^isub>1M2 \<Longrightarrow> (\<exists>M3. P'\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3)" by fact |
|
438 |
assume "App P Q \<longrightarrow>\<^isub>1 M2" |
|
439 |
hence "(\<exists>P'' Q''. M2 = App P'' Q'' \<and> P\<longrightarrow>\<^isub>1P'' \<and> Q\<longrightarrow>\<^isub>1Q'') \<or> |
|
| 22540 | 440 |
(\<exists>x P' P'' Q'. P = Lam [x].P' \<and> x\<sharp>(Q,Q') \<and> M2 = P''[x::=Q'] \<and> P'\<longrightarrow>\<^isub>1 P'' \<and> Q\<longrightarrow>\<^isub>1Q')" |
| 18344 | 441 |
by (simp add: one_app[simplified]) |
442 |
moreover (* subcase 3.1 *) |
|
443 |
{ assume "\<exists>P'' Q''. M2 = App P'' Q'' \<and> P\<longrightarrow>\<^isub>1P'' \<and> Q\<longrightarrow>\<^isub>1Q''"
|
|
444 |
then obtain P'' and Q'' where |
|
445 |
b1: "M2=App P'' Q''" and b2: "P\<longrightarrow>\<^isub>1P''" and b3: "Q\<longrightarrow>\<^isub>1Q''" by blast |
|
446 |
from b2 i2 have "(\<exists>M3. P'\<longrightarrow>\<^isub>1M3 \<and> P''\<longrightarrow>\<^isub>1M3)" by simp |
|
447 |
then obtain P''' where |
|
448 |
c1: "P'\<longrightarrow>\<^isub>1P'''" and c2: "P''\<longrightarrow>\<^isub>1P'''" by blast |
|
449 |
from b3 i1 have "\<exists>M3. Q'\<longrightarrow>\<^isub>1M3 \<and> Q''\<longrightarrow>\<^isub>1M3" by simp |
|
450 |
then obtain Q''' where |
|
451 |
d1: "Q'\<longrightarrow>\<^isub>1Q'''" and d2: "Q''\<longrightarrow>\<^isub>1Q'''" by blast |
|
452 |
from c1 c2 d1 d2 |
|
453 |
have "App P' Q'\<longrightarrow>\<^isub>1App P''' Q''' \<and> App P'' Q'' \<longrightarrow>\<^isub>1 App P''' Q'''" by blast |
|
454 |
hence "\<exists>M3. App P' Q'\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3" using b1 by blast |
|
455 |
} |
|
456 |
moreover (* subcase 3.2 *) |
|
| 22540 | 457 |
{ assume "\<exists>x P1 P'' Q''. P = Lam [x].P1 \<and> x\<sharp>(Q,Q'') \<and> M2 = P''[x::=Q''] \<and> P1\<longrightarrow>\<^isub>1 P'' \<and> Q\<longrightarrow>\<^isub>1Q''"
|
| 18344 | 458 |
then obtain x P1 P1'' Q'' where |
| 22540 | 459 |
b0: "P = Lam [x].P1" and b1: "M2 = P1''[x::=Q'']" and |
460 |
b2: "P1\<longrightarrow>\<^isub>1P1''" and b3: "Q\<longrightarrow>\<^isub>1Q''" and vc: "x\<sharp>(Q,Q'')" by blast |
|
| 18344 | 461 |
from b0 i0 have "\<exists>P1'. P'=Lam [x].P1' \<and> P1\<longrightarrow>\<^isub>1P1'" by (simp add: one_abs) |
462 |
then obtain P1' where g1: "P'=Lam [x].P1'" and g2: "P1\<longrightarrow>\<^isub>1P1'" by blast |
|
463 |
from g1 b0 b2 i2 have "(\<exists>M3. (Lam [x].P1')\<longrightarrow>\<^isub>1M3 \<and> (Lam [x].P1'')\<longrightarrow>\<^isub>1M3)" by simp |
|
464 |
then obtain P1''' where |
|
465 |
c1: "(Lam [x].P1')\<longrightarrow>\<^isub>1P1'''" and c2: "(Lam [x].P1'')\<longrightarrow>\<^isub>1P1'''" by blast |
|
466 |
from c1 have "\<exists>R1. P1'''=Lam [x].R1 \<and> P1'\<longrightarrow>\<^isub>1R1" by (simp add: one_abs) |
|
467 |
then obtain R1 where r1: "P1'''=Lam [x].R1" and r2: "P1'\<longrightarrow>\<^isub>1R1" by blast |
|
468 |
from c2 have "\<exists>R2. P1'''=Lam [x].R2 \<and> P1''\<longrightarrow>\<^isub>1R2" by (simp add: one_abs) |
|
469 |
then obtain R2 where r3: "P1'''=Lam [x].R2" and r4: "P1''\<longrightarrow>\<^isub>1R2" by blast |
|
470 |
from r1 r3 have r5: "R1=R2" by (simp add: lam.inject alpha) |
|
471 |
from b3 i1 have "(\<exists>M3. Q'\<longrightarrow>\<^isub>1M3 \<and> Q''\<longrightarrow>\<^isub>1M3)" by simp |
|
472 |
then obtain Q''' where |
|
473 |
d1: "Q'\<longrightarrow>\<^isub>1Q'''" and d2: "Q''\<longrightarrow>\<^isub>1Q'''" by blast |
|
474 |
from g1 r2 d1 r4 r5 d2 |
|
| 22540 | 475 |
have "App P' Q'\<longrightarrow>\<^isub>1R1[x::=Q'''] \<and> P1''[x::=Q'']\<longrightarrow>\<^isub>1R1[x::=Q''']" |
476 |
using vc i0' by (simp add: one_subst one_fresh_preserv) |
|
| 18344 | 477 |
hence "\<exists>M3. App P' Q'\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3" using b1 by blast |
478 |
} |
|
479 |
ultimately show "\<exists>M3. App P' Q'\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3" by blast |
|
| 18106 | 480 |
next |
| 21101 | 481 |
case (o3 P P' x) (* case 4 *) |
| 18344 | 482 |
have i1: "P\<longrightarrow>\<^isub>1P'" by fact |
483 |
have i2: "\<And>M2. P \<longrightarrow>\<^isub>1M2 \<Longrightarrow> (\<exists>M3. P'\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3)" by fact |
|
484 |
have "(Lam [x].P)\<longrightarrow>\<^isub>1 M2" by fact |
|
485 |
hence "\<exists>P''. M2=Lam [x].P'' \<and> P\<longrightarrow>\<^isub>1P''" by (simp add: one_abs) |
|
486 |
then obtain P'' where b1: "M2=Lam [x].P''" and b2: "P\<longrightarrow>\<^isub>1P''" by blast |
|
487 |
from i2 b1 b2 have "\<exists>M3. (Lam [x].P')\<longrightarrow>\<^isub>1M3 \<and> (Lam [x].P'')\<longrightarrow>\<^isub>1M3" by blast |
|
488 |
then obtain M3 where c1: "(Lam [x].P')\<longrightarrow>\<^isub>1M3" and c2: "(Lam [x].P'')\<longrightarrow>\<^isub>1M3" by blast |
|
489 |
from c1 have "\<exists>R1. M3=Lam [x].R1 \<and> P'\<longrightarrow>\<^isub>1R1" by (simp add: one_abs) |
|
490 |
then obtain R1 where r1: "M3=Lam [x].R1" and r2: "P'\<longrightarrow>\<^isub>1R1" by blast |
|
491 |
from c2 have "\<exists>R2. M3=Lam [x].R2 \<and> P''\<longrightarrow>\<^isub>1R2" by (simp add: one_abs) |
|
492 |
then obtain R2 where r3: "M3=Lam [x].R2" and r4: "P''\<longrightarrow>\<^isub>1R2" by blast |
|
493 |
from r1 r3 have r5: "R1=R2" by (simp add: lam.inject alpha) |
|
494 |
from r2 r4 have "(Lam [x].P')\<longrightarrow>\<^isub>1(Lam [x].R1) \<and> (Lam [x].P'')\<longrightarrow>\<^isub>1(Lam [x].R2)" |
|
495 |
by (simp add: one_subst) |
|
496 |
thus "\<exists>M3. (Lam [x].P')\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3" using b1 r5 by blast |
|
| 18106 | 497 |
qed |
498 |
||
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
499 |
lemma one_lam_cong: |
| 18106 | 500 |
assumes a: "t1\<longrightarrow>\<^isub>\<beta>\<^sup>*t2" |
501 |
shows "(Lam [a].t1)\<longrightarrow>\<^isub>\<beta>\<^sup>*(Lam [a].t2)" |
|
502 |
using a |
|
503 |
proof induct |
|
| 21101 | 504 |
case bs1 thus ?case by simp |
| 18106 | 505 |
next |
| 21101 | 506 |
case (bs2 y z) |
507 |
thus ?case by (blast dest: b3) |
|
| 18106 | 508 |
qed |
509 |
||
| 18378 | 510 |
lemma one_app_congL: |
| 18106 | 511 |
assumes a: "t1\<longrightarrow>\<^isub>\<beta>\<^sup>*t2" |
512 |
shows "App t1 s\<longrightarrow>\<^isub>\<beta>\<^sup>* App t2 s" |
|
513 |
using a |
|
514 |
proof induct |
|
| 21101 | 515 |
case bs1 thus ?case by simp |
| 18106 | 516 |
next |
| 21101 | 517 |
case bs2 thus ?case by (blast dest: b1) |
| 18106 | 518 |
qed |
519 |
||
| 18378 | 520 |
lemma one_app_congR: |
| 18106 | 521 |
assumes a: "t1\<longrightarrow>\<^isub>\<beta>\<^sup>*t2" |
522 |
shows "App s t1 \<longrightarrow>\<^isub>\<beta>\<^sup>* App s t2" |
|
523 |
using a |
|
524 |
proof induct |
|
| 21101 | 525 |
case bs1 thus ?case by simp |
| 18106 | 526 |
next |
| 21101 | 527 |
case bs2 thus ?case by (blast dest: b2) |
| 18106 | 528 |
qed |
529 |
||
| 18378 | 530 |
lemma one_app_cong: |
| 18106 | 531 |
assumes a1: "t1\<longrightarrow>\<^isub>\<beta>\<^sup>*t2" |
| 21101 | 532 |
and a2: "s1\<longrightarrow>\<^isub>\<beta>\<^sup>*s2" |
| 18106 | 533 |
shows "App t1 s1\<longrightarrow>\<^isub>\<beta>\<^sup>* App t2 s2" |
534 |
proof - |
|
| 18378 | 535 |
have "App t1 s1 \<longrightarrow>\<^isub>\<beta>\<^sup>* App t2 s1" using a1 by (rule one_app_congL) |
536 |
moreover |
|
537 |
have "App t2 s1 \<longrightarrow>\<^isub>\<beta>\<^sup>* App t2 s2" using a2 by (rule one_app_congR) |
|
| 21101 | 538 |
ultimately show ?thesis by (rule beta_star_trans) |
| 18106 | 539 |
qed |
540 |
||
541 |
lemma one_beta_star: |
|
542 |
assumes a: "(t1\<longrightarrow>\<^isub>1t2)" |
|
543 |
shows "(t1\<longrightarrow>\<^isub>\<beta>\<^sup>*t2)" |
|
544 |
using a |
|
| 22540 | 545 |
proof(nominal_induct rule: One.strong_induct) |
| 18378 | 546 |
case o1 thus ?case by simp |
| 18106 | 547 |
next |
| 18378 | 548 |
case o2 thus ?case by (blast intro!: one_app_cong) |
| 18106 | 549 |
next |
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
550 |
case o3 thus ?case by (blast intro!: one_lam_cong) |
| 18106 | 551 |
next |
| 22540 | 552 |
case (o4 a s1 s2 t1 t2) |
553 |
have vc: "a\<sharp>s1" "a\<sharp>s2" by fact |
|
| 18378 | 554 |
have a1: "t1\<longrightarrow>\<^isub>\<beta>\<^sup>*t2" and a2: "s1\<longrightarrow>\<^isub>\<beta>\<^sup>*s2" by fact |
| 22540 | 555 |
have c1: "(App (Lam [a].t2) s2) \<longrightarrow>\<^isub>\<beta> (t2 [a::= s2])" using vc by (simp add: b4) |
| 18106 | 556 |
from a1 a2 have c2: "App (Lam [a].t1 ) s1 \<longrightarrow>\<^isub>\<beta>\<^sup>* App (Lam [a].t2 ) s2" |
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
557 |
by (blast intro!: one_app_cong one_lam_cong) |
| 21101 | 558 |
show ?case using c2 c1 by (blast intro: beta_star_trans) |
| 18106 | 559 |
qed |
560 |
||
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
561 |
lemma one_star_lam_cong: |
| 18106 | 562 |
assumes a: "t1\<longrightarrow>\<^isub>1\<^sup>*t2" |
563 |
shows "(Lam [a].t1)\<longrightarrow>\<^isub>1\<^sup>* (Lam [a].t2)" |
|
564 |
using a |
|
565 |
proof induct |
|
| 21101 | 566 |
case os1 thus ?case by simp |
| 18106 | 567 |
next |
| 21101 | 568 |
case os2 thus ?case by (blast intro: one_star_trans) |
| 18106 | 569 |
qed |
570 |
||
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
571 |
lemma one_star_app_congL: |
| 18106 | 572 |
assumes a: "t1\<longrightarrow>\<^isub>1\<^sup>*t2" |
573 |
shows "App t1 s\<longrightarrow>\<^isub>1\<^sup>* App t2 s" |
|
574 |
using a |
|
575 |
proof induct |
|
| 21101 | 576 |
case os1 thus ?case by simp |
| 18106 | 577 |
next |
| 21101 | 578 |
case os2 thus ?case by (blast intro: one_star_trans) |
| 18106 | 579 |
qed |
580 |
||
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
581 |
lemma one_star_app_congR: |
| 18106 | 582 |
assumes a: "t1\<longrightarrow>\<^isub>1\<^sup>*t2" |
583 |
shows "App s t1 \<longrightarrow>\<^isub>1\<^sup>* App s t2" |
|
584 |
using a |
|
585 |
proof induct |
|
| 21101 | 586 |
case os1 thus ?case by simp |
| 18106 | 587 |
next |
| 21101 | 588 |
case os2 thus ?case by (blast intro: one_star_trans) |
| 18106 | 589 |
qed |
590 |
||
591 |
lemma beta_one_star: |
|
592 |
assumes a: "t1\<longrightarrow>\<^isub>\<beta>t2" |
|
593 |
shows "t1\<longrightarrow>\<^isub>1\<^sup>*t2" |
|
594 |
using a |
|
| 22540 | 595 |
proof(induct) |
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
596 |
case b1 thus ?case by (blast intro!: one_star_app_congL) |
| 18106 | 597 |
next |
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
598 |
case b2 thus ?case by (blast intro!: one_star_app_congR) |
| 18106 | 599 |
next |
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
600 |
case b3 thus ?case by (blast intro!: one_star_lam_cong) |
| 18106 | 601 |
next |
| 22540 | 602 |
case b4 thus ?case by auto |
| 18106 | 603 |
qed |
604 |
||
605 |
lemma trans_closure: |
|
| 21101 | 606 |
shows "(M1\<longrightarrow>\<^isub>1\<^sup>*M2) = (M1\<longrightarrow>\<^isub>\<beta>\<^sup>*M2)" |
| 18106 | 607 |
proof |
| 21101 | 608 |
assume "M1 \<longrightarrow>\<^isub>1\<^sup>* M2" |
609 |
then show "M1\<longrightarrow>\<^isub>\<beta>\<^sup>*M2" |
|
| 18106 | 610 |
proof induct |
| 21101 | 611 |
case (os1 M1) thus "M1\<longrightarrow>\<^isub>\<beta>\<^sup>*M1" by simp |
| 18106 | 612 |
next |
| 21101 | 613 |
case (os2 M1 M2 M3) |
614 |
have "M2\<longrightarrow>\<^isub>1M3" by fact |
|
615 |
then have "M2\<longrightarrow>\<^isub>\<beta>\<^sup>*M3" by (rule one_beta_star) |
|
616 |
moreover have "M1\<longrightarrow>\<^isub>\<beta>\<^sup>*M2" by fact |
|
617 |
ultimately show "M1\<longrightarrow>\<^isub>\<beta>\<^sup>*M3" by (auto intro: beta_star_trans) |
|
| 18106 | 618 |
qed |
619 |
next |
|
| 21101 | 620 |
assume "M1 \<longrightarrow>\<^isub>\<beta>\<^sup>* M2" |
621 |
then show "M1\<longrightarrow>\<^isub>1\<^sup>*M2" |
|
| 18106 | 622 |
proof induct |
| 21101 | 623 |
case (bs1 M1) thus "M1\<longrightarrow>\<^isub>1\<^sup>*M1" by simp |
| 18106 | 624 |
next |
| 21101 | 625 |
case (bs2 M1 M2 M3) |
626 |
have "M2\<longrightarrow>\<^isub>\<beta>M3" by fact |
|
627 |
then have "M2\<longrightarrow>\<^isub>1\<^sup>*M3" by (rule beta_one_star) |
|
628 |
moreover have "M1\<longrightarrow>\<^isub>1\<^sup>*M2" by fact |
|
629 |
ultimately show "M1\<longrightarrow>\<^isub>1\<^sup>*M3" by (auto intro: one_star_trans) |
|
| 18106 | 630 |
qed |
631 |
qed |
|
632 |
||
633 |
lemma cr_one: |
|
634 |
assumes a: "t\<longrightarrow>\<^isub>1\<^sup>*t1" |
|
| 18344 | 635 |
and b: "t\<longrightarrow>\<^isub>1t2" |
| 18106 | 636 |
shows "\<exists>t3. t1\<longrightarrow>\<^isub>1t3 \<and> t2\<longrightarrow>\<^isub>1\<^sup>*t3" |
| 18344 | 637 |
using a b |
| 20503 | 638 |
proof (induct arbitrary: t2) |
| 21101 | 639 |
case os1 thus ?case by force |
| 18344 | 640 |
next |
| 21101 | 641 |
case (os2 t s1 s2 t2) |
| 18344 | 642 |
have b: "s1 \<longrightarrow>\<^isub>1 s2" by fact |
643 |
have h: "\<And>t2. t \<longrightarrow>\<^isub>1 t2 \<Longrightarrow> (\<exists>t3. s1 \<longrightarrow>\<^isub>1 t3 \<and> t2 \<longrightarrow>\<^isub>1\<^sup>* t3)" by fact |
|
644 |
have c: "t \<longrightarrow>\<^isub>1 t2" by fact |
|
| 18378 | 645 |
show "\<exists>t3. s2 \<longrightarrow>\<^isub>1 t3 \<and> t2 \<longrightarrow>\<^isub>1\<^sup>* t3" |
| 18344 | 646 |
proof - |
| 18378 | 647 |
from c h have "\<exists>t3. s1 \<longrightarrow>\<^isub>1 t3 \<and> t2 \<longrightarrow>\<^isub>1\<^sup>* t3" by blast |
648 |
then obtain t3 where c1: "s1 \<longrightarrow>\<^isub>1 t3" and c2: "t2 \<longrightarrow>\<^isub>1\<^sup>* t3" by blast |
|
649 |
have "\<exists>t4. s2 \<longrightarrow>\<^isub>1 t4 \<and> t3 \<longrightarrow>\<^isub>1 t4" using b c1 by (blast intro: diamond) |
|
| 21101 | 650 |
thus ?thesis using c2 by (blast intro: one_star_trans) |
| 18106 | 651 |
qed |
652 |
qed |
|
653 |
||
654 |
lemma cr_one_star: |
|
655 |
assumes a: "t\<longrightarrow>\<^isub>1\<^sup>*t2" |
|
656 |
and b: "t\<longrightarrow>\<^isub>1\<^sup>*t1" |
|
| 18378 | 657 |
shows "\<exists>t3. t1\<longrightarrow>\<^isub>1\<^sup>*t3\<and>t2\<longrightarrow>\<^isub>1\<^sup>*t3" |
| 21101 | 658 |
using a b |
659 |
proof (induct arbitrary: t1) |
|
660 |
case (os1 t) then show ?case by force |
|
| 18106 | 661 |
next |
| 21101 | 662 |
case (os2 t s1 s2 t1) |
663 |
have c: "t \<longrightarrow>\<^isub>1\<^sup>* s1" by fact |
|
664 |
have c': "t \<longrightarrow>\<^isub>1\<^sup>* t1" by fact |
|
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
665 |
have d: "s1 \<longrightarrow>\<^isub>1 s2" by fact |
| 21101 | 666 |
have "t \<longrightarrow>\<^isub>1\<^sup>* t1 \<Longrightarrow> (\<exists>t3. t1 \<longrightarrow>\<^isub>1\<^sup>* t3 \<and> s1 \<longrightarrow>\<^isub>1\<^sup>* t3)" by fact |
| 18106 | 667 |
then obtain t3 where f1: "t1 \<longrightarrow>\<^isub>1\<^sup>* t3" |
| 21101 | 668 |
and f2: "s1 \<longrightarrow>\<^isub>1\<^sup>* t3" using c' by blast |
| 18378 | 669 |
from cr_one d f2 have "\<exists>t4. t3\<longrightarrow>\<^isub>1t4 \<and> s2\<longrightarrow>\<^isub>1\<^sup>*t4" by blast |
| 18106 | 670 |
then obtain t4 where g1: "t3\<longrightarrow>\<^isub>1t4" |
| 18378 | 671 |
and g2: "s2\<longrightarrow>\<^isub>1\<^sup>*t4" by blast |
| 21101 | 672 |
have "t1\<longrightarrow>\<^isub>1\<^sup>*t4" using f1 g1 by (blast intro: one_star_trans) |
| 18378 | 673 |
thus ?case using g2 by blast |
| 18106 | 674 |
qed |
675 |
||
676 |
lemma cr_beta_star: |
|
677 |
assumes a1: "t\<longrightarrow>\<^isub>\<beta>\<^sup>*t1" |
|
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
678 |
and a2: "t\<longrightarrow>\<^isub>\<beta>\<^sup>*t2" |
| 18378 | 679 |
shows "\<exists>t3. t1\<longrightarrow>\<^isub>\<beta>\<^sup>*t3\<and>t2\<longrightarrow>\<^isub>\<beta>\<^sup>*t3" |
| 18106 | 680 |
proof - |
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
681 |
from a1 have "t\<longrightarrow>\<^isub>1\<^sup>*t1" by (simp only: trans_closure) |
| 18378 | 682 |
moreover |
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
683 |
from a2 have "t\<longrightarrow>\<^isub>1\<^sup>*t2" by (simp only: trans_closure) |
|
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
684 |
ultimately have "\<exists>t3. t1\<longrightarrow>\<^isub>1\<^sup>*t3 \<and> t2\<longrightarrow>\<^isub>1\<^sup>*t3" by (blast intro: cr_one_star) |
|
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
685 |
then obtain t3 where "t1\<longrightarrow>\<^isub>1\<^sup>*t3" and "t2\<longrightarrow>\<^isub>1\<^sup>*t3" by blast |
|
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
686 |
hence "t1\<longrightarrow>\<^isub>\<beta>\<^sup>*t3" and "t2\<longrightarrow>\<^isub>\<beta>\<^sup>*t3" by (simp_all only: trans_closure) |
|
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
687 |
then show "\<exists>t3. t1\<longrightarrow>\<^isub>\<beta>\<^sup>*t3\<and>t2\<longrightarrow>\<^isub>\<beta>\<^sup>*t3" by blast |
| 18106 | 688 |
qed |
689 |
||
690 |
end |
|
691 |