]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/rt_computation/lprs_cpms.ma
update in ground_2, static_2, basic_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_computation / lprs_cpms.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/rt_computation/lprs_lpr.ma".
16
17 (* PARALLEL R-COMPUTATION FOR FULL LOCAL ENVIRONMENTS ***********************)
18
19 (* Properties with t-bound context-sensitive rt-computarion for terms *******)
20
21 lemma lprs_cpms_trans (n) (h) (G):
22                       ∀L2,T1,T2. ❪G,L2❫ ⊢ T1 ➡*[n,h] T2 →
23                       ∀L1. ❪G,L1❫ ⊢ ➡*[h] L2 → ❪G,L1❫ ⊢ T1 ➡*[n,h] T2.
24 #n #h #G #L2 #T1 #T2 #HT12 #L1 #H
25 @(lprs_ind_sn … H) -L1 /2 width=3 by lpr_cpms_trans/
26 qed-.
27
28 lemma lprs_cpm_trans (n) (h) (G):
29                      ∀L2,T1,T2. ❪G,L2❫ ⊢ T1 ➡[n,h] T2 →
30                      ∀L1. ❪G,L1❫ ⊢ ➡*[h] L2 → ❪G,L1❫ ⊢ T1 ➡*[n,h] T2.
31 /3 width=3 by lprs_cpms_trans, cpm_cpms/ qed-.
32
33 (* Basic_2A1: includes cprs_bind2 *)
34 lemma cpms_bind_dx (n) (h) (G) (L):
35                    ∀V1,V2. ❪G,L❫ ⊢ V1 ➡*[h] V2 →
36                    ∀I,T1,T2. ❪G,L.ⓑ[I]V2❫ ⊢ T1 ➡*[n,h] T2 →
37                    ∀p. ❪G,L❫ ⊢ ⓑ[p,I]V1.T1 ➡*[n,h] ⓑ[p,I]V2.T2.
38 /4 width=5 by lprs_cpms_trans, lprs_pair, cpms_bind/ qed.
39
40 (* Inversion lemmas with t-bound context-sensitive rt-computarion for terms *)
41
42 (* Basic_1: was: pr3_gen_abst *)
43 (* Basic_2A1: includes: cprs_inv_abst1 *)
44 (* Basic_2A1: uses: scpds_inv_abst1 *)
45 lemma cpms_inv_abst_sn (n) (h) (G) (L):
46                        ∀p,V1,T1,X2. ❪G,L❫ ⊢ ⓛ[p]V1.T1 ➡*[n,h] X2 →
47                        ∃∃V2,T2. ❪G,L❫ ⊢ V1 ➡*[h] V2 & ❪G,L.ⓛV1❫ ⊢ T1 ➡*[n,h] T2 &
48                                 X2 = ⓛ[p]V2.T2.
49 #n #h #G #L #p #V1 #T1 #X2 #H
50 @(cpms_ind_dx … H) -X2 /2 width=5 by ex3_2_intro/
51 #n1 #n2 #X #X2 #_ * #V #T #HV1 #HT1 #H1 #H2 destruct
52 elim (cpm_inv_abst1 … H2) -H2 #V2 #T2 #HV2 #HT2 #H2 destruct
53 /5 width=7 by lprs_cpm_trans, lprs_pair, cprs_step_dx, cpms_trans, ex3_2_intro/
54 qed-.
55
56 lemma cpms_inv_abst_sn_cprs (h) (n) (p) (G) (L) (W):
57                             ∀T,X. ❪G,L❫ ⊢ ⓛ[p]W.T ➡*[n,h] X →
58                             ∃∃U. ❪G,L.ⓛW❫⊢ T ➡*[n,h] U & ❪G,L❫ ⊢ ⓛ[p]W.U ➡*[h] X.
59 #h #n #p #G #L #W #T #X #H
60 elim (cpms_inv_abst_sn … H) -H #W0 #U #HW0 #HTU #H destruct
61 @(ex2_intro … HTU) /2 width=1 by cpms_bind/
62 qed-.
63
64 (* Basic_2A1: includes: cprs_inv_abst *)
65 lemma cpms_inv_abst_bi (n) (h) (p1) (p2) (G) (L):
66                        ∀W1,W2,T1,T2. ❪G,L❫ ⊢ ⓛ[p1]W1.T1 ➡*[n,h] ⓛ[p2]W2.T2 →
67                        ∧∧ p1 = p2 & ❪G,L❫ ⊢ W1 ➡*[h] W2 & ❪G,L.ⓛW1❫ ⊢ T1 ➡*[n,h] T2.
68 #n #h #p1 #p2 #G #L #W1 #W2 #T1 #T2 #H
69 elim (cpms_inv_abst_sn … H) -H #W #T #HW1 #HT1 #H destruct
70 /2 width=1 by and3_intro/
71 qed-.
72
73 (* Basic_1: was pr3_gen_abbr *)
74 (* Basic_2A1: includes: cprs_inv_abbr1 *)
75 lemma cpms_inv_abbr_sn_dx (n) (h) (G) (L):
76                           ∀p,V1,T1,X2. ❪G,L❫ ⊢ ⓓ[p]V1.T1 ➡*[n,h] X2 →
77                           ∨∨ ∃∃V2,T2. ❪G,L❫ ⊢ V1 ➡*[h] V2 & ❪G,L.ⓓV1❫ ⊢ T1 ➡*[n,h] T2 & X2 = ⓓ[p]V2.T2
78                            | ∃∃T2. ❪G,L.ⓓV1❫ ⊢ T1 ➡*[n ,h] T2 & ⇧[1] X2 ≘ T2 & p = Ⓣ.
79 #n #h #G #L #p #V1 #T1 #X2 #H
80 @(cpms_ind_dx … H) -X2 -n /3 width=5 by ex3_2_intro, or_introl/
81 #n1 #n2 #X #X2 #_ * *
82 [ #V #T #HV1 #HT1 #H #HX2 destruct
83   elim (cpm_inv_abbr1 … HX2) -HX2 *
84   [ #V2 #T2 #HV2 #HT2 #H destruct
85     /6 width=7 by lprs_cpm_trans, lprs_pair, cprs_step_dx, cpms_trans, ex3_2_intro, or_introl/
86   | #T2 #HT2 #HTX2 #Hp -V
87     elim (cpm_lifts_sn … HTX2 (Ⓣ) … (L.ⓓV1) … HT2) -T2 [| /3 width=3 by drops_refl, drops_drop/ ] #X #HX2 #HTX
88     /4 width=3 by cpms_step_dx, ex3_intro, or_intror/
89   ]
90 | #T #HT1 #HXT #Hp #HX2
91   elim (cpm_lifts_sn … HX2 (Ⓣ) … (L.ⓓV1) … HXT) -X
92   /4 width=3 by cpms_step_dx, drops_refl, drops_drop, ex3_intro, or_intror/
93 ]
94 qed-.
95
96 (* Basic_2A1: uses: scpds_inv_abbr_abst *)
97 lemma cpms_inv_abbr_abst (n) (h) (G) (L):
98                          ∀p1,p2,V1,W2,T1,T2. ❪G,L❫ ⊢ ⓓ[p1]V1.T1 ➡*[n,h] ⓛ[p2]W2.T2 →
99                          ∃∃T. ❪G,L.ⓓV1❫ ⊢ T1 ➡*[n,h] T & ⇧[1] ⓛ[p2]W2.T2 ≘ T & p1 = Ⓣ.
100 #n #h #G #L #p1 #p2 #V1 #W2 #T1 #T2 #H
101 elim (cpms_inv_abbr_sn_dx … H) -H *
102 [ #V #T #_ #_ #H destruct
103 | /2 width=3 by ex3_intro/
104 ]
105 qed-.