]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/basic_2/computation/csn.ma
- we introduced the pointer_step rc in the perspective of proving
[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/cnf.ma".
16
17 (* CONTEXT-SENSITIVE STRONGLY NORMALIZING TERMS *****************************)
18
19 definition csn: lenv → predicate term ≝ λL. SN … (cpr L) (eq …).
20
21 interpretation
22    "context-sensitive strong normalization (term)"
23    'SN L T = (csn L T).
24
25 (* Basic eliminators ********************************************************)
26
27 lemma csn_ind: ∀L. ∀R:predicate term.
28                (∀T1. L ⊢ ⬊* T1 →
29                      (∀T2. L ⊢ T1 ➡ T2 → (T1 = T2 → ⊥) → R T2) →
30                      R T1
31                ) →
32                ∀T. L ⊢ ⬊* T → R T.
33 #L #R #H0 #T1 #H elim H -T1 #T1 #HT1 #IHT1
34 @H0 -H0 /3 width=1/ -IHT1 /4 width=1/
35 qed-.
36
37 (* Basic properties *********************************************************)
38
39 (* Basic_1: was: sn3_pr2_intro *)
40 lemma csn_intro: ∀L,T1.
41                  (∀T2. L ⊢ T1 ➡ T2 → (T1 = T2 → ⊥) → L ⊢ ⬊* T2) → L ⊢ ⬊* T1.
42 /4 width=1/ qed.
43
44 (* Basic_1: was: sn3_nf2 *)
45 lemma csn_cnf: ∀L,T. L ⊢ 𝐍⦃T⦄ → L ⊢ ⬊* T.
46 /2 width=1/ qed.
47
48 lemma csn_cpr_trans: ∀L,T1. L ⊢ ⬊* T1 → ∀T2. L ⊢ T1 ➡ T2 → L ⊢ ⬊* T2.
49 #L #T1 #H elim H -T1 #T1 #HT1 #IHT1 #T2 #HLT12
50 @csn_intro #T #HLT2 #HT2
51 elim (term_eq_dec T1 T2) #HT12
52 [ -IHT1 -HLT12 destruct /3 width=1/
53 | -HT1 -HT2 /3 width=4/
54 qed.
55
56 (* Basic_1: was: sn3_cast *)
57 lemma csn_cast: ∀L,W. L ⊢ ⬊* W → ∀T. L ⊢ ⬊* T → L ⊢ ⬊* ⓝW. T.
58 #L #W #HW elim HW -W #W #_ #IHW #T #HT @(csn_ind … HT) -T #T #HT #IHT
59 @csn_intro #X #H1 #H2
60 elim (cpr_inv_cast1 … H1) -H1
61 [ * #W0 #T0 #HLW0 #HLT0 #H destruct
62   elim (eq_false_inv_tpair_sn … H2) -H2
63   [ /3 width=3/
64   | -HLW0 * #H destruct /3 width=1/ 
65   ]
66 | /3 width=3/
67 ]
68 qed.
69
70 (* Basic forward lemmas *****************************************************)
71
72 fact csn_fwd_flat_dx_aux: ∀L,U. L ⊢ ⬊* U → ∀I,V,T. U = ⓕ{I} V. T → L ⊢ ⬊* T.
73 #L #U #H elim H -H #U0 #_ #IH #I #V #T #H destruct
74 @csn_intro #T2 #HLT2 #HT2
75 @(IH (ⓕ{I} V. T2)) -IH // /2 width=1/ -HLT2 #H destruct /2 width=1/
76 qed.
77
78 (* Basic_1: was: sn3_gen_flat *)
79 lemma csn_fwd_flat_dx: ∀I,L,V,T. L ⊢ ⬊* ⓕ{I} V. T → L ⊢ ⬊* T.
80 /2 width=5/ qed-.
81
82 (* Basic_1: removed theorems 14:
83             sn3_cdelta
84             sn3_gen_cflat sn3_cflat sn3_cpr3_trans sn3_shift sn3_change
85             sn3_appl_cast sn3_appl_beta sn3_appl_lref sn3_appl_abbr
86             sn3_appl_appls sn3_bind sn3_appl_bind sn3_appls_bind
87 *)