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/computation/cpxs_cpxs.ma".
16 include "basic_2/computation/lpxs.ma".
18 (* SN EXTENDED PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS *******************)
20 (* Advanced properties ******************************************************)
22 lemma lpxs_pair: ∀h,g,I,G,L1,L2. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 →
23 ∀V1,V2. ⦃G, L1⦄ ⊢ V1 ➡*[h, g] V2 →
24 ⦃G, L1.ⓑ{I}V1⦄ ⊢ ➡*[h, g] L2.ⓑ{I}V2.
25 /2 width=1 by TC_lpx_sn_pair/ qed.
27 (* Advanced inversion lemmas ************************************************)
29 lemma lpxs_inv_pair1: ∀h,g,I,G,K1,L2,V1. ⦃G, K1.ⓑ{I}V1⦄ ⊢ ➡*[h, g] L2 →
30 ∃∃K2,V2. ⦃G, K1⦄ ⊢ ➡*[h, g] K2 & ⦃G, K1⦄ ⊢ V1 ➡*[h, g] V2 & L2 = K2.ⓑ{I}V2.
31 /3 width=3 by TC_lpx_sn_inv_pair1, lpx_cpxs_trans/ qed-.
33 lemma lpxs_inv_pair2: ∀h,g,I,G,L1,K2,V2. ⦃G, L1⦄ ⊢ ➡*[h, g] K2.ⓑ{I}V2 →
34 ∃∃K1,V1. ⦃G, K1⦄ ⊢ ➡*[h, g] K2 & ⦃G, K1⦄ ⊢ V1 ➡*[h, g] V2 & L1 = K1.ⓑ{I}V1.
35 /3 width=3 by TC_lpx_sn_inv_pair2, lpx_cpxs_trans/ qed-.
37 (* Properties on context-sensitive extended parallel computation for terms **)
39 lemma lpxs_cpx_trans: ∀h,g,G. s_r_trans … (cpx h g G) (lpxs h g G).
40 /3 width=5 by s_r_trans_TC2, lpx_cpxs_trans/ qed-.
42 lemma lpxs_cpxs_trans: ∀h,g,G. s_rs_trans … (cpx h g G) (lpxs h g G).
43 /3 width=5 by s_r_trans_TC1, lpxs_cpx_trans/ qed-.
45 lemma cpxs_bind2: ∀h,g,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡*[h, g] V2 →
46 ∀I,T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ➡*[h, g] T2 →
47 ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ➡*[h, g] ⓑ{a,I}V2.T2.
48 #h #g #G #L #V1 #V2 #HV12 #I #T1 #T2 #HT12
49 lapply (lpxs_cpxs_trans … HT12 (L.ⓑ{I}V1) ?) /2 width=1/
52 (* Inversion lemmas on context-sensitive ext parallel computation for terms *)
54 lemma cpxs_inv_abst1: ∀h,g,a,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓛ{a}V1.T1 ➡*[h, g] U2 →
55 ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡*[h, g] V2 & ⦃G, L.ⓛV1⦄ ⊢ T1 ➡*[h, g] T2 &
57 #h #g #a #G #L #V1 #T1 #U2 #H @(cpxs_ind … H) -U2 /2 width=5/
58 #U0 #U2 #_ #HU02 * #V0 #T0 #HV10 #HT10 #H destruct
59 elim (cpx_inv_abst1 … HU02) -HU02 #V2 #T2 #HV02 #HT02 #H destruct
60 lapply (lpxs_cpx_trans … HT02 (L.ⓛV1) ?) /2 width=1/ -HT02 #HT02
61 lapply (cpxs_strap1 … HV10 … HV02) -V0
62 lapply (cpxs_trans … HT10 … HT02) -T0 /2 width=5/
65 lemma cpxs_inv_abbr1: ∀h,g,a,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓓ{a}V1.T1 ➡*[h, g] U2 → (
66 ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡*[h, g] V2 & ⦃G, L.ⓓV1⦄ ⊢ T1 ➡*[h, g] T2 &
69 ∃∃T2. ⦃G, L.ⓓV1⦄ ⊢ T1 ➡*[h, g] T2 & ⇧[0, 1] U2 ≡ T2 & a = true.
70 #h #g #a #G #L #V1 #T1 #U2 #H @(cpxs_ind … H) -U2 /3 width=5/
72 [ #V0 #T0 #HV10 #HT10 #H destruct
73 elim (cpx_inv_abbr1 … HU02) -HU02 *
74 [ #V2 #T2 #HV02 #HT02 #H destruct
75 lapply (lpxs_cpx_trans … HT02 (L.ⓓV1) ?) /2 width=1/ -HT02 #HT02
76 lapply (cpxs_strap1 … HV10 … HV02) -V0
77 lapply (cpxs_trans … HT10 … HT02) -T0 /3 width=5/
79 lapply (lpxs_cpx_trans … HT02 (L.ⓓV1) ?) -HT02 /2 width=1/ -V0 #HT02
80 lapply (cpxs_trans … HT10 … HT02) -T0 /3 width=3/
83 elim (lift_total U2 0 1) #U #HU2
84 lapply (cpx_lift … HU02 (L.ⓓV1) … HU01 … HU2) -U0 /2 width=1/ /4 width=3/
88 (* More advanced properties *************************************************)
90 lemma lpxs_pair2: ∀h,g,I,G,L1,L2. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 →
91 ∀V1,V2. ⦃G, L2⦄ ⊢ V1 ➡*[h, g] V2 → ⦃G, L1.ⓑ{I}V1⦄ ⊢ ➡*[h, g] L2.ⓑ{I}V2.
92 /3 width=3 by lpxs_pair, lpxs_cpxs_trans/ qed.