]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/computation/cpxs_lift.ma
update in lambdadelta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / 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_2A/multiple/fqus_fqus.ma".
16 include "basic_2A/reduction/cpx_lift.ma".
17 include "basic_2A/computation/cpxs.ma".
18
19 (* CONTEXT-SENSITIVE EXTENDED PARALLEL COMPUTATION ON TERMS *****************)
20
21 (* Advanced properties ******************************************************)
22
23 lemma cpxs_delta: ∀h,g,I,G,L,K,V,V2,i.
24                   ⬇[i] L ≡ K.ⓑ{I}V → ⦃G, K⦄ ⊢ V ➡*[h, g] V2 →
25                   ∀W2. ⬆[0, i+1] V2 ≡ W2 → ⦃G, L⦄ ⊢ #i ➡*[h, g] W2.
26 #h #g #I #G #L #K #V #V2 #i #HLK #H elim H -V2
27 [ /3 width=9 by cpx_cpxs, cpx_delta/
28 | #V1 lapply (drop_fwd_drop2 … HLK) -HLK
29   elim (lift_total V1 0 (i+1)) /4 width=12 by cpx_lift, cpxs_strap1/
30 ]
31 qed.
32
33 lemma lstas_cpxs: ∀h,g,G,L,T1,T2,d2. ⦃G, L⦄ ⊢ T1 •*[h, d2] T2 →
34                   ∀d1. ⦃G, L⦄ ⊢ T1 ▪[h, g] d1 → d2 ≤ d1 → ⦃G, L⦄ ⊢ T1 ➡*[h, g] T2.
35 #h #g #G #L #T1 #T2 #d2 #H elim H -G -L -T1 -T2 -d2 //
36 [ /3 width=3 by cpxs_sort, da_inv_sort/
37 | #G #L #K #V1 #V2 #W2 #i #d2 #HLK #_ #HVW2 #IHV12 #d1 #H #Hd21
38   elim (da_inv_lref … H) -H * #K0 #V0 [| #d0 ] #HLK0
39   lapply (drop_mono … HLK0 … HLK) -HLK0 #H destruct /3 width=7 by cpxs_delta/
40 | #G #L #K #V1 #V2 #W2 #i #d2 #HLK #_ #HVW2 #IHV12 #d1 #H #Hd21
41   elim (da_inv_lref … H) -H * #K0 #V0 [| #d0 ] #HLK0
42   lapply (drop_mono … HLK0 … HLK) -HLK0 #H destruct
43   #HV1 #H destruct lapply (le_plus_to_le_r … Hd21) -Hd21
44   /3 width=7 by cpxs_delta/
45 | /4 width=3 by cpxs_bind_dx, da_inv_bind/
46 | /4 width=3 by cpxs_flat_dx, da_inv_flat/
47 | /4 width=3 by cpxs_eps, da_inv_flat/
48 ]
49 qed.
50
51 (* Advanced inversion lemmas ************************************************)
52
53 lemma cpxs_inv_lref1: ∀h,g,G,L,T2,i. ⦃G, L⦄ ⊢ #i ➡*[h, g] T2 →
54                       T2 = #i ∨
55                       ∃∃I,K,V1,T1. ⬇[i] L ≡ K.ⓑ{I}V1 & ⦃G, K⦄ ⊢ V1 ➡*[h, g] T1 &
56                                    ⬆[0, i+1] T1 ≡ T2.
57 #h #g #G #L #T2 #i #H @(cpxs_ind … H) -T2 /2 width=1 by or_introl/
58 #T #T2 #_ #HT2 *
59 [ #H destruct
60   elim (cpx_inv_lref1 … HT2) -HT2 /2 width=1 by or_introl/
61   * /4 width=7 by cpx_cpxs, ex3_4_intro, or_intror/
62 | * #I #K #V1 #T1 #HLK #HVT1 #HT1
63   lapply (drop_fwd_drop2 … HLK) #H0LK
64   elim (cpx_inv_lift1 … HT2 … H0LK … HT1) -H0LK -T
65   /4 width=7 by cpxs_strap1, ex3_4_intro, or_intror/
66 ]
67 qed-.
68
69 (* Relocation properties ****************************************************)
70
71 lemma cpxs_lift: ∀h,g,G. d_liftable (cpxs h g G).
72 /3 width=10 by cpx_lift, cpxs_strap1, d_liftable_LTC/ qed.
73
74 lemma cpxs_inv_lift1: ∀h,g,G. d_deliftable_sn (cpxs h g G).
75 /3 width=6 by d_deliftable_sn_LTC, cpx_inv_lift1/
76 qed-.
77
78 (* Properties on supclosure *************************************************)
79
80 lemma fqu_cpxs_trans: ∀h,g,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡*[h, g] U2 →
81                       ∀T1. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ →
82                       ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊐ ⦃G2, L2, U2⦄.
83 #h #g #G1 #G2 #L1 #L2 #T2 #U2 #H @(cpxs_ind_dx … H) -T2 /2 width=3 by ex2_intro/
84 #T #T2 #HT2 #_ #IHTU2 #T1 #HT1 elim (fqu_cpx_trans … HT1 … HT2) -T
85 #T #HT1 #HT2 elim (IHTU2 … HT2) -T2 /3 width=3 by cpxs_strap2, ex2_intro/
86 qed-.
87
88 lemma fquq_cpxs_trans: ∀h,g,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡*[h, g] U2 →
89                        ∀T1. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ →
90                        ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊐⸮ ⦃G2, L2, U2⦄.
91 #h #g #G1 #G2 #L1 #L2 #T2 #U2 #HTU2 #T1 #H elim (fquq_inv_gen … H) -H
92 [ #HT12 elim (fqu_cpxs_trans … HTU2 … HT12) /3 width=3 by fqu_fquq, ex2_intro/
93 | * #H1 #H2 #H3 destruct /2 width=3 by ex2_intro/
94 ]
95 qed-.
96
97 lemma fquq_lstas_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ →
98                         ∀U2,d1. ⦃G2, L2⦄ ⊢ T2 •*[h, d1] U2 →
99                         ∀d2. ⦃G2, L2⦄ ⊢ T2 ▪[h, g] d2 → d1 ≤ d2 →
100                         ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊐⸮ ⦃G2, L2, U2⦄.
101 /3 width=5 by fquq_cpxs_trans, lstas_cpxs/ qed-.
102
103 lemma fqup_cpxs_trans: ∀h,g,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡*[h, g] U2 →
104                        ∀T1. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T2⦄ →
105                        ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊐+ ⦃G2, L2, U2⦄.
106 #h #g #G1 #G2 #L1 #L2 #T2 #U2 #H @(cpxs_ind_dx … H) -T2 /2 width=3 by ex2_intro/
107 #T #T2 #HT2 #_ #IHTU2 #T1 #HT1 elim (fqup_cpx_trans … HT1 … HT2) -T
108 #U1 #HTU1 #H2 elim (IHTU2 … H2) -T2 /3 width=3 by cpxs_strap2, ex2_intro/
109 qed-.
110
111 lemma fqus_cpxs_trans: ∀h,g,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡*[h, g] U2 →
112                        ∀T1. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ →
113                        ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊐* ⦃G2, L2, U2⦄.
114 #h #g #G1 #G2 #L1 #L2 #T2 #U2 #HTU2 #T1 #H elim (fqus_inv_gen … H) -H
115 [ #HT12 elim (fqup_cpxs_trans … HTU2 … HT12) /3 width=3 by fqup_fqus, ex2_intro/
116 | * #H1 #H2 #H3 destruct /2 width=3 by ex2_intro/
117 ]
118 qed-.
119
120 lemma fqus_lstas_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ →
121                         ∀U2,d1. ⦃G2, L2⦄ ⊢ T2 •*[h, d1] U2 →
122                         ∀d2. ⦃G2, L2⦄ ⊢ T2 ▪[h, g] d2 → d1 ≤ d2 →
123                         ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊐* ⦃G2, L2, U2⦄.
124 /3 width=6 by fqus_cpxs_trans, lstas_cpxs/ qed-.