]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/Basic_2/computation/csn.ma
- first properties of strongly normalizing terms
[helm.git] / matita / matita / contribs / lambda_delta / Basic_2 / computation / csn.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/reducibility/cpr.ma".
16 include "Basic_2/reducibility/cnf.ma".
17
18 (* CONTEXT-SENSITIVE STRONGLY NORMALIZING TERMS *****************************)
19
20 definition csn: lenv → predicate term ≝ λL. SN … (cpr L) (eq …).
21
22 interpretation
23    "context-sensitive strong normalization (term)"
24    'SN L T = (csn L T).
25
26 (* Basic eliminators ********************************************************)
27
28 lemma csn_ind: ∀L. ∀R:predicate term.
29                (∀T1. L ⊢ ⬇* T1 →
30                      (∀T2. L ⊢ T1 ➡ T2 → (T1 = T2 → False) → R T2) →
31                      R T1
32                ) →
33                ∀T. L ⊢ ⬇* T → R T.
34 #L #R #H0 #T1 #H elim H -T1 #T1 #HT1 #IHT1
35 @H0 -H0 /3 width=1/ -IHT1 /4 width=1/
36 qed-.
37
38 (* Basic properties *********************************************************)
39
40 (* Basic_1: was: sn3_pr2_intro *)
41 lemma csn_intro: ∀L,T1.
42                  (∀T2. L ⊢ T1 ➡ T2 → (T1 = T2 → False) → L ⊢ ⬇* T2) → L ⊢ ⬇* T1.
43 #L #T1 #H
44 @(SN_intro … H)
45 qed.
46
47 (* Basic_1: was: sn3_nf2 *)
48 lemma csn_cnf: ∀L,T. L ⊢ 𝐍[T] → L ⊢ ⬇* T.
49 /2 width=1/ qed.
50
51 lemma csn_cpr_trans: ∀L,T1. L ⊢ ⬇* T1 → ∀T2. L ⊢ T1 ➡ T2 → L ⊢ ⬇* T2.
52 #L #T1 #H elim H -T1 #T1 #HT1 #IHT1 #T2 #HLT12
53 @csn_intro #T #HLT2 #HT2
54 elim (term_eq_dec T1 T2) #HT12
55 [ -IHT1 -HLT12 destruct /3 width=1/
56 | -HT1 -HT2 /3 width=4/
57 qed.
58
59 axiom tpss_csn_trans: ∀L,T2. L ⊢ ⬇* T2 → ∀T1,d,e. L ⊢ T1 [d, e] ▶* T2 → L ⊢ ⬇* T1.
60 (*
61 #L #T2 #H @(csn_ind … H) -T2 #T2 #HT2 #IHT2 #T1 #d #e #HT12
62 @csn_intro #T #HLT1 #HT1  
63 *)
64 (* Basic_1: was: sn3_cast *)
65 lemma csn_cast: ∀L,W. L ⊢ ⬇* W → ∀T. L ⊢ ⬇* T → L ⊢ ⬇* ⓣW. T.
66 #L #W #HW elim HW -W #W #_ #IHW #T #HT @(csn_ind … HT) -T #T #HT #IHT
67 @csn_intro #X #H1 #H2
68 elim (cpr_inv_cast1 … H1) -H1
69 [ * #W0 #T0 #HLW0 #HLT0 #H destruct
70   elim (eq_false_inv_tpair … H2) -H2
71   [ /3 width=3/
72   | -HLW0 * #H destruct /3 width=1/ 
73   ]
74 | /3 width=3/
75 ]
76 qed.
77
78 (* Basic forward lemmas *****************************************************)
79
80 fact csn_fwd_flat2_aux: ∀L,U. L ⊢ ⬇* U → ∀I,V,T. U = ⓕ{I} V. T → L ⊢ ⬇* T.
81 #L #U #H elim H -H #U0 #_ #IH #I #V #T #H destruct
82 @csn_intro #T2 #HLT2 #HT2
83 @(IH (ⓕ{I} V. T2)) -IH // /2 width=1/ -HLT2 #H destruct /2 width=1/
84 qed.
85
86 (* Basic_1: was: sn3_gen_flat *)
87 lemma csn_fwd_flat2: ∀I,L,V,T. L ⊢ ⬇* ⓕ{I} V. T → L ⊢ ⬇* T.
88 /2 width=5/ qed-.
89
90 (*
91 sn3/fwd sn3_gen_bind
92 sn3/fwd sn3_gen_head
93 *)
94
95 (* Basic_1: removed theorems 3: sn3_gen_cflat sn3_cflat sn3_bind *)