]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/computation/cprs_lift.ma
- lambda_delta: programmed renaming to lambdadelta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / computation / cprs_lift.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/reducibility/cpr_lift.ma".
16 include "basic_2/computation/cprs.ma".
17
18 (* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************)
19
20 (* Advanced inversion lemmas ************************************************)
21
22 (* Basic_1: was: pr3_gen_lref *)
23 lemma cprs_inv_lref1: ∀L,T2,i. L ⊢ #i ➡* T2 →
24                       T2 = #i ∨
25                       ∃∃K,V1,T1. ⇩[0, i] L ≡ K. ⓓV1 &
26                                  K ⊢ V1 ➡* T1 &
27                                  ⇧[0, i + 1] T1 ≡ T2 &
28                                  i < |L|.
29 #L #T2 #i #H @(cprs_ind … H) -T2 /2 width=1/
30 #T #T2 #_ #HT2 *
31 [ #H destruct
32   elim (cpr_inv_lref1 … HT2) -HT2 /2 width=1/
33   * #K #V1 #T1 #HLK #HVT1 #HT12 #Hi
34   @or_intror @(ex4_3_intro … HLK … HT12) // /3 width=3/ (**) (* explicit constructors *)
35 | * #K #V1 #T1 #HLK #HVT1 #HT1 #Hi
36   lapply (ldrop_fwd_ldrop2 … HLK) #H0LK
37   elim (cpr_inv_lift1 … H0LK … HT1 … HT2) -H0LK -T /4 width=6/
38 ]
39 qed-.
40
41 (* Basic_1: was: pr3_gen_abst *)
42 lemma cprs_inv_abst1: ∀I,W,a,L,V1,T1,U2. L ⊢ ⓛ{a}V1. T1 ➡* U2 →
43                       ∃∃V2,T2. L ⊢ V1 ➡* V2 & L. ⓑ{I} W ⊢ T1 ➡* T2 &
44                                U2 = ⓛ{a}V2. T2.
45 #I #W #a #L #V1 #T1 #U2 #H @(cprs_ind … H) -U2 /2 width=5/
46 #U #U2 #_ #HU2 * #V #T #HV1 #HT1 #H destruct
47 elim (cpr_inv_abst1 … HU2 I W) -HU2 #V2 #T2 #HV2 #HT2 #H destruct  /3 width=5/
48 qed-.
49
50 lemma cprs_inv_abst: ∀a,L,V1,V2,T1,T2. L ⊢ ⓛ{a}V1. T1 ➡* ⓛ{a}V2. T2 → ∀I,W.
51                      L ⊢ V1 ➡* V2 ∧ L. ⓑ{I} W ⊢ T1 ➡* T2.
52 #a #L #V1 #V2 #T1 #T2 #H #I #W
53 elim (cprs_inv_abst1 I W … H) -H #V #T #HV1 #HT1 #H destruct /2 width=1/
54 qed-.
55
56 (* Relocation properties ****************************************************)
57
58 (* Basic_1: was: pr3_lift *)
59 lemma cprs_lift: ∀L,K,d,e. ⇩[d, e] L ≡ K → ∀T1,U1. ⇧[d, e] T1 ≡ U1 →
60                  ∀T2. K ⊢ T1 ➡* T2 → ∀U2. ⇧[d, e] T2 ≡ U2 →
61                  L ⊢ U1 ➡* U2.
62 #L #K #d #e #HLK #T1 #U1 #HTU1 #T2 #HT12 @(cprs_ind … HT12) -T2
63 [ -HLK #T2 #HT12
64    <(lift_mono … HTU1 … HT12) -T1 //
65 | -HTU1 #T #T2 #_ #HT2 #IHT2 #U2 #HTU2
66   elim (lift_total T d e) #U #HTU
67   lapply (cpr_lift … HLK … HTU … HTU2 … HT2) -T2 -HLK /3 width=3/
68 ]
69 qed.
70
71 (* Basic_1: was: pr3_gen_lift *)
72 lemma cprs_inv_lift1: ∀L,K,d,e. ⇩[d, e] L ≡ K →
73                       ∀T1,U1. ⇧[d, e] T1 ≡ U1 → ∀U2. L ⊢ U1 ➡* U2 →
74                       ∃∃T2. ⇧[d, e] T2 ≡ U2 & K ⊢ T1 ➡* T2.
75 #L #K #d #e #HLK #T1 #U1 #HTU1 #U2 #HU12 @(cprs_ind … HU12) -U2 /2 width=3/
76 -HTU1 #U #U2 #_ #HU2 * #T #HTU #HT1
77 elim (cpr_inv_lift1 … HLK … HTU … HU2) -U -HLK /3 width=5/
78 qed.