]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/reduction/lpr_lpr.ma
partial commit: just the components before "static" ...
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / reduction / lpr_lpr.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "basic_2/grammar/lpx_sn_lpx_sn.ma".
16 include "basic_2/substitution/fsupp.ma".
17 include "basic_2/reduction/lpr_ldrop.ma".
18
19 (* SN PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS *****************************)
20
21 (* Main properties on context-sensitive parallel reduction for terms ********)
22
23 fact cpr_conf_lpr_atom_atom:
24    ∀I,L1,L2. ∃∃T. L1 ⊢ ⓪{I} ➡ T & L2 ⊢ ⓪{I} ➡ T.
25 /2 width=3/ qed-.
26
27 fact cpr_conf_lpr_atom_delta:
28    ∀L0,i. (
29       ∀L,T. ⦃L0, #i⦄ ⊃+ ⦃L, T⦄ →
30       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
31       ∀L1. ⦃G, L⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
32       ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
33    ) →
34    ∀K0,V0. ⇩[O, i] L0 ≡ K0.ⓓV0 →
35    ∀V2. K0 ⊢ V0 ➡ V2 → ∀T2. ⇧[O, i + 1] V2 ≡ T2 →
36    ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
37    ∃∃T. L1 ⊢ #i ➡ T & L2 ⊢ T2 ➡ T.
38 #L0 #i #IH #K0 #V0 #HLK0 #V2 #HV02 #T2 #HVT2 #L1 #HL01 #L2 #HL02
39 elim (lpr_ldrop_conf … HLK0 … HL01) -HL01 #X1 #H1 #HLK1
40 elim (lpr_inv_pair1 … H1) -H1 #K1 #V1 #HK01 #HV01 #H destruct
41 elim (lpr_ldrop_conf … HLK0 … HL02) -HL02 #X2 #H2 #HLK2
42 elim (lpr_inv_pair1 … H2) -H2 #K2 #W2 #HK02 #_ #H destruct
43 lapply (ldrop_fwd_ldrop2 … HLK2) -W2 #HLK2
44 lapply (fsupp_lref … HLK0) -HLK0 #HLK0
45 elim (IH … HLK0 … HV01 … HV02 … HK01 … HK02) -L0 -K0 -V0 #V #HV1 #HV2
46 elim (lift_total V 0 (i+1)) #T #HVT
47 lapply (cpr_lift … HV2 … HLK2 … HVT2 … HVT) -K2 -V2 /3 width=6/
48 qed-.
49
50 (* Basic_1: includes: pr0_delta_delta pr2_delta_delta *)
51 fact cpr_conf_lpr_delta_delta:
52    ∀L0,i. (
53       ∀L,T. ⦃L0, #i⦄ ⊃+ ⦃L, T⦄ →
54       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
55       ∀L1. ⦃G, L⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
56       ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
57    ) →
58    ∀K0,V0. ⇩[O, i] L0 ≡ K0.ⓓV0 →
59    ∀V1. K0 ⊢ V0 ➡ V1 → ∀T1. ⇧[O, i + 1] V1 ≡ T1 →
60    ∀KX,VX. ⇩[O, i] L0 ≡ KX.ⓓVX →
61    ∀V2. KX ⊢ VX ➡ V2 → ∀T2. ⇧[O, i + 1] V2 ≡ T2 →
62    ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
63    ∃∃T. L1 ⊢ T1 ➡ T & L2 ⊢ T2 ➡ T.
64 #L0 #i #IH #K0 #V0 #HLK0 #V1 #HV01 #T1 #HVT1
65 #KX #VX #H #V2 #HV02 #T2 #HVT2 #L1 #HL01 #L2 #HL02
66 lapply (ldrop_mono … H … HLK0) -H #H destruct
67 elim (lpr_ldrop_conf … HLK0 … HL01) -HL01 #X1 #H1 #HLK1
68 elim (lpr_inv_pair1 … H1) -H1 #K1 #W1 #HK01 #_ #H destruct
69 lapply (ldrop_fwd_ldrop2 … HLK1) -W1 #HLK1
70 elim (lpr_ldrop_conf … HLK0 … HL02) -HL02 #X2 #H2 #HLK2
71 elim (lpr_inv_pair1 … H2) -H2 #K2 #W2 #HK02 #_ #H destruct
72 lapply (ldrop_fwd_ldrop2 … HLK2) -W2 #HLK2
73 lapply (fsupp_lref … HLK0) -HLK0 #HLK0
74 elim (IH … HLK0 … HV01 … HV02 … HK01 … HK02) -L0 -K0 -V0 #V #HV1 #HV2
75 elim (lift_total V 0 (i+1)) #T #HVT
76 lapply (cpr_lift … HV1 … HLK1 … HVT1 … HVT) -K1 -V1
77 lapply (cpr_lift … HV2 … HLK2 … HVT2 … HVT) -K2 -V2 -V /2 width=3/
78 qed-.
79
80 fact cpr_conf_lpr_bind_bind:
81    ∀a,I,L0,V0,T0. (
82       ∀L,T. ⦃L0,ⓑ{a,I}V0.T0⦄ ⊃+ ⦃L, T⦄ →
83       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
84       ∀L1. ⦃G, L⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
85       ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
86    ) →
87    ∀V1. L0 ⊢ V0 ➡ V1 → ∀T1. L0.ⓑ{I}V0 ⊢ T0 ➡ T1 →
88    ∀V2. L0 ⊢ V0 ➡ V2 → ∀T2. L0.ⓑ{I}V0 ⊢ T0 ➡ T2 →
89    ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
90    ∃∃T. L1 ⊢ ⓑ{a,I}V1.T1 ➡ T & L2 ⊢ ⓑ{a,I}V2.T2 ➡ T.
91 #a #I #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01
92 #V2 #HV02 #T2 #HT02 #L1 #HL01 #L2 #HL02
93 elim (IH … HV01 … HV02 … HL01 … HL02) //
94 elim (IH … HT01 … HT02 (L1.ⓑ{I}V1) … (L2.ⓑ{I}V2)) -IH // /2 width=1/ /3 width=5/
95 qed-.
96
97 fact cpr_conf_lpr_bind_zeta:
98    ∀L0,V0,T0. (
99       ∀L,T. ⦃L0,+ⓓV0.T0⦄ ⊃+ ⦃L, T⦄ →
100       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
101       ∀L1. ⦃G, L⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
102       ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
103    ) →
104    ∀V1. L0 ⊢ V0 ➡ V1 → ∀T1. L0.ⓓV0 ⊢ T0 ➡ T1 →
105    ∀T2. L0.ⓓV0 ⊢ T0 ➡ T2 → ∀X2. ⇧[O, 1] X2 ≡ T2 →
106    ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
107    ∃∃T. L1 ⊢ +ⓓV1.T1 ➡ T & L2 ⊢ X2 ➡ T.
108 #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01
109 #T2 #HT02 #X2 #HXT2 #L1 #HL01 #L2 #HL02
110 elim (IH … HT01 … HT02 (L1.ⓓV1) … (L2.ⓓV1)) -IH -HT01 -HT02 // /2 width=1/ -L0 -V0 -T0 #T #HT1 #HT2
111 elim (cpr_inv_lift1 … HT2 L2 … HXT2) -T2 /2 width=1/ /3 width=3/
112 qed-.
113
114 fact cpr_conf_lpr_zeta_zeta:
115    ∀L0,V0,T0. (
116       ∀L,T. ⦃L0,+ⓓV0.T0⦄ ⊃+ ⦃L, T⦄ →
117       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
118       ∀L1. ⦃G, L⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
119       ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
120    ) →
121    ∀T1. L0.ⓓV0 ⊢ T0 ➡ T1 → ∀X1. ⇧[O, 1] X1 ≡ T1 →
122    ∀T2. L0.ⓓV0 ⊢ T0 ➡ T2 → ∀X2. ⇧[O, 1] X2 ≡ T2 →
123    ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
124    ∃∃T. L1 ⊢ X1 ➡ T & L2 ⊢ X2 ➡ T.
125 #L0 #V0 #T0 #IH #T1 #HT01 #X1 #HXT1
126 #T2 #HT02 #X2 #HXT2 #L1 #HL01 #L2 #HL02
127 elim (IH … HT01 … HT02 (L1.ⓓV0) … (L2.ⓓV0)) -IH -HT01 -HT02 // /2 width=1/ -L0 -T0 #T #HT1 #HT2
128 elim (cpr_inv_lift1 … HT1 L1 … HXT1) -T1 /2 width=1/ #T1 #HT1 #HXT1
129 elim (cpr_inv_lift1 … HT2 L2 … HXT2) -T2 /2 width=1/ #T2 #HT2 #HXT2 
130 lapply (lift_inj … HT2 … HT1) -T #H destruct /2 width=3/
131 qed-.
132
133 fact cpr_conf_lpr_flat_flat:
134    ∀I,L0,V0,T0. (
135       ∀L,T. ⦃L0,ⓕ{I}V0.T0⦄ ⊃+ ⦃L, T⦄ →
136       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
137       ∀L1. ⦃G, L⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
138       ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
139    ) →
140    ∀V1. L0 ⊢ V0 ➡ V1 → ∀T1. L0 ⊢ T0 ➡ T1 →
141    ∀V2. L0 ⊢ V0 ➡ V2 → ∀T2. L0 ⊢ T0 ➡ T2 →
142    ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
143    ∃∃T. L1 ⊢ ⓕ{I}V1.T1 ➡ T & L2 ⊢ ⓕ{I}V2.T2 ➡ T.
144 #I #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01
145 #V2 #HV02 #T2 #HT02 #L1 #HL01 #L2 #HL02
146 elim (IH … HV01 … HV02 … HL01 … HL02) //
147 elim (IH … HT01 … HT02 … HL01 … HL02) // /3 width=5/
148 qed-.
149
150 fact cpr_conf_lpr_flat_tau:
151    ∀L0,V0,T0. (
152       ∀L,T. ⦃L0,ⓝV0.T0⦄ ⊃+ ⦃L, T⦄ →
153       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
154       ∀L1. ⦃G, L⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
155       ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
156    ) →
157    ∀V1,T1. L0 ⊢ T0 ➡ T1 → ∀T2. L0 ⊢ T0 ➡ T2 →
158    ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
159    ∃∃T. L1 ⊢ ⓝV1.T1 ➡ T & L2 ⊢ T2 ➡ T.
160 #L0 #V0 #T0 #IH #V1 #T1 #HT01
161 #T2 #HT02 #L1 #HL01 #L2 #HL02
162 elim (IH … HT01 … HT02 … HL01 … HL02) // -L0 -V0 -T0 /3 width=3/
163 qed-.
164
165 fact cpr_conf_lpr_tau_tau:
166    ∀L0,V0,T0. (
167       ∀L,T. ⦃L0,ⓝV0.T0⦄ ⊃+ ⦃L, T⦄ →
168       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
169       ∀L1. ⦃G, L⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
170       ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
171    ) →
172    ∀T1. L0 ⊢ T0 ➡ T1 → ∀T2. L0 ⊢ T0 ➡ T2 →
173    ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
174    ∃∃T. L1 ⊢ T1 ➡ T & L2 ⊢ T2 ➡ T.
175 #L0 #V0 #T0 #IH #T1 #HT01
176 #T2 #HT02 #L1 #HL01 #L2 #HL02
177 elim (IH … HT01 … HT02 … HL01 … HL02) // -L0 -V0 -T0 /2 width=3/
178 qed-.
179
180 fact cpr_conf_lpr_flat_beta:
181    ∀a,L0,V0,W0,T0. (
182       ∀L,T. ⦃L0,ⓐV0.ⓛ{a}W0.T0⦄ ⊃+ ⦃L, T⦄ →
183       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
184       ∀L1. ⦃G, L⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
185       ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
186    ) →
187    ∀V1. L0 ⊢ V0 ➡ V1 → ∀T1. L0 ⊢ ⓛ{a}W0.T0 ➡ T1 →
188    ∀V2. L0 ⊢ V0 ➡ V2 → ∀W2. L0 ⊢ W0 ➡ W2 → ∀T2. L0.ⓛW0 ⊢ T0 ➡ T2 →
189    ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
190    ∃∃T. L1 ⊢ ⓐV1.T1 ➡ T & L2 ⊢ ⓓ{a}ⓝW2.V2.T2 ➡ T.
191 #a #L0 #V0 #W0 #T0 #IH #V1 #HV01 #X #H
192 #V2 #HV02 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02
193 elim (cpr_inv_abst1 … H) -H #W1 #T1 #HW01 #HT01 #H destruct
194 elim (IH … HV01 … HV02 … HL01 … HL02) -HV01 -HV02 /2 width=1/ #V #HV1 #HV2
195 elim (IH … HW01 … HW02 … HL01 … HL02) /2 width=1/ #W #HW1 #HW2
196 elim (IH … HT01 … HT02 (L1.ⓛW1) … (L2.ⓛW2)) /2 width=1/ -L0 -V0 -W0 -T0 #T #HT1 #HT2
197 lapply (lsubr_cpr_trans … HT2 (L2.ⓓⓝW2.V2) ?) -HT2 /2 width=1/
198 /4 width=5 by cpr_bind, cpr_flat, cpr_beta, ex2_intro/ (**) (* auto too slow without trace *)
199 qed-.
200
201 (* Basic-1: includes:
202             pr0_cong_upsilon_refl pr0_cong_upsilon_zeta
203             pr0_cong_upsilon_cong pr0_cong_upsilon_delta
204 *)
205 fact cpr_conf_lpr_flat_theta:
206    ∀a,L0,V0,W0,T0. (
207       ∀L,T. ⦃L0,ⓐV0.ⓓ{a}W0.T0⦄ ⊃+ ⦃L, T⦄ →
208       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
209       ∀L1. ⦃G, L⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
210       ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
211    ) →
212    ∀V1. L0 ⊢ V0 ➡ V1 → ∀T1. L0 ⊢ ⓓ{a}W0.T0 ➡ T1 →
213    ∀V2. L0 ⊢ V0 ➡ V2 → ∀U2. ⇧[O, 1] V2 ≡ U2 →
214    ∀W2. L0 ⊢ W0 ➡ W2 → ∀T2. L0.ⓓW0 ⊢ T0 ➡ T2 →
215    ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
216    ∃∃T. L1 ⊢ ⓐV1.T1 ➡ T & L2 ⊢ ⓓ{a}W2.ⓐU2.T2 ➡ T.
217 #a #L0 #V0 #W0 #T0 #IH #V1 #HV01 #X #H
218 #V2 #HV02 #U2 #HVU2 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02
219 elim (IH … HV01 … HV02 … HL01 … HL02) -HV01 -HV02 /2 width=1/ #V #HV1 #HV2
220 elim (lift_total V 0 1) #U #HVU
221 lapply (cpr_lift … HV2 (L2.ⓓW2) … HVU2 … HVU) -HVU2 /2 width=1/ #HU2
222 elim (cpr_inv_abbr1 … H) -H *
223 [ #W1 #T1 #HW01 #HT01 #H destruct
224   elim (IH … HW01 … HW02 … HL01 … HL02) /2 width=1/
225   elim (IH … HT01 … HT02 (L1.ⓓW1) … (L2.ⓓW2)) /2 width=1/ -L0 -V0 -W0 -T0
226   /4 width=7 by cpr_bind, cpr_flat, cpr_theta, ex2_intro/ (**) (* timeout=35 *)
227 | #T1 #HT01 #HXT1 #H destruct
228   elim (IH … HT01 … HT02 (L1.ⓓW2) … (L2.ⓓW2)) /2 width=1/ -L0 -V0 -W0 -T0 #T #HT1 #HT2
229   elim (cpr_inv_lift1 … HT1 L1 … HXT1) -HXT1 /2 width=1/ #Y #HYT #HXY
230   @(ex2_intro … (ⓐV.Y)) /2 width=1/ /3 width=5/ (**) (* auto /4 width=9/ is too slow *)
231
232 qed-.
233
234 fact cpr_conf_lpr_beta_beta:
235    ∀a,L0,V0,W0,T0. (
236       ∀L,T. ⦃L0,ⓐV0.ⓛ{a}W0.T0⦄ ⊃+ ⦃L, T⦄ →
237       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
238       ∀L1. ⦃G, L⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
239       ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
240    ) →
241    ∀V1. L0 ⊢ V0 ➡ V1 → ∀W1. L0 ⊢ W0 ➡ W1 → ∀T1. L0.ⓛW0 ⊢ T0 ➡ T1 →
242    ∀V2. L0 ⊢ V0 ➡ V2 → ∀W2. L0 ⊢ W0 ➡ W2 → ∀T2. L0.ⓛW0 ⊢ T0 ➡ T2 →
243    ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
244    ∃∃T. L1 ⊢ ⓓ{a}ⓝW1.V1.T1 ➡ T & L2 ⊢ ⓓ{a}ⓝW2.V2.T2 ➡ T.
245 #a #L0 #V0 #W0 #T0 #IH #V1 #HV01 #W1 #HW01 #T1 #HT01
246 #V2 #HV02 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02
247 elim (IH … HV01 … HV02 … HL01 … HL02) -HV01 -HV02 /2 width=1/ #V #HV1 #HV2
248 elim (IH … HW01 … HW02 … HL01 … HL02) /2 width=1/ #W #HW1 #HW2
249 elim (IH … HT01 … HT02 (L1.ⓛW1) … (L2.ⓛW2)) /2 width=1/ -L0 -V0 -W0 -T0 #T #HT1 #HT2
250 lapply (lsubr_cpr_trans … HT1 (L1.ⓓⓝW1.V1) ?) -HT1 /2 width=1/
251 lapply (lsubr_cpr_trans … HT2 (L2.ⓓⓝW2.V2) ?) -HT2 /2 width=1/
252 /4 width=5 by cpr_bind, cpr_flat, ex2_intro/
253 qed-.
254
255 (* Basic_1: was: pr0_upsilon_upsilon *)
256 fact cpr_conf_lpr_theta_theta:
257    ∀a,L0,V0,W0,T0. (
258       ∀L,T. ⦃L0,ⓐV0.ⓓ{a}W0.T0⦄ ⊃+ ⦃L, T⦄ →
259       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
260       ∀L1. ⦃G, L⦄ ⊢ ➡ L1 → ∀L2. ⦃G, L⦄ ⊢ ➡ L2 →
261       ∃∃T0. L1 ⊢ T1 ➡ T0 & L2 ⊢ T2 ➡ T0
262    ) →
263    ∀V1. L0 ⊢ V0 ➡ V1 → ∀U1. ⇧[O, 1] V1 ≡ U1 →
264    ∀W1. L0 ⊢ W0 ➡ W1 → ∀T1. L0.ⓓW0 ⊢ T0 ➡ T1 →
265    ∀V2. L0 ⊢ V0 ➡ V2 → ∀U2. ⇧[O, 1] V2 ≡ U2 →
266    ∀W2. L0 ⊢ W0 ➡ W2 → ∀T2. L0.ⓓW0 ⊢ T0 ➡ T2 →
267    ∀L1. L0 ⊢ ➡ L1 → ∀L2. L0 ⊢ ➡ L2 →
268    ∃∃T. L1 ⊢ ⓓ{a}W1.ⓐU1.T1 ➡ T & L2 ⊢ ⓓ{a}W2.ⓐU2.T2 ➡ T.
269 #a #L0 #V0 #W0 #T0 #IH #V1 #HV01 #U1 #HVU1 #W1 #HW01 #T1 #HT01
270 #V2 #HV02 #U2 #HVU2 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02
271 elim (IH … HV01 … HV02 … HL01 … HL02) -HV01 -HV02 /2 width=1/ #V #HV1 #HV2
272 elim (IH … HW01 … HW02 … HL01 … HL02) /2 width=1/
273 elim (IH … HT01 … HT02 (L1.ⓓW1) … (L2.ⓓW2)) /2 width=1/ -L0 -V0 -W0 -T0
274 elim (lift_total V 0 1) #U #HVU
275 lapply (cpr_lift … HV1 (L1.ⓓW1) … HVU1 … HVU) -HVU1 /2 width=1/
276 lapply (cpr_lift … HV2 (L2.ⓓW2) … HVU2 … HVU) -HVU2 /2 width=1/
277 /4 width=7 by cpr_bind, cpr_flat, ex2_intro/ (**) (* timeout 40 *)
278 qed-.
279
280 theorem cpr_conf_lpr: lpx_sn_confluent cpr cpr.
281 #L0 #T0 @(fsupp_wf_ind … L0 T0) -L0 -T0 #L #T #IH #L0 * [|*]
282 [ #I0 #HL #HT #T1 #H1 #T2 #H2 #L1 #HL01 #L2 #HL02 destruct
283   elim (cpr_inv_atom1 … H1) -H1
284   elim (cpr_inv_atom1 … H2) -H2
285   [ #H2 #H1 destruct
286     /2 width=1 by cpr_conf_lpr_atom_atom/
287   | * #K0 #V0 #V2 #i2 #HLK0 #HV02 #HVT2 #H2 #H1 destruct
288     /3 width=10 by cpr_conf_lpr_atom_delta/
289   | #H2 * #K0 #V0 #V1 #i1 #HLK0 #HV01 #HVT1 #H1 destruct
290     /4 width=10 by ex2_commute, cpr_conf_lpr_atom_delta/
291   | * #X #Y #V2 #z #H #HV02 #HVT2 #H2
292     * #K0 #V0 #V1 #i #HLK0 #HV01 #HVT1 #H1 destruct
293     /3 width=17 by cpr_conf_lpr_delta_delta/
294   ]
295 | #a #I #V0 #T0 #HL #HT #X1 #H1 #X2 #H2 #L1 #HL01 #L2 #HL02 destruct
296   elim (cpr_inv_bind1 … H1) -H1 *
297   [ #V1 #T1 #HV01 #HT01 #H1
298   | #T1 #HT01 #HXT1 #H11 #H12
299   ]
300   elim (cpr_inv_bind1 … H2) -H2 *
301   [1,3: #V2 #T2 #HV02 #HT02 #H2
302   |2,4: #T2 #HT02 #HXT2 #H21 #H22
303   ] destruct
304   [ /3 width=10 by cpr_conf_lpr_bind_bind/
305   | /4 width=11 by ex2_commute, cpr_conf_lpr_bind_zeta/
306   | /3 width=11 by cpr_conf_lpr_bind_zeta/
307   | /3 width=12 by cpr_conf_lpr_zeta_zeta/
308   ]
309 | #I #V0 #T0 #HL #HT #X1 #H1 #X2 #H2 #L1 #HL01 #L2 #HL02 destruct
310   elim (cpr_inv_flat1 … H1) -H1 *
311   [ #V1 #T1 #HV01 #HT01 #H1
312   | #HX1 #H1
313   | #a1 #V1 #Y1 #W1 #Z1 #T1 #HV01 #HYW1 #HZT1 #H11 #H12 #H13
314   | #a1 #V1 #U1 #Y1 #W1 #Z1 #T1 #HV01 #HVU1 #HYW1 #HZT1 #H11 #H12 #H13
315   ]
316   elim (cpr_inv_flat1 … H2) -H2 *
317   [1,5,9,13: #V2 #T2 #HV02 #HT02 #H2
318   |2,6,10,14: #HX2 #H2
319   |3,7,11,15: #a2 #V2 #Y2 #W2 #Z2 #T2 #HV02 #HYW2 #HZT2 #H21 #H22 #H23
320   |4,8,12,16: #a2 #V2 #U2 #Y2 #W2 #Z2 #T2 #HV02 #HVU2 #HYW2 #HZT2 #H21 #H22 #H23
321   ] destruct
322   [ /3 width=10 by cpr_conf_lpr_flat_flat/
323   | /4 width=8 by ex2_commute, cpr_conf_lpr_flat_tau/
324   | /4 width=12 by ex2_commute, cpr_conf_lpr_flat_beta/
325   | /4 width=14 by ex2_commute, cpr_conf_lpr_flat_theta/
326   | /3 width=8 by cpr_conf_lpr_flat_tau/
327   | /3 width=7 by cpr_conf_lpr_tau_tau/
328   | /3 width=12 by cpr_conf_lpr_flat_beta/
329   | /3 width=13 by cpr_conf_lpr_beta_beta/
330   | /3 width=14 by cpr_conf_lpr_flat_theta/
331   | /3 width=17 by cpr_conf_lpr_theta_theta/
332   ]
333 ]
334 qed-.
335
336 (* Basic_1: includes: pr0_confluence pr2_confluence *)
337 theorem cpr_conf: ∀L. confluent … (cpr L).
338 /2 width=6 by cpr_conf_lpr/ qed-.
339
340 (* Properties on context-sensitive parallel reduction for terms *************)
341
342 lemma lpr_cpr_conf_dx: ∀L0,T0,T1. L0 ⊢ T0 ➡ T1 → ∀L1. L0 ⊢ ➡ L1 →
343                        ∃∃T. L1 ⊢ T0 ➡ T & L1 ⊢ T1 ➡ T.
344 #L0 #T0 #T1 #HT01 #L1 #HL01
345 elim (cpr_conf_lpr … HT01 T0 … HL01 … HL01) // -L0 /2 width=3/
346 qed-.
347
348 lemma lpr_cpr_conf_sn: ∀L0,T0,T1. L0 ⊢ T0 ➡ T1 → ∀L1. L0 ⊢ ➡ L1 →
349                        ∃∃T. L1 ⊢ T0 ➡ T & L0 ⊢ T1 ➡ T.
350 #L0 #T0 #T1 #HT01 #L1 #HL01
351 elim (cpr_conf_lpr … HT01 T0 … L0 … HL01) // -HT01 -HL01 /2 width=3/
352 qed-.
353
354 (* Main properties **********************************************************)
355
356 theorem lpr_conf: confluent … lpr.
357 /3 width=6 by lpx_sn_conf, cpr_conf_lpr/
358 qed-.