]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/rt_transition/lfpr_lfpr.ma
d05584ebf795bae07dd1c19000b10b2c894f31ce
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_transition / lfpr_lfpr.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/static/lfxs_lfxs.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/lfpr_drops.ma".
20 include "basic_2/rt_transition/lfpr_fqup.ma".
21 include "basic_2/rt_transition/lfpr_frees.ma".
22
23 (* PARALLEL R-TRANSITION FOR LOCAL ENV.S ON REFERRED ENTRIES ****************)
24
25 (* Main properties with context-sensitive parallel r-transition for terms ***)
26
27 fact cpr_conf_lfpr_atom_atom:
28    ∀h,I,G,L1,L2. ∃∃T. ⦃G, L1⦄ ⊢ ⓪{I} ➡[h] T & ⦃G, L2⦄ ⊢ ⓪{I} ➡[h] T.
29 /2 width=3 by ex2_intro/ qed-.
30
31 fact cpr_conf_lfpr_atom_delta:
32    ∀h,G,L0,i. (
33       ∀L,T. ⦃G, L0, #i⦄ ⊐+ ⦃G, L, T⦄ →
34       ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
35       ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
36       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
37    ) →
38    ∀K0,V0. ⬇*[i] L0 ≡ K0.ⓓV0 →
39    ∀V2. ⦃G, K0⦄ ⊢ V0 ➡[h] V2 → ∀T2. ⬆*[⫯i] V2 ≡ T2 →
40    ∀L1. ⦃G, L0⦄ ⊢ ➡[h, #i] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, #i] L2 →
41    ∃∃T. ⦃G, L1⦄ ⊢ #i ➡[h] T & ⦃G, L2⦄ ⊢ T2 ➡[h] T.
42 #h #G #L0 #i #IH #K0 #V0 #HLK0 #V2 #HV02 #T2 #HVT2 #L1 #HL01 #L2 #HL02
43 elim (lfpr_inv_lref_sn … HL01 … HLK0) -HL01 #K1 #V1 #HLK1 #HK01 #HV01
44 elim (lfpr_inv_lref_sn … HL02 … HLK0) -HL02 #K2 #W2 #HLK2 #HK02 #_
45 lapply (drops_isuni_fwd_drop2 … HLK2) // -W2 #HLK2
46 lapply (fqup_lref … G … HLK0) -HLK0 #HLK0
47 elim (IH … HLK0 … HV01 … HV02 … HK01 … HK02) -L0 -K0 -V0 #V #HV1 #HV2
48 elim (cpm_lifts … HV2 … HLK2 … HVT2) -K2 -V2
49 /3 width=6 by cpm_delta_drops, ex2_intro/
50 qed-.
51
52 fact cpr_conf_lfpr_delta_delta:
53    ∀h,G,L0,i. (
54       ∀L,T. ⦃G, L0, #i⦄ ⊐+ ⦃G, L, T⦄ →
55       ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
56       ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
57       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
58    ) →
59    ∀K0,V0. ⬇*[i] L0 ≡ K0.ⓓV0 →
60    ∀V1. ⦃G, K0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⬆*[⫯i] V1 ≡ T1 →
61    ∀KX,VX. ⬇*[i] L0 ≡ KX.ⓓVX →
62    ∀V2. ⦃G, KX⦄ ⊢ VX ➡[h] V2 → ∀T2. ⬆*[⫯i] V2 ≡ T2 →
63    ∀L1. ⦃G, L0⦄ ⊢ ➡[h, #i] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, #i] L2 →
64    ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡[h] T & ⦃G, L2⦄ ⊢ T2 ➡[h] T.
65 #h #G #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 (lfpr_inv_lref_sn … HL01 … HLK0) -HL01 #K1 #W1 #HLK1 #HK01 #_
69 lapply (drops_isuni_fwd_drop2 … HLK1) -W1 // #HLK1
70 elim (lfpr_inv_lref_sn … HL02 … HLK0) -HL02 #K2 #W2 #HLK2 #HK02 #_
71 lapply (drops_isuni_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 (cpm_lifts … HV1 … HLK1 … HVT1) -K1 -V1 #T #HVT #HT1
75 elim (cpm_lifts … HV2 … HLK2 … HVT2) -K2 -V2 #X #HX #HT2
76 lapply (lifts_mono … HX … HVT) #H destruct
77 /2 width=3 by ex2_intro/
78 qed-.
79
80 fact cpr_conf_lfpr_bind_bind:
81    ∀h,p,I,G,L0,V0,T0. (
82       ∀L,T. ⦃G, L0, ⓑ{p,I}V0.T0⦄ ⊐+ ⦃G, L, T⦄ →
83       ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
84       ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
85       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
86    ) →
87    ∀V1. ⦃G, L0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⦃G, L0.ⓑ{I}V0⦄ ⊢ T0 ➡[h] T1 →
88    ∀V2. ⦃G, L0⦄ ⊢ V0 ➡[h] V2 → ∀T2. ⦃G, L0.ⓑ{I}V0⦄ ⊢ T0 ➡[h] T2 →
89    ∀L1. ⦃G, L0⦄ ⊢ ➡[h, ⓑ{p,I}V0.T0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, ⓑ{p,I}V0.T0] L2 →
90    ∃∃T. ⦃G, L1⦄ ⊢ ⓑ{p,I}V1.T1 ➡[h] T & ⦃G, L2⦄ ⊢ ⓑ{p,I}V2.T2 ➡[h] T.
91 #h #p #I #G #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01
92 #V2 #HV02 #T2 #HT02 #L1 #HL01 #L2 #HL02
93 elim (lfpr_inv_bind … HL01) -HL01 #H1V0 #H1T0
94 elim (lfpr_inv_bind … HL02) -HL02 #H2V0 #H2T0
95 elim (IH … HV01 … HV02 … H1V0 … H2V0) //
96 elim (IH … HT01 … HT02 (L1.ⓑ{I}V1) … (L2.ⓑ{I}V2)) -IH
97 /3 width=5 by lfpr_pair_repl_dx, cpm_bind, ex2_intro/
98 qed-.
99
100 fact cpr_conf_lfpr_bind_zeta:
101    ∀h,G,L0,V0,T0. (
102       ∀L,T. ⦃G, L0, +ⓓV0.T0⦄ ⊐+ ⦃G, L, T⦄ →
103       ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
104       ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
105       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
106    ) →
107    ∀V1. ⦃G, L0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⦃G, L0.ⓓV0⦄ ⊢ T0 ➡[h] T1 →
108    ∀T2. ⦃G, L0.ⓓV0⦄ ⊢ T0 ➡[h] T2 → ∀X2. ⬆*[1] X2 ≡ T2 →
109    ∀L1. ⦃G, L0⦄ ⊢ ➡[h, +ⓓV0.T0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, +ⓓV0.T0] L2 →
110    ∃∃T. ⦃G, L1⦄ ⊢ +ⓓV1.T1 ➡[h] T & ⦃G, L2⦄ ⊢ X2 ➡[h] T.
111 #h #G #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01
112 #T2 #HT02 #X2 #HXT2 #L1 #HL01 #L2 #HL02
113 elim (lfpr_inv_bind … HL01) -HL01 #H1V0 #H1T0
114 elim (lfpr_inv_bind … HL02) -HL02 #H2V0 #H2T0
115 elim (IH … HT01 … HT02 (L1.ⓓV1) … (L2.ⓓV1)) -IH -HT01 -HT02 /2 width=4 by lfpr_pair_repl_dx/ -L0 -V0 -T0 #T #HT1 #HT2
116 elim (cpm_inv_lifts1 … HT2 … L2 … HXT2) -T2 /3 width=3 by drops_refl, drops_drop, cpm_zeta, ex2_intro/
117 qed-.
118
119 fact cpr_conf_lfpr_zeta_zeta:
120    ∀h,G,L0,V0,T0. (
121       ∀L,T. ⦃G, L0, +ⓓV0.T0⦄ ⊐+ ⦃G, L, T⦄ →
122       ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
123       ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
124       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
125    ) →
126    ∀T1. ⦃G, L0.ⓓV0⦄ ⊢ T0 ➡[h] T1 → ∀X1. ⬆*[1] X1 ≡ T1 →
127    ∀T2. ⦃G, L0.ⓓV0⦄ ⊢ T0 ➡[h] T2 → ∀X2. ⬆*[1] X2 ≡ T2 →
128    ∀L1. ⦃G, L0⦄ ⊢ ➡[h, +ⓓV0.T0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, +ⓓV0.T0] L2 →
129    ∃∃T. ⦃G, L1⦄ ⊢ X1 ➡[h] T & ⦃G, L2⦄ ⊢ X2 ➡[h] T.
130 #h #G #L0 #V0 #T0 #IH #T1 #HT01 #X1 #HXT1
131 #T2 #HT02 #X2 #HXT2 #L1 #HL01 #L2 #HL02
132 elim (lfpr_inv_bind … HL01) -HL01 #H1V0 #H1T0
133 elim (lfpr_inv_bind … HL02) -HL02 #H2V0 #H2T0
134 elim (IH … HT01 … HT02 (L1.ⓓV0) … (L2.ⓓV0)) -IH -HT01 -HT02 /2 width=4 by lfpr_pair_repl_dx/ -L0 -T0 #T #HT1 #HT2
135 elim (cpm_inv_lifts1 … HT1 … L1 … HXT1) -T1 /3 width=2 by drops_refl, drops_drop/ #T1 #HT1 #HXT1
136 elim (cpm_inv_lifts1 … HT2 … L2 … HXT2) -T2 /3 width=2 by drops_refl, drops_drop/ #T2 #HT2 #HXT2
137 lapply (lifts_inj … HT2 … HT1) -T #H destruct /2 width=3 by ex2_intro/
138 qed-.
139
140 fact cpr_conf_lfpr_flat_flat:
141    ∀h,I,G,L0,V0,T0. (
142       ∀L,T. ⦃G, L0, ⓕ{I}V0.T0⦄ ⊐+ ⦃G, L, T⦄ →
143       ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
144       ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
145       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
146    ) →
147    ∀V1. ⦃G, L0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⦃G, L0⦄ ⊢ T0 ➡[h] T1 →
148    ∀V2. ⦃G, L0⦄ ⊢ V0 ➡[h] V2 → ∀T2. ⦃G, L0⦄ ⊢ T0 ➡[h] T2 →
149    ∀L1. ⦃G, L0⦄ ⊢ ➡[h, ⓕ{I}V0.T0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, ⓕ{I}V0.T0] L2 →
150    ∃∃T. ⦃G, L1⦄ ⊢ ⓕ{I}V1.T1 ➡[h] T & ⦃G, L2⦄ ⊢ ⓕ{I}V2.T2 ➡[h] T.
151 #h #I #G #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01
152 #V2 #HV02 #T2 #HT02 #L1 #HL01 #L2 #HL02
153 elim (lfpr_inv_flat … HL01) -HL01 #H1V0 #H1T0
154 elim (lfpr_inv_flat … HL02) -HL02 #H2V0 #H2T0
155 elim (IH … HV01 … HV02 … H1V0 … H2V0) //
156 elim (IH … HT01 … HT02 … H1T0 … H2T0) /3 width=5 by cpr_flat, ex2_intro/
157 qed-.
158
159 fact cpr_conf_lfpr_flat_epsilon:
160    ∀h,G,L0,V0,T0. (
161       ∀L,T. ⦃G, L0, ⓝV0.T0⦄ ⊐+ ⦃G, L, T⦄ →
162       ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
163       ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
164       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
165    ) →
166    ∀V1,T1. ⦃G, L0⦄ ⊢ T0 ➡[h] T1 → ∀T2. ⦃G, L0⦄ ⊢ T0 ➡[h] T2 →
167    ∀L1. ⦃G, L0⦄ ⊢ ➡[h, ⓝV0.T0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, ⓝV0.T0] L2 →
168    ∃∃T. ⦃G, L1⦄ ⊢ ⓝV1.T1 ➡[h] T & ⦃G, L2⦄ ⊢ T2 ➡[h] T.
169 #h #G #L0 #V0 #T0 #IH #V1 #T1 #HT01
170 #T2 #HT02 #L1 #HL01 #L2 #HL02
171 elim (lfpr_inv_flat … HL01) -HL01 #_ #H1T0
172 elim (lfpr_inv_flat … HL02) -HL02 #_ #H2T0
173 elim (IH … HT01 … HT02 … H1T0 … H2T0) // -L0 -V0 -T0 /3 width=3 by cpm_eps, ex2_intro/
174 qed-.
175
176 fact cpr_conf_lfpr_epsilon_epsilon:
177    ∀h,G,L0,V0,T0. (
178       ∀L,T. ⦃G, L0, ⓝV0.T0⦄ ⊐+ ⦃G, L, T⦄ →
179       ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
180       ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
181       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
182    ) →
183    ∀T1. ⦃G, L0⦄ ⊢ T0 ➡[h] T1 → ∀T2. ⦃G, L0⦄ ⊢ T0 ➡[h] T2 →
184    ∀L1. ⦃G, L0⦄ ⊢ ➡[h, ⓝV0.T0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, ⓝV0.T0] L2 →
185    ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡[h] T & ⦃G, L2⦄ ⊢ T2 ➡[h] T.
186 #h #G #L0 #V0 #T0 #IH #T1 #HT01
187 #T2 #HT02 #L1 #HL01 #L2 #HL02
188 elim (lfpr_inv_flat … HL01) -HL01 #_ #H1T0
189 elim (lfpr_inv_flat … HL02) -HL02 #_ #H2T0
190 elim (IH … HT01 … HT02 … H1T0 … H2T0) // -L0 -V0 -T0 /2 width=3 by ex2_intro/
191 qed-.
192
193 fact cpr_conf_lfpr_flat_beta:
194    ∀h,p,G,L0,V0,W0,T0. (
195       ∀L,T. ⦃G, L0, ⓐV0.ⓛ{p}W0.T0⦄ ⊐+ ⦃G, L, T⦄ →
196       ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
197       ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
198       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
199    ) →
200    ∀V1. ⦃G, L0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⦃G, L0⦄ ⊢ ⓛ{p}W0.T0 ➡[h] T1 →
201    ∀V2. ⦃G, L0⦄ ⊢ V0 ➡[h] V2 → ∀W2. ⦃G, L0⦄ ⊢ W0 ➡[h] W2 → ∀T2. ⦃G, L0.ⓛW0⦄ ⊢ T0 ➡[h] T2 →
202    ∀L1. ⦃G, L0⦄ ⊢ ➡[h, ⓐV0.ⓛ{p}W0.T0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, ⓐV0.ⓛ{p}W0.T0] L2 →
203    ∃∃T. ⦃G, L1⦄ ⊢ ⓐV1.T1 ➡[h] T & ⦃G, L2⦄ ⊢ ⓓ{p}ⓝW2.V2.T2 ➡[h] T.
204 #h #p #G #L0 #V0 #W0 #T0 #IH #V1 #HV01 #X #H
205 #V2 #HV02 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02
206 elim (cpm_inv_abst1 … H) -H #W1 #T1 #HW01 #HT01 #H destruct
207 elim (lfpr_inv_flat … HL01) -HL01 #H1V0 #HL01
208 elim (lfpr_inv_bind … HL01) -HL01 #H1W0 #H1T0
209 elim (lfpr_inv_flat … HL02) -HL02 #H2V0 #HL02
210 elim (lfpr_inv_bind … HL02) -HL02 #H2W0 #H2T0
211 elim (IH … HV01 … HV02 … H1V0 … H2V0) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2
212 elim (IH … HW01 … HW02 … H1W0 … H2W0) /2 width=1 by/ #W #HW1 #HW2
213 elim (IH … HT01 … HT02 (L1.ⓛW1) … (L2.ⓛW2)) /2 width=4 by lfpr_pair_repl_dx/ -L0 -V0 -W0 -T0 #T #HT1 #HT2
214 lapply (lsubr_cpm_trans … HT2 (L2.ⓓⓝW2.V2) ?) -HT2 /2 width=1 by lsubr_beta/ (**) (* full auto not tried *)
215 /4 width=5 by cpm_bind, cpr_flat, cpm_beta, ex2_intro/
216 qed-.
217
218 fact cpr_conf_lfpr_flat_theta:
219    ∀h,p,G,L0,V0,W0,T0. (
220       ∀L,T. ⦃G, L0, ⓐV0.ⓓ{p}W0.T0⦄ ⊐+ ⦃G, L, T⦄ →
221       ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
222       ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
223       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
224    ) →
225    ∀V1. ⦃G, L0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⦃G, L0⦄ ⊢ ⓓ{p}W0.T0 ➡[h] T1 →
226    ∀V2. ⦃G, L0⦄ ⊢ V0 ➡[h] V2 → ∀U2. ⬆*[1] V2 ≡ U2 →
227    ∀W2. ⦃G, L0⦄ ⊢ W0 ➡[h] W2 → ∀T2. ⦃G, L0.ⓓW0⦄ ⊢ T0 ➡[h] T2 →
228    ∀L1. ⦃G, L0⦄ ⊢ ➡[h, ⓐV0.ⓓ{p}W0.T0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, ⓐV0.ⓓ{p}W0.T0] L2 →
229    ∃∃T. ⦃G, L1⦄ ⊢ ⓐV1.T1 ➡[h] T & ⦃G, L2⦄ ⊢ ⓓ{p}W2.ⓐU2.T2 ➡[h] T.
230 #h #p #G #L0 #V0 #W0 #T0 #IH #V1 #HV01 #X #H
231 #V2 #HV02 #U2 #HVU2 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02
232 elim (lfpr_inv_flat … HL01) -HL01 #H1V0 #HL01
233 elim (lfpr_inv_bind … HL01) -HL01 #H1W0 #H1T0
234 elim (lfpr_inv_flat … HL02) -HL02 #H2V0 #HL02
235 elim (lfpr_inv_bind … HL02) -HL02 #H2W0 #H2T0
236 elim (IH … HV01 … HV02 … H1V0 … H2V0) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2
237 elim (cpm_lifts … HV2 … (L2.ⓓW2) … HVU2) -HVU2 /3 width=2 by drops_refl, drops_drop/ #U #HVU #HU2
238 elim (cpm_inv_abbr1 … H) -H *
239 [ #W1 #T1 #HW01 #HT01 #H destruct
240   elim (IH … HW01 … HW02 … H1W0 … H2W0) /2 width=1 by/
241   elim (IH … HT01 … HT02 (L1.ⓓW1) … (L2.ⓓW2)) /2 width=4 by lfpr_pair_repl_dx/ -L0 -V0 -W0 -T0
242   /4 width=7 by cpm_bind, cpr_flat, cpm_theta, ex2_intro/
243 | #T1 #HT01 #HXT1 #H destruct
244   elim (IH … HT01 … HT02 (L1.ⓓW2) … (L2.ⓓW2)) /2 width=4 by lfpr_pair_repl_dx/ -L0 -V0 -W0 -T0 #T #HT1 #HT2
245   elim (cpm_inv_lifts1 … HT1 … L1 … HXT1) -HXT1
246   /4 width=9 by cpr_flat, cpm_zeta, drops_refl, drops_drop, lifts_flat, ex2_intro/
247 ]
248 qed-.
249
250 fact cpr_conf_lfpr_beta_beta:
251    ∀h,p,G,L0,V0,W0,T0. (
252       ∀L,T. ⦃G, L0, ⓐV0.ⓛ{p}W0.T0⦄ ⊐+ ⦃G, L, T⦄ →
253       ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
254       ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
255       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
256    ) →
257    ∀V1. ⦃G, L0⦄ ⊢ V0 ➡[h] V1 → ∀W1. ⦃G, L0⦄ ⊢ W0 ➡[h] W1 → ∀T1. ⦃G, L0.ⓛW0⦄ ⊢ T0 ➡[h] T1 →
258    ∀V2. ⦃G, L0⦄ ⊢ V0 ➡[h] V2 → ∀W2. ⦃G, L0⦄ ⊢ W0 ➡[h] W2 → ∀T2. ⦃G, L0.ⓛW0⦄ ⊢ T0 ➡[h] T2 →
259    ∀L1. ⦃G, L0⦄ ⊢ ➡[h, ⓐV0.ⓛ{p}W0.T0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, ⓐV0.ⓛ{p}W0.T0] L2 →
260    ∃∃T. ⦃G, L1⦄ ⊢ ⓓ{p}ⓝW1.V1.T1 ➡[h] T & ⦃G, L2⦄ ⊢ ⓓ{p}ⓝW2.V2.T2 ➡[h] T.
261 #h #p #G #L0 #V0 #W0 #T0 #IH #V1 #HV01 #W1 #HW01 #T1 #HT01
262 #V2 #HV02 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02
263 elim (lfpr_inv_flat … HL01) -HL01 #H1V0 #HL01
264 elim (lfpr_inv_bind … HL01) -HL01 #H1W0 #H1T0
265 elim (lfpr_inv_flat … HL02) -HL02 #H2V0 #HL02
266 elim (lfpr_inv_bind … HL02) -HL02 #H2W0 #H2T0
267 elim (IH … HV01 … HV02 … H1V0 … H2V0) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2
268 elim (IH … HW01 … HW02 … H1W0 … H2W0) /2 width=1/ #W #HW1 #HW2
269 elim (IH … HT01 … HT02 (L1.ⓛW1) … (L2.ⓛW2)) /2 width=4 by lfpr_pair_repl_dx/ -L0 -V0 -W0 -T0 #T #HT1 #HT2
270 lapply (lsubr_cpm_trans … HT1 (L1.ⓓⓝW1.V1) ?) -HT1 /2 width=1 by lsubr_beta/
271 lapply (lsubr_cpm_trans … HT2 (L2.ⓓⓝW2.V2) ?) -HT2 /2 width=1 by lsubr_beta/
272 /4 width=5 by cpm_bind, cpr_flat, ex2_intro/ (**) (* full auto not tried *)
273 qed-.
274
275 fact cpr_conf_lfpr_theta_theta:
276    ∀h,p,G,L0,V0,W0,T0. (
277       ∀L,T. ⦃G, L0, ⓐV0.ⓓ{p}W0.T0⦄ ⊐+ ⦃G, L, T⦄ →
278       ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
279       ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
280       ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
281    ) →
282    ∀V1. ⦃G, L0⦄ ⊢ V0 ➡[h] V1 → ∀U1. ⬆*[1] V1 ≡ U1 →
283    ∀W1. ⦃G, L0⦄ ⊢ W0 ➡[h] W1 → ∀T1. ⦃G, L0.ⓓW0⦄ ⊢ T0 ➡[h] T1 →
284    ∀V2. ⦃G, L0⦄ ⊢ V0 ➡[h] V2 → ∀U2. ⬆*[1] V2 ≡ U2 →
285    ∀W2. ⦃G, L0⦄ ⊢ W0 ➡[h] W2 → ∀T2. ⦃G, L0.ⓓW0⦄ ⊢ T0 ➡[h] T2 →
286    ∀L1. ⦃G, L0⦄ ⊢ ➡[h, ⓐV0.ⓓ{p}W0.T0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, ⓐV0.ⓓ{p}W0.T0] L2 →
287    ∃∃T. ⦃G, L1⦄ ⊢ ⓓ{p}W1.ⓐU1.T1 ➡[h] T & ⦃G, L2⦄ ⊢ ⓓ{p}W2.ⓐU2.T2 ➡[h] T.
288 #h #p #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 (lfpr_inv_flat … HL01) -HL01 #H1V0 #HL01
291 elim (lfpr_inv_bind … HL01) -HL01 #H1W0 #H1T0
292 elim (lfpr_inv_flat … HL02) -HL02 #H2V0 #HL02
293 elim (lfpr_inv_bind … 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 lfpr_pair_repl_dx/ -L0 -V0 -W0 -T0
297 elim (cpm_lifts … HV1 … (L1.ⓓW1) … HVU1) -HVU1 /3 width=2 by drops_refl, drops_drop/ #U #HVU
298 elim (cpm_lifts … HV2 … (L2.ⓓW2) … HVU2) -HVU2 /3 width=2 by drops_refl, drops_drop/ #X #HX
299 lapply (lifts_mono … HX … HVU) -HX #H destruct
300 /4 width=7 by cpm_bind, cpr_flat, ex2_intro/ (**) (* full auto not tried *)
301 qed-.
302
303 theorem cpr_conf_lfpr: ∀h,G. R_confluent2_lfxs (cpm 0 h G) (cpm 0 h G) (cpm 0 h G) (cpm 0 h G).
304 #h #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_drops … H1) -H1
307   elim (cpr_inv_atom1_drops … H2) -H2
308   [ #H2 #H1 destruct
309     /2 width=1 by cpr_conf_lfpr_atom_atom/
310   | * #K0 #V0 #V2 #i2 #HLK0 #HV02 #HVT2 #H2 #H1 destruct
311     /3 width=10 by cpr_conf_lfpr_atom_delta/
312   | #H2 * #K0 #V0 #V1 #i1 #HLK0 #HV01 #HVT1 #H1 destruct
313     /4 width=10 by ex2_commute, cpr_conf_lfpr_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_lfpr_delta_delta/
317   ]
318 | #p #I #V0 #T0 #HG #HL #HT #X1 #H1 #X2 #H2 #L1 #HL01 #L2 #HL02 destruct
319   elim (cpm_inv_bind1 … H1) -H1 *
320   [ #V1 #T1 #HV01 #HT01 #H1
321   | #T1 #HT01 #HXT1 #H11 #H12
322   ]
323   elim (cpm_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_lfpr_bind_bind/
328   | /4 width=11 by ex2_commute, cpr_conf_lfpr_bind_zeta/
329   | /3 width=11 by cpr_conf_lfpr_bind_zeta/
330   | /3 width=12 by cpr_conf_lfpr_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   | #p1 #V1 #Y1 #W1 #Z1 #T1 #HV01 #HYW1 #HZT1 #H11 #H12 #H13
337   | #p1 #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: #p2 #V2 #Y2 #W2 #Z2 #T2 #HV02 #HYW2 #HZT2 #H21 #H22 #H23
343   |4,8,12,16: #p2 #V2 #U2 #Y2 #W2 #Z2 #T2 #HV02 #HVU2 #HYW2 #HZT2 #H21 #H22 #H23
344   ] destruct
345   [ /3 width=10 by cpr_conf_lfpr_flat_flat/
346   | /4 width=8 by ex2_commute, cpr_conf_lfpr_flat_epsilon/
347   | /4 width=12 by ex2_commute, cpr_conf_lfpr_flat_beta/
348   | /4 width=14 by ex2_commute, cpr_conf_lfpr_flat_theta/
349   | /3 width=8 by cpr_conf_lfpr_flat_epsilon/
350   | /3 width=8 by cpr_conf_lfpr_epsilon_epsilon/
351   | /3 width=12 by cpr_conf_lfpr_flat_beta/
352   | /3 width=13 by cpr_conf_lfpr_beta_beta/
353   | /3 width=14 by cpr_conf_lfpr_flat_theta/
354   | /3 width=17 by cpr_conf_lfpr_theta_theta/
355   ]
356 ]
357 qed-.
358
359 (* Basic_1: includes: pr0_confluence pr2_confluence *)
360 theorem cpr_conf: ∀h,G,L. confluent … (cpm 0 h G L).
361 /2 width=6 by cpr_conf_lfpr/ qed-.
362
363 (* Properties with context-sensitive parallel r-transition for terms ********)
364
365 lemma lfpr_cpr_conf_dx: ∀h,G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡[h] T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡[h, T0] L1 →
366                         ∃∃T. ⦃G, L1⦄ ⊢ T0 ➡[h] T & ⦃G, L1⦄ ⊢ T1 ➡[h] T.
367 #h #G #L0 #T0 #T1 #HT01 #L1 #HL01
368 elim (cpr_conf_lfpr … HT01 T0 … HL01 … HL01) /2 width=3 by ex2_intro/
369 qed-.
370
371 lemma lfpr_cpr_conf_sn: ∀h,G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡[h] T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡[h, T0] L1 →
372                         ∃∃T. ⦃G, L1⦄ ⊢ T0 ➡[h] T & ⦃G, L0⦄ ⊢ T1 ➡[h] T.
373 #h #G #L0 #T0 #T1 #HT01 #L1 #HL01
374 elim (cpr_conf_lfpr … HT01 T0 … L0 … HL01) /2 width=3 by ex2_intro/
375 qed-.
376
377 (* Main properties **********************************************************)
378
379 theorem lfpr_conf: ∀h,G,T. confluent … (lfpr h G T).
380 /3 width=6 by cpr_conf_lfpr, lfpr_frees_conf, lfxs_conf/ qed-.