]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx_lpx.ma
9192f4fa5050c20412b832ff6a43690d9124692d
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_computation / csx_lpx.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/rt_computation/cpxs_lpx.ma".
16 include "basic_2/rt_computation/csx_cpxs.ma".
17
18 (* CONTEXT-SENSITIVE EXTENDED STRONGLY NORMALIZING TERMS ********************)
19
20 (* Properties with unbound parallel rt-transition on all entries ************)
21
22 lemma csx_lpx_conf: ∀h,o,G,L1,T. ⦃G, L1⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ →
23                     ∀L2. ⦃G, L1⦄ ⊢ ⬈[h] L2 → ⦃G, L2⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄.
24 #h #o #G #L1 #T #H @(csx_ind_cpxs … H) -T
25 /4 width=3 by csx_intro, lpx_cpx_trans/
26 qed-.
27
28 (* Advanced properties ******************************************************)
29
30 lemma csx_abst: ∀h,o,p,G,L,W. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃W⦄ →
31                 ∀T. ⦃G, L.ⓛW⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓛ{p}W.T⦄.
32 #h #o #p #G #L #W #HW
33 @(csx_ind … HW) -W #W #_ #IHW #T #HT
34 @(csx_ind … HT) -T #T #HT #IHT
35 @csx_intro #X #H1 #H2
36 elim (cpx_inv_abst1 … H1) -H1 #W0 #T0 #HLW0 #HLT0 #H destruct
37 elim (tdneq_inv_pair  … H2) -H2
38 [ #H elim H -H //
39 | -IHT #H lapply (csx_cpx_trans … o … HLT0) // -HT #HT0
40   /4 width=5 by csx_lpx_conf, lpx_pair/
41 | -IHW -HT /4 width=3 by csx_cpx_trans, cpx_pair_sn/
42 ]
43 qed.
44
45 lemma csx_abbr: ∀h,o,p,G,L,V. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃V⦄ →
46                 ∀T. ⦃G, L.ⓓV⦄ ⊢ ⬈*[h, o] 𝐒⦃T⦄ → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓓ{p}V.T⦄.
47 #h #o #p #G #L #V #HV
48 @(csx_ind … HV) -V #V #_ #IHV #T #HT
49 @(csx_ind_cpxs … HT) -T #T #HT #IHT
50 @csx_intro #X #H1 #H2
51 elim (cpx_inv_abbr1 … H1) -H1 *
52 [ #V1 #T1 #HLV1 #HLT1 #H destruct
53   elim (tdneq_inv_pair … H2) -H2
54   [ #H elim H -H //
55   | /4 width=5 by csx_cpx_trans, csx_lpx_conf, lpx_pair/
56   | -IHV /4 width=3 by csx_cpx_trans, cpx_cpxs, cpx_pair_sn/
57   ]
58 | -IHV -IHT -H2
59   /4 width=7 by csx_cpx_trans, csx_inv_lifts, drops_drop, drops_refl/
60 ]
61 qed.
62
63 fact csx_appl_theta_aux: ∀h,o,p,G,L,U. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃U⦄ → ∀V1,V2. ⬆*[1] V1 ≘ V2 →
64                          ∀V,T. U = ⓓ{p}V.ⓐV2.T → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓐV1.ⓓ{p}V.T⦄.
65 #h #o #p #G #L #X #H
66 @(csx_ind_cpxs … H) -X #X #HVT #IHVT #V1 #V2 #HV12 #V #T #H destruct
67 lapply (csx_fwd_pair_sn … HVT) #HV
68 lapply (csx_fwd_bind_dx … HVT) -HVT #HVT
69 @csx_intro #X #HL #H
70 elim (cpx_inv_appl1 … HL) -HL *
71 [ -HV #V0 #Y #HLV10 #HL #H0 destruct
72   elim (cpx_inv_abbr1 … HL) -HL *
73   [ #V3 #T3 #HV3 #HLT3 #H0 destruct
74     elim (cpx_lifts_sn … HLV10 (Ⓣ) … (L.ⓓV) … HV12) -HLV10 /3 width=1 by drops_refl, drops_drop/ #V4 #HV04 #HV24
75     elim (tdeq_dec h o (ⓓ{p}V.ⓐV2.T) (ⓓ{p}V3.ⓐV4.T3)) #H0
76     [ -IHVT -HV3 -HV24 -HLT3
77       elim (tdeq_inv_pair … H0) -H0 #_ #HV3 #H0
78       elim (tdeq_inv_pair … H0) -H0 #_ #HV24 #HT3
79       elim (tdneq_inv_pair … H) -H #H elim H -H -G -L
80       /3 width=6 by tdeq_inv_lifts_bi, tdeq_pair/
81     | -V1 @(IHVT … H0 … HV04) -o -V0 /4 width=1 by cpx_cpxs, cpx_flat, cpx_bind/
82     ]
83   | -H -IHVT #T0 #HLT0 #HT0 #H0 destruct
84     lapply (csx_cpx_trans … HVT (ⓐV2.T0) ?) /2 width=1 by cpx_flat/ -T #HVT0
85     lapply (csx_inv_lifts … HVT0 (Ⓣ) … L ???) -HVT0
86     /3 width=5 by csx_cpx_trans, cpx_pair_sn, drops_refl, drops_drop, lifts_flat/
87   ]
88 | -HV -HV12 -HVT -IHVT -H #b #V0 #W0 #W1 #T0 #T1 #_ #_ #_ #H destruct
89 | -IHVT -H #b #V0 #V3 #W0 #W1 #T0 #T1 #HLV10 #HV03 #HLW01 #HLT01 #H1 #H2 destruct
90   lapply (cpx_lifts_bi … HLV10 (Ⓣ) … (L.ⓓW0) … HV12 … HV03) -HLV10 -HV12 -HV03 /3 width=1 by drops_refl, drops_drop/ #HLV23
91   @csx_abbr /2 width=3 by csx_cpx_trans/ -HV
92   @(csx_lpx_conf … (L.ⓓW0)) /2 width=1 by lpx_pair/ -W1
93   /4 width=5 by csx_cpxs_trans, cpx_cpxs, cpx_flat/
94 ]
95 qed-.
96
97 lemma csx_appl_theta: ∀h,o,p,G,L,V,V2,T. ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓓ{p}V.ⓐV2.T⦄ →
98                       ∀V1. ⬆*[1] V1 ≘ V2 → ⦃G, L⦄ ⊢ ⬈*[h, o] 𝐒⦃ⓐV1.ⓓ{p}V.T⦄.
99 /2 width=5 by csx_appl_theta_aux/ qed.