]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/etc/lsubr/ssta_lpss.etc
- extended multiple substitutions now uses bounds in ynat (ie. they
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / etc / lsubr / ssta_lpss.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/substitution/lpss_ldrop.ma".
16 include "basic_2/static/ssta_lift.ma".
17
18 (* STRATIFIED STATIC TYPE ASSIGNMENT ON TERMS *******************************)
19
20 (* Properties about sn parallel substitution ********************************)
21
22 (* Note: apparently this was missing in basic_1 *)
23 lemma ssta_cpss_lpss_conf: ∀h,g,L1,T1,U1,l. ⦃h, L1⦄ ⊢ T1 •[g] ⦃l, U1⦄ →
24                            ∀T2. L1 ⊢ T1 ▶* T2 → ∀L2. L1 ⊢ ▶* L2 →
25                            ∃∃U2. ⦃h, L2⦄ ⊢ T2 •[g] ⦃l, U2⦄ & L1 ⊢ U1 ▶* U2.
26 #h #g #L1 #T1 #U1 #l #H elim H -L1 -T1 -U1 -l
27 [ #L1 #k1 #l1 #Hkl1 #X #H
28   >(cpss_inv_sort1 … H) -H /3 width=3/
29 | #L1 #K1 #V1 #W1 #U1 #i #l #HLK1 #_ #HWU1 #IHVW1 #X #H #L2 #HL12
30   elim (cpss_inv_lref1 … H) -H
31   [ #H destruct
32     elim (lpss_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2
33     elim (lpss_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
34     lapply (ldrop_fwd_ldrop2 … HLK1) -HLK1 #HLK1
35     elim (IHVW1 … HV12 … HK12) -IHVW1 -HV12 -HK12 #W2 #HVW2 #HW12
36     elim (lift_total W2 0 (i+1)) #U2 #HWU2
37     lapply (cpss_lift … HW12 … HLK1 … HWU1 … HWU2) -HW12 -HLK1 -HWU1 /3 width=6/
38   | * #Y #Z #V2 #H #HV12 #HV2
39     lapply (ldrop_mono … H … HLK1) -H #H destruct
40     elim (lpss_ldrop_conf … HLK1 … HL12) -HL12 #Z #H #HLK2
41     elim (lpss_inv_pair1 … H) -H #K2 #V0 #HK12 #_ #H destruct
42     lapply (ldrop_fwd_ldrop2 … HLK2) -V0 #HLK2
43     lapply (ldrop_fwd_ldrop2 … HLK1) -HLK1 #HLK1
44     elim (IHVW1 … HV12 … HK12) -IHVW1 -HK12 -HV12 #W2 #HVW2 #HW12
45     elim (lift_total W2 0 (i+1)) #U2 #HWU2
46     lapply (ssta_lift … HVW2 … HLK2 … HV2 … HWU2) -HVW2 -HLK2 -HV2
47     lapply (cpss_lift … HW12 … HLK1 … HWU1 … HWU2) -HW12 -HLK1 -HWU1 -HWU2 /3 width=3/
48   ]
49 | #L1 #K1 #W1 #V1 #U1 #i #l #HLK1 #_ #HWU1 #IHWV1 #X #H #L2 #HL12
50   elim (cpss_inv_lref1 … H) -H [ | -IHWV1 -HWU1 -HL12 ]
51   [ #H destruct
52     elim (lpss_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2
53     elim (lpss_inv_pair1 … H) -H #K2 #W2 #HK12 #HW12 #H destruct
54     lapply (ldrop_fwd_ldrop2 … HLK1) -HLK1 #HLK1
55     elim (IHWV1 … HW12 … HK12) -IHWV1 -HK12 #V2 #HWV2 #_
56     elim (lift_total W2 0 (i+1)) #U2 #HWU2
57     lapply (cpss_lift … HW12 … HLK1 … HWU1 … HWU2) -HW12 -HLK1 -HWU1 /3 width=6/ 
58   | * #K2 #V2 #W2 #HLK2 #_ #_
59     lapply (ldrop_mono … HLK2 … HLK1) -HLK1 -HLK2 #H destruct
60   ]
61 | #a #I #L1 #V1 #T1 #U1 #l #_ #IHTU1 #X #H #L2 #HL12
62   elim (cpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct
63   elim (IHTU1 … HT12 (L2.ⓑ{I}V2)) -IHTU1 -HT12 /2 width=1/ -HL12 /3 width=5/
64 | #L1 #V1 #T1 #U1 #l #_ #IHTU1 #X #H #L2 #HL12
65   elim (cpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct
66   elim (IHTU1 … HT12 … HL12) -IHTU1 -HT12 -HL12 /3 width=5/
67 | #L1 #W1 #T1 #U1 #l #_ #IHTU1 #X #H #L2 #HL12
68   elim (cpss_inv_flat1 … H) -H #W2 #T2 #HW12 #HT12 #H destruct
69   elim (IHTU1 … HT12 … HL12) -IHTU1 -HT12 -HL12 /3 width=3/
70 ]
71 qed-.
72
73 lemma ssta_cpss_conf: ∀h,g,L,T1,U1,l. ⦃h, L⦄ ⊢ T1 •[g] ⦃l, U1⦄ →
74                       ∀T2. L ⊢ T1 ▶* T2 →
75                       ∃∃U2. ⦃h, L⦄ ⊢ T2 •[g] ⦃l, U2⦄ & L ⊢ U1 ▶* U2.
76 /2 width=3 by ssta_cpss_lpss_conf/ qed-.
77
78 lemma ssta_lpss_conf: ∀h,g,L1,T,U1,l. ⦃h, L1⦄ ⊢ T •[g] ⦃l, U1⦄ →
79                       ∀L2. L1 ⊢ ▶* L2 →
80                       ∃∃U2. ⦃h, L2⦄ ⊢ T •[g] ⦃l, U2⦄ & L1 ⊢ U1 ▶* U2.
81 /2 width=3 by ssta_cpss_lpss_conf/ qed-.