1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "basic_2/dynamic/cnv_cpms_conf.ma".
17 (* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************)
19 (* Main preservation properties *********************************************)
21 (* Basic_2A1: uses: snv_preserve *)
22 lemma cnv_preserve (h) (a): ∀G,L,T. ❨G,L❩ ⊢ T ![h,a] →
23 ∧∧ IH_cnv_cpms_conf_lpr h a G L T
24 & IH_cnv_cpm_trans_lpr h a G L T.
26 lapply (cnv_fwd_fsb … HT) -HT #H
27 @(fsb_ind_fpbg … H) -G -L -T #G #L #T #_ #IH
28 @conj [ letin aux ≝ cnv_cpms_conf_lpr_aux | letin aux ≝ cnv_cpm_trans_lpr_aux ]
29 @(aux … G L T) // #G0 #L0 #T0 #H
30 elim (IH … H) -IH -H //
33 theorem cnv_cpms_conf_lpr (h) (a) (G) (L) (T): IH_cnv_cpms_conf_lpr h a G L T.
34 #h #a #G #L #T #HT elim (cnv_preserve … HT) /2 width=1 by/
37 (* Basic_2A1: uses: snv_cpr_lpr *)
38 theorem cnv_cpm_trans_lpr (h) (a) (G) (L) (T): IH_cnv_cpm_trans_lpr h a G L T.
39 #h #a #G #L #T #HT elim (cnv_preserve … HT) /2 width=2 by/
42 (* Advanced preservation properties *****************************************)
44 lemma cnv_cpms_conf (h) (a) (G) (L):
45 ∀T0. ❨G,L❩ ⊢ T0 ![h,a] →
46 ∀n1,T1. ❨G,L❩ ⊢ T0 ➡*[h,n1] T1 → ∀n2,T2. ❨G,L❩ ⊢ T0 ➡*[h,n2] T2 →
47 ∃∃T. ❨G,L❩ ⊢ T1 ➡*[h,n2-n1] T & ❨G,L❩ ⊢ T2 ➡*[h,n1-n2] T.
48 /2 width=8 by cnv_cpms_conf_lpr/ qed-.
50 (* Basic_2A1: uses: snv_cprs_lpr *)
51 lemma cnv_cpms_trans_lpr (h) (a) (G) (L) (T): IH_cnv_cpms_trans_lpr h a G L T.
52 #h #a #G #L1 #T1 #HT1 #n #T2 #H
53 @(cpms_ind_dx … H) -n -T2 /3 width=6 by cnv_cpm_trans_lpr/
56 lemma cnv_cpm_trans (h) (a) (G) (L):
57 ∀T1. ❨G,L❩ ⊢ T1 ![h,a] →
58 ∀n,T2. ❨G,L❩ ⊢ T1 ➡[h,n] T2 → ❨G,L❩ ⊢ T2 ![h,a].
59 /2 width=6 by cnv_cpm_trans_lpr/ qed-.
61 (* Note: this is the preservation property *)
62 lemma cnv_cpms_trans (h) (a) (G) (L):
63 ∀T1. ❨G,L❩ ⊢ T1 ![h,a] →
64 ∀n,T2. ❨G,L❩ ⊢ T1 ➡*[h,n] T2 → ❨G,L❩ ⊢ T2 ![h,a].
65 /2 width=6 by cnv_cpms_trans_lpr/ qed-.
67 lemma cnv_lpr_trans (h) (a) (G):
68 ∀L1,T. ❨G,L1❩ ⊢ T ![h,a] → ∀L2. ❨G,L1❩ ⊢ ➡[h,0] L2 → ❨G,L2❩ ⊢ T ![h,a].
69 /2 width=6 by cnv_cpm_trans_lpr/ qed-.
71 lemma cnv_lprs_trans (h) (a) (G):
72 ∀L1,T. ❨G,L1❩ ⊢ T ![h,a] → ∀L2. ❨G,L1❩ ⊢ ➡*[h,0] L2 → ❨G,L2❩ ⊢ T ![h,a].
73 #h #a #G #L1 #T #HT #L2 #H
74 @(lprs_ind_dx … H) -L2 /2 width=3 by cnv_lpr_trans/