]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/dynamic/snv_lstas.ma
reorganization of the "static" component:
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / snv_lstas.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_lift.ma".
16 include "basic_2/dynamic/snv_cpcs.ma".
17
18 (* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
19
20 (* Properties on nat-iterated stratified static type assignment for terms ***)
21
22 fact snv_lstas_aux: ∀h,g,G0,L0,T0.
23                     (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
24                     (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
25                     (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) →
26                     (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lstas h g G1 L1 T1) →
27                     ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_snv_lstas h g G1 L1 T1.
28 #h #g #G0 #L0 #T0 #IH4 #IH3 #IH2 #IH1 #G1 #L1 * * [|||| * ]
29 [ #k #HG0 #HL0 #HT0 #_ #l1 #l2 #Hl21 #Hl1 #X #H2 destruct -IH4 -IH3 -IH2 -IH1
30   >(lstas_inv_sort1 … H2) -X //
31 | #i #HG0 #HL0 #HT0 #H1 #l1 #l2 @(nat_ind_plus … l2) -l2 [ #_ | #l2 #_ #Hl21 ] #Hl1 #X #H2 destruct -IH4 -IH3 -IH2
32   [ lapply (lstas_inv_O … H2) -H2 #H destruct // ]
33   elim (snv_inv_lref … H1) -H1 #I0 #K0 #X0 #HLK0 #HX0
34   elim (da_inv_lref … Hl1) -Hl1 * #K1 [ #V1 | #W1 #l ] #HLK1 [ #Hl1 | #Hl #H ]
35   lapply (ldrop_mono … HLK0 … HLK1) -HLK0 #H0 destruct
36   elim (lstas_inv_lref1 … H2) -H2 * #K0 #Y0 #X0 [2,4: #Y1 ] #HLK0 [1,2: #HY01 ] #HYX0 #HX0
37   lapply (ldrop_mono … HLK0 … HLK1) -HLK0 #H destruct
38   [ lapply (le_plus_to_le_r … Hl21) -Hl21 #Hl21 ]
39   lapply (fqup_lref … G1 … HLK1) #H
40   lapply (ldrop_fwd_drop2 … HLK1) -HLK1 /4 width=8 by fqup_fpbg, snv_lift/
41 | #p #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X #H2 destruct -IH4 -IH3 -IH2 -IH1
42   elim (snv_inv_gref … H1)
43 | #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X #H2 destruct -IH4 -IH3 -IH2
44   elim (snv_inv_bind … H1) -H1 #HV1 #HT1
45   lapply (da_inv_bind … Hl1) -Hl1 #Hl1
46   elim (lstas_inv_bind1 … H2) -H2 #U1 #HTU1 #H destruct /4 width=8 by fqup_fpbg, snv_bind/
47 | #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X #H2 destruct
48   elim (snv_inv_appl … H1) -H1 #a #W1 #W0 #T0 #l0 #HV1 #HT1 #Hl0 #HVW1 #HW10 #HT10
49   lapply (da_inv_flat … Hl1) -Hl1 #Hl1
50   elim (lstas_inv_appl1 … H2) -H2 #U1 #HTU1 #H destruct
51   lapply (IH1 … HT1 … Hl1 … HTU1) /2 width=1 by fqup_fpbg/ #HU1
52   elim (lstas_cpds_aux … IH1 IH4 IH3 IH2 … Hl1 … HTU1 … HT10) -IH4 -IH3 -IH2 -IH1 /2 width=1 by fqup_fpbg/ -T1 -l1 #X #l #_ #H #HU10 -l2
53   elim (lstas_inv_bind1 … H) -H #U0 #_ #H destruct -T0 -l
54   elim (cpes_inv_abst2 … HU10) -HU10 #W2 #U2 #HU12 #HU02
55   elim (cprs_inv_abst … HU02) -HU02 #HW02 #_
56   /3 width=7 by snv_appl, cprs_trans/
57 | #W1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 @(nat_ind_plus … l2) -l2 [ #_ | #l2 #_ #Hl21 ] #Hl1 #X #H2 destruct -IH4 -IH3 -IH2
58   [ lapply (lstas_inv_O … H2) -H2 #H destruct // ]
59   elim (snv_inv_cast … H1) -H1
60   lapply (da_inv_flat … Hl1) -Hl1
61   lapply (lstas_inv_cast1 … H2) -H2 /3 width=8 by fqup_fpbg/
62 ]
63 qed-.