]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/basic_2/dynamic/snv_ssta.ma
a934ca08e003411e0d1dd22a6fe2e817f90897b7
[helm.git] / matita / matita / contribs / lambda_delta / 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/static/ssta.ma".
16 include "basic_2/dynamic/snv.ma".
17
18 (* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
19
20 (* Properties on stratified static type assignment for terms ****************)
21
22 lemma snv_ssta: ∀h,g,L,T. ⦃h, L⦄ ⊩ T :[g] → ∃∃U,l. ⦃h, L⦄ ⊢ T •[g, l] U.
23 #h #g #L #T #H elim H -L -T
24 [ #L #k elim (deg_total h g k) /3 width=3/
25 | * #L #K #V #i #HLK #_ * #W #l0 #HVW
26   [ elim (lift_total W 0 (i+1)) /3 width=8/
27   | elim (lift_total V 0 (i+1)) /3 width=8/
28   ]
29 | #a #I #L #V #T #_ #_ #_ * /3 width=3/
30 | #a #L #V #W #W1 #T0 #T1 #l #_ #_ #_ #_ #_ #_ * /3 width=3/
31 | #L #W #T #U #l #_ #_ #HTU #_ #_ #_ /3 width=3/ (**) (* auto fails without the last #_ *) 
32 ]
33 qed-.
34 (*
35 fact snv_ssta_conf_aux: ∀h,g,L,T. (
36                            ∀L0,T1,U1,l1. ⦃h, L0⦄ ⊢ T1 •[g, l1] U1 →
37                            ∀T2,U2,l2. ⦃h, L0⦄ ⊢ T2 •[g, l2] U2 →
38                            L0 ⊢ T1 ⬌* T2 → ⦃h, L0⦄ ⊩ T1 :[g] →  ⦃h, L0⦄ ⊩ T2 :[g] →
39                            #{L0, T1} < #{L ,T} →
40                            l1 = l2 ∧ L0 ⊢ U1 ⬌* U2
41                         ) → (
42                            ∀L0,T0. ⦃h, L0⦄ ⊩ T0 :[g] →
43                            ∀U0. ⦃h, L0⦄ ⊢ T0 •➡*[g] U0 →
44                            #{L0, T0} < #{L ,T} →
45                            ⦃h, L0⦄ ⊩ U0 :[g]
46                         ) →
47                         ∀L0,T0. ⦃h, L0⦄ ⊩ T0 :[g] →
48                         ∀U0,l. ⦃h, L⦄ ⊢ T0 •[g, l + 1] U0 →
49                         L0 = L → T0 = T → ⦃h, L0⦄ ⊩ U0 :[g].
50 #h #g #L #T #IH2 #IH1 #L0 #T0 * -L0 -T0
51 [
52 |
53 |
54 | #a #L0 #V #W #W0 #T0 #V0 #l0 #HV #HT0 #HVW #HW0 #HTV0 #X #l #H #H1 #H2 destruct
55   elim (ssta_inv_appl1 … H) -H #U0 #HTU0 #H destruct
56   lapply (IH1 … HT0 U0 ? ?) // [ /3 width=2/ ] -HTU0 #HU0
57   @(snv_appl … HV HU0 HVW HW0) -HV -HU0 -HVW -HW0
58 | #L0 #W #T0 #W0 #l0 #HW #HT0 #HTW0 #HW0 #X #l #H #H1 #H2 destruct
59   elim (ssta_inv_cast1 … H) -H <minus_plus_m_m #V #U0 #HWV #HTU0 #H destruct
60   elim (ssta_mono … HTU0 … HTW0) -HTU0 #H1 #H2
61   lapply (injective_plus_l … H1) -H1 #H1 destruct
62 (*  elim (ssta_fwd_correct … HTW0) <minus_plus_m_m #X0 #HWX0 *)
63   lapply (IH1 … HT0 W0 ? ?) -IH1 -HT0 // [ /3 width=2/ ] -HTW0 #HW0
64   @(snv_cast … HV HW0) 
65   
66   HVW HW0) -HV -HU0 -HVW -HW0  
67 *)