1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "basic_2/computation/lpxs_lleq.ma".
16 include "basic_2/computation/lpxs_lpxs.ma".
17 include "basic_2/computation/lsx.ma".
19 (* SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS **********************)
21 (* Advanced properties ******************************************************)
23 lemma lsx_lleq_trans: ∀h,g,T,G,L1. G ⊢ ⋕⬊*[h, g, T] L1 →
24 ∀L2. L1 ⋕[T, 0] L2 → G ⊢ ⋕⬊*[h, g, T] L2.
25 #h #g #T #G #L1 #H @(lsx_ind … H) -L1
26 #L1 #_ #IHL1 #L2 #HL12 @lsx_intro
27 #K2 #HLK2 #HnLK2 elim (lleq_lpxs_trans … HL12 … HLK2) -HLK2
28 /5 width=4 by lleq_canc_sn, lleq_trans/
31 lemma lsx_lpxs_trans: ∀h,g,T,G,L1. G ⊢ ⋕⬊*[h, g, T] L1 →
32 ∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 → G ⊢ ⋕⬊*[h, g, T] L2.
33 #h #g #T #G #L1 #H @(lsx_ind … H) -L1 #L1 #HL1 #IHL1 #L2 #HL12
34 elim (lleq_dec T L1 L2 0) /3 width=4 by lsx_lleq_trans/
37 lemma lsx_flat_lpxs: ∀h,g,I,G,L1,V. G ⊢ ⋕⬊*[h, g, V] L1 →
38 ∀L2,T. G ⊢ ⋕⬊*[h, g, T] L2 → ⦃G, L1⦄ ⊢ ➡*[h, g] L2 →
39 G ⊢ ⋕⬊*[h, g, ⓕ{I}T.V] L2.
40 #h #g #I #G #L1 #V #H @(lsx_ind … H) -L1
41 #L1 #HL1 #IHL1 #L2 #T #H @(lsx_ind … H) -L2
42 #L2 #HL2 #IHL2 #HL12 @lsx_intro
43 #L0 #HL20 lapply (lpxs_trans … HL12 … HL20)
44 #HL10 #H elim (nlleq_inv_flat … H) -H [ -HL2 -IHL1 | -HL1 -IHL2 ]
46 | #HnV elim (lleq_dec V L1 L2 0)
47 [ #HV @(IHL1 … L0) /3 width=3 by lsx_lpxs_trans, lleq_canc_sn/ (**) (* full auto too slow: 47s *)
48 | -HnV -HL10 /3 width=4 by lsx_lpxs_trans/
52 lemma lsx_flat: ∀h,g,I,G,L,V. G ⊢ ⋕⬊*[h, g, V] L →
53 ∀T. G ⊢ ⋕⬊*[h, g, T] L → G ⊢ ⋕⬊*[h, g, ⓕ{I}T.V] L.
54 /2 width=3 by lsx_flat_lpxs/ qed.