]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/etc/llpx/llsx_alt.etc
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / etc / llpx / llsx_alt.etc
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/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".
19
20 (* SN EXTENDED STRONGLY NORMALIZING LOCAL ENVIRONMENTS **********************)
21
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).
25
26 interpretation
27    "lazy extended strong normalization (local environment) alternative"
28    'LazySNAlt h g d T G L = (llsxa h g T d G L).
29
30 (* Basic eliminators ********************************************************)
31
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) →
35                        R L1
36                  ) →
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/
40 qed-.
41
42 (* Basic properties *********************************************************)
43
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.
48
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-.
53
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/
58 qed-.
59
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/
68 ]
69 qed.
70
71 (* Main properties **********************************************************)
72
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/
76 qed.
77
78 (* Main inversion lemmas ****************************************************)
79
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/
83 qed-.
84
85 (* Advanced properties ******************************************************)
86
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.
91
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/
95 qed-.
96
97 (* Advanced eliminators *****************************************************)
98
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) →
102                           R L1
103                     ) →
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/
107 qed-.