author | wenzelm |
Sun, 28 Nov 2010 21:07:28 +0100 | |
changeset 40800 | 330eb65c9469 |
parent 35762 | af3ff2ba4c54 |
child 45602 | 2a858377c3d2 |
permissions | -rw-r--r-- |
35762 | 1 |
(* Title: ZF/Resid/Confluence.thy |
1478 | 2 |
Author: Ole Rasmussen |
1048 | 3 |
Copyright 1995 University of Cambridge |
4 |
*) |
|
5 |
||
16417 | 6 |
theory Confluence imports Reduction begin |
12593 | 7 |
|
24893 | 8 |
definition |
9 |
confluence :: "i=>o" where |
|
12593 | 10 |
"confluence(R) == |
11 |
\<forall>x y. <x,y> \<in> R --> (\<forall>z.<x,z> \<in> R --> (\<exists>u.<y,u> \<in> R & <z,u> \<in> R))" |
|
12 |
||
24893 | 13 |
definition |
14 |
strip :: "o" where |
|
12593 | 15 |
"strip == \<forall>x y. (x ===> y) --> |
16 |
(\<forall>z.(x =1=> z) --> (\<exists>u.(y =1=> u) & (z===>u)))" |
|
17 |
||
18 |
||
19 |
(* ------------------------------------------------------------------------- *) |
|
20 |
(* strip lemmas *) |
|
21 |
(* ------------------------------------------------------------------------- *) |
|
22 |
||
23 |
lemma strip_lemma_r: |
|
24 |
"[|confluence(Spar_red1)|]==> strip" |
|
25 |
apply (unfold confluence_def strip_def) |
|
26 |
apply (rule impI [THEN allI, THEN allI]) |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12593
diff
changeset
|
27 |
apply (erule Spar_red.induct, fast) |
12593 | 28 |
apply (fast intro: Spar_red.trans) |
29 |
done |
|
30 |
||
31 |
||
32 |
lemma strip_lemma_l: |
|
33 |
"strip==> confluence(Spar_red)" |
|
34 |
apply (unfold confluence_def strip_def) |
|
35 |
apply (rule impI [THEN allI, THEN allI]) |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12593
diff
changeset
|
36 |
apply (erule Spar_red.induct, blast) |
12593 | 37 |
apply clarify |
38 |
apply (blast intro: Spar_red.trans) |
|
39 |
done |
|
40 |
||
41 |
(* ------------------------------------------------------------------------- *) |
|
42 |
(* Confluence *) |
|
43 |
(* ------------------------------------------------------------------------- *) |
|
44 |
||
45 |
||
46 |
lemma parallel_moves: "confluence(Spar_red1)" |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12593
diff
changeset
|
47 |
apply (unfold confluence_def, clarify) |
12593 | 48 |
apply (frule simulation) |
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12593
diff
changeset
|
49 |
apply (frule_tac n = z in simulation, clarify) |
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12593
diff
changeset
|
50 |
apply (frule_tac v = va in paving) |
12593 | 51 |
apply (force intro: completeness)+ |
52 |
done |
|
53 |
||
54 |
lemmas confluence_parallel_reduction = |
|
55 |
parallel_moves [THEN strip_lemma_r, THEN strip_lemma_l, standard] |
|
56 |
||
57 |
lemma lemma1: "[|confluence(Spar_red)|]==> confluence(Sred)" |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12593
diff
changeset
|
58 |
by (unfold confluence_def, blast intro: par_red_red red_par_red) |
12593 | 59 |
|
60 |
lemmas confluence_beta_reduction = |
|
61 |
confluence_parallel_reduction [THEN lemma1, standard] |
|
62 |
||
63 |
||
64 |
(**** Conversion ****) |
|
1048 | 65 |
|
66 |
consts |
|
12593 | 67 |
Sconv1 :: "i" |
68 |
Sconv :: "i" |
|
69 |
||
22808 | 70 |
abbreviation |
71 |
Sconv1_rel (infixl "<-1->" 50) where |
|
72 |
"a<-1->b == <a,b> \<in> Sconv1" |
|
73 |
||
74 |
abbreviation |
|
75 |
Sconv_rel (infixl "<--->" 50) where |
|
76 |
"a<--->b == <a,b> \<in> Sconv" |
|
12593 | 77 |
|
78 |
inductive |
|
79 |
domains "Sconv1" <= "lambda*lambda" |
|
80 |
intros |
|
81 |
red1: "m -1-> n ==> m<-1->n" |
|
82 |
expl: "n -1-> m ==> m<-1->n" |
|
83 |
type_intros red1D1 red1D2 lambda.intros bool_typechecks |
|
84 |
||
85 |
declare Sconv1.intros [intro] |
|
1048 | 86 |
|
12593 | 87 |
inductive |
88 |
domains "Sconv" <= "lambda*lambda" |
|
89 |
intros |
|
90 |
one_step: "m<-1->n ==> m<--->n" |
|
91 |
refl: "m \<in> lambda ==> m<--->m" |
|
92 |
trans: "[|m<--->n; n<--->p|] ==> m<--->p" |
|
93 |
type_intros Sconv1.dom_subset [THEN subsetD] lambda.intros bool_typechecks |
|
94 |
||
95 |
declare Sconv.intros [intro] |
|
96 |
||
97 |
lemma conv_sym: "m<--->n ==> n<--->m" |
|
98 |
apply (erule Sconv.induct) |
|
13339
0f89104dd377
Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents:
12593
diff
changeset
|
99 |
apply (erule Sconv1.induct, blast+) |
12593 | 100 |
done |
101 |
||
102 |
(* ------------------------------------------------------------------------- *) |
|
103 |
(* Church_Rosser Theorem *) |
|
104 |
(* ------------------------------------------------------------------------- *) |
|
105 |
||
106 |
lemma Church_Rosser: "m<--->n ==> \<exists>p.(m --->p) & (n ---> p)" |
|
107 |
apply (erule Sconv.induct) |
|
108 |
apply (erule Sconv1.induct) |
|
109 |
apply (blast intro: red1D1 redD2) |
|
110 |
apply (blast intro: red1D1 redD2) |
|
111 |
apply (blast intro: red1D1 redD2) |
|
112 |
apply (cut_tac confluence_beta_reduction) |
|
113 |
apply (unfold confluence_def) |
|
114 |
apply (blast intro: Sred.trans) |
|
115 |
done |
|
116 |
||
1048 | 117 |
end |
118 |