]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/computation/lsx_csx.ma
update in lambdadelta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / computation / lsx_csx.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/csx_lpxs.ma".
16 include "basic_2A/computation/lcosx_cpx.ma".
17
18 (* SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS **********************)
19
20 (* Advanced properties ******************************************************)
21
22 lemma lsx_lref_be_lpxs: ∀h,g,I,G,K1,V,i,l. l ≤ yinj i → ⦃G, K1⦄ ⊢ ⬊*[h, g] V →
23                         ∀K2. G ⊢ ⬊*[h, g, V, 0] K2 → ⦃G, K1⦄ ⊢ ➡*[h, g] K2 →
24                         ∀L2. ⬇[i] L2 ≡ K2.ⓑ{I}V → G ⊢ ⬊*[h, g, #i, l] L2.
25 #h #g #I #G #K1 #V #i #l #Hli #H @(csx_ind_alt … H) -V
26 #V0 #_ #IHV0 #K2 #H @(lsx_ind … H) -K2
27 #K0 #HK0 #IHK0 #HK10 #L0 #HLK0 @lsx_intro
28 #L2 #HL02 #HnL02 elim (lpx_drop_conf … HLK0 … HL02) -HL02
29 #Y #H #HLK2 elim (lpx_inv_pair1 … H) -H
30 #K2 #V2 #HK02 #HV02 #H destruct
31 elim (eq_term_dec V0 V2) #HnV02 destruct [ -IHV0 -HV02 -HK0 | -IHK0 -HnL02 -HLK0 ]
32 [ /4 width=8 by lpxs_strap1, lleq_lref/
33 | @(IHV0 … HnV02 … HLK2) -IHV0 -HnV02 -HLK2
34   /3 width=4 by lsx_cpx_trans_O, lsx_lpx_trans, lpxs_cpx_trans, lpxs_strap1/ (**) (* full auto too slow *)
35 ]
36 qed.
37
38 lemma lsx_lref_be: ∀h,g,I,G,K,V,i,l. l ≤ yinj i → ⦃G, K⦄ ⊢ ⬊*[h, g] V →
39                    G ⊢ ⬊*[h, g, V, 0] K →
40                    ∀L. ⬇[i] L ≡ K.ⓑ{I}V → G ⊢ ⬊*[h, g, #i, l] L.
41 /2 width=8 by lsx_lref_be_lpxs/ qed.
42
43 (* Main properties **********************************************************)
44
45 theorem csx_lsx: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ ⬊*[h, g] T → ∀l. G ⊢ ⬊*[h, g, T, l] L.
46 #h #g #G #L #T @(fqup_wf_ind_eq … G L T) -G -L -T
47 #Z #Y #X #IH #G #L * * //
48 [ #i #HG #HL #HT #H #l destruct
49   elim (lt_or_ge i (|L|)) /2 width=1 by lsx_lref_free/
50   elim (ylt_split i l) /2 width=1 by lsx_lref_skip/
51   #Hli #Hi elim (drop_O1_lt (Ⓕ) … Hi) -Hi
52   #I #K #V #HLK lapply (csx_inv_lref_bind … HLK … H) -H
53   /4 width=6 by lsx_lref_be, fqup_lref/
54 | #a #I #V #T #HG #HL #HT #H #l destruct
55   elim (csx_fwd_bind … H) -H /3 width=1 by lsx_bind/
56 | #I #V #T #HG #HL #HT #H #l destruct
57   elim (csx_fwd_flat … H) -H /3 width=1 by lsx_flat/
58 ]
59 qed.