1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
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".
23 (* PARALLEL R-TRANSITION FOR LOCAL ENV.S ON REFERRED ENTRIES ****************)
25 (* Main properties with context-sensitive parallel r-transition for terms ***)
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-.
31 fact cpr_conf_lfpr_atom_delta:
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
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_pair_sn … HL01 … HLK0) -HL01 #K1 #V1 #HLK1 #HK01 #HV01
44 elim (lfpr_inv_lref_pair_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_sn … HV2 … HLK2 … HVT2) -K2 -V2
49 /3 width=6 by cpm_delta_drops, ex2_intro/
52 (* Note: we don't use cpm_lifts_bi to preserve visual symmetry *)
53 fact cpr_conf_lfpr_delta_delta:
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
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_pair_sn … HL01 … HLK0) -HL01 #K1 #W1 #HLK1 #HK01 #_
70 lapply (drops_isuni_fwd_drop2 … HLK1) -W1 // #HLK1
71 elim (lfpr_inv_lref_pair_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_sn … HV1 … HLK1 … HVT1) -K1 -V1 #T #HVT #HT1
76 elim (cpm_lifts_sn … HV2 … HLK2 … HVT2) -K2 -V2 #X #HX #HT2
77 lapply (lifts_mono … HX … HVT) #H destruct
78 /2 width=3 by ex2_intro/
81 fact cpr_conf_lfpr_bind_bind:
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
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_bind_repl_dx, cpm_bind, ext2_pair, ex2_intro/
101 fact cpr_conf_lfpr_bind_zeta:
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
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 /3 width=4 by lfpr_bind_repl_dx, ext2_pair/ -L0 -V0 -T0 #T #HT1 #HT2
117 elim (cpm_inv_lifts_sn … HT2 … L2 … HXT2) -T2 /3 width=3 by drops_refl, drops_drop, cpm_zeta, ex2_intro/
120 (* Note: we don't use cpm_inv_lifts_bi to preserve visual symmetry *)
121 fact cpr_conf_lfpr_zeta_zeta:
123 ∀L,T. ⦃G, L0, +ⓓV0.T0⦄ ⊐+ ⦃G, L, T⦄ →
124 ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
125 ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
126 ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
128 ∀T1. ⦃G, L0.ⓓV0⦄ ⊢ T0 ➡[h] T1 → ∀X1. ⬆*[1] X1 ≡ T1 →
129 ∀T2. ⦃G, L0.ⓓV0⦄ ⊢ T0 ➡[h] T2 → ∀X2. ⬆*[1] X2 ≡ T2 →
130 ∀L1. ⦃G, L0⦄ ⊢ ➡[h, +ⓓV0.T0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, +ⓓV0.T0] L2 →
131 ∃∃T. ⦃G, L1⦄ ⊢ X1 ➡[h] T & ⦃G, L2⦄ ⊢ X2 ➡[h] T.
132 #h #G #L0 #V0 #T0 #IH #T1 #HT01 #X1 #HXT1
133 #T2 #HT02 #X2 #HXT2 #L1 #HL01 #L2 #HL02
134 elim (lfpr_inv_bind … HL01) -HL01 #H1V0 #H1T0
135 elim (lfpr_inv_bind … HL02) -HL02 #H2V0 #H2T0
136 elim (IH … HT01 … HT02 (L1.ⓓV0) … (L2.ⓓV0)) -IH -HT01 -HT02 /3 width=4 by lfpr_bind_repl_dx, ext2_pair/ -L0 -T0 #T #HT1 #HT2
137 elim (cpm_inv_lifts_sn … HT1 … L1 … HXT1) -T1 /3 width=2 by drops_refl, drops_drop/ #T1 #HT1 #HXT1
138 elim (cpm_inv_lifts_sn … HT2 … L2 … HXT2) -T2 /3 width=2 by drops_refl, drops_drop/ #T2 #HT2 #HXT2
139 lapply (lifts_inj … HT2 … HT1) -T #H destruct /2 width=3 by ex2_intro/
142 fact cpr_conf_lfpr_flat_flat:
144 ∀L,T. ⦃G, L0, ⓕ{I}V0.T0⦄ ⊐+ ⦃G, L, T⦄ →
145 ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
146 ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
147 ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
149 ∀V1. ⦃G, L0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⦃G, L0⦄ ⊢ T0 ➡[h] T1 →
150 ∀V2. ⦃G, L0⦄ ⊢ V0 ➡[h] V2 → ∀T2. ⦃G, L0⦄ ⊢ T0 ➡[h] T2 →
151 ∀L1. ⦃G, L0⦄ ⊢ ➡[h, ⓕ{I}V0.T0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, ⓕ{I}V0.T0] L2 →
152 ∃∃T. ⦃G, L1⦄ ⊢ ⓕ{I}V1.T1 ➡[h] T & ⦃G, L2⦄ ⊢ ⓕ{I}V2.T2 ➡[h] T.
153 #h #I #G #L0 #V0 #T0 #IH #V1 #HV01 #T1 #HT01
154 #V2 #HV02 #T2 #HT02 #L1 #HL01 #L2 #HL02
155 elim (lfpr_inv_flat … HL01) -HL01 #H1V0 #H1T0
156 elim (lfpr_inv_flat … HL02) -HL02 #H2V0 #H2T0
157 elim (IH … HV01 … HV02 … H1V0 … H2V0) //
158 elim (IH … HT01 … HT02 … H1T0 … H2T0) /3 width=5 by cpr_flat, ex2_intro/
161 fact cpr_conf_lfpr_flat_epsilon:
163 ∀L,T. ⦃G, L0, ⓝV0.T0⦄ ⊐+ ⦃G, L, T⦄ →
164 ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
165 ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
166 ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
168 ∀V1,T1. ⦃G, L0⦄ ⊢ T0 ➡[h] T1 → ∀T2. ⦃G, L0⦄ ⊢ T0 ➡[h] T2 →
169 ∀L1. ⦃G, L0⦄ ⊢ ➡[h, ⓝV0.T0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, ⓝV0.T0] L2 →
170 ∃∃T. ⦃G, L1⦄ ⊢ ⓝV1.T1 ➡[h] T & ⦃G, L2⦄ ⊢ T2 ➡[h] T.
171 #h #G #L0 #V0 #T0 #IH #V1 #T1 #HT01
172 #T2 #HT02 #L1 #HL01 #L2 #HL02
173 elim (lfpr_inv_flat … HL01) -HL01 #_ #H1T0
174 elim (lfpr_inv_flat … HL02) -HL02 #_ #H2T0
175 elim (IH … HT01 … HT02 … H1T0 … H2T0) // -L0 -V0 -T0 /3 width=3 by cpm_eps, ex2_intro/
178 fact cpr_conf_lfpr_epsilon_epsilon:
180 ∀L,T. ⦃G, L0, ⓝV0.T0⦄ ⊐+ ⦃G, L, T⦄ →
181 ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
182 ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
183 ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
185 ∀T1. ⦃G, L0⦄ ⊢ T0 ➡[h] T1 → ∀T2. ⦃G, L0⦄ ⊢ T0 ➡[h] T2 →
186 ∀L1. ⦃G, L0⦄ ⊢ ➡[h, ⓝV0.T0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, ⓝV0.T0] L2 →
187 ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡[h] T & ⦃G, L2⦄ ⊢ T2 ➡[h] T.
188 #h #G #L0 #V0 #T0 #IH #T1 #HT01
189 #T2 #HT02 #L1 #HL01 #L2 #HL02
190 elim (lfpr_inv_flat … HL01) -HL01 #_ #H1T0
191 elim (lfpr_inv_flat … HL02) -HL02 #_ #H2T0
192 elim (IH … HT01 … HT02 … H1T0 … H2T0) // -L0 -V0 -T0 /2 width=3 by ex2_intro/
195 fact cpr_conf_lfpr_flat_beta:
196 ∀h,p,G,L0,V0,W0,T0. (
197 ∀L,T. ⦃G, L0, ⓐV0.ⓛ{p}W0.T0⦄ ⊐+ ⦃G, L, T⦄ →
198 ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
199 ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
200 ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
202 ∀V1. ⦃G, L0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⦃G, L0⦄ ⊢ ⓛ{p}W0.T0 ➡[h] T1 →
203 ∀V2. ⦃G, L0⦄ ⊢ V0 ➡[h] V2 → ∀W2. ⦃G, L0⦄ ⊢ W0 ➡[h] W2 → ∀T2. ⦃G, L0.ⓛW0⦄ ⊢ T0 ➡[h] T2 →
204 ∀L1. ⦃G, L0⦄ ⊢ ➡[h, ⓐV0.ⓛ{p}W0.T0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, ⓐV0.ⓛ{p}W0.T0] L2 →
205 ∃∃T. ⦃G, L1⦄ ⊢ ⓐV1.T1 ➡[h] T & ⦃G, L2⦄ ⊢ ⓓ{p}ⓝW2.V2.T2 ➡[h] T.
206 #h #p #G #L0 #V0 #W0 #T0 #IH #V1 #HV01 #X #H
207 #V2 #HV02 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02
208 elim (cpm_inv_abst1 … H) -H #W1 #T1 #HW01 #HT01 #H destruct
209 elim (lfpr_inv_flat … HL01) -HL01 #H1V0 #HL01
210 elim (lfpr_inv_bind … HL01) -HL01 #H1W0 #H1T0
211 elim (lfpr_inv_flat … HL02) -HL02 #H2V0 #HL02
212 elim (lfpr_inv_bind … HL02) -HL02 #H2W0 #H2T0
213 elim (IH … HV01 … HV02 … H1V0 … H2V0) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2
214 elim (IH … HW01 … HW02 … H1W0 … H2W0) /2 width=1 by/ #W #HW1 #HW2
215 elim (IH … HT01 … HT02 (L1.ⓛW1) … (L2.ⓛW2)) /3 width=4 by lfpr_bind_repl_dx, ext2_pair/ -L0 -V0 -W0 -T0 #T #HT1 #HT2
216 lapply (lsubr_cpm_trans … HT2 (L2.ⓓⓝW2.V2) ?) -HT2 /2 width=1 by lsubr_beta/ (**) (* full auto not tried *)
217 /4 width=5 by cpm_bind, cpr_flat, cpm_beta, ex2_intro/
220 fact cpr_conf_lfpr_flat_theta:
221 ∀h,p,G,L0,V0,W0,T0. (
222 ∀L,T. ⦃G, L0, ⓐV0.ⓓ{p}W0.T0⦄ ⊐+ ⦃G, L, T⦄ →
223 ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
224 ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
225 ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
227 ∀V1. ⦃G, L0⦄ ⊢ V0 ➡[h] V1 → ∀T1. ⦃G, L0⦄ ⊢ ⓓ{p}W0.T0 ➡[h] T1 →
228 ∀V2. ⦃G, L0⦄ ⊢ V0 ➡[h] V2 → ∀U2. ⬆*[1] V2 ≡ U2 →
229 ∀W2. ⦃G, L0⦄ ⊢ W0 ➡[h] W2 → ∀T2. ⦃G, L0.ⓓW0⦄ ⊢ T0 ➡[h] T2 →
230 ∀L1. ⦃G, L0⦄ ⊢ ➡[h, ⓐV0.ⓓ{p}W0.T0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, ⓐV0.ⓓ{p}W0.T0] L2 →
231 ∃∃T. ⦃G, L1⦄ ⊢ ⓐV1.T1 ➡[h] T & ⦃G, L2⦄ ⊢ ⓓ{p}W2.ⓐU2.T2 ➡[h] T.
232 #h #p #G #L0 #V0 #W0 #T0 #IH #V1 #HV01 #X #H
233 #V2 #HV02 #U2 #HVU2 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02
234 elim (lfpr_inv_flat … HL01) -HL01 #H1V0 #HL01
235 elim (lfpr_inv_bind … HL01) -HL01 #H1W0 #H1T0
236 elim (lfpr_inv_flat … HL02) -HL02 #H2V0 #HL02
237 elim (lfpr_inv_bind … HL02) -HL02 #H2W0 #H2T0
238 elim (IH … HV01 … HV02 … H1V0 … H2V0) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2
239 elim (cpm_lifts_sn … HV2 … (L2.ⓓW2) … HVU2) -HVU2 /3 width=2 by drops_refl, drops_drop/ #U #HVU #HU2
240 elim (cpm_inv_abbr1 … H) -H *
241 [ #W1 #T1 #HW01 #HT01 #H destruct
242 elim (IH … HW01 … HW02 … H1W0 … H2W0) /2 width=1 by/
243 elim (IH … HT01 … HT02 (L1.ⓓW1) … (L2.ⓓW2)) /3 width=4 by lfpr_bind_repl_dx, ext2_pair/ -L0 -V0 -W0 -T0
244 /4 width=7 by cpm_bind, cpr_flat, cpm_theta, ex2_intro/
245 | #T1 #HT01 #HXT1 #H destruct
246 elim (IH … HT01 … HT02 (L1.ⓓW2) … (L2.ⓓW2)) /3 width=4 by lfpr_bind_repl_dx, ext2_pair/ -L0 -V0 -W0 -T0 #T #HT1 #HT2
247 elim (cpm_inv_lifts_sn … HT1 … L1 … HXT1) -HXT1
248 /4 width=9 by cpr_flat, cpm_zeta, drops_refl, drops_drop, lifts_flat, ex2_intro/
252 fact cpr_conf_lfpr_beta_beta:
253 ∀h,p,G,L0,V0,W0,T0. (
254 ∀L,T. ⦃G, L0, ⓐV0.ⓛ{p}W0.T0⦄ ⊐+ ⦃G, L, T⦄ →
255 ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
256 ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
257 ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
259 ∀V1. ⦃G, L0⦄ ⊢ V0 ➡[h] V1 → ∀W1. ⦃G, L0⦄ ⊢ W0 ➡[h] W1 → ∀T1. ⦃G, L0.ⓛW0⦄ ⊢ T0 ➡[h] T1 →
260 ∀V2. ⦃G, L0⦄ ⊢ V0 ➡[h] V2 → ∀W2. ⦃G, L0⦄ ⊢ W0 ➡[h] W2 → ∀T2. ⦃G, L0.ⓛW0⦄ ⊢ T0 ➡[h] T2 →
261 ∀L1. ⦃G, L0⦄ ⊢ ➡[h, ⓐV0.ⓛ{p}W0.T0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, ⓐV0.ⓛ{p}W0.T0] L2 →
262 ∃∃T. ⦃G, L1⦄ ⊢ ⓓ{p}ⓝW1.V1.T1 ➡[h] T & ⦃G, L2⦄ ⊢ ⓓ{p}ⓝW2.V2.T2 ➡[h] T.
263 #h #p #G #L0 #V0 #W0 #T0 #IH #V1 #HV01 #W1 #HW01 #T1 #HT01
264 #V2 #HV02 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02
265 elim (lfpr_inv_flat … HL01) -HL01 #H1V0 #HL01
266 elim (lfpr_inv_bind … HL01) -HL01 #H1W0 #H1T0
267 elim (lfpr_inv_flat … HL02) -HL02 #H2V0 #HL02
268 elim (lfpr_inv_bind … HL02) -HL02 #H2W0 #H2T0
269 elim (IH … HV01 … HV02 … H1V0 … H2V0) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2
270 elim (IH … HW01 … HW02 … H1W0 … H2W0) /2 width=1/ #W #HW1 #HW2
271 elim (IH … HT01 … HT02 (L1.ⓛW1) … (L2.ⓛW2)) /3 width=4 by lfpr_bind_repl_dx, ext2_pair/ -L0 -V0 -W0 -T0 #T #HT1 #HT2
272 lapply (lsubr_cpm_trans … HT1 (L1.ⓓⓝW1.V1) ?) -HT1 /2 width=1 by lsubr_beta/
273 lapply (lsubr_cpm_trans … HT2 (L2.ⓓⓝW2.V2) ?) -HT2 /2 width=1 by lsubr_beta/
274 /4 width=5 by cpm_bind, cpr_flat, ex2_intro/ (**) (* full auto not tried *)
277 (* Note: we don't use cpm_lifts_bi to preserve visual symmetry *)
278 fact cpr_conf_lfpr_theta_theta:
279 ∀h,p,G,L0,V0,W0,T0. (
280 ∀L,T. ⦃G, L0, ⓐV0.ⓓ{p}W0.T0⦄ ⊐+ ⦃G, L, T⦄ →
281 ∀T1. ⦃G, L⦄ ⊢ T ➡[h] T1 → ∀T2. ⦃G, L⦄ ⊢ T ➡[h] T2 →
282 ∀L1. ⦃G, L⦄ ⊢ ➡[h, T] L1 → ∀L2. ⦃G, L⦄ ⊢ ➡[h, T] L2 →
283 ∃∃T0. ⦃G, L1⦄ ⊢ T1 ➡[h] T0 & ⦃G, L2⦄ ⊢ T2 ➡[h] T0
285 ∀V1. ⦃G, L0⦄ ⊢ V0 ➡[h] V1 → ∀U1. ⬆*[1] V1 ≡ U1 →
286 ∀W1. ⦃G, L0⦄ ⊢ W0 ➡[h] W1 → ∀T1. ⦃G, L0.ⓓW0⦄ ⊢ T0 ➡[h] T1 →
287 ∀V2. ⦃G, L0⦄ ⊢ V0 ➡[h] V2 → ∀U2. ⬆*[1] V2 ≡ U2 →
288 ∀W2. ⦃G, L0⦄ ⊢ W0 ➡[h] W2 → ∀T2. ⦃G, L0.ⓓW0⦄ ⊢ T0 ➡[h] T2 →
289 ∀L1. ⦃G, L0⦄ ⊢ ➡[h, ⓐV0.ⓓ{p}W0.T0] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h, ⓐV0.ⓓ{p}W0.T0] L2 →
290 ∃∃T. ⦃G, L1⦄ ⊢ ⓓ{p}W1.ⓐU1.T1 ➡[h] T & ⦃G, L2⦄ ⊢ ⓓ{p}W2.ⓐU2.T2 ➡[h] T.
291 #h #p #G #L0 #V0 #W0 #T0 #IH #V1 #HV01 #U1 #HVU1 #W1 #HW01 #T1 #HT01
292 #V2 #HV02 #U2 #HVU2 #W2 #HW02 #T2 #HT02 #L1 #HL01 #L2 #HL02
293 elim (lfpr_inv_flat … HL01) -HL01 #H1V0 #HL01
294 elim (lfpr_inv_bind … HL01) -HL01 #H1W0 #H1T0
295 elim (lfpr_inv_flat … HL02) -HL02 #H2V0 #HL02
296 elim (lfpr_inv_bind … HL02) -HL02 #H2W0 #H2T0
297 elim (IH … HV01 … HV02 … H1V0 … H2V0) -HV01 -HV02 /2 width=1 by/ #V #HV1 #HV2
298 elim (IH … HW01 … HW02 … H1W0 … H2W0) /2 width=1 by/
299 elim (IH … HT01 … HT02 (L1.ⓓW1) … (L2.ⓓW2)) /3 width=4 by lfpr_bind_repl_dx, ext2_pair/ -L0 -V0 -W0 -T0
300 elim (cpm_lifts_sn … HV1 … (L1.ⓓW1) … HVU1) -HVU1 /3 width=2 by drops_refl, drops_drop/ #U #HVU
301 elim (cpm_lifts_sn … HV2 … (L2.ⓓW2) … HVU2) -HVU2 /3 width=2 by drops_refl, drops_drop/ #X #HX
302 lapply (lifts_mono … HX … HVU) -HX #H destruct
303 /4 width=7 by cpm_bind, cpr_flat, ex2_intro/ (**) (* full auto not tried *)
306 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).
307 #h #G #L0 #T0 @(fqup_wf_ind_eq (Ⓣ) … G L0 T0) -G -L0 -T0 #G #L #T #IH #G0 #L0 * [| * ]
308 [ #I0 #HG #HL #HT #T1 #H1 #T2 #H2 #L1 #HL01 #L2 #HL02 destruct
309 elim (cpr_inv_atom1_drops … H1) -H1
310 elim (cpr_inv_atom1_drops … H2) -H2
312 /2 width=1 by cpr_conf_lfpr_atom_atom/
313 | * #K0 #V0 #V2 #i2 #HLK0 #HV02 #HVT2 #H2 #H1 destruct
314 /3 width=10 by cpr_conf_lfpr_atom_delta/
315 | #H2 * #K0 #V0 #V1 #i1 #HLK0 #HV01 #HVT1 #H1 destruct
316 /4 width=10 by ex2_commute, cpr_conf_lfpr_atom_delta/
317 | * #X #Y #V2 #z #H #HV02 #HVT2 #H2
318 * #K0 #V0 #V1 #i #HLK0 #HV01 #HVT1 #H1 destruct
319 /3 width=17 by cpr_conf_lfpr_delta_delta/
321 | #p #I #V0 #T0 #HG #HL #HT #X1 #H1 #X2 #H2 #L1 #HL01 #L2 #HL02 destruct
322 elim (cpm_inv_bind1 … H1) -H1 *
323 [ #V1 #T1 #HV01 #HT01 #H1
324 | #T1 #HT01 #HXT1 #H11 #H12
326 elim (cpm_inv_bind1 … H2) -H2 *
327 [1,3: #V2 #T2 #HV02 #HT02 #H2
328 |2,4: #T2 #HT02 #HXT2 #H21 #H22
330 [ /3 width=10 by cpr_conf_lfpr_bind_bind/
331 | /4 width=11 by ex2_commute, cpr_conf_lfpr_bind_zeta/
332 | /3 width=11 by cpr_conf_lfpr_bind_zeta/
333 | /3 width=12 by cpr_conf_lfpr_zeta_zeta/
335 | #I #V0 #T0 #HG #HL #HT #X1 #H1 #X2 #H2 #L1 #HL01 #L2 #HL02 destruct
336 elim (cpr_inv_flat1 … H1) -H1 *
337 [ #V1 #T1 #HV01 #HT01 #H1
339 | #p1 #V1 #Y1 #W1 #Z1 #T1 #HV01 #HYW1 #HZT1 #H11 #H12 #H13
340 | #p1 #V1 #U1 #Y1 #W1 #Z1 #T1 #HV01 #HVU1 #HYW1 #HZT1 #H11 #H12 #H13
342 elim (cpr_inv_flat1 … H2) -H2 *
343 [1,5,9,13: #V2 #T2 #HV02 #HT02 #H2
345 |3,7,11,15: #p2 #V2 #Y2 #W2 #Z2 #T2 #HV02 #HYW2 #HZT2 #H21 #H22 #H23
346 |4,8,12,16: #p2 #V2 #U2 #Y2 #W2 #Z2 #T2 #HV02 #HVU2 #HYW2 #HZT2 #H21 #H22 #H23
348 [ /3 width=10 by cpr_conf_lfpr_flat_flat/
349 | /4 width=8 by ex2_commute, cpr_conf_lfpr_flat_epsilon/
350 | /4 width=12 by ex2_commute, cpr_conf_lfpr_flat_beta/
351 | /4 width=14 by ex2_commute, cpr_conf_lfpr_flat_theta/
352 | /3 width=8 by cpr_conf_lfpr_flat_epsilon/
353 | /3 width=8 by cpr_conf_lfpr_epsilon_epsilon/
354 | /3 width=12 by cpr_conf_lfpr_flat_beta/
355 | /3 width=13 by cpr_conf_lfpr_beta_beta/
356 | /3 width=14 by cpr_conf_lfpr_flat_theta/
357 | /3 width=17 by cpr_conf_lfpr_theta_theta/
362 (* Basic_1: includes: pr0_confluence pr2_confluence *)
363 theorem cpr_conf: ∀h,G,L. confluent … (cpm 0 h G L).
364 /2 width=6 by cpr_conf_lfpr/ qed-.
366 (* Properties with context-sensitive parallel r-transition for terms ********)
368 lemma lfpr_cpr_conf_dx: ∀h,G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡[h] T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡[h, T0] L1 →
369 ∃∃T. ⦃G, L1⦄ ⊢ T0 ➡[h] T & ⦃G, L1⦄ ⊢ T1 ➡[h] T.
370 #h #G #L0 #T0 #T1 #HT01 #L1 #HL01
371 elim (cpr_conf_lfpr … HT01 T0 … HL01 … HL01) /2 width=3 by ex2_intro/
374 lemma lfpr_cpr_conf_sn: ∀h,G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡[h] T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡[h, T0] L1 →
375 ∃∃T. ⦃G, L1⦄ ⊢ T0 ➡[h] T & ⦃G, L0⦄ ⊢ T1 ➡[h] T.
376 #h #G #L0 #T0 #T1 #HT01 #L1 #HL01
377 elim (cpr_conf_lfpr … HT01 T0 … L0 … HL01) /2 width=3 by ex2_intro/
380 (* Main properties **********************************************************)
382 theorem lfpr_conf: ∀h,G,T. confluent … (lfpr h G T).
383 /3 width=6 by cpr_conf_lfpr, lfpr_frees_conf, lfxs_conf/ qed-.
385 theorem lfpr_bind: ∀h,G,L1,L2,V1. ⦃G, L1⦄ ⊢ ➡[h, V1] L2 →
386 ∀I,V2,T. ⦃G, L1.ⓑ{I}V1⦄ ⊢ ➡[h, T] L2.ⓑ{I}V2 →
387 ∀p. ⦃G, L1⦄ ⊢ ➡[h, ⓑ{p,I}V1.T] L2.
388 /2 width=2 by lfxs_bind/ qed.
390 theorem lfpr_flat: ∀h,G,L1,L2,V. ⦃G, L1⦄ ⊢ ➡[h, V] L2 →
391 ∀I,T. ⦃G, L1⦄ ⊢ ➡[h, T] L2 → ⦃G, L1⦄ ⊢ ➡[h, ⓕ{I}V.T] L2.
392 /2 width=1 by lfxs_flat/ qed.
394 theorem lfpr_bind_void: ∀h,G,L1,L2,V. ⦃G, L1⦄ ⊢ ➡[h, V] L2 →
395 ∀T. ⦃G, L1.ⓧ⦄ ⊢ ➡[h, T] L2.ⓧ →
396 ∀p,I. ⦃G, L1⦄ ⊢ ➡[h, ⓑ{p,I}V.T] L2.
397 /2 width=1 by lfxs_bind_void/ qed.