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/notation/relations/lazysnalt_6.ma".
16 include "basic_2/substitution/lleq_lleq.ma".
17 include "basic_2/computation/llpxs_lleq.ma".
18 include "basic_2/computation/llsx.ma".
20 (* SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS **********************)
22 (* alternative definition of llsx *)
23 definition llsxa: ∀h. sd h → relation4 ynat term genv lenv ≝
24 λh,g,d,T,G. SN … (llpxs h g G d T) (lleq d T).
27 "lazy extended strong normalization (local environment) alternative"
28 'LazySNAlt h g d T G L = (llsxa h g T d G L).
30 (* Basic eliminators ********************************************************)
32 lemma llsxa_ind: ∀h,g,G,T,d. ∀R:predicate lenv.
33 (∀L1. G ⊢ ⋕⬊⬊*[h, g, T, d] L1 →
34 (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → (L1 ⋕[T, d] L2 → ⊥) → R L2) →
37 ∀L. G ⊢ ⋕⬊⬊*[h, g, T, d] L → R L.
38 #h #g #G #T #d #R #H0 #L1 #H elim H -L1
39 /5 width=1 by lleq_sym, SN_intro/
42 (* Basic properties *********************************************************)
44 lemma llsxa_intro: ∀h,g,G,L1,T,d.
45 (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → (L1 ⋕[T, d] L2 → ⊥) → G ⊢ ⋕⬊⬊*[h, g, T, d] L2) →
46 G ⊢ ⋕⬊⬊*[h, g, T, d] L1.
47 /5 width=1 by lleq_sym, SN_intro/ qed.
49 fact llsxa_intro_aux: ∀h,g,G,L1,T,d.
50 (∀L,L2. ⦃G, L⦄ ⊢ ➡*[h, g, T, d] L2 → L1 ⋕[T, d] L → (L1 ⋕[T, d] L2 → ⊥) → G ⊢ ⋕⬊⬊*[h, g, T, d] L2) →
51 G ⊢ ⋕⬊⬊*[h, g, T, d] L1.
52 /4 width=3 by llsxa_intro/ qed-.
54 lemma llsxa_llpxs_trans: ∀h,g,G,L1,T,d. G ⊢ ⋕⬊⬊*[h, g, T, d] L1 →
55 ∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → G ⊢ ⋕⬊⬊*[h, g, T, d] L2.
56 #h #g #G #L1 #T #d #H @(llsxa_ind … H) -L1 #L1 #HL1 #IHL1 #L2 #HL12 @llsxa_intro
57 elim (lleq_dec T L1 L2 d) /4 width=4 by lleq_llpxs_trans, lleq_canc_sn/
60 lemma llsxa_intro_llpx: ∀h,g,G,L1,T,d.
61 (∀L2. ⦃G, L1⦄ ⊢ ➡[h, g, T, d] L2 → (L1 ⋕[T, d] L2 → ⊥) → G ⊢ ⋕⬊⬊*[h, g, T, d] L2) →
62 G ⊢ ⋕⬊⬊*[h, g, T, d] L1.
63 #h #g #G #L1 #T #d #IH @llsxa_intro_aux
64 #L #L2 #H @(llpxs_ind_dx … H) -L
65 [ #H destruct #H elim H //
66 | #L0 #L elim (lleq_dec T L1 L d)
67 /4 width=3 by llsxa_llpxs_trans, lleq_llpx_trans/
71 (* Main properties **********************************************************)
73 theorem llsx_llsxa: ∀h,g,G,L,T,d. G ⊢ ⋕⬊*[h, g, T, d] L → G ⊢ ⋕⬊⬊*[h, g, T, d] L.
74 #h #g #G #L #T #d #H @(llsx_ind … H) -L
75 /4 width=1 by llsxa_intro_llpx/
78 (* Main inversion lemmas ****************************************************)
80 theorem llsxa_inv_llsx: ∀h,g,G,L,T,d. G ⊢ ⋕⬊⬊*[h, g, T, d] L → G ⊢ ⋕⬊*[h, g, T, d] L.
81 #h #g #G #L #T #d #H @(llsxa_ind … H) -L
82 /4 width=1 by llsx_intro, llpx_llpxs/
85 (* Advanced properties ******************************************************)
87 lemma llsx_intro_alt: ∀h,g,G,L1,T,d.
88 (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → (L1 ⋕[T, d] L2 → ⊥) → G ⊢ ⋕⬊*[h, g, T, d] L2) →
89 G ⊢ ⋕⬊*[h, g, T, d] L1.
90 /6 width=1 by llsxa_inv_llsx, llsx_llsxa, llsxa_intro/ qed.
92 lemma llsx_llpxs_trans: ∀h,g,G,L1,T,d. G ⊢ ⋕⬊*[h, g, T, d] L1 →
93 ∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → G ⊢ ⋕⬊*[h, g, T, d] L2.
94 /4 width=3 by llsxa_inv_llsx, llsx_llsxa, llsxa_llpxs_trans/
97 (* Advanced eliminators *****************************************************)
99 lemma llsx_ind_alt: ∀h,g,G,T,d. ∀R:predicate lenv.
100 (∀L1. G ⊢ ⋕⬊*[h, g, T, d] L1 →
101 (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g, T, d] L2 → (L1 ⋕[T, d] L2 → ⊥) → R L2) →
104 ∀L. G ⊢ ⋕⬊*[h, g, T, d] L → R L.
105 #h #g #G #T #d #R #IH #L #H @(llsxa_ind h g G T d … L)
106 /4 width=1 by llsxa_inv_llsx, llsx_llsxa/