]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/rt_computation/cprs_cprs.ma
update in ground_2 and basic_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_computation / cprs_cprs.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_transition/lpr_lpr.ma".
16 include "basic_2/rt_computation/cpms_cpms.ma".
17
18 (* CONTEXT-SENSITIVE PARALLEL COMPUTATION FOR TERMS *************************)
19
20 (* Main properties **********************************************************)
21
22 (* Basic_1: was: pr3_t *)
23 (* Basic_1: includes: pr1_t *)
24 theorem cprs_trans: ∀G,L. Transitive … (cprs G L).
25 normalize /2 width=3 by trans_TC/ qed-.
26
27 (* Basic_1: was: pr3_confluence *)
28 (* Basic_1: includes: pr1_confluence *)
29 theorem cprs_conf: ∀G,L. confluent2 … (cprs G L) (cprs G L).
30 normalize /3 width=3 by cpr_conf, TC_confluent2/ qed-.
31
32 (* Basic_1: was: pr3_flat *)
33 theorem cprs_flat (h) (G) (L):
34                   ∀T1,T2. ⦃G, L⦄ ⊢ T1 ➡*[h] T2 →
35                   ∀V1,V2. ⦃G, L⦄ ⊢ V1 ➡*[h] V2 →
36                   ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ➡*[h] ⓕ{I}V2.T2.
37 #h #G #L #T1 #T2 #HT12 #V1 #V2 #H @(cprs_ind_dx … H) -V2
38 [ /2 width=3 by cprs_flat_dx/
39 | /3 width=3 by cpr_pair_sn, cprs_step_dx/
40 ]
41 qed.
42
43 (* Advanced inversion lemmas ************************************************)
44
45 (* Basic_1: was pr3_gen_appl *)
46 lemma cprs_inv_appl1: ∀G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓐV1.T1 ➡* U2 →
47                       ∨∨ ∃∃V2,T2.       ⦃G, L⦄ ⊢ V1 ➡* V2 & ⦃G, L⦄ ⊢ T1 ➡* T2 &
48                                         U2 = ⓐV2. T2
49                        | ∃∃a,W,T.       ⦃G, L⦄ ⊢ T1 ➡* ⓛ{a}W.T &
50                                         ⦃G, L⦄ ⊢ ⓓ{a}ⓝW.V1.T ➡* U2
51                        | ∃∃a,V0,V2,V,T. ⦃G, L⦄ ⊢ V1 ➡* V0 & ⬆[0,1] V0 ≘ V2 &
52                                         ⦃G, L⦄ ⊢ T1 ➡* ⓓ{a}V.T &
53                                         ⦃G, L⦄ ⊢ ⓓ{a}V.ⓐV2.T ➡* U2.
54 #G #L #V1 #T1 #U2 #H @(cprs_ind … H) -U2 /3 width=5 by or3_intro0, ex3_2_intro/
55 #U #U2 #_ #HU2 * *
56 [ #V0 #T0 #HV10 #HT10 #H destruct
57   elim (cpr_inv_appl1 … HU2) -HU2 *
58   [ #V2 #T2 #HV02 #HT02 #H destruct /4 width=5 by cprs_strap1, or3_intro0, ex3_2_intro/
59   | #a #V2 #W #W2 #T #T2 #HV02 #HW2 #HT2 #H1 #H2 destruct
60     lapply (cprs_strap1 … HV10 … HV02) -V0 #HV12
61     lapply (lsubr_cpr_trans … HT2 (L.ⓓⓝW.V1) ?) -HT2
62     /5 width=5 by cprs_bind, cprs_flat_dx, cpr_cprs, lsubr_beta, ex2_3_intro, or3_intro1/
63   | #a #V #V2 #W0 #W2 #T #T2 #HV0 #HV2 #HW02 #HT2 #H1 #H2 destruct
64     /5 width=10 by cprs_flat_sn, cprs_bind_dx, cprs_strap1, ex4_5_intro, or3_intro2/
65   ]
66 | /4 width=9 by cprs_strap1, or3_intro1, ex2_3_intro/
67 | /4 width=11 by cprs_strap1, or3_intro2, ex4_5_intro/
68 ]
69 qed-.
70
71 (* Basic_1: was: pr3_strip *)
72 (* Basic_1: includes: pr1_strip *)
73 lemma cprs_strip: ∀G,L. confluent2 … (cprs G L) (cpr G L).
74 normalize /4 width=3 by cpr_conf, TC_strip1/ qed-.
75
76 lemma cprs_lpr_conf_dx: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡* T1 → ∀L1. ⦃G, L0⦄ ⊢ ➡ L1 →
77                         ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡* T & ⦃G, L1⦄ ⊢ T0 ➡* T.
78 #G #L0 #T0 #T1 #H @(cprs_ind … H) -T1 /2 width=3 by ex2_intro/
79 #T #T1 #_ #HT1 #IHT0 #L1 #HL01 elim (IHT0 … HL01)
80 #T2 #HT2 #HT02 elim (lpr_cpr_conf_dx … HT1 … HL01) -L0
81 #T3 #HT3 #HT13 elim (cprs_strip … HT2 … HT3) -T
82 /4 width=5 by cprs_strap2, cprs_strap1, ex2_intro/
83 qed-.
84
85 lemma cprs_lpr_conf_sn: ∀G,L0,T0,T1. ⦃G, L0⦄ ⊢ T0 ➡* T1 →
86                         ∀L1. ⦃G, L0⦄ ⊢ ➡ L1 →
87                         ∃∃T. ⦃G, L0⦄ ⊢ T1 ➡* T & ⦃G, L1⦄ ⊢ T0 ➡* T.
88 #G #L0 #T0 #T1 #HT01 #L1 #HL01 elim (cprs_lpr_conf_dx … HT01 … HL01) -HT01
89 /3 width=3 by lpr_cprs_trans, ex2_intro/
90 qed-.