]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/etc/snta/snta_ltpss.etc
milestone update in ground_2 and basic_2A
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / etc / snta / snta_ltpss.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/equivalence/cpcs_ltpss.ma".
16 include "basic_2/dynamic/snta_snta.ma".
17
18 (* STRATIFIED NATIVE TYPE ASSIGNMENT ON TERMS *******************************)
19
20 (* Properties about parallel unfold *****************************************)
21
22 lemma snta_ltpss_tpss_conf: ∀h,L1,T1,U,l. ⦃h, L1⦄ ⊢ T1 :[l] U →
23                             ∀L2,d,e. L1 ▶* [d, e] L2 →
24                             ∀T2. L2 ⊢ T1 ▶* [d, e] T2 → ⦃h, L2⦄ ⊢ T2 :[l] U.
25 #h #L1 #T1 #U #l #H elim H -L1 -T1 -U -l
26 [ #L1 #k #L2 #d #e #_ #T2 #H
27   >(tpss_inv_sort1 … H) -H //
28 | #L1 #K1 #V1 #W #U #i #l #HLK1 #_ #HWU #IHV1 #L2 #d #e #HL12 #T2 #H
29   elim (tpss_inv_lref1 … H) -H
30   [ #H destruct
31     elim (lt_or_ge i d) #Hdi
32     [ elim (ltpss_ldrop_conf_le … HL12 … HLK1 ?) -L1 /2 width=2/ #X #H #HLK2
33       elim (ltpss_inv_tpss11 … H ?) -H /2 width=1/ -Hdi #K2 #V2 #HK12 #HV12 #H destruct
34       /3 width=7/
35     | elim (lt_or_ge i (d + e)) #Hide [ | -Hdi ]
36       [ elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HLK2
37         elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K2 #V2 #HK12 #HV12 #H destruct
38         /3 width=7/
39       | lapply (ltpss_ldrop_conf_ge … HL12 … HLK1 ?) -L1 // -Hide /3 width=7/
40       ]
41     ]
42   | * #K2 #V2 #W2 #Hdi #Hide #HLK2 #HVW2 #HWT2
43     elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HL2K0
44     elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K0 #V0 #HK12 #HV12 #H destruct
45     lapply (ldrop_mono … HL2K0 … HLK2) -HL2K0 #H destruct
46     lapply (ldrop_fwd_ldrop2 … HLK2) -HLK2 #HLK2
47     lapply (tpss_trans_eq … HV12 HVW2) -V2 /3 width=9/
48   ]
49 | #L1 #K1 #W1 #V1 #U1 #i #l #HLK1 #HWV1 #HWU1 #IHWV1 #L2 #d #e #HL12 #T2 #H
50   elim (tpss_inv_lref1 … H) -H [ | -HWV1 -HWU1 -IHWV1 ]
51   [ #H destruct
52     elim (lift_total V1 0 (i+1)) #W #HW
53     elim (lt_or_ge i d) #Hdi [ -HWV1 ]
54     [ elim (ltpss_ldrop_conf_le … HL12 … HLK1 ?) -L1 /2 width=2/ #X #H #HLK2
55       elim (ltpss_inv_tpss11 … H ?) -H /2 width=1/ -Hdi #K2 #W2 #HK12 #HW12 #H destruct
56       lapply (ldrop_fwd_ldrop2 … HLK2) #HLK
57       lapply (snta_lift h … HLK … HWU1 … HW) [ /2 width=4/ | skip ] -HW #H
58       elim (lift_total W2 0 (i+1)) #U2 #HWU2
59       lapply (tpss_lift_ge … HW12 … HLK … HWU1 … HWU2) -HLK -HWU1 // #HU12
60       lapply (cpr_tpss … HU12) -HU12 #HU12
61       @(snta_conv … U2) // /2 width=1/ /3 width=6/ (**) (* explicit constructor, /4 width=6/ is too slow *)
62     | elim (lt_or_ge i (d + e)) #Hide [ -HWV1 | -IHWV1 -HW -Hdi ]
63       [ elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HLK2
64         elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K2 #W2 #HK12 #HW12 #H destruct
65         lapply (ldrop_fwd_ldrop2 … HLK2) #HLK
66         lapply (snta_lift h … HLK … HWU1 … HW) [ /2 width=4/ | skip ] -HW #H
67         elim (lift_total W2 0 (i+1)) #U2 #HWU2
68         lapply (tpss_lift_ge … HW12 … HLK … HWU1 … HWU2) -HLK -HWU1 // #HU12
69         lapply (cpr_tpss … HU12) -HU12 #HU12
70         @(snta_conv … U2) // /2 width=1/ /3 width=6/ (**) (* explicit constructor, /4 width=6/ is too slow *)
71       | lapply (ltpss_ldrop_conf_ge … HL12 … HLK1 ?) -L1 // -Hide /2 width=6/
72       ]
73     ]
74   | * #K2 #V2 #W2 #Hdi #Hide #HLK2 #_ #_
75     elim (ltpss_ldrop_conf_be … HL12 … HLK1 ? ?) -L1 // /2 width=2/ #X #H #HL2K0
76     elim (ltpss_inv_tpss21 … H ?) -H /2 width=1/ -Hdi -Hide #K0 #V0 #_ #_ #H destruct
77     lapply (ldrop_mono … HL2K0 … HLK2) -HL2K0 -HLK2 #H destruct
78   ]
79 | #I #L1 #V1 #W1 #T1 #U1 #l1 #l2 #_ #_ #IHVW1 #IHTU1 #L2 #d #e #HL12 #X #H
80   elim (tpss_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct
81   lapply (cpr_tpss … HV12) #HV
82   lapply (IHTU1 (L2.ⓑ{I}V1) (d+1) e ? T1 ?) // /2 width=1/ #H
83   elim (snta_fwd_correct … H) -H #U2 #HU12
84   @(snta_conv … (ⓑ{I}V2.U1)) /3 width=2/ /3 width=4/ /4 width=4/ (**) (* explicit constructor, /5 width=6/ is too slow *)
85 | #L1 #V1 #W11 #W12 #T1 #U1 #l1 #l2 #_ #_ #IHVW1 #IHTU1 #L2 #d #e #HL12 #X #H
86   elim (tpss_inv_flat1 … H) -H #V2 #Y #HV12 #HY #H destruct
87   elim (tpss_inv_bind1 … HY) -HY #W21 #T2 #HW121 #HT12 #H destruct
88   lapply (cpr_tpss … HV12) #HVV12
89   lapply (IHTU1 L2 d e ? (ⓛW21.T2) ?) -IHTU1 // /2 width=1/ -HW121 -HT12 #H0
90   elim (snta_fwd_correct … H0) #X #H
91   elim (snta_inv_bind1 … H) -H #W #U #l0 #HW #HU #_
92   @(snta_conv … (ⓐV2.ⓛW12.U1)) /3 width=2/ /3 width=4/ /3 width=5/ (**) (* explicit constructor, /4 width=5/ is too slow *)
93 | #L1 #V1 #T1 #U1 #W1 #l #_ #_ #IHTU1 #IHUW1 #L2 #d #e #HL12 #X #H
94   elim (tpss_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct
95   lapply (cpr_tpss … HV12) #HV
96   elim (snta_fwd_correct h L2 (ⓐV1.T1) (ⓐV1.U1) (l+1) ?) [2: /3 width=4/ ] #U
97   @(snta_conv … (ⓐV2.U1)) /3 width=1/ /4 width=5/ (**) (* explicit constructor, /5 width=5/ is too slow *)
98 | #L1 #T1 #U1 #W1 #l1 #l2 #HTU1 #HUW1 #IHTU1 #IHUW1 #L2 #d #e #HL12 #X #H
99   elim (snta_fwd_correct … HTU1) -HTU1 #U #H
100   elim (snta_mono … HUW1 … H) -HUW1 -H #H #_ -U destruct
101   elim (tpss_inv_flat1 … H) -H #U2 #T2 #HU12 #HT12 #H destruct
102   lapply (cpr_tpss … HU12) #HU /4 width=4/
103 | #L1 #T1 #U11 #U12 #U #l #_ #HU112 #_ #IHTU11 #IHU12 #L2 #d #e #HL12 #T2 #HT12
104   @(snta_conv … U11) /2 width=5/ (**) (* explicit constructor, /3 width=7/ is too slow *)
105 ]
106 qed.
107
108 lemma snta_ltpss_tps_conf: ∀h,L1,T1,U,l. ⦃h, L1⦄ ⊢ T1 :[l] U →
109                            ∀L2,d,e. L1 ▶* [d, e] L2 →
110                            ∀T2. L2 ⊢ T1 ▶ [d, e] T2 → ⦃h, L2⦄ ⊢ T2 :[l] U.
111 /3 width=7/ qed.
112
113 lemma snta_ltpss_conf: ∀h,L1,T,U,l. ⦃h, L1⦄ ⊢ T :[l] U →
114                        ∀L2,d,e. L1 ▶* [d, e] L2 → ⦃h, L2⦄ ⊢ T :[l] U.
115 /2 width=7/ qed.
116
117 lemma snta_tpss_conf: ∀h,L,T1,U,l. ⦃h, L⦄ ⊢ T1 :[l] U →
118                       ∀T2,d,e. L ⊢ T1 ▶* [d, e] T2 → ⦃h, L⦄ ⊢ T2 :[l] U.
119 /2 width=7/ qed.
120
121 lemma snta_tps_conf: ∀h,L,T1,U,l. ⦃h, L⦄ ⊢ T1 :[l] U →
122                      ∀T2,d,e. L ⊢ T1 ▶ [d, e] T2 → ⦃h, L⦄ ⊢ T2 :[l] U.
123 /2 width=7/ qed.