]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/computation/cpxs_tstc.ma
partial commit of the components before "conversion"
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / computation / cpxs_tstc.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/tstc.ma".
16 include "basic_2/computation/lpxs_cpxs.ma".
17
18 (* CONTEXT-SENSITIVE EXTENDED PARALLEL COMPUTATION ON TERMS *****************)
19
20 (* Forward lemmas involving same top term constructor ***********************)
21
22 lemma cpxs_fwd_cnx: ∀h,g,L,T. ⦃h, L⦄ ⊢ 𝐍[g]⦃T⦄ → ∀U. ⦃h, L⦄ ⊢ T ➡*[g] U → T ≃ U.
23 #h #g #L #T #HT #U #H
24 >(cpxs_inv_cnx1 … H HT) -L -T //
25 qed-.
26
27 (* Basic_1: was just: pr3_iso_beta *)
28 lemma cpxs_fwd_beta: ∀h,g,a,L,V,W,T,U. ⦃h, L⦄ ⊢ ⓐV.ⓛ{a}W.T ➡*[g] U →
29                      ⓐV.ⓛ{a}W.T ≃ U ∨ 
30                      ∃∃T0. ⦃h, L.ⓛW⦄ ⊢ T ➡*[g] T0 & ⦃h, L⦄ ⊢ ⓓ{a}V.T0 ➡*[g] U.
31 #h #g #a #L #V #W #T #U #H
32 elim (cpxs_inv_appl1 … H) -H *
33 [ #V0 #T0 #_ #_ #H destruct /2 width=1/
34 | #b #V0 #W0 #T0 #HV0 #HT0 #HU
35   elim (cpxs_inv_abst1 … HT0) -HT0 #W1 #T1 #_ #HT1 #H destruct -W1
36   @or_intror @(ex2_intro … HT1) -W (**) (* explicit constructors *)
37   @(cpxs_trans … HU) -U /2 width=1/
38 | #b #V1 #V2 #V0 #T1 #_ #_ #HT1 #_
39   elim (cpxs_inv_abst1 … HT1) -HT1 #W2 #T2 #_ #_ #H destruct
40 ]
41 qed-.
42
43 (* Note: probably this is an inversion lemma *)
44 lemma cpxs_fwd_delta: ∀h,g,I,L,K,V1,i. ⇩[0, i] L ≡ K.ⓑ{I}V1 →
45                       ∀V2. ⇧[0, i + 1] V1 ≡ V2 →
46                       ∀U. ⦃h, L⦄ ⊢ #i ➡*[g] U →
47                       #i ≃ U ∨ ⦃h, L⦄ ⊢ V2 ➡*[g] U.
48 #h #g #I #L #K #V1 #i #HLK #V2 #HV12 #U #H
49 elim (cpxs_inv_lref1 … H) -H /2 width=1/
50 * #I0 #K0 #V0 #U0 #HLK0 #HVU0 #HU0
51 lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct
52 lapply (ldrop_fwd_ldrop2 … HLK) -HLK /3 width=9/
53 qed-.
54
55 lemma cpxs_fwd_theta: ∀h,g,a,L,V1,V,T,U. ⦃h, L⦄ ⊢ ⓐV1.ⓓ{a}V.T ➡*[g] U →
56                       ∀V2. ⇧[0, 1] V1 ≡ V2 → ⓐV1.ⓓ{a}V.T ≃ U ∨
57                       ⦃h, L⦄ ⊢ ⓓ{a}V.ⓐV2.T ➡*[g] U.
58 #h #g #a #L #V1 #V #T #U #H #V2 #HV12
59 elim (cpxs_inv_appl1 … H) -H *
60 [ -HV12 #V0 #T0 #_ #_ #H destruct /2 width=1/
61 | #b #V0 #W #T0 #HV10 #HT0 #HU
62   elim (cpxs_inv_abbr1 … HT0) -HT0 *
63   [ #V3 #T3 #_ #_ #H destruct
64   | #X #HT2 #H #H0 destruct
65     elim (lift_inv_bind1 … H) -H #W2 #T2 #HW2 #HT02 #H destruct
66     @or_intror @(cpxs_trans … HU) -U (**) (* explicit constructor *)
67     @(cpxs_trans … (+ⓓV.ⓐV2.ⓛ{b}W2.T2)) [ /3 width=1/ ] -T
68     @(cpxs_strap2 … (ⓐV1.ⓛ{b}W.T0)) [ /5 width=7/ ] -V -V2 -W2 -T2
69     @(cpxs_strap2 … (ⓓ{b}V1.T0)) [ /3 width=1/ ] -W /2 width=1/
70   ]
71 | #b #V3 #V4 #V0 #T0 #HV13 #HV34 #HT0 #HU
72   @or_intror @(cpxs_trans … HU) -U (**) (* explicit constructor *)
73   elim (cpxs_inv_abbr1 … HT0) -HT0 *
74   [ #V5 #T5 #HV5 #HT5 #H destruct
75     lapply (cpxs_lift … HV13 (L.ⓓV) … HV12 … HV34) -V1 -V3 /2 width=1/
76     /3 width=1/
77   | #X #HT1 #H #H0 destruct
78     elim (lift_inv_bind1 … H) -H #V5 #T5 #HV05 #HT05 #H destruct
79     lapply (cpxs_lift … HV13 (L.ⓓV0) … HV12 … HV34) -V3 /2 width=1/ #HV24
80     @(cpxs_trans … (+ⓓV.ⓐV2.ⓓ{b}V5.T5)) [ /3 width=1/ ] -T
81     @(cpxs_strap2 … (ⓐV1.ⓓ{b}V0.T0)) [ /5 width=7/ ] -V -V5 -T5
82     @(cpxs_strap2 … (ⓓ{b}V0.ⓐV2.T0)) [ /3 width=3/ ] -V1 /3 width=1/
83   ]
84 ]
85 qed-.
86
87 lemma cpxs_fwd_tau: ∀h,g,L,W,T,U. ⦃h, L⦄ ⊢ ⓝW.T ➡*[g] U →
88                     ⓝW. T ≃ U ∨ ⦃h, L⦄ ⊢ T ➡*[g] U.
89 #h #g #L #W #T #U #H
90 elim (cpxs_inv_cast1 … H) -H /2 width=1/ *
91 #W0 #T0 #_ #_ #H destruct /2 width=1/
92 qed-.