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_2A/notation/relations/sn_6.ma".
16 include "basic_2A/multiple/lleq.ma".
17 include "basic_2A/reduction/lpx.ma".
19 (* SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS **********************)
21 definition lsx: ∀h. sd h → relation4 ynat term genv lenv ≝
22 λh,g,l,T,G. SN … (lpx h g G) (lleq l T).
25 "extended strong normalization (local environment)"
26 'SN h g l T G L = (lsx h g T l G L).
28 (* Basic eliminators ********************************************************)
30 lemma lsx_ind: ∀h,g,G,T,l. ∀R:predicate lenv.
31 (∀L1. G ⊢ ⬊*[h, g, T, l] L1 →
32 (∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → (L1 ≡[T, l] L2 → ⊥) → R L2) →
35 ∀L. G ⊢ ⬊*[h, g, T, l] L → R L.
36 #h #g #G #T #l #R #H0 #L1 #H elim H -L1
37 /5 width=1 by lleq_sym, SN_intro/
40 (* Basic properties *********************************************************)
42 lemma lsx_intro: ∀h,g,G,L1,T,l.
43 (∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → (L1 ≡[T, l] L2 → ⊥) → G ⊢ ⬊*[h, g, T, l] L2) →
44 G ⊢ ⬊*[h, g, T, l] L1.
45 /5 width=1 by lleq_sym, SN_intro/ qed.
47 lemma lsx_atom: ∀h,g,G,T,l. G ⊢ ⬊*[h, g, T, l] ⋆.
48 #h #g #G #T #l @lsx_intro
49 #X #H #HT lapply (lpx_inv_atom1 … H) -H
50 #H destruct elim HT -HT //
53 lemma lsx_sort: ∀h,g,G,L,l,k. G ⊢ ⬊*[h, g, ⋆k, l] L.
54 #h #g #G #L1 #l #k @lsx_intro
55 #L2 #HL12 #H elim H -H
56 /3 width=4 by lpx_fwd_length, lleq_sort/
59 lemma lsx_gref: ∀h,g,G,L,l,p. G ⊢ ⬊*[h, g, §p, l] L.
60 #h #g #G #L1 #l #p @lsx_intro
61 #L2 #HL12 #H elim H -H
62 /3 width=4 by lpx_fwd_length, lleq_gref/
65 lemma lsx_ge_up: ∀h,g,G,L,T,U,lt,l,m. lt ≤ yinj l + yinj m →
66 ⬆[l, m] T ≡ U → G ⊢ ⬊*[h, g, U, lt] L → G ⊢ ⬊*[h, g, U, l] L.
67 #h #g #G #L #T #U #lt #l #m #Hltlm #HTU #H @(lsx_ind … H) -L
68 /5 width=7 by lsx_intro, lleq_ge_up/
71 lemma lsx_ge: ∀h,g,G,L,T,l1,l2. l1 ≤ l2 →
72 G ⊢ ⬊*[h, g, T, l1] L → G ⊢ ⬊*[h, g, T, l2] L.
73 #h #g #G #L #T #l1 #l2 #Hl12 #H @(lsx_ind … H) -L
74 /5 width=7 by lsx_intro, lleq_ge/
77 (* Basic forward lemmas *****************************************************)
79 lemma lsx_fwd_bind_sn: ∀h,g,a,I,G,L,V,T,l. G ⊢ ⬊*[h, g, ⓑ{a,I}V.T, l] L →
81 #h #g #a #I #G #L #V #T #l #H @(lsx_ind … H) -L
82 #L1 #_ #IHL1 @lsx_intro
83 #L2 #HL12 #HV @IHL1 /3 width=4 by lleq_fwd_bind_sn/
86 lemma lsx_fwd_flat_sn: ∀h,g,I,G,L,V,T,l. G ⊢ ⬊*[h, g, ⓕ{I}V.T, l] L →
88 #h #g #I #G #L #V #T #l #H @(lsx_ind … H) -L
89 #L1 #_ #IHL1 @lsx_intro
90 #L2 #HL12 #HV @IHL1 /3 width=3 by lleq_fwd_flat_sn/
93 lemma lsx_fwd_flat_dx: ∀h,g,I,G,L,V,T,l. G ⊢ ⬊*[h, g, ⓕ{I}V.T, l] L →
95 #h #g #I #G #L #V #T #l #H @(lsx_ind … H) -L
96 #L1 #_ #IHL1 @lsx_intro
97 #L2 #HL12 #HV @IHL1 /3 width=3 by lleq_fwd_flat_dx/
100 lemma lsx_fwd_pair_sn: ∀h,g,I,G,L,V,T,l. G ⊢ ⬊*[h, g, ②{I}V.T, l] L →
101 G ⊢ ⬊*[h, g, V, l] L.
102 #h #g * /2 width=4 by lsx_fwd_bind_sn, lsx_fwd_flat_sn/
105 (* Basic inversion lemmas ***************************************************)
107 lemma lsx_inv_flat: ∀h,g,I,G,L,V,T,l. G ⊢ ⬊*[h, g, ⓕ{I}V.T, l] L →
108 G ⊢ ⬊*[h, g, V, l] L ∧ G ⊢ ⬊*[h, g, T, l] L.
109 /3 width=3 by lsx_fwd_flat_sn, lsx_fwd_flat_dx, conj/ qed-.