]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/computation/cprs_tstc_vector.ma
- lambda_delta: programmed renaming to lambdadelta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / computation / cprs_tstc_vector.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_vector.ma".
16 include "basic_2/substitution/lift_vector.ma".
17 include "basic_2/computation/cprs_tstc.ma".
18
19 (* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************)
20
21 (* Vector form of forward lemmas involving same top term constructor ********)
22
23 (* Basic_1: was just: nf2_iso_appls_lref *)
24 lemma cprs_fwd_cnf_vector: ∀L,T.  𝐒⦃T⦄ → L ⊢ 𝐍⦃T⦄ → ∀Vs,U. L ⊢ ⒶVs.T ➡* U → ⒶVs.T ≃ U.
25 #L #T #H1T #H2T #Vs elim Vs -Vs [ @(cprs_fwd_cnf … H2T) ] (**) (* /2 width=3 by cprs_fwd_cnf/ does not work *)
26 #V #Vs #IHVs #U #H
27 elim (cprs_inv_appl1 … H) -H *
28 [ -IHVs #V0 #T0 #_ #_ #H destruct /2 width=1/
29 | #a #V0 #W0 #T0 #HV0 #HT0 #HU
30   lapply (IHVs … HT0) -IHVs -HT0 #HT0
31   elim (tstc_inv_bind_appls_simple … HT0 ?) //
32 | #a #V1 #V2 #V0 #T0 #HV1 #HV12 #HT0 #HU
33   lapply (IHVs … HT0) -IHVs -HT0 #HT0
34   elim (tstc_inv_bind_appls_simple … HT0 ?) //
35 ]
36 qed-.
37
38 (* Basic_1: was: pr3_iso_appls_beta *)
39 lemma cprs_fwd_beta_vector: ∀a,L,Vs,V,W,T,U. L ⊢ ⒶVs. ⓐV. ⓛ{a}W. T ➡* U →
40                             ⒶVs. ⓐV. ⓛ{a}W. T ≃ U ∨ L ⊢ ⒶVs. ⓓ{a}V. T ➡* U.
41 #a #L #Vs elim Vs -Vs /2 width=1 by cprs_fwd_beta/
42 #V0 #Vs #IHVs #V #W #T #U #H
43 elim (cprs_inv_appl1 … H) -H *
44 [ -IHVs #V1 #T1 #_ #_ #H destruct /2 width=1/
45 | #b #V1 #W1 #T1 #HV01 #HT1 #HU
46   elim (IHVs … HT1) -IHVs -HT1 #HT1
47   [ elim (tstc_inv_bind_appls_simple … HT1 ?) //
48   | @or_intror -W (**) (* explicit constructor *)
49     @(cprs_trans … HU) -U
50     @(cprs_strap1 … (ⓐV1.ⓛ{b}W1.T1)) [ /2 width=1/ ] -V -V0 -Vs -T /3 width=1/
51   ]
52 | #b #V1 #V2 #V3 #T1 #HV01 #HV12 #HT1 #HU
53   elim (IHVs … HT1) -IHVs -HT1 #HT1
54   [ elim (tstc_inv_bind_appls_simple … HT1 ?) //
55   | @or_intror -W (**) (* explicit constructor *)
56     @(cprs_trans … HU) -U
57     @(cprs_strap1 … (ⓐV1.ⓓ{b}V3.T1)) [ /2 width=1/ ] -V -V0 -Vs -T /3 width=3/
58   ]
59 ]
60 qed-.
61
62 lemma cprs_fwd_delta_vector: ∀L,K,V1,i. ⇩[0, i] L ≡ K. ⓓV1 →
63                              ∀V2. ⇧[0, i + 1] V1 ≡ V2 →
64                              ∀Vs,U. L ⊢ ⒶVs.#i ➡* U →
65                              ⒶVs.#i ≃ U ∨ L ⊢ ⒶVs.V2 ➡* U.
66 #L #K #V1 #i #HLK #V2 #HV12 #Vs elim Vs -Vs /2 width=4 by cprs_fwd_delta/
67 #V #Vs #IHVs #U #H -K -V1
68 elim (cprs_inv_appl1 … H) -H *
69 [ -IHVs #V0 #T0 #_ #_ #H destruct /2 width=1/
70 | #b #V0 #W0 #T0 #HV0 #HT0 #HU
71   elim (IHVs … HT0) -IHVs -HT0 #HT0
72   [ elim (tstc_inv_bind_appls_simple … HT0 ?) //
73   | @or_intror -i (**) (* explicit constructor *)
74     @(cprs_trans … HU) -U
75     @(cprs_strap1 … (ⓐV0.ⓛ{b}W0.T0)) [ /2 width=1/ ] -V -V2 -Vs /3 width=1/
76   ]
77 | #b #V0 #V1 #V3 #T0 #HV0 #HV01 #HT0 #HU
78   elim (IHVs … HT0) -IHVs -HT0 #HT0
79   [ elim (tstc_inv_bind_appls_simple … HT0 ?) //
80   | @or_intror -i (**) (* explicit constructor *)
81     @(cprs_trans … HU) -U
82     @(cprs_strap1 … (ⓐV0.ⓓ{b}V3.T0)) [ /2 width=1/ ] -V -V2 -Vs /3 width=3/
83   ]
84 ]
85 qed-.
86
87 (* Basic_1: was: pr3_iso_appls_abbr *)
88 lemma cprs_fwd_theta_vector: ∀L,V1s,V2s. ⇧[0, 1] V1s ≡ V2s →
89                              ∀a,V,T,U. L ⊢ ⒶV1s. ⓓ{a}V. T ➡* U →
90                              ⒶV1s. ⓓ{a}V. T ≃ U ∨ L ⊢ ⓓ{a}V. ⒶV2s. T ➡* U.
91 #L #V1s #V2s * -V1s -V2s /3 width=1/
92 #V1s #V2s #V1a #V2a #HV12a #HV12s #a
93 generalize in match HV12a; -HV12a
94 generalize in match V2a; -V2a
95 generalize in match V1a; -V1a
96 elim HV12s -V1s -V2s /2 width=1 by cprs_fwd_theta/
97 #V1s #V2s #V1b #V2b #HV12b #_ #IHV12s #V1a #V2a #HV12a #V #T #U #H
98 elim (cprs_inv_appl1 … H) -H *
99 [ -IHV12s -HV12a -HV12b #V0 #T0 #_ #_ #H destruct /2 width=1/
100 | #b #V0a #W0 #T0 #HV10a #HT0 #HU
101   elim (IHV12s … HV12b … HT0) -IHV12s -HT0 #HT0
102   [ -HV12a -HV12b -HV10a -HU
103     elim (tstc_inv_pair1 … HT0) #V1 #T1 #H destruct
104   | @or_intror -V1s (**) (* explicit constructor *)
105     @(cprs_trans … HU) -U
106     elim (cprs_inv_abbr1 … HT0) -HT0 *
107     [ -HV12a -HV12b -HV10a #V1 #T1 #_ #_ #H destruct
108     | -V1b #X #HT1 #H #H0 destruct
109       elim (lift_inv_bind1 … H) -H #W1 #T1 #HW01 #HT01 #H destruct
110       @(cprs_trans … (+ⓓV.ⓐV2a.ⓛ{b}W1.T1)) [ /3 width=1/ ] -T -V2b -V2s
111       @(cprs_strap2 … (ⓐV1a.ⓛ{b}W0.T0)) [ /5 width=7/ ] -V -V2a -W1 -T1
112       @(cprs_strap2 … (ⓓ{b}V1a.T0)) [ /3 width=1/ ] -W0 /2 width=1/
113     ]
114   ]
115 | #b #V0a #Va #V0 #T0 #HV10a #HV0a #HT0 #HU
116   elim (IHV12s … HV12b … HT0) -HV12b -IHV12s -HT0 #HT0
117   [ -HV12a -HV10a -HV0a -HU
118     elim (tstc_inv_pair1 … HT0) #V1 #T1 #H destruct
119   | @or_intror -V1s -V1b (**) (* explicit constructor *)
120     @(cprs_trans … HU) -U
121     elim (cprs_inv_abbr1 … HT0) -HT0 *
122     [ #V1 #T1 #HV1 #HT1 #H destruct
123       lapply (cprs_lift (L.ⓓV) … HV12a … HV10a … HV0a) -V1a -V0a [ /2 width=1/ ] #HV2a
124       @(cprs_trans … (ⓓ{a}V.ⓐV2a.T1)) [ /3 width=1/ ] -T -V2b -V2s /3 width=1/
125     | #X #HT1 #H #H0 destruct
126       elim (lift_inv_bind1 … H) -H #V1 #T1 #HW01 #HT01 #H destruct
127       lapply (cprs_lift (L.ⓓV0) … HV12a … HV10a … HV0a) -V0a [ /2 width=1/ ] #HV2a
128       @(cprs_trans … (+ⓓV.ⓐV2a.ⓓ{b}V1.T1)) [ /3 width=1/ ] -T -V2b -V2s
129       @(cprs_strap2 … (ⓐV1a.ⓓ{b}V0.T0)) [ /5 width=7/ ] -V -V1 -T1
130       @(cprs_strap2 … (ⓓ{b}V0.ⓐV2a.T0)) [ /3 width=3/ ] -V1a /3 width=1/
131     ]
132   ]
133 ]  
134 qed-.
135
136 (* Basic_1: was: pr3_iso_appls_cast *)
137 lemma cprs_fwd_tau_vector: ∀L,Vs,W,T,U. L ⊢ ⒶVs. ⓝW. T ➡* U →
138                            ⒶVs. ⓝW. T ≃ U ∨ L ⊢ ⒶVs. T ➡* U.
139 #L #Vs elim Vs -Vs /2 width=1 by cprs_fwd_tau/
140 #V #Vs #IHVs #W #T #U #H
141 elim (cprs_inv_appl1 … H) -H *
142 [ -IHVs #V0 #T0 #_ #_ #H destruct /2 width=1/
143 | #b #V0 #W0 #T0 #HV0 #HT0 #HU
144   elim (IHVs … HT0) -IHVs -HT0 #HT0
145   [ elim (tstc_inv_bind_appls_simple … HT0 ?) //
146   | @or_intror -W (**) (* explicit constructor *)
147     @(cprs_trans … HU) -U
148     @(cprs_strap1 … (ⓐV0.ⓛ{b}W0.T0)) [ /2 width=1/ ] -V -Vs -T /3 width=1/
149   ]
150 | #b #V0 #V1 #V2 #T0 #HV0 #HV01 #HT0 #HU
151   elim (IHVs … HT0) -IHVs -HT0 #HT0
152   [ elim (tstc_inv_bind_appls_simple … HT0 ?) //
153   | @or_intror -W (**) (* explicit constructor *)
154     @(cprs_trans … HU) -U
155     @(cprs_strap1 … (ⓐV0.ⓓ{b}V2.T0)) [ /2 width=1/ ] -V -Vs -T /3 width=3/
156 ]
157 qed-.