]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/lstas_lift.etc
update in binaries for λδ
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / etc_2A1 / sta / lstas_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/sta_lift.ma".
16 include "basic_2/unfold/lstas.ma".
17
18 (* NAT-ITERATED STATIC TYPE ASSIGNMENT FOR TERMS ****************************)
19
20 (* Properties on relocation *************************************************)
21
22 lemma lstas_lift: ∀h,G,l. l_liftable (llstar … (sta h G) l).
23 /3 width=10 by l_liftable_llstar, sta_lift/ qed.
24
25 (* Inversion lemmas on relocation *******************************************)
26
27 lemma lstas_inv_lift1: ∀h,G,l. l_deliftable_sn (llstar … (sta h G) l).
28 /3 width=6 by l_deliftable_sn_llstar, sta_inv_lift1/ qed-.
29
30 (* Advanced inversion lemmas ************************************************)
31
32 lemma lstas_inv_lref1: ∀h,G,L,U,i,l. ⦃G, L⦄ ⊢ #i •*[h, l+1] U →
33                        (∃∃K,V,W. ⇩[i] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •*[h, l+1] W &
34                                  ⇧[0, i+1] W ≡ U
35                        ) ∨
36                        (∃∃K,W,V,V0. ⇩[i] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W •[h] V0 &
37                                     ⦃G, K⦄ ⊢ W •*[h, l] V & ⇧[0, i+1] V ≡ U
38                         ).
39 #h #G #L #U #i #l #H elim (lstas_inv_step_sn … H) -H
40 #X #H #HXU elim (sta_inv_lref1 … H) -H
41 * #K #V #W #HLK #HVW #HWX
42 lapply (drop_fwd_drop2 … HLK) #H0LK
43 elim (lstas_inv_lift1 … HXU … H0LK … HWX) -H0LK -X
44 /4 width=8 by lstas_step_sn, ex4_4_intro, ex3_3_intro, or_introl, or_intror/
45 qed-.
46
47 (* Advanced forward lemmas **************************************************)
48
49 lemma lstas_fwd_correct: ∀h,G,L,T1,U1. ⦃G, L⦄ ⊢ T1 •[h] U1 →
50                          ∀T2,l. ⦃G, L⦄ ⊢ T1 •*[h, l] T2 →
51                          ∃U2. ⦃G, L⦄ ⊢ T2 •[h] U2.
52 #h #G #L #T1 #U1 #HTU1 #T2 #l #H @(lstas_ind_dx … H) -l -T2 /2 width=3 by ex_intro/ -HTU1
53 #l #T #T2 #_ #HT2 #_ -T1 -U1 -l
54 elim (sta_fwd_correct … HT2) -T /2 width=2 by ex_intro/
55 qed-.
56
57 (* Advanced properties ******************************************************)
58
59 lemma lstas_total: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U →
60                    ∀l. ∃U0. ⦃G, L⦄ ⊢ T •*[h, l] U0.
61 #h #G #L #T #U #HTU #l @(nat_ind_plus … l) -l /2 width=2 by ex_intro/
62 #l * #U0 #HTU0 elim (lstas_fwd_correct … HTU … HTU0) -U
63 /3 width=4 by lstas_step_dx, ex_intro/
64 qed-.
65
66 lemma lstas_ldef: ∀h,G,L,K,V,i. ⇩[i] L ≡ K.ⓓV →
67                   ∀W,l. ⦃G, K⦄ ⊢ V •*[h, l+1] W →
68                   ∀U. ⇧[0, i+1] W ≡ U → ⦃G, L⦄ ⊢ #i •*[h, l+1] U.
69 #h #G #L #K #V #i #HLK #W #l #HVW #U #HWU
70 lapply (drop_fwd_drop2 … HLK)
71 elim (lstas_inv_step_sn … HVW) -HVW #W0
72 elim (lift_total W0 0 (i+1)) /3 width=12 by lstas_step_sn, sta_ldef, lstas_lift/
73 qed.
74
75 lemma lstas_ldec: ∀h,G,L,K,W,i. ⇩[i] L ≡ K.ⓛW → ∀V0. ⦃G, K⦄ ⊢ W •[h] V0 →
76                   ∀V,l. ⦃G, K⦄ ⊢ W •*[h, l] V →
77                   ∀U. ⇧[0, i+1] V ≡ U → ⦃G, L⦄ ⊢ #i •*[h, l+1] U.
78 #h #G #L #K #W #i #HLK #V0 #HWV0 #V #l #HWV #U #HVU
79 lapply (drop_fwd_drop2 … HLK) #H
80 elim (lift_total W 0 (i+1)) /3 width=12 by lstas_step_sn, sta_ldec, lstas_lift/
81 qed.