]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs_theq_vector.ma
milestone in basic_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_computation / cpxs_theq_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 "static_2/syntax/theq_simple_vector.ma".
16 include "static_2/relocation/lifts_vector.ma".
17 include "basic_2/rt_computation/cpxs_theq.ma".
18
19 (* UNBOUND CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS **************)
20
21 (* Vector form of forward lemmas with head equivalence for terms ************)
22
23 lemma cpxs_fwd_sort_vector: ∀h,G,L,s,Vs,X2. ⦃G, L⦄ ⊢ ⒶVs.⋆s ⬈*[h] X2 → ⒶVs.⋆s ⩳ X2.
24 #h #G #L #s #Vs elim Vs -Vs /2 width=4 by cpxs_fwd_sort/
25 #V #Vs #IHVs #X2 #H
26 elim (cpxs_inv_appl1 … H) -H *
27 [ -IHVs #V1 #T1 #_ #_ #H destruct /2 width=1 by theq_pair/
28 | #p #W1 #T1 #HT1 #HU
29   lapply (IHVs … HT1) -IHVs -HT1 #HT1
30   elim (theq_inv_applv_bind_simple … HT1) //
31 | #p #V1 #V2 #V3 #T1 #HV01 #HV12 #HT1 #HU
32   lapply (IHVs … HT1) -IHVs -HT1 #HT1
33   elim (theq_inv_applv_bind_simple … HT1) //
34 ]
35 qed-.
36
37 (* Basic_2A1: was: cpxs_fwd_delta_vector *)
38 lemma cpxs_fwd_delta_drops_vector: ∀h,I,G,L,K,V1,i. ⬇*[i] L ≘ K.ⓑ{I}V1 →
39                                    ∀V2. ⬆*[↑i] V1 ≘ V2 →
40                                    ∀Vs,X2. ⦃G, L⦄ ⊢ ⒶVs.#i ⬈*[h] X2 →
41                                    ∨∨ ⒶVs.#i ⩳ X2 | ⦃G, L⦄ ⊢ ⒶVs.V2 ⬈*[h] X2.
42 #h #I #G #L #K #V1 #i #HLK #V2 #HV12 #Vs
43 elim Vs -Vs /2 width=5 by cpxs_fwd_delta_drops/
44 #V #Vs #IHVs #X2 #H -K -V1
45 elim (cpxs_inv_appl1 … H) -H *
46 [ -IHVs #V0 #T0 #_ #_ #H destruct /2 width=1 by theq_pair, or_introl/
47 | #q #W0 #T0 #HT0 #HU
48   elim (IHVs … HT0) -IHVs -HT0 #HT0
49   [ elim (theq_inv_applv_bind_simple … HT0) //
50   | @or_intror -i (**) (* explicit constructor *)
51     @(cpxs_trans … HU) -X2
52     @(cpxs_strap1 … (ⓐV.ⓛ{q}W0.T0)) /3 width=1 by cpxs_flat_dx, cpx_beta/
53   ]
54 | #q #V0 #V1 #V3 #T0 #HV0 #HV01 #HT0 #HU
55   elim (IHVs … HT0) -IHVs -HT0 #HT0
56   [ elim (theq_inv_applv_bind_simple … HT0) //
57   | @or_intror -i (**) (* explicit constructor *)
58     @(cpxs_trans … HU) -X2
59     @(cpxs_strap1 … (ⓐV0.ⓓ{q}V3.T0)) /3 width=3 by cpxs_flat, cpx_theta/
60   ]
61 ]
62 qed-.
63
64 (* Basic_1: was just: pr3_iso_appls_beta *)
65 lemma cpxs_fwd_beta_vector: ∀h,p,G,L,Vs,V,W,T,X2. ⦃G, L⦄ ⊢ ⒶVs.ⓐV.ⓛ{p}W.T ⬈*[h] X2 →
66                             ∨∨ ⒶVs.ⓐV.ⓛ{p}W. T ⩳ X2 | ⦃G, L⦄ ⊢ ⒶVs.ⓓ{p}ⓝW.V.T ⬈*[h] X2.
67 #h #p #G #L #Vs elim Vs -Vs /2 width=1 by cpxs_fwd_beta/
68 #V0 #Vs #IHVs #V #W #T #X2 #H
69 elim (cpxs_inv_appl1 … H) -H *
70 [ -IHVs #V1 #T1 #_ #_ #H destruct /2 width=1 by theq_pair, or_introl/
71 | #q #W1 #T1 #HT1 #HU
72   elim (IHVs … HT1) -IHVs -HT1 #HT1
73   [ elim (theq_inv_applv_bind_simple … HT1) //
74   | @or_intror (**) (* explicit constructor *)
75     @(cpxs_trans … HU) -X2
76     @(cpxs_strap1 … (ⓐV0.ⓛ{q}W1.T1)) /3 width=1 by cpxs_flat_dx, cpx_beta/
77   ]
78 | #q #V1 #V2 #V3 #T1 #HV01 #HV12 #HT1 #HU
79   elim (IHVs … HT1) -IHVs -HT1 #HT1
80   [ elim (theq_inv_applv_bind_simple … HT1) //
81   | @or_intror (**) (* explicit constructor *)
82     @(cpxs_trans … HU) -X2
83     @(cpxs_strap1 … (ⓐV1.ⓓ{q}V3.T1)) /3 width=3 by cpxs_flat, cpx_theta/
84   ]
85 ]
86 qed-.
87
88 (* Basic_1: was just: pr3_iso_appls_abbr *)
89 lemma cpxs_fwd_theta_vector: ∀h,G,L,V1b,V2b. ⬆*[1] V1b ≘ V2b →
90                              ∀p,V,T,X2. ⦃G, L⦄ ⊢ ⒶV1b.ⓓ{p}V.T ⬈*[h] X2 →
91                              ∨∨ ⒶV1b.ⓓ{p}V.T ⩳ X2 | ⦃G, L⦄ ⊢ ⓓ{p}V.ⒶV2b.T ⬈*[h] X2.
92 #h #G #L #V1b #V2b * -V1b -V2b /3 width=1 by or_intror/
93 #V1b #V2b #V1a #V2a #HV12a #HV12b #p
94 generalize in match HV12a; -HV12a
95 generalize in match V2a; -V2a
96 generalize in match V1a; -V1a
97 elim HV12b -V1b -V2b /2 width=1 by cpxs_fwd_theta/
98 #V1b #V2b #V1b #V2b #HV12b #_ #IHV12b #V1a #V2a #HV12a #V #T #X2 #H
99 elim (cpxs_inv_appl1 … H) -H *
100 [ -IHV12b -HV12a -HV12b #V0 #T0 #_ #_ #H destruct /2 width=1 by theq_pair, or_introl/
101 | #q #W0 #T0 #HT0 #HU
102   elim (IHV12b … HV12b … HT0) -IHV12b -HT0 #HT0
103   [ -HV12a -HV12b -HU
104     elim (theq_inv_pair1 … HT0) #V1 #T1 #H destruct
105   | @or_intror -V1b (**) (* explicit constructor *)
106     @(cpxs_trans … HU) -X2
107     elim (cpxs_inv_abbr1_dx … HT0) -HT0 *
108     [ -HV12a #V1 #T1 #_ #_ #H destruct
109     | -V1b #X #HT1 #H #H0 destruct
110       elim (lifts_inv_bind1 … H) -H #W1 #T1 #HW01 #HT01 #H destruct
111       @(cpxs_trans … (+ⓓV.ⓐV2a.ⓛ{q}W1.T1)) [ /3 width=1 by cpxs_flat_dx, cpxs_bind_dx/ ] -T -V2b -V2b
112       @(cpxs_strap2 … (ⓐV1a.ⓛ{q}W0.T0))
113       /4 width=7 by cpxs_beta_dx, cpx_zeta, lifts_bind, lifts_flat/
114     ]
115   ]
116 | #q #V0a #Va #V0 #T0 #HV10a #HV0a #HT0 #HU
117   elim (IHV12b … HV12b … HT0) -HV12b -IHV12b -HT0 #HT0
118   [ -HV12a -HV10a -HV0a -HU
119     elim (theq_inv_pair1 … HT0) #V1 #T1 #H destruct
120   | @or_intror -V1b -V1b (**) (* explicit constructor *)
121     @(cpxs_trans … HU) -X2
122     elim (cpxs_inv_abbr1_dx … HT0) -HT0 *
123     [ #V1 #T1 #HV1 #HT1 #H destruct
124       lapply (cpxs_lifts_bi … HV10a (Ⓣ) … (L.ⓓV) … HV12a … HV0a) -V1a -V0a /3 width=1 by drops_refl, drops_drop/ #HV2a
125       @(cpxs_trans … (ⓓ{p}V.ⓐV2a.T1)) /3 width=1 by cpxs_bind, cpxs_pair_sn, cpxs_flat_dx, cpxs_bind_dx/
126     | #X #HT1 #H #H0 destruct
127       elim (lifts_inv_bind1 … H) -H #V1 #T1 #HW01 #HT01 #H destruct
128       lapply (cpxs_lifts_bi … HV10a (Ⓣ) … (L.ⓓV0) … HV12a … HV0a) -V0a /3 width=1 by drops_refl, drops_drop/ #HV2a
129       @(cpxs_trans … (+ⓓV.ⓐV2a.ⓓ{q}V1.T1)) [ /3 width=1 by cpxs_flat_dx, cpxs_bind_dx/ ] -T -V2b -V2b
130       @(cpxs_strap2 … (ⓐV1a.ⓓ{q}V0.T0)) [ /4 width=7 by cpx_zeta, lifts_bind, lifts_flat/ ] -V -V1 -T1
131       @(cpxs_strap2 … (ⓓ{q}V0.ⓐV2a.T0)) /3 width=3 by cpxs_pair_sn, cpxs_bind_dx, cpx_theta/
132     ]
133   ]
134 ]
135 qed-.
136
137 (* Basic_1: was just: pr3_iso_appls_cast *)
138 lemma cpxs_fwd_cast_vector: ∀h,G,L,Vs,W,T,X2. ⦃G, L⦄ ⊢ ⒶVs.ⓝW.T ⬈*[h] X2 →
139                             ∨∨ ⒶVs. ⓝW. T ⩳ X2
140                              | ⦃G, L⦄ ⊢ ⒶVs.T ⬈*[h] X2
141                              | ⦃G, L⦄ ⊢ ⒶVs.W ⬈*[h] X2.
142 #h #G #L #Vs elim Vs -Vs /2 width=1 by cpxs_fwd_cast/
143 #V #Vs #IHVs #W #T #X2 #H
144 elim (cpxs_inv_appl1 … H) -H *
145 [ -IHVs #V0 #T0 #_ #_ #H destruct /2 width=1 by theq_pair, or3_intro0/
146 | #q #W0 #T0 #HT0 #HU elim (IHVs … HT0) -IHVs -HT0 #HT0
147   [ elim (theq_inv_applv_bind_simple … HT0) //
148   | @or3_intro1 -W (**) (* explicit constructor *)
149     @(cpxs_trans … HU) -X2
150     @(cpxs_strap1 … (ⓐV.ⓛ{q}W0.T0)) /2 width=1 by cpxs_flat_dx, cpx_beta/
151   | @or3_intro2 -T (**) (* explicit constructor *)
152     @(cpxs_trans … HU) -X2
153     @(cpxs_strap1 … (ⓐV.ⓛ{q}W0.T0)) /2 width=1 by cpxs_flat_dx, cpx_beta/
154   ]
155 | #q #V0 #V1 #V2 #T0 #HV0 #HV01 #HT0 #HU
156   elim (IHVs … HT0) -IHVs -HT0 #HT0
157   [ elim (theq_inv_applv_bind_simple … HT0) //
158   | @or3_intro1 -W (**) (* explicit constructor *)
159     @(cpxs_trans … HU) -X2
160     @(cpxs_strap1 … (ⓐV0.ⓓ{q}V2.T0)) /2 width=3 by cpxs_flat, cpx_theta/
161   | @or3_intro2 -T (**) (* explicit constructor *)
162     @(cpxs_trans … HU) -X2
163     @(cpxs_strap1 … (ⓐV0.ⓓ{q}V2.T0)) /2 width=3 by cpxs_flat, cpx_theta/
164   ]
165 ]
166 qed-.
167
168 (* Basic_1: was just: nf2_iso_appls_lref *)
169 lemma cpxs_fwd_cnx_vector: ∀h,G,L,T. 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ ⬈[h] 𝐍⦃T⦄ →
170                            ∀Vs,X2. ⦃G, L⦄ ⊢ ⒶVs.T ⬈*[h] X2 → ⒶVs.T ⩳ X2.
171 #h #G #L #T #H1T #H2T #Vs elim Vs -Vs [ @(cpxs_fwd_cnx … H2T) ] (**) (* /2 width=3 by cpxs_fwd_cnx/ does not work *)
172 #V #Vs #IHVs #X2 #H
173 elim (cpxs_inv_appl1 … H) -H *
174 [ -IHVs #V0 #T0 #_ #_ #H destruct /2 width=1 by theq_pair/
175 | #p #W0 #T0 #HT0 #HU
176   lapply (IHVs … HT0) -IHVs -HT0 #HT0
177   elim (theq_inv_applv_bind_simple … HT0) //
178 | #p #V1 #V2 #V0 #T0 #HV1 #HV12 #HT0 #HU
179   lapply (IHVs … HT0) -IHVs -HT0 #HT0
180   elim (theq_inv_applv_bind_simple … HT0) //
181 ]
182 qed-.