]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/basic_2/computation/cprs_tstc_vector.ma
- property S4 of strongly normalizing term proved!
[helm.git] / matita / matita / contribs / lambda_delta / 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: 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 *)
34     @(cprs_trans … HU) -U
35     @(cprs_strap1 … (ⓐV1.ⓛW1.T1)) [ /2 width=1/ ] -V -V0 -Vs -T /3 width=1/
36   ]
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 *)
41     @(cprs_trans … HU) -U
42     @(cprs_strap1 … (ⓐV1.ⓓV3.T1)) [ /2 width=1/ ] -V -V0 -Vs -T /3 width=3/
43   ]
44 ]
45 qed-.
46
47 lemma cprs_fwd_delta_vector: ∀L,K,V1,i. ⇩[0, i] L ≡ K. ⓓV1 →
48                              ∀V2. ⇧[0, i + 1] V1 ≡ V2 →
49                              ∀Vs,U. L ⊢ ⒶVs.#i ➡* U →
50                              ⒶVs.#i ≃ U ∨ L ⊢ ⒶVs.V2 ➡* U.
51 #L #K #V1 #i #HLK #V2 #HV12 #Vs elim Vs -Vs /2 width=4 by cprs_fwd_delta/
52 #V #Vs #IHVs #U #H -K -V1
53 elim (cprs_inv_appl1 … H) -H *
54 [ -IHVs #V0 #T0 #_ #_ #H destruct /2 width=1/
55 | #V0 #W0 #T0 #HV0 #HT0 #HU
56   elim (IHVs … HT0) -IHVs -HT0 #HT0
57   [ elim (tstc_inv_bind_appls_simple … HT0 ?) //
58   | @or_intror -i (**) (* explicit constructor *)
59     @(cprs_trans … HU) -U
60     @(cprs_strap1 … (ⓐV0.ⓛW0.T0)) [ /2 width=1/ ] -V -V2 -Vs /3 width=1/
61   ]
62 | #V0 #V1 #V3 #T0 #HV0 #HV01 #HT0 #HU
63   elim (IHVs … HT0) -IHVs -HT0 #HT0
64   [ elim (tstc_inv_bind_appls_simple … HT0 ?) //
65   | @or_intror -i (**) (* explicit constructor *)
66     @(cprs_trans … HU) -U
67     @(cprs_strap1 … (ⓐV0.ⓓV3.T0)) [ /2 width=1/ ] -V -V2 -Vs /3 width=3/
68   ]
69 ]
70 qed-.
71
72 (* Basic_1: was: pr3_iso_appls_abbr *)
73 lemma cprs_fwd_theta_vector: ∀L,V1s,V2s. ⇧[0, 1] V1s ≡ V2s →
74                              ∀V,T,U. L ⊢ ⒶV1s. ⓓV. T ➡* U →
75                              ⒶV1s. ⓓV. T ≃ U ∨ L ⊢ ⓓV. ⒶV2s. T ➡* U.
76 #L #V1s #V2s * -V1s -V2s /3 width=1/
77 #V1s #V2s #V1a #V2a #HV12a #HV12s
78 generalize in match HV12a; -HV12a
79 generalize in match V2a; -V2a
80 generalize in match V1a; -V1a
81 elim HV12s -V1s -V2s /2 width=1 by cprs_fwd_theta/
82 #V1s #V2s #V1b #V2b #HV12b #_ #IHV12s #V1a #V2a #HV12a #V #T #U #H
83 elim (cprs_inv_appl1 … H) -H *
84 [ -IHV12s -HV12a -HV12b #V0 #T0 #_ #_ #H destruct /2 width=1/
85 | #V0a #W0 #T0 #HV10a #HT0 #HU
86   elim (IHV12s … HV12b … HT0) -IHV12s -HT0 #HT0
87   [ -HV12a -HV12b -HV10a -HU
88     elim (tstc_inv_pair1 … HT0) #V1 #T1 #H destruct
89   | @or_intror -V1s (**) (* explicit constructor *)
90     @(cprs_trans … HU) -U
91     elim (cprs_inv_abbr1 … HT0) -HT0 *
92     [ -HV12a -HV12b -HV10a #V1 #T1 #_ #_ #H destruct
93     | -V1b #X #H #HT1
94       elim (lift_inv_bind1 … H) -H #W1 #T1 #HW01 #HT01 #H destruct
95       @(cprs_trans … (ⓓV.ⓐV2a.ⓛW1.T1)) [ /3 width=1/ ] -T -V2b -V2s
96       @(cprs_strap2 … (ⓐV1a.ⓛW0.T0)) [ /5 width=3/ ] -V -V2a -W1 -T1
97       @(cprs_strap2 … (ⓓV1a.T0)) [ /3 width=1/ ] -W0 /2 width=1/
98     ]
99   ]
100 | #V0a #Va #V0 #T0 #HV10a #HV0a #HT0 #HU
101   elim (IHV12s … HV12b … HT0) -HV12b -IHV12s -HT0 #HT0
102   [ -HV12a -HV10a -HV0a -HU
103     elim (tstc_inv_pair1 … HT0) #V1 #T1 #H destruct
104   | @or_intror -V1s -V1b (**) (* explicit constructor *)
105     @(cprs_trans … HU) -U
106     elim (cprs_inv_abbr1 … HT0) -HT0 *
107     [ #V1 #T1 #HV1 #HT1 #H destruct
108       lapply (cprs_lift (L.ⓓV) … HV12a … HV10a … HV0a) -V1a -V0a [ /2 width=1/ ] #HV2a
109       @(cprs_trans … (ⓓV.ⓐV2a.T1)) [ /3 width=1/ ] -T -V2b -V2s /3 width=1/
110     | #X #H #HT1
111       elim (lift_inv_bind1 … H) -H #V1 #T1 #HW01 #HT01 #H destruct
112       lapply (cprs_lift (L.ⓓV0) … HV12a … HV10a … HV0a) -V0a [ /2 width=1/ ] #HV2a
113       @(cprs_trans … (ⓓV.ⓐV2a.ⓓV1.T1)) [ /3 width=1/ ] -T -V2b -V2s
114       @(cprs_strap2 … (ⓐV1a.ⓓV0.T0)) [ /5 width=3/ ] -V -V1 -T1
115       @(cprs_strap2 … (ⓓV0.ⓐV2a.T0)) [ /3 width=3/ ] -V1a /3 width=1/
116     ]
117   ]
118 ]  
119 qed-.
120
121 (* Basic_1: was: pr3_iso_appls_cast *)
122 lemma cprs_fwd_tau_vector: ∀L,Vs,W,T,U. L ⊢ ⒶVs. ⓣW. T ➡* U →
123                            ⒶVs. ⓣW. T ≃ U ∨ L ⊢ ⒶVs. T ➡* U.
124 #L #Vs elim Vs -Vs /2 width=1 by cprs_fwd_tau/
125 #V #Vs #IHVs #W #T #U #H
126 elim (cprs_inv_appl1 … H) -H *
127 [ -IHVs #V0 #T0 #_ #_ #H destruct /2 width=1/
128 | #V0 #W0 #T0 #HV0 #HT0 #HU
129   elim (IHVs … HT0) -IHVs -HT0 #HT0
130   [ elim (tstc_inv_bind_appls_simple … HT0 ?) //
131   | @or_intror -W (**) (* explicit constructor *)
132     @(cprs_trans … HU) -U
133     @(cprs_strap1 … (ⓐV0.ⓛW0.T0)) [ /2 width=1/ ] -V -Vs -T /3 width=1/
134   ]
135 | #V0 #V1 #V2 #T0 #HV0 #HV01 #HT0 #HU
136   elim (IHVs … HT0) -IHVs -HT0 #HT0
137   [ elim (tstc_inv_bind_appls_simple … HT0 ?) //
138   | @or_intror -W (**) (* explicit constructor *)
139     @(cprs_trans … HU) -U
140     @(cprs_strap1 … (ⓐV0.ⓓV2.T0)) [ /2 width=1/ ] -V -Vs -T /3 width=3/
141 ]
142 qed-.