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,L1,L2. ⦃h, L1⦄ ⊢ ➡*[g] L2 → ∀V1,V2. ⦃h, L1⦄ ⊢ V1 ➡*[g] V2 →
23 ⦃h, L1.ⓑ{I}V1⦄ ⊢ ➡*[g] L2.ⓑ{I}V2.
24 /2 width=1 by TC_lpx_sn_pair/ qed.
26 (* Advanced inversion lemmas ************************************************)
28 lemma lpxs_inv_pair1: ∀h,g,I,K1,L2,V1. ⦃h, K1.ⓑ{I}V1⦄ ⊢ ➡*[g] L2 →
29 ∃∃K2,V2. ⦃h, K1⦄ ⊢ ➡*[g] K2 & ⦃h, K1⦄ ⊢ V1 ➡*[g] V2 & L2 = K2.ⓑ{I}V2.
30 /3 width=3 by TC_lpx_sn_inv_pair1, lpx_cpxs_trans/ qed-.
32 lemma lpxs_inv_pair2: ∀h,g,I,L1,K2,V2. ⦃h, L1⦄ ⊢ ➡*[g] K2.ⓑ{I}V2 →
33 ∃∃K1,V1. ⦃h, K1⦄ ⊢ ➡*[g] K2 & ⦃h, K1⦄ ⊢ V1 ➡*[g] V2 & L1 = K1.ⓑ{I}V1.
34 /3 width=3 by TC_lpx_sn_inv_pair2, lpx_cpxs_trans/ qed-.
36 (* Properties on context-sensitive extended parallel computation for terms **)
38 lemma lpxs_cpx_trans: ∀h,g. s_r_trans … (cpx h g) (lpxs h g).
39 /3 width=5 by s_r_trans_TC2, lpx_cpxs_trans/ qed-.
41 lemma lpxs_cpxs_trans: ∀h,g. s_rs_trans … (cpx h g) (lpxs h g).
42 /3 width=5 by s_r_trans_TC1, lpxs_cpx_trans/ qed-.
44 lemma cpxs_bind2: ∀h,g,L,V1,V2. ⦃h, L⦄ ⊢ V1 ➡*[g] V2 →
45 ∀I,T1,T2. ⦃h, L.ⓑ{I}V2⦄ ⊢ T1 ➡*[g] T2 →
46 ∀a. ⦃h, L⦄ ⊢ ⓑ{a,I}V1.T1 ➡*[g] ⓑ{a,I}V2.T2.
47 #h #g #L #V1 #V2 #HV12 #I #T1 #T2 #HT12
48 lapply (lpxs_cpxs_trans … HT12 (L.ⓑ{I}V1) ?) /2 width=1/
51 (* Inversion lemmas on context-sensitive ext parallel computation for terms *)
53 lemma cpxs_inv_abst1: ∀h,g,a,L,V1,T1,U2. ⦃h, L⦄ ⊢ ⓛ{a}V1.T1 ➡*[g] U2 →
54 ∃∃V2,T2. ⦃h, L⦄ ⊢ V1 ➡*[g] V2 & ⦃h, L.ⓛV1⦄ ⊢ T1 ➡*[g] T2 &
56 #h #g #a #L #V1 #T1 #U2 #H @(cpxs_ind … H) -U2 /2 width=5/
57 #U0 #U2 #_ #HU02 * #V0 #T0 #HV10 #HT10 #H destruct
58 elim (cpx_inv_abst1 … HU02) -HU02 #V2 #T2 #HV02 #HT02 #H destruct
59 lapply (lpxs_cpx_trans … HT02 (L.ⓛV1) ?) /2 width=1/ -HT02 #HT02
60 lapply (cpxs_strap1 … HV10 … HV02) -V0
61 lapply (cpxs_trans … HT10 … HT02) -T0 /2 width=5/
64 lemma cpxs_inv_abbr1: ∀h,g,a,L,V1,T1,U2. ⦃h, L⦄ ⊢ ⓓ{a}V1.T1 ➡*[g] U2 → (
65 ∃∃V2,T2. ⦃h, L⦄ ⊢ V1 ➡*[g] V2 & ⦃h, L.ⓓV1⦄ ⊢ T1 ➡*[g] T2 &
68 ∃∃T2. ⦃h, L.ⓓV1⦄ ⊢ T1 ➡*[g] T2 & ⇧[0, 1] U2 ≡ T2 & a = true.
69 #h #g #a #L #V1 #T1 #U2 #H @(cpxs_ind … H) -U2 /3 width=5/
71 [ #V0 #T0 #HV10 #HT10 #H destruct
72 elim (cpx_inv_abbr1 … HU02) -HU02 *
73 [ #V2 #T2 #HV02 #HT02 #H destruct
74 lapply (lpxs_cpx_trans … HT02 (L.ⓓV1) ?) /2 width=1/ -HT02 #HT02
75 lapply (cpxs_strap1 … HV10 … HV02) -V0
76 lapply (cpxs_trans … HT10 … HT02) -T0 /3 width=5/
78 lapply (lpxs_cpx_trans … HT02 (L.ⓓV1) ?) -HT02 /2 width=1/ -V0 #HT02
79 lapply (cpxs_trans … HT10 … HT02) -T0 /3 width=3/
82 elim (lift_total U2 0 1) #U #HU2
83 lapply (cpx_lift … HU02 (L.ⓓV1) … HU01 … HU2) -U0 /2 width=1/ /4 width=3/
87 (* More advanced properties *************************************************)
89 lemma lpxs_pair2: ∀h,g,I,L1,L2. ⦃h, L1⦄ ⊢ ➡*[g] L2 →
90 ∀V1,V2. ⦃h, L2⦄ ⊢ V1 ➡*[g] V2 → ⦃h, L1.ⓑ{I}V1⦄ ⊢ ➡*[g] L2.ⓑ{I}V2.
91 /3 width=3 by lpxs_pair, lpxs_cpxs_trans/ qed.