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/da_aaa.ma".
16 include "basic_2/unfold/lstas_lift.ma".
17 include "basic_2/computation/csx_aaa.ma".
18 include "basic_2/computation/cpds_aaa.ma".
19 include "basic_2/equivalence/cpcs_aaa.ma".
20 include "basic_2/dynamic/snv.ma".
22 (* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
24 (* Forward lemmas on atomic arity assignment for terms **********************)
26 lemma snv_fwd_aaa: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] → ∃A. ⦃G, L⦄ ⊢ T ⁝ A.
27 #h #g #G #L #T #H elim H -G -L -T
28 [ /2 width=2 by aaa_sort, ex_intro/
29 | #I #G #L #K #V #i #HLK #_ * /3 width=6 by aaa_lref, ex_intro/
30 | #a * #G #L #V #T #_ #_ * #B #HV * #A #HA /3 width=2 by aaa_abbr, aaa_abst, ex_intro/
31 | #a #G #L #V #W #W0 #T #U #l #_ #_ #Hl #HVW #HW0 #HTU * #B #HV * #X #HT
32 lapply (cpds_aaa_conf h g … HV W0 ?) [ -HTU /3 width=4 by cpds_strap1, sta_cprs_cpds/ ] -W #HW0 (**) (* auto fail without -HTU *)
33 lapply (cpds_aaa_conf … HT … HTU) -HTU #H
34 elim (aaa_inv_abst … H) -H #B0 #A #H1 #HU #H2 destruct
35 lapply (aaa_mono … H1 … HW0) -W0 #H destruct /3 width=4 by aaa_appl, ex_intro/
36 | #G #L #W #T #U #l #_ #_ #_ #HTU #HUW * #B #HW * #A #HT
37 lapply (sta_aaa_conf … HT … HTU) -HTU #H
38 lapply (cpcs_aaa_mono … HUW … H … HW) -HUW -H #H destruct /3 width=3 by aaa_cast, ex_intro/
42 lemma snv_fwd_csx: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] → ⦃G, L⦄ ⊢ ⬊*[h, g] T.
43 #h #g #G #L #T #H elim (snv_fwd_aaa … H) -H /2 width=2 by aaa_csx/
46 (* Advanced forward lemmas **************************************************)
48 lemma snv_fwd_da: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] → ∃l. ⦃G, L⦄ ⊢ T ▪[h, g] l.
49 #h #g #G #L #T #H elim (snv_fwd_aaa … H) -H /2 width=2 by aaa_da/
52 lemma snv_fwd_sta: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] → ∃U. ⦃G, L⦄ ⊢ T •[h] U.
53 #h #g #G #L #T #H elim (snv_fwd_aaa … H) -H /2 width=2 by aaa_sta/
56 lemma snv_lstas_fwd_correct: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ¡[h, g] → ⦃G, L⦄ ⊢ T1 •* [h, l] T2 →
57 ∃U2. ⦃G, L⦄ ⊢ T2 •[h] U2.
58 #h #g #G #L #T1 #T2 #l #HT1 #HT12
59 elim (snv_fwd_sta … HT1) -HT1 /2 width=5 by lstas_fwd_correct/
62 (* Advanced properties ******************************************************)
64 lemma snv_scast: ∀h,g,G,L,V,W,l. ⦃G, L⦄ ⊢ V ¡[h, g] → ⦃G, L⦄ ⊢ W ¡[h, g] →
65 scast h g l G L V W → ⦃G, L⦄ ⊢V ▪[h, g] l+1 → ⦃G, L⦄ ⊢ ⓝW.V ¡[h, g].
66 #h #g #G #L #V #W #l #HV #HW #H #Hl
67 elim (snv_fwd_sta … HV) /4 width=6 by snv_cast, sta_lstas/