]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/computation/lpxs_cpxs.ma
381e6e939716b648dab8e8d5974088fdc6ff9ded
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / computation / lpxs_cpxs.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/computation/cpxs_cpxs.ma".
16 include "basic_2/computation/lpxs.ma".
17
18 (* SN EXTENDED PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS *******************)
19
20 (* Advanced properties ******************************************************)
21
22 lemma lpxs_pair: ∀h,g,I,L1,L2. ⦃h, L1⦄ ⊢ ➡*[h, g] L2 → ∀V1,V2. ⦃h, L1⦄ ⊢ V1 ➡*[h, g] V2 →
23                  ⦃h, L1.ⓑ{I}V1⦄ ⊢ ➡*[h, g] L2.ⓑ{I}V2.
24 /2 width=1 by TC_lpx_sn_pair/ qed.
25
26 (* Advanced inversion lemmas ************************************************)
27
28 lemma lpxs_inv_pair1: ∀h,g,I,K1,L2,V1. ⦃h, K1.ⓑ{I}V1⦄ ⊢ ➡*[h, g] L2 →
29                       ∃∃K2,V2. ⦃h, K1⦄ ⊢ ➡*[h, g] K2 & ⦃h, K1⦄ ⊢ V1 ➡*[h, g] V2 & L2 = K2.ⓑ{I}V2.
30 /3 width=3 by TC_lpx_sn_inv_pair1, lpx_cpxs_trans/ qed-.
31
32 lemma lpxs_inv_pair2: ∀h,g,I,L1,K2,V2. ⦃h, L1⦄ ⊢ ➡*[h, g] K2.ⓑ{I}V2 →
33                       ∃∃K1,V1. ⦃h, K1⦄ ⊢ ➡*[h, g] K2 & ⦃h, K1⦄ ⊢ V1 ➡*[h, g] V2 & L1 = K1.ⓑ{I}V1.
34 /3 width=3 by TC_lpx_sn_inv_pair2, lpx_cpxs_trans/ qed-.
35
36 (* Properties on context-sensitive extended parallel computation for terms **)
37
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-.
40
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-.
43
44 lemma cpxs_bind2: ∀h,g,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡*[h, g] V2 →
45                   ∀I,T1,T2. ⦃h, L.ⓑ{I}V2⦄ ⊢ T1 ➡*[h, g] T2 →
46                   ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ➡*[h, 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/
49 qed.
50
51 (* Inversion lemmas on context-sensitive ext parallel computation for terms *)
52
53 lemma cpxs_inv_abst1: ∀h,g,a,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓛ{a}V1.T1 ➡*[h, g] U2 →
54                       ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡*[h, g] V2 & ⦃h, L.ⓛV1⦄ ⊢ T1 ➡*[h, g] T2 &
55                                U2 = ⓛ{a}V2.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/
62 qed-.
63
64 lemma cpxs_inv_abbr1: ∀h,g,a,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓓ{a}V1.T1 ➡*[h, g] U2 → (
65                       ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡*[h, g] V2 & ⦃h, L.ⓓV1⦄ ⊢ T1 ➡*[h, g] T2 &
66                                U2 = ⓓ{a}V2.T2
67                       ) ∨
68                       ∃∃T2. ⦃h, L.ⓓV1⦄ ⊢ T1 ➡*[h, g] T2 & ⇧[0, 1] U2 ≡ T2 & a = true.
69 #h #g #a #L #V1 #T1 #U2 #H @(cpxs_ind … H) -U2 /3 width=5/
70 #U0 #U2 #_ #HU02 * *
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/
77   | #T2 #HT02 #HUT2
78     lapply (lpxs_cpx_trans … HT02 (L.ⓓV1) ?) -HT02 /2 width=1/ -V0 #HT02
79     lapply (cpxs_trans … HT10 … HT02) -T0 /3 width=3/
80   ]
81 | #U1 #HTU1 #HU01
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/
84 ]
85 qed-.
86
87 (* More advanced properties *************************************************)
88
89 lemma lpxs_pair2: ∀h,g,I,L1,L2. ⦃h, L1⦄ ⊢ ➡*[h, g] L2 →
90                   ∀V1,V2. ⦃h, L2⦄ ⊢ V1 ➡*[h, g] V2 → ⦃h, L1.ⓑ{I}V1⦄ ⊢ ➡*[h, g] L2.ⓑ{I}V2.
91 /3 width=3 by lpxs_pair, lpxs_cpxs_trans/ qed.