2 ||M|| This file is part of HELM, an Hypertextual, Electronic
3 ||A|| Library of Mathematics, developed at the Computer Science
4 ||T|| Department of the University of Bologna, Italy.
7 ||A|| This file is distributed under the terms of the
8 \ / GNU General Public License Version 2
10 V_______________________________________________________________ *)
12 include "lambda-delta/substitution/lift_weight.ma".
13 include "lambda-delta/reduction/tpr_main.ma".
15 (* CONTEXT-FREE PARALLEL REDUCTION ON TERMS *********************************)
17 (* Confluence lemmas ********************************************************)
19 lemma tpr_conf_sort_sort: ∀k1. ∃∃T0. ⋆k1 ⇒ T0 & ⋆k1 ⇒ T0.
22 lemma tpr_conf_lref_lref: ∀i1. ∃∃T0. #i1 ⇒ T0 & #i1 ⇒ T0.
25 lemma tpr_conf_bind_bind:
26 ∀I1,V11,V12,T11,T12,V22,T22. (
27 ∀T1. #T1 < #V11 + #T11 + 1 →
28 ∀T3,T4. T1 ⇒ T3 → T1 ⇒ T4 →
29 ∃∃T0. T3 ⇒ T0 & T4 ⇒ T0
31 V11 ⇒ V12 → T11 ⇒ T12 →
32 V11 ⇒ V22 → T11 ⇒ T22 →
33 ∃∃T0. 𝕓{I1} V12. T12 ⇒ T0 & 𝕓{I1} V22. T22 ⇒ T0.
34 #I1 #V11 #V12 #T11 #T12 #V22 #T22 #IH #HV1 #HT1 #HV2 #HT2
35 elim (IH … HV1 … HV2) -HV1 HV2 // #V #HV1 #HV2
36 elim (IH … HT1 … HT2) -HT1 HT2 // #T #HT1 #HT2
40 lemma tpr_conf_bind_zeta:
41 ∀V11,V12,T11,T12,T22,T20. (
42 ∀T1. #T1 < #V11 + #T11 +1 →
43 ∀T3,T4. T1 ⇒ T3 → T1 ⇒ T4 →
44 ∃∃T0. T3 ⇒ T0 & T4 ⇒ T0
46 V11 ⇒ V12 → T22 ⇒ T20 → T11 ⇒ T12 → ↑[O, 1] T22 ≡ T11 →
47 ∃∃T0. 𝕓{Abbr} V12. T12 ⇒ T0 & T20 ⇒ T0.
48 #V11 #V12 #T11 #T12 #T22 #T20 #IH #HV112 #HT202 #HT112 #HT
49 elim (tpr_inv_lift … HT112 … HT) -HT112 #T #HT12 #HT22
50 lapply (tw_lift … HT) -HT #HT
51 elim (IH … HT202 … HT22) -HT202 HT22 IH /3/
54 lemma tpr_conf_flat_flat:
55 ∀I1,V11,V12,T11,T12,V22,T22. (
56 ∀T1. #T1 < #V11 + #T11 + 1 →
57 ∀T3,T4. T1 ⇒ T3 → T1 ⇒ T4 →
58 ∃∃T0. T3 ⇒ T0 & T4 ⇒ T0
60 V11 ⇒ V12 → T11 ⇒ T12 →
61 V11 ⇒ V22 → T11 ⇒ T22 →
62 ∃∃T0. 𝕗{I1} V12. T12 ⇒ T0 & 𝕗{I1} V22. T22 ⇒ T0.
63 #I1 #V11 #V12 #T11 #T12 #V22 #T22 #IH #HV1 #HT1 #HV2 #HT2
64 elim (IH … HV1 … HV2) -HV1 HV2 // #V #HV1 #HV2
65 elim (IH … HT1 … HT2) -HT1 HT2 // #T #HT1 #HT2
69 (* Confluence ***************************************************************)
73 ∀T1. #T1 < #T → ∀T3,T4. T1 ⇒ T3 → T1 ⇒ T4 →
74 ∃∃T0. T3 ⇒ T0 & T4 ⇒ T0
76 ∀U1,T1,U2,T2. U1 ⇒ T1 → U2 ⇒ T2 →
78 ∃∃T0. T1 ⇒ T0 & T2 ⇒ T0.
79 #T #IH #U1 #T1 #U2 #T2
82 (* case 1: sort, sort *)
83 [ #k2 #H1 #H2 destruct -T k2 //
84 (* case 2: sort, lref (excluded) *)
85 | #i2 #H1 #H2 destruct
86 (* case 3: sort, bind (excluded) *)
87 | #I2 #V21 #V22 #T21 #T22 #_ #_ #H1 #H2 destruct
88 (* case 4: sort, flat (excluded) *)
89 | #I2 #V21 #V22 #T21 #T22 #_ #_ #H1 #H2 destruct
90 (* case 5: sort, beta (excluded) *)
91 | #V21 #V22 #W2 #T21 #T22 #_ #_ #H1 #H2 destruct
92 (* case 6: sort, delta (excluded) *)
93 | #V21 #V22 #T21 #T22 #T20 #_ #_ #_ #H1 #H2 destruct
94 (* case 7: sort, theta (excluded) *)
95 | #V2 #V21 #V22 #W21 #W22 #T21 #T22 #_ #_ #_ #_ #H1 #H2 destruct
96 (* case 8: sort, zeta (excluded) *)
97 | #V2 #T21 #T22 #T20 #_ #_ #H1 #H2 destruct
98 (* case 9: sort, tau (excluded) *)
99 | #V2 #T21 #T22 #_ #H1 #H2 destruct
102 (* case 10: lref, sort (excluded) broken *)
103 [ #k2 #H1 #H2 destruct
104 (* case 11: lref, sort (excluded) *)
105 | #i2 #H1 #H2 destruct -T i2 //
106 (* case 12: lref, bind (excluded) *)
107 | #I2 #V21 #V22 #T21 #T22 #_ #_ #H1 #H2 destruct
108 (* case 13: lref, flat (excluded) *)
109 | #I2 #V21 #V22 #T21 #T22 #_ #_ #H1 #H2 destruct
110 (* case 14: lref, beta (excluded) *)
111 | #V21 #V22 #W2 #T21 #T22 #_ #_ #H1 #H2 destruct
112 (* case 15: lref, delta (excluded) *)
113 | #V21 #V22 #T21 #T22 #T20 #_ #_ #_ #H1 #H2 destruct
114 (* case 16: lref, theta (excluded) *)
115 | #V2 #V21 #V22 #W21 #W22 #T21 #T22 #_ #_ #_ #_ #H1 #H2 destruct
116 (* case 17: lref, zeta (excluded) *)
117 | #V2 #T21 #T22 #T20 #_ #_ #H1 #H2 destruct
118 (* case 18: lref, tau (excluded) *)
119 | #V2 #T21 #T22 #_ #H1 #H2 destruct
121 | #I1 #V11 #V12 #T11 #T12 #HV112 #HT112 * -U2 T2
122 (* case 19: bind, sort (excluded) *)
123 [ #k2 #H1 #H2 destruct
124 (* case 20: bind, lref (excluded) *)
125 | #i2 #H1 #H2 destruct
126 (* case 21: bind, bind *)
127 | #I2 #V21 #V22 #T21 #T22 #HV212 #HT212 #H1 #H2
128 destruct -T I2 V21 T21 /3 width=7/
129 (* case 22: bind, flat (excluded) *)
130 | #I2 #V21 #V22 #T21 #T22 #_ #_ #H1 #H2 destruct
131 (* case 23: bind, beta (excluded) *)
132 | #V21 #V22 #W2 #T21 #T22 #_ #_ #H1 #H2 destruct
133 (* case 24: bind, delta (excluded) *)
134 | #V21 #V22 #T21 #T22 #T20 #_ #_ #_ #H1 #H2 destruct
135 (* case 25: bind, theta (excluded) *)
136 | #V2 #V21 #V22 #W21 #W22 #T21 #T22 #_ #_ #_ #_ #H1 #H2 destruct
137 (* case 26: bind, zeta *)
138 | #V2 #T21 #T22 #T20 #HT212 #HT220 #H1 #H2
139 destruct -I1 V2 T21 T /3 width=8/
140 (* case 27: bind, tau (excluded) *)
141 | #V2 #T21 #T22 #_ #H1 #H2 destruct
143 | #I1 #V11 #V12 #T11 #T12 #HV112 #HT112 * -U2 T2
144 (* case 28: flat, sort (excluded) *)
145 [ #k2 #H1 #H2 destruct
146 (* case 29: flat, lref (excluded) *)
147 | #i2 #H1 #H2 destruct
148 (* case 30: flat, bind (excluded) *)
149 | #I2 #V21 #V22 #T21 #T22 #_ #_ #H1 #H2 destruct
150 (* case 31: flat, flat *)
151 | #I2 #V21 #V22 #T21 #T22 #HV212 #HT212 #H1 #H2
152 destruct -T I2 V21 T21 /3 width=7/
153 (* case 32: flat, beta *)
154 | #V21 #V22 #W2 #T21 #T22 #HV212 #HT212 #H1 #H2
155 destruct -I1 V21 T11 T;
157 theorem pr_conf: ∀T,T1,T2. T ⇒ T1 → T ⇒ T2 →
158 ∃∃T0. T1 ⇒ T0 & T2 ⇒ T0.
159 #T @(tw_wf_ind … T) -T /3 width=8/