]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/dynamic/snv_ltpr.ma
4bcfa9889de72a4f198385b04f4161e507d2f2be
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / snv_ltpr.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/dynamic/snv_ltpr_ssta.ma".
16
17 (* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
18
19 (* Properties on context-free parallel reduction for local environments *****)
20
21 fact snv_ltpr_tpr_aux: ∀h,g,L0,T0.
22                        (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_ssta_ltpr_tpr h g L1 T1) →
23                        (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_ltpr_tpr h g L1 T1) →
24                        ∀L1,T1. L0 = L1 → T0 = T1 → IH_snv_ltpr_tpr h g L1 T1.
25 #h #g #L0 #T0 #IH2 #IH1 #L1 * * [||||*]
26 [ #k #HL0 #HT0 #H1 #L2 #_ #X #H2 destruct -IH2 -IH1 -L1
27   >(tpr_inv_atom1 … H2) -X //
28 | #i #HL0 #HT0 #H1 #L2 #HL12 #X #H2 destruct -IH2
29   elim (snv_inv_lref … H1) -H1 #I #K1 #V1 #HLK1 #HV1
30   >(tpr_inv_atom1 … H2) -X
31   elim (ltpr_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2
32   elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
33   lapply (ldrop_pair2_fwd_fw … HLK1 (#i)) -HLK1 #HLK1
34   lapply (IH1 … HK12 … HV12) -IH1 -HV12 -HK12 // -HV1 [ /2 width=1/ ] -HLK1 /2 width=5/
35 | #p #HL0 #HT0 #H1 #L2 #HL12 #X #H2 destruct -IH2 -IH1
36   elim (snv_inv_gref … H1)
37 | #a #I #V1 #T1 #HL0 #HT0 #H1 #L2 #HL12 #X #H2 destruct -IH2
38   elim (snv_inv_bind … H1) -H1 #HV1 #HT1
39   elim (tpr_inv_bind1 … H2) -H2 *
40   [ #V2 #T0 #T2 #HV12 #HT10 #HT02 #H destruct
41     lapply (tps_lsubs_trans … HT02 (L2.ⓑ{I}V2) ?) -HT02 /2 width=1/ #HT02
42     lapply (IH1 … HL12 … HV12) // [ /2 width=1/ ] #HV2
43     lapply (snv_ltpr_cpr_aux … HT1  (L2.ⓑ{I}V2) … T2 ?) -HT1
44     [ /3 width=5 by cpr_intro, tps_tpss/ | /2 width=1/ | /3 width=1/ ] -IH1 -T0 /2 width=1/
45   | #T2 #HT12 #HXT2 #H1 #H2 destruct
46     lapply (IH1 … HT1 (L2.ⓓV1) … HT12) -IH1 -HT1 -HT12 [1,2: /2 width=1/ ] -HL12 #HT2
47     lapply (snv_inv_lift … HT2 L2 … HXT2) -T2 // /2 width=1/
48   ]
49 | #V1 #T1 #HL0 #HT0 #H1 #L2 #HL12 #X #H2 destruct
50   elim (snv_inv_appl … H1) -H1 #a #W10 #W1 #U1 #l #HV1 #HT1 #HVW1 #HW10 #HTU1
51   elim (tpr_inv_appl1 … H2) -H2 *
52   [ #V2 #T2 #HV12 #HT12 #H destruct
53     lapply (IH1 … HV1 … HL12 … HV12) [ /2 width=1/ ] #HV2
54     lapply (IH1 … HT1 … HL12 … HT12) [ /2 width=1/ ] #HT2
55     elim (IH2 … HVW1 … HL12 … HV12) -IH2 -HVW1 -HV12 // -HV1 [2: /2 width=1/ ] #W2 #HVW2 #HW12
56     lapply (fpcs_canc_sn L1 L1 … W10 W1 … HW12) -HW12 /3 width=1/ -W10 #HW12
57     @(snv_appl … HV2 HT2 HVW2)
58 (*
59     lapply (IH1 … HT1 … HTU1) -IH1 // #H
60     elim (snv_inv_bind … H) -H #HW1 #HU1
61     elim (IH2 … HVW1 … HL12 … HV12 HV1) -IH2 -HVW1 -HV12 -HV1 // #W2 #HVW2 #HW12
62 *)