]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/rt_computation/csx.ma
csx on the way ...
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_computation / csx.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/predtystrong_5.ma".
16 include "basic_2/syntax/tdeq.ma".
17 include "basic_2/rt_transition/cpx.ma".
18
19 (* STRONGLY NORMALIZING TERMS FOR UNCOUNTED PARALLEL RT-TRANSITION **********)
20
21 definition csx: ∀h. sd h → relation3 genv lenv term ≝
22                 λh,o,G,L. SN … (cpx h G L) (tdeq h o …).
23
24 interpretation
25    "strong normalization for uncounted context-sensitive parallel rt-transition (term)"
26    'PRedTyStrong h o G L T = (csx h o G L T).
27
28 (* Basic eliminators ********************************************************)
29
30 lemma csx_ind: ∀h,o,G,L. ∀R:predicate term.
31                (∀T1. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃T1⦄ →
32                      (∀T2. ⦃G, L⦄ ⊢ T1 ⬈[h] T2 → (T1 ≡[h, o] T2 → ⊥) → R T2) →
33                      R T1
34                ) →
35                ∀T. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃T⦄ → R T.
36 #h #o #G #L #R #H0 #T1 #H elim H -T1
37 /5 width=1 by SN_intro/
38 qed-.
39
40 (* Basic properties *********************************************************)
41
42 (* Basic_1: was just: sn3_pr2_intro *)
43 lemma csx_intro: ∀h,o,G,L,T1.
44                  (∀T2. ⦃G, L⦄ ⊢ T1 ⬈[h] T2 → (T1 ≡[h, o] T2 → ⊥) → ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃T2⦄) →
45                  ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃T1⦄.
46 /4 width=1 by SN_intro/ qed.
47
48 lemma csx_sort: ∀h,o,G,L,s. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃⋆s⦄.
49 #h #o #G #L #s elim (deg_total h o s)
50 #d generalize in match s; -s elim d -d
51 [ #s1 #Hs1 @csx_intro #X #H #HX elim HX -HX
52   elim (cpx_inv_sort1 … H) -H #H destruct //
53   /3 width=3 by tdeq_sort, deg_next/
54 | #d #IH #s #Hsd lapply (deg_next_SO … Hsd) -Hsd
55   #Hsd @csx_intro #X #H #HX
56   elim (cpx_inv_sort1 … H) -H #H destruct /2 width=1 by/
57   elim HX //
58 ]
59 qed.
60
61 (* Basic forward lemmas *****************************************************)
62
63 fact csx_fwd_pair_sn_aux: ∀h,o,G,L,U. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃U⦄ →
64                           ∀I,V,T. U = ②{I}V.T → ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃V⦄.
65 #h #o #G #L #U #H elim H -H #U0 #_ #IH #I #V #T #H destruct
66 @csx_intro #V2 #HLV2 #HV2
67 @(IH (②{I}V2.T)) -IH /2 width=3 by cpx_pair_sn/ -HLV2
68 #H elim (tdeq_inv_pair … H) -H /2 width=1 by/
69 qed-.
70
71 (* Basic_1: was just: sn3_gen_head *)
72 lemma csx_fwd_pair_sn: ∀h,o,I,G,L,V,T. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃②{I}V.T⦄ → ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃V⦄.
73 /2 width=5 by csx_fwd_pair_sn_aux/ qed-.
74
75 fact csx_fwd_bind_dx_aux: ∀h,o,G,L,U. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃U⦄ →
76                           ∀p,I,V,T. U = ⓑ{p,I}V.T → ⦃G, L.ⓑ{I}V⦄ ⊢ ⬈[h, o] 𝐒⦃T⦄.
77 #h #o #G #L #U #H elim H -H #U0 #_ #IH #p #I #V #T #H destruct
78 @csx_intro #T2 #HLT2 #HT2
79 @(IH (ⓑ{p,I}V.T2)) -IH /2 width=3 by cpx_bind/ -HLT2
80 #H elim (tdeq_inv_pair … H) -H /2 width=1 by/
81 qed-.
82
83 (* Basic_1: was just: sn3_gen_bind *)
84 lemma csx_fwd_bind_dx: ∀h,o,p,I,G,L,V,T. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃ⓑ{p,I}V.T⦄ → ⦃G, L.ⓑ{I}V⦄ ⊢ ⬈[h, o] 𝐒⦃T⦄.
85 /2 width=4 by csx_fwd_bind_dx_aux/ qed-.
86
87 fact csx_fwd_flat_dx_aux: ∀h,o,G,L,U. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃U⦄ →
88                           ∀I,V,T. U = ⓕ{I}V.T → ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃T⦄.
89 #h #o #G #L #U #H elim H -H #U0 #_ #IH #I #V #T #H destruct
90 @csx_intro #T2 #HLT2 #HT2
91 @(IH (ⓕ{I}V.T2)) -IH /2 width=3 by cpx_flat/ -HLT2
92 #H elim (tdeq_inv_pair … H) -H /2 width=1 by/
93 qed-.
94
95 (* Basic_1: was just: sn3_gen_flat *)
96 lemma csx_fwd_flat_dx: ∀h,o,I,G,L,V,T. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃ⓕ{I}V.T⦄ → ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃T⦄.
97 /2 width=5 by csx_fwd_flat_dx_aux/ qed-.
98
99 lemma csx_fwd_bind: ∀h,o,p,I,G,L,V,T. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃ⓑ{p,I}V.T⦄ →
100                     ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃V⦄ ∧ ⦃G, L.ⓑ{I}V⦄ ⊢ ⬈[h, o] 𝐒⦃T⦄.
101 /3 width=3 by csx_fwd_pair_sn, csx_fwd_bind_dx, conj/ qed-.
102
103 lemma csx_fwd_flat: ∀h,o,I,G,L,V,T. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃ⓕ{I}V.T⦄ →
104                     ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃V⦄ ∧ ⦃G, L⦄ ⊢ ⬈[h, o] 𝐒⦃T⦄.
105 /3 width=3 by csx_fwd_pair_sn, csx_fwd_flat_dx, conj/ qed-.
106
107 (* Basic_1: removed theorems 14:
108             sn3_cdelta
109             sn3_gen_cflat sn3_cflat sn3_cpr3_trans sn3_shift sn3_change
110             sn3_appl_cast sn3_appl_beta sn3_appl_lref sn3_appl_abbr
111             sn3_appl_appls sn3_bind sn3_appl_bind sn3_appls_bind
112 *)