]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/computation/lsx_lpxs.ma
update in lambdadelta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / computation / lsx_lpxs.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/lpxs_lpxs.ma".
16 include "basic_2A/computation/lsx_alt.ma".
17
18 (* SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS **********************)
19
20 (* Advanced properties ******************************************************)
21
22 fact lsx_bind_lpxs_aux: ∀h,g,a,I,G,L1,V,l. G ⊢ ⬊*[h, g, V, l] L1 →
23                         ∀Y,T. G ⊢ ⬊*[h, g, T, ⫯l] Y →
24                         ∀L2. Y = L2.ⓑ{I}V → ⦃G, L1⦄ ⊢ ➡*[h, g] L2 →
25                         G ⊢ ⬊*[h, g, ⓑ{a,I}V.T, l] L2.
26 #h #g #a #I #G #L1 #V #l #H @(lsx_ind_alt … H) -L1
27 #L1 #HL1 #IHL1 #Y #T #H @(lsx_ind_alt … H) -Y
28 #Y #HY #IHY #L2 #H #HL12 destruct @lsx_intro_alt
29 #L0 #HL20 lapply (lpxs_trans … HL12 … HL20)
30 #HL10 #H elim (nlleq_inv_bind … H) -H [ -HL1 -IHY | -HY -IHL1 ]
31 [ #HnV elim (lleq_dec V L1 L2 l)
32   [ #HV @(IHL1 … L0) /3 width=5 by lsx_lpxs_trans, lpxs_pair, lleq_canc_sn/ (**) (* full auto too slow *)
33   | -HnV -HL10 /4 width=5 by lsx_lpxs_trans, lpxs_pair/
34   ]
35 | /3 width=4 by lpxs_pair/
36 ]
37 qed-.
38
39 lemma lsx_bind: ∀h,g,a,I,G,L,V,l. G ⊢ ⬊*[h, g, V, l] L →
40                 ∀T. G ⊢ ⬊*[h, g, T, ⫯l] L.ⓑ{I}V →
41                 G ⊢ ⬊*[h, g, ⓑ{a,I}V.T, l] L.
42 /2 width=3 by lsx_bind_lpxs_aux/ qed.
43
44 lemma lsx_flat_lpxs: ∀h,g,I,G,L1,V,l. G ⊢ ⬊*[h, g, V, l] L1 →
45                      ∀L2,T. G ⊢ ⬊*[h, g, T, l] L2 → ⦃G, L1⦄ ⊢ ➡*[h, g] L2 →
46                      G ⊢ ⬊*[h, g, ⓕ{I}V.T, l] L2.
47 #h #g #I #G #L1 #V #l #H @(lsx_ind_alt … H) -L1
48 #L1 #HL1 #IHL1 #L2 #T #H @(lsx_ind_alt … H) -L2
49 #L2 #HL2 #IHL2 #HL12 @lsx_intro_alt
50 #L0 #HL20 lapply (lpxs_trans … HL12 … HL20)
51 #HL10 #H elim (nlleq_inv_flat … H) -H [ -HL1 -IHL2 | -HL2 -IHL1 ]
52 [ #HnV elim (lleq_dec V L1 L2 l)
53   [ #HV @(IHL1 … L0) /3 width=3 by lsx_lpxs_trans, lleq_canc_sn/ (**) (* full auto too slow: 47s *)
54   | -HnV -HL10 /3 width=4 by lsx_lpxs_trans/
55   ]
56 | /3 width=1 by/
57 ]
58 qed-.
59
60 lemma lsx_flat: ∀h,g,I,G,L,V,l. G ⊢ ⬊*[h, g, V, l] L →
61                 ∀T. G ⊢ ⬊*[h, g, T, l] L → G ⊢ ⬊*[h, g, ⓕ{I}V.T, l] L.
62 /2 width=3 by lsx_flat_lpxs/ qed.