]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/Basic_2/reduction/cpr_ltpr.ma
old pr2_subst1 (Basic-1) closed!
[helm.git] / matita / matita / contribs / lambda_delta / Basic_2 / reduction / cpr_ltpr.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/reduction/tpr_tpss.ma".
16 include "Basic_2/reduction/cpr.ma".
17
18 (* CONTEXT-SENSITIVE PARALLEL REDUCTION ON TERMS ****************************)
19
20 (* Unfold properties ********************************************************)
21
22 (* Note: we could invoke tpss_weak_all instead of ltpr_fwd_length *)
23
24 (* Basic_1: was only: pr2_subst1 *)
25 lemma cpr_tpss_ltpr: ∀L1,L2. L1 ⇒ L2 → ∀T1,T2. L2 ⊢ T1 ⇒ T2 →
26                      ∀d,e,U1. L1 ⊢ T1 [d, e] ≫* U1 →
27                      ∃∃U2. L2 ⊢ U1 ⇒ U2 & L2 ⊢ T2 [d, e] ≫* U2.
28 #L1 #L2 #HL12 #T1 #T2 * #T #HT1 #HT2 #d #e #U1 #HTU1
29 elim (tpr_tpss_ltpr … HL12 … HT1 … HTU1) -L1 HT1 #U #HU1 #HTU
30 elim (tpss_conf_eq … HT2 … HTU) -T /3/
31 qed.
32
33 lemma cpr_ltpr_conf_eq: ∀L1,T1,T2. L1 ⊢ T1 ⇒ T2 → ∀L2. L1 ⇒ L2 →
34                         ∃∃T. L2 ⊢ T1 ⇒ T & T2 ⇒ T.
35 #L1 #T1 #T2 * #T #HT1 #HT2 #L2 #HL12
36 >(ltpr_fwd_length … HL12) in HT2 #HT2
37 elim (tpr_tpss_ltpr … HL12 … HT2) -L1 HT2 /3/
38 qed.
39
40 lemma cpr_ltpr_conf_tpss: ∀L1,L2. L1 ⇒ L2 → ∀T1,T2. L1 ⊢ T1 ⇒ T2 →
41                           ∀d,e,U1. L1 ⊢ T1 [d, e] ≫* U1 →
42                           ∃∃U2. L2 ⊢ U1 ⇒ U2 & L2 ⊢ T2 ⇒ U2.
43 #L1 #L2 #HL12 #T1 #T2 #HT12 #d #e #U1 #HTU1
44 elim (cpr_ltpr_conf_eq … HT12 … HL12) -HT12 #T #HT1 #HT2
45 elim (cpr_tpss_ltpr … HL12 … HT1 … HTU1) -L1 HT1 #U2 #HU12 #HTU2
46 lapply (tpss_weak_all … HTU2) -HTU2 #HTU2 /3 width=5/ (**) (* /4 width=5/ is too slow *)
47 qed.