1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "basic_2/grammar/tstc_vector.ma".
16 include "basic_2/substitution/lift_vector.ma".
17 include "basic_2/computation/cprs_tstc.ma".
19 (* CONTEXT-SENSITIVE PARALLEL COMPUTATION ON TERMS **************************)
21 (* Vector form of forward lemmas involving same top term constructor ********)
23 (* Basic_1: was: pr3_iso_appls_beta *)
24 lemma cprs_fwd_beta_vector: ∀L,Vs,V,W,T,U. L ⊢ ⒶVs. ⓐV. ⓛW. T ➡* U →
25 ⒶVs. ⓐV. ⓛW. T ≃ U ∨ L ⊢ ⒶVs. ⓓV. T ➡* U.
26 #L #Vs elim Vs -Vs /2 width=1 by cprs_fwd_beta/
27 #V0 #Vs #IHVs #V #W #T #U #H
28 elim (cprs_inv_appl1 … H) -H *
29 [ -IHVs #V1 #T1 #_ #_ #H destruct /2 width=1/
30 | #V1 #W1 #T1 #HV01 #HT1 #HU
31 elim (IHVs … HT1) -IHVs -HT1 #HT1
32 [ elim (tstc_inv_bind_appls_simple … HT1 ?) //
33 | @or_intror -W (**) (* explicit constructor *)
35 @(cprs_strap1 … (ⓐV1.ⓛW1.T1)) [ /2 width=1/ ] -V -V0 -Vs -T /3 width=1/
37 | #V1 #V2 #V3 #T1 #HV01 #HV12 #HT1 #HU
38 elim (IHVs … HT1) -IHVs -HT1 #HT1
39 [ elim (tstc_inv_bind_appls_simple … HT1 ?) //
40 | @or_intror -W (**) (* explicit constructor *)
42 @(cprs_strap1 … (ⓐV1.ⓓV3.T1)) [ /2 width=1/ ] -V -V0 -Vs -T /3 width=3/
47 (* Basic_1: was: pr3_iso_appls_abbr *)
48 lemma cprs_fwd_theta_vector: ∀L,V1s,V2s. ⇧[0, 1] V1s ≡ V2s →
49 ∀V,T,U. L ⊢ ⒶV1s. ⓓV. T ➡* U →
50 ⒶV1s. ⓓV. T ≃ U ∨ L ⊢ ⓓV. ⒶV2s. T ➡* U.
51 #L #V1s #V2s * -V1s -V2s /3 width=1/
52 #V1s #V2s #V1a #V2a #HV12a #HV12s
53 generalize in match HV12a; -HV12a
54 generalize in match V2a; -V2a
55 generalize in match V1a; -V1a
56 elim HV12s -V1s -V2s /2 width=1 by cprs_fwd_theta/
57 #V1s #V2s #V1b #V2b #HV12b #_ #IHV12s #V1a #V2a #HV12a #V #T #U #H
58 elim (cprs_inv_appl1 … H) -H *
59 [ -IHV12s -HV12a -HV12b #V0 #T0 #_ #_ #H destruct /2 width=1/
60 | #V0a #W0 #T0 #HV10a #HT0 #HU
61 elim (IHV12s … HV12b … HT0) -IHV12s -HT0 #HT0
62 [ -HV12a -HV12b -HV10a -HU
63 elim (tstc_inv_pair1 … HT0) #V1 #T1 #H destruct
64 | @or_intror -V1s (**) (* explicit constructor *)
66 elim (cprs_inv_abbr1 … HT0) -HT0 *
67 [ -HV12a -HV12b -HV10a #V1 #T1 #_ #_ #H destruct
69 elim (lift_inv_bind1 … H) -H #W1 #T1 #HW01 #HT01 #H destruct
70 @(cprs_trans … (ⓓV.ⓐV2a.ⓛW1.T1)) [ /3 width=1/ ] -T -V2b -V2s
71 @(cprs_strap2 … (ⓐV1a.ⓛW0.T0)) [ /5 width=3/ ] -V -V2a -W1 -T1
72 @(cprs_strap2 … (ⓓV1a.T0)) [ /3 width=1/ ] -W0 /2 width=1/
75 | #V0a #Va #V0 #T0 #HV10a #HV0a #HT0 #HU
76 elim (IHV12s … HV12b … HT0) -HV12b -IHV12s -HT0 #HT0
77 [ -HV12a -HV10a -HV0a -HU
78 elim (tstc_inv_pair1 … HT0) #V1 #T1 #H destruct
79 | @or_intror -V1s -V1b (**) (* explicit constructor *)
81 elim (cprs_inv_abbr1 … HT0) -HT0 *
82 [ #V1 #T1 #HV1 #HT1 #H destruct
83 lapply (cprs_lift (L.ⓓV) … HV12a … HV10a … HV0a) -V1a -V0a [ /2 width=1/ ] #HV2a
84 @(cprs_trans … (ⓓV.ⓐV2a.T1)) [ /3 width=1/ ] -T -V2b -V2s /3 width=1/
86 elim (lift_inv_bind1 … H) -H #V1 #T1 #HW01 #HT01 #H destruct
87 lapply (cprs_lift (L.ⓓV0) … HV12a … HV10a … HV0a) -V0a [ /2 width=1/ ] #HV2a
88 @(cprs_trans … (ⓓV.ⓐV2a.ⓓV1.T1)) [ /3 width=1/ ] -T -V2b -V2s
89 @(cprs_strap2 … (ⓐV1a.ⓓV0.T0)) [ /5 width=3/ ] -V -V1 -T1
90 @(cprs_strap2 … (ⓓV0.ⓐV2a.T0)) [ /3 width=3/ ] -V1a /3 width=1/
96 (* Basic_1: was: pr3_iso_appls_cast *)
97 lemma cprs_fwd_tau_vector: ∀L,Vs,W,T,U. L ⊢ ⒶVs. ⓣW. T ➡* U →
98 ⒶVs. ⓣW. T ≃ U ∨ L ⊢ ⒶVs. T ➡* U.
99 #L #Vs elim Vs -Vs /2 width=1 by cprs_fwd_tau/
100 #V #Vs #IHVs #W #T #U #H
101 elim (cprs_inv_appl1 … H) -H *
102 [ -IHVs #V0 #T0 #_ #_ #H destruct /2 width=1/
103 | #V0 #W0 #T0 #HV0 #HT0 #HU
104 elim (IHVs … HT0) -IHVs -HT0 #HT0
105 [ elim (tstc_inv_bind_appls_simple … HT0 ?) //
106 | @or_intror -W (**) (* explicit constructor *)
107 @(cprs_trans … HU) -U
108 @(cprs_strap1 … (ⓐV0.ⓛW0.T0)) [ /2 width=1/ ] -V -Vs -T /3 width=1/
110 | #V0 #V1 #V2 #T0 #HV0 #HV01 #HT0 #HU
111 elim (IHVs … HT0) -IHVs -HT0 #HT0
112 [ elim (tstc_inv_bind_appls_simple … HT0 ?) //
113 | @or_intror -W (**) (* explicit constructor *)
114 @(cprs_trans … HU) -U
115 @(cprs_strap1 … (ⓐV0.ⓓV2.T0)) [ /2 width=1/ ] -V -Vs -T /3 width=3/