]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/computation/cpxs_lift.ma
- degree assignment, static type assignment, iterated static type
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / computation / cpxs_lift.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/substitution/fsups_fsups.ma".
16 include "basic_2/unfold/lsstas_lift.ma".
17 include "basic_2/reduction/cpx_lift.ma".
18 include "basic_2/computation/cpxs.ma".
19
20 (* CONTEXT-SENSITIVE EXTENDED PARALLEL COMPUTATION ON TERMS *****************)
21
22 (* Advanced properties ******************************************************)
23
24 lemma lsstas_cpxs: ∀h,g,G,L,T1,T2,l1. ⦃G, L⦄ ⊢ T1 •* [h, g, l1] T2 →
25                    ∀l2. ⦃G, L⦄ ⊢ T1 ▪ [h, g] l2 → l1 ≤ l2 → ⦃G, L⦄ ⊢ T1 ➡*[h, g] T2.
26 #h #g #G #L #T1 #T2 #l1 #H @(lsstas_ind_dx … H) -T2 -l1 //
27 #l1 #T #T2 #HT1 #HT2 #IHT1 #l2 #Hl2 #Hl12
28 lapply (lsstas_da_conf … HT1 … Hl2) -HT1
29 >(plus_minus_m_m (l2-l1) 1 ?) [2: /2 width=1/ ]
30 /4 width=5 by cpxs_strap1, ssta_cpx, lt_to_le/
31 qed.
32
33 lemma cpxs_delta: ∀h,g,I,G,L,K,V,V2,i.
34                   ⇩[0, i] L ≡ K.ⓑ{I}V → ⦃G, K⦄ ⊢ V ➡*[h, g] V2 →
35                   ∀W2. ⇧[0, i + 1] V2 ≡ W2 → ⦃G, L⦄ ⊢ #i ➡*[h, g] W2.
36 #h #g #I #G #L #K #V #V2 #i #HLK #H elim H -V2 [ /3 width=9/ ]
37 #V1 #V2 #_ #HV12 #IHV1 #W2 #HVW2
38 lapply (ldrop_fwd_ldrop2 … HLK) -HLK #HLK
39 elim (lift_total V1 0 (i+1)) /4 width=11 by cpx_lift, cpxs_strap1/
40 qed.
41
42 (* Advanced inversion lemmas ************************************************)
43
44 lemma cpxs_inv_lref1: ∀h,g,G,L,T2,i. ⦃G, L⦄ ⊢ #i ➡*[h, g] T2 →
45                       T2 = #i ∨
46                       ∃∃I,K,V1,T1. ⇩[0, i] L ≡ K.ⓑ{I}V1 & ⦃G, K⦄ ⊢ V1 ➡*[h, g] T1 &
47                                    ⇧[0, i + 1] T1 ≡ T2.
48 #h #g #G #L #T2 #i #H @(cpxs_ind … H) -T2 /2 width=1/
49 #T #T2 #_ #HT2 *
50 [ #H destruct
51   elim (cpx_inv_lref1 … HT2) -HT2 /2 width=1/
52   * /4 width=7/
53 | * #I #K #V1 #T1 #HLK #HVT1 #HT1
54   lapply (ldrop_fwd_ldrop2 … HLK) #H0LK
55   elim (cpx_inv_lift1 … HT2 … H0LK … HT1) -H0LK -T /4 width=7/
56 ]
57 qed-.
58
59 (* Relocation properties ****************************************************)
60
61 lemma cpxs_lift: ∀h,g,G. l_liftable (cpxs h g G).
62 /3 width=9/ qed.
63
64 lemma cpxs_inv_lift1: ∀h,g,G. l_deliftable_sn (cpxs h g G).
65 /3 width=5 by l_deliftable_sn_LTC, cpx_inv_lift1/
66 qed-.
67
68 (* Properties on supclosure *************************************************)
69
70 lemma fsupq_cpxs_trans: ∀h,g,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡*[h, g] U2 →
71                         ∀T1. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ →
72                         ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊃* ⦃G2, L2, U2⦄.
73 #h #g #G1 #G2 #L1 #L2 #T2 #U2 #H @(cpxs_ind_dx … H) -T2 [ /3 width=3/ ]
74 #T #T2 #HT2 #_ #IHTU2 #T1 #HT1
75 elim (fsupq_cpx_trans … HT1 … HT2) -T #T #HT1 #HT2
76 elim (IHTU2 … HT2) -T2 /3 width=3/
77 qed-.
78
79 lemma fsupq_lsstas_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃⸮ ⦃G2, L2, T2⦄ →
80                           ∀U2,l1. ⦃G2, L2⦄ ⊢ T2 •*[h, g, l1] U2 →
81                           ∀l2. ⦃G2, L2⦄ ⊢ T2 ▪ [h, g] l2 → l1 ≤ l2 →
82                           ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊃* ⦃G2, L2, U2⦄.
83 /3 width=5 by fsupq_cpxs_trans, lsstas_cpxs/ qed-.
84
85 lemma fsups_cpxs_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃* ⦃G2, L2, T2⦄ →
86                         ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡*[h, g] U2 →
87                         ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊃* ⦃G2, L2, U2⦄.
88 #h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fsups_ind … H) -G2 -L2 -T2 [ /2 width=3/ ]
89 #G #G2 #L #L2 #T #T2 #_ #HT2 #IHT1 #U2 #HTU2
90 elim (fsupq_cpxs_trans … HTU2 … HT2) -T2 #T2 #HT2 #HTU2
91 elim (IHT1 … HT2) -T #T #HT1 #HT2
92 lapply (fsups_trans … HT2 … HTU2) -G -L -T2 /2 width=3/
93 qed-.
94
95 lemma fsups_lsstas_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊃* ⦃G2, L2, T2⦄ →
96                           ∀U2,l1. ⦃G2, L2⦄ ⊢ T2 •*[h, g, l1] U2 →
97                           ∀l2. ⦃G2, L2⦄ ⊢ T2 ▪ [h, g] l2 → l1 ≤ l2 →
98                           ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊃* ⦃G2, L2, U2⦄.
99 /3 width=7 by fsups_cpxs_trans, lsstas_cpxs/ qed-.