1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "basic_2/substitution/lpss_lpss.ma".
16 include "basic_2/reduction/lpr_lpss.ma".
17 include "basic_2/computation/cprs.ma".
19 (* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************)
21 (* Properties on parallel substitution for terms ****************************)
23 (* Basic_1: was: pr3_subst1 *)
24 lemma cprs_cpss_conf: ∀L,T0,T1. L ⊢ T0 ➡* T1 → ∀T2. L ⊢ T0 ▶* T2 →
25 ∃∃T. L ⊢ T1 ▶* T & L ⊢ T2 ➡* T.
26 #L @TC_strip1 /2 width=3 by cpr_cpss_conf/ qed-. (**) (* auto /3 width=3/ fails because a δ-expansion gets in the way *)
28 (* Properties on sn parallel substitution for local environments ************)
30 lemma cprs_lpss_conf_dx: ∀L0,T0,T1. L0 ⊢ T0 ➡* T1 → ∀L1. L0 ⊢ ▶* L1 →
31 ∃∃T. L1 ⊢ T1 ▶* T & L1 ⊢ T0 ➡* T.
32 #L0 #T0 #T1 #H elim H -T1
34 elim (cpr_lpss_conf_dx … HT01 … HL01) -L0 /3 width=3/
35 | #T #T1 #_ #HT1 #IHT0 #L1 #HL01
36 elim (IHT0 … HL01) #T2 #HT2 #HT02
37 elim (cpr_lpss_conf_dx … HT1 … HL01) -L0 #T3 #HT13 #HT3
38 elim (cpr_cpss_conf … HT3 … HT2) -T #T #HT3 #HT2
39 lapply (cpss_trans … HT13 … HT3) -T3
40 lapply (cprs_strap1 … HT02 … HT2) -T2 /2 width=3/
44 lemma cprs_lpss_conf_sn: ∀L0,T0,T1. L0 ⊢ T0 ➡* T1 → ∀L1. L0 ⊢ ▶* L1 →
45 ∃∃T. L0 ⊢ T1 ▶* T & L1 ⊢ T0 ➡* T.
46 #L0 #T0 #T1 #HT01 #L1 #HL01
47 elim (cprs_lpss_conf_dx … HT01 … HL01) -HT01 #T #HT1
48 lapply (lpss_cpss_trans … HL01 … HT1) -HT1 /2 width=3/
51 lemma cprs_cpss_lpss_conf_sn: ∀L1,T1,U1. L1 ⊢ T1 ➡* U1 →
52 ∀T2. L1 ⊢ T1 ▶* T2 → ∀L2. L1 ⊢ ▶* L2 →
53 ∃∃U2. L2 ⊢ T2 ➡* U2 & L1 ⊢ U1 ▶* U2.
54 #L1 #T1 #U1 #HTU1 #T2 #HT12 #L2 #HL12
55 elim (cprs_cpss_conf … HTU1 … HT12) -T1 #U #HU1 #HT2U
56 elim (cprs_lpss_conf_sn … HT2U … HL12) -HT2U -HL12 #U2 #HU2 #HTU2
57 lapply (cpss_trans … HU1 … HU2) -U /2 width=3/
60 lemma cprs_cpss_lpss_conf_dx: ∀L1,T1,U1. L1 ⊢ T1 ➡* U1 →
61 ∀T2. L1 ⊢ T1 ▶* T2 → ∀L2. L1 ⊢ ▶* L2 →
62 ∃∃U2. L2 ⊢ T2 ➡* U2 & L2 ⊢ U1 ▶* U2.
63 #L1 #T1 #U1 #HTU1 #T2 #HT12 #L2 #HL12
64 elim (cprs_lpss_conf_dx … HTU1 … HL12) -HTU1 #U2 #HU12 #HT1U2
65 elim (lpss_cpss_conf_dx … HT12 … HL12) -L1 #T #HT1 #HT2
66 elim (cprs_cpss_conf … HT1U2 … HT1) -T1 #U #HU2 #HTU
67 lapply (cpss_trans … HU12 … HU2) -U2
68 lapply (cpss_cprs_trans … HT2 … HTU) -T /2 width=3/
72 lemma cprs_cpss2_lpss_conf_sn: ∀L1,T1,U1. L1 ⊢ T1 ➡* U1 → ∀T2. L1 ⊢ T1 ▶* T2 →
73 ∀U2. L1 ⊢ U1 ▶* U2 → ∀L2. L1 ⊢ ▶* L2 →
74 ∃∃U. L2 ⊢ T2 ➡* U & L1 ⊢ U2 ▶* U.
75 #L1 #T1 #U1 #HTU1 #T2 #HT12 #U2 #HU12 #L2 #HL12
76 elim (cprs_cpss_lpss_conf_sn … HTU1 … HT12 … HL12) -T1 #T1 #HT21 #HUT1
77 elim (cpss_conf … HU12 … HUT1) -U1 #U1 #HU21 #HTU1
78 elim (lpss_cpss_conf_sn … HTU1 … HL12) -HTU1 -HL12 #U2 #HT1U2 #HU12
79 lapply (cpss_trans … HU21 … HU12) -U1
80 lapply (cprs_cpss_trans … HT21 … HT1U2) -T1 /2 width=3/
83 lemma cprs_cpss2_lpss_conf_dx: ∀L1,T1,U1. L1 ⊢ T1 ➡* U1 → ∀T2. L1 ⊢ T1 ▶* T2 →
84 ∀U2. L1 ⊢ U1 ▶* U2 → ∀L2. L1 ⊢ ▶* L2 →
85 ∃∃U. L2 ⊢ T2 ➡* U & L2 ⊢ U2 ▶* U.
86 #L1 #T1 #U1 #HTU1 #T2 #HT12 #U2 #HU12 #L2 #HL12
87 elim (cprs_cpss_lpss_conf_dx … HTU1 … HT12 … HL12) -T1 #T1 #HT21 #HUT1
88 elim (lpss_cpss_conf_dx … HU12 … HL12) -L1 #U #HU1 #HU2
89 elim (cpss_conf … HU1 … HUT1) -U1 #U1 #HU1 #HTU1
90 lapply (cpss_trans … HU2 … HU1) -U
91 lapply (cprs_cpss_trans … HT21 … HTU1) -T1 /2 width=3/