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