]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/dynamic/snv_da_lpr.ma
syntactic components detached from basic_2 become static_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / snv_da_lpr.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 "static_2/static/lsubd_da.ma".
16 include "basic_2/dynamic/snv_aaa.ma".
17 include "basic_2/dynamic/snv_scpes.ma".
18
19 (* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
20
21 (* Properties on degree assignment for terms ********************************)
22
23 fact da_cpr_lpr_aux: ∀h,o,G0,L0,T0.
24                      (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≛[h, o] ⦃G1, L1, T1⦄ → IH_snv_lstas h o G1 L1 T1) →
25                      (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≛[h, o] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h o G1 L1 T1) →
26                      (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≛[h, o] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h o G1 L1 T1) →
27                      ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_da_cpr_lpr h o G1 L1 T1.
28 #h #o #G0 #L0 #T0 #IH3 #IH2 #IH1 #G1 #L1 * * [|||| * ]
29 [ #s #_ #_ #_ #_ #d #H2 #X3 #H3 #L2 #_ -IH3 -IH2 -IH1
30   lapply (da_inv_sort … H2) -H2
31   lapply (cpr_inv_sort1 … H3) -H3 #H destruct /2 width=1 by da_sort/
32 | #i #HG0 #HL0 #HT0 #H1 #d #H2 #X3 #H3 #L2 #HL12 destruct -IH3 -IH2
33   elim (snv_inv_lref … H1) -H1 #I0 #K0 #X0 #H #HX0
34   elim (da_inv_lref … H2) -H2 * #K1 [ #V1 | #W1 #d1 ] #HLK1 [ #HV1 | #HW1 #H ] destruct
35   lapply (drop_mono … H … HLK1) -H #H destruct
36   elim (cpr_inv_lref1 … H3) -H3
37   [1,3: #H destruct
38     lapply (fqup_lref … G1 … HLK1)
39     elim (lpr_drop_conf … HLK1 … HL12) -HLK1 -HL12 #X #H #HLK2
40     elim (lpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
41     /4 width=10 by da_ldef, da_ldec, fqup_fpbg/
42   |2,4: * #K0 #V0 #W0 #H #HVW0 #HW0
43     lapply (drop_mono … H … HLK1) -H #H destruct
44     lapply (fqup_lref … G1 … HLK1)
45     elim (lpr_drop_conf … HLK1 … HL12) -HLK1 -HL12 #X #H #HLK2
46     elim (lpr_inv_pair1 … H) -H #K2 #V2 #HK12 #_ #H destruct
47     lapply (drop_fwd_drop2 … HLK2) -V2
48     /4 width=8 by da_lift, fqup_fpbg/
49   ]
50 | #p #_ #_ #HT0 #H1 destruct -IH3 -IH2 -IH1
51   elim (snv_inv_gref … H1)
52 | #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #d #H2 #X3 #H3 #L2 #HL12 destruct -IH2
53   elim (snv_inv_bind … H1) -H1 #_ #HT1
54   lapply (da_inv_bind … H2) -H2
55   elim (cpr_inv_bind1 … H3) -H3 *
56   [ #V2 #T2 #HV12 #HT12 #H destruct
57     /4 width=9 by da_bind, fqup_fpbg, lpr_pair/
58   | #T2 #HT12 #HT2 #H1 #H2 destruct
59     /4 width=11 by da_inv_lift, fqup_fpbg, lpr_pair, drop_drop/
60   ]
61 | #V1 #T1 #HG0 #HL0 #HT0 #H1 #d #H2 #X3 #H3 #L2 #HL12 destruct
62   elim (snv_inv_appl … H1) -H1 #b1 #W1 #U1 #d1 #HV1 #HT1 #HVW1 #HTU1
63   lapply (da_inv_flat … H2) -H2 #Hd
64   elim (cpr_inv_appl1 … H3) -H3 *
65   [ #V2 #T2 #HV12 #HT12 #H destruct -IH3 -IH2 /4 width=7 by da_flat, fqup_fpbg/
66   | #b #V2 #W #W2 #U #U2 #HV12 #HW2 #HU2 #H1 #H2 destruct
67     elim (snv_inv_bind … HT1) -HT1 #HW #HU
68     lapply (da_inv_bind … Hd) -Hd #Hd
69     elim (scpds_inv_abst1 … HTU1) -HTU1 #W3 #U3 #HW3 #_ #H destruct -U3 -d1
70     elim (snv_fwd_da … HV1) #d1 #Hd1
71     elim (snv_fwd_da … HW) #d0 #Hd0
72     lapply (cprs_scpds_div … HW3 … Hd0 … 1 HVW1) -W3 #H
73     elim (da_scpes_aux … IH3 IH2 IH1 … Hd0 … Hd1 … H) -IH3 -IH2 -H /2 width=1 by fqup_fpbg/ #_ #H1
74     <minus_n_O #H destruct >(plus_minus_k_k d1 1) in Hd1; // -H1 #Hd1
75     lapply (IH1 … HV1 … Hd1 … HV12 … HL12) -HV1 -Hd1 -HV12 [ /2 by fqup_fpbg/ ]
76     lapply (IH1 … Hd0 … HW2 … HL12) -Hd0 /2 width=1 by fqup_fpbg/ -HW
77     lapply (IH1 … HU … Hd … HU2 (L2.ⓛW2) ?) -IH1 -HU -Hd -HU2 [1,2: /2 by fqup_fpbg, lpr_pair/ ] -HL12 -HW2
78     /4 width=6 by da_bind, lsubd_da_trans, lsubd_beta/
79   | #b #V0 #V2 #W #W2 #U #U2 #HV10 #HV02 #HW2 #HU2 #H1 #H2 destruct -IH3 -IH2 -b1 -V0 -W1 -U1 -d1 -HV1
80     elim (snv_inv_bind … HT1) -HT1 #_
81     lapply (da_inv_bind … Hd) -Hd
82     /5 width=9 by da_bind, da_flat, fqup_fpbg, lpr_pair/
83   ]
84 | #W1 #T1 #HG0 #HL0 #HT0 #H1 #d #H2 #X3 #H3 #L2 #HL12 destruct -IH3 -IH2
85   elim (snv_inv_cast … H1) -H1 #U1 #HW1 #HT1 #HWU1 #HTU1
86   lapply (da_inv_flat … H2) -H2 #Hd
87   elim (cpr_inv_cast1 … H3) -H3
88   [ * #W2 #T2 #HW12 #HT12 #H destruct /4 width=7 by da_flat, fqup_fpbg/
89   | /3 width=7 by fqup_fpbg/
90   ]
91 ]
92 qed-.