]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_preserve_sub.ma
update in basic_2 and ground_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / cnv_preserve_sub.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/rt_computation/fpbg.ma".
16 include "basic_2/rt_computation/cpms_fpbs.ma".
17 include "basic_2/dynamic/cnv.ma".
18
19 (* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************)
20
21 (* Inductive premises for the preservation results **************************)
22
23 definition IH_cnv_cpm_trans_lpr (a) (h): relation3 genv lenv term ≝
24                                 λG,L1,T1. ⦃G, L1⦄ ⊢ T1 ![a,h] →
25                                 ∀n,T2. ⦃G, L1⦄ ⊢ T1 ➡[n,h] T2 →
26                                 ∀L2. ⦃G, L1⦄ ⊢ ➡[h] L2 → ⦃G, L2⦄ ⊢ T2 ![a,h].
27
28 definition IH_cnv_cpms_trans_lpr (a) (h): relation3 genv lenv term ≝
29                                  λG,L1,T1. ⦃G, L1⦄ ⊢ T1 ![a,h] →
30                                  ∀n,T2. ⦃G, L1⦄ ⊢ T1 ➡*[n,h] T2 →
31                                  ∀L2. ⦃G, L1⦄ ⊢ ➡[h] L2 → ⦃G, L2⦄ ⊢ T2 ![a,h].
32
33 definition IH_cnv_cpm_conf_lpr (a) (h): relation3 genv lenv term ≝
34                                λG,L0,T0. ⦃G, L0⦄ ⊢ T0 ![a,h] →
35                                ∀n1,T1. ⦃G, L0⦄ ⊢ T0 ➡[n1,h] T1 → ∀n2,T2. ⦃G, L0⦄ ⊢ T0 ➡[n2,h] T2 →
36                                ∀L1. ⦃G, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h] L2 →
37                                ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡*[n2-n1,h] T & ⦃G, L2⦄ ⊢ T2 ➡*[n1-n2,h] T.
38
39 definition IH_cnv_cpms_strip_lpr (a) (h): relation3 genv lenv term ≝
40                                  λG,L0,T0. ⦃G, L0⦄ ⊢ T0 ![a,h] →
41                                  ∀n1,T1. ⦃G, L0⦄ ⊢ T0 ➡*[n1,h] T1 → ∀n2,T2. ⦃G, L0⦄ ⊢ T0 ➡[n2,h] T2 →
42                                  ∀L1. ⦃G, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h] L2 →
43                                  ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡*[n2-n1,h] T & ⦃G, L2⦄ ⊢ T2 ➡*[n1-n2,h] T.
44
45 definition IH_cnv_cpms_conf_lpr (a) (h): relation3 genv lenv term ≝
46                                 λG,L0,T0. ⦃G, L0⦄ ⊢ T0 ![a,h] →
47                                 ∀n1,T1. ⦃G, L0⦄ ⊢ T0 ➡*[n1,h] T1 → ∀n2,T2. ⦃G, L0⦄ ⊢ T0 ➡*[n2,h] T2 →
48                                 ∀L1. ⦃G, L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G, L0⦄ ⊢ ➡[h] L2 →
49                                 ∃∃T. ⦃G, L1⦄ ⊢ T1 ➡*[n2-n1,h] T & ⦃G, L2⦄ ⊢ T2 ➡*[n1-n2,h] T.
50
51 (* Auxiliary properties for preservation ************************************)
52
53 fact cnv_cpms_trans_lpr_sub (a) (h) (o):
54                             ∀G0,L0,T0.
55                             (∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpm_trans_lpr a h G1 L1 T1) →
56                             ∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpms_trans_lpr a h G1 L1 T1.
57 #a #h #o #G0 #L0 #T0 #IH #G1 #L1 #T1 #H01 #HT1 #n #T2 #H
58 @(cpms_ind_dx … H) -n -T2
59 /4 width=7 by cpms_fwd_fpbs, fpbg_fpbs_trans/
60 qed-.
61
62 fact cnv_cpm_conf_lpr_sub (a) (h) (o):
63                           ∀G0,L0,T0.
64                           (∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpms_conf_lpr a h G1 L1 T1) →
65                           ∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpm_conf_lpr a h G1 L1 T1.
66 /3 width=8 by cpm_cpms/ qed-.
67
68 fact cnv_cpms_strip_lpr_sub (a) (h) (o):
69                             ∀G0,L0,T0.
70                             (∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpms_conf_lpr a h G1 L1 T1) →
71                             ∀G1,L1,T1. ⦃G0, L0, T0⦄ >[h, o] ⦃G1, L1, T1⦄ → IH_cnv_cpms_strip_lpr a h G1 L1 T1.
72 /3 width=8 by cpm_cpms/ qed-.