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/computation/dxprs_dxprs.ma".
16 include "basic_2/dynamic/lsubsv_ldrop.ma".
17 include "basic_2/dynamic/lsubsv_dxprs.ma".
18 include "basic_2/dynamic/lsubsv_cpcs.ma".
20 (* LOCAL ENVIRONMENT REFINEMENT FOR STRATIFIED NATIVE VALIDITY **************)
22 (* Properties concerning stratified native validity *************************)
24 fact snv_lsubsv_aux: ∀h,g,L0,T0.
25 (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_ltpr_tpr h g L1 T1) →
26 (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_ssta_ltpr_tpr h g L1 T1) →
27 (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_ssta h g L1 T1) →
28 (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_lsubsv h g L1 T1) →
29 ∀L1,T1. L0 = L1 → T0 = T1 → IH_snv_lsubsv h g L1 T1.
30 #h #g #L0 #T0 #IH4 #IH3 #IH2 #IH1 #L2 * * [||||*] //
31 [ #i #HL0 #HT0 #H #L1 #HL12 destruct -IH4 -IH3 -IH2
32 elim (snv_inv_lref … H) -H #I2 #K2 #W2 #HLK2 #HW2
33 elim (lsubsv_ldrop_O1_trans … HL12 … HLK2) -HL12 #X #H #HLK1
34 lapply (ldrop_pair2_fwd_fw … HLK2 (#i)) -HLK2 #HLK2
35 elim (lsubsv_inv_pair2 … H) -H * #K1
36 [ #HK12 #H destruct /4 width=8 by snv_lref, fw_ygt/ (**) (* auto too slow without trace *)
37 | #W1 #V1 #V2 #l #HV1 #_ #_ #_ #_ #_ #H #_ destruct /2 width=5/
39 | #p #HL0 #HT0 #H #L1 #HL12 destruct -IH4 -IH3 -IH2 -IH1
40 elim (snv_inv_gref … H)
41 | #a #I #V #T #HL0 #HT0 #H #L1 #HL12 destruct -IH4 -IH3 -IH2
42 elim (snv_inv_bind … H) -H /4 width=4/
43 | #V #T #HL0 #HT0 #H #L1 #HL12 destruct
44 elim (snv_inv_appl … H) -H #a #W #W0 #U #l #HV #HT #HVW #HW0 #HTU
45 lapply (lsubsv_cprs_trans … HL12 … HW0) -HW0 #HW0
46 elim (lsubsv_ssta_trans … HVW … HL12) -HVW #W1 #HVW1 #HW1
47 lapply (cpcs_cprs_strap1 … HW1 … HW0) -W #HW10
48 elim (dxprs_lsubsv_aux … IH4 IH3 IH2 IH1 … HL12 … HTU) -IH4 -IH3 -IH2 -HTU // /2 width=1/ #X #HTU #H
49 elim (cprs_inv_abst1 Abst W0 … H) -H #W #U2 #HW0 #HU2 #H destruct
50 lapply (cpcs_cprs_strap1 … HW10 … HW0) -W0 #H
51 elim (cpcs_inv_cprs … H) -H #W0 #HW10 #HW0
52 lapply (dxprs_cprs_trans … (ⓛ{a}W0.U2) HTU ?) [ /2 width=1/ ] -HTU -HW0
53 /4 width=8 by snv_appl, fw_ygt/ (**) (* auto too slow without trace *)
54 | #W #T #HL0 #HT0 #H #L1 #HL12 destruct -IH4 -IH3 -IH2
55 elim (snv_inv_cast … H) -H #U #l #HW #HT #HTU #HUW
56 lapply (lsubsv_cpcs_trans … HL12 … HUW) -HUW #HUW
57 elim (lsubsv_ssta_trans … HTU … HL12) -HTU #U0 #HTU0 #HU0
58 lapply (cpcs_trans … HU0 … HUW) -U /4 width=4 by snv_cast, fw_ygt/ (**) (* auto too slow without trace *)