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