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/static/ssta_ssta.ma".
16 include "basic_2/equivalence/cpcs_cpcs.ma".
17 include "basic_2/dynamic/lsubsv_ldrop.ma".
19 (* LOCAL ENVIRONMENT REFINEMENT FOR STRATIFIED NATIVE VALIDITY **************)
21 (* Properties on stratified static type assignment **************************)
23 lemma lsubsv_ssta_trans: ∀h,g,L2,T,U2,l. ⦃h, L2⦄ ⊢ T •[g] ⦃l, U2⦄ →
24 ∀L1. h ⊢ L1 ¡⊑[g] L2 →
25 ∃∃U1. ⦃h, L1⦄ ⊢ T •[g] ⦃l, U1⦄ & L1 ⊢ U1 ⬌* U2.
26 #h #g #L2 #T #U #l #H elim H -L2 -T -U -l
28 | #L2 #K2 #X #Y #U #i #l #HLK2 #_ #HYU #IHXY #L1 #HL12
29 elim (lsubsv_ldrop_O1_trans … HL12 … HLK2) -L2 #X #H #HLK1
30 elim (lsubsv_inv_pair2 … H) -H * #K1 [ | -HYU -IHXY -HLK1 ]
32 elim (IHXY … HK12) -K2 #T #HXT #HTY
33 lapply (ldrop_fwd_ldrop2 … HLK1) #H
34 elim (lift_total T 0 (i+1)) /3 width=11/
35 | #V #W1 #V2 #l0 #_ #_ #_ #_ #_ #H destruct
37 | #L2 #K2 #Y #X #U #i #l #HLK2 #HYX #HYU #IHYX #L1 #HL12
38 elim (lsubsv_ldrop_O1_trans … HL12 … HLK2) -L2 #X #H #HLK1
39 elim (lsubsv_inv_pair2 … H) -H * #K1 [ -HYX | -IHYX ]
41 elim (IHYX … HK12) -K2 /3 width=6/
42 | #V #W1 #V2 #l0 #HYV #_ #HV #HY #_ #_ #H destruct
43 elim (snv_inv_cast … HYV) -HYV #W #l1 #_ #_ #HVW #HWY
44 elim (ssta_mono … HVW … HV) -HV #Hl10 #_
45 elim (ssta_mono … HYX … HY) -HYX -HY #H #_ destruct
46 lapply (ldrop_fwd_ldrop2 … HLK1) #H
47 elim (lift_total W 0 (i+1))
48 /4 width=11 by cpcs_lift, ex2_intro, ssta_ldef, ssta_cast/
50 | #a #I #L2 #V2 #T2 #U2 #l #_ #IHTU2 #L1 #HL12
51 elim (IHTU2 (L1.ⓑ{I}V2) …) [2: /2 width=1/ ] -L2 /3 width=3/
52 | #L2 #V2 #T2 #U2 #l #_ #IHTU2 #L1 #HL12
53 elim (IHTU2 … HL12) -L2 /3 width=5/
54 | #L2 #W2 #T2 #U2 #l #_ #IHTU2 #L1 #HL12
55 elim (IHTU2 … HL12) -L2 /3 width=3/