]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/etc_2A1/llpr/llpr_llpr.etc
update in binaries for λδ
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / etc_2A1 / llpr / llpr_llpr.etc
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/relocation/llpx_sn_llpx_sn.ma".
16 include "basic_2/substitution/fqup.ma".
17 include "basic_2/reduction/llpr_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_llpr_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_llpr_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⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] 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⦄ ⊢ ➡[#i, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[#i, 0] 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 (llpr_inv_lref_ge_sn … HL01 … HLK0) -HL01 // #K1 #V1 #HLK1 #HK01 #HV01
40 elim (llpr_inv_lref_ge_sn … HL02 … HLK0) -HL02 // #K2 #W2 #HLK2 #HK02 #_
41 lapply (ldrop_fwd_drop2 … HLK2) -W2 #HLK2
42 lapply (fqup_lref … G … HLK0) -HLK0 #HLK0
43 elim (IH … HLK0 … HV01 … HV02 … HK01 … HK02) -L0 -K0 -V0 #V #HV1 #HV2
44 elim (lift_total V 0 (i+1))
45 /3 width=12 by cpr_lift, cpr_delta, ex2_intro/
46 qed-.
47
48 (* Basic_1: includes: pr0_delta_delta pr2_delta_delta *)
49 fact cpr_conf_llpr_delta_delta:
50    ∀G,L0,i. (
51       ∀L,T. ⦃G, L0, #i⦄ ⊃+ ⦃G, L, T⦄ →
52       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
53       ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 →
54       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
55    ) →
56    ∀K0,V0. ⇩[i] L0 ≡ K0.ⓓV0 →
57    ∀V1. ⦃G, K0⦄ ⊢ V0 ➡ V1 → ∀T1. ⇧[O, i + 1] V1 ≡ T1 →
58    ∀KX,VX. ⇩[i] L0 ≡ KX.ⓓVX →
59    ∀V2. ⦃G, KX⦄ ⊢ VX ➡ V2 → ∀T2. ⇧[O, i + 1] V2 ≡ T2 →
60    ∀L1. ⦃G, L0⦄ ⊢ ➡[#i, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[#i, 0] L2 →
61    ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡ T & ⦃G, L2⦄ ⊢ T2 ➡ T.
62 #G #L0 #i #IH #K0 #V0 #HLK0 #V1 #HV01 #T1 #HVT1
63 #KX #VX #H #V2 #HV02 #T2 #HVT2 #L1 #HL01 #L2 #HL02
64 lapply (ldrop_mono … H … HLK0) -H #H destruct
65 elim (llpr_inv_lref_ge_sn … HL01 … HLK0) -HL01 // #K1 #W1 #HLK1 #HK01 #_
66 lapply (ldrop_fwd_drop2 … HLK1) -W1 #HLK1
67 elim (llpr_inv_lref_ge_sn … HL02 … HLK0) -HL02 // #K2 #W2 #HLK2 #HK02 #_
68 lapply (ldrop_fwd_drop2 … HLK2) -W2 #HLK2
69 lapply (fqup_lref … G … HLK0) -HLK0 #HLK0
70 elim (IH … HLK0 … HV01 … HV02 … HK01 … HK02) -L0 -K0 -V0 #V #HV1 #HV2
71 elim (lift_total V 0 (i+1)) /3 width=12 by cpr_lift, ex2_intro/
72 qed-.
73
74 fact cpr_conf_llpr_bind_bind:
75    ∀a,I,G,L0,V0,T0. (
76       ∀L,T. ⦃G, L0, ⓑ{a,I}V0.T0⦄ ⊃+ ⦃G, L, T⦄ →
77       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
78       ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 →
79       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
80    ) →
81    ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀T1. ⦃G, L0.ⓑ{I}V0⦄ ⊢ T0 ➡ T1 →
82    ∀V2. ⦃G, L0⦄ ⊢ V0 ➡ V2 → ∀T2. ⦃G, L0.ⓑ{I}V0⦄ ⊢ T0 ➡ T2 →
83    ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓑ{a,I}V0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓑ{a,I}V0.T0, 0] L2 →
84    ∃∃T. ⦃G, L1⦄ ⊢ ⓑ{a,I}V1.T1 ➡ T & ⦃G, L2⦄ ⊢ ⓑ{a,I}V2.T2 ➡ T.
85 #a #I #G #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01
86 #V2 #HV02 #T2 #HT02 #L1 #HL01 #L2 #HL02
87 elim (llpr_inv_bind_O … HL01) -HL01 #H1V0 #H1T0
88 elim (llpr_inv_bind_O … HL02) -HL02 #H2V0 #H2T0
89 elim (IH … HV01 … HV02 … H1V0 … H2V0) //
90 elim (IH … HT01 … HT02 (L1.ⓑ{I}V1) … (L2.ⓑ{I}V2)) -IH
91 /3 width=5 by llpr_bind_repl_O, cpr_bind, ex2_intro/
92 qed-.
93
94 fact cpr_conf_llpr_bind_zeta:
95    ∀G,L0,V0,T0. (
96       ∀L,T. ⦃G, L0, +ⓓV0.T0⦄ ⊃+ ⦃G, L, T⦄ →
97       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
98       ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 →
99       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
100    ) →
101    ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀T1. ⦃G, L0.ⓓV0⦄ ⊢ T0 ➡ T1 →
102    ∀T2. ⦃G, L0.ⓓV0⦄ ⊢ T0 ➡ T2 → ∀X2. ⇧[O, 1] X2 ≡ T2 →
103    ∀L1. ⦃G, L0⦄ ⊢ ➡[+ⓓV0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[+ⓓV0.T0, 0] L2 →
104    ∃∃T. ⦃G, L1⦄ ⊢ +ⓓV1.T1 ➡ T & ⦃G, L2⦄ ⊢ X2 ➡ T.
105 #G #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01
106 #T2 #HT02 #X2 #HXT2 #L1 #HL01 #L2 #HL02
107 elim (llpr_inv_bind_O … HL01) -HL01 #H1V0 #H1T0
108 elim (llpr_inv_bind_O … HL02) -HL02 #H2V0 #H2T0
109 elim (IH … HT01 … HT02 (L1.ⓓV1) … (L2.ⓓV1)) -IH -HT01 -HT02 /2 width=4 by llpr_bind_repl_O/ -L0 -V0 -T0 #T #HT1 #HT2
110 elim (cpr_inv_lift1 … HT2 L2 … HXT2) -T2 /3 width=3 by cpr_zeta, ldrop_drop, ex2_intro/
111 qed-.
112
113 fact cpr_conf_llpr_zeta_zeta:
114    ∀G,L0,V0,T0. (
115       ∀L,T. ⦃G, L0, +ⓓV0.T0⦄ ⊃+ ⦃G, L, T⦄ →
116       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
117       ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 →
118       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
119    ) →
120    ∀T1. ⦃G, L0.ⓓV0⦄ ⊢ T0 ➡ T1 → ∀X1. ⇧[O, 1] X1 ≡ T1 →
121    ∀T2. ⦃G, L0.ⓓV0⦄ ⊢ T0 ➡ T2 → ∀X2. ⇧[O, 1] X2 ≡ T2 →
122    ∀L1. ⦃G, L0⦄ ⊢ ➡[+ⓓV0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[+ⓓV0.T0, 0] L2 →
123    ∃∃T. ⦃G, L1⦄ ⊢ X1 ➡ T & ⦃G, L2⦄ ⊢ X2 ➡ T.
124 #G #L0 #V0 #T0 #IH #T1 #HT01 #X1 #HXT1
125 #T2 #HT02 #X2 #HXT2 #L1 #HL01 #L2 #HL02
126 elim (llpr_inv_bind_O … HL01) -HL01 #H1V0 #H1T0
127 elim (llpr_inv_bind_O … HL02) -HL02 #H2V0 #H2T0
128 elim (IH … HT01 … HT02 (L1.ⓓV0) … (L2.ⓓV0)) -IH -HT01 -HT02 /2 width=4 by llpr_bind_repl_O/ -L0 -T0 #T #HT1 #HT2
129 elim (cpr_inv_lift1 … HT1 L1 … HXT1) -T1 /2 width=2 by ldrop_drop/ #T1 #HT1 #HXT1
130 elim (cpr_inv_lift1 … HT2 L2 … HXT2) -T2 /2 width=2 by ldrop_drop/ #T2 #HT2 #HXT2
131 lapply (lift_inj … HT2 … HT1) -T #H destruct /2 width=3 by ex2_intro/
132 qed-.
133
134 fact cpr_conf_llpr_flat_flat:
135    ∀I,G,L0,V0,T0. (
136       ∀L,T. ⦃G, L0, ⓕ{I}V0.T0⦄ ⊃+ ⦃G, L, T⦄ →
137       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
138       ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 →
139       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
140    ) →
141    ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 →
142    ∀V2. ⦃G, L0⦄ ⊢ V0 ➡ V2 → ∀T2. ⦃G, L0⦄ ⊢ T0 ➡ T2 →
143    ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓕ{I}V0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓕ{I}V0.T0, 0] L2 →
144    ∃∃T. ⦃G, L1⦄ ⊢ ⓕ{I}V1.T1 ➡ T & ⦃G, L2⦄ ⊢ ⓕ{I}V2.T2 ➡ T.
145 #I #G #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01
146 #V2 #HV02 #T2 #HT02 #L1 #HL01 #L2 #HL02
147 elim (llpr_inv_flat … HL01) -HL01 #H1V0 #H1T0
148 elim (llpr_inv_flat … HL02) -HL02 #H2V0 #H2T0
149 elim (IH … HV01 … HV02 … H1V0 … H2V0) //
150 elim (IH … HT01 … HT02 … H1T0 … H2T0) /3 width=5 by cpr_flat, ex2_intro/
151 qed-.
152
153 fact cpr_conf_llpr_flat_tau:
154    ∀G,L0,V0,T0. (
155       ∀L,T. ⦃G, L0, ⓝV0.T0⦄ ⊃+ ⦃G, L, T⦄ →
156       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
157       ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 →
158       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
159    ) →
160    ∀V1,T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → ∀T2. ⦃G, L0⦄ ⊢ T0 ➡ T2 →
161    ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓝV0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓝV0.T0, 0] L2 →
162    ∃∃T. ⦃G, L1⦄ ⊢ ⓝV1.T1 ➡ T & ⦃G, L2⦄ ⊢ T2 ➡ T.
163 #G #L0 #V0 #T0 #IH #V1 #T1 #HT01
164 #T2 #HT02 #L1 #HL01 #L2 #HL02
165 elim (llpr_inv_flat … HL01) -HL01 #_ #H1T0
166 elim (llpr_inv_flat … HL02) -HL02 #_ #H2T0
167 elim (IH … HT01 … HT02 … H1T0 … H2T0) // -L0 -V0 -T0 /3 width=3 by cpr_tau, ex2_intro/
168 qed-.
169
170 fact cpr_conf_llpr_tau_tau:
171    ∀G,L0,V0,T0. (
172       ∀L,T. ⦃G, L0, ⓝV0.T0⦄ ⊃+ ⦃G, L, T⦄ →
173       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
174       ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 →
175       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
176    ) →
177    ∀T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → ∀T2. ⦃G, L0⦄ ⊢ T0 ➡ T2 →
178    ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓝV0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓝV0.T0, 0] L2 →
179    ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡ T & ⦃G, L2⦄ ⊢ T2 ➡ T.
180 #G #L0 #V0 #T0 #IH #T1 #HT01
181 #T2 #HT02 #L1 #HL01 #L2 #HL02
182 elim (llpr_inv_flat … HL01) -HL01 #_ #H1T0
183 elim (llpr_inv_flat … HL02) -HL02 #_ #H2T0
184 elim (IH … HT01 … HT02 … H1T0 … H2T0) // -L0 -V0 -T0 /2 width=3 by ex2_intro/
185 qed-.
186
187 fact cpr_conf_llpr_flat_beta:
188    ∀a,G,L0,V0,W0,T0. (
189       ∀L,T. ⦃G, L0, ⓐV0.ⓛ{a}W0.T0⦄ ⊃+ ⦃G, L, T⦄ →
190       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
191       ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 →
192       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
193    ) →
194    ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀T1. ⦃G, L0⦄ ⊢ ⓛ{a}W0.T0 ➡ T1 →
195    ∀V2. ⦃G, L0⦄ ⊢ V0 ➡ V2 → ∀W2. ⦃G, L0⦄ ⊢ W0 ➡ W2 → ∀T2. ⦃G, L0.ⓛW0⦄ ⊢ T0 ➡ T2 →
196    ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓛ{a}W0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓛ{a}W0.T0, 0] L2 →
197    ∃∃T. ⦃G, L1⦄ ⊢ ⓐV1.T1 ➡ T & ⦃G, L2⦄ ⊢ ⓓ{a}ⓝW2.V2.T2 ➡ T.
198 #a #G #L0 #V0 #W0 #T0 #IH #V1 #HV01 #X #H
199 #V2 #HV02 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02
200 elim (cpr_inv_abst1 … H) -H #W1 #T1 #HW01 #HT01 #H destruct
201 elim (llpr_inv_flat … HL01) -HL01 #H1V0 #HL01
202 elim (llpr_inv_bind_O … HL01) -HL01 #H1W0 #H1T0
203 elim (llpr_inv_flat … HL02) -HL02 #H2V0 #HL02
204 elim (llpr_inv_bind_O … HL02) -HL02 #H2W0 #H2T0
205 elim (IH … HV01 … HV02 … H1V0 … H2V0) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2
206 elim (IH … HW01 … HW02 … H1W0 … H2W0) /2 width=1 by/ #W #HW1 #HW2
207 elim (IH … HT01 … HT02 (L1.ⓛW1) … (L2.ⓛW2)) /2 width=4 by llpr_bind_repl_O/ -L0 -V0 -W0 -T0 #T #HT1 #HT2
208 lapply (lsubr_cpr_trans … HT2 (L2.ⓓⓝW2.V2) ?) -HT2 /2 width=1 by lsubr_abst/ (**) (* full auto not tried *)
209 /4 width=5 by cpr_bind, cpr_flat, cpr_beta, ex2_intro/
210 qed-.
211
212 (* Basic-1: includes:
213             pr0_cong_upsilon_refl pr0_cong_upsilon_zeta
214             pr0_cong_upsilon_cong pr0_cong_upsilon_delta
215 *)
216 fact cpr_conf_llpr_flat_theta:
217    ∀a,G,L0,V0,W0,T0. (
218       ∀L,T. ⦃G, L0, ⓐV0.ⓓ{a}W0.T0⦄ ⊃+ ⦃G, L, T⦄ →
219       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
220       ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 →
221       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
222    ) →
223    ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀T1. ⦃G, L0⦄ ⊢ ⓓ{a}W0.T0 ➡ T1 →
224    ∀V2. ⦃G, L0⦄ ⊢ V0 ➡ V2 → ∀U2. ⇧[O, 1] V2 ≡ U2 →
225    ∀W2. ⦃G, L0⦄ ⊢ W0 ➡ W2 → ∀T2. ⦃G, L0.ⓓW0⦄ ⊢ T0 ➡ T2 →
226    ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓓ{a}W0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓓ{a}W0.T0, 0] L2 →
227    ∃∃T. ⦃G, L1⦄ ⊢ ⓐV1.T1 ➡ T & ⦃G, L2⦄ ⊢ ⓓ{a}W2.ⓐU2.T2 ➡ T.
228 #a #G #L0 #V0 #W0 #T0 #IH #V1 #HV01 #X #H
229 #V2 #HV02 #U2 #HVU2 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02
230 elim (llpr_inv_flat … HL01) -HL01 #H1V0 #HL01
231 elim (llpr_inv_bind_O … HL01) -HL01 #H1W0 #H1T0
232 elim (llpr_inv_flat … HL02) -HL02 #H2V0 #HL02
233 elim (llpr_inv_bind_O … HL02) -HL02 #H2W0 #H2T0
234 elim (IH … HV01 … HV02 … H1V0 … H2V0) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2
235 elim (lift_total V 0 1) #U #HVU
236 lapply (cpr_lift … HV2 (L2.ⓓW2) … HVU2 … HVU) -HVU2 /2 width=2 by ldrop_drop/ #HU2
237 elim (cpr_inv_abbr1 … H) -H *
238 [ #W1 #T1 #HW01 #HT01 #H destruct
239   elim (IH … HW01 … HW02 … H1W0 … H2W0) /2 width=1 by/
240   elim (IH … HT01 … HT02 (L1.ⓓW1) … (L2.ⓓW2)) /2 width=4 by llpr_bind_repl_O/ -L0 -V0 -W0 -T0
241   /4 width=7 by cpr_bind, cpr_flat, cpr_theta, ex2_intro/
242 | #T1 #HT01 #HXT1 #H destruct
243   elim (IH … HT01 … HT02 (L1.ⓓW2) … (L2.ⓓW2)) /2 width=4 by llpr_bind_repl_O/ -L0 -V0 -W0 -T0 #T #HT1 #HT2
244   elim (cpr_inv_lift1 … HT1 L1 … HXT1) -HXT1
245   /4 width=9 by cpr_flat, cpr_zeta, ldrop_drop, lift_flat, ex2_intro/
246 ]
247 qed-.
248
249 fact cpr_conf_llpr_beta_beta:
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⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 →
254       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
255    ) →
256    ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀W1. ⦃G, L0⦄ ⊢ W0 ➡ W1 → ∀T1. ⦃G, L0.ⓛW0⦄ ⊢ T0 ➡ T1 →
257    ∀V2. ⦃G, L0⦄ ⊢ V0 ➡ V2 → ∀W2. ⦃G, L0⦄ ⊢ W0 ➡ W2 → ∀T2. ⦃G, L0.ⓛW0⦄ ⊢ T0 ➡ T2 →
258    ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓛ{a}W0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓛ{a}W0.T0, 0] L2 →
259    ∃∃T. ⦃G, L1⦄ ⊢ ⓓ{a}ⓝW1.V1.T1 ➡ T & ⦃G, L2⦄ ⊢ ⓓ{a}ⓝW2.V2.T2 ➡ T.
260 #a #G #L0 #V0 #W0 #T0 #IH #V1 #HV01 #W1 #HW01 #T1 #HT01
261 #V2 #HV02 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02
262 elim (llpr_inv_flat … HL01) -HL01 #H1V0 #HL01
263 elim (llpr_inv_bind_O … HL01) -HL01 #H1W0 #H1T0
264 elim (llpr_inv_flat … HL02) -HL02 #H2V0 #HL02
265 elim (llpr_inv_bind_O … HL02) -HL02 #H2W0 #H2T0
266 elim (IH … HV01 … HV02 … H1V0 … H2V0) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2
267 elim (IH … HW01 … HW02 … H1W0 … H2W0) /2 width=1/ #W #HW1 #HW2
268 elim (IH … HT01 … HT02 (L1.ⓛW1) … (L2.ⓛW2)) /2 width=4 by llpr_bind_repl_O/ -L0 -V0 -W0 -T0 #T #HT1 #HT2
269 lapply (lsubr_cpr_trans … HT1 (L1.ⓓⓝW1.V1) ?) -HT1 /2 width=1 by lsubr_abst/
270 lapply (lsubr_cpr_trans … HT2 (L2.ⓓⓝW2.V2) ?) -HT2 /2 width=1 by lsubr_abst/
271 /4 width=5 by cpr_bind, cpr_flat, ex2_intro/ (**) (* full auto not tried *)
272 qed-.
273
274 (* Basic_1: includes: pr0_upsilon_upsilon *)
275 fact cpr_conf_llpr_theta_theta:
276    ∀a,G,L0,V0,W0,T0. (
277       ∀L,T. ⦃G, L0, ⓐV0.ⓓ{a}W0.T0⦄ ⊃+ ⦃G, L, T⦄ →
278       ∀T1. ⦃G, L⦄ ⊢ T ➡ T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡ T2 →
279       ∀L1. ⦃G, L⦄ ⊢ ➡[T, 0] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[T, 0] L2 →
280       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡ T0 & ⦃G, L2⦄ ⊢ T2 ➡ T0
281    ) →
282    ∀V1. ⦃G, L0⦄ ⊢ V0 ➡ V1 → ∀U1. ⇧[O, 1] V1 ≡ U1 →
283    ∀W1. ⦃G, L0⦄ ⊢ W0 ➡ W1 → ∀T1. ⦃G, L0.ⓓW0⦄ ⊢ T0 ➡ T1 →
284    ∀V2. ⦃G, L0⦄ ⊢ V0 ➡ V2 → ∀U2. ⇧[O, 1] V2 ≡ U2 →
285    ∀W2. ⦃G, L0⦄ ⊢ W0 ➡ W2 → ∀T2. ⦃G, L0.ⓓW0⦄ ⊢ T0 ➡ T2 →
286    ∀L1. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓓ{a}W0.T0, 0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[ⓐV0.ⓓ{a}W0.T0, 0] L2 →
287    ∃∃T. ⦃G, L1⦄ ⊢ ⓓ{a}W1.ⓐU1.T1 ➡ T & ⦃G, L2⦄ ⊢ ⓓ{a}W2.ⓐU2.T2 ➡ T.
288 #a #G #L0 #V0 #W0 #T0 #IH #V1 #HV01 #U1 #HVU1 #W1 #HW01 #T1 #HT01
289 #V2 #HV02 #U2 #HVU2 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02
290 elim (llpr_inv_flat … HL01) -HL01 #H1V0 #HL01
291 elim (llpr_inv_bind_O … HL01) -HL01 #H1W0 #H1T0
292 elim (llpr_inv_flat … HL02) -HL02 #H2V0 #HL02
293 elim (llpr_inv_bind_O … HL02) -HL02 #H2W0 #H2T0
294 elim (IH … HV01 … HV02 … H1V0 … H2V0) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2
295 elim (IH … HW01 … HW02 … H1W0 … H2W0) /2 width=1 by/
296 elim (IH … HT01 … HT02 (L1.ⓓW1) … (L2.ⓓW2)) /2 width=4 by llpr_bind_repl_O/ -L0 -V0 -W0 -T0
297 elim (lift_total V 0 1) #U #HVU
298 lapply (cpr_lift … HV1 (L1.ⓓW1) … HVU1 … HVU) -HVU1 /2 width=2 by ldrop_drop/
299 lapply (cpr_lift … HV2 (L2.ⓓW2) … HVU2 … HVU) -HVU2 /2 width=2 by ldrop_drop/
300 /4 width=7 by cpr_bind, cpr_flat, ex2_intro/ (**) (* full auto not tried *)
301 qed-.
302
303 theorem cpr_conf_llpr: ∀G. llpx_sn_confluent2 (cpr G) (cpr G).
304 #G #L0 #T0 @(fqup_wf_ind_eq … G L0 T0) -G -L0 -T0 #G #L #T #IH #G0 #L0 * [| * ]
305 [ #I0 #HG #HL #HT #T1 #H1 #T2 #H2 #L1 #HL01 #L2 #HL02 destruct
306   elim (cpr_inv_atom1 … H1) -H1
307   elim (cpr_inv_atom1 … H2) -H2
308   [ #H2 #H1 destruct
309     /2 width=1 by cpr_conf_llpr_atom_atom/
310   | * #K0 #V0 #V2 #i2 #HLK0 #HV02 #HVT2 #H2 #H1 destruct
311     /3 width=10 by cpr_conf_llpr_atom_delta/
312   | #H2 * #K0 #V0 #V1 #i1 #HLK0 #HV01 #HVT1 #H1 destruct
313     /4 width=10 by ex2_commute, cpr_conf_llpr_atom_delta/
314   | * #X #Y #V2 #z #H #HV02 #HVT2 #H2
315     * #K0 #V0 #V1 #i #HLK0 #HV01 #HVT1 #H1 destruct
316     /3 width=17 by cpr_conf_llpr_delta_delta/
317   ]
318 | #a #I #V0 #T0 #HG #HL #HT #X1 #H1 #X2 #H2 #L1 #HL01 #L2 #HL02 destruct
319   elim (cpr_inv_bind1 … H1) -H1 *
320   [ #V1 #T1 #HV01 #HT01 #H1
321   | #T1 #HT01 #HXT1 #H11 #H12
322   ]
323   elim (cpr_inv_bind1 … H2) -H2 *
324   [1,3: #V2 #T2 #HV02 #HT02 #H2
325   |2,4: #T2 #HT02 #HXT2 #H21 #H22
326   ] destruct
327   [ /3 width=10 by cpr_conf_llpr_bind_bind/
328   | /4 width=11 by ex2_commute, cpr_conf_llpr_bind_zeta/
329   | /3 width=11 by cpr_conf_llpr_bind_zeta/
330   | /3 width=12 by cpr_conf_llpr_zeta_zeta/
331   ]
332 | #I #V0 #T0 #HG #HL #HT #X1 #H1 #X2 #H2 #L1 #HL01 #L2 #HL02 destruct
333   elim (cpr_inv_flat1 … H1) -H1 *
334   [ #V1 #T1 #HV01 #HT01 #H1
335   | #HX1 #H1
336   | #a1 #V1 #Y1 #W1 #Z1 #T1 #HV01 #HYW1 #HZT1 #H11 #H12 #H13
337   | #a1 #V1 #U1 #Y1 #W1 #Z1 #T1 #HV01 #HVU1 #HYW1 #HZT1 #H11 #H12 #H13
338   ]
339   elim (cpr_inv_flat1 … H2) -H2 *
340   [1,5,9,13: #V2 #T2 #HV02 #HT02 #H2
341   |2,6,10,14: #HX2 #H2
342   |3,7,11,15: #a2 #V2 #Y2 #W2 #Z2 #T2 #HV02 #HYW2 #HZT2 #H21 #H22 #H23
343   |4,8,12,16: #a2 #V2 #U2 #Y2 #W2 #Z2 #T2 #HV02 #HVU2 #HYW2 #HZT2 #H21 #H22 #H23
344   ] destruct
345   [ /3 width=10 by cpr_conf_llpr_flat_flat/
346   | /4 width=8 by ex2_commute, cpr_conf_llpr_flat_tau/
347   | /4 width=12 by ex2_commute, cpr_conf_llpr_flat_beta/
348   | /4 width=14 by ex2_commute, cpr_conf_llpr_flat_theta/
349   | /3 width=8 by cpr_conf_llpr_flat_tau/
350   | /3 width=8 by cpr_conf_llpr_tau_tau/
351   | /3 width=12 by cpr_conf_llpr_flat_beta/
352   | /3 width=13 by cpr_conf_llpr_beta_beta/
353   | /3 width=14 by cpr_conf_llpr_flat_theta/
354   | /3 width=17 by cpr_conf_llpr_theta_theta/
355   ]
356 ]
357 qed-.
358
359 (* Basic_1: includes: pr0_confluence pr2_confluence *)
360 theorem cpr_conf: ∀G,L. confluent … (cpr G L).
361 /2 width=6 by cpr_conf_llpr/ qed-.
362
363 (* Properties on context-sensitive parallel reduction for terms *************)
364
365 lemma llpr_cpr_conf_dx: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡[T0, 0] L1 →
366                         ∃∃T. ⦃G, L1⦄ ⊢ T0 ➡ T & ⦃G, L1⦄ ⊢ T1 ➡ T.
367 #G #L0 #T0 #T1 #HT01 #L1 #HL01
368 elim (cpr_conf_llpr … HT01 T0 … HL01 … HL01) /2 width=3 by ex2_intro/
369 qed-.
370
371 lemma llpr_cpr_conf_sn: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡ T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡[T0, 0] L1 →
372                         ∃∃T. ⦃G, L1⦄ ⊢ T0 ➡ T & ⦃G, L0⦄ ⊢ T1 ➡ T.
373 #G #L0 #T0 #T1 #HT01 #L1 #HL01
374 elim (cpr_conf_llpr … HT01 T0 … L0 … HL01) /2 width=3 by ex2_intro/
375 qed-.