author | wenzelm |
Sat, 17 Jun 2006 19:37:53 +0200 | |
changeset 19912 | 4a3e35fd6e02 |
parent 19496 | 79dbe35c6cba |
child 20503 | 503ac4c5ef91 |
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 |
19496 | 4 |
imports Lam_substs |
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: |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
10 |
assumes a: "a\<sharp>t1" |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
11 |
shows "t1[a::=t2] = t1" |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
12 |
using a |
18659
2ff0ae57431d
changes to make use of the new induction principle proved by
urbanc
parents:
18378
diff
changeset
|
13 |
proof (nominal_induct t1 avoiding: a t2 rule: lam.induct) |
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
14 |
case (Var b) |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
15 |
thus ?case by (simp add: fresh_atm) |
18106 | 16 |
next |
17 |
case App |
|
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
18 |
thus ?case by simp |
18106 | 19 |
next |
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
20 |
case (Lam c t) |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
21 |
have ih: "\<And>c t2. c\<sharp>t \<Longrightarrow> t[c::=t2] = t" by fact |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
22 |
have a: "c\<sharp>t2" by fact |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
23 |
have "c\<sharp>a" by fact |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
24 |
hence b: "a\<noteq>c" by (simp add: fresh_atm) |
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
25 |
have "a\<sharp>Lam [c].t" by fact |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
26 |
hence "a\<sharp>t" using b by (simp add: abs_fresh) |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
27 |
hence "t[a::=t2] = t" using ih by simp |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
28 |
thus "(Lam [c].t)[a::=t2] = Lam [c].t" using a b by simp |
18106 | 29 |
qed |
30 |
||
18378 | 31 |
lemma forget_automatic: |
19172
ad36a9b42cf3
made some small changes to generate nicer latex-output
urbanc
parents:
18882
diff
changeset
|
32 |
assumes asm: "a\<sharp>t\<^isub>1" |
ad36a9b42cf3
made some small changes to generate nicer latex-output
urbanc
parents:
18882
diff
changeset
|
33 |
shows "t\<^isub>1[a::=t\<^isub>2] = t\<^isub>1" |
ad36a9b42cf3
made some small changes to generate nicer latex-output
urbanc
parents:
18882
diff
changeset
|
34 |
using asm by (nominal_induct t\<^isub>1 avoiding: a t\<^isub>2 rule: lam.induct) |
19477 | 35 |
(auto simp add: abs_fresh fresh_atm) |
18106 | 36 |
|
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
37 |
lemma fresh_fact: |
18378 | 38 |
fixes a :: "name" |
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
39 |
assumes a: "a\<sharp>t1" |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
40 |
and b: "a\<sharp>t2" |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
41 |
shows "a\<sharp>(t1[b::=t2])" |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
42 |
using a b |
18659
2ff0ae57431d
changes to make use of the new induction principle proved by
urbanc
parents:
18378
diff
changeset
|
43 |
proof (nominal_induct t1 avoiding: a b t2 rule: lam.induct) |
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
44 |
case (Var c) |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
45 |
thus ?case by simp |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
46 |
next |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
47 |
case App thus ?case by simp |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
48 |
next |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
49 |
case (Lam c t) |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
50 |
have ih: "\<And>(a::name) b t2. a\<sharp>t \<Longrightarrow> a\<sharp>t2 \<Longrightarrow> a\<sharp>(t[b::=t2])" by fact |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
51 |
have fr: "c\<sharp>a" "c\<sharp>b" "c\<sharp>t2" by fact+ |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
52 |
hence fr': "c\<noteq>a" by (simp add: fresh_atm) |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
53 |
have a1: "a\<sharp>t2" by fact |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
54 |
have a2: "a\<sharp>Lam [c].t" by fact |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
55 |
hence "a\<sharp>t" using fr' by (simp add: abs_fresh) |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
56 |
hence "a\<sharp>t[b::=t2]" using a1 ih by simp |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
57 |
thus "a\<sharp>(Lam [c].t)[b::=t2]" using fr by (simp add: abs_fresh) |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
58 |
qed |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
59 |
|
18378 | 60 |
lemma fresh_fact_automatic: |
18344 | 61 |
fixes a::"name" |
19172
ad36a9b42cf3
made some small changes to generate nicer latex-output
urbanc
parents:
18882
diff
changeset
|
62 |
assumes asm: "a\<sharp>t\<^isub>1" "a\<sharp>t\<^isub>2" |
ad36a9b42cf3
made some small changes to generate nicer latex-output
urbanc
parents:
18882
diff
changeset
|
63 |
shows "a\<sharp>(t\<^isub>1[b::=t\<^isub>2])" |
ad36a9b42cf3
made some small changes to generate nicer latex-output
urbanc
parents:
18882
diff
changeset
|
64 |
using asm by (nominal_induct t\<^isub>1 avoiding: a b t\<^isub>2 rule: lam.induct) |
ad36a9b42cf3
made some small changes to generate nicer latex-output
urbanc
parents:
18882
diff
changeset
|
65 |
(auto simp add: abs_fresh fresh_atm) |
18106 | 66 |
|
67 |
lemma subs_lemma: |
|
68 |
fixes x::"name" |
|
69 |
and y::"name" |
|
70 |
and L::"lam" |
|
71 |
and M::"lam" |
|
72 |
and N::"lam" |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
73 |
assumes a: "x\<noteq>y" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
74 |
and b: "x\<sharp>L" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
75 |
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
|
76 |
using a b |
18659
2ff0ae57431d
changes to make use of the new induction principle proved by
urbanc
parents:
18378
diff
changeset
|
77 |
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
|
78 |
case (Var z) (* case 1: Variables*) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
79 |
have "x\<noteq>y" by fact |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
80 |
have "x\<sharp>L" by fact |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
81 |
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
|
82 |
proof - |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
83 |
{ (*Case 1.1*) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
84 |
assume "z=x" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
85 |
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
|
86 |
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
|
87 |
from "(1)" "(2)" have "?LHS = ?RHS" by simp |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
88 |
} |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
89 |
moreover |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
90 |
{ (*Case 1.2*) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
91 |
assume "z\<noteq>x" and "z=y" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
92 |
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
|
93 |
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
|
94 |
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
|
95 |
from "(1)" "(2)" "(3)" have "?LHS = ?RHS" by simp |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
96 |
} |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
97 |
moreover |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
98 |
{ (*Case 1.3*) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
99 |
assume "z\<noteq>x" and "z\<noteq>y" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
100 |
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
|
101 |
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
|
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 |
ultimately show "?LHS = ?RHS" by blast |
18106 | 105 |
qed |
106 |
next |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
107 |
case (Lam z M1) (* case 2: lambdas *) |
19172
ad36a9b42cf3
made some small changes to generate nicer latex-output
urbanc
parents:
18882
diff
changeset
|
108 |
have ih: "\<And>x y N L. \<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
|
109 |
have "x\<noteq>y" by fact |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
110 |
have "x\<sharp>L" by fact |
19477 | 111 |
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
|
112 |
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
|
113 |
show "(Lam [z].M1)[x::=N][y::=L] = (Lam [z].M1)[y::=L][x::=N[y::=L]]" (is "?LHS=?RHS") |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
114 |
proof - |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
115 |
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
|
116 |
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
|
117 |
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
|
118 |
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
|
119 |
finally show "?LHS = ?RHS" . |
18106 | 120 |
qed |
121 |
next |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
122 |
case (App M1 M2) (* case 3: applications *) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
123 |
thus ?case by simp |
18106 | 124 |
qed |
125 |
||
18378 | 126 |
lemma subs_lemma_automatic: |
19172
ad36a9b42cf3
made some small changes to generate nicer latex-output
urbanc
parents:
18882
diff
changeset
|
127 |
assumes asm: "x\<noteq>y" "x\<sharp>L" |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
128 |
shows "M[x::=N][y::=L] = M[y::=L][x::=N[y::=L]]" |
19172
ad36a9b42cf3
made some small changes to generate nicer latex-output
urbanc
parents:
18882
diff
changeset
|
129 |
using asm by (nominal_induct M avoiding: x y N L rule: lam.induct) |
ad36a9b42cf3
made some small changes to generate nicer latex-output
urbanc
parents:
18882
diff
changeset
|
130 |
(auto simp add: fresh_fact forget) |
18106 | 131 |
|
18344 | 132 |
lemma subst_rename: |
133 |
assumes a: "c\<sharp>t1" |
|
134 |
shows "t1[a::=t2] = ([(c,a)]\<bullet>t1)[c::=t2]" |
|
135 |
using a |
|
18659
2ff0ae57431d
changes to make use of the new induction principle proved by
urbanc
parents:
18378
diff
changeset
|
136 |
proof (nominal_induct t1 avoiding: a c t2 rule: lam.induct) |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
137 |
case (Var b) |
18344 | 138 |
thus "(Var b)[a::=t2] = ([(c,a)]\<bullet>(Var b))[c::=t2]" by (simp add: calc_atm fresh_atm) |
18106 | 139 |
next |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
140 |
case App thus ?case by force |
18106 | 141 |
next |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
142 |
case (Lam b s) |
18344 | 143 |
have i: "\<And>a c t2. c\<sharp>s \<Longrightarrow> (s[a::=t2] = ([(c,a)]\<bullet>s)[c::=t2])" by fact |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
144 |
have f: "b\<sharp>a" "b\<sharp>c" "b\<sharp>t2" by fact |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
145 |
from f have a:"b\<noteq>c" and b: "b\<noteq>a" and c: "b\<sharp>t2" by (simp add: fresh_atm)+ |
18344 | 146 |
have "c\<sharp>Lam [b].s" by fact |
147 |
hence "c\<sharp>s" using a by (simp add: abs_fresh) |
|
148 |
hence d: "s[a::=t2] = ([(c,a)]\<bullet>s)[c::=t2]" using i by simp |
|
149 |
show "(Lam [b].s)[a::=t2] = ([(c,a)]\<bullet>(Lam [b].s))[c::=t2]" (is "?LHS = ?RHS") |
|
150 |
proof - |
|
18106 | 151 |
have "?LHS = Lam [b].(s[a::=t2])" using b c by simp |
152 |
also have "\<dots> = Lam [b].(([(c,a)]\<bullet>s)[c::=t2])" using d by simp |
|
153 |
also have "\<dots> = (Lam [b].([(c,a)]\<bullet>s))[c::=t2]" using a c by simp |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
154 |
also have "\<dots> = ?RHS" using a b by (simp add: calc_atm) |
18106 | 155 |
finally show "?LHS = ?RHS" by simp |
156 |
qed |
|
157 |
qed |
|
158 |
||
18378 | 159 |
lemma subst_rename_automatic: |
18344 | 160 |
assumes a: "c\<sharp>t1" |
161 |
shows "t1[a::=t2] = ([(c,a)]\<bullet>t1)[c::=t2]" |
|
162 |
using a |
|
18659
2ff0ae57431d
changes to make use of the new induction principle proved by
urbanc
parents:
18378
diff
changeset
|
163 |
apply(nominal_induct t1 avoiding: a c t2 rule: lam.induct) |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
164 |
apply(auto simp add: calc_atm fresh_atm abs_fresh) |
18106 | 165 |
done |
166 |
||
167 |
section {* Beta Reduction *} |
|
168 |
||
169 |
consts |
|
170 |
Beta :: "(lam\<times>lam) set" |
|
171 |
syntax |
|
172 |
"_Beta" :: "lam\<Rightarrow>lam\<Rightarrow>bool" (" _ \<longrightarrow>\<^isub>\<beta> _" [80,80] 80) |
|
173 |
"_Beta_star" :: "lam\<Rightarrow>lam\<Rightarrow>bool" (" _ \<longrightarrow>\<^isub>\<beta>\<^sup>* _" [80,80] 80) |
|
174 |
translations |
|
175 |
"t1 \<longrightarrow>\<^isub>\<beta> t2" \<rightleftharpoons> "(t1,t2) \<in> Beta" |
|
176 |
"t1 \<longrightarrow>\<^isub>\<beta>\<^sup>* t2" \<rightleftharpoons> "(t1,t2) \<in> Beta\<^sup>*" |
|
177 |
inductive Beta |
|
178 |
intros |
|
179 |
b1[intro!]: "s1\<longrightarrow>\<^isub>\<beta>s2 \<Longrightarrow> (App s1 t)\<longrightarrow>\<^isub>\<beta>(App s2 t)" |
|
180 |
b2[intro!]: "s1\<longrightarrow>\<^isub>\<beta>s2 \<Longrightarrow> (App t s1)\<longrightarrow>\<^isub>\<beta>(App t s2)" |
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
181 |
b3[intro!]: "s1\<longrightarrow>\<^isub>\<beta>s2 \<Longrightarrow> (Lam [a].s1)\<longrightarrow>\<^isub>\<beta> (Lam [a].s2)" |
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
182 |
b4[intro!]: "(App (Lam [a].s1) s2)\<longrightarrow>\<^isub>\<beta>(s1[a::=s2])" |
18106 | 183 |
|
184 |
lemma eqvt_beta: |
|
185 |
fixes pi :: "name prm" |
|
186 |
and t :: "lam" |
|
187 |
and s :: "lam" |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
188 |
assumes a: "t\<longrightarrow>\<^isub>\<beta>s" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
189 |
shows "(pi\<bullet>t)\<longrightarrow>\<^isub>\<beta>(pi\<bullet>s)" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
190 |
using a by (induct, auto) |
18106 | 191 |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
192 |
lemma beta_induct[consumes 1, case_names b1 b2 b3 b4]: |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
193 |
fixes P :: "'a::fs_name\<Rightarrow>lam \<Rightarrow> lam \<Rightarrow>bool" |
18106 | 194 |
and t :: "lam" |
195 |
and s :: "lam" |
|
196 |
and x :: "'a::fs_name" |
|
197 |
assumes a: "t\<longrightarrow>\<^isub>\<beta>s" |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
198 |
and a1: "\<And>t s1 s2 x. s1\<longrightarrow>\<^isub>\<beta>s2 \<Longrightarrow> (\<And>z. P z s1 s2) \<Longrightarrow> P x (App s1 t) (App s2 t)" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
199 |
and a2: "\<And>t s1 s2 x. s1\<longrightarrow>\<^isub>\<beta>s2 \<Longrightarrow> (\<And>z. P z s1 s2) \<Longrightarrow> P x (App t s1) (App t s2)" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
200 |
and a3: "\<And>a s1 s2 x. a\<sharp>x \<Longrightarrow> s1\<longrightarrow>\<^isub>\<beta>s2 \<Longrightarrow> (\<And>z. P z s1 s2) \<Longrightarrow> P x (Lam [a].s1) (Lam [a].s2)" |
18773
0eabf66582d0
the additional freshness-condition in the one-induction
urbanc
parents:
18659
diff
changeset
|
201 |
and a4: "\<And>a t1 s1 x. a\<sharp>x \<Longrightarrow> P x (App (Lam [a].t1) s1) (t1[a::=s1])" |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
202 |
shows "P x t s" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
203 |
proof - |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
204 |
from a have "\<And>(pi::name prm) x. P x (pi\<bullet>t) (pi\<bullet>s)" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
205 |
proof (induct) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
206 |
case b1 thus ?case using a1 by (simp, blast intro: eqvt_beta) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
207 |
next |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
208 |
case b2 thus ?case using a2 by (simp, blast intro: eqvt_beta) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
209 |
next |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
210 |
case (b3 a s1 s2) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
211 |
have j1: "s1 \<longrightarrow>\<^isub>\<beta> s2" by fact |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
212 |
have j2: "\<And>x (pi::name prm). P x (pi\<bullet>s1) (pi\<bullet>s2)" by fact |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
213 |
show ?case |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
214 |
proof (simp) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
215 |
have f: "\<exists>c::name. c\<sharp>(pi\<bullet>a,pi\<bullet>s1,pi\<bullet>s2,x)" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
216 |
by (rule at_exists_fresh[OF at_name_inst], simp add: fs_name1) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
217 |
then obtain c::"name" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
218 |
where f1: "c\<noteq>(pi\<bullet>a)" and f2: "c\<sharp>x" and f3: "c\<sharp>(pi\<bullet>s1)" and f4: "c\<sharp>(pi\<bullet>s2)" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
219 |
by (force simp add: fresh_prod fresh_atm) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
220 |
have x: "P x (Lam [c].(([(c,pi\<bullet>a)]@pi)\<bullet>s1)) (Lam [c].(([(c,pi\<bullet>a)]@pi)\<bullet>s2))" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
221 |
using a3 f2 j1 j2 by (simp, blast intro: eqvt_beta) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
222 |
have alpha1: "(Lam [c].([(c,pi\<bullet>a)]\<bullet>(pi\<bullet>s1))) = (Lam [(pi\<bullet>a)].(pi\<bullet>s1))" using f1 f3 |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
223 |
by (simp add: lam.inject alpha) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
224 |
have alpha2: "(Lam [c].([(c,pi\<bullet>a)]\<bullet>(pi\<bullet>s2))) = (Lam [(pi\<bullet>a)].(pi\<bullet>s2))" using f1 f3 |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
225 |
by (simp add: lam.inject alpha) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
226 |
show " P x (Lam [(pi\<bullet>a)].(pi\<bullet>s1)) (Lam [(pi\<bullet>a)].(pi\<bullet>s2))" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
227 |
using x alpha1 alpha2 by (simp only: pt_name2) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
228 |
qed |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
229 |
next |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
230 |
case (b4 a s1 s2) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
231 |
show ?case |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
232 |
proof (simp add: subst_eqvt) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
233 |
have f: "\<exists>c::name. c\<sharp>(pi\<bullet>a,pi\<bullet>s1,pi\<bullet>s2,x)" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
234 |
by (rule at_exists_fresh[OF at_name_inst], simp add: fs_name1) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
235 |
then obtain c::"name" |
18773
0eabf66582d0
the additional freshness-condition in the one-induction
urbanc
parents:
18659
diff
changeset
|
236 |
where f1: "c\<noteq>(pi\<bullet>a)" and f2: "c\<sharp>x" and f3: "c\<sharp>(pi\<bullet>s1)" and f4: "c\<sharp>(pi\<bullet>s2)" |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
237 |
by (force simp add: fresh_prod fresh_atm) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
238 |
have x: "P x (App (Lam [c].(([(c,pi\<bullet>a)]@pi)\<bullet>s1)) (pi\<bullet>s2)) ((([(c,pi\<bullet>a)]@pi)\<bullet>s1)[c::=(pi\<bullet>s2)])" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
239 |
using a4 f2 by (blast intro!: eqvt_beta) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
240 |
have alpha1: "(Lam [c].([(c,pi\<bullet>a)]\<bullet>(pi\<bullet>s1))) = (Lam [(pi\<bullet>a)].(pi\<bullet>s1))" using f1 f3 |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
241 |
by (simp add: lam.inject alpha) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
242 |
have alpha2: "(([(c,pi\<bullet>a)]@pi)\<bullet>s1)[c::=(pi\<bullet>s2)] = (pi\<bullet>s1)[(pi\<bullet>a)::=(pi\<bullet>s2)]" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
243 |
using f3 by (simp only: subst_rename[symmetric] pt_name2) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
244 |
show "P x (App (Lam [(pi\<bullet>a)].(pi\<bullet>s1)) (pi\<bullet>s2)) ((pi\<bullet>s1)[(pi\<bullet>a)::=(pi\<bullet>s2)])" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
245 |
using x alpha1 alpha2 by (simp only: pt_name2) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
246 |
qed |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
247 |
qed |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
248 |
hence "P x (([]::name prm)\<bullet>t) (([]::name prm)\<bullet>s)" by blast |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
249 |
thus ?thesis by simp |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
250 |
qed |
18106 | 251 |
|
252 |
section {* One-Reduction *} |
|
253 |
||
254 |
consts |
|
255 |
One :: "(lam\<times>lam) set" |
|
256 |
syntax |
|
257 |
"_One" :: "lam\<Rightarrow>lam\<Rightarrow>bool" (" _ \<longrightarrow>\<^isub>1 _" [80,80] 80) |
|
258 |
"_One_star" :: "lam\<Rightarrow>lam\<Rightarrow>bool" (" _ \<longrightarrow>\<^isub>1\<^sup>* _" [80,80] 80) |
|
259 |
translations |
|
260 |
"t1 \<longrightarrow>\<^isub>1 t2" \<rightleftharpoons> "(t1,t2) \<in> One" |
|
261 |
"t1 \<longrightarrow>\<^isub>1\<^sup>* t2" \<rightleftharpoons> "(t1,t2) \<in> One\<^sup>*" |
|
262 |
inductive One |
|
263 |
intros |
|
264 |
o1[intro!]: "M\<longrightarrow>\<^isub>1M" |
|
265 |
o2[simp,intro!]: "\<lbrakk>t1\<longrightarrow>\<^isub>1t2;s1\<longrightarrow>\<^isub>1s2\<rbrakk> \<Longrightarrow> (App t1 s1)\<longrightarrow>\<^isub>1(App t2 s2)" |
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
266 |
o3[simp,intro!]: "s1\<longrightarrow>\<^isub>1s2 \<Longrightarrow> (Lam [a].s1)\<longrightarrow>\<^isub>1(Lam [a].s2)" |
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
267 |
o4[simp,intro!]: "\<lbrakk>s1\<longrightarrow>\<^isub>1s2;t1\<longrightarrow>\<^isub>1t2\<rbrakk> \<Longrightarrow> (App (Lam [a].t1) s1)\<longrightarrow>\<^isub>1(t2[a::=s2])" |
18106 | 268 |
|
269 |
lemma eqvt_one: |
|
270 |
fixes pi :: "name prm" |
|
271 |
and t :: "lam" |
|
272 |
and s :: "lam" |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
273 |
assumes a: "t\<longrightarrow>\<^isub>1s" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
274 |
shows "(pi\<bullet>t)\<longrightarrow>\<^isub>1(pi\<bullet>s)" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
275 |
using a by (induct, auto) |
18106 | 276 |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
277 |
lemma one_induct[consumes 1, case_names o1 o2 o3 o4]: |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
278 |
fixes P :: "'a::fs_name\<Rightarrow>lam \<Rightarrow> lam \<Rightarrow>bool" |
18106 | 279 |
and t :: "lam" |
280 |
and s :: "lam" |
|
281 |
and x :: "'a::fs_name" |
|
282 |
assumes a: "t\<longrightarrow>\<^isub>1s" |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
283 |
and a1: "\<And>t x. P x t t" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
284 |
and a2: "\<And>t1 t2 s1 s2 x. t1\<longrightarrow>\<^isub>1t2 \<Longrightarrow> (\<And>z. P z t1 t2) \<Longrightarrow> s1\<longrightarrow>\<^isub>1s2 \<Longrightarrow> (\<And>z. P z s1 s2) \<Longrightarrow> |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
285 |
P x (App t1 s1) (App t2 s2)" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
286 |
and a3: "\<And>a s1 s2 x. a\<sharp>x \<Longrightarrow> s1\<longrightarrow>\<^isub>1s2 \<Longrightarrow> (\<And>z. P z s1 s2) \<Longrightarrow> P x (Lam [a].s1) (Lam [a].s2)" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
287 |
and a4: "\<And>a t1 t2 s1 s2 x. |
18773
0eabf66582d0
the additional freshness-condition in the one-induction
urbanc
parents:
18659
diff
changeset
|
288 |
a\<sharp>x \<Longrightarrow> t1\<longrightarrow>\<^isub>1t2 \<Longrightarrow> (\<And>z. P z t1 t2) \<Longrightarrow> s1\<longrightarrow>\<^isub>1s2 \<Longrightarrow> (\<And>z. P z s1 s2) |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
289 |
\<Longrightarrow> P x (App (Lam [a].t1) s1) (t2[a::=s2])" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
290 |
shows "P x t s" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
291 |
proof - |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
292 |
from a have "\<And>(pi::name prm) x. P x (pi\<bullet>t) (pi\<bullet>s)" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
293 |
proof (induct) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
294 |
case o1 show ?case using a1 by force |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
295 |
next |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
296 |
case (o2 s1 s2 t1 t2) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
297 |
thus ?case using a2 by (simp, blast intro: eqvt_one) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
298 |
next |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
299 |
case (o3 a t1 t2) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
300 |
have j1: "t1 \<longrightarrow>\<^isub>1 t2" by fact |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
301 |
have j2: "\<And>(pi::name prm) x. P x (pi\<bullet>t1) (pi\<bullet>t2)" by fact |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
302 |
show ?case |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
303 |
proof (simp) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
304 |
have f: "\<exists>c::name. c\<sharp>(pi\<bullet>a,pi\<bullet>t1,pi\<bullet>t2,x)" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
305 |
by (rule at_exists_fresh[OF at_name_inst], simp add: fs_name1) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
306 |
then obtain c::"name" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
307 |
where f1: "c\<noteq>(pi\<bullet>a)" and f2: "c\<sharp>x" and f3: "c\<sharp>(pi\<bullet>t1)" and f4: "c\<sharp>(pi\<bullet>t2)" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
308 |
by (force simp add: fresh_prod fresh_atm) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
309 |
have x: "P x (Lam [c].(([(c,pi\<bullet>a)]@pi)\<bullet>t1)) (Lam [c].(([(c,pi\<bullet>a)]@pi)\<bullet>t2))" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
310 |
using a3 f2 j1 j2 by (simp, blast intro: eqvt_one) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
311 |
have alpha1: "(Lam [c].([(c,pi\<bullet>a)]\<bullet>(pi\<bullet>t1))) = (Lam [(pi\<bullet>a)].(pi\<bullet>t1))" using f1 f3 |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
312 |
by (simp add: lam.inject alpha) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
313 |
have alpha2: "(Lam [c].([(c,pi\<bullet>a)]\<bullet>(pi\<bullet>t2))) = (Lam [(pi\<bullet>a)].(pi\<bullet>t2))" using f1 f3 |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
314 |
by (simp add: lam.inject alpha) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
315 |
show " P x (Lam [(pi\<bullet>a)].(pi\<bullet>t1)) (Lam [(pi\<bullet>a)].(pi\<bullet>t2))" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
316 |
using x alpha1 alpha2 by (simp only: pt_name2) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
317 |
qed |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
318 |
next |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
319 |
case (o4 a s1 s2 t1 t2) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
320 |
have j0: "t1 \<longrightarrow>\<^isub>1 t2" by fact |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
321 |
have j1: "s1 \<longrightarrow>\<^isub>1 s2" by fact |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
322 |
have j2: "\<And>(pi::name prm) x. P x (pi\<bullet>t1) (pi\<bullet>t2)" by fact |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
323 |
have j3: "\<And>(pi::name prm) x. P x (pi\<bullet>s1) (pi\<bullet>s2)" by fact |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
324 |
show ?case |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
325 |
proof (simp) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
326 |
have f: "\<exists>c::name. c\<sharp>(pi\<bullet>a,pi\<bullet>t1,pi\<bullet>t2,pi\<bullet>s1,pi\<bullet>s2,x)" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
327 |
by (rule at_exists_fresh[OF at_name_inst], simp add: fs_name1) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
328 |
then obtain c::"name" |
18773
0eabf66582d0
the additional freshness-condition in the one-induction
urbanc
parents:
18659
diff
changeset
|
329 |
where f1: "c\<noteq>(pi\<bullet>a)" and f2: "c\<sharp>x" and f3: "c\<sharp>(pi\<bullet>t1)" and f4: "c\<sharp>(pi\<bullet>t2)" |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
330 |
by (force simp add: fresh_prod at_fresh[OF at_name_inst]) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
331 |
have x: "P x (App (Lam [c].(([(c,pi\<bullet>a)]@pi)\<bullet>t1)) (pi\<bullet>s1)) ((([(c,pi\<bullet>a)]@pi)\<bullet>t2)[c::=(pi\<bullet>s2)])" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
332 |
using a4 f2 j0 j1 j2 j3 by (simp, blast intro!: eqvt_one) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
333 |
have alpha1: "(Lam [c].([(c,pi\<bullet>a)]\<bullet>(pi\<bullet>t1))) = (Lam [(pi\<bullet>a)].(pi\<bullet>t1))" using f1 f3 |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
334 |
by (simp add: lam.inject alpha) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
335 |
have alpha2: "(([(c,pi\<bullet>a)]@pi)\<bullet>t2)[c::=(pi\<bullet>s2)] = (pi\<bullet>t2)[(pi\<bullet>a)::=(pi\<bullet>s2)]" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
336 |
using f4 by (simp only: subst_rename[symmetric] pt_name2) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
337 |
show "P x (App (Lam [(pi\<bullet>a)].(pi\<bullet>t1)) (pi\<bullet>s1)) ((pi\<bullet>t2)[(pi\<bullet>a)::=(pi\<bullet>s2)])" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
338 |
using x alpha1 alpha2 by (simp only: pt_name2) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
339 |
qed |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
340 |
qed |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
341 |
hence "P x (([]::name prm)\<bullet>t) (([]::name prm)\<bullet>s)" by blast |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
342 |
thus ?thesis by simp |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
343 |
qed |
18106 | 344 |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
345 |
lemma fresh_fact': |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
346 |
assumes a: "a\<sharp>t2" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
347 |
shows "a\<sharp>(t1[a::=t2])" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
348 |
using a |
18659
2ff0ae57431d
changes to make use of the new induction principle proved by
urbanc
parents:
18378
diff
changeset
|
349 |
proof (nominal_induct t1 avoiding: a t2 rule: lam.induct) |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
350 |
case (Var b) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
351 |
thus ?case by (simp add: fresh_atm) |
18106 | 352 |
next |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
353 |
case App thus ?case by simp |
18106 | 354 |
next |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
355 |
case (Lam c t) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
356 |
have "a\<sharp>t2" "c\<sharp>a" "c\<sharp>t2" by fact |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
357 |
moreover |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
358 |
have ih: "\<And>a t2. a\<sharp>t2 \<Longrightarrow> a\<sharp>(t[a::=t2])" by fact |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
359 |
ultimately show ?case by (simp add: abs_fresh) |
18106 | 360 |
qed |
361 |
||
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
362 |
lemma one_fresh_preserv: |
18378 | 363 |
fixes a :: "name" |
18106 | 364 |
assumes a: "t\<longrightarrow>\<^isub>1s" |
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
365 |
and b: "a\<sharp>t" |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
366 |
shows "a\<sharp>s" |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
367 |
using a b |
18106 | 368 |
proof (induct) |
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
369 |
case o1 thus ?case by simp |
18106 | 370 |
next |
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
371 |
case o2 thus ?case by simp |
18106 | 372 |
next |
373 |
case (o3 c s1 s2) |
|
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
374 |
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
|
375 |
have c: "a\<sharp>Lam [c].s1" by fact |
18106 | 376 |
show ?case |
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
377 |
proof (cases "a=c") |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
378 |
assume "a=c" thus "a\<sharp>Lam [c].s2" by (simp add: abs_fresh) |
18106 | 379 |
next |
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
380 |
assume d: "a\<noteq>c" |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
381 |
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
|
382 |
hence "a\<sharp>s2" using ih by simp |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
383 |
thus "a\<sharp>Lam [c].s2" using d by (simp add: abs_fresh) |
18106 | 384 |
qed |
385 |
next |
|
386 |
case (o4 c t1 t2 s1 s2) |
|
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
387 |
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
|
388 |
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
|
389 |
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
|
390 |
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
|
391 |
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
|
392 |
show "a\<sharp>s2[c::=t2]" |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
393 |
proof (cases "a=c") |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
394 |
assume "a=c" |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
395 |
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
|
396 |
next |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
397 |
assume d1: "a\<noteq>c" |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
398 |
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
|
399 |
hence "a\<sharp>s2" using i2 by simp |
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
400 |
thus "a\<sharp>s2[c::=t2]" using c3 by (simp add: fresh_fact) |
18106 | 401 |
qed |
402 |
qed |
|
403 |
||
404 |
lemma one_abs: |
|
405 |
fixes t :: "lam" |
|
406 |
and t':: "lam" |
|
407 |
and a :: "name" |
|
408 |
shows "(Lam [a].t)\<longrightarrow>\<^isub>1t'\<Longrightarrow>\<exists>t''. t'=Lam [a].t'' \<and> t\<longrightarrow>\<^isub>1t''" |
|
409 |
apply(ind_cases "(Lam [a].t)\<longrightarrow>\<^isub>1t'") |
|
410 |
apply(auto simp add: lam.distinct lam.inject alpha) |
|
411 |
apply(rule_tac x="[(a,aa)]\<bullet>s2" in exI) |
|
412 |
apply(rule conjI) |
|
413 |
apply(rule pt_bij2[OF pt_name_inst, OF at_name_inst, symmetric]) |
|
414 |
apply(simp) |
|
415 |
apply(rule pt_name3) |
|
416 |
apply(rule at_ds5[OF at_name_inst]) |
|
417 |
apply(frule_tac a="a" in one_fresh_preserv) |
|
418 |
apply(assumption) |
|
419 |
apply(rule conjI) |
|
420 |
apply(simp add: pt_fresh_left[OF pt_name_inst, OF at_name_inst]) |
|
421 |
apply(simp add: calc_atm) |
|
422 |
apply(force intro!: eqvt_one) |
|
423 |
done |
|
424 |
||
425 |
lemma one_app: |
|
426 |
"App t1 t2 \<longrightarrow>\<^isub>1 t' \<Longrightarrow> |
|
427 |
(\<exists>s1 s2. t' = App s1 s2 \<and> t1 \<longrightarrow>\<^isub>1 s1 \<and> t2 \<longrightarrow>\<^isub>1 s2) \<or> |
|
428 |
(\<exists>a s s1 s2. t1 = Lam [a].s \<and> t' = s1[a::=s2] \<and> s \<longrightarrow>\<^isub>1 s1 \<and> t2 \<longrightarrow>\<^isub>1 s2)" |
|
429 |
apply(ind_cases "App t1 s1 \<longrightarrow>\<^isub>1 t'") |
|
430 |
apply(auto simp add: lam.distinct lam.inject) |
|
431 |
done |
|
432 |
||
433 |
lemma one_red: |
|
434 |
"App (Lam [a].t1) t2 \<longrightarrow>\<^isub>1 M \<Longrightarrow> |
|
435 |
(\<exists>s1 s2. M = App (Lam [a].s1) s2 \<and> t1 \<longrightarrow>\<^isub>1 s1 \<and> t2 \<longrightarrow>\<^isub>1 s2) \<or> |
|
436 |
(\<exists>s1 s2. M = s1[a::=s2] \<and> t1 \<longrightarrow>\<^isub>1 s1 \<and> t2 \<longrightarrow>\<^isub>1 s2)" |
|
437 |
apply(ind_cases "App (Lam [a].t1) s1 \<longrightarrow>\<^isub>1 M") |
|
438 |
apply(simp_all add: lam.inject) |
|
439 |
apply(force) |
|
440 |
apply(erule conjE) |
|
441 |
apply(drule sym[of "Lam [a].t1"]) |
|
442 |
apply(simp) |
|
443 |
apply(drule one_abs) |
|
444 |
apply(erule exE) |
|
445 |
apply(simp) |
|
446 |
apply(force simp add: alpha) |
|
447 |
apply(erule conjE) |
|
448 |
apply(simp add: lam.inject alpha) |
|
449 |
apply(erule disjE) |
|
450 |
apply(simp) |
|
451 |
apply(force) |
|
452 |
apply(simp) |
|
453 |
apply(rule disjI2) |
|
454 |
apply(rule_tac x="[(a,aa)]\<bullet>t2a" in exI) |
|
455 |
apply(rule_tac x="s2" in exI) |
|
456 |
apply(auto) |
|
457 |
apply(subgoal_tac "a\<sharp>t2a")(*A*) |
|
458 |
apply(simp add: subst_rename) |
|
459 |
(*A*) |
|
460 |
apply(force intro: one_fresh_preserv) |
|
461 |
apply(force intro: eqvt_one) |
|
462 |
done |
|
463 |
||
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
464 |
text {* first case in Lemma 3.2.4*} |
18106 | 465 |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
466 |
lemma one_subst_aux: |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
467 |
assumes a: "N\<longrightarrow>\<^isub>1N'" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
468 |
shows "M[x::=N] \<longrightarrow>\<^isub>1 M[x::=N']" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
469 |
using a |
18659
2ff0ae57431d
changes to make use of the new induction principle proved by
urbanc
parents:
18378
diff
changeset
|
470 |
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
|
471 |
case (Var y) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
472 |
show "Var y[x::=N] \<longrightarrow>\<^isub>1 Var y[x::=N']" by (cases "x=y", auto) |
18106 | 473 |
next |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
474 |
case (App P Q) (* application case - third line *) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
475 |
thus "(App P Q)[x::=N] \<longrightarrow>\<^isub>1 (App P Q)[x::=N']" using o2 by simp |
18106 | 476 |
next |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
477 |
case (Lam y P) (* abstraction case - fourth line *) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
478 |
thus "(Lam [y].P)[x::=N] \<longrightarrow>\<^isub>1 (Lam [y].P)[x::=N']" using o3 by simp |
18106 | 479 |
qed |
480 |
||
18378 | 481 |
lemma one_subst_aux_automatic: |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
482 |
assumes a: "N\<longrightarrow>\<^isub>1N'" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
483 |
shows "M[x::=N] \<longrightarrow>\<^isub>1 M[x::=N']" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
484 |
using a |
18659
2ff0ae57431d
changes to make use of the new induction principle proved by
urbanc
parents:
18378
diff
changeset
|
485 |
apply(nominal_induct M avoiding: x N N' rule: lam.induct) |
18106 | 486 |
apply(auto simp add: fresh_prod fresh_atm) |
487 |
done |
|
488 |
||
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
489 |
lemma one_subst: |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
490 |
assumes a: "M\<longrightarrow>\<^isub>1M'" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
491 |
and b: "N\<longrightarrow>\<^isub>1N'" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
492 |
shows "M[x::=N]\<longrightarrow>\<^isub>1M'[x::=N']" |
18773
0eabf66582d0
the additional freshness-condition in the one-induction
urbanc
parents:
18659
diff
changeset
|
493 |
using a b |
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
494 |
proof (nominal_induct M M' avoiding: N N' x rule: one_induct) |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
495 |
case (o1 M) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
496 |
thus ?case by (simp add: one_subst_aux) |
18106 | 497 |
next |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
498 |
case (o2 M1 M2 N1 N2) |
18106 | 499 |
thus ?case by simp |
500 |
next |
|
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
501 |
case (o3 a M1 M2) |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
502 |
thus ?case by simp |
18106 | 503 |
next |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
504 |
case (o4 a M1 M2 N1 N2) |
18773
0eabf66582d0
the additional freshness-condition in the one-induction
urbanc
parents:
18659
diff
changeset
|
505 |
have e3: "a\<sharp>N" "a\<sharp>N'" "a\<sharp>x" by fact |
18106 | 506 |
show ?case |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
507 |
proof - |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
508 |
have "(App (Lam [a].M1) N1)[x::=N] = App (Lam [a].(M1[x::=N])) (N1[x::=N])" using e3 by simp |
18106 | 509 |
also have "App (Lam [a].(M1[x::=N])) (N1[x::=N]) \<longrightarrow>\<^isub>1 M2[x::=N'][a::=N2[x::=N']]" |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
510 |
using o4 b by force |
18106 | 511 |
also have "M2[x::=N'][a::=N2[x::=N']] = M2[a::=N2][x::=N']" |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
512 |
using e3 by (simp add: subs_lemma fresh_atm) |
18106 | 513 |
ultimately show "(App (Lam [a].M1) N1)[x::=N] \<longrightarrow>\<^isub>1 M2[a::=N2][x::=N']" by simp |
514 |
qed |
|
515 |
qed |
|
516 |
||
18378 | 517 |
lemma one_subst_automatic: |
18106 | 518 |
assumes a: "M\<longrightarrow>\<^isub>1M'" |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
519 |
and b: "N\<longrightarrow>\<^isub>1N'" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
520 |
shows "M[x::=N]\<longrightarrow>\<^isub>1M'[x::=N']" |
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
521 |
using a b |
18312
c68296902ddb
cleaned up further the proofs (diamond still needs work);
urbanc
parents:
18303
diff
changeset
|
522 |
apply(nominal_induct M M' avoiding: N N' x rule: one_induct) |
18303
b18fabea0fd0
modified almost everything for the new nominal_induct
urbanc
parents:
18269
diff
changeset
|
523 |
apply(auto simp add: one_subst_aux subs_lemma fresh_atm) |
18106 | 524 |
done |
525 |
||
526 |
lemma diamond[rule_format]: |
|
527 |
fixes M :: "lam" |
|
528 |
and M1:: "lam" |
|
529 |
assumes a: "M\<longrightarrow>\<^isub>1M1" |
|
18344 | 530 |
and b: "M\<longrightarrow>\<^isub>1M2" |
531 |
shows "\<exists>M3. M1\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3" |
|
532 |
using a b |
|
533 |
proof (induct fixing: M2) |
|
18106 | 534 |
case (o1 M) (* case 1 --- M1 = M *) |
18344 | 535 |
thus "\<exists>M3. M\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3" by blast |
18106 | 536 |
next |
537 |
case (o4 x Q Q' P P') (* case 2 --- a beta-reduction occurs*) |
|
18344 | 538 |
have i1: "\<And>M2. Q \<longrightarrow>\<^isub>1M2 \<Longrightarrow> (\<exists>M3. Q'\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3)" by fact |
539 |
have i2: "\<And>M2. P \<longrightarrow>\<^isub>1M2 \<Longrightarrow> (\<exists>M3. P'\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3)" by fact |
|
540 |
have "App (Lam [x].P) Q \<longrightarrow>\<^isub>1 M2" by fact |
|
541 |
hence "(\<exists>P' Q'. M2 = App (Lam [x].P') Q' \<and> P\<longrightarrow>\<^isub>1P' \<and> Q\<longrightarrow>\<^isub>1Q') \<or> |
|
542 |
(\<exists>P' Q'. M2 = P'[x::=Q'] \<and> P\<longrightarrow>\<^isub>1P' \<and> Q\<longrightarrow>\<^isub>1Q')" by (simp add: one_red) |
|
543 |
moreover (* subcase 2.1 *) |
|
544 |
{ assume "\<exists>P' Q'. M2 = App (Lam [x].P') Q' \<and> P\<longrightarrow>\<^isub>1P' \<and> Q\<longrightarrow>\<^isub>1Q'" |
|
545 |
then obtain P'' and Q'' where |
|
546 |
b1: "M2=App (Lam [x].P'') Q''" and b2: "P\<longrightarrow>\<^isub>1P''" and b3: "Q\<longrightarrow>\<^isub>1Q''" by blast |
|
547 |
from b2 i2 have "(\<exists>M3. P'\<longrightarrow>\<^isub>1M3 \<and> P''\<longrightarrow>\<^isub>1M3)" by simp |
|
548 |
then obtain P''' where |
|
549 |
c1: "P'\<longrightarrow>\<^isub>1P'''" and c2: "P''\<longrightarrow>\<^isub>1P'''" by force |
|
550 |
from b3 i1 have "(\<exists>M3. Q'\<longrightarrow>\<^isub>1M3 \<and> Q''\<longrightarrow>\<^isub>1M3)" by simp |
|
551 |
then obtain Q''' where |
|
552 |
d1: "Q'\<longrightarrow>\<^isub>1Q'''" and d2: "Q''\<longrightarrow>\<^isub>1Q'''" by force |
|
553 |
from c1 c2 d1 d2 |
|
554 |
have "P'[x::=Q']\<longrightarrow>\<^isub>1P'''[x::=Q'''] \<and> App (Lam [x].P'') Q'' \<longrightarrow>\<^isub>1 P'''[x::=Q''']" |
|
555 |
by (force simp add: one_subst) |
|
556 |
hence "\<exists>M3. P'[x::=Q']\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3" using b1 by blast |
|
557 |
} |
|
558 |
moreover (* subcase 2.2 *) |
|
559 |
{ assume "\<exists>P' Q'. M2 = P'[x::=Q'] \<and> P\<longrightarrow>\<^isub>1P' \<and> Q\<longrightarrow>\<^isub>1Q'" |
|
560 |
then obtain P'' Q'' where |
|
561 |
b1: "M2=P''[x::=Q'']" and b2: "P\<longrightarrow>\<^isub>1P''" and b3: "Q\<longrightarrow>\<^isub>1Q''" by blast |
|
562 |
from b2 i2 have "(\<exists>M3. P'\<longrightarrow>\<^isub>1M3 \<and> P''\<longrightarrow>\<^isub>1M3)" by simp |
|
563 |
then obtain P''' where |
|
564 |
c1: "P'\<longrightarrow>\<^isub>1P'''" and c2: "P''\<longrightarrow>\<^isub>1P'''" by blast |
|
565 |
from b3 i1 have "(\<exists>M3. Q'\<longrightarrow>\<^isub>1M3 \<and> Q''\<longrightarrow>\<^isub>1M3)" by simp |
|
566 |
then obtain Q''' where |
|
567 |
d1: "Q'\<longrightarrow>\<^isub>1Q'''" and d2: "Q''\<longrightarrow>\<^isub>1Q'''" by blast |
|
568 |
from c1 c2 d1 d2 |
|
569 |
have "P'[x::=Q']\<longrightarrow>\<^isub>1P'''[x::=Q'''] \<and> P''[x::=Q'']\<longrightarrow>\<^isub>1P'''[x::=Q''']" |
|
570 |
by (force simp add: one_subst) |
|
571 |
hence "\<exists>M3. P'[x::=Q']\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3" using b1 by blast |
|
572 |
} |
|
573 |
ultimately show "\<exists>M3. P'[x::=Q']\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3" by blast |
|
18106 | 574 |
next |
575 |
case (o2 Q Q' P P') (* case 3 *) |
|
18344 | 576 |
have i0: "P\<longrightarrow>\<^isub>1P'" by fact |
577 |
have i1: "\<And>M2. Q \<longrightarrow>\<^isub>1M2 \<Longrightarrow> (\<exists>M3. Q'\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3)" by fact |
|
578 |
have i2: "\<And>M2. P \<longrightarrow>\<^isub>1M2 \<Longrightarrow> (\<exists>M3. P'\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3)" by fact |
|
579 |
assume "App P Q \<longrightarrow>\<^isub>1 M2" |
|
580 |
hence "(\<exists>P'' Q''. M2 = App P'' Q'' \<and> P\<longrightarrow>\<^isub>1P'' \<and> Q\<longrightarrow>\<^isub>1Q'') \<or> |
|
581 |
(\<exists>x P' P'' Q'. P = Lam [x].P' \<and> M2 = P''[x::=Q'] \<and> P'\<longrightarrow>\<^isub>1 P'' \<and> Q\<longrightarrow>\<^isub>1Q')" |
|
582 |
by (simp add: one_app[simplified]) |
|
583 |
moreover (* subcase 3.1 *) |
|
584 |
{ assume "\<exists>P'' Q''. M2 = App P'' Q'' \<and> P\<longrightarrow>\<^isub>1P'' \<and> Q\<longrightarrow>\<^isub>1Q''" |
|
585 |
then obtain P'' and Q'' where |
|
586 |
b1: "M2=App P'' Q''" and b2: "P\<longrightarrow>\<^isub>1P''" and b3: "Q\<longrightarrow>\<^isub>1Q''" by blast |
|
587 |
from b2 i2 have "(\<exists>M3. P'\<longrightarrow>\<^isub>1M3 \<and> P''\<longrightarrow>\<^isub>1M3)" by simp |
|
588 |
then obtain P''' where |
|
589 |
c1: "P'\<longrightarrow>\<^isub>1P'''" and c2: "P''\<longrightarrow>\<^isub>1P'''" by blast |
|
590 |
from b3 i1 have "\<exists>M3. Q'\<longrightarrow>\<^isub>1M3 \<and> Q''\<longrightarrow>\<^isub>1M3" by simp |
|
591 |
then obtain Q''' where |
|
592 |
d1: "Q'\<longrightarrow>\<^isub>1Q'''" and d2: "Q''\<longrightarrow>\<^isub>1Q'''" by blast |
|
593 |
from c1 c2 d1 d2 |
|
594 |
have "App P' Q'\<longrightarrow>\<^isub>1App P''' Q''' \<and> App P'' Q'' \<longrightarrow>\<^isub>1 App P''' Q'''" by blast |
|
595 |
hence "\<exists>M3. App P' Q'\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3" using b1 by blast |
|
596 |
} |
|
597 |
moreover (* subcase 3.2 *) |
|
598 |
{ assume "\<exists>x P1 P'' Q''. P = Lam [x].P1 \<and> M2 = P''[x::=Q''] \<and> P1\<longrightarrow>\<^isub>1 P'' \<and> Q\<longrightarrow>\<^isub>1Q''" |
|
599 |
then obtain x P1 P1'' Q'' where |
|
600 |
b0: "P=Lam [x].P1" and b1: "M2=P1''[x::=Q'']" and |
|
601 |
b2: "P1\<longrightarrow>\<^isub>1P1''" and b3: "Q\<longrightarrow>\<^isub>1Q''" by blast |
|
602 |
from b0 i0 have "\<exists>P1'. P'=Lam [x].P1' \<and> P1\<longrightarrow>\<^isub>1P1'" by (simp add: one_abs) |
|
603 |
then obtain P1' where g1: "P'=Lam [x].P1'" and g2: "P1\<longrightarrow>\<^isub>1P1'" by blast |
|
604 |
from g1 b0 b2 i2 have "(\<exists>M3. (Lam [x].P1')\<longrightarrow>\<^isub>1M3 \<and> (Lam [x].P1'')\<longrightarrow>\<^isub>1M3)" by simp |
|
605 |
then obtain P1''' where |
|
606 |
c1: "(Lam [x].P1')\<longrightarrow>\<^isub>1P1'''" and c2: "(Lam [x].P1'')\<longrightarrow>\<^isub>1P1'''" by blast |
|
607 |
from c1 have "\<exists>R1. P1'''=Lam [x].R1 \<and> P1'\<longrightarrow>\<^isub>1R1" by (simp add: one_abs) |
|
608 |
then obtain R1 where r1: "P1'''=Lam [x].R1" and r2: "P1'\<longrightarrow>\<^isub>1R1" by blast |
|
609 |
from c2 have "\<exists>R2. P1'''=Lam [x].R2 \<and> P1''\<longrightarrow>\<^isub>1R2" by (simp add: one_abs) |
|
610 |
then obtain R2 where r3: "P1'''=Lam [x].R2" and r4: "P1''\<longrightarrow>\<^isub>1R2" by blast |
|
611 |
from r1 r3 have r5: "R1=R2" by (simp add: lam.inject alpha) |
|
612 |
from b3 i1 have "(\<exists>M3. Q'\<longrightarrow>\<^isub>1M3 \<and> Q''\<longrightarrow>\<^isub>1M3)" by simp |
|
613 |
then obtain Q''' where |
|
614 |
d1: "Q'\<longrightarrow>\<^isub>1Q'''" and d2: "Q''\<longrightarrow>\<^isub>1Q'''" by blast |
|
615 |
from g1 r2 d1 r4 r5 d2 |
|
616 |
have "App P' Q'\<longrightarrow>\<^isub>1R1[x::=Q'''] \<and> P1''[x::=Q'']\<longrightarrow>\<^isub>1R1[x::=Q''']" by (simp add: one_subst) |
|
617 |
hence "\<exists>M3. App P' Q'\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3" using b1 by blast |
|
618 |
} |
|
619 |
ultimately show "\<exists>M3. App P' Q'\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3" by blast |
|
18106 | 620 |
next |
621 |
case (o3 x P P') (* case 4 *) |
|
18344 | 622 |
have i1: "P\<longrightarrow>\<^isub>1P'" by fact |
623 |
have i2: "\<And>M2. P \<longrightarrow>\<^isub>1M2 \<Longrightarrow> (\<exists>M3. P'\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3)" by fact |
|
624 |
have "(Lam [x].P)\<longrightarrow>\<^isub>1 M2" by fact |
|
625 |
hence "\<exists>P''. M2=Lam [x].P'' \<and> P\<longrightarrow>\<^isub>1P''" by (simp add: one_abs) |
|
626 |
then obtain P'' where b1: "M2=Lam [x].P''" and b2: "P\<longrightarrow>\<^isub>1P''" by blast |
|
627 |
from i2 b1 b2 have "\<exists>M3. (Lam [x].P')\<longrightarrow>\<^isub>1M3 \<and> (Lam [x].P'')\<longrightarrow>\<^isub>1M3" by blast |
|
628 |
then obtain M3 where c1: "(Lam [x].P')\<longrightarrow>\<^isub>1M3" and c2: "(Lam [x].P'')\<longrightarrow>\<^isub>1M3" by blast |
|
629 |
from c1 have "\<exists>R1. M3=Lam [x].R1 \<and> P'\<longrightarrow>\<^isub>1R1" by (simp add: one_abs) |
|
630 |
then obtain R1 where r1: "M3=Lam [x].R1" and r2: "P'\<longrightarrow>\<^isub>1R1" by blast |
|
631 |
from c2 have "\<exists>R2. M3=Lam [x].R2 \<and> P''\<longrightarrow>\<^isub>1R2" by (simp add: one_abs) |
|
632 |
then obtain R2 where r3: "M3=Lam [x].R2" and r4: "P''\<longrightarrow>\<^isub>1R2" by blast |
|
633 |
from r1 r3 have r5: "R1=R2" by (simp add: lam.inject alpha) |
|
634 |
from r2 r4 have "(Lam [x].P')\<longrightarrow>\<^isub>1(Lam [x].R1) \<and> (Lam [x].P'')\<longrightarrow>\<^isub>1(Lam [x].R2)" |
|
635 |
by (simp add: one_subst) |
|
636 |
thus "\<exists>M3. (Lam [x].P')\<longrightarrow>\<^isub>1M3 \<and> M2\<longrightarrow>\<^isub>1M3" using b1 r5 by blast |
|
18106 | 637 |
qed |
638 |
||
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
639 |
lemma one_lam_cong: |
18106 | 640 |
assumes a: "t1\<longrightarrow>\<^isub>\<beta>\<^sup>*t2" |
641 |
shows "(Lam [a].t1)\<longrightarrow>\<^isub>\<beta>\<^sup>*(Lam [a].t2)" |
|
642 |
using a |
|
643 |
proof induct |
|
18378 | 644 |
case 1 thus ?case by simp |
18106 | 645 |
next |
646 |
case (2 y z) |
|
18378 | 647 |
thus ?case by (blast dest: b3 intro: rtrancl_trans) |
18106 | 648 |
qed |
649 |
||
18378 | 650 |
lemma one_app_congL: |
18106 | 651 |
assumes a: "t1\<longrightarrow>\<^isub>\<beta>\<^sup>*t2" |
652 |
shows "App t1 s\<longrightarrow>\<^isub>\<beta>\<^sup>* App t2 s" |
|
653 |
using a |
|
654 |
proof induct |
|
18378 | 655 |
case 1 thus ?case by simp |
18106 | 656 |
next |
18378 | 657 |
case 2 thus ?case by (blast dest: b1 intro: rtrancl_trans) |
18106 | 658 |
qed |
659 |
||
18378 | 660 |
lemma one_app_congR: |
18106 | 661 |
assumes a: "t1\<longrightarrow>\<^isub>\<beta>\<^sup>*t2" |
662 |
shows "App s t1 \<longrightarrow>\<^isub>\<beta>\<^sup>* App s t2" |
|
663 |
using a |
|
664 |
proof induct |
|
18378 | 665 |
case 1 thus ?case by simp |
18106 | 666 |
next |
18378 | 667 |
case 2 thus ?case by (blast dest: b2 intro: rtrancl_trans) |
18106 | 668 |
qed |
669 |
||
18378 | 670 |
lemma one_app_cong: |
18106 | 671 |
assumes a1: "t1\<longrightarrow>\<^isub>\<beta>\<^sup>*t2" |
672 |
and a2: "s1\<longrightarrow>\<^isub>\<beta>\<^sup>*s2" |
|
673 |
shows "App t1 s1\<longrightarrow>\<^isub>\<beta>\<^sup>* App t2 s2" |
|
674 |
proof - |
|
18378 | 675 |
have "App t1 s1 \<longrightarrow>\<^isub>\<beta>\<^sup>* App t2 s1" using a1 by (rule one_app_congL) |
676 |
moreover |
|
677 |
have "App t2 s1 \<longrightarrow>\<^isub>\<beta>\<^sup>* App t2 s2" using a2 by (rule one_app_congR) |
|
678 |
ultimately show ?thesis by (blast intro: rtrancl_trans) |
|
18106 | 679 |
qed |
680 |
||
681 |
lemma one_beta_star: |
|
682 |
assumes a: "(t1\<longrightarrow>\<^isub>1t2)" |
|
683 |
shows "(t1\<longrightarrow>\<^isub>\<beta>\<^sup>*t2)" |
|
684 |
using a |
|
685 |
proof induct |
|
18378 | 686 |
case o1 thus ?case by simp |
18106 | 687 |
next |
18378 | 688 |
case o2 thus ?case by (blast intro!: one_app_cong) |
18106 | 689 |
next |
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
690 |
case o3 thus ?case by (blast intro!: one_lam_cong) |
18106 | 691 |
next |
692 |
case (o4 a s1 s2 t1 t2) |
|
18378 | 693 |
have a1: "t1\<longrightarrow>\<^isub>\<beta>\<^sup>*t2" and a2: "s1\<longrightarrow>\<^isub>\<beta>\<^sup>*s2" by fact |
18106 | 694 |
have c1: "(App (Lam [a].t2) s2) \<longrightarrow>\<^isub>\<beta> (t2 [a::= s2])" by (rule b4) |
695 |
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
|
696 |
by (blast intro!: one_app_cong one_lam_cong) |
18378 | 697 |
show ?case using c1 c2 by (blast intro: rtrancl_trans) |
18106 | 698 |
qed |
699 |
||
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
700 |
lemma one_star_lam_cong: |
18106 | 701 |
assumes a: "t1\<longrightarrow>\<^isub>1\<^sup>*t2" |
702 |
shows "(Lam [a].t1)\<longrightarrow>\<^isub>1\<^sup>* (Lam [a].t2)" |
|
703 |
using a |
|
704 |
proof induct |
|
18378 | 705 |
case 1 thus ?case by simp |
18106 | 706 |
next |
18378 | 707 |
case 2 thus ?case by (blast intro: rtrancl_trans) |
18106 | 708 |
qed |
709 |
||
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
710 |
lemma one_star_app_congL: |
18106 | 711 |
assumes a: "t1\<longrightarrow>\<^isub>1\<^sup>*t2" |
712 |
shows "App t1 s\<longrightarrow>\<^isub>1\<^sup>* App t2 s" |
|
713 |
using a |
|
714 |
proof induct |
|
18378 | 715 |
case 1 thus ?case by simp |
18106 | 716 |
next |
18378 | 717 |
case 2 thus ?case by (blast intro: rtrancl_trans) |
18106 | 718 |
qed |
719 |
||
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
720 |
lemma one_star_app_congR: |
18106 | 721 |
assumes a: "t1\<longrightarrow>\<^isub>1\<^sup>*t2" |
722 |
shows "App s t1 \<longrightarrow>\<^isub>1\<^sup>* App s t2" |
|
723 |
using a |
|
724 |
proof induct |
|
18378 | 725 |
case 1 thus ?case by simp |
18106 | 726 |
next |
18378 | 727 |
case 2 thus ?case by (blast intro: rtrancl_trans) |
18106 | 728 |
qed |
729 |
||
730 |
lemma beta_one_star: |
|
731 |
assumes a: "t1\<longrightarrow>\<^isub>\<beta>t2" |
|
732 |
shows "t1\<longrightarrow>\<^isub>1\<^sup>*t2" |
|
733 |
using a |
|
734 |
proof induct |
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
735 |
case b1 thus ?case by (blast intro!: one_star_app_congL) |
18106 | 736 |
next |
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
737 |
case b2 thus ?case by (blast intro!: one_star_app_congR) |
18106 | 738 |
next |
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
739 |
case b3 thus ?case by (blast intro!: one_star_lam_cong) |
18106 | 740 |
next |
18378 | 741 |
case b4 thus ?case by blast |
18106 | 742 |
qed |
743 |
||
744 |
lemma trans_closure: |
|
745 |
shows "(t1\<longrightarrow>\<^isub>1\<^sup>*t2) = (t1\<longrightarrow>\<^isub>\<beta>\<^sup>*t2)" |
|
746 |
proof |
|
747 |
assume "t1 \<longrightarrow>\<^isub>1\<^sup>* t2" |
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
748 |
then show "t1\<longrightarrow>\<^isub>\<beta>\<^sup>*t2" |
18106 | 749 |
proof induct |
18378 | 750 |
case 1 thus ?case by simp |
18106 | 751 |
next |
752 |
case 2 thus ?case by (force intro: rtrancl_trans simp add: one_beta_star) |
|
753 |
qed |
|
754 |
next |
|
755 |
assume "t1 \<longrightarrow>\<^isub>\<beta>\<^sup>* t2" |
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
756 |
then show "t1\<longrightarrow>\<^isub>1\<^sup>*t2" |
18106 | 757 |
proof induct |
18378 | 758 |
case 1 thus ?case by simp |
18106 | 759 |
next |
760 |
case 2 thus ?case by (force intro: rtrancl_trans simp add: beta_one_star) |
|
761 |
qed |
|
762 |
qed |
|
763 |
||
764 |
lemma cr_one: |
|
765 |
assumes a: "t\<longrightarrow>\<^isub>1\<^sup>*t1" |
|
18344 | 766 |
and b: "t\<longrightarrow>\<^isub>1t2" |
18106 | 767 |
shows "\<exists>t3. t1\<longrightarrow>\<^isub>1t3 \<and> t2\<longrightarrow>\<^isub>1\<^sup>*t3" |
18344 | 768 |
using a b |
769 |
proof (induct fixing: t2) |
|
770 |
case 1 thus ?case by force |
|
771 |
next |
|
772 |
case (2 s1 s2) |
|
773 |
have b: "s1 \<longrightarrow>\<^isub>1 s2" by fact |
|
774 |
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 |
|
775 |
have c: "t \<longrightarrow>\<^isub>1 t2" by fact |
|
18378 | 776 |
show "\<exists>t3. s2 \<longrightarrow>\<^isub>1 t3 \<and> t2 \<longrightarrow>\<^isub>1\<^sup>* t3" |
18344 | 777 |
proof - |
18378 | 778 |
from c h have "\<exists>t3. s1 \<longrightarrow>\<^isub>1 t3 \<and> t2 \<longrightarrow>\<^isub>1\<^sup>* t3" by blast |
779 |
then obtain t3 where c1: "s1 \<longrightarrow>\<^isub>1 t3" and c2: "t2 \<longrightarrow>\<^isub>1\<^sup>* t3" by blast |
|
780 |
have "\<exists>t4. s2 \<longrightarrow>\<^isub>1 t4 \<and> t3 \<longrightarrow>\<^isub>1 t4" using b c1 by (blast intro: diamond) |
|
781 |
thus ?thesis using c2 by (blast intro: rtrancl_trans) |
|
18106 | 782 |
qed |
783 |
qed |
|
784 |
||
785 |
lemma cr_one_star: |
|
786 |
assumes a: "t\<longrightarrow>\<^isub>1\<^sup>*t2" |
|
787 |
and b: "t\<longrightarrow>\<^isub>1\<^sup>*t1" |
|
18378 | 788 |
shows "\<exists>t3. t1\<longrightarrow>\<^isub>1\<^sup>*t3\<and>t2\<longrightarrow>\<^isub>1\<^sup>*t3" |
18106 | 789 |
using a |
790 |
proof induct |
|
791 |
case 1 |
|
792 |
show ?case using b by force |
|
793 |
next |
|
794 |
case (2 s1 s2) |
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
795 |
have d: "s1 \<longrightarrow>\<^isub>1 s2" by fact |
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
796 |
have "\<exists>t3. t1 \<longrightarrow>\<^isub>1\<^sup>* t3 \<and> s1 \<longrightarrow>\<^isub>1\<^sup>* t3" by fact |
18106 | 797 |
then obtain t3 where f1: "t1 \<longrightarrow>\<^isub>1\<^sup>* t3" |
18378 | 798 |
and f2: "s1 \<longrightarrow>\<^isub>1\<^sup>* t3" by blast |
799 |
from cr_one d f2 have "\<exists>t4. t3\<longrightarrow>\<^isub>1t4 \<and> s2\<longrightarrow>\<^isub>1\<^sup>*t4" by blast |
|
18106 | 800 |
then obtain t4 where g1: "t3\<longrightarrow>\<^isub>1t4" |
18378 | 801 |
and g2: "s2\<longrightarrow>\<^isub>1\<^sup>*t4" by blast |
802 |
have "t1\<longrightarrow>\<^isub>1\<^sup>*t4" using f1 g1 by (blast intro: rtrancl_trans) |
|
803 |
thus ?case using g2 by blast |
|
18106 | 804 |
qed |
805 |
||
806 |
lemma cr_beta_star: |
|
807 |
assumes a1: "t\<longrightarrow>\<^isub>\<beta>\<^sup>*t1" |
|
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
808 |
and a2: "t\<longrightarrow>\<^isub>\<beta>\<^sup>*t2" |
18378 | 809 |
shows "\<exists>t3. t1\<longrightarrow>\<^isub>\<beta>\<^sup>*t3\<and>t2\<longrightarrow>\<^isub>\<beta>\<^sup>*t3" |
18106 | 810 |
proof - |
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
811 |
from a1 have "t\<longrightarrow>\<^isub>1\<^sup>*t1" by (simp only: trans_closure) |
18378 | 812 |
moreover |
18882
454d09651d1a
- renamed some lemmas (some had names coming from ancient
urbanc
parents:
18773
diff
changeset
|
813 |
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
|
814 |
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
|
815 |
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
|
816 |
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
|
817 |
then show "\<exists>t3. t1\<longrightarrow>\<^isub>\<beta>\<^sup>*t3\<and>t2\<longrightarrow>\<^isub>\<beta>\<^sup>*t3" by blast |
18106 | 818 |
qed |
819 |
||
820 |
end |
|
821 |