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/dynamic/snv_cpcs.ma".
17 (* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
19 (* Properties on stratified static type assignment for terms ****************)
21 fact snv_ssta_aux: ∀h,g,L0,T0.
22 (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_ltpr_tpr h g L1 T1) →
23 (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_ssta_ltpr_tpr h g L1 T1) →
24 (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_ssta h g L1 T1) →
25 ∀L1,T1. L0 = L1 → T0 = T1 → IH_snv_ssta h g L1 T1.
26 #h #g #L0 #T0 #IH3 #IH2 #IH1 #L1 * * [||||*]
27 [ #k #HL0 #HT0 #_ #X #l #H2 destruct -IH3 -IH2 -IH1
28 elim (ssta_inv_sort1 … H2) -H2 #_ #H destruct //
29 | #i #HL0 #HT0 #H1 #X #l #H2 destruct -IH3 -IH2
30 elim (snv_inv_lref … H1) -H1 #I #K1 #V1 #HLK1 #HV1
31 elim (ssta_inv_lref1 … H2) -H2 * #K0 #V0 #W1 [| #l ] #H #HVW1 #HX [| #_ ]
32 lapply (ldrop_mono … H … HLK1) -H #H destruct
33 lapply (ldrop_pair2_fwd_fw … HLK1 (#i)) #H
34 lapply (ldrop_fwd_ldrop2 … HLK1) -HLK1 /4 width=7/
35 | #p #HL0 #HT0 #H1 #X #l #H2 destruct -IH3 -IH2 -IH1
36 elim (snv_inv_gref … H1)
37 | #a #I #V1 #T1 #HL0 #HT0 #H1 #X #l #H2 destruct -IH3 -IH2
38 elim (snv_inv_bind … H1) -H1 #HV1 #HT1
39 elim (ssta_inv_bind1 … H2) -H2 #U1 #HTU1 #H destruct /4 width=5/
40 | #V1 #T1 #HL0 #HT0 #H1 #X #l #H2 destruct
41 elim (snv_inv_appl … H1) -H1 #a #W1 #W0 #T0 #l0 #HV1 #HT1 #HVW1 #HW10 #HT10
42 elim (ssta_inv_appl1 … H2) -H2 #U1 #HTU1 #H destruct
43 lapply (IH1 … HT1 … HTU1) -IH1 /2 width=1/ #HU1
44 elim (ssta_dxprs_aux … IH3 IH2 … HTU1 … HT10) -IH3 -IH2 // /2 width=2/ -T1 #U #X #HU1U #H #HU0
45 elim (sstas_inv_bind1 … H) -H #U0 #HTU0 #H destruct
46 elim (cpcs_inv_abst2 … HU0) -HU0 #W2 #U2 #HU2 #HU02
47 elim (cprs_inv_abst … HU02 Abst W0) -HU02 #HW02 #_
48 lapply (cprs_trans … HW10 … HW02) -W0 /3 width=10 by snv_appl, ex2_intro/ (**) (* auto is too slow without trace *)
49 | #W1 #T1 #HL0 #HT0 #H1 #X #l #H2 destruct -IH3 -IH2
50 elim (snv_inv_cast … H1) -H1 #U1 #l0 #HW1 #HT1 #HTU1 #HUW1
51 lapply (ssta_inv_cast1 … H2) -H2 /3 width=5/