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