]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/computation/lsx_alt.ma
update in lambdadelta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / computation / lsx_alt.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_2A/notation/relations/snalt_6.ma".
16 include "basic_2A/computation/lpxs_lleq.ma".
17 include "basic_2A/computation/lsx.ma".
18
19 (* SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS **********************)
20
21 (* alternative definition of lsx *)
22 definition lsxa: ∀h. sd h → relation4 ynat term genv lenv ≝
23                  λh,g,l,T,G. SN … (lpxs h g G) (lleq l T).
24
25 interpretation
26    "extended strong normalization (local environment) alternative"
27    'SNAlt h g l T G L = (lsxa h g T l G L).
28
29 (* Basic eliminators ********************************************************)
30
31 lemma lsxa_ind: ∀h,g,G,T,l. ∀R:predicate lenv.
32                 (∀L1. G ⊢ ⬊⬊*[h, g, T, l] L1 →
33                       (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 → (L1 ≡[T, l] L2 → ⊥) → R L2) →
34                       R L1
35                 ) →
36                 ∀L. G ⊢ ⬊⬊*[h, g, T, l] L → R L.
37 #h #g #G #T #l #R #H0 #L1 #H elim H -L1
38 /5 width=1 by lleq_sym, SN_intro/
39 qed-.
40
41 (* Basic properties *********************************************************)
42
43 lemma lsxa_intro: ∀h,g,G,L1,T,l.
44                   (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 → (L1 ≡[T, l] L2 → ⊥) → G ⊢ ⬊⬊*[h, g, T, l] L2) →
45                   G ⊢ ⬊⬊*[h, g, T, l] L1.
46 /5 width=1 by lleq_sym, SN_intro/ qed.
47
48 fact lsxa_intro_aux: ∀h,g,G,L1,T,l.
49                      (∀L,L2. ⦃G, L⦄ ⊢ ➡*[h, g] L2 → L1 ≡[T, l] L → (L1 ≡[T, l] L2 → ⊥) → G ⊢ ⬊⬊*[h, g, T, l] L2) →
50                      G ⊢ ⬊⬊*[h, g, T, l] L1.
51 /4 width=3 by lsxa_intro/ qed-.
52
53 lemma lsxa_lleq_trans: ∀h,g,T,G,L1,l. G ⊢ ⬊⬊*[h, g, T, l] L1 →
54                        ∀L2. L1 ≡[T, l] L2 → G ⊢ ⬊⬊*[h, g, T, l] L2.
55 #h #g #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/
59 qed-.
60
61 lemma lsxa_lpxs_trans: ∀h,g,T,G,L1,l. G ⊢ ⬊⬊*[h, g, T, l] L1 →
62                        ∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 → G ⊢ ⬊⬊*[h, g, T, l] L2.
63 #h #g #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/
65 qed-.
66
67 lemma lsxa_intro_lpx: ∀h,g,G,L1,T,l.
68                       (∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → (L1 ≡[T, l] L2 → ⊥) → G ⊢ ⬊⬊*[h, g, T, l] L2) →
69                       G ⊢ ⬊⬊*[h, g, T, l] L1.
70 #h #g #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/
77 ]
78 qed-.
79
80 (* Main properties **********************************************************)
81
82 theorem lsx_lsxa: ∀h,g,G,L,T,l. G ⊢ ⬊*[h, g, T, l] L → G ⊢ ⬊⬊*[h, g, T, l] L.
83 #h #g #G #L #T #l #H @(lsx_ind … H) -L
84 /4 width=1 by lsxa_intro_lpx/
85 qed.
86
87 (* Main inversion lemmas ****************************************************)
88
89 theorem lsxa_inv_lsx: ∀h,g,G,L,T,l. G ⊢ ⬊⬊*[h, g, T, l] L → G ⊢ ⬊*[h, g, T, l] L.
90 #h #g #G #L #T #l #H @(lsxa_ind … H) -L
91 /4 width=1 by lsx_intro, lpx_lpxs/
92 qed-.
93
94 (* Advanced properties ******************************************************)
95
96 lemma lsx_intro_alt: ∀h,g,G,L1,T,l.
97                      (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 → (L1 ≡[T, l] L2 → ⊥) → G ⊢ ⬊*[h, g, T, l] L2) →
98                      G ⊢ ⬊*[h, g, T, l] L1.
99 /6 width=1 by lsxa_inv_lsx, lsx_lsxa, lsxa_intro/ qed.
100
101 lemma lsx_lpxs_trans: ∀h,g,G,L1,T,l. G ⊢ ⬊*[h, g, T, l] L1 →
102                       ∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 → G ⊢ ⬊*[h, g, T, l] L2.
103 /4 width=3 by lsxa_inv_lsx, lsx_lsxa, lsxa_lpxs_trans/ qed-.
104
105 (* Advanced eliminators *****************************************************)
106
107 lemma lsx_ind_alt: ∀h,g,G,T,l. ∀R:predicate lenv.
108                    (∀L1. G ⊢ ⬊*[h, g, T, l] L1 →
109                          (∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 → (L1 ≡[T, l] L2 → ⊥) → R L2) →
110                          R L1
111                    ) →
112                    ∀L. G ⊢ ⬊*[h, g, T, l] L → R L.
113 #h #g #G #T #l #R #IH #L #H @(lsxa_ind h g G T l … L)
114 /4 width=1 by lsxa_inv_lsx, lsx_lsxa/
115 qed-.