]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/computation/csn_tstc_vector.ma
partial commit: just the components before "static" ...
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / computation / csn_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/computation/acp_cr.ma".
16 include "basic_2/computation/cpxs_tstc_vector.ma".
17 include "basic_2/computation/csn_lpx.ma".
18 include "basic_2/computation/csn_vector.ma".
19
20 (* CONTEXT-SENSITIVE EXTENDED STRONGLY NORMALIZING TERM VECTORS *************)
21
22 (* Advanced properties ******************************************************)
23
24 (* Basic_1: was just: sn3_appls_lref *)
25 lemma csn_applv_cnx: ∀h,g,L,T. 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ 𝐍[h, g]⦃T⦄ →
26                      ∀Vs. ⦃G, L⦄ ⊢ ⬊*[h, g] Vs → ⦃G, L⦄ ⊢ ⬊*[h, g] ⒶVs.T.
27 #h #g #L #T #H1T #H2T #Vs elim Vs -Vs [ #_ @(cnx_csn … H2T) ] (**) (* /2 width=1/ does not work *)
28 #V #Vs #IHV #H
29 elim (csnv_inv_cons … H) -H #HV #HVs
30 @csn_appl_simple_tstc // -HV /2 width=1/ -IHV -HVs
31 #X #H #H0
32 lapply (cpxs_fwd_cnx_vector … H) -H // -H1T -H2T #H
33 elim (H0) -H0 //
34 qed.
35
36 lemma csn_applv_sort: ∀h,g,L,k,Vs. ⦃G, L⦄ ⊢ ⬊*[h, g] Vs → ⦃G, L⦄ ⊢ ⬊*[h, g] ⒶVs.⋆k.
37 #h #g #L #k elim (deg_total h g k)
38 #l generalize in match k; -k @(nat_ind_plus … l) -l [ /3 width=1/ ]
39 #l #IHl #k #Hkl lapply (deg_next_SO … Hkl) -Hkl
40 #Hkl #Vs elim Vs -Vs /2 width=1/
41 #V #Vs #IHVs #HVVs
42 elim (csnv_inv_cons … HVVs) #HV #HVs
43 @csn_appl_simple_tstc // -HV /2 width=1/ -IHVs -HVs
44 #X #H #H0
45 elim (cpxs_fwd_sort_vector … H) -H #H
46 [ elim H0 -H0 //
47 | -H0 @(csn_cpxs_trans … (Ⓐ(V@Vs).⋆(next h k))) /2 width=1/
48 ]
49 qed.
50
51 (* Basic_1: was just: sn3_appls_beta *)
52 lemma csn_applv_beta: ∀h,g,a,L,Vs,V,W,T. ⦃G, L⦄ ⊢ ⬊*[h, g] ⒶVs.ⓓ{a}ⓝW.V.T →
53                       ⦃G, L⦄ ⊢ ⬊*[h, g] ⒶVs. ⓐV.ⓛ{a}W.T.
54 #h #g #a #L #Vs elim Vs -Vs /2 width=1/
55 #V0 #Vs #IHV #V #W #T #H1T
56 lapply (csn_fwd_pair_sn … H1T) #HV0
57 lapply (csn_fwd_flat_dx … H1T) #H2T
58 @csn_appl_simple_tstc // -HV0 /2 width=1/ -IHV -H2T
59 #X #H #H0
60 elim (cpxs_fwd_beta_vector … H) -H #H
61 [ -H1T elim H0 -H0 //
62 | -H0 @(csn_cpxs_trans … H1T) -H1T /2 width=1/
63 ]
64 qed.
65
66 lemma csn_applv_delta: ∀h,g,I,L,K,V1,i. ⇩[0, i] L ≡ K.ⓑ{I}V1 →
67                        ∀V2. ⇧[0, i + 1] V1 ≡ V2 →
68                        ∀Vs. ⦃G, L⦄ ⊢ ⬊*[h, g] (ⒶVs.V2) → ⦃G, L⦄ ⊢ ⬊*[h, g] (ⒶVs.#i).
69 #h #g #I #L #K #V1 #i #HLK #V2 #HV12 #Vs elim Vs -Vs
70 [ #H
71   lapply (ldrop_fwd_ldrop2 … HLK) #HLK0
72   lapply (csn_inv_lift … H … HLK0 HV12) -V2 -HLK0 /2 width=5/
73 | #V #Vs #IHV #H1T
74   lapply (csn_fwd_pair_sn … H1T) #HV
75   lapply (csn_fwd_flat_dx … H1T) #H2T
76   @csn_appl_simple_tstc // -HV /2 width=1/ -IHV -H2T
77   #X #H #H0
78   elim (cpxs_fwd_delta_vector … HLK … HV12 … H) -HLK -HV12 -H #H
79   [ -H1T elim H0 -H0 //
80   | -H0 @(csn_cpxs_trans … H1T) -H1T /2 width=1/
81   ]
82 ]
83 qed.
84
85 (* Basic_1: was just: sn3_appls_abbr *)
86 lemma csn_applv_theta: ∀h,g,a,L,V1s,V2s. ⇧[0, 1] V1s ≡ V2s →
87                        ∀V,T. ⦃G, L⦄ ⊢ ⬊*[h, g] ⓓ{a}V.ⒶV2s.T →
88                        ⦃G, L⦄ ⊢ ⬊*[h, g] ⒶV1s.ⓓ{a}V.T.
89 #h #g #a #L #V1s #V2s * -V1s -V2s /2 width=1/
90 #V1s #V2s #V1 #V2 #HV12 #H
91 generalize in match HV12; -HV12 generalize in match V2; -V2 generalize in match V1; -V1
92 elim H -V1s -V2s /2 width=3/
93 #V1s #V2s #V1 #V2 #HV12 #HV12s #IHV12s #W1 #W2 #HW12 #V #T #H
94 lapply (csn_appl_theta … HW12 … H) -H -HW12 #H
95 lapply (csn_fwd_pair_sn … H) #HW1
96 lapply (csn_fwd_flat_dx … H) #H1
97 @csn_appl_simple_tstc // -HW1 /2 width=3/ -IHV12s -H1 #X #H1 #H2
98 elim (cpxs_fwd_theta_vector … (V2@V2s) … H1) -H1 /2 width=1/ -HV12s -HV12
99 [ -H #H elim H2 -H2 //
100 | -H2 #H1 @(csn_cpxs_trans … H) -H /2 width=1/
101 ]
102 qed.
103
104 (* Basic_1: was just: sn3_appls_cast *)
105 lemma csn_applv_cast: ∀h,g,L,Vs,W,T. ⦃G, L⦄ ⊢ ⬊*[h, g] ⒶVs.W → ⦃G, L⦄ ⊢ ⬊*[h, g] ⒶVs.T →
106                       ⦃G, L⦄ ⊢ ⬊*[h, g] ⒶVs.ⓝW.T.
107 #h #g #L #Vs elim Vs -Vs /2 width=1/
108 #V #Vs #IHV #W #T #H1W #H1T
109 lapply (csn_fwd_pair_sn … H1W) #HV
110 lapply (csn_fwd_flat_dx … H1W) #H2W
111 lapply (csn_fwd_flat_dx … H1T) #H2T
112 @csn_appl_simple_tstc // -HV /2 width=1/ -IHV -H2W -H2T
113 #X #H #H0
114 elim (cpxs_fwd_cast_vector … H) -H #H
115 [ -H1W -H1T elim H0 -H0 //
116 | -H1W -H0 @(csn_cpxs_trans … H1T) -H1T /2 width=1/
117 | -H1T -H0 @(csn_cpxs_trans … H1W) -H1W /2 width=1/
118 ]
119 qed.
120
121 theorem csn_acr: ∀h,g. acr (cpx h g) (eq …) (csn h g) (λL,T. ⦃G, L⦄ ⊢ ⬊*[h, g] T).
122 #h #g @mk_acr //
123 [ /3 width=1/
124 |2,3,6: /2 width=1/
125 | /2 width=7/
126 | #L #V1s #V2s #HV12s #a #V #T #H #HV
127   @(csn_applv_theta … HV12s) -HV12s
128   @(csn_abbr) //
129 | @csn_lift
130 ]
131 qed.