]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/computation/csx_tsts_vector.ma
update in lambdadelta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / computation / csx_tsts_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_2A/computation/gcp_cr.ma".
16 include "basic_2A/computation/cpxs_tsts_vector.ma".
17 include "basic_2A/computation/csx_lpx.ma".
18 include "basic_2A/computation/csx_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 csx_applv_cnx: ∀h,g,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 #G #L #T #H1T #H2T #Vs elim Vs -Vs [ #_ @(cnx_csx … H2T) ] (**) (* /2 width=1/ does not work *)
28 #V #Vs #IHV #H
29 elim (csxv_inv_cons … H) -H #HV #HVs
30 @csx_appl_simple_tsts /2 width=1 by applv_simple/ -IHV -HV -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 csx_applv_sort: ∀h,g,G,L,k,Vs. ⦃G, L⦄ ⊢ ⬊*[h, g] Vs → ⦃G, L⦄ ⊢ ⬊*[h, g] ⒶVs.⋆k.
37 #h #g #G #L #k elim (deg_total h g k)
38 #d generalize in match k; -k @(nat_ind_plus … d) -d [ /3 width=6 by csx_applv_cnx, cnx_sort, simple_atom/ ]
39 #d #IHd #k #Hkd lapply (deg_next_SO … Hkd) -Hkd
40 #Hkd #Vs elim Vs -Vs /2 width=1 by/
41 #V #Vs #IHVs #HVVs
42 elim (csxv_inv_cons … HVVs) #HV #HVs
43 @csx_appl_simple_tsts /2 width=1 by applv_simple, simple_atom/ -IHVs -HV -HVs
44 #X #H #H0
45 elim (cpxs_fwd_sort_vector … H) -H #H
46 [ elim H0 -H0 //
47 | -H0 @(csx_cpxs_trans … (Ⓐ(V@Vs).⋆(next h k))) /2 width=1 by cpxs_flat_dx/
48 ]
49 qed.
50
51 (* Basic_1: was just: sn3_appls_beta *)
52 lemma csx_applv_beta: ∀h,g,a,G,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 #G #L #Vs elim Vs -Vs /2 width=1 by csx_appl_beta/
55 #V0 #Vs #IHV #V #W #T #H1T
56 lapply (csx_fwd_pair_sn … H1T) #HV0
57 lapply (csx_fwd_flat_dx … H1T) #H2T
58 @csx_appl_simple_tsts /2 width=1 by applv_simple, simple_flat/ -IHV -HV0 -H2T
59 #X #H #H0
60 elim (cpxs_fwd_beta_vector … H) -H #H
61 [ -H1T elim H0 -H0 //
62 | -H0 /3 width=5 by csx_cpxs_trans, cpxs_flat_dx/
63 ]
64 qed.
65
66 lemma csx_applv_delta: ∀h,g,I,G,L,K,V1,i. ⬇[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 #G #L #K #V1 #i #HLK #V2 #HV12 #Vs elim Vs -Vs
70 [ /4 width=12 by csx_inv_lift, csx_lref_bind, drop_fwd_drop2/
71 | #V #Vs #IHV #H1T
72   lapply (csx_fwd_pair_sn … H1T) #HV
73   lapply (csx_fwd_flat_dx … H1T) #H2T
74   @csx_appl_simple_tsts /2 width=1 by applv_simple, simple_atom/ -IHV -HV  -H2T
75   #X #H #H0
76   elim (cpxs_fwd_delta_vector … HLK … HV12 … H) -HLK -HV12 -H #H
77   [ -H1T elim H0 -H0 //
78   | -H0 /3 width=5 by csx_cpxs_trans, cpxs_flat_dx/
79   ]
80 ]
81 qed.
82
83 (* Basic_1: was just: sn3_appls_abbr *)
84 lemma csx_applv_theta: ∀h,g,a,G,L,V1s,V2s. ⬆[0, 1] V1s ≡ V2s →
85                        ∀V,T. ⦃G, L⦄ ⊢ ⬊*[h, g] ⓓ{a}V.ⒶV2s.T →
86                        ⦃G, L⦄ ⊢ ⬊*[h, g] ⒶV1s.ⓓ{a}V.T.
87 #h #g #a #G #L #V1s #V2s * -V1s -V2s /2 width=1 by/
88 #V1s #V2s #V1 #V2 #HV12 #H
89 generalize in match HV12; -HV12 generalize in match V2; -V2 generalize in match V1; -V1
90 elim H -V1s -V2s /2 width=3 by csx_appl_theta/
91 #V1s #V2s #V1 #V2 #HV12 #HV12s #IHV12s #W1 #W2 #HW12 #V #T #H
92 lapply (csx_appl_theta … HW12 … H) -H -HW12 #H
93 lapply (csx_fwd_pair_sn … H) #HW1
94 lapply (csx_fwd_flat_dx … H) #H1
95 @csx_appl_simple_tsts /2 width=3 by simple_flat/ -IHV12s -HW1 -H1 #X #H1 #H2
96 elim (cpxs_fwd_theta_vector … (V2@V2s) … H1) -H1 /2 width=1 by liftv_cons/ -HV12s -HV12
97 [ -H #H elim H2 -H2 //
98 | -H2 /3 width=5 by csx_cpxs_trans, cpxs_flat_dx/
99 ]
100 qed.
101
102 (* Basic_1: was just: sn3_appls_cast *)
103 lemma csx_applv_cast: ∀h,g,G,L,Vs,W,T. ⦃G, L⦄ ⊢ ⬊*[h, g] ⒶVs.W → ⦃G, L⦄ ⊢ ⬊*[h, g] ⒶVs.T →
104                       ⦃G, L⦄ ⊢ ⬊*[h, g] ⒶVs.ⓝW.T.
105 #h #g #G #L #Vs elim Vs -Vs /2 width=1 by csx_cast/
106 #V #Vs #IHV #W #T #H1W #H1T
107 lapply (csx_fwd_pair_sn … H1W) #HV
108 lapply (csx_fwd_flat_dx … H1W) #H2W
109 lapply (csx_fwd_flat_dx … H1T) #H2T
110 @csx_appl_simple_tsts /2 width=1 by applv_simple, simple_flat/ -IHV -HV -H2W -H2T
111 #X #H #H0
112 elim (cpxs_fwd_cast_vector … H) -H #H
113 [ -H1W -H1T elim H0 -H0 //
114 | -H1W -H0 /3 width=5 by csx_cpxs_trans, cpxs_flat_dx/
115 | -H1T -H0 /3 width=5 by csx_cpxs_trans, cpxs_flat_dx/
116 ]
117 qed.
118
119 theorem csx_gcr: ∀h,g. gcr (cpx h g) (eq …) (csx h g) (csx h g).
120 #h #g @mk_gcr //
121 [ /3 width=1 by csx_applv_cnx/
122 |2,3,6: /2 width=1 by csx_applv_beta, csx_applv_sort, csx_applv_cast/
123 | /2 width=7 by csx_applv_delta/
124 | #G #L #V1s #V2s #HV12s #a #V #T #H #HV
125   @(csx_applv_theta … HV12s) -HV12s
126   @csx_abbr //
127 ]
128 qed.