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