]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/unfold/lpqs_cpqs.ma
- partial commit: refactoring in the components before "computation"
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / unfold / lpqs_cpqs.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/grammar/lpx_sn_lpx_sn.ma".
16 include "basic_2/unfold/lpqs_ldrop.ma".
17
18 (* SN RESTRICTED PARALLEL COMPUTATION FOR LOCAL ENVIRONMENTS ****************)
19
20 (* Main properties on context-sensitive rest parallel computation for terms *)
21
22 theorem cpqs_trans_lpqs: lpx_sn_transitive cpqs cpqs.
23 #L1 #T1 @(f2_ind … fw … L1 T1) -L1 -T1 #n #IH #L1 * [|*]
24 [ #I #Hn #T #H1 #L2 #HL12 #T2 #HT2 destruct
25   elim (cpqs_inv_atom1 … H1) -H1
26   [ #H destruct
27     elim (cpqs_inv_atom1 … HT2) -HT2
28     [ #H destruct //
29     | * #K2 #V #V2 #i #HLK2 #HV2 #HVT2 #H destruct
30       elim (lpqs_ldrop_trans_O1 … HL12 … HLK2) -L2 #X #HLK1 #H
31       elim (lpqs_inv_pair2 … H) -H #K1 #V1 #HK12 #HV1 #H destruct
32       lapply (ldrop_pair2_fwd_fw … HLK1 (#i)) /3 width=9/
33     ]
34   | * #K1 #V1 #V #i #HLK1 #HV1 #HVT #H destruct
35     elim (lpqs_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2
36     elim (lpqs_inv_pair1 … H) -H #K2 #W2 #HK12 #_ #H destruct
37     lapply (ldrop_fwd_ldrop2 … HLK2) -W2 #HLK2
38     elim (cpqs_inv_lift1 … HT2 … HLK2 … HVT) -L2 -T
39     lapply (ldrop_pair2_fwd_fw … HLK1 (#i)) /3 width=9/
40   ]
41 | #a #I #V1 #T1 #Hn #X1 #H1 #L2 #HL12 #X2 #H2
42   elim (cpqs_inv_bind1 … H1) -H1 *
43   [ #V #T #HV1 #HT1 #H destruct
44     elim (cpqs_inv_bind1 … H2) -H2 *
45     [ #V2 #T2 #HV2 #HT2 #H destruct /4 width=5/
46     | #T2 #HT2 #HXT2 #H1 #H2 destruct /4 width=5/
47     ]
48   | #Y1 #HTY1 #HXY1 #H11 #H12 destruct
49     elim (lift_total X2 0 1) #Y2 #HXY2
50     lapply (cpqs_lift … H2 (L2.ⓓV1) … HXY1 … HXY2) /2 width=1/ -X1 /4 width=5/
51   ]
52 | #I #V1 #T1 #Hn #X1 #H1 #L2 #HL12 #X2 #H2
53   elim (cpqs_inv_flat1 … H1) -H1 *
54   [ #V #T #HV1 #HT1 #H destruct
55     elim (cpqs_inv_flat1 … H2) -H2 *
56     [ #V2 #T2 #HV2 #HT2 #H destruct /3 width=5/
57     | #HX2 #H destruct /3 width=5/
58     ]
59   | #HX1 #H destruct /3 width=5/
60 ]
61 qed-.
62
63 theorem cpqs_trans: ∀L. Transitive … (cpqs L).
64 /2 width=5 by cpqs_trans_lpqs/ qed-.
65
66 (* Properties on context-sensitive rest. parallel computation for terms *****)
67
68 lemma lpqs_cpqs_trans: ∀L1,L2. L1 ⊢ ➤* L2 →
69                        ∀T1,T2. L2 ⊢ T1 ➤* T2 → L1 ⊢ T1 ➤* T2.
70 /2 width=5 by cpqs_trans_lpqs/ qed-.