]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/computation/lsx.ma
some improvements on the relation lsx ...
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / computation / lsx.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_2/notation/relations/lazysn_5.ma".
16 include "basic_2/substitution/lleq.ma".
17 include "basic_2/computation/lpxs.ma".
18
19 (* SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS **********************)
20
21 definition lsx: ∀h. sd h → relation3 term genv lenv ≝
22                 λh,g,T,G. SN … (lpxs h g G) (lleq 0 T).
23
24 interpretation
25    "extended strong normalization (local environment)"
26    'LazySN h g T G L = (lsx h g T G L).
27
28 (* Basic eliminators ********************************************************)
29
30 lemma lsx_ind: ∀h,g,T,G. ∀R:predicate lenv.
31                (∀L1. G ⊢ ⋕⬊*[h, g, T] L1 →
32                      (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 → (L1 ⋕[T, 0] L2 → ⊥) → R L2) →
33                      R L1
34                ) →
35                ∀L. G ⊢ ⋕⬊*[h, g, T] L → R L.
36 #h #g #T #G #R #H0 #L1 #H elim H -L1
37 /5 width=1 by lleq_sym, SN_intro/
38 qed-.
39
40 (* Basic properties *********************************************************)
41
42 lemma lsx_intro: ∀h,g,T,G,L1.
43                  (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 → (L1 ⋕[T, 0] L2 → ⊥) → G ⊢ ⋕⬊*[h, g, T] L2) →
44                  G ⊢ ⋕⬊*[h, g, T] L1.
45 /5 width=1 by lleq_sym, SN_intro/ qed.
46
47 lemma lsx_atom: ∀h,g,T,G. G ⊢ ⋕⬊*[h, g, T] ⋆.
48 #h #g #T #G @lsx_intro
49 #X #H #HT lapply (lpxs_inv_atom1 … H) -H
50 #H destruct elim HT -HT //
51 qed.
52
53 lemma lsx_sort: ∀h,g,G,L,k. G ⊢ ⋕⬊*[h, g, ⋆k] L.
54 #h #g #G #L1 #k @lsx_intro
55 #L2 #HL12 #H elim H -H
56 /3 width=4 by lpxs_fwd_length, lleq_sort/
57 qed.
58
59 lemma lsx_gref: ∀h,g,G,L,p. G ⊢ ⋕⬊*[h, g, §p] L.
60 #h #g #G #L1 #p @lsx_intro
61 #L2 #HL12 #H elim H -H
62 /3 width=4 by lpxs_fwd_length, lleq_gref/
63 qed.
64
65 (* Basic forward lemmas *****************************************************)
66
67 lemma lsx_fwd_bind_sn: ∀h,g,a,I,G,L,V,T. G ⊢ ⋕⬊*[h, g, ⓑ{a,I}V.T] L →
68                        G ⊢ ⋕⬊*[h, g, V] L.
69 #h #g #a #I #G #L #V #T #H @(lsx_ind … H) -L
70 #L1 #_ #IHL1 @lsx_intro
71 #L2 #HL12 #HV @IHL1 /3 width=4 by lleq_fwd_bind_sn/
72 qed-.
73
74 lemma lsx_fwd_flat_sn: ∀h,g,I,G,L,V,T. G ⊢ ⋕⬊*[h, g, ⓕ{I}V.T] L →
75                        G ⊢ ⋕⬊*[h, g, V] L.
76 #h #g #I #G #L #V #T #H @(lsx_ind … H) -L
77 #L1 #_ #IHL1 @lsx_intro
78 #L2 #HL12 #HV @IHL1 /3 width=3 by lleq_fwd_flat_sn/
79 qed-.
80
81 lemma lsx_fwd_flat_dx: ∀h,g,I,G,L,V,T. G ⊢ ⋕⬊*[h, g, ⓕ{I}V.T] L →
82                        G ⊢ ⋕⬊*[h, g, T] L.
83 #h #g #I #G #L #V #T #H @(lsx_ind … H) -L
84 #L1 #_ #IHL1 @lsx_intro
85 #L2 #HL12 #HV @IHL1 /3 width=3 by lleq_fwd_flat_dx/
86 qed-.
87
88 lemma lsx_fwd_pair_sn: ∀h,g,I,G,L,V,T. G ⊢ ⋕⬊*[h, g, ②{I}V.T] L →
89                        G ⊢ ⋕⬊*[h, g, V] L.
90 #h #g * /2 width=4 by lsx_fwd_bind_sn, lsx_fwd_flat_sn/
91 qed-.
92
93 (* Basic inversion lemmas ***************************************************)
94
95 lemma lsx_inv_flat: ∀h,g,I,G,L,V,T. G ⊢ ⋕⬊*[h, g, ⓕ{I}V.T] L →
96                     G ⊢ ⋕⬊*[h, g, V] L ∧ G ⊢ ⋕⬊*[h, g, T] L.
97 /3 width=3 by lsx_fwd_flat_sn, lsx_fwd_flat_dx, conj/ qed-.