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/snalt_6.ma".
16 include "basic_2/computation/lpxs_lleq.ma".
17 include "basic_2/computation/lsx.ma".
19 (* SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS **********************)
21 (* alternative definition of lsx *)
22 definition lsxa: ∀h. sd h → relation4 ynat term genv lenv ≝
23 λh,o,l,T,G. SN … (lpxs h o G) (lleq l T).
26 "extended strong normalization (local environment) alternative"
27 'SNAlt h o l T G L = (lsxa h o T l G L).
29 (* Basic eliminators ********************************************************)
31 lemma lsxa_ind: ∀h,o,G,T,l. ∀R:predicate lenv.
32 (∀L1. G ⊢ ⬊⬊*[h, o, T, l] L1 →
33 (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, o] L2 → (L1 ≡[T, l] L2 → ⊥) → R L2) →
36 ∀L. G ⊢ ⬊⬊*[h, o, T, l] L → R L.
37 #h #o #G #T #l #R #H0 #L1 #H elim H -L1
38 /5 width=1 by lleq_sym, SN_intro/
41 (* Basic properties *********************************************************)
43 lemma lsxa_intro: ∀h,o,G,L1,T,l.
44 (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, o] L2 → (L1 ≡[T, l] L2 → ⊥) → G ⊢ ⬊⬊*[h, o, T, l] L2) →
45 G ⊢ ⬊⬊*[h, o, T, l] L1.
46 /5 width=1 by lleq_sym, SN_intro/ qed.
48 fact lsxa_intro_aux: ∀h,o,G,L1,T,l.
49 (∀L,L2. ⦃G, L⦄ ⊢ ➡*[h, o] L2 → L1 ≡[T, l] L → (L1 ≡[T, l] L2 → ⊥) → G ⊢ ⬊⬊*[h, o, T, l] L2) →
50 G ⊢ ⬊⬊*[h, o, T, l] L1.
51 /4 width=3 by lsxa_intro/ qed-.
53 lemma lsxa_lleq_trans: ∀h,o,T,G,L1,l. G ⊢ ⬊⬊*[h, o, T, l] L1 →
54 ∀L2. L1 ≡[T, l] L2 → G ⊢ ⬊⬊*[h, o, T, l] L2.
55 #h #o #T #G #L1 #l #H @(lsxa_ind … H) -L1
56 #L1 #_ #IHL1 #L2 #HL12 @lsxa_intro
57 #K2 #HLK2 #HnLK2 elim (lleq_lpxs_trans … HLK2 … HL12) -HLK2
58 /5 width=4 by lleq_canc_sn, lleq_trans/
61 lemma lsxa_lpxs_trans: ∀h,o,T,G,L1,l. G ⊢ ⬊⬊*[h, o, T, l] L1 →
62 ∀L2. ⦃G, L1⦄ ⊢ ➡*[h, o] L2 → G ⊢ ⬊⬊*[h, o, T, l] L2.
63 #h #o #T #G #L1 #l #H @(lsxa_ind … H) -L1 #L1 #HL1 #IHL1 #L2 #HL12
64 elim (lleq_dec T L1 L2 l) /3 width=4 by lsxa_lleq_trans/
67 lemma lsxa_intro_lpx: ∀h,o,G,L1,T,l.
68 (∀L2. ⦃G, L1⦄ ⊢ ➡[h, o] L2 → (L1 ≡[T, l] L2 → ⊥) → G ⊢ ⬊⬊*[h, o, T, l] L2) →
69 G ⊢ ⬊⬊*[h, o, T, l] L1.
70 #h #o #G #L1 #T #l #IH @lsxa_intro_aux
71 #L #L2 #H @(lpxs_ind_dx … H) -L
72 [ #H destruct #H elim H //
73 | #L0 #L elim (lleq_dec T L1 L l) /3 width=1 by/
74 #HnT #HL0 #HL2 #_ #HT #_ elim (lleq_lpx_trans … HL0 … HT) -L0
75 #L0 #HL10 #HL0 @(lsxa_lpxs_trans … HL2) -HL2
76 /5 width=3 by lsxa_lleq_trans, lleq_trans/
80 (* Main properties **********************************************************)
82 theorem lsx_lsxa: ∀h,o,G,L,T,l. G ⊢ ⬊*[h, o, T, l] L → G ⊢ ⬊⬊*[h, o, T, l] L.
83 #h #o #G #L #T #l #H @(lsx_ind … H) -L
84 /4 width=1 by lsxa_intro_lpx/
87 (* Main inversion lemmas ****************************************************)
89 theorem lsxa_inv_lsx: ∀h,o,G,L,T,l. G ⊢ ⬊⬊*[h, o, T, l] L → G ⊢ ⬊*[h, o, T, l] L.
90 #h #o #G #L #T #l #H @(lsxa_ind … H) -L
91 /4 width=1 by lsx_intro, lpx_lpxs/
94 (* Advanced properties ******************************************************)
96 lemma lsx_intro_alt: ∀h,o,G,L1,T,l.
97 (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, o] L2 → (L1 ≡[T, l] L2 → ⊥) → G ⊢ ⬊*[h, o, T, l] L2) →
98 G ⊢ ⬊*[h, o, T, l] L1.
99 /6 width=1 by lsxa_inv_lsx, lsx_lsxa, lsxa_intro/ qed.
101 lemma lsx_lpxs_trans: ∀h,o,G,L1,T,l. G ⊢ ⬊*[h, o, T, l] L1 →
102 ∀L2. ⦃G, L1⦄ ⊢ ➡*[h, o] L2 → G ⊢ ⬊*[h, o, T, l] L2.
103 /4 width=3 by lsxa_inv_lsx, lsx_lsxa, lsxa_lpxs_trans/ qed-.
105 (* Advanced eliminators *****************************************************)
107 lemma lsx_ind_alt: ∀h,o,G,T,l. ∀R:predicate lenv.
108 (∀L1. G ⊢ ⬊*[h, o, T, l] L1 →
109 (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, o] L2 → (L1 ≡[T, l] L2 → ⊥) → R L2) →
112 ∀L. G ⊢ ⬊*[h, o, T, l] L → R L.
113 #h #o #G #T #l #R #IH #L #H @(lsxa_ind h o G T l … L)
114 /4 width=1 by lsxa_inv_lsx, lsx_lsxa/