1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "basic_2/equivalence/cpcs_ltpss.ma".
16 include "basic_2/dynamic/nta_nta.ma".
18 (* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************)
20 (* Properties about parallel unfold *****************************************)
22 lemma nta_ltpss_tpss_conf: ∀h,L1,T1,U. ⦃h, L1⦄ ⊢ T1 : U →
23 ∀L2,d,e. L1 ▶* [d, e] L2 →
24 ∀T2. L2 ⊢ T1 ▶* [d, e] T2 → ⦃h, L2⦄ ⊢ T2 : U.
25 #h #L1 #T1 #U #H @(nta_ind_alt … H) -L1 -T1 -U
26 [ #L1 #k #L2 #d #e #_ #T2 #H
27 >(tpss_inv_sort1 … H) -H //
28 | #L1 #K1 #V1 #W #U #i #HLK1 #_ #HWU #IHV1 #L2 #d #e #HL12 #T2 #H
29 elim (tpss_inv_lref1 … H) -H
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
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
39 | lapply (ltpss_ldrop_conf_ge … HL12 … HLK1 ?) -L1 // -Hide /3 width=7/
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/
49 | #L1 #K1 #W1 #V1 #U1 #i #HLK1 #HWV1 #HWU1 #IHWV1 #L2 #d #e #HL12 #T2 #H
50 elim (tpss_inv_lref1 … H) -H [ | -HWV1 -HWU1 -IHWV1 ]
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 (nta_lift h … HLK … HWU1 … HW) /2 width=4/ -HW
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 @(nta_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 (nta_lift h … HLK … HWU1 … HW) /2 width=4/ -HW
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 @(nta_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/
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
79 | #I #L1 #V1 #W1 #T1 #U1 #_ #_ #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 (nta_fwd_correct … H) -H #U2 #HU12
84 @(nta_conv … (ⓑ{I}V2.U1)) /3 width=2/ /3 width=4/ /4 width=4/ (**) (* explicit constructor, /5 width=6/ is too slow *)
85 | #L1 #V1 #W1 #T1 #U1 #_ #_ #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 #W2 #T2 #HW12 #HT12 #H destruct
88 lapply (cpr_tpss … HV12) #HV
89 lapply (IHTU1 L2 d e ? (ⓛW1.T1) ?) // #H
90 elim (nta_fwd_correct … H) -H #X #H
91 elim (nta_inv_bind1 … H) -H #W #U #HW #HU #_
92 @(nta_conv … (ⓐV2.ⓛW1.U1)) /3 width=2/ /3 width=4/ /4 width=5/ (**) (* explicit constructor, /5 width=5/ is too slow *)
93 | #L1 #V1 #W1 #T1 #U1 #_ #_ #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 (nta_fwd_correct h L2 (ⓐV1.T1) (ⓐV1.U1) ?) [2: /3 width=4/ ] #U #HU
97 @(nta_conv … (ⓐV2.U1)) // /3 width=1/ /4 width=5/ (**) (* explicit constructor, /5 width=5/ is too slow *)
98 | #L1 #T1 #U1 #W1 #_ #_ #IHTU1 #IHUW1 #L2 #d #e #HL12 #X #H
99 elim (tpss_inv_flat1 … H) -H #U2 #T2 #HU12 #HT12 #H destruct
100 lapply (cpr_tpss … HU12) /4 width=4/
101 | #L1 #T1 #U11 #U12 #U #_ #HU112 #_ #IHTU11 #IHU12 #L2 #d #e #HL12 #T2 #HT12
102 @(nta_conv … U11) /2 width=5/ (**) (* explicot constructor, /3 width=7/ is too slow *)
106 lemma nta_ltpss_tps_conf: ∀h,L1,T1,U. ⦃h, L1⦄ ⊢ T1 : U →
107 ∀L2,d,e. L1 ▶* [d, e] L2 →
108 ∀T2. L2 ⊢ T1 ▶ [d, e] T2 → ⦃h, L2⦄ ⊢ T2 : U.
111 lemma nta_ltpss_conf: ∀h,L1,T,U. ⦃h, L1⦄ ⊢ T : U →
112 ∀L2,d,e. L1 ▶* [d, e] L2 → ⦃h, L2⦄ ⊢ T : U.
115 lemma nta_tpss_conf: ∀h,L,T1,U. ⦃h, L⦄ ⊢ T1 : U →
116 ∀T2,d,e. L ⊢ T1 ▶* [d, e] T2 → ⦃h, L⦄ ⊢ T2 : U.
119 lemma nta_tps_conf: ∀h,L,T1,U. ⦃h, L⦄ ⊢ T1 : U →
120 ∀T2,d,e. L ⊢ T1 ▶ [d, e] T2 → ⦃h, L⦄ ⊢ T2 : U.