]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/etc/sstas/sstas_lift.etc
preservation of stratified vaildity through ordinary reduction and static typing
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / etc / sstas / sstas_lift.etc
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_lift.ma".
16 include "basic_2/unfold/sstas.ma".
17
18 (* ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *********************)
19
20 (* Advanced forward lemmas **************************************************)
21
22 lemma sstas_fwd_correct: ∀h,g,G,L,T1,U1,l1. ⦃G, L⦄ ⊢ T1 •[h, g] ⦃l1, U1⦄ →
23                          ∀T2. ⦃G, L⦄ ⊢ T1 •*[h, g] T2 →
24                          ∃∃U2,l2. ⦃G, L⦄ ⊢ T2 •[h, g] ⦃l2, U2⦄.
25 #h #g #G #L #T1 #U1 #l1 #HTU1 #T2 #H @(sstas_ind … H) -T2 [ /2 width=3/ ] -HTU1
26 #T #T2 #l #_ #HT2 * #U #l0 #_ -l0
27 elim (ssta_fwd_correct … HT2) -T /2 width=3/
28 qed-.
29
30 (* Properties on relocation *************************************************)
31
32 lemma sstas_lift: ∀h,g,G,L1,T1,U1. ⦃G, L1⦄ ⊢ T1 •*[h, g] U1 →
33                   ∀L2,d,e. ⇩[d, e] L2 ≡ L1 → ∀T2. ⇧[d, e] T1 ≡ T2 →
34                   ∀U2. ⇧[d, e] U1 ≡ U2 → ⦃G, L2⦄ ⊢ T2 •*[h, g] U2.
35 #h #g #G #L1 #T1 #U1 #H @(sstas_ind_dx … H) -T1
36 [ #L2 #d #e #HL21 #X #HX #U2 #HU12
37   >(lift_mono … HX … HU12) -X //
38 | #T0 #U0 #l0 #HTU0 #_ #IHU01 #L2 #d #e #HL21 #T2 #HT02 #U2 #HU12
39   elim (lift_total U0 d e) /3 width=10/
40 ]
41 qed.
42
43 (* Inversion lemmas on relocation *******************************************)
44
45 lemma sstas_inv_lift1: ∀h,g,G,L2,T2,U2. ⦃G, L2⦄ ⊢ T2 •*[h, g] U2 →
46                        ∀L1,d,e. ⇩[d, e] L2 ≡ L1 → ∀T1. ⇧[d, e] T1 ≡ T2 →
47                        ∃∃U1. ⦃G, L1⦄ ⊢ T1 •*[h, g] U1 & ⇧[d, e] U1 ≡ U2.
48 #h #g #G #L2 #T2 #U2 #H @(sstas_ind_dx … H) -T2 /2 width=3/
49 #T0 #U0 #l0 #HTU0 #_ #IHU01 #L1 #d #e #HL21 #U1 #HU12
50 elim (ssta_inv_lift1 … HTU0 … HL21 … HU12) -HTU0 -HU12 #U #HU1 #HU0
51 elim (IHU01 … HL21 … HU0) -IHU01 -HL21 -U0 /3 width=4/
52 qed-.