]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/etc_2A1/sta/da_sta.etc
update in binaries for λδ
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / etc_2A1 / sta / da_sta.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.ma".
16 include "basic_2/static/da_da.ma".
17
18 (* Properties on static type assignment for terms ***************************)
19
20 lemma da_sta_conf: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U →
21                    ∀l. ⦃G, L⦄ ⊢ T ▪[h, g] l → ⦃G, L⦄ ⊢ U ▪[h, g] l-1.
22 #h #g #G #L #T #U #H elim H -G -L -T -U
23 [ #G #L #k #l #H
24   lapply (da_inv_sort … H) -H /3 width=1 by da_sort, deg_next/
25 | #G #L #K #V #U #W #i #HLK #_ #HWU #IHVW #l #H
26   elim (da_inv_lref … H) -H * #K0 #V0 [| #l0] #HLK0 #HV0
27   lapply (drop_mono … HLK0 … HLK) -HLK0 #H destruct
28   lapply (drop_fwd_drop2 … HLK) -HLK /3 width=8 by da_lift/
29 | #G #L #K #W #V #U #i #HLK #_ #HWU #IHWV #l #H
30   elim (da_inv_lref … H) -H * #K0 #V0 [| #l0] #HLK0 #HV0 [| #H0 ]
31   lapply (drop_mono … HLK0 … HLK) -HLK0 #H destruct
32   lapply (drop_fwd_drop2 … HLK) -HLK /3 width=8 by da_lift/
33 | #a #I #G #L #V #T #U #_ #IHTU #l #H
34   lapply (da_inv_bind … H) -H /3 width=1 by da_bind/
35 | #G #L #V #T #U #_ #IHTU #l #H
36   lapply (da_inv_flat … H) -H /3 width=1 by da_flat/
37 | #G #L #W #T #U #_ #IHTU #l #H
38   lapply (da_inv_flat … H) -H /2 width=1 by/
39 ]
40 qed-.
41
42 lemma sta_da: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U →
43               ∃l. ⦃G, L⦄ ⊢ T ▪[h, g] l.
44 #h #g #G #L #T #U #H elim H -G -L -T -U
45 [ #G #L #k elim (deg_total h g k) /3 width=2 by da_sort, ex_intro/
46 | #G #L #K #V #W #W0 #i #HLK #_ #_ * /3 width=5 by da_ldef, ex_intro/
47 | #G #L #K #W #V #W0 #i #HLK #_ #_ * /3 width=5 by da_ldec, ex_intro/
48 | #a #I #G #L #V #T #U #_ * /3 width=2 by da_bind, ex_intro/
49 | #G #L #V #T #U #_ * /3 width=2 by da_flat, ex_intro/
50 | #G #L #W #T #U #_ * /3 width=2 by da_flat, ex_intro/
51 ]
52 qed-.
53
54 lemma sta_da_ge: ∀h,G,L,T,U,l0. ⦃G, L⦄ ⊢ T •[h] U →
55                  ∃∃g,l. ⦃G, L⦄ ⊢ T ▪[h, g] l & l0 ≤ l.
56 #h #G #L #T #U #l0 #H elim H -G -L -T -U
57 [ /3 width=4 by da_sort, ex2_2_intro/
58 | #G #L #K #V #W #W0 #i #HLK #_ #_ * /3 width=5 by da_ldef, ex2_2_intro/
59 | #G #L #K #W #V #W0 #i #HLK #_ #_ * /4 width=5 by da_ldec, lt_to_le, le_S_S, ex2_2_intro/
60 | #a #I #G #L #V #T #U #_ * /3 width=4 by da_bind, ex2_2_intro/
61 | #G #L #V #T #U #_ * /3 width=4 by da_flat, ex2_2_intro/
62 | #G #L #W #T #U #_ * /3 width=4 by da_flat, ex2_2_intro/
63 ]
64 qed-.
65
66 (* Inversion lrmmas on static type assignment for terms *********************)
67
68 lemma da_inv_sta: ∀h,g,G,L,T,l. ⦃G, L⦄ ⊢ T ▪[h, g] l →
69                   ∃U. ⦃G, L⦄ ⊢ T •[h] U.
70 #h #g #G #L #T #l #H elim H -G -L -T -l
71 [ /2 width=2/
72 | #G #L #K #V #i #l #HLK #_ * #W #HVW
73   elim (lift_total W 0 (i+1)) /3 width=7 by sta_ldef, ex_intro/
74 | #G #L #K #W #i #l #HLK #_ * #V #HWV
75   elim (lift_total W 0 (i+1)) /3 width=7 by sta_ldec, ex_intro/
76 | #a #I #G #L #V #T #l #_ * /3 width=2 by sta_bind, ex_intro/
77 | * #G #L #V #T #l #_ * /3 width=2 by sta_appl, sta_cast, ex_intro/
78 ]
79 qed-.
80
81 lemma sta_inv_refl_pos: ∀h,g,G,L,T,l. ⦃G, L⦄ ⊢ T ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T •[h] T → ⊥.
82 #h #g #G #L #T #l #H1T #HTT
83 lapply (da_sta_conf … HTT … H1T) -HTT <minus_plus_m_m #H2T
84 lapply (da_mono … H2T … H1T) -h -G -L -T #H
85 elim (plus_xySz_x_false 0 l 0) //
86 qed-.