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