]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/dynamic/snv_ssta.ma
lambdadelta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / snv_ssta.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 stratified static type assignment for terms ****************)
21
22 fact snv_ssta_aux: ∀h,g,L0,T0.
23                    (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_cpr_lpr h g L1 T1) →
24                    (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_ssta_cpr_lpr h g L1 T1) →
25                    (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_ssta h g L1 T1) →
26                    ∀L1,T1. L0 = L1 → T0 = T1 → IH_snv_ssta h g L1 T1.
27 #h #g #L0 #T0 #IH3 #IH2 #IH1 #L1 * * [||||*]
28 [ #k #HL0 #HT0 #_ #X #l #H2 destruct -IH3 -IH2 -IH1
29   elim (ssta_inv_sort1 … H2) -H2 #_ #H destruct //
30 | #i #HL0 #HT0 #H1 #X #l #H2 destruct -IH3 -IH2
31   elim (snv_inv_lref … H1) -H1 #I #K1 #V1 #HLK1 #HV1
32   elim (ssta_inv_lref1 … H2) -H2 * #K0 #V0 #W1 [| #l ] #H #HVW1 #HX [| #_ ]
33   lapply (ldrop_mono … H … HLK1) -H #H destruct
34   lapply (fsupp_lref … HLK1) #H
35   lapply (ldrop_fwd_ldrop2 … HLK1) -HLK1 /4 width=7/
36 | #p #HL0 #HT0 #H1 #X #l #H2 destruct -IH3 -IH2 -IH1
37   elim (snv_inv_gref … H1)
38 | #a #I #V1 #T1 #HL0 #HT0 #H1 #X #l #H2 destruct -IH3 -IH2
39   elim (snv_inv_bind … H1) -H1 #HV1 #HT1
40   elim (ssta_inv_bind1 … H2) -H2 #U1 #HTU1 #H destruct /4 width=5/
41 | #V1 #T1 #HL0 #HT0 #H1 #X #l #H2 destruct
42   elim (snv_inv_appl … H1) -H1 #a #W1 #W0 #T0 #l0 #HV1 #HT1 #HVW1 #HW10 #HT10
43   elim (ssta_inv_appl1 … H2) -H2 #U1 #HTU1 #H destruct
44   lapply (IH1 … HT1 … HTU1) -IH1 /2 width=1/ #HU1
45   elim (ssta_cpds_aux … IH3 IH2 … HTU1 … HT10) -IH3 -IH2 // /2 width=2/ -T1 #U #X #HU1U #H #HU0
46   elim (sstas_inv_bind1 … H) -H #U0 #HTU0 #H destruct
47   elim (cpcs_inv_abst2 … HU0) -HU0 #W2 #U2 #HU2 #HU02
48   elim (cprs_inv_abst … HU02) -HU02 #HW02 #_
49   lapply (cprs_trans … HW10 … HW02) -W0 /3 width=10 by snv_appl, ex2_intro/ (**) (* auto is too slow without trace *)
50 | #W1 #T1 #HL0 #HT0 #H1 #X #l #H2 destruct -IH3 -IH2
51   elim (snv_inv_cast … H1) -H1 #U1 #l0 #HW1 #HT1 #HTU1 #HUW1
52   lapply (ssta_inv_cast1 … H2) -H2 /3 width=5/
53 ]
54 qed-.