]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/static/ssta_ssta.ma
preservation of stratified vaildity through ordinary reduction and static typing
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / static / ssta_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/da_da.ma".
16 include "basic_2/static/ssta_lift.ma".
17
18 (* STRATIFIED STATIC TYPE ASSIGNMENT ON TERMS *******************************)
19
20 (* Advanced inversion lemmas ************************************************)
21
22 lemma ssta_inv_refl_pos: ∀h,g,G,L,T,l.  ⦃G, L⦄ ⊢ T ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T •[h, g] T → ⊥.
23 #h #g #G #L #T #l #H1T #HTT
24 lapply (ssta_da_conf … HTT … H1T) -HTT <minus_plus_m_m #H2T
25 lapply (da_mono … H2T … H1T) -h -G -L -T #H
26 elim (plus_xySz_x_false 0 l 0) //
27 qed-.
28
29 (* Main properties **********************************************************)
30
31 theorem ssta_mono: ∀h,g,G,L. singlevalued … (ssta h g G L).
32 #h #g #G #L #T #U1 #H elim H -G -L -T -U1
33 [ #G #L #k #X #H >(ssta_inv_sort1 … H) -X //
34 | #G #L #K #V #U1 #W #i #HLK #_ #HWU1 #IHVW #U2 #H
35   elim (ssta_inv_lref1 … H) -H * #K0 #V0 #W0 #HLK0 #HVW0 #HW0U2
36   lapply (ldrop_mono … HLK0 … HLK) -HLK -HLK0 #H destruct
37   lapply (IHVW … HVW0) -IHVW -HVW0 #H destruct
38   >(lift_mono … HWU1 … HW0U2) -W0 -U1 //
39 | #G #L #K #W #U1 #l #i #HLK #HWl #HWU1 #U2 #H
40   elim (ssta_inv_lref1 … H) -H * #K0 #W0 #l0 #HLK0 #HWl0 #HW0U2
41   lapply (ldrop_mono … HLK0 … HLK) -HLK -HLK0 #H destruct
42   lapply (da_mono … HWl0 … HWl) -HWl0 #H destruct
43   >(lift_mono … HWU1 … HW0U2) -W -U1 //
44 | #a #I #G #L #V #T #U1 #_ #IHTU1 #X #H
45   elim (ssta_inv_bind1 … H) -H #U2 #HTU2 #H destruct /3 width=1/
46 | #G #L #V #T #U1 #_ #IHTU1 #X #H
47   elim (ssta_inv_appl1 … H) -H #U2 #HTU2 #H destruct /3 width=1/
48 | #G #L #W #T #U1 #_ #IHTU1 #U2 #H
49   lapply (ssta_inv_cast1 … H) -H /2 width=1/
50 ]
51 qed-.