(**************************************************************************)
include "basic_2/notation/relations/dpredstar_6.ma".
-include "basic_2/unfold/lsstas.ma".
+include "basic_2/static/da.ma".
+include "basic_2/unfold/lstas.ma".
include "basic_2/computation/cprs.ma".
(* DECOMPOSED EXTENDED PARALLEL COMPUTATION ON TERMS ************************)
definition cpds: ∀h. sd h → relation4 genv lenv term term ≝
λh,g,G,L,T1,T2.
- ∃∃T,l1,l2. l2 ≤ l1 & ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 & ⦃G, L⦄ ⊢ T1 •*[h, g, l2] T & ⦃G, L⦄ ⊢ T ➡* T2.
+ ∃∃T,l1,l2. l2 ≤ l1 & ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 & ⦃G, L⦄ ⊢ T1 •*[h, l2] T & ⦃G, L⦄ ⊢ T ➡* T2.
interpretation "decomposed extended parallel computation (term)"
'DPRedStar h g G L T1 T2 = (cpds h g G L T1 T2).
(* Basic properties *********************************************************)
-lemma ssta_cprs_cpds: ∀h,g,G,L,T1,T,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T1 •[h, g] T →
- ⦃G, L⦄ ⊢ T ➡* T2 → ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2.
-/3 width=7/ qed.
+lemma sta_cprs_cpds: ∀h,g,G,L,T1,T,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T1 •[h] T →
+ ⦃G, L⦄ ⊢ T ➡* T2 → ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2.
+/3 width=7 by sta_lstas, ex4_3_intro/ qed.
-lemma lsstas_cpds: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l → ⦃G, L⦄ ⊢ T1 •*[h, g, l] T2 → ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2.
-/2 width=7/ qed.
+lemma lstas_cpds: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l → ⦃G, L⦄ ⊢ T1 •*[h, l] T2 → ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2.
+/2 width=7 by ex4_3_intro/ qed.
lemma cprs_cpds: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l → ⦃G, L⦄ ⊢ T1 ➡* T2 → ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2.
-/2 width=7/ qed.
+/2 width=7 by lstar_O, ex4_3_intro/ qed.
lemma cpds_refl: ∀h,g,G,L,T,l. ⦃G, L⦄ ⊢ T ▪[h, g] l → ⦃G, L⦄ ⊢ T •*➡*[h, g] T.
-/2 width=2/ qed.
+/2 width=2 by cprs_cpds/ qed.
lemma cpds_strap1: ∀h,g,G,L,T1,T,T2.
⦃G, L⦄ ⊢ T1 •*➡*[h, g] T → ⦃G, L⦄ ⊢ T ➡ T2 → ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2.
-#h #g #G #L #T1 #T #T2 * /3 width=9/
+#h #g #G #L #T1 #T #T2 * /3 width=9 by cprs_strap1, ex4_3_intro/
qed.
(* *)
(**************************************************************************)
-include "basic_2/unfold/lsstas_aaa.ma".
+include "basic_2/unfold/lstas_aaa.ma".
include "basic_2/computation/cpxs_aaa.ma".
include "basic_2/computation/cpds.ma".
(* Properties on atomic arity assignment for terms **************************)
-lemma aaa_cpds_conf: ∀h,g,G,L. Conf3 … (aaa G L) (cpds h g G L).
-#h #g #G #L #A #T #HT #U * /3 width=6 by aaa_lsstas_conf, aaa_cprs_conf/
+lemma cpds_aaa_conf: ∀h,g,G,L. Conf3 … (aaa G L) (cpds h g G L).
+#h #g #G #L #A #T #HT #U * /3 width=6 by lstas_aaa_conf, cprs_aaa_conf/
qed.
(* *)
(**************************************************************************)
-include "basic_2/unfold/lsstas_lsstas.ma".
+include "basic_2/unfold/lstas_lstas.ma".
include "basic_2/computation/lprs_cprs.ma".
include "basic_2/computation/cpxs_cpxs.ma".
include "basic_2/computation/cpds.ma".
(* Advanced properties ******************************************************)
lemma cpds_strap2: ∀h,g,G,L,T1,T,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 →
- ⦃G, L⦄ ⊢ T1 •[h, g] T → ⦃G, L⦄ ⊢ T •*➡*[h, g] T2 → ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2.
+ ⦃G, L⦄ ⊢ T1 •[h] T → ⦃G, L⦄ ⊢ T •*➡*[h, g] T2 → ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2.
#h #g #G #L #T1 #T #T2 #l #Hl #HT1 *
#T0 #l0 #l1 #Hl10 #HT #HT0 #HT02
-lapply (ssta_da_conf … HT1 … Hl) <minus_plus_m_m #H0T
+lapply (da_sta_conf … HT1 … Hl) <minus_plus_m_m #H0T
lapply (da_mono … H0T … HT) -HT -H0T #H destruct
-/3 width=7 by lsstas_step_sn, le_S_S, ex4_3_intro/
+/3 width=7 by lstas_step_sn, le_S_S, ex4_3_intro/
qed.
lemma cpds_cprs_trans: ∀h,g,G,L,T1,T,T2.
#h #g #G #L #T1 #T #T2 * /3 width=9 by cprs_trans, ex4_3_intro/
qed-.
-lemma lsstas_cpds_trans: ∀h,g,G,L,T1,T,T2,l1,l2.
- l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 →
- ⦃G, L⦄ ⊢ T1 •*[h, g, l2] T → ⦃G, L⦄ ⊢ T •*➡*[h, g] T2 → ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2.
+lemma lstas_cpds_trans: ∀h,g,G,L,T1,T,T2,l1,l2.
+ l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 →
+ ⦃G, L⦄ ⊢ T1 •*[h, l2] T → ⦃G, L⦄ ⊢ T •*➡*[h, g] T2 → ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2.
#h #g #G #L #T1 #T #T2 #l1 #l2 #Hl21 #Hl1 #HT1 * #T0 #l3 #l4 #Hl43 #Hl3 #HT0 #HT02
-lapply (lsstas_da_conf … HT1 … Hl1) #H0T
+lapply (lstas_da_conf … HT1 … Hl1) #H0T
lapply (da_mono … H0T … Hl3) -H0T -Hl3 #H destruct
lapply (le_minus_to_plus_r … Hl21 Hl43) -Hl21 -Hl43
-/3 width=8 by lsstas_trans, ex4_3_intro/
+/3 width=8 by lstas_trans, ex4_3_intro/
qed-.
(* Advanced inversion lemmas ************************************************)
U2 = ⓛ{a}V2.T2.
#h #g #a #G #L #V1 #T1 #U2 * #X #l1 #l2 #Hl21 #Hl1 #H1 #H2
lapply (da_inv_bind … Hl1) -Hl1 #Hl1
-elim (lsstas_inv_bind1 … H1) -H1 #U #HTU1 #H destruct
+elim (lstas_inv_bind1 … H1) -H1 #U #HTU1 #H destruct
elim (cprs_inv_abst1 … H2) -H2 #V2 #T2 #HV12 #HUT2 #H destruct
/3 width=7 by ex4_3_intro, ex3_2_intro/
qed-.
∃∃T. ⦃G, L.ⓓV1⦄ ⊢ T1 •*➡*[h, g] T & ⇧[0, 1] ⓛ{a2}W2.T2 ≡ T & a1 = true.
#h #g #a1 #a2 #G #L #V1 #W2 #T1 #T2 * #X #l1 #l2 #Hl21 #Hl1 #H1 #H2
lapply (da_inv_bind … Hl1) -Hl1 #Hl1
-elim (lsstas_inv_bind1 … H1) -H1 #U1 #HTU1 #H destruct
+elim (lstas_inv_bind1 … H1) -H1 #U1 #HTU1 #H destruct
elim (cprs_inv_abbr1 … H2) -H2 *
[ #V2 #U2 #HV12 #HU12 #H destruct
| /3 width=7 by ex4_3_intro, ex3_intro/
(* Advanced forward lemmas **************************************************)
lemma cpds_fwd_cpxs: ∀h,g,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2 → ⦃G, L⦄ ⊢ T1 ➡*[h, g] T2.
-#h #g #G #L #T1 #T2 * /3 width=5 by cpxs_trans, lsstas_cpxs, cprs_cpxs/
+#h #g #G #L #T1 #T2 * /3 width=5 by cpxs_trans, lstas_cpxs, cprs_cpxs/
qed-.
(* *)
(**************************************************************************)
-include "basic_2/unfold/lsstas_lift.ma".
+include "basic_2/static/da_lift.ma".
+include "basic_2/unfold/lstas_lift.ma".
include "basic_2/computation/cprs_lift.ma".
include "basic_2/computation/cpds.ma".
lemma cpds_lift: ∀h,g,G. l_liftable (cpds h g G).
#h #g #G #K #T1 #T2 * #T #l1 #l2 #Hl12 #Hl1 #HT1 #HT2 #L #s #d #e
elim (lift_total T d e)
-/3 width=16 by cprs_lift, da_lift, lsstas_lift, ex4_3_intro/
+/3 width=16 by cprs_lift, da_lift, lstas_lift, ex4_3_intro/
qed.
lemma cpds_inv_lift1: ∀h,g,G. l_deliftable_sn (cpds h g G).
#h #g #G #L #U1 #U2 * #U #l1 #l2 #Hl12 #Hl1 #HU1 #HU2 #K #s #d #e #HLK #T1 #HTU1
lapply (da_inv_lift … Hl1 … HLK … HTU1) -Hl1 #Hl1
-elim (lsstas_inv_lift1 … HU1 … HLK … HTU1) -U1 #T #HTU #HT1
+elim (lstas_inv_lift1 … HU1 … HLK … HTU1) -U1 #T #HTU #HT1
elim (cprs_inv_lift1 … HU2 … HLK … HTU) -U -L
/3 width=9 by ex4_3_intro, ex2_intro/
qed-.
(* Properties about atomic arity assignment on terms ************************)
-lemma aaa_cpxs_conf: ∀h,g,G,L,T1,A. ⦃G, L⦄ ⊢ T1 ⁝ A →
+lemma cpxs_aaa_conf: ∀h,g,G,L,T1,A. ⦃G, L⦄ ⊢ T1 ⁝ A →
∀T2. ⦃G, L⦄ ⊢ T1 ➡*[h, g] T2 → ⦃G, L⦄ ⊢ T2 ⁝ A.
#h #g #G #L #T1 #A #HT1 #T2 #HT12
-@(TC_Conf3 … HT1 ? HT12) -A -T1 -T2 /2 width=5 by aaa_cpx_conf/
+@(TC_Conf3 … HT1 ? HT12) -A -T1 -T2 /2 width=5 by cpx_aaa_conf/
qed-.
-lemma aaa_cprs_conf: ∀G,L,T1,A. ⦃G, L⦄ ⊢ T1 ⁝ A → ∀T2. ⦃G, L⦄ ⊢ T1 ➡* T2 → ⦃G, L⦄ ⊢ T2 ⁝ A.
-/3 width=5 by aaa_cpxs_conf, cprs_cpxs/ qed-.
+lemma cprs_aaa_conf: ∀G,L,T1,A. ⦃G, L⦄ ⊢ T1 ⁝ A → ∀T2. ⦃G, L⦄ ⊢ T1 ➡* T2 → ⦃G, L⦄ ⊢ T2 ⁝ A.
+/3 width=5 by cpxs_aaa_conf, cprs_cpxs/ qed-.
(**************************************************************************)
include "basic_2/multiple/fqus_fqus.ma".
-include "basic_2/unfold/lsstas_lift.ma".
+include "basic_2/unfold/lstas_da.ma".
include "basic_2/reduction/cpx_lift.ma".
include "basic_2/computation/cpxs.ma".
(* Advanced properties ******************************************************)
-lemma lsstas_cpxs: ∀h,g,G,L,T1,T2,l1. ⦃G, L⦄ ⊢ T1 •* [h, g, l1] T2 →
- ∀l2. ⦃G, L⦄ ⊢ T1 ▪ [h, g] l2 → l1 ≤ l2 → ⦃G, L⦄ ⊢ T1 ➡*[h, g] T2.
-#h #g #G #L #T1 #T2 #l1 #H @(lsstas_ind_dx … H) -T2 -l1 //
+lemma lstas_cpxs: ∀h,g,G,L,T1,T2,l1. ⦃G, L⦄ ⊢ T1 •* [h, l1] T2 →
+ ∀l2. ⦃G, L⦄ ⊢ T1 ▪ [h, g] l2 → l1 ≤ l2 → ⦃G, L⦄ ⊢ T1 ➡*[h, g] T2.
+#h #g #G #L #T1 #T2 #l1 #H @(lstas_ind_dx … H) -T2 -l1 //
#l1 #T #T2 #HT1 #HT2 #IHT1 #l2 #Hl2 #Hl12
-lapply (lsstas_da_conf … HT1 … Hl2) -HT1
+lapply (lstas_da_conf … HT1 … Hl2) -HT1
>(plus_minus_m_m (l2-l1) 1 ?)
-[ /4 width=5 by cpxs_strap1, ssta_cpx, lt_to_le/
+[ /4 width=5 by cpxs_strap1, sta_cpx, lt_to_le/
| /2 width=1 by monotonic_le_minus_r/
]
qed.
]
qed-.
-lemma fquq_lsstas_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ →
- ∀U2,l1. ⦃G2, L2⦄ ⊢ T2 •*[h, g, l1] U2 →
- ∀l2. ⦃G2, L2⦄ ⊢ T2 ▪ [h, g] l2 → l1 ≤ l2 →
- ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊐⸮ ⦃G2, L2, U2⦄.
-/3 width=5 by fquq_cpxs_trans, lsstas_cpxs/ qed-.
+lemma fquq_lstas_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ →
+ ∀U2,l1. ⦃G2, L2⦄ ⊢ T2 •*[h, l1] U2 →
+ ∀l2. ⦃G2, L2⦄ ⊢ T2 ▪ [h, g] l2 → l1 ≤ l2 →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊐⸮ ⦃G2, L2, U2⦄.
+/3 width=5 by fquq_cpxs_trans, lstas_cpxs/ qed-.
lemma fqup_cpxs_trans: ∀h,g,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡*[h, g] U2 →
∀T1. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T2⦄ →
]
qed-.
-lemma fqus_lsstas_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ →
- ∀U2,l1. ⦃G2, L2⦄ ⊢ T2 •*[h, g, l1] U2 →
- ∀l2. ⦃G2, L2⦄ ⊢ T2 ▪ [h, g] l2 → l1 ≤ l2 →
- ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊐* ⦃G2, L2, U2⦄.
-/3 width=7 by fqus_cpxs_trans, lsstas_cpxs/ qed-.
+lemma fqus_lstas_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ →
+ ∀U2,l1. ⦃G2, L2⦄ ⊢ T2 •*[h, l1] U2 →
+ ∀l2. ⦃G2, L2⦄ ⊢ T2 ▪ [h, g] l2 → l1 ≤ l2 →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊐* ⦃G2, L2, U2⦄.
+/3 width=6 by fqus_cpxs_trans, lstas_cpxs/ qed-.
(∀T2. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 → (T1 = T2 → ⊥) → R T2) → R T1
) →
∀T. ⦃G, L⦄ ⊢ ⬊*[h, g] T → ⦃G, L⦄ ⊢ T ⁝ A → R T.
-#h #g #G #L #A #R #IH #T #H @(csx_ind … H) -T /4 width=5 by aaa_cpx_conf/
+#h #g #G #L #A #R #IH #T #H @(csx_ind … H) -T /4 width=5 by cpx_aaa_conf/
qed-.
lemma aaa_ind_csx: ∀h,g,G,L,A. ∀R:predicate term.
(∀T2. ⦃G, L⦄ ⊢ T1 ➡*[h, g] T2 → (T1 = T2 → ⊥) → R T2) → R T1
) →
∀T. ⦃G, L⦄ ⊢ ⬊*[h, g] T → ⦃G, L⦄ ⊢ T ⁝ A → R T.
-#h #g #G #L #A #R #IH #T #H @(csx_ind_alt … H) -T /4 width=5 by aaa_cpxs_conf/
+#h #g #G #L #A #R #IH #T #H @(csx_ind_alt … H) -T /4 width=5 by cpxs_aaa_conf/
qed-.
lemma aaa_ind_csx_alt: ∀h,g,G,L,A. ∀R:predicate term.
(* Advanced properties ******************************************************)
-lemma lsstas_fpbg: ∀h,g,G,L,T1,T2,l2. ⦃G, L⦄ ⊢ T1 •*[h, g, l2] T2 → (T1 = T2 → ⊥) →
- ∀l1. l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 → ⦃G, L, T1⦄ >≡[h, g] ⦃G, L, T2⦄.
-/5 width=5 by fpbc_fpbg, fpbu_fpbc, lsstas_fpbu/ qed.
+lemma lstas_fpbg: ∀h,g,G,L,T1,T2,l2. ⦃G, L⦄ ⊢ T1 •*[h, l2] T2 → (T1 = T2 → ⊥) →
+ ∀l1. l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 → ⦃G, L, T1⦄ >≡[h, g] ⦃G, L, T2⦄.
+/5 width=5 by fpbc_fpbg, fpbu_fpbc, lstas_fpbu/ qed.
-lemma ssta_fpbg: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 →
- ⦃G, L⦄ ⊢ T1 •[h, g] T2 → ⦃G, L, T1⦄ >≡[h, g] ⦃G, L, T2⦄.
-/4 width=2 by fpbc_fpbg, fpbu_fpbc, ssta_fpbu/ qed.
+lemma sta_fpbg: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 →
+ ⦃G, L⦄ ⊢ T1 •[h] T2 → ⦃G, L, T1⦄ >≡[h, g] ⦃G, L, T2⦄.
+/4 width=2 by fpbc_fpbg, fpbu_fpbc, sta_fpbu/ qed.
(* Properties on atomic arity assignment for terms **************************)
-lemma aaa_fpbs_conf: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄ →
+lemma fpbs_aaa_conf: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≥[h, g] ⦃G2, L2, T2⦄ →
∀A1. ⦃G1, L1⦄ ⊢ T1 ⁝ A1 → ∃A2. ⦃G2, L2⦄ ⊢ T2 ⁝ A2.
#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fpbs_ind … H) -G2 -L2 -T2 /2 width=2 by ex_intro/
#G #G2 #L #L2 #T #T2 #_ #H2 #IH1 #A #HA elim (IH1 … HA) -IH1 -A
-/2 width=8 by aaa_fpb_conf/
+/2 width=8 by fpb_aaa_conf/
qed-.
(* Advanced properties ******************************************************)
-lemma lsstas_fpbs: ∀h,g,G,L,T1,T2,l2. ⦃G, L⦄ ⊢ T1 •*[h, g, l2] T2 →
- ∀l1. l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 → ⦃G, L, T1⦄ ≥[h, g] ⦃G, L, T2⦄.
-/3 width=5 by cpxs_fpbs, lsstas_cpxs/ qed.
+lemma lstas_fpbs: ∀h,g,G,L,T1,T2,l2. ⦃G, L⦄ ⊢ T1 •*[h, l2] T2 →
+ ∀l1. l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 → ⦃G, L, T1⦄ ≥[h, g] ⦃G, L, T2⦄.
+/3 width=5 by cpxs_fpbs, lstas_cpxs/ qed.
-lemma ssta_fpbs: ∀h,g,G,L,T,U,l.
- ⦃G, L⦄ ⊢ T ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T •[h, g] U →
- ⦃G, L, T⦄ ≥[h, g] ⦃G, L, U⦄.
-/4 width=2 by fpb_fpbs, ssta_fpb/ qed.
+lemma sta_fpbs: ∀h,g,G,L,T,U,l.
+ ⦃G, L⦄ ⊢ T ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T •[h] U →
+ ⦃G, L, T⦄ ≥[h, g] ⦃G, L, U⦄.
+/4 width=2 by fpb_fpbs, sta_fpb/ qed.
(* Note: this is used in the closure proof *)
-lemma cpr_lpr_ssta_fpbs: ∀h,g,G,L1,L2,T1,T2,U2,l2.
- ⦃G, L1⦄ ⊢ T1 ➡ T2 → ⦃G, L1⦄ ⊢ ➡ L2 →
- ⦃G, L2⦄ ⊢ T2 ▪[h, g] l2+1 → ⦃G, L2⦄ ⊢ T2 •[h, g] U2 →
- ⦃G, L1, T1⦄ ≥[h, g] ⦃G, L2, U2⦄.
-/4 width=5 by fpbs_strap1, cpr_lpr_fpbs, ssta_cpx, fpb_cpx/ qed.
+lemma cpr_lpr_sta_fpbs: ∀h,g,G,L1,L2,T1,T2,U2,l2.
+ ⦃G, L1⦄ ⊢ T1 ➡ T2 → ⦃G, L1⦄ ⊢ ➡ L2 →
+ ⦃G, L2⦄ ⊢ T2 ▪[h, g] l2+1 → ⦃G, L2⦄ ⊢ T2 •[h] U2 →
+ ⦃G, L1, T1⦄ ≥[h, g] ⦃G, L2, U2⦄.
+/4 width=5 by fpbs_strap1, cpr_lpr_fpbs, sta_cpx, fpb_cpx/ qed.
(* *)
(**************************************************************************)
-include "basic_2/static/ssta_ssta.ma".
+include "basic_2/static/sta_sta.ma".
include "basic_2/computation/cpxs_lift.ma".
include "basic_2/computation/fpbu.ma".
(* Advanced properties ******************************************************)
-lemma lsstas_fpbu: ∀h,g,G,L,T1,T2,l2. ⦃G, L⦄ ⊢ T1 •*[h, g, l2] T2 → (T1 = T2 → ⊥) →
- ∀l1. l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 → ⦃G, L, T1⦄ ≻[h, g] ⦃G, L, T2⦄.
-/4 width=5 by fpbu_cpxs, lsstas_cpxs/ qed.
+lemma lstas_fpbu: ∀h,g,G,L,T1,T2,l2. ⦃G, L⦄ ⊢ T1 •*[h, l2] T2 → (T1 = T2 → ⊥) →
+ ∀l1. l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 → ⦃G, L, T1⦄ ≻[h, g] ⦃G, L, T2⦄.
+/4 width=5 by fpbu_cpxs, lstas_cpxs/ qed.
-lemma ssta_fpbu: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 →
- ⦃G, L⦄ ⊢ T1 •[h, g] T2 → ⦃G, L, T1⦄ ≻[h, g] ⦃G, L, T2⦄.
+lemma sta_fpbu: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 →
+ ⦃G, L⦄ ⊢ T1 •[h] T2 → ⦃G, L, T1⦄ ≻[h, g] ⦃G, L, T2⦄.
#h #g #G #L #T1 #T2 #l #HT1 #HT12 elim (eq_term_dec T1 T2)
-/3 width=5 by ssta_lsstas, lsstas_fpbu/ #H destruct
-elim (ssta_inv_refl_pos … HT1 … HT12)
+/3 width=5 by sta_lstas, lstas_fpbu/ #H destruct
+elim (sta_inv_refl_pos … HT1 … HT12)
qed.
∀G,L,T. ⦃G, L⦄ ⊢ ⬊*[h, g] T → ∀A. ⦃G, L⦄ ⊢ T ⁝ A → R G L T.
#h #g #R #IH #G #L #T #H @(csx_ind_fpbu … H) -G -L -T
#G1 #L1 #T1 #H1 #IH1 #A1 #HTA1 @IH -IH //
-#G2 #L2 #T2 #H12 elim (aaa_fpbs_conf h g … G2 … L2 … T2 … HTA1) -A1
+#G2 #L2 #T2 #H12 elim (fpbs_aaa_conf h g … G2 … L2 … T2 … HTA1) -A1
/2 width=2 by fpbu_fwd_fpbs/
qed-.
∀G,L,T. ⦃G, L⦄ ⊢ ⬊*[h, g] T → ∀A. ⦃G, L⦄ ⊢ T ⁝ A → R G L T.
#h #g #R #IH #G #L #T #H @(csx_ind_fpbg … H) -G -L -T
#G1 #L1 #T1 #H1 #IH1 #A1 #HTA1 @IH -IH //
-#G2 #L2 #T2 #H12 elim (aaa_fpbs_conf h g … G2 … L2 … T2 … HTA1) -A1
+#G2 #L2 #T2 #H12 elim (fpbs_aaa_conf h g … G2 … L2 … T2 … HTA1) -A1
/2 width=2 by fpbg_fwd_fpbs/
qed-.
(* Properties about atomic arity assignment on terms ************************)
-lemma aaa_lpxs_conf: ∀h,g,G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A →
+lemma lpxs_aaa_conf: ∀h,g,G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A →
∀L2. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 → ⦃G, L2⦄ ⊢ T ⁝ A.
#h #g #G #L1 #T #A #HT #L2 #HL12
-@(TC_Conf3 … (λL,A. ⦃G, L⦄ ⊢ T ⁝ A) … HT ? HL12) /2 width=5 by aaa_lpx_conf/
+@(TC_Conf3 … (λL,A. ⦃G, L⦄ ⊢ T ⁝ A) … HT ? HL12) /2 width=5 by lpx_aaa_conf/
qed-.
-lemma aaa_lprs_conf: ∀G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A →
+lemma lprs_aaa_conf: ∀G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A →
∀L2. ⦃G, L1⦄ ⊢ ➡* L2 → ⦃G, L2⦄ ⊢ T ⁝ A.
-/3 width=5 by lprs_lpxs, aaa_lpxs_conf/ qed-.
+/3 width=5 by lprs_lpxs, lpxs_aaa_conf/ qed-.
∀T1,T2. ⦃G, L2⦄ ⊢ T1 ➡* T2 → ⦃G, L1⦄ ⊢ T1 ➡* T2.
/3 width=6 by lsubsv_fwd_lsubr, lsubr_cprs_trans/
qed-.
+
+(* Note: the constant 0 cannot be generalized *)
+lemma lsubsv_ldrop_O1_conf: ∀h,g,G,L1,L2. G ⊢ L1 ¡⫃[h, g] L2 →
+ ∀K1,s,e. ⇩[s, 0, e] L1 ≡ K1 →
+ ∃∃K2. G ⊢ K1 ¡⫃[h, g] K2 & ⇩[s, 0, e] L2 ≡ K2.
+#h #g #G #L1 #L2 #H elim H -L1 -L2
+[ /2 width=3 by ex2_intro/
+| #I #L1 #L2 #V #_ #IHL12 #K1 #s #e #H
+ elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK1
+ [ destruct
+ elim (IHL12 L1 s 0) -IHL12 // #X #HL12 #H
+ <(ldrop_inv_O2 … H) in HL12; -H /3 width=3 by lsubsv_pair, ldrop_pair, ex2_intro/
+ | elim (IHL12 … HLK1) -L1 /3 width=3 by ldrop_drop_lt, ex2_intro/
+ ]
+| #L1 #L2 #W #V #l #H1W #HV #HVW #H2W #H1l #H2l #_ #IHL12 #K1 #s #e #H
+ elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK1
+ [ destruct
+ elim (IHL12 L1 s 0) -IHL12 // #X #HL12 #H
+ <(ldrop_inv_O2 … H) in HL12; -H /3 width=4 by lsubsv_abbr, ldrop_pair, ex2_intro/
+ | elim (IHL12 … HLK1) -L1 /3 width=3 by ldrop_drop_lt, ex2_intro/
+ ]
+]
+qed-.
+
+(* Note: the constant 0 cannot be generalized *)
+lemma lsubsv_ldrop_O1_trans: ∀h,g,G,L1,L2. G ⊢ L1 ¡⫃[h, g] L2 →
+ ∀K2,s, e. ⇩[s, 0, e] L2 ≡ K2 →
+ ∃∃K1. G ⊢ K1 ¡⫃[h, g] K2 & ⇩[s, 0, e] L1 ≡ K1.
+#h #g #G #L1 #L2 #H elim H -L1 -L2
+[ /2 width=3 by ex2_intro/
+| #I #L1 #L2 #V #_ #IHL12 #K2 #s #e #H
+ elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK2
+ [ destruct
+ elim (IHL12 L2 s 0) -IHL12 // #X #HL12 #H
+ <(ldrop_inv_O2 … H) in HL12; -H /3 width=3 by lsubsv_pair, ldrop_pair, ex2_intro/
+ | elim (IHL12 … HLK2) -L2 /3 width=3 by ldrop_drop_lt, ex2_intro/
+ ]
+| #L1 #L2 #W #V #l #H1W #HV #HVW #H2W #H1l #H2l #_ #IHL12 #K2 #s #e #H
+ elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK2
+ [ destruct
+ elim (IHL12 L2 s 0) -IHL12 // #X #HL12 #H
+ <(ldrop_inv_O2 … H) in HL12; -H /3 width=4 by lsubsv_abbr, ldrop_pair, ex2_intro/
+ | elim (IHL12 … HLK2) -L2 /3 width=3 by ldrop_drop_lt, ex2_intro/
+ ]
+]
+qed-.
(* *)
(**************************************************************************)
-include "basic_2/dynamic/lsubsv_lsstas.ma".
+include "basic_2/dynamic/lsubsv_lstas.ma".
(* LOCAL ENVIRONMENT REFINEMENT FOR STRATIFIED NATIVE VALIDITY **************)
∃∃T. ⦃G, L1⦄ ⊢ T1 •*➡*[h, g] T & ⦃G, L1⦄ ⊢ T2 ➡* T.
#h #g #G #L2 #T1 #T2 * #T #l1 #l2 #Hl21 #Hl1 #HT1 #HT2 #L1 #HL12
lapply (lsubsv_cprs_trans … HL12 … HT2) -HT2 #HT2
-elim (lsubsv_lsstas_trans … HT1 … Hl1 … HL12) // #T0 #HT10 #HT0
+elim (lsubsv_lstas_trans … HT1 … Hl1 … HL12) // #T0 #HT10 #HT0
lapply (lsubsv_fwd_lsubd … HL12) -HL12 #HL12
lapply (lsubd_da_trans … Hl1 … HL12) -L2 #Hl1
lapply (cpcs_cprs_strap1 … HT0 … HT2) -T #HT02
-elim (cpcs_inv_cprs … HT02) -HT02 /3 width=7/
+elim (cpcs_inv_cprs … HT02) -HT02 /3 width=7 by ex2_intro, ex4_3_intro/
qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/dynamic/lsubsv.ma".
-
-(* LOCAL ENVIRONMENT REFINEMENT FOR STRATIFIED NATIVE VALIDITY **************)
-
-(* Properties concerning basic local environment slicing ********************)
-
-(* Note: the constant 0 cannot be generalized *)
-lemma lsubsv_ldrop_O1_conf: ∀h,g,G,L1,L2. G ⊢ L1 ¡⫃[h, g] L2 →
- ∀K1,s,e. ⇩[s, 0, e] L1 ≡ K1 →
- ∃∃K2. G ⊢ K1 ¡⫃[h, g] K2 & ⇩[s, 0, e] L2 ≡ K2.
-#h #g #G #L1 #L2 #H elim H -L1 -L2
-[ /2 width=3 by ex2_intro/
-| #I #L1 #L2 #V #_ #IHL12 #K1 #s #e #H
- elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK1
- [ destruct
- elim (IHL12 L1 s 0) -IHL12 // #X #HL12 #H
- <(ldrop_inv_O2 … H) in HL12; -H /3 width=3 by lsubsv_pair, ldrop_pair, ex2_intro/
- | elim (IHL12 … HLK1) -L1 /3 width=3 by ldrop_drop_lt, ex2_intro/
- ]
-| #L1 #L2 #W #V #l #H1W #HV #HVW #H2W #H1l #H2l #_ #IHL12 #K1 #s #e #H
- elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK1
- [ destruct
- elim (IHL12 L1 s 0) -IHL12 // #X #HL12 #H
- <(ldrop_inv_O2 … H) in HL12; -H /3 width=4 by lsubsv_abbr, ldrop_pair, ex2_intro/
- | elim (IHL12 … HLK1) -L1 /3 width=3 by ldrop_drop_lt, ex2_intro/
- ]
-]
-qed-.
-
-(* Note: the constant 0 cannot be generalized *)
-lemma lsubsv_ldrop_O1_trans: ∀h,g,G,L1,L2. G ⊢ L1 ¡⫃[h, g] L2 →
- ∀K2,s, e. ⇩[s, 0, e] L2 ≡ K2 →
- ∃∃K1. G ⊢ K1 ¡⫃[h, g] K2 & ⇩[s, 0, e] L1 ≡ K1.
-#h #g #G #L1 #L2 #H elim H -L1 -L2
-[ /2 width=3 by ex2_intro/
-| #I #L1 #L2 #V #_ #IHL12 #K2 #s #e #H
- elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK2
- [ destruct
- elim (IHL12 L2 s 0) -IHL12 // #X #HL12 #H
- <(ldrop_inv_O2 … H) in HL12; -H /3 width=3 by lsubsv_pair, ldrop_pair, ex2_intro/
- | elim (IHL12 … HLK2) -L2 /3 width=3 by ldrop_drop_lt, ex2_intro/
- ]
-| #L1 #L2 #W #V #l #H1W #HV #HVW #H2W #H1l #H2l #_ #IHL12 #K2 #s #e #H
- elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK2
- [ destruct
- elim (IHL12 L2 s 0) -IHL12 // #X #HL12 #H
- <(ldrop_inv_O2 … H) in HL12; -H /3 width=4 by lsubsv_abbr, ldrop_pair, ex2_intro/
- | elim (IHL12 … HLK2) -L2 /3 width=3 by ldrop_drop_lt, ex2_intro/
- ]
-]
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/static/lsubd_da.ma".
-include "basic_2/unfold/lsstas_alt.ma".
-include "basic_2/equivalence/cpcs_cpcs.ma".
-include "basic_2/dynamic/lsubsv_ldrop.ma".
-include "basic_2/dynamic/lsubsv_lsubd.ma".
-
-(* LOCAL ENVIRONMENT REFINEMENT FOR STRATIFIED NATIVE VALIDITY **************)
-
-(* Properties on nat-iterated stratified static type assignment *************)
-
-lemma lsubsv_lsstas_trans: ∀h,g,G,L2,T,U2,l1. ⦃G, L2⦄ ⊢ T •*[h, g, l1] U2 →
- ∀l2. l1 ≤ l2 → ⦃G, L2⦄ ⊢ T ▪[h, g] l2 →
- ∀L1. G ⊢ L1 ¡⫃[h, g] L2 →
- ∃∃U1. ⦃G, L1⦄ ⊢ T •*[h, g, l1] U1 & ⦃G, L1⦄ ⊢ U1 ⬌* U2.
-#h #g #G #L2 #T #U #l1 #H @(lsstas_ind_alt … H) -G -L2 -T -U -l1
-[1,2: /2 width=3 by lstar_O, ex2_intro/
-| #G #L2 #K2 #X #Y #U #i #l1 #HLK2 #_ #HYU #IHXY #l2 #Hl12 #Hl2 #L1 #HL12
- elim (da_inv_lref … Hl2) -Hl2 * #K0 #V0 [| #l0 ] #HK0 #HV0
- lapply (ldrop_mono … HK0 … HLK2) -HK0 #H destruct
- elim (lsubsv_ldrop_O1_trans … HL12 … HLK2) -L2 #X #H #HLK1
- elim (lsubsv_inv_pair2 … H) -H * #K1 [ | -HYU -IHXY -HLK1 ]
- [ #HK12 #H destruct
- elim (IHXY … Hl12 HV0 … HK12) -K2 -l2 #T #HXT #HTY
- lapply (ldrop_fwd_drop2 … HLK1) #H
- elim (lift_total T 0 (i+1))
- /3 width=12 by lsstas_ldef, cpcs_lift, ex2_intro/
- | #V #l0 #_ #_ #_ #_ #_ #_ #_ #H destruct
- ]
-| #G #L2 #K2 #X #Y #U #i #l1 #l #HLK2 #_ #_ #HYU #IHXY #l2 #Hl12 #Hl2 #L1 #HL12 -l
- elim (da_inv_lref … Hl2) -Hl2 * #K0 #V0 [| #l0 ] #HK0 #HV0 [| #H1 ]
- lapply (ldrop_mono … HK0 … HLK2) -HK0 #H2 destruct
- lapply (le_plus_to_le_r … Hl12) -Hl12 #Hl12
- elim (lsubsv_ldrop_O1_trans … HL12 … HLK2) -L2 #X #H #HLK1
- elim (lsubsv_inv_pair2 … H) -H * #K1 [| ]
- [ #HK12 #H destruct
- lapply (lsubsv_fwd_lsubd … HK12) #H
- lapply (lsubd_da_trans … HV0 … H) -H
- elim (IHXY … Hl12 HV0 … HK12) -K2 -Hl12 #Y0
- lapply (ldrop_fwd_drop2 … HLK1)
- elim (lift_total Y0 0 (i+1))
- /3 width=12 by lsstas_ldec, cpcs_lift, ex2_intro/
- | #V #l #_ #_ #HVX #_ #HV #HX #HK12 #_ #H destruct
- lapply (da_mono … HX … HV0) -HX #H destruct
- elim (IHXY … Hl12 HV0 … HK12) -K2 #Y0 #HXY0 #HY0
- elim (da_ssta … HV) -HV #W #HVW
- elim (lsstas_total … HVW (l1+1)) -W #W #HVW
- lapply (HVX … Hl12 HVW HXY0) -HVX -Hl12 -HXY0 #HWY0
- lapply (cpcs_trans … HWY0 … HY0) -Y0
- lapply (ldrop_fwd_drop2 … HLK1)
- elim (lift_total W 0 (i+1))
- /4 width=12 by lsstas_ldef, lsstas_cast, cpcs_lift, ex2_intro/
- ]
-| #a #I #G #L2 #V2 #T2 #U2 #l1 #_ #IHTU2 #l2 #Hl12 #Hl2 #L1 #HL12
- lapply (da_inv_bind … Hl2) -Hl2 #Hl2
- elim (IHTU2 … Hl2 (L1.ⓑ{I}V2) …) // [2: /2 width=1/ ] -L2
- /3 width=3 by lsstas_bind, cpcs_bind_dx, ex2_intro/
-| #G #L2 #V2 #T2 #U2 #l1 #_ #IHTU2 #l2 #Hl12 #Hl2 #L1 #HL12
- lapply (da_inv_flat … Hl2) -Hl2 #Hl2
- elim (IHTU2 … Hl2 … HL12) -L2 //
- /3 width=5 by lsstas_appl, cpcs_flat, ex2_intro/
-| #G #L2 #W2 #T2 #U2 #l1 #_ #IHTU2 #l2 #Hl12 #Hl2 #L1 #HL12
- lapply (da_inv_flat … Hl2) -Hl2 #Hl2
- elim (IHTU2 … Hl2 … HL12) -L2 //
- /3 width=3 by lsstas_cast, ex2_intro/
-]
-qed-.
-
-lemma lsubsv_ssta_trans: ∀h,g,G,L2,T,U2. ⦃G, L2⦄ ⊢ T •[h, g] U2 →
- ∀l. ⦃G, L2⦄ ⊢ T ▪[h, g] l+1 →
- ∀L1. G ⊢ L1 ¡⫃[h, g] L2 →
- ∃∃U1. ⦃G, L1⦄ ⊢ T •[h, g] U1 & ⦃G, L1⦄ ⊢ U1 ⬌* U2.
-#h #g #G #L2 #T #U2 #H #l #HTl #L1 #HL12
-elim ( lsubsv_lsstas_trans … U2 1 … HTl … HL12)
-/3 width=3 by lsstas_inv_SO, ssta_lsstas, ex2_intro/
-qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/da_sta.ma".
+include "basic_2/static/lsubd_da.ma".
+include "basic_2/unfold/lstas_alt.ma".
+include "basic_2/equivalence/cpcs_cpcs.ma".
+include "basic_2/dynamic/lsubsv_lsubd.ma".
+
+(* LOCAL ENVIRONMENT REFINEMENT FOR STRATIFIED NATIVE VALIDITY **************)
+
+(* Properties on nat-iterated static type assignment ************************)
+
+lemma lsubsv_lstas_trans: ∀h,g,G,L2,T,U2,l1. ⦃G, L2⦄ ⊢ T •*[h, l1] U2 →
+ ∀l2. l1 ≤ l2 → ⦃G, L2⦄ ⊢ T ▪[h, g] l2 →
+ ∀L1. G ⊢ L1 ¡⫃[h, g] L2 →
+ ∃∃U1. ⦃G, L1⦄ ⊢ T •*[h, l1] U1 & ⦃G, L1⦄ ⊢ U1 ⬌* U2.
+#h #g #G #L2 #T #U #l1 #H @(lstas_ind_alt … H) -G -L2 -T -U -l1
+[1,2: /2 width=3 by ex2_intro/
+| #G #L2 #K2 #X #Y #U #i #l1 #HLK2 #_ #HYU #IHXY #l2 #Hl12 #Hl2 #L1 #HL12
+ elim (da_inv_lref … Hl2) -Hl2 * #K0 #V0 [| #l0 ] #HK0 #HV0
+ lapply (ldrop_mono … HK0 … HLK2) -HK0 #H destruct
+ elim (lsubsv_ldrop_O1_trans … HL12 … HLK2) -L2 #X #H #HLK1
+ elim (lsubsv_inv_pair2 … H) -H * #K1 [ | -HYU -IHXY -HLK1 ]
+ [ #HK12 #H destruct
+ elim (IHXY … Hl12 HV0 … HK12) -K2 -l2 #T #HXT #HTY
+ lapply (ldrop_fwd_drop2 … HLK1) #H
+ elim (lift_total T 0 (i+1))
+ /3 width=12 by lstas_ldef, cpcs_lift, ex2_intro/
+ | #V #l0 #_ #_ #_ #_ #_ #_ #_ #H destruct
+ ]
+| #G #L2 #K2 #X #Y #Y0 #U #i #l1 #HLK2 #HXY0 #_ #HYU #IHXY #l2 #Hl12 #Hl2 #L1 #HL12
+ elim (da_inv_lref … Hl2) -Hl2 * #K0 #V0 [| #l0 ] #HK0 #HV0 [| #H1 ]
+ lapply (ldrop_mono … HK0 … HLK2) -HK0 #H2 destruct
+ lapply (le_plus_to_le_r … Hl12) -Hl12 #Hl12
+ elim (lsubsv_ldrop_O1_trans … HL12 … HLK2) -L2 #X #H #HLK1
+ elim (lsubsv_inv_pair2 … H) -H * #K1
+ [ #HK12 #H destruct
+ lapply (lsubsv_fwd_lsubd … HK12) #H
+ lapply (lsubd_da_trans … HV0 … H) -H #H
+ elim (da_inv_sta … H) -H
+ elim (IHXY … Hl12 HV0 … HK12) -K2 -Hl12 #Y1
+ lapply (ldrop_fwd_drop2 … HLK1)
+ elim (lift_total Y1 0 (i+1))
+ /3 width=12 by lstas_ldec, cpcs_lift, ex2_intro/
+ | #V #l #_ #_ #HVX #_ #HV #HX #HK12 #_ #H destruct
+ lapply (da_mono … HX … HV0) -HX #H destruct
+ elim (IHXY … Hl12 HV0 … HK12) -K2 #Y0 #HXY0 #HY0
+ elim (da_inv_sta … HV) -HV #W #HVW
+ elim (lstas_total … HVW (l1+1)) -W #W #HVW
+ lapply (HVX … Hl12 HVW HXY0) -HVX -Hl12 -HXY0 #HWY0
+ lapply (cpcs_trans … HWY0 … HY0) -Y0
+ lapply (ldrop_fwd_drop2 … HLK1)
+ elim (lift_total W 0 (i+1))
+ /4 width=12 by lstas_ldef, lstas_cast, cpcs_lift, ex2_intro/
+ ]
+| #a #I #G #L2 #V2 #T2 #U2 #l1 #_ #IHTU2 #l2 #Hl12 #Hl2 #L1 #HL12
+ lapply (da_inv_bind … Hl2) -Hl2 #Hl2
+ elim (IHTU2 … Hl2 (L1.ⓑ{I}V2) …)
+ /3 width=3 by lsubsv_pair, lstas_bind, cpcs_bind_dx, ex2_intro/
+| #G #L2 #V2 #T2 #U2 #l1 #_ #IHTU2 #l2 #Hl12 #Hl2 #L1 #HL12
+ lapply (da_inv_flat … Hl2) -Hl2 #Hl2
+ elim (IHTU2 … Hl2 … HL12) -L2
+ /3 width=5 by lstas_appl, cpcs_flat, ex2_intro/
+| #G #L2 #W2 #T2 #U2 #l1 #_ #IHTU2 #l2 #Hl12 #Hl2 #L1 #HL12
+ lapply (da_inv_flat … Hl2) -Hl2 #Hl2
+ elim (IHTU2 … Hl2 … HL12) -L2
+ /3 width=3 by lstas_cast, ex2_intro/
+]
+qed-.
+
+lemma lsubsv_sta_trans: ∀h,g,G,L2,T,U2. ⦃G, L2⦄ ⊢ T •[h] U2 →
+ ∀l. ⦃G, L2⦄ ⊢ T ▪[h, g] l+1 →
+ ∀L1. G ⊢ L1 ¡⫃[h, g] L2 →
+ ∃∃U1. ⦃G, L1⦄ ⊢ T •[h] U1 & ⦃G, L1⦄ ⊢ U1 ⬌* U2.
+#h #g #G #L2 #T #U2 #H #l #HTl #L1 #HL12
+elim (lsubsv_lstas_trans … U2 1 … HTl … HL12)
+/3 width=3 by lstas_inv_SO, sta_lstas, ex2_intro/
+qed-.
/4 width=1 by snv_bind, lsubsv_pair/
| #a #G #L2 #V #W #W0 #T #U #l #_ #_ #HVl #HVW #HW0 #HTU #IHV #IHT #L1 #HL12
lapply (lsubsv_cprs_trans … HL12 … HW0) -HW0 #HW0
- elim (lsubsv_ssta_trans … HVW … HVl … HL12) -HVW #W1 #HVW1 #HW1
+ elim (lsubsv_sta_trans … HVW … HVl … HL12) -HVW #W1 #HVW1 #HW1
lapply (cpcs_cprs_strap1 … HW1 … HW0) -W #HW10
lapply (lsubd_da_trans … HVl L1 ?) -HVl /2 width=1 by lsubsv_fwd_lsubd/ #HVl
elim (lsubsv_cpds_trans … HTU … HL12) -HTU #X #HTU #H
/4 width=11 by snv_appl, cpds_cprs_trans, cprs_bind/
| #G #L2 #W #T #U #l #_ #_ #HTl #HTU #HUW #IHW #IHT #L1 #HL12
lapply (lsubsv_cpcs_trans … HL12 … HUW) -HUW #HUW
- elim (lsubsv_ssta_trans … HTU … HTl … HL12) -HTU #U0 #HTU0 #HU0
+ elim (lsubsv_sta_trans … HTU … HTl … HL12) -HTU #U0 #HTU0 #HU0
lapply (lsubd_da_trans … HTl L1 ?) -HTl
/4 width=5 by lsubsv_fwd_lsubd, snv_cast, cpcs_trans/
]
definition scast: ∀h. sd h → nat → relation4 genv lenv term term ≝
λh,g,l,G,L,V,W. ∀V0,W0,l0.
- l0 ≤ l → ⦃G, L⦄ ⊢ V •*[h, g, l0+1] V0 → ⦃G, L⦄ ⊢ W •*[h, g, l0] W0 → ⦃G, L⦄ ⊢ V0 ⬌* W0.
+ l0 ≤ l → ⦃G, L⦄ ⊢ V •*[h, l0+1] V0 → ⦃G, L⦄ ⊢ W •*[h, l0] W0 → ⦃G, L⦄ ⊢ V0 ⬌* W0.
(* activate genv *)
inductive snv (h:sh) (g:sd h): relation3 genv lenv term ≝
| snv_lref: ∀I,G,L,K,V,i. ⇩[i] L ≡ K.ⓑ{I}V → snv h g G K V → snv h g G L (#i)
| snv_bind: ∀a,I,G,L,V,T. snv h g G L V → snv h g G (L.ⓑ{I}V) T → snv h g G L (ⓑ{a,I}V.T)
| snv_appl: ∀a,G,L,V,W,W0,T,U,l. snv h g G L V → snv h g G L T →
- ⦃G, L⦄ ⊢ V ▪[h, g] l+1 → ⦃G, L⦄ ⊢ V •[h, g] W → ⦃G, L⦄ ⊢ W ➡* W0 →
+ ⦃G, L⦄ ⊢ V ▪[h, g] l+1 → ⦃G, L⦄ ⊢ V •[h] W → ⦃G, L⦄ ⊢ W ➡* W0 →
⦃G, L⦄ ⊢ T •*➡*[h, g] ⓛ{a}W0.U → snv h g G L (ⓐV.T)
| snv_cast: ∀G,L,W,T,U,l. snv h g G L W → snv h g G L T →
- ⦃G, L⦄ ⊢ T ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T •[h, g] U → ⦃G, L⦄ ⊢ U ⬌* W → snv h g G L (ⓝW.T)
+ ⦃G, L⦄ ⊢ T ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T •[h] U → ⦃G, L⦄ ⊢ U ⬌* W → snv h g G L (ⓝW.T)
.
interpretation "stratified native validity (term)"
fact snv_inv_appl_aux: ∀h,g,G,L,X. ⦃G, L⦄ ⊢ X ¡[h, g] → ∀V,T. X = ⓐV.T →
∃∃a,W,W0,U,l. ⦃G, L⦄ ⊢ V ¡[h, g] & ⦃G, L⦄ ⊢ T ¡[h, g] &
- ⦃G, L⦄ ⊢ V ▪[h, g] l+1 & ⦃G, L⦄ ⊢ V •[h, g] W & ⦃G, L⦄ ⊢ W ➡* W0 &
+ ⦃G, L⦄ ⊢ V ▪[h, g] l+1 & ⦃G, L⦄ ⊢ V •[h] W & ⦃G, L⦄ ⊢ W ➡* W0 &
⦃G, L⦄ ⊢ T •*➡*[h, g] ⓛ{a}W0.U.
#h #g #G #L #X * -L -X
[ #G #L #k #V #T #H destruct
lemma snv_inv_appl: ∀h,g,G,L,V,T. ⦃G, L⦄ ⊢ ⓐV.T ¡[h, g] →
∃∃a,W,W0,U,l. ⦃G, L⦄ ⊢ V ¡[h, g] & ⦃G, L⦄ ⊢ T ¡[h, g] &
- ⦃G, L⦄ ⊢ V ▪[h, g] l+1 & ⦃G, L⦄ ⊢ V •[h, g] W & ⦃G, L⦄ ⊢ W ➡* W0 &
+ ⦃G, L⦄ ⊢ V ▪[h, g] l+1 & ⦃G, L⦄ ⊢ V •[h] W & ⦃G, L⦄ ⊢ W ➡* W0 &
⦃G, L⦄ ⊢ T •*➡*[h, g] ⓛ{a}W0.U.
/2 width=3 by snv_inv_appl_aux/ qed-.
fact snv_inv_cast_aux: ∀h,g,G,L,X. ⦃G, L⦄ ⊢ X ¡[h, g] → ∀W,T. X = ⓝW.T →
∃∃U,l. ⦃G, L⦄ ⊢ W ¡[h, g] & ⦃G, L⦄ ⊢ T ¡[h, g] &
- ⦃G, L⦄ ⊢ T ▪[h, g] l+1 & ⦃G, L⦄ ⊢ T •[h, g] U & ⦃G, L⦄ ⊢ U ⬌* W.
+ ⦃G, L⦄ ⊢ T ▪[h, g] l+1 & ⦃G, L⦄ ⊢ T •[h] U & ⦃G, L⦄ ⊢ U ⬌* W.
#h #g #G #L #X * -G -L -X
[ #G #L #k #W #T #H destruct
| #I #G #L #K #V #i #_ #_ #W #T #H destruct
lemma snv_inv_cast: ∀h,g,G,L,W,T. ⦃G, L⦄ ⊢ ⓝW.T ¡[h, g] →
∃∃U,l. ⦃G, L⦄ ⊢ W ¡[h, g] & ⦃G, L⦄ ⊢ T ¡[h, g] &
- ⦃G, L⦄ ⊢ T ▪[h, g] l+1 & ⦃G, L⦄ ⊢ T •[h, g] U & ⦃G, L⦄ ⊢ U ⬌* W.
+ ⦃G, L⦄ ⊢ T ▪[h, g] l+1 & ⦃G, L⦄ ⊢ T •[h] U & ⦃G, L⦄ ⊢ U ⬌* W.
/2 width=3 by snv_inv_cast_aux/ qed-.
(* *)
(**************************************************************************)
+include "basic_2/static/da_aaa.ma".
+include "basic_2/unfold/lstas_lift.ma".
include "basic_2/computation/csx_aaa.ma".
include "basic_2/computation/cpds_aaa.ma".
include "basic_2/equivalence/cpcs_aaa.ma".
lemma snv_fwd_aaa: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] → ∃A. ⦃G, L⦄ ⊢ T ⁝ A.
#h #g #G #L #T #H elim H -G -L -T
-[ /2 width=2/
-| #I #G #L #K #V #i #HLK #_ * /3 width=6/
-| #a * #G #L #V #T #_ #_ * #B #HV * #A #HA /3 width=2/
+[ /2 width=2 by aaa_sort, ex_intro/
+| #I #G #L #K #V #i #HLK #_ * /3 width=6 by aaa_lref, ex_intro/
+| #a * #G #L #V #T #_ #_ * #B #HV * #A #HA /3 width=2 by aaa_abbr, aaa_abst, ex_intro/
| #a #G #L #V #W #W0 #T #U #l #_ #_ #Hl #HVW #HW0 #HTU * #B #HV * #X #HT
- lapply (aaa_cpds_conf h g … HV W0 ?) [ -HTU /3 width=4/ ] -W #HW0 (**) (* auto fail without -HTU *)
- lapply (aaa_cpds_conf … HT … HTU) -HTU #H
+ lapply (cpds_aaa_conf h g … HV W0 ?) [ -HTU /3 width=4 by cpds_strap1, sta_cprs_cpds/ ] -W #HW0 (**) (* auto fail without -HTU *)
+ lapply (cpds_aaa_conf … HT … HTU) -HTU #H
elim (aaa_inv_abst … H) -H #B0 #A #H1 #HU #H2 destruct
- lapply (aaa_mono … H1 … HW0) -W0 #H destruct /3 width=4/
+ lapply (aaa_mono … H1 … HW0) -W0 #H destruct /3 width=4 by aaa_appl, ex_intro/
| #G #L #W #T #U #l #_ #_ #_ #HTU #HUW * #B #HW * #A #HT
- lapply (aaa_ssta_conf … HT … HTU) -HTU #H
- lapply (aaa_cpcs_mono … HUW … H … HW) -HUW -H #H destruct /3 width=3/
+ lapply (sta_aaa_conf … HT … HTU) -HTU #H
+ lapply (cpcs_aaa_mono … HUW … H … HW) -HUW -H #H destruct /3 width=3 by aaa_cast, ex_intro/
]
qed-.
lemma snv_fwd_csx: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] → ⦃G, L⦄ ⊢ ⬊*[h, g] T.
-#h #g #G #L #T #H elim (snv_fwd_aaa … H) -H /2 width=2/
+#h #g #G #L #T #H elim (snv_fwd_aaa … H) -H /2 width=2 by aaa_csx/
qed-.
(* Advanced forward lemmas **************************************************)
lemma snv_fwd_da: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] → ∃l. ⦃G, L⦄ ⊢ T ▪[h, g] l.
-#h #g #G #L #T #H elim (snv_fwd_aaa … H) -H /2 width=2 by aaa_fwd_da/
+#h #g #G #L #T #H elim (snv_fwd_aaa … H) -H /2 width=2 by aaa_da/
qed-.
-lemma snv_fwd_ssta: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] → ∃U. ⦃G, L⦄ ⊢ T •[h, g] U.
-#h #g #G #L #T #H elim (snv_fwd_aaa … H) -H /2 width=2 by aaa_fwd_ssta/
+lemma snv_fwd_sta: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] → ∃U. ⦃G, L⦄ ⊢ T •[h] U.
+#h #g #G #L #T #H elim (snv_fwd_aaa … H) -H /2 width=2 by aaa_sta/
qed-.
-lemma snv_lsstas_fwd_correct: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ¡[h, g] → ⦃G, L⦄ ⊢ T1 •* [h, g, l] T2 →
- ∃U2. ⦃G, L⦄ ⊢ T2 •[h, g] U2.
+lemma snv_lstas_fwd_correct: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ¡[h, g] → ⦃G, L⦄ ⊢ T1 •* [h, l] T2 →
+ ∃U2. ⦃G, L⦄ ⊢ T2 •[h] U2.
#h #g #G #L #T1 #T2 #l #HT1 #HT12
-elim (snv_fwd_ssta … HT1) -HT1 /2 width=5 by lsstas_fwd_correct/
+elim (snv_fwd_sta … HT1) -HT1 /2 width=5 by lstas_fwd_correct/
qed-.
(* Advanced properties ******************************************************)
lemma snv_scast: ∀h,g,G,L,V,W,l. ⦃G, L⦄ ⊢ V ¡[h, g] → ⦃G, L⦄ ⊢ W ¡[h, g] →
scast h g l G L V W → ⦃G, L⦄ ⊢V ▪[h, g] l+1 → ⦃G, L⦄ ⊢ ⓝW.V ¡[h, g].
#h #g #G #L #V #W #l #HV #HW #H #Hl
-elim (snv_fwd_ssta … HV) /4 width=6 by snv_cast, ssta_lsstas/
+elim (snv_fwd_sta … HV) /4 width=6 by snv_cast, sta_lstas/
qed-.
(* *)
(**************************************************************************)
-include "basic_2/unfold/lsstas_lsstas.ma".
+include "basic_2/unfold/lstas_lstas.ma".
include "basic_2/computation/fpbs_lift.ma".
include "basic_2/computation/fpbg_fleq.ma".
include "basic_2/equivalence/cpes_cpds.ma".
∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
⦃G, L2⦄ ⊢ T2 ▪[h, g] l.
-definition IH_lsstas_cpr_lpr: ∀h:sh. sd h → relation3 genv lenv term ≝
- λh,g,G,L1,T1. ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
- ∀l1,l2. l2 ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 →
- ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, g, l2] U1 →
- ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
- ∃∃U2. ⦃G, L2⦄ ⊢ T2 •*[h, g, l2] U2 & ⦃G, L2⦄ ⊢ U1 ⬌* U2.
+definition IH_lstas_cpr_lpr: ∀h:sh. sd h → relation3 genv lenv term ≝
+ λh,g,G,L1,T1. ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀l1,l2. l2 ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 →
+ ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, l2] U1 →
+ ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
+ ∃∃U2. ⦃G, L2⦄ ⊢ T2 •*[h, l2] U2 & ⦃G, L2⦄ ⊢ U1 ⬌* U2.
-definition IH_snv_lsstas: ∀h:sh. sd h → relation3 genv lenv term ≝
- λh,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] →
- ∀l1,l2. l2 ≤ l1 → ⦃G, L⦄ ⊢ T ▪[h, g] l1 →
- ∀U. ⦃G, L⦄ ⊢ T •*[h, g, l2] U → ⦃G, L⦄ ⊢ U ¡[h, g].
+definition IH_snv_lstas: ∀h:sh. sd h → relation3 genv lenv term ≝
+ λh,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] →
+ ∀l1,l2. l2 ≤ l1 → ⦃G, L⦄ ⊢ T ▪[h, g] l1 →
+ ∀U. ⦃G, L⦄ ⊢ T •*[h, l2] U → ⦃G, L⦄ ⊢ U ¡[h, g].
(* Properties for the preservation results **********************************)
elim (cpcs_inv_cprs … H) -H /4 width=18 by da_cprs_lpr_aux, da_mono/
qed-.
-fact ssta_cpr_lpr_aux: ∀h,g,G0,L0,T0.
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lsstas_cpr_lpr h g G1 L1 T1) →
- ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
- ∀l. ⦃G, L1⦄ ⊢ T1 ▪[h, g] l+1 →
- ∀U1. ⦃G, L1⦄ ⊢ T1 •[h, g] U1 →
- ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
- ∃∃U2. ⦃G, L2⦄ ⊢ T2 •[h, g] U2 & ⦃G, L2⦄ ⊢ U1 ⬌* U2.
+fact sta_cpr_lpr_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) →
+ ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀l. ⦃G, L1⦄ ⊢ T1 ▪[h, g] l+1 →
+ ∀U1. ⦃G, L1⦄ ⊢ T1 •[h] U1 →
+ ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
+ ∃∃U2. ⦃G, L2⦄ ⊢ T2 •[h] U2 & ⦃G, L2⦄ ⊢ U1 ⬌* U2.
#h #g #G0 #L0 #T0 #IH #G #L1 #T1 #H01 #HT1 #l #Hl #U1 #HTU1 #T2 #HT12 #L2 #HL12
elim (IH … H01 … 1 … Hl U1 … HT12 … HL12) -H01 -Hl -HT12 -HL12
-/3 width=3 by lsstas_inv_SO, ssta_lsstas, ex2_intro/
+/3 width=3 by lstas_inv_SO, sta_lstas, ex2_intro/
qed-.
-fact lsstas_cprs_lpr_aux: ∀h,g,G0,L0,T0.
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lsstas_cpr_lpr h g G1 L1 T1) →
- ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
- ∀l1,l2. l2 ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 →
- ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, g, l2] U1 →
- ∀T2. ⦃G, L1⦄ ⊢ T1 ➡* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
- ∃∃U2. ⦃G, L2⦄ ⊢ T2 •*[h, g, l2] U2 & ⦃G, L2⦄ ⊢ U1 ⬌* U2.
+fact lstas_cprs_lpr_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) →
+ ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀l1,l2. l2 ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 →
+ ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, l2] U1 →
+ ∀T2. ⦃G, L1⦄ ⊢ T1 ➡* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
+ ∃∃U2. ⦃G, L2⦄ ⊢ T2 •*[h, l2] U2 & ⦃G, L2⦄ ⊢ U1 ⬌* U2.
#h #g #G0 #L0 #T0 #IH3 #IH2 #IH1 #G #L1 #T1 #H01 #HT1 #l1 #l2 #Hl21 #Hl1 #U1 #HTU1 #T2 #H
@(cprs_ind … H) -T2 [ /2 width=10 by/ ]
#T #T2 #HT1T #HTT2 #IHT1 #L2 #HL12
/4 width=5 by lpr_cpcs_conf, cpcs_trans, ex2_intro/
qed-.
-fact lsstas_cpcs_lpr_aux: ∀h,g,G0,L0,T0.
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lsstas_cpr_lpr h g G1 L1 T1) →
- ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
- ∀l,l1. l ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 → ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, g, l] U1 →
- ∀T2. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T2⦄ → ⦃G, L1⦄ ⊢ T2 ¡[h, g] →
- ∀l2. l ≤ l2 → ⦃G, L1⦄ ⊢ T2 ▪[h, g] l2 → ∀U2. ⦃G, L1⦄ ⊢ T2 •*[h, g, l] U2 →
- ⦃G, L1⦄ ⊢ T1 ⬌* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ U1 ⬌* U2.
+fact lstas_cpcs_lpr_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) →
+ ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀l,l1. l ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 → ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, l] U1 →
+ ∀T2. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T2⦄ → ⦃G, L1⦄ ⊢ T2 ¡[h, g] →
+ ∀l2. l ≤ l2 → ⦃G, L1⦄ ⊢ T2 ▪[h, g] l2 → ∀U2. ⦃G, L1⦄ ⊢ T2 •*[h, l] U2 →
+ ⦃G, L1⦄ ⊢ T1 ⬌* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ U1 ⬌* U2.
#h #g #G0 #L0 #T0 #IH3 #IH2 #IH1 #G #L1 #T1 #H01 #HT1 #l #l1 #Hl1 #HTl1 #U1 #HTU1 #T2 #H02 #HT2 #l2 #Hl2 #HTl2 #U2 #HTU2 #H #L2 #HL12
elim (cpcs_inv_cprs … H) -H #T #H1 #H2
-elim (lsstas_cprs_lpr_aux … H01 HT1 … Hl1 HTl1 … HTU1 … H1 … HL12) -T1 /2 width=1 by/ #W1 #H1 #HUW1
-elim (lsstas_cprs_lpr_aux … H02 HT2 … Hl2 HTl2 … HTU2 … H2 … HL12) -T2 /2 width=1 by/ #W2 #H2 #HUW2 -L0 -T0
-lapply (lsstas_mono … H1 … H2) -h -T -l #H destruct /2 width=3 by cpcs_canc_dx/
+elim (lstas_cprs_lpr_aux … H01 HT1 … Hl1 HTl1 … HTU1 … H1 … HL12) -T1 /2 width=1 by/ #W1 #H1 #HUW1
+elim (lstas_cprs_lpr_aux … H02 HT2 … Hl2 HTl2 … HTU2 … H2 … HL12) -T2 /2 width=1 by/ #W2 #H2 #HUW2 -L0 -T0
+lapply (lstas_mono … H1 … H2) -h -T -l #H destruct /2 width=3 by cpcs_canc_dx/
qed-.
-fact snv_ssta_aux: ∀h,g,G0,L0,T0.
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lsstas h g G1 L1 T1) →
- ∀G,L,T. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L, T⦄ → ⦃G, L⦄ ⊢ T ¡[h, g] →
- ∀l. ⦃G, L⦄ ⊢ T ▪[h, g] l+1 →
- ∀U. ⦃G, L⦄ ⊢ T •[h, g] U → ⦃G, L⦄ ⊢ U ¡[h, g].
-/3 width=8 by lsstas_inv_SO, ssta_lsstas/ qed-.
-
-fact lsstas_cpds_aux: ∀h,g,G0,L0,T0.
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lsstas h g G1 L1 T1) →
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lsstas_cpr_lpr h g G1 L1 T1) →
- ∀G,L,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L, T1⦄ → ⦃G, L⦄ ⊢ T1 ¡[h, g] →
- ∀l1,l2. l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 →
- ∀U1. ⦃G, L⦄ ⊢ T1 •*[h, g, l2] U1 → ∀T2. ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2 →
- ∃∃U2,l. l ≤ l2 & ⦃G, L⦄ ⊢ T2 •*[h, g, l] U2 & ⦃G, L⦄ ⊢ U1 •*⬌*[h, g] U2.
+fact snv_sta_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lstas h g G1 L1 T1) →
+ ∀G,L,T. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L, T⦄ → ⦃G, L⦄ ⊢ T ¡[h, g] →
+ ∀l. ⦃G, L⦄ ⊢ T ▪[h, g] l+1 →
+ ∀U. ⦃G, L⦄ ⊢ T •[h] U → ⦃G, L⦄ ⊢ U ¡[h, g].
+/3 width=8 by lstas_inv_SO, sta_lstas/ qed-.
+
+fact lstas_cpds_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lstas h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) →
+ ∀G,L,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L, T1⦄ → ⦃G, L⦄ ⊢ T1 ¡[h, g] →
+ ∀l1,l2. l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 →
+ ∀U1. ⦃G, L⦄ ⊢ T1 •*[h, l2] U1 → ∀T2. ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2 →
+ ∃∃U2,l. l ≤ l2 & ⦃G, L⦄ ⊢ T2 •*[h, l] U2 & ⦃G, L⦄ ⊢ U1 •*⬌*[h, g] U2.
#h #g #G0 #L0 #T0 #IH4 #IH3 #IH2 #IH1 #G #L #T1 #H01 #HT1 #l1 #l2 #Hl21 #Hl1 #U1 #HTU1 #T2 * #T #l0 #l #Hl0 #H #HT1T #HTT2
lapply (da_mono … H … Hl1) -H #H destruct
-lapply (lsstas_da_conf … HTU1 … Hl1) #Hl12
+lapply (lstas_da_conf … HTU1 … Hl1) #Hl12
elim (le_or_ge l2 l) #Hl2
-[ lapply (lsstas_conf_le … HTU1 … HT1T) -HT1T
+[ lapply (lstas_conf_le … HTU1 … HT1T) -HT1T
/5 width=11 by cpds_cpes_dx, monotonic_le_minus_l, ex3_2_intro, ex4_3_intro/
-| lapply (lsstas_da_conf … HT1T … Hl1) #Hl1l
- lapply (lsstas_conf_le … HT1T … HTU1) -HTU1 // #HTU1
- elim (lsstas_cprs_lpr_aux … IH3 IH2 IH1 … Hl1l … HTU1 … HTT2 L) -IH3 -IH2 -IH1 -Hl1l -HTU1 -HTT2
- /3 width=8 by cpcs_cpes, fpbg_fpbs_trans, lsstas_fpbs, monotonic_le_minus_l, ex3_2_intro/
+| lapply (lstas_da_conf … HT1T … Hl1) #Hl1l
+ lapply (lstas_conf_le … HT1T … HTU1) -HTU1 // #HTU1
+ elim (lstas_cprs_lpr_aux … IH3 IH2 IH1 … Hl1l … HTU1 … HTT2 L) -IH3 -IH2 -IH1 -Hl1l -HTU1 -HTT2
+ /3 width=8 by cpcs_cpes, fpbg_fpbs_trans, lstas_fpbs, monotonic_le_minus_l, ex3_2_intro/
]
qed-.
fact cpds_cpr_lpr_aux: ∀h,g,G0,L0,T0.
(∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lsstas_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) →
∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
∀U1. ⦃G, L1⦄ ⊢ T1 •*➡*[h, g] U1 →
∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
(* Properties on degree assignment for terms ********************************)
fact da_cpr_lpr_aux: ∀h,g,G0,L0,T0.
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lsstas h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lstas h g G1 L1 T1) →
(∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
(∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_da_cpr_lpr h g G1 L1 T1.
lapply (da_inv_bind … Hl) -Hl #Hl
elim (cpds_inv_abst1 … HT10) -HT10 #W3 #U3 #HW3 #_ #H destruct -U3
lapply (cprs_div … HW3 … HW10) -W3 #HWW1
- lapply (ssta_da_conf … HVW1 … Hl0) <minus_plus_m_m #H
+ lapply (da_sta_conf … HVW1 … Hl0) <minus_plus_m_m #H
elim (snv_fwd_da … HW) #l1 #Hl1
- lapply (IH3 … HV1 … 1 … Hl0 W1 ?) /2 width=2 by fqup_fpbg, ssta_lsstas/ #HW1
+ lapply (IH3 … HV1 … 1 … Hl0 W1 ?) /2 width=2 by fqup_fpbg, sta_lstas/ #HW1
lapply (da_cpcs_aux … IH2 IH1 … Hl1 … H … HWW1) -H
- /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, ssta_fpbs/ #H destruct
+ /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, sta_fpbs/ #H destruct
lapply (IH1 … HV1 … Hl0 … HV12 … HL12) -HV1 -Hl0 -HV12 [ /2 by fqup_fpbg/ ] #Hl0
lapply (IH1 … Hl1 … HW2 … HL12) -Hl1 // /2 width=1 by fqup_fpbg/ -HW
lapply (IH1 … HU1 … Hl … HU12 (L2.ⓛW2) ?) -IH1 -HU1 -Hl -HU12 [1,2: /2 by fqup_fpbg, lpr_pair/ ] -HL12 -HW2
elim (lift_total V1 d e) #W1 #HVW1
elim (lift_total T1 (d+1) e) #U1 #HTU1
@(snv_appl … a … W0 … W1 … U1 l)
- [1,2,3,4,5: /2 width=10 by cprs_lift, ssta_lift, da_lift/ ]
+ [1,2,3,4,5: /2 width=10 by cprs_lift, sta_lift, da_lift/ ]
@(cpds_lift … HT1 … HLK … HTU) /2 width=1 by lift_bind/ (**) (* full auto raises typecjhecker failure *)
| #G #K #V0 #T #V #l #_ #_ #Hl #HTV #HV0 #IHV0 #IHT #L #s #d #e #HLK #X #H
elim (lift_inv_flat1 … H) -H #W0 #U #HVW0 #HTU #H destruct
elim (lift_total V d e)
- /3 width=12 by snv_cast, cpcs_lift, ssta_lift, da_lift/
+ /3 width=12 by snv_cast, cpcs_lift, sta_lift, da_lift/
]
qed.
| #a #G #L #W #W0 #W1 #U #U1 #l #_ #_ #Hl #HW0 #HW01 #HU1 #IHW #IHU #K #s #d #e #HLK #X #H
elim (lift_inv_flat2 … H) -H #V #T #HVW #HTU #H destruct
lapply (da_inv_lift … Hl … HLK … HVW) -Hl #Hl
- elim (ssta_inv_lift1 … HW0 … HLK … HVW) -HW0 #V0 #HVW0 #HV0
+ elim (sta_inv_lift1 … HW0 … HLK … HVW) -HW0 #V0 #HVW0 #HV0
elim (cprs_inv_lift1 … HW01 … HLK … HVW0) -W0 #V1 #HVW1 #HV01
elim (cpds_inv_lift1 … HU1 … HLK … HTU) -HU1 #X #H #HTU
elim (lift_inv_bind2 … H) -H #Y #T1 #HY #HTU1 #H destruct
| #G #L #W0 #U #W #l #_ #_ #Hl #HUW #HW0 #IHW0 #IHU #K #s #d #e #HLK #X #H
elim (lift_inv_flat2 … H) -H #V0 #T #HVW0 #HTU #H destruct
lapply (da_inv_lift … Hl … HLK … HTU) -Hl #Hl
- elim (ssta_inv_lift1 … HUW … HLK … HTU) -HUW #V #HVW #HTV
+ elim (sta_inv_lift1 … HUW … HLK … HTU) -HUW #V #HVW #HTV
lapply (cpcs_inv_lift G … HLK … HVW … HVW0 ?) // -W
/3 width=8 by snv_cast/
]
(* Properties on context-free parallel reduction for local environments *****)
fact snv_cpr_lpr_aux: ∀h,g,G0,L0,T0.
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lsstas h g G1 L1 T1) →
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lsstas_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lstas h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) →
(∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
(∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_snv_cpr_lpr h g G1 L1 T1.
lapply (IH1 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #HV2
lapply (IH1 … HT12 … HL12) /2 width=1 by fqup_fpbg/ #HT2
lapply (IH2 … Hl0 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #H2l0
- elim (ssta_cpr_lpr_aux … IH3 … Hl0 … HVW1 … HV12 … HL12) -Hl0 -HVW1 -HV12 /2 width=1 by fqup_fpbg/ -HV1 #W2 #HVW2 #HW12
+ elim (sta_cpr_lpr_aux … IH3 … Hl0 … HVW1 … HV12 … HL12) -Hl0 -HVW1 -HV12 /2 width=1 by fqup_fpbg/ -HV1 #W2 #HVW2 #HW12
elim (cpds_cpr_lpr_aux … IH2 IH3 … HTU1 … HT12 … HL12) /2 width=1 by fqup_fpbg/ -HT12 -HTU1 #X #HTU2 #H
elim (cprs_inv_abst1 … H) -H #W20 #U2 #HW120 #_ #H destruct
lapply (lpr_cprs_conf … HL12 … HW10) -L1 #HW10
elim (snv_inv_bind … HT1) -HT1 #HW20 #HT20
elim (cpds_inv_abst1 … HTU1) -HTU1 #W30 #T30 #HW230 #_ #H destruct -T30
lapply (cprs_div … HW10 … HW230) -W30 #HW120
- lapply (snv_ssta_aux … IH4 … Hl0 … HVW1) /2 width=1 by fqup_fpbg/ #HW10
- lapply (ssta_da_conf … HVW1 … Hl0) <minus_plus_m_m #HlW10
+ lapply (snv_sta_aux … IH4 … Hl0 … HVW1) /2 width=1 by fqup_fpbg/ #HW10
+ lapply (da_sta_conf … HVW1 … Hl0) <minus_plus_m_m #HlW10
elim (snv_fwd_da … HW20) #l #Hl
lapply (da_cpcs_aux … IH1 IH2 … HlW10 … Hl … HW120) // -HlW10
- /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, ssta_fpbs/ #H destruct
+ /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, sta_fpbs/ #H destruct
lapply (IH2 … Hl0 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #HlV2
lapply (IH2 … Hl … HW202 … HL12) /2 width=1 by fqup_fpbg/ #HlW2
- elim (ssta_cpr_lpr_aux … IH3 … Hl0 … HVW1 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #W3 #HV2W3 #HW103
- lapply (ssta_da_conf … HV2W3 … HlV2) <minus_plus_m_m #HlW3
+ elim (sta_cpr_lpr_aux … IH3 … Hl0 … HVW1 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #W3 #HV2W3 #HW103
+ lapply (da_sta_conf … HV2W3 … HlV2) <minus_plus_m_m #HlW3
lapply (cpcs_cpr_strap1 … HW120 … HW202) -HW120 #HW102
lapply (lpr_cpcs_conf … HL12 … HW102) -HW102 #HW102
lapply (cpcs_canc_sn … HW103 … HW102) -W10 #HW32
lapply (IH1 … HV12 … HL12) /2 width=1 by fqup_fpbg/ -HV1 #HV2
lapply (IH1 … HW202 … HL12) /2 width=1 by fqup_fpbg/ -HW20 #HW2
lapply (IH1 … HT20 … HT202 … (L2.ⓛW2) ?) /2 width=1 by fqup_fpbg, lpr_pair/ -HT20 #HT2
- lapply (snv_ssta_aux … IH4 … HlV2 … HV2W3)
+ lapply (snv_sta_aux … IH4 … HlV2 … HV2W3)
/3 width=5 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_fpbs/ #HW3
lapply (lsubsv_snv_trans … HT2 (L2.ⓓⓝW2.V2) ?) -HT2 /3 width=3 by snv_bind, snv_cast/
@(lsubsv_abbr … l) /3 width=7 by fqup_fpbg/ #W #W0 #l0 #Hl0 #HV2W #HW20
- lapply (lsstas_ssta_conf_pos … HV2W3 … HV2W) -HV2W #HW3W
- @(lsstas_cpcs_lpr_aux … IH1 IH2 IH3 … HlW3 … HW3W … HlW2 … HW20 … HW32) //
- [ /3 width=9 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_ssta_fpbs/
+ lapply (lstas_sta_conf_pos … HV2W3 … HV2W) -HV2W #HW3W
+ @(lstas_cpcs_lpr_aux … IH1 IH2 IH3 … HlW3 … HW3W … HlW2 … HW20 … HW32) //
+ [ /3 width=9 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_sta_fpbs/
| /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_fpbs/
]
| #b #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HV02 #HW02 #HT02 #H1 #H2 destruct -IH4
lapply (lpr_cprs_conf … HL12 … HW10) -HW10 #HW10
elim (cpds_cpr_lpr_aux … IH2 IH3 … HTU0 … HT02 (L2.ⓓW2)) /2 width=1 by fqup_fpbg, lpr_pair/ -HTU0 #X #HTU2 #H
elim (cprs_inv_abst1 … H) -H #W #U2 #HW1 #_ #H destruct -U3
- elim (ssta_cpr_lpr_aux … IH3 … HVW1 … HV10 … HL12) /2 width=2 by fqup_fpbg/ -IH3 -HVW1 #X #H1 #H2
+ elim (sta_cpr_lpr_aux … IH3 … HVW1 … HV10 … HL12) /2 width=2 by fqup_fpbg/ -IH3 -HVW1 #X #H1 #H2
lapply (cpcs_canc_sn … H2 HW10) -W10 #H2
elim (lift_total X 0 1) #W20 #H3
- lapply (ssta_lift … H1 (L2.ⓓW2) … HV02 … H3) /2 width=2 by ldrop_drop/ -H1 #HVW20
+ lapply (sta_lift … H1 (L2.ⓓW2) … HV02 … H3) /2 width=2 by ldrop_drop/ -H1 #HVW20
lapply (cpcs_lift … (L2.ⓓW2) … H3 … HW13 H2) /2 width=2 by ldrop_drop/ -HW13 -H3 -H2 #HW320
lapply (cpcs_cprs_strap1 … HW320 … HW1) -W3 #HW20
elim (cpcs_inv_cprs … HW20) -HW20 #W3 #HW203 #HW3
lapply (cpcs_cprs_strap1 … HUW1 W2 ?) /2 width=1 by cpr_cprs/ -HUW1 #H1
lapply (IH1 … HW12 … HL12) /2 width=1 by fqup_fpbg/ -HW1 -HW12 #HW2
lapply (IH1 … HT12 … HL12) /2 width=1 by fqup_fpbg/ -IH1 #HT2
- elim (ssta_cpr_lpr_aux … IH3 … Hl0 … HTU1 … HT12 … HL12) /2 width=2 by fqup_fpbg/ -IH3 -HTU1 #U2 #HTU2 #HU12
+ elim (sta_cpr_lpr_aux … IH3 … Hl0 … HTU1 … HT12 … HL12) /2 width=2 by fqup_fpbg/ -IH3 -HTU1 #U2 #HTU2 #HU12
lapply (IH2 … Hl0 … HT12 … HL12) /2 width=1 by fqup_fpbg/ -IH2 -HT1 -HT12 -Hl0 #Hl0
/4 width=7 by snv_cast, lpr_cpcs_conf, cpcs_canc_sn/
| #H -IH3 -IH2 -HW1 -HTU1 -HUW1
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/dynamic/snv_lift.ma".
-include "basic_2/dynamic/snv_cpcs.ma".
-
-(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
-
-(* Properties on nat-iterated stratified static type assignment for terms ***)
-
-fact snv_lsstas_aux: ∀h,g,G0,L0,T0.
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lsstas_cpr_lpr h g G1 L1 T1) →
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lsstas h g G1 L1 T1) →
- ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_snv_lsstas h g G1 L1 T1.
-#h #g #G0 #L0 #T0 #IH4 #IH3 #IH2 #IH1 #G1 #L1 * * [|||| * ]
-[ #k #HG0 #HL0 #HT0 #_ #l1 #l2 #Hl21 #Hl1 #X #H2 destruct -IH4 -IH3 -IH2 -IH1
- >(lsstas_inv_sort1 … H2) -X //
-| #i #HG0 #HL0 #HT0 #H1 #l1 #l2 @(nat_ind_plus … l2) -l2 [ #_ | #l2 #_ #Hl21 ] #Hl1 #X #H2 destruct -IH4 -IH3 -IH2
- [ lapply (lsstas_inv_O … H2) -H2 #H destruct // ]
- elim (snv_inv_lref … H1) -H1 #I0 #K0 #X0 #HLK0 #HX0
- elim (da_inv_lref … Hl1) -Hl1 * #K1 [ #V1 | #W1 #l ] #HLK1 [ #Hl1 | #Hl #H ]
- lapply (ldrop_mono … HLK0 … HLK1) -HLK0 #H0 destruct
- elim (lsstas_inv_lref1 … H2) -H2 * #K0 #Y0 #X0 [2,4: #l0 ] #HLK0 [1,2: #HYl0 ] #HYX0 #HX0
- lapply (ldrop_mono … HLK0 … HLK1) -HLK0 #H destruct
- [ lapply (le_plus_to_le_r … Hl21) -Hl21 #Hl21 ]
- lapply (fqup_lref … G1 … HLK1) #H
- lapply (ldrop_fwd_drop2 … HLK1) -HLK1 /4 width=8 by fqup_fpbg, snv_lift/
-| #p #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X #H2 destruct -IH4 -IH3 -IH2 -IH1
- elim (snv_inv_gref … H1)
-| #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X #H2 destruct -IH4 -IH3 -IH2
- elim (snv_inv_bind … H1) -H1 #HV1 #HT1
- lapply (da_inv_bind … Hl1) -Hl1 #Hl1
- elim (lsstas_inv_bind1 … H2) -H2 #U1 #HTU1 #H destruct /4 width=8 by fqup_fpbg, snv_bind/
-| #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X #H2 destruct
- elim (snv_inv_appl … H1) -H1 #a #W1 #W0 #T0 #l0 #HV1 #HT1 #Hl0 #HVW1 #HW10 #HT10
- lapply (da_inv_flat … Hl1) -Hl1 #Hl1
- elim (lsstas_inv_appl1 … H2) -H2 #U1 #HTU1 #H destruct
- lapply (IH1 … HT1 … Hl1 … HTU1) /2 width=1 by fqup_fpbg/ #HU1
- elim (lsstas_cpds_aux … IH1 IH4 IH3 IH2 … Hl1 … HTU1 … HT10) -IH4 -IH3 -IH2 -IH1 /2 width=1 by fqup_fpbg/ -T1 -l1 #X #l #_ #H #HU10 -l2
- elim (lsstas_inv_bind1 … H) -H #U0 #_ #H destruct -T0 -l
- elim (cpes_inv_abst2 … HU10) -HU10 #W2 #U2 #HU12 #HU02
- elim (cprs_inv_abst … HU02) -HU02 #HW02 #_
- /3 width=7 by snv_appl, cprs_trans/
-| #W1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 @(nat_ind_plus … l2) -l2 [ #_ | #l2 #_ #Hl21 ] #Hl1 #X #H2 destruct -IH4 -IH3 -IH2
- [ lapply (lsstas_inv_O … H2) -H2 #H destruct // ]
- elim (snv_inv_cast … H1) -H1
- lapply (da_inv_flat … Hl1) -Hl1
- lapply (lsstas_inv_cast1 … H2) -H2 /3 width=8 by fqup_fpbg/
-]
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/computation/cpds_cpds.ma".
-include "basic_2/dynamic/snv_aaa.ma".
-include "basic_2/dynamic/snv_cpcs.ma".
-include "basic_2/dynamic/lsubsv_lsstas.ma".
-
-(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
-
-(* Properties on sn parallel reduction for local environments ***************)
-
-fact lsstas_cpr_lpr_aux: ∀h,g,G0,L0,T0.
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lsstas h g G1 L1 T1) →
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
- (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lsstas_cpr_lpr h g G1 L1 T1) →
- ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_lsstas_cpr_lpr h g G1 L1 T1.
-#h #g #G0 #L0 #T0 #IH4 #IH3 #IH2 #IH1 #G1 #L1 * * [|||| * ]
-[ #k #_ #_ #_ #_ #l1 #l2 #_ #_ #X2 #H2 #X3 #H3 #L2 #_ -IH4 -IH3 -IH2 -IH1
- >(lsstas_inv_sort1 … H2) -X2
- >(cpr_inv_sort1 … H3) -X3 /2 width=3 by cpr_atom, ex2_intro/
-| #i #HG0 #HL0 #HT0 #H1 #l1 #l2 @(nat_ind_plus … l2) -l2 [ #_ | #l2 #_ #Hl21 ] #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct -IH4 -IH3
- [ lapply (lsstas_inv_O … H2) -H2 #H destruct -IH1 -H1 -l1 /4 width=5 by lpr_cpcs_conf, cpr_cpcs_dx, ex2_intro/ ]
- elim (snv_inv_lref … H1) -H1 #I0 #K0 #X0 #HK0 #HX0
- elim (da_inv_lref … Hl1) -Hl1 * #K1 [ #V1 | #W1 #l0 ] #HLK1 [ #HVl1 | #HWl1 #H destruct ]
- lapply (ldrop_mono … HK0 … HLK1) -HK0 #H destruct
- elim (lsstas_inv_lref1 … H2) -H2 * #K0 #V0 #W0 [2,4: #l ] #HK0 [1,2: #Hl ] #HW0 #HX2
- lapply (ldrop_mono … HK0 … HLK1) -HK0 #H destruct
- [ lapply (da_mono … Hl … HWl1) -Hl #H destruct
- lapply (le_plus_to_le_r … Hl21) -Hl21 #Hl21
- ]
- lapply (fqup_lref … G1 … HLK1) #HKV1
- elim (lpr_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2
- elim (lpr_inv_pair1 … H) -H #K2 [ #W2 | #V2 ] #HK12 [ #HW12 | #HV12 ] #H destruct
- lapply (ldrop_fwd_drop2 … HLK2) #H2
- elim (cpr_inv_lref1 … H3) -H3
- [1,3: #H destruct -HLK1
- |2,4: * #K0 #V0 #X0 #H #HVX0 #HX0
- lapply (ldrop_mono … H … HLK1) -H -HLK1 #H destruct
- ]
- [ elim (IH1 … HWl1 … HW0 … HW12 … HK12) -IH1 -HW0 /2 width=1 by fqup_fpbg/ #V2 #HWV2 #HV2
- elim (lift_total V2 0 (i+1))
- /6 width=12 by fqup_fpbg, cpcs_lift, lsstas_ldec, ex2_intro/
- | elim (IH1 … HVl1 … HW0 … HV12 … HK12) -IH1 -HVl1 -HW0 -HV12 -HK12 -IH2 /2 width=1 by fqup_fpbg/ #W2 #HVW2 #HW02
- elim (lift_total W2 0 (i+1))
- /4 width=12 by cpcs_lift, lsstas_ldef, ex2_intro/
- | elim (IH1 … HVl1 … HW0 … HVX0 … HK12) -IH1 -HVl1 -HW0 -HVX0 -HK12 -IH2 -V2 /2 width=1 by fqup_fpbg/ -l1 #W2 #HXW2 #HW02
- elim (lift_total W2 0 (i+1))
- /3 width=12 by cpcs_lift, lsstas_lift, ex2_intro/
- ]
-| #p #_ #_ #HT0 #H1 destruct -IH4 -IH3 -IH2 -IH1
- elim (snv_inv_gref … H1)
-| #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct -IH4 -IH3 -IH2
- elim (snv_inv_bind … H1) -H1 #_ #HT1
- lapply (da_inv_bind … Hl1) -Hl1 #Hl1
- elim (lsstas_inv_bind1 … H2) -H2 #U1 #HTU1 #H destruct
- elim (cpr_inv_bind1 … H3) -H3 *
- [ #V2 #T2 #HV12 #HT12 #H destruct
- elim (IH1 … Hl1 … HTU1 … HT12 (L2.ⓑ{I}V2)) -IH1 -Hl1 -HTU1 -HT12 /2 width=1 by fqup_fpbg, lpr_pair/ -T1
- /4 width=5 by cpcs_bind2, lpr_cpr_conf, lsstas_bind, ex2_intro/
- | #T3 #HT13 #HXT3 #H1 #H2 destruct
- elim (IH1 … Hl1 … HTU1 … HT13 (L2.ⓓV1)) -IH1 -Hl1 -HTU1 -HT13 /2 width=1 by fqup_fpbg, lpr_pair/ -T1 -HL12 #U3 #HTU3 #HU13
- elim (lsstas_inv_lift1 … HTU3 L2 … HXT3) -T3
- /5 width=8 by cpcs_cpr_strap1, cpcs_bind1, cpr_zeta, ldrop_drop, ex2_intro/
- ]
-| #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct
- elim (snv_inv_appl … H1) -H1 #a #W1 #W10 #U10 #l0 #HV1 #HT1 #Hl0 #HVW1 #HW10 #HTU10
- lapply (da_inv_flat … Hl1) -Hl1 #Hl1
- elim (lsstas_inv_appl1 … H2) -H2 #U1 #HTU1 #H destruct
- elim (cpr_inv_appl1 … H3) -H3 *
- [ #V2 #T2 #HV12 #HT12 #H destruct -a -l0 -W1 -W10 -U10 -HV1 -IH4 -IH3 -IH2
- elim (IH1 … Hl1 … HTU1 … HT12 … HL12) -IH1 -Hl1 -HTU1
- /4 width=5 by fqup_fpbg, cpcs_flat, lpr_cpr_conf, lsstas_appl, ex2_intro/
- | #b #V2 #W2 #W3 #T2 #T3 #HV12 #HW23 #HT23 #H1 #H2 destruct
- elim (snv_inv_bind … HT1) -HT1 #HW2 #HT2
- lapply (da_inv_bind … Hl1) -Hl1 #Hl1
- elim (lsstas_inv_bind1 … HTU1) -HTU1 #U2 #HTU2 #H destruct
- elim (cpds_inv_abst1 … HTU10) -HTU10 #W0 #U0 #HW20 #_ #H destruct
- lapply (cprs_div … HW10 … HW20) -W0 #HW12
- lapply (ssta_da_conf … HVW1 … Hl0) <minus_plus_m_m #H
- elim (snv_fwd_da … HW2) #l #Hl
- lapply (IH4 … HV1 … 1 … Hl0 W1 ?) /2 width=1 by fqup_fpbg, ssta_lsstas/ #HW1
- lapply (da_cpcs_aux … IH3 IH2 … H … Hl … HW12) // -H
- /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, ssta_fpbs/ #H destruct
- lapply (IH3 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #HV2
- lapply (IH2 … Hl0 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #HV2l
- elim (IH1 … 1 … Hl0 … W1 … HV12 … HL12) /2 width=1 by fqup_fpbg, ssta_lsstas/ -HVW1 #W4 #H #HW14
- lapply (lsstas_inv_SO … H) #HV2W4
- lapply (ssta_da_conf … HV2W4 … HV2l) <minus_plus_m_m #HW4l
- lapply (IH4 … HV2 … HV2l … H) -H /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_fpbs/ #HW4
- lapply (IH3 … HW23 … HL12) /2 width=1 by fqup_fpbg/ #HW3
- lapply (IH2 … Hl … HW23 … HL12) /2 width=1 by fqup_fpbg/ #HW3l
- elim (IH1 … Hl1 … HTU2 … HT23 (L2.ⓛW3)) -HTU2 /2 width=1 by fqup_fpbg, lpr_pair/ #U3 #HTU3 #HU23
- lapply (cpcs_cpr_strap1 … HW12 … HW23) #H
- lapply (lpr_cpcs_conf … HL12 … H) -H #H
- lapply (cpcs_canc_sn … HW14 H) -H #HW43
- elim (lsubsv_lsstas_trans … HTU3 … Hl21 … (L2.ⓓⓝW3.V2)) -HTU3
- [ #U4 #HT3U4 #HU43 -HW12 -HW3 -HW3l -W4 -IH2 -IH3 -IH4
- @(ex2_intro … (ⓓ{b}ⓝW3.V2.U4)) /2 width=1 by lsstas_bind/ -HT3U4
- @(cpcs_canc_dx … (ⓓ{b}ⓝW3.V2.U3)) /2 width=1 by cpcs_bind_dx/ -HU43
- @(cpcs_cpr_strap1 … (ⓐV2.ⓛ{b}W3.U3)) /2 width=1 by cpr_beta/
- /4 width=3 by cpcs_flat, cpcs_bind2, lpr_cpr_conf/
- | -U3
- @(lsubsv_abbr … l) /3 width=7 by fqup_fpbg/
- #W #W0 #l0 #Hl0 #HV2W #HW30
- lapply (lsstas_ssta_conf_pos … HV2W4 … HV2W) -HV2W #HW4W
- @(lsstas_cpcs_lpr_aux … IH3 IH2 IH1 … Hl0 … HW4W … Hl0 … HW30 … HW43) //
- [ /3 width=9 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_ssta_fpbs/
- | /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_fpbs/
- ]
- | -IH1 -IH3 -IH4 /3 width=9 by fqup_fpbg, lpr_pair/
- ]
- | #b #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HV02 #HW02 #HT02 #H1 #H2 destruct -a -l0 -W1 -W10 -HV1 -IH4 -IH3 -IH2
- elim (snv_inv_bind … HT1) -HT1 #_ #HT0
- lapply (da_inv_bind … Hl1) -Hl1 #Hl1
- elim (lsstas_inv_bind1 … HTU1) -HTU1 #U0 #HTU0 #H destruct
- elim (IH1 … Hl1 … HTU0 … HT02 (L2.ⓓW2)) -IH1 -Hl1 -HTU0 /2 width=1 by fqup_fpbg, lpr_pair/ -T0 #U2 #HTU2 #HU02
- lapply (lpr_cpr_conf … HL12 … HV10) -HV10 #HV10
- lapply (lpr_cpr_conf … HL12 … HW02) -L1 #HW02
- lapply (cpcs_bind2 b … HW02 … HU02) -HW02 -HU02 #HU02
- lapply (cpcs_flat … HV10 … HU02 Appl) -HV10 -HU02 #HU02
- lapply (cpcs_cpr_strap1 … HU02 (ⓓ{b}W2.ⓐV2.U2) ?)
- /4 width=3 by lsstas_appl, lsstas_bind, cpr_theta, ex2_intro/
- ]
-| #W1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 @(nat_ind_plus … l2) -l2 [ #_ | #l2 #_ #Hl21 ] #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct -IH4 -IH3 -IH2
- [ lapply (lsstas_inv_O … H2) -H2 #H destruct -IH1 -H1 -l1 /4 width=5 by lpr_cpcs_conf, cpr_cpcs_dx, ex2_intro/ ]
- elim (snv_inv_cast … H1) -H1 #U1 #l #_ #HT1 #_ #_ #_ -U1 -l
- lapply (da_inv_flat … Hl1) -Hl1 #Hl1
- lapply (lsstas_inv_cast1 … H2) -H2 #HTU1
- elim (cpr_inv_cast1 … H3) -H3
- [ * #U2 #T2 #_ #HT12 #H destruct
- elim (IH1 … Hl1 … HTU1 … HT12 … HL12) -IH1 -Hl1 -HTU1 -HL12
- /3 width=3 by fqup_fpbg, lsstas_cast, ex2_intro/
- | #HT1X3
- elim (IH1 … Hl1 … HTU1 … HT1X3 … HL12) -IH1 -Hl1 -HTU1 -HL12
- /2 width=3 by fqup_fpbg, ex2_intro/
- ]
-]
-qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/dynamic/snv_lift.ma".
+include "basic_2/dynamic/snv_cpcs.ma".
+
+(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
+
+(* Properties on nat-iterated stratified static type assignment for terms ***)
+
+fact snv_lstas_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lstas h g G1 L1 T1) →
+ ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_snv_lstas h g G1 L1 T1.
+#h #g #G0 #L0 #T0 #IH4 #IH3 #IH2 #IH1 #G1 #L1 * * [|||| * ]
+[ #k #HG0 #HL0 #HT0 #_ #l1 #l2 #Hl21 #Hl1 #X #H2 destruct -IH4 -IH3 -IH2 -IH1
+ >(lstas_inv_sort1 … H2) -X //
+| #i #HG0 #HL0 #HT0 #H1 #l1 #l2 @(nat_ind_plus … l2) -l2 [ #_ | #l2 #_ #Hl21 ] #Hl1 #X #H2 destruct -IH4 -IH3 -IH2
+ [ lapply (lstas_inv_O … H2) -H2 #H destruct // ]
+ elim (snv_inv_lref … H1) -H1 #I0 #K0 #X0 #HLK0 #HX0
+ elim (da_inv_lref … Hl1) -Hl1 * #K1 [ #V1 | #W1 #l ] #HLK1 [ #Hl1 | #Hl #H ]
+ lapply (ldrop_mono … HLK0 … HLK1) -HLK0 #H0 destruct
+ elim (lstas_inv_lref1 … H2) -H2 * #K0 #Y0 #X0 [2,4: #Y1 ] #HLK0 [1,2: #HY01 ] #HYX0 #HX0
+ lapply (ldrop_mono … HLK0 … HLK1) -HLK0 #H destruct
+ [ lapply (le_plus_to_le_r … Hl21) -Hl21 #Hl21 ]
+ lapply (fqup_lref … G1 … HLK1) #H
+ lapply (ldrop_fwd_drop2 … HLK1) -HLK1 /4 width=8 by fqup_fpbg, snv_lift/
+| #p #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X #H2 destruct -IH4 -IH3 -IH2 -IH1
+ elim (snv_inv_gref … H1)
+| #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X #H2 destruct -IH4 -IH3 -IH2
+ elim (snv_inv_bind … H1) -H1 #HV1 #HT1
+ lapply (da_inv_bind … Hl1) -Hl1 #Hl1
+ elim (lstas_inv_bind1 … H2) -H2 #U1 #HTU1 #H destruct /4 width=8 by fqup_fpbg, snv_bind/
+| #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X #H2 destruct
+ elim (snv_inv_appl … H1) -H1 #a #W1 #W0 #T0 #l0 #HV1 #HT1 #Hl0 #HVW1 #HW10 #HT10
+ lapply (da_inv_flat … Hl1) -Hl1 #Hl1
+ elim (lstas_inv_appl1 … H2) -H2 #U1 #HTU1 #H destruct
+ lapply (IH1 … HT1 … Hl1 … HTU1) /2 width=1 by fqup_fpbg/ #HU1
+ elim (lstas_cpds_aux … IH1 IH4 IH3 IH2 … Hl1 … HTU1 … HT10) -IH4 -IH3 -IH2 -IH1 /2 width=1 by fqup_fpbg/ -T1 -l1 #X #l #_ #H #HU10 -l2
+ elim (lstas_inv_bind1 … H) -H #U0 #_ #H destruct -T0 -l
+ elim (cpes_inv_abst2 … HU10) -HU10 #W2 #U2 #HU12 #HU02
+ elim (cprs_inv_abst … HU02) -HU02 #HW02 #_
+ /3 width=7 by snv_appl, cprs_trans/
+| #W1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 @(nat_ind_plus … l2) -l2 [ #_ | #l2 #_ #Hl21 ] #Hl1 #X #H2 destruct -IH4 -IH3 -IH2
+ [ lapply (lstas_inv_O … H2) -H2 #H destruct // ]
+ elim (snv_inv_cast … H1) -H1
+ lapply (da_inv_flat … Hl1) -Hl1
+ lapply (lstas_inv_cast1 … H2) -H2 /3 width=8 by fqup_fpbg/
+]
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/computation/cpds_cpds.ma".
+include "basic_2/dynamic/snv_aaa.ma".
+include "basic_2/dynamic/snv_cpcs.ma".
+include "basic_2/dynamic/lsubsv_lstas.ma".
+
+(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
+
+(* Properties on sn parallel reduction for local environments ***************)
+
+fact lstas_cpr_lpr_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lstas h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) →
+ ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_lstas_cpr_lpr h g G1 L1 T1.
+#h #g #G0 #L0 #T0 #IH4 #IH3 #IH2 #IH1 #G1 #L1 * * [|||| * ]
+[ #k #_ #_ #_ #_ #l1 #l2 #_ #_ #X2 #H2 #X3 #H3 #L2 #_ -IH4 -IH3 -IH2 -IH1
+ >(lstas_inv_sort1 … H2) -X2
+ >(cpr_inv_sort1 … H3) -X3 /2 width=3 by ex2_intro/
+| #i #HG0 #HL0 #HT0 #H1 #l1 #l2 @(nat_ind_plus … l2) -l2 [ #_ | #l2 #_ #Hl21 ] #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct -IH4 -IH3
+ [ lapply (lstas_inv_O … H2) -H2 #H destruct -IH1 -H1 -l1 /4 width=5 by lpr_cpcs_conf, cpr_cpcs_dx, ex2_intro/ ]
+ elim (snv_inv_lref … H1) -H1 #I0 #K0 #X0 #HK0 #HX0
+ elim (da_inv_lref … Hl1) -Hl1 * #K1 [ #V1 | #W1 #l0 ] #HLK1 [ #HVl1 | #HWl1 #H destruct ]
+ lapply (ldrop_mono … HK0 … HLK1) -HK0 #H destruct
+ elim (lstas_inv_lref1 … H2) -H2 * #K0 #V0 #W0 [2,4: #X0 ] #HK0 [1,2: #_ -X0 ] #HVW0 #HX2
+ lapply (ldrop_mono … HK0 … HLK1) -HK0 #H destruct
+ [ lapply (le_plus_to_le_r … Hl21) -Hl21 #Hl21 ]
+ lapply (fqup_lref … G1 … HLK1) #HKV1
+ elim (lpr_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2
+ elim (lpr_inv_pair1 … H) -H #K2 [ #W2 | #V2 ] #HK12 [ #HW12 | #HV12 ] #H destruct
+ lapply (ldrop_fwd_drop2 … HLK2) #H2
+ elim (cpr_inv_lref1 … H3) -H3
+ [1,3: #H destruct -HLK1
+ |2,4: * #K0 #V0 #X0 #H #HVX0 #HX0
+ lapply (ldrop_mono … H … HLK1) -H -HLK1 #H destruct
+ ]
+ [ lapply (IH2 … HWl1 … HW12 … HK12) /2 width=1 by fqup_fpbg/ -IH2 #H
+ elim (da_inv_sta … H) -H
+ elim (IH1 … HWl1 … HVW0 … HW12 … HK12) -IH1 -HVW0 /2 width=1 by fqup_fpbg/ #V2 #HWV2 #HV2
+ elim (lift_total V2 0 (i+1))
+ /3 width=12 by cpcs_lift, lstas_ldec, ex2_intro/
+ | elim (IH1 … HVl1 … HVW0 … HV12 … HK12) -IH1 -HVl1 -HVW0 -HV12 -HK12 -IH2 /2 width=1 by fqup_fpbg/ #W2 #HVW2 #HW02
+ elim (lift_total W2 0 (i+1))
+ /4 width=12 by cpcs_lift, lstas_ldef, ex2_intro/
+ | elim (IH1 … HVl1 … HVW0 … HVX0 … HK12) -IH1 -HVl1 -HVW0 -HVX0 -HK12 -IH2 -V2 /2 width=1 by fqup_fpbg/ -l1 #W2 #HXW2 #HW02
+ elim (lift_total W2 0 (i+1))
+ /3 width=12 by cpcs_lift, lstas_lift, ex2_intro/
+ ]
+| #p #_ #_ #HT0 #H1 destruct -IH4 -IH3 -IH2 -IH1
+ elim (snv_inv_gref … H1)
+| #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct -IH4 -IH3 -IH2
+ elim (snv_inv_bind … H1) -H1 #_ #HT1
+ lapply (da_inv_bind … Hl1) -Hl1 #Hl1
+ elim (lstas_inv_bind1 … H2) -H2 #U1 #HTU1 #H destruct
+ elim (cpr_inv_bind1 … H3) -H3 *
+ [ #V2 #T2 #HV12 #HT12 #H destruct
+ elim (IH1 … Hl1 … HTU1 … HT12 (L2.ⓑ{I}V2)) -IH1 -Hl1 -HTU1 -HT12 /2 width=1 by fqup_fpbg, lpr_pair/ -T1
+ /4 width=5 by cpcs_bind2, lpr_cpr_conf, lstas_bind, ex2_intro/
+ | #T3 #HT13 #HXT3 #H1 #H2 destruct
+ elim (IH1 … Hl1 … HTU1 … HT13 (L2.ⓓV1)) -IH1 -Hl1 -HTU1 -HT13 /2 width=1 by fqup_fpbg, lpr_pair/ -T1 -HL12 #U3 #HTU3 #HU13
+ elim (lstas_inv_lift1 … HTU3 L2 … HXT3) -T3
+ /5 width=8 by cpcs_cpr_strap1, cpcs_bind1, cpr_zeta, ldrop_drop, ex2_intro/
+ ]
+| #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct
+ elim (snv_inv_appl … H1) -H1 #a #W1 #W10 #U10 #l0 #HV1 #HT1 #Hl0 #HVW1 #HW10 #HTU10
+ lapply (da_inv_flat … Hl1) -Hl1 #Hl1
+ elim (lstas_inv_appl1 … H2) -H2 #U1 #HTU1 #H destruct
+ elim (cpr_inv_appl1 … H3) -H3 *
+ [ #V2 #T2 #HV12 #HT12 #H destruct -a -l0 -W1 -W10 -U10 -HV1 -IH4 -IH3 -IH2
+ elim (IH1 … Hl1 … HTU1 … HT12 … HL12) -IH1 -Hl1 -HTU1
+ /4 width=5 by fqup_fpbg, cpcs_flat, lpr_cpr_conf, lstas_appl, ex2_intro/
+ | #b #V2 #W2 #W3 #T2 #T3 #HV12 #HW23 #HT23 #H1 #H2 destruct
+ elim (snv_inv_bind … HT1) -HT1 #HW2 #HT2
+ lapply (da_inv_bind … Hl1) -Hl1 #Hl1
+ elim (lstas_inv_bind1 … HTU1) -HTU1 #U2 #HTU2 #H destruct
+ elim (cpds_inv_abst1 … HTU10) -HTU10 #W0 #U0 #HW20 #_ #H destruct
+ lapply (cprs_div … HW10 … HW20) -W0 #HW12
+ lapply (da_sta_conf … HVW1 … Hl0) <minus_plus_m_m #H
+ elim (snv_fwd_da … HW2) #l #Hl
+ lapply (IH4 … HV1 … 1 … Hl0 W1 ?) /2 width=1 by fqup_fpbg, sta_lstas/ #HW1
+ lapply (da_cpcs_aux … IH3 IH2 … H … Hl … HW12) // -H
+ /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, sta_fpbs/ #H destruct
+ lapply (IH3 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #HV2
+ lapply (IH2 … Hl0 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #HV2l
+ elim (IH1 … 1 … Hl0 … W1 … HV12 … HL12) /2 width=1 by fqup_fpbg, sta_lstas/ -HVW1 #W4 #H #HW14
+ lapply (lstas_inv_SO … H) #HV2W4
+ lapply (da_sta_conf … HV2W4 … HV2l) <minus_plus_m_m #HW4l
+ lapply (IH4 … HV2 … HV2l … H) -H /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_fpbs/ #HW4
+ lapply (IH3 … HW23 … HL12) /2 width=1 by fqup_fpbg/ #HW3
+ lapply (IH2 … Hl … HW23 … HL12) /2 width=1 by fqup_fpbg/ #HW3l
+ elim (IH1 … Hl1 … HTU2 … HT23 (L2.ⓛW3)) -HTU2 /2 width=1 by fqup_fpbg, lpr_pair/ #U3 #HTU3 #HU23
+ lapply (cpcs_cpr_strap1 … HW12 … HW23) #H
+ lapply (lpr_cpcs_conf … HL12 … H) -H #H
+ lapply (cpcs_canc_sn … HW14 H) -H #HW43
+ elim (lsubsv_lstas_trans … g … HTU3 … Hl21 … (L2.ⓓⓝW3.V2)) -HTU3
+ [ #U4 #HT3U4 #HU43 -HW12 -HW3 -HW3l -W4 -IH2 -IH3 -IH4
+ @(ex2_intro … (ⓓ{b}ⓝW3.V2.U4)) /2 width=1 by lstas_bind/ -HT3U4
+ @(cpcs_canc_dx … (ⓓ{b}ⓝW3.V2.U3)) /2 width=1 by cpcs_bind_dx/ -HU43
+ @(cpcs_cpr_strap1 … (ⓐV2.ⓛ{b}W3.U3)) /2 width=1 by cpr_beta/
+ /4 width=3 by cpcs_flat, cpcs_bind2, lpr_cpr_conf/
+ | -U3
+ @(lsubsv_abbr … l) /3 width=7 by fqup_fpbg/
+ #W #W0 #l0 #Hl0 #HV2W #HW30
+ lapply (lstas_sta_conf_pos … HV2W4 … HV2W) -HV2W #HW4W
+ @(lstas_cpcs_lpr_aux … IH3 IH2 IH1 … Hl0 … HW4W … Hl0 … HW30 … HW43) //
+ [ /3 width=9 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_sta_fpbs/
+ | /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_fpbs/
+ ]
+ | -IH1 -IH3 -IH4 /3 width=9 by fqup_fpbg, lpr_pair/
+ ]
+ | #b #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HV02 #HW02 #HT02 #H1 #H2 destruct -a -l0 -W1 -W10 -HV1 -IH4 -IH3 -IH2
+ elim (snv_inv_bind … HT1) -HT1 #_ #HT0
+ lapply (da_inv_bind … Hl1) -Hl1 #Hl1
+ elim (lstas_inv_bind1 … HTU1) -HTU1 #U0 #HTU0 #H destruct
+ elim (IH1 … Hl1 … HTU0 … HT02 (L2.ⓓW2)) -IH1 -Hl1 -HTU0 /2 width=1 by fqup_fpbg, lpr_pair/ -T0 #U2 #HTU2 #HU02
+ lapply (lpr_cpr_conf … HL12 … HV10) -HV10 #HV10
+ lapply (lpr_cpr_conf … HL12 … HW02) -L1 #HW02
+ lapply (cpcs_bind2 b … HW02 … HU02) -HW02 -HU02 #HU02
+ lapply (cpcs_flat … HV10 … HU02 Appl) -HV10 -HU02 #HU02
+ lapply (cpcs_cpr_strap1 … HU02 (ⓓ{b}W2.ⓐV2.U2) ?)
+ /4 width=3 by lstas_appl, lstas_bind, cpr_theta, ex2_intro/
+ ]
+| #W1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 @(nat_ind_plus … l2) -l2 [ #_ | #l2 #_ #Hl21 ] #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct -IH4 -IH3 -IH2
+ [ lapply (lstas_inv_O … H2) -H2 #H destruct -IH1 -H1 -l1 /4 width=5 by lpr_cpcs_conf, cpr_cpcs_dx, ex2_intro/ ]
+ elim (snv_inv_cast … H1) -H1 #U1 #l #_ #HT1 #_ #_ #_ -U1 -l
+ lapply (da_inv_flat … Hl1) -Hl1 #Hl1
+ lapply (lstas_inv_cast1 … H2) -H2 #HTU1
+ elim (cpr_inv_cast1 … H3) -H3
+ [ * #U2 #T2 #_ #HT12 #H destruct
+ elim (IH1 … Hl1 … HTU1 … HT12 … HL12) -IH1 -Hl1 -HTU1 -HL12
+ /3 width=3 by fqup_fpbg, lstas_cast, ex2_intro/
+ | #HT1X3
+ elim (IH1 … Hl1 … HTU1 … HT1X3 … HL12) -IH1 -Hl1 -HTU1 -HL12
+ /2 width=3 by fqup_fpbg, ex2_intro/
+ ]
+]
+qed-.
include "basic_2/computation/fsb_aaa.ma".
include "basic_2/dynamic/snv_da_lpr.ma".
-include "basic_2/dynamic/snv_lsstas.ma".
-include "basic_2/dynamic/snv_lsstas_lpr.ma".
+include "basic_2/dynamic/snv_lstas.ma".
+include "basic_2/dynamic/snv_lstas_lpr.ma".
include "basic_2/dynamic/snv_lpr.ma".
(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
lemma snv_preserve: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] →
∧∧ IH_da_cpr_lpr h g G L T
& IH_snv_cpr_lpr h g G L T
- & IH_snv_lsstas h g G L T
- & IH_lsstas_cpr_lpr h g G L T.
+ & IH_snv_lstas h g G L T
+ & IH_lstas_cpr_lpr h g G L T.
#h #g #G #L #T #HT elim (snv_fwd_aaa … HT) -HT
#A #HT @(aaa_ind_fpbg h g … HT) -G -L -T -A
#G #L #T #A #_ #IH -A @and4_intro
[ letin aux ≝ da_cpr_lpr_aux | letin aux ≝ snv_cpr_lpr_aux
-| letin aux ≝ snv_lsstas_aux | letin aux ≝ lsstas_cpr_lpr_aux
+| letin aux ≝ snv_lstas_aux | letin aux ≝ lstas_cpr_lpr_aux
]
@(aux … G L T) // #G0 #L0 #T0 #H elim (IH … H) -IH -H //
qed-.
#h #g #G #L #T #HT elim (snv_preserve … HT) /2 width=1 by/
qed-.
-theorem snv_lsstas: ∀h,g,G,L,T. IH_snv_lsstas h g G L T.
+theorem snv_lstas: ∀h,g,G,L,T. IH_snv_lstas h g G L T.
#h #g #G #L #T #HT elim (snv_preserve … HT) /2 width=5 by/
qed-.
-theorem lsstas_cpr_lpr: ∀h,g,G,L,T. IH_lsstas_cpr_lpr h g G L T.
+theorem lstas_cpr_lpr: ∀h,g,G,L,T. IH_lstas_cpr_lpr h g G L T.
#h #g #G #L #T #HT elim (snv_preserve … HT) /2 width=3 by/
qed-.
elim (cpcs_inv_cprs … H) -H /3 width=12 by da_cprs_lpr, da_mono/
qed-.
-lemma ssta_cpr_lpr: ∀h,g,G,L1,T1. ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
- ∀l. ⦃G, L1⦄ ⊢ T1 ▪[h, g] l+1 →
- ∀U1. ⦃G, L1⦄ ⊢ T1 •[h, g] U1 →
- ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
- ∃∃U2. ⦃G, L2⦄ ⊢ T2 •[h, g] U2 & ⦃G, L2⦄ ⊢ U1 ⬌* U2.
+lemma sta_cpr_lpr: ∀h,g,G,L1,T1. ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀l. ⦃G, L1⦄ ⊢ T1 ▪[h, g] l+1 →
+ ∀U1. ⦃G, L1⦄ ⊢ T1 •[h] U1 →
+ ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
+ ∃∃U2. ⦃G, L2⦄ ⊢ T2 •[h] U2 & ⦃G, L2⦄ ⊢ U1 ⬌* U2.
#h #g #G #L1 #T1 #HT1 #l #Hl #U1 #HTU1 #T2 #HT12 #L2 #HL12
-elim (lsstas_cpr_lpr … 1 … Hl U1 … HT12 … HL12) -Hl -HT12 -HL12
-/3 width=3 by lsstas_inv_SO, ssta_lsstas, ex2_intro/
+elim (lstas_cpr_lpr … 1 … Hl U1 … HT12 … HL12) -Hl -HT12 -HL12
+/3 width=3 by lstas_inv_SO, sta_lstas, ex2_intro/
qed-.
-lemma lsstas_cprs_lpr: ∀h,g,G,L1,T1. ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
- ∀l1,l2. l2 ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 →
- ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, g, l2] U1 →
- ∀T2. ⦃G, L1⦄ ⊢ T1 ➡* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
- ∃∃U2. ⦃G, L2⦄ ⊢ T2 •*[h, g, l2] U2 & ⦃G, L2⦄ ⊢ U1 ⬌* U2.
+lemma lstas_cprs_lpr: ∀h,g,G,L1,T1. ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀l1,l2. l2 ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 →
+ ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, l2] U1 →
+ ∀T2. ⦃G, L1⦄ ⊢ T1 ➡* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
+ ∃∃U2. ⦃G, L2⦄ ⊢ T2 •*[h, l2] U2 & ⦃G, L2⦄ ⊢ U1 ⬌* U2.
#h #g #G #L1 #T1 #HT1 #l1 #l2 #Hl21 #Hl1 #U1 #HTU1 #T2 #H
-@(cprs_ind … H) -T2 [ /2 width=9 by lsstas_cpr_lpr/ ]
+@(cprs_ind … H) -T2 [ /2 width=10 by lstas_cpr_lpr/ ]
#T #T2 #HT1T #HTT2 #IHT1 #L2 #HL12
elim (IHT1 L1) // -IHT1 #U #HTU #HU1
-elim (lsstas_cpr_lpr … Hl21 … HTU … HTT2 … HL12) -HTU -HTT2
-[2,3: /2 width=6 by snv_cprs_lpr, da_cprs_lpr/ ] -T1 -T -l1
+elim (lstas_cpr_lpr … g … Hl21 … HTU … HTT2 … HL12) -HTU -HTT2
+[2,3: /2 width=7 by snv_cprs_lpr, da_cprs_lpr/ ] -T1 -T -l1
/4 width=5 by lpr_cpcs_conf, cpcs_trans, ex2_intro/
qed-.
-lemma lsstas_cpcs_lpr: ∀h,g,G,L1,T1. ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
- ∀l,l1. l ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 → ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, g, l] U1 →
- ∀T2. ⦃G, L1⦄ ⊢ T2 ¡[h, g] →
- ∀l2. l ≤ l2 → ⦃G, L1⦄ ⊢ T2 ▪[h, g] l2 → ∀U2. ⦃G, L1⦄ ⊢ T2 •*[h, g, l] U2 →
- ⦃G, L1⦄ ⊢ T1 ⬌* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ U1 ⬌* U2.
+lemma lstas_cpcs_lpr: ∀h,g,G,L1,T1. ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀l,l1. l ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 → ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, l] U1 →
+ ∀T2. ⦃G, L1⦄ ⊢ T2 ¡[h, g] →
+ ∀l2. l ≤ l2 → ⦃G, L1⦄ ⊢ T2 ▪[h, g] l2 → ∀U2. ⦃G, L1⦄ ⊢ T2 •*[h, l] U2 →
+ ⦃G, L1⦄ ⊢ T1 ⬌* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ U1 ⬌* U2.
#h #g #G #L1 #T1 #HT1 #l #l1 #Hl1 #HTl1 #U1 #HTU1 #T2 #HT2 #l2 #Hl2 #HTl2 #U2 #HTU2 #H #L2 #HL12
elim (cpcs_inv_cprs … H) -H #T #H1 #H2
-elim (lsstas_cprs_lpr … HT1 … Hl1 HTl1 … HTU1 … H1 … HL12) -T1 #W1 #H1 #HUW1
-elim (lsstas_cprs_lpr … HT2 … Hl2 HTl2 … HTU2 … H2 … HL12) -T2 #W2 #H2 #HUW2
-lapply (lsstas_mono … H1 … H2) -h -T -l #H destruct /2 width=3 by cpcs_canc_dx/
+elim (lstas_cprs_lpr … HT1 … Hl1 HTl1 … HTU1 … H1 … HL12) -T1 #W1 #H1 #HUW1
+elim (lstas_cprs_lpr … HT2 … Hl2 HTl2 … HTU2 … H2 … HL12) -T2 #W2 #H2 #HUW2
+lapply (lstas_mono … H1 … H2) -h -T -l #H destruct /2 width=3 by cpcs_canc_dx/
qed-.
-lemma snv_ssta: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] →
- ∀l. ⦃G, L⦄ ⊢ T ▪[h, g] l+1 →
- ∀U. ⦃G, L⦄ ⊢ T •[h, g] U → ⦃G, L⦄ ⊢ U ¡[h, g].
-/3 width=7 by lsstas_inv_SO, ssta_lsstas, snv_lsstas/ qed-.
+lemma snv_sta: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] →
+ ∀l. ⦃G, L⦄ ⊢ T ▪[h, g] l+1 →
+ ∀U. ⦃G, L⦄ ⊢ T •[h] U → ⦃G, L⦄ ⊢ U ¡[h, g].
+/3 width=7 by lstas_inv_SO, sta_lstas, snv_lstas/ qed-.
-lemma lsstas_cpds: ∀h,g,G,L,T1. ⦃G, L⦄ ⊢ T1 ¡[h, g] →
- ∀l1,l2. l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 →
- ∀U1. ⦃G, L⦄ ⊢ T1 •*[h, g, l2] U1 → ∀T2. ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2 →
- ∃∃U2,l. l ≤ l2 & ⦃G, L⦄ ⊢ T2 •*[h, g, l] U2 & ⦃G, L⦄ ⊢ U1 •*⬌*[h, g] U2.
+lemma lstas_cpds: ∀h,g,G,L,T1. ⦃G, L⦄ ⊢ T1 ¡[h, g] →
+ ∀l1,l2. l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 →
+ ∀U1. ⦃G, L⦄ ⊢ T1 •*[h, l2] U1 → ∀T2. ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2 →
+ ∃∃U2,l. l ≤ l2 & ⦃G, L⦄ ⊢ T2 •*[h, l] U2 & ⦃G, L⦄ ⊢ U1 •*⬌*[h, g] U2.
#h #g #G #L #T1 #HT1 #l1 #l2 #Hl21 #Hl1 #U1 #HTU1 #T2 * #T #l0 #l #Hl0 #H #HT1T #HTT2
lapply (da_mono … H … Hl1) -H #H destruct
-lapply (lsstas_da_conf … HTU1 … Hl1) #Hl12
+lapply (lstas_da_conf … HTU1 … Hl1) #Hl12
elim (le_or_ge l2 l) #Hl2
-[ lapply (lsstas_conf_le … HTU1 … HT1T) -HT1T //
+[ lapply (lstas_conf_le … HTU1 … HT1T) -HT1T //
/5 width=11 by cpds_cpes_dx, monotonic_le_minus_l, ex3_2_intro, ex4_3_intro/
-| lapply (lsstas_da_conf … HT1T … Hl1) #Hl1l
- lapply (lsstas_conf_le … HT1T … HTU1) -HTU1 // #HTU1
- elim (lsstas_cprs_lpr … Hl1l … HTU1 … HTT2 L) -Hl1l -HTU1 -HTT2
- /3 width=7 by snv_lsstas, cpcs_cpes, monotonic_le_minus_l, ex3_2_intro/
+| lapply (lstas_da_conf … HT1T … Hl1) #Hl1l
+ lapply (lstas_conf_le … HT1T … HTU1) -HTU1 // #HTU1
+ elim (lstas_cprs_lpr … Hl1l … HTU1 … HTT2 L) -Hl1l -HTU1 -HTT2
+ /3 width=7 by snv_lstas, cpcs_cpes, monotonic_le_minus_l, ex3_2_intro/
]
qed-.
∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
∃∃U2. ⦃G, L2⦄ ⊢ T2 •*➡*[h, g] U2 & ⦃G, L2⦄ ⊢ U1 ➡* U2.
#h #g #G #L1 #T1 #HT1 #U1 * #W1 #l1 #l2 #Hl21 #Hl1 #HTW1 #HWU1 #T2 #HT12 #L2 #HL12
-elim (lsstas_cpr_lpr … HTW1 … HT12 … HL12) // #W2 #HTW2 #HW12
+elim (lstas_cpr_lpr … g … HTW1 … HT12 … HL12) // #W2 #HTW2 #HW12
lapply (da_cpr_lpr … Hl1 … HT12 … HL12) // -T1
lapply (lpr_cprs_conf … HL12 … HWU1) -L1 #HWU1
lapply (cpcs_canc_sn … HW12 HWU1) -W1 #H
(* Main properties about atomic arity assignment on terms *******************)
-theorem aaa_cpcs_mono: ∀G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬌* T2 →
+theorem cpcs_aaa_mono: ∀G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬌* T2 →
∀A1. ⦃G, L⦄ ⊢ T1 ⁝ A1 → ∀A2. ⦃G, L⦄ ⊢ T2 ⁝ A2 →
A1 = A2.
#G #L #T1 #T2 #HT12 #A1 #HA1 #A2 #HA2
elim (cpcs_inv_cprs … HT12) -HT12 #T #HT1 #HT2
-lapply (aaa_cprs_conf … HA1 … HT1) -T1 #HA1
-lapply (aaa_cprs_conf … HA2 … HT2) -T2 #HA2
+lapply (cprs_aaa_conf … HA1 … HT1) -T1 #HA1
+lapply (cprs_aaa_conf … HA2 … HT2) -T2 #HA2
lapply (aaa_mono … HA1 … HA2) -L -T //
qed-.
(**************************************************************************)
include "basic_2/notation/relations/dpconvstar_6.ma".
-include "basic_2/unfold/lsstas.ma".
+include "basic_2/static/da.ma".
+include "basic_2/unfold/lstas.ma".
include "basic_2/equivalence/cpcs.ma".
(* DECOMPOSED EXTENDED PARALLEL EQUIVALENCE FOR TERMS ***********************)
definition cpes: ∀h. sd h → relation4 genv lenv term term ≝
λh,g,G,L,T1,T2.
- ∃∃T,l1,l2. l2 ≤ l1 & ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 & ⦃G, L⦄ ⊢ T1 •*[h, g, l2] T & ⦃G, L⦄ ⊢ T ⬌* T2.
+ ∃∃T,l1,l2. l2 ≤ l1 & ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 & ⦃G, L⦄ ⊢ T1 •*[h, l2] T & ⦃G, L⦄ ⊢ T ⬌* T2.
interpretation "decomposed extended parallel equivalence (term)"
'DPConvStar h g G L T1 T2 = (cpes h g G L T1 T2).
(* Basic properties *********************************************************)
-lemma ssta_cpcs_cpes: ∀h,g,G,L,T1,T,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T1 •[h, g] T →
- ⦃G, L⦄ ⊢ T ⬌* T2 → ⦃G, L⦄ ⊢ T1 •*⬌*[h, g] T2.
-/3 width=7/ qed.
+lemma sta_cpcs_cpes: ∀h,g,G,L,T1,T,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T1 •[h] T →
+ ⦃G, L⦄ ⊢ T ⬌* T2 → ⦃G, L⦄ ⊢ T1 •*⬌*[h, g] T2.
+/3 width=7 by sta_lstas, ex4_3_intro/ qed.
-lemma lsstas_cpes: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l → ⦃G, L⦄ ⊢ T1 •*[h, g, l] T2 → ⦃G, L⦄ ⊢ T1 •*⬌*[h, g] T2.
-/2 width=7/ qed.
+lemma lstas_cpes: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l → ⦃G, L⦄ ⊢ T1 •*[h, l] T2 → ⦃G, L⦄ ⊢ T1 •*⬌*[h, g] T2.
+/2 width=7 by ex4_3_intro/ qed.
lemma cpcs_cpes: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l → ⦃G, L⦄ ⊢ T1 ⬌* T2 → ⦃G, L⦄ ⊢ T1 •*⬌*[h, g] T2.
-/2 width=7/ qed.
+/2 width=7 by lstar_O, ex4_3_intro/ qed.
lemma cpes_refl: ∀h,g,G,L,T,l. ⦃G, L⦄ ⊢ T ▪[h, g] l → ⦃G, L⦄ ⊢ T •*⬌*[h, g] T.
-/2 width=2/ qed.
+/2 width=2 by cpcs_cpes/ qed.
lemma cpes_strap1: ∀h,g,G,L,T1,T,T2.
⦃G, L⦄ ⊢ T1 •*⬌*[h, g] T → ⦃G, L⦄ ⊢ T ⬌ T2 → ⦃G, L⦄ ⊢ T1 •*⬌*[h, g] T2.
-#h #g #G #L #T1 #T #T2 * /3 width=9/
+#h #g #G #L #T1 #T #T2 * /3 width=9 by cpcs_strap1, ex4_3_intro/
qed.
+++ /dev/null
-(* Inversion lrmmas on static type assignment for terms *********************)
-
-lemma da_inv_sta: ∀h,g,G,L,T,l. ⦃G, L⦄ ⊢ T ▪[h, g] l →
- ∃U. ⦃G, L⦄ ⊢ T •[h] U.
-#h #g #G #L #T #l #H elim H -G -L -T -l
-[ /2 width=2/
-| #G #L #K #V #i #l #HLK #_ * #W #HVW
- elim (lift_total W 0 (i+1)) /3 width=7/
-| #G #L #K #W #i #l #HLK #_ * #V #HWV
- elim (lift_total W 0 (i+1)) /3 width=7/
-| #a #I #G #L #V #T #l #_ * /3 width=2/
-| * #G #L #V #T #l #_ * /3 width=2/
-]
-qed-.
-
-(* Properties on static type assignment for terms ***************************)
-
-lemma sta_da: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U →
- ∃l. ⦃G, L⦄ ⊢ T ▪[h, g] l.
-#h #g #G #L #T #U #H elim H -G -L -T -U
-[ #G #L #k elim (deg_total h g k) /3 width=2/
-| #G #L #K #V #W #W0 #i #HLK #_ #_ * /3 width=5/
-| #G #L #K #W #V #W0 #i #HLK #_ #_ * /3 width=5/
-| #a #I #G #L #V #T #U #_ * /3 width=2/
-| #G #L #V #T #U #_ * /3 width=2/
-| #G #L #W #T #U #_ * /3 width=2/
-]
-qed-.
+++ /dev/null
-(* Advanced inversion lemmas ************************************************)
-
-lemma sta_inv_refl_pos: ∀h,g,G,L,T,l. ⦃G, L⦄ ⊢ T ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T •[h] T → ⊥.
-#h #g #G #L #T #l #H1T #HTT
-lapply (sta_da_conf … HTT … H1T) -HTT <minus_plus_m_m #H2T
-lapply (da_mono … H2T … H1T) -h -G -L -T #H
-elim (plus_xySz_x_false 0 l 0 ?) //
-qed-.
+++ /dev/null
-(* Advanced properties ******************************************************)
-
-lemma sta_da_conf: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U →
- ∀l. ⦃G, L⦄ ⊢ T ▪[h, g] l → ⦃G, L⦄ ⊢ U ▪[h, g] l-1.
-#h #g #G #L #T #U #H elim H -G -L -T -U
-[ #G #L #k #l #H
- lapply (da_inv_sort … H) -H /3 width=1/
-| #G #L #K #V #W #W0 #i #HLK #_ #HW0 #IHVW #l #H
- elim (da_inv_lref … H) -H * #K0 #V0 [2: #l0] #HLK0 #HV0 [ #H0 ]
- lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct
- lapply (ldrop_fwd_ldrop2 … HLK) -HLK /3 width=7/
-| #G #L #K #W #V #W0 #i #HLK #HWV #HW0 #_ #l #H
- elim (da_inv_lref … H) -H * #K0 #V0 [2: #l0] #HLK0 #HV0 [ #H0 ]
- lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct
- lapply (ldrop_fwd_ldrop2 … HLK) -HLK /3 width=7/
-| #a #I #G #L #V #T #U #_ #IHTU #l #H
- lapply (da_inv_bind … H) -H /3 width=1/
-| #G #L #V #T #U #_ #IHTU #l #H
- lapply (da_inv_flat … H) -H /3 width=1/
-| #G #L #W #T #U #_ #IHTU #l #H
- lapply (da_inv_flat … H) -H /2 width=1/
-]
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-notation "hvbox( h ⊢ break term 46 L1 • ⊑ break [ term 46 g ] break term 46 L2 )"
- non associative with precedence 45
- for @{ 'CrSubEqS $h $g $L1 $L2 }.
-
-include "basic_2/static/ssta.ma".
-include "basic_2/computation/cprs.ma".
-include "basic_2/equivalence/cpcs.ma".
-
-(* LOCAL ENVIRONMENT REFINEMENT FOR STRATIFIED STATIC TYPE ASSIGNMENT *******)
-
-(* Note: this is not transitive *)
-inductive lsubss (h:sh) (g:sd h): relation lenv ≝
-| lsubss_atom: lsubss h g (⋆) (⋆)
-| lsubss_pair: ∀I,L1,L2,V. lsubss h g L1 L2 →
- lsubss h g (L1. ⓑ{I} V) (L2. ⓑ{I} V)
-| lsubss_abbr: ∀L1,L2,V1,V2,W1,W2,l. L1 ⊢ W1 ⬌* W2 →
- ⦃h, L1⦄ ⊢ V1 •[g] ⦃l+1, W1⦄ → ⦃h, L2⦄ ⊢ W2 •[g] ⦃l, V2⦄ →
- lsubss h g L1 L2 → lsubss h g (L1. ⓓV1) (L2. ⓛW2)
-.
-
-interpretation
- "local environment refinement (stratified static type assigment)"
- 'CrSubEqS h g L1 L2 = (lsubss h g L1 L2).
-
-(* Basic inversion lemmas ***************************************************)
-
-fact lsubss_inv_atom1_aux: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 → L1 = ⋆ → L2 = ⋆.
-#h #g #L1 #L2 * -L1 -L2
-[ //
-| #I #L1 #L2 #V #_ #H destruct
-| #L1 #L2 #V1 #V2 #W1 #W2 #l #_ #_ #_ #_ #H destruct
-]
-qed-.
-
-lemma lsubss_inv_atom1: ∀h,g,L2. h ⊢ ⋆ •⊑[g] L2 → L2 = ⋆.
-/2 width=5 by lsubss_inv_atom1_aux/ qed-.
-
-fact lsubss_inv_pair1_aux: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 →
- ∀I,K1,V1. L1 = K1. ⓑ{I} V1 →
- (∃∃K2. h ⊢ K1 •⊑[g] K2 & L2 = K2. ⓑ{I} V1) ∨
- ∃∃K2,W1,W2,V2,l. ⦃h, K1⦄ ⊢ V1 •[g] ⦃l+1, W1⦄ & ⦃h, K2⦄ ⊢ W2 •[g] ⦃l, V2⦄ &
- K1 ⊢ W1 ⬌* W2 & h ⊢ K1 •⊑[g] K2 & L2 = K2. ⓛW2 & I = Abbr.
-#h #g #L1 #L2 * -L1 -L2
-[ #J #K1 #U1 #H destruct
-| #I #L1 #L2 #V #HL12 #J #K1 #U1 #H destruct /3 width=3/
-| #L1 #L2 #V1 #V2 #W1 #W2 #l #HW12 #HVW1 #HWV2 #HL12 #J #K1 #U1 #H destruct /3 width=10/
-]
-qed-.
-
-lemma lsubss_inv_pair1: ∀h,g,I,K1,L2,V1. h ⊢ K1. ⓑ{I} V1 •⊑[g] L2 →
- (∃∃K2. h ⊢ K1 •⊑[g] K2 & L2 = K2. ⓑ{I} V1) ∨
- ∃∃K2,W1,W2,V2,l. ⦃h, K1⦄ ⊢ V1 •[g] ⦃l+1, W1⦄ & ⦃h, K2⦄ ⊢ W2 •[g] ⦃l, V2⦄ &
- K1 ⊢ W1 ⬌* W2 & h ⊢ K1 •⊑[g] K2 & L2 = K2. ⓛW2 & I = Abbr.
-/2 width=3 by lsubss_inv_pair1_aux/ qed-.
-
-fact lsubss_inv_atom2_aux: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 → L2 = ⋆ → L1 = ⋆.
-#h #g #L1 #L2 * -L1 -L2
-[ //
-| #I #L1 #L2 #V #_ #H destruct
-| #L1 #L2 #V1 #V2 #W1 #W2 #l #_ #_ #_ #_ #H destruct
-]
-qed-.
-
-lemma lsubss_inv_atom2: ∀h,g,L1. h ⊢ L1 •⊑[g] ⋆ → L1 = ⋆.
-/2 width=5 by lsubss_inv_atom2_aux/ qed-.
-
-fact lsubss_inv_pair2_aux: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 →
- ∀I,K2,W2. L2 = K2. ⓑ{I} W2 →
- (∃∃K1. h ⊢ K1 •⊑[g] K2 & L1 = K1. ⓑ{I} W2) ∨
- ∃∃K1,W1,V1,V2,l. ⦃h, K1⦄ ⊢ V1 •[g] ⦃l+1, W1⦄ & ⦃h, K2⦄ ⊢ W2 •[g] ⦃l, V2⦄ &
- K1 ⊢ W1 ⬌* W2 & h ⊢ K1 •⊑[g] K2 & L1 = K1. ⓓV1 & I = Abst.
-#h #g #L1 #L2 * -L1 -L2
-[ #J #K2 #U2 #H destruct
-| #I #L1 #L2 #V #HL12 #J #K2 #U2 #H destruct /3 width=3/
-| #L1 #L2 #V1 #V2 #W1 #W2 #l #HW12 #HVW1 #HWV2 #HL12 #J #K2 #U2 #H destruct /3 width=10/
-]
-qed-.
-
-lemma lsubss_inv_pair2: ∀h,g,I,L1,K2,W2. h ⊢ L1 •⊑[g] K2. ⓑ{I} W2 →
- (∃∃K1. h ⊢ K1 •⊑[g] K2 & L1 = K1. ⓑ{I} W2) ∨
- ∃∃K1,W1,V1,V2,l. ⦃h, K1⦄ ⊢ V1 •[g] ⦃l+1, W1⦄ & ⦃h, K2⦄ ⊢ W2 •[g] ⦃l, V2⦄ &
- K1 ⊢ W1 ⬌* W2 & h ⊢ K1 •⊑[g] K2 & L1 = K1. ⓓV1 & I = Abst.
-/2 width=3 by lsubss_inv_pair2_aux/ qed-.
-
-(* Basic_forward lemmas *****************************************************)
-
-axiom lsubss_fwd_lsubx: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 → L1 ⓝ⊑ L2.
-(*
-#h #g #L1 #L2 #H elim H -L1 -L2 // /2 width=1/
-qed-.
-*)
-(* Basic properties *********************************************************)
-
-lemma lsubss_refl: ∀h,g,L. h ⊢ L •⊑[g] L.
-#h #g #L elim L -L // /2 width=1/
-qed.
-
-lemma lsubss_cprs_trans: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 →
- ∀T1,T2. L2 ⊢ T1 ➡* T2 → L1 ⊢ T1 ➡* T2.
-/3 width=5 by lsubss_fwd_lsubx, lsubx_cprs_trans/
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/equivalence/cpcs_cpcs.ma".
-include "basic_2/equivalence/lsubss.ma".
-
-(* LOCAL ENVIRONMENT REFINEMENT FOR STRATIFIED STATIC TYPE ASSIGNMENT *******)
-
-(* Properties on context-sensitive parallel equivalence for terms ***********)
-
-lemma lsubss_cpcs_trans: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 →
- ∀T1,T2. L2 ⊢ T1 ⬌* T2 → L1 ⊢ T1 ⬌* T2.
-/3 width=5 by lsubss_fwd_lsubx, lsubx_cpcs_trans/
-qed-.
+++ /dev/null
-lemma lsubsv_fwd_lsubss: ∀h,g,L1,L2. h ⊢ L1 ¡⊑[g] L2 → h ⊢ L1 •⊑[g] L2.
-#h #g #L1 #L2 #H elim H -L1 -L2 // /2 width=1/ /2 width=6/
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/equivalence/lsubss.ma".
-
-(* LOCAL ENVIRONMENT REFINEMENT FOR STRATIFIED STATIC TYPE ASSIGNMENT *******)
-
-(* Properties concerning basic local environment slicing ********************)
-
-(* Note: the constant 0 cannot be generalized *)
-lemma lsubss_ldrop_O1_conf: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 →
- ∀K1,e. ⇩[0, e] L1 ≡ K1 →
- ∃∃K2. h ⊢ K1 •⊑[g] K2 & ⇩[0, e] L2 ≡ K2.
-#h #g #L1 #L2 #H elim H -L1 -L2
-[ /2 width=3/
-| #I #L1 #L2 #V #_ #IHL12 #K1 #e #H
- elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK1
- [ destruct
- elim (IHL12 L1 0) -IHL12 // #X #HL12 #H
- <(ldrop_inv_O2 … H) in HL12; -H /3 width=3/
- | elim (IHL12 … HLK1) -L1 /3 width=3/
- ]
-| #L1 #L2 #V1 #V2 #W1 #W2 #l #HW12 #HVW1 #HWV2 #_ #IHL12 #K1 #e #H
- elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK1
- [ destruct
- elim (IHL12 L1 0) -IHL12 // #X #HL12 #H
- <(ldrop_inv_O2 … H) in HL12; -H /3 width=6/
- | elim (IHL12 … HLK1) -L1 /3 width=3/
- ]
-]
-qed-.
-
-(* Note: the constant 0 cannot be generalized *)
-lemma lsubss_ldrop_O1_trans: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 →
- ∀K2,e. ⇩[0, e] L2 ≡ K2 →
- ∃∃K1. h ⊢ K1 •⊑[g] K2 & ⇩[0, e] L1 ≡ K1.
-#h #g #L1 #L2 #H elim H -L1 -L2
-[ /2 width=3/
-| #I #L1 #L2 #V #_ #IHL12 #K2 #e #H
- elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK2
- [ destruct
- elim (IHL12 L2 0) -IHL12 // #X #HL12 #H
- <(ldrop_inv_O2 … H) in HL12; -H /3 width=3/
- | elim (IHL12 … HLK2) -L2 /3 width=3/
- ]
-| #L1 #L2 #V1 #V2 #W1 #W2 #l #HW12 #HVW1 #HWV2 #_ #IHL12 #K2 #e #H
- elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK2
- [ destruct
- elim (IHL12 L2 0) -IHL12 // #X #HL12 #H
- <(ldrop_inv_O2 … H) in HL12; -H /3 width=6/
- | elim (IHL12 … HLK2) -L2 /3 width=3/
- ]
-]
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/static/ssta_ssta.ma".
-include "basic_2/equivalence/cpcs_cpcs.ma".
-include "basic_2/equivalence/lsubss_ldrop.ma".
-
-(* LOCAL ENVIRONMENT REFINEMENT FOR STRATIFIED STATIC TYPE ASSIGNMENT *******)
-
-(* Properties on stratified native type assignment **************************)
-
-lemma lsubss_ssta_trans: ∀h,g,L2,T,U2,l. ⦃h, L2⦄ ⊢ T •[g] ⦃l, U2⦄ →
- ∀L1. h ⊢ L1 •⊑[g] L2 →
- ∃∃U1. ⦃h, L1⦄ ⊢ T •[g] ⦃l, U1⦄ & L1 ⊢ U1 ⬌* U2.
-#h #g #L2 #T #U #l #H elim H -L2 -T -U -l
-[ /3 width=3/
-| #L2 #K2 #V2 #W2 #U2 #i #l #HLK2 #_ #HWU2 #IHVW2 #L1 #HL12
- elim (lsubss_ldrop_O1_trans … HL12 … HLK2) -L2 #X #H #HLK1
- elim (lsubss_inv_pair2 … H) -H * #K1 [ | -HWU2 -IHVW2 -HLK1 ]
- [ #HK12 #H destruct
- elim (IHVW2 … HK12) -K2 #T2 #HVT2 #HTW2
- lapply (ldrop_fwd_ldrop2 … HLK1) #H
- elim (lift_total T2 0 (i+1)) /3 width=11/
- | #W1 #V1 #W2 #l0 #_ #_ #_ #_ #_ #H destruct
- ]
-| #L2 #K2 #W2 #V2 #U2 #i #l #HLK2 #HWV2 #HWU2 #IHWV2 #L1 #HL12
- elim (lsubss_ldrop_O1_trans … HL12 … HLK2) -L2 #X #H #HLK1
- elim (lsubss_inv_pair2 … H) -H * #K1 [ -HWV2 | -IHWV2 ]
- [ #HK12 #H destruct
- elim (IHWV2 … HK12) -K2 /3 width=6/
- | #W1 #V1 #T2 #l0 #HVW1 #HWT2 #HW12 #_ #H #_ destruct
- elim (ssta_mono … HWV2 … HWT2) -HWV2 -HWT2 #H1 #H2 destruct
- lapply (ldrop_fwd_ldrop2 … HLK1) #H
- elim (lift_total W1 0 (i+1)) /3 width=11/
- ]
-| #a #I #L2 #V2 #T2 #U2 #l #_ #IHTU2 #L1 #HL12
- elim (IHTU2 (L1.ⓑ{I}V2) …) [2: /2 width=1/ ] -L2 /3 width=3/
-| #L2 #V2 #T2 #U2 #l #_ #IHTU2 #L1 #HL12
- elim (IHTU2 … HL12) -L2 /3 width=5/
-| #L2 #W2 #T2 #U2 #l #_ #IHTU2 #L1 #HL12
- elim (IHTU2 … HL12) -L2 /3 width=3/
-]
-qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+notation "hvbox( h ⊢ break term 46 L1 • ⊑ break [ term 46 g ] break term 46 L2 )"
+ non associative with precedence 45
+ for @{ 'CrSubEqS $h $g $L1 $L2 }.
+
+include "basic_2/static/ssta.ma".
+include "basic_2/computation/cprs.ma".
+include "basic_2/equivalence/cpcs.ma".
+
+(* LOCAL ENVIRONMENT REFINEMENT FOR STRATIFIED STATIC TYPE ASSIGNMENT *******)
+
+(* Note: this is not transitive *)
+inductive lsubss (h:sh) (g:sd h): relation lenv ≝
+| lsubss_atom: lsubss h g (⋆) (⋆)
+| lsubss_pair: ∀I,L1,L2,V. lsubss h g L1 L2 →
+ lsubss h g (L1. ⓑ{I} V) (L2. ⓑ{I} V)
+| lsubss_abbr: ∀L1,L2,V1,V2,W1,W2,l. L1 ⊢ W1 ⬌* W2 →
+ ⦃h, L1⦄ ⊢ V1 •[g] ⦃l+1, W1⦄ → ⦃h, L2⦄ ⊢ W2 •[g] ⦃l, V2⦄ →
+ lsubss h g L1 L2 → lsubss h g (L1. ⓓV1) (L2. ⓛW2)
+.
+
+interpretation
+ "local environment refinement (stratified static type assigment)"
+ 'CrSubEqS h g L1 L2 = (lsubss h g L1 L2).
+
+(* Basic inversion lemmas ***************************************************)
+
+fact lsubss_inv_atom1_aux: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 → L1 = ⋆ → L2 = ⋆.
+#h #g #L1 #L2 * -L1 -L2
+[ //
+| #I #L1 #L2 #V #_ #H destruct
+| #L1 #L2 #V1 #V2 #W1 #W2 #l #_ #_ #_ #_ #H destruct
+]
+qed-.
+
+lemma lsubss_inv_atom1: ∀h,g,L2. h ⊢ ⋆ •⊑[g] L2 → L2 = ⋆.
+/2 width=5 by lsubss_inv_atom1_aux/ qed-.
+
+fact lsubss_inv_pair1_aux: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 →
+ ∀I,K1,V1. L1 = K1. ⓑ{I} V1 →
+ (∃∃K2. h ⊢ K1 •⊑[g] K2 & L2 = K2. ⓑ{I} V1) ∨
+ ∃∃K2,W1,W2,V2,l. ⦃h, K1⦄ ⊢ V1 •[g] ⦃l+1, W1⦄ & ⦃h, K2⦄ ⊢ W2 •[g] ⦃l, V2⦄ &
+ K1 ⊢ W1 ⬌* W2 & h ⊢ K1 •⊑[g] K2 & L2 = K2. ⓛW2 & I = Abbr.
+#h #g #L1 #L2 * -L1 -L2
+[ #J #K1 #U1 #H destruct
+| #I #L1 #L2 #V #HL12 #J #K1 #U1 #H destruct /3 width=3/
+| #L1 #L2 #V1 #V2 #W1 #W2 #l #HW12 #HVW1 #HWV2 #HL12 #J #K1 #U1 #H destruct /3 width=10/
+]
+qed-.
+
+lemma lsubss_inv_pair1: ∀h,g,I,K1,L2,V1. h ⊢ K1. ⓑ{I} V1 •⊑[g] L2 →
+ (∃∃K2. h ⊢ K1 •⊑[g] K2 & L2 = K2. ⓑ{I} V1) ∨
+ ∃∃K2,W1,W2,V2,l. ⦃h, K1⦄ ⊢ V1 •[g] ⦃l+1, W1⦄ & ⦃h, K2⦄ ⊢ W2 •[g] ⦃l, V2⦄ &
+ K1 ⊢ W1 ⬌* W2 & h ⊢ K1 •⊑[g] K2 & L2 = K2. ⓛW2 & I = Abbr.
+/2 width=3 by lsubss_inv_pair1_aux/ qed-.
+
+fact lsubss_inv_atom2_aux: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 → L2 = ⋆ → L1 = ⋆.
+#h #g #L1 #L2 * -L1 -L2
+[ //
+| #I #L1 #L2 #V #_ #H destruct
+| #L1 #L2 #V1 #V2 #W1 #W2 #l #_ #_ #_ #_ #H destruct
+]
+qed-.
+
+lemma lsubss_inv_atom2: ∀h,g,L1. h ⊢ L1 •⊑[g] ⋆ → L1 = ⋆.
+/2 width=5 by lsubss_inv_atom2_aux/ qed-.
+
+fact lsubss_inv_pair2_aux: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 →
+ ∀I,K2,W2. L2 = K2. ⓑ{I} W2 →
+ (∃∃K1. h ⊢ K1 •⊑[g] K2 & L1 = K1. ⓑ{I} W2) ∨
+ ∃∃K1,W1,V1,V2,l. ⦃h, K1⦄ ⊢ V1 •[g] ⦃l+1, W1⦄ & ⦃h, K2⦄ ⊢ W2 •[g] ⦃l, V2⦄ &
+ K1 ⊢ W1 ⬌* W2 & h ⊢ K1 •⊑[g] K2 & L1 = K1. ⓓV1 & I = Abst.
+#h #g #L1 #L2 * -L1 -L2
+[ #J #K2 #U2 #H destruct
+| #I #L1 #L2 #V #HL12 #J #K2 #U2 #H destruct /3 width=3/
+| #L1 #L2 #V1 #V2 #W1 #W2 #l #HW12 #HVW1 #HWV2 #HL12 #J #K2 #U2 #H destruct /3 width=10/
+]
+qed-.
+
+lemma lsubss_inv_pair2: ∀h,g,I,L1,K2,W2. h ⊢ L1 •⊑[g] K2. ⓑ{I} W2 →
+ (∃∃K1. h ⊢ K1 •⊑[g] K2 & L1 = K1. ⓑ{I} W2) ∨
+ ∃∃K1,W1,V1,V2,l. ⦃h, K1⦄ ⊢ V1 •[g] ⦃l+1, W1⦄ & ⦃h, K2⦄ ⊢ W2 •[g] ⦃l, V2⦄ &
+ K1 ⊢ W1 ⬌* W2 & h ⊢ K1 •⊑[g] K2 & L1 = K1. ⓓV1 & I = Abst.
+/2 width=3 by lsubss_inv_pair2_aux/ qed-.
+
+(* Basic_forward lemmas *****************************************************)
+
+axiom lsubss_fwd_lsubx: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 → L1 ⓝ⊑ L2.
+(*
+#h #g #L1 #L2 #H elim H -L1 -L2 // /2 width=1/
+qed-.
+*)
+(* Basic properties *********************************************************)
+
+lemma lsubss_refl: ∀h,g,L. h ⊢ L •⊑[g] L.
+#h #g #L elim L -L // /2 width=1/
+qed.
+
+lemma lsubss_cprs_trans: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 →
+ ∀T1,T2. L2 ⊢ T1 ➡* T2 → L1 ⊢ T1 ➡* T2.
+/3 width=5 by lsubss_fwd_lsubx, lsubx_cprs_trans/
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/equivalence/cpcs_cpcs.ma".
+include "basic_2/equivalence/lsubss.ma".
+
+(* LOCAL ENVIRONMENT REFINEMENT FOR STRATIFIED STATIC TYPE ASSIGNMENT *******)
+
+(* Properties on context-sensitive parallel equivalence for terms ***********)
+
+lemma lsubss_cpcs_trans: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 →
+ ∀T1,T2. L2 ⊢ T1 ⬌* T2 → L1 ⊢ T1 ⬌* T2.
+/3 width=5 by lsubss_fwd_lsubx, lsubx_cpcs_trans/
+qed-.
--- /dev/null
+lemma lsubsv_fwd_lsubss: ∀h,g,L1,L2. h ⊢ L1 ¡⊑[g] L2 → h ⊢ L1 •⊑[g] L2.
+#h #g #L1 #L2 #H elim H -L1 -L2 // /2 width=1/ /2 width=6/
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/equivalence/lsubss.ma".
+
+(* LOCAL ENVIRONMENT REFINEMENT FOR STRATIFIED STATIC TYPE ASSIGNMENT *******)
+
+(* Properties concerning basic local environment slicing ********************)
+
+(* Note: the constant 0 cannot be generalized *)
+lemma lsubss_ldrop_O1_conf: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 →
+ ∀K1,e. ⇩[0, e] L1 ≡ K1 →
+ ∃∃K2. h ⊢ K1 •⊑[g] K2 & ⇩[0, e] L2 ≡ K2.
+#h #g #L1 #L2 #H elim H -L1 -L2
+[ /2 width=3/
+| #I #L1 #L2 #V #_ #IHL12 #K1 #e #H
+ elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK1
+ [ destruct
+ elim (IHL12 L1 0) -IHL12 // #X #HL12 #H
+ <(ldrop_inv_O2 … H) in HL12; -H /3 width=3/
+ | elim (IHL12 … HLK1) -L1 /3 width=3/
+ ]
+| #L1 #L2 #V1 #V2 #W1 #W2 #l #HW12 #HVW1 #HWV2 #_ #IHL12 #K1 #e #H
+ elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK1
+ [ destruct
+ elim (IHL12 L1 0) -IHL12 // #X #HL12 #H
+ <(ldrop_inv_O2 … H) in HL12; -H /3 width=6/
+ | elim (IHL12 … HLK1) -L1 /3 width=3/
+ ]
+]
+qed-.
+
+(* Note: the constant 0 cannot be generalized *)
+lemma lsubss_ldrop_O1_trans: ∀h,g,L1,L2. h ⊢ L1 •⊑[g] L2 →
+ ∀K2,e. ⇩[0, e] L2 ≡ K2 →
+ ∃∃K1. h ⊢ K1 •⊑[g] K2 & ⇩[0, e] L1 ≡ K1.
+#h #g #L1 #L2 #H elim H -L1 -L2
+[ /2 width=3/
+| #I #L1 #L2 #V #_ #IHL12 #K2 #e #H
+ elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK2
+ [ destruct
+ elim (IHL12 L2 0) -IHL12 // #X #HL12 #H
+ <(ldrop_inv_O2 … H) in HL12; -H /3 width=3/
+ | elim (IHL12 … HLK2) -L2 /3 width=3/
+ ]
+| #L1 #L2 #V1 #V2 #W1 #W2 #l #HW12 #HVW1 #HWV2 #_ #IHL12 #K2 #e #H
+ elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK2
+ [ destruct
+ elim (IHL12 L2 0) -IHL12 // #X #HL12 #H
+ <(ldrop_inv_O2 … H) in HL12; -H /3 width=6/
+ | elim (IHL12 … HLK2) -L2 /3 width=3/
+ ]
+]
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/ssta_ssta.ma".
+include "basic_2/equivalence/cpcs_cpcs.ma".
+include "basic_2/equivalence/lsubss_ldrop.ma".
+
+(* LOCAL ENVIRONMENT REFINEMENT FOR STRATIFIED STATIC TYPE ASSIGNMENT *******)
+
+(* Properties on stratified native type assignment **************************)
+
+lemma lsubss_ssta_trans: ∀h,g,L2,T,U2,l. ⦃h, L2⦄ ⊢ T •[g] ⦃l, U2⦄ →
+ ∀L1. h ⊢ L1 •⊑[g] L2 →
+ ∃∃U1. ⦃h, L1⦄ ⊢ T •[g] ⦃l, U1⦄ & L1 ⊢ U1 ⬌* U2.
+#h #g #L2 #T #U #l #H elim H -L2 -T -U -l
+[ /3 width=3/
+| #L2 #K2 #V2 #W2 #U2 #i #l #HLK2 #_ #HWU2 #IHVW2 #L1 #HL12
+ elim (lsubss_ldrop_O1_trans … HL12 … HLK2) -L2 #X #H #HLK1
+ elim (lsubss_inv_pair2 … H) -H * #K1 [ | -HWU2 -IHVW2 -HLK1 ]
+ [ #HK12 #H destruct
+ elim (IHVW2 … HK12) -K2 #T2 #HVT2 #HTW2
+ lapply (ldrop_fwd_ldrop2 … HLK1) #H
+ elim (lift_total T2 0 (i+1)) /3 width=11/
+ | #W1 #V1 #W2 #l0 #_ #_ #_ #_ #_ #H destruct
+ ]
+| #L2 #K2 #W2 #V2 #U2 #i #l #HLK2 #HWV2 #HWU2 #IHWV2 #L1 #HL12
+ elim (lsubss_ldrop_O1_trans … HL12 … HLK2) -L2 #X #H #HLK1
+ elim (lsubss_inv_pair2 … H) -H * #K1 [ -HWV2 | -IHWV2 ]
+ [ #HK12 #H destruct
+ elim (IHWV2 … HK12) -K2 /3 width=6/
+ | #W1 #V1 #T2 #l0 #HVW1 #HWT2 #HW12 #_ #H #_ destruct
+ elim (ssta_mono … HWV2 … HWT2) -HWV2 -HWT2 #H1 #H2 destruct
+ lapply (ldrop_fwd_ldrop2 … HLK1) #H
+ elim (lift_total W1 0 (i+1)) /3 width=11/
+ ]
+| #a #I #L2 #V2 #T2 #U2 #l #_ #IHTU2 #L1 #HL12
+ elim (IHTU2 (L1.ⓑ{I}V2) …) [2: /2 width=1/ ] -L2 /3 width=3/
+| #L2 #V2 #T2 #U2 #l #_ #IHTU2 #L1 #HL12
+ elim (IHTU2 … HL12) -L2 /3 width=5/
+| #L2 #W2 #T2 #U2 #l #_ #IHTU2 #L1 #HL12
+ elim (IHTU2 … HL12) -L2 /3 width=3/
+]
+qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/notation/relations/statictype_7.ma".
-include "basic_2/grammar/genv.ma".
-include "basic_2/relocation/ldrop.ma".
-include "basic_2/static/sd.ma".
-
-(* STRATIFIED STATIC TYPE ASSIGNMENT ON TERMS *******************************)
-
-(* activate genv *)
-inductive ssta (h:sh) (g:sd h): nat → relation4 genv lenv term term ≝
-| ssta_sort: ∀G,L,k,l. deg h g k l → ssta h g l G L (⋆k) (⋆(next h k))
-| ssta_ldef: ∀G,L,K,V,W,U,i,l. ⇩[0, i] L ≡ K. ⓓV → ssta h g l G K V W →
- ⇧[0, i + 1] W ≡ U → ssta h g l G L (#i) U
-| ssta_ldec: ∀G,L,K,W,V,U,i,l. ⇩[0, i] L ≡ K. ⓛW → ssta h g l G K W V →
- ⇧[0, i + 1] W ≡ U → ssta h g (l+1) G L (#i) U
-| ssta_bind: ∀a,I,G,L,V,T,U,l. ssta h g l G (L. ⓑ{I} V) T U →
- ssta h g l G L (ⓑ{a,I}V.T) (ⓑ{a,I}V.U)
-| ssta_appl: ∀G,L,V,T,U,l. ssta h g l G L T U →
- ssta h g l G L (ⓐV.T) (ⓐV.U)
-| ssta_cast: ∀G,L,W,T,U,l. ssta h g l G L T U → ssta h g l G L (ⓝW.T) U
-.
-
-interpretation "stratified static type assignment (term)"
- 'StaticType h g G L T U l = (ssta h g l G L T U).
-
-definition ssta_step: ∀h. sd h → relation4 genv lenv term term ≝
- λh,g,G,L,T,U. ∃l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l+1, U⦄.
-
-(* Basic inversion lemmas ************************************************)
-
-fact ssta_inv_sort1_aux: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l, U⦄ → ∀k0. T = ⋆k0 →
- deg h g k0 l ∧ U = ⋆(next h k0).
-#h #g #G #L #T #U #l * -G -L -T -U -l
-[ #G #L #k #l #Hkl #k0 #H destruct /2 width=1/
-| #G #L #K #V #W #U #i #l #_ #_ #_ #k0 #H destruct
-| #G #L #K #W #V #U #i #l #_ #_ #_ #k0 #H destruct
-| #a #I #G #L #V #T #U #l #_ #k0 #H destruct
-| #G #L #V #T #U #l #_ #k0 #H destruct
-| #G #L #W #T #U #l #_ #k0 #H destruct
-qed-.
-
-lemma ssta_inv_sort1: ∀h,g,G,L,U,k,l. ⦃G, L⦄ ⊢ ⋆k •[h, g] ⦃l, U⦄ →
- deg h g k l ∧ U = ⋆(next h k).
-/2 width=5 by ssta_inv_sort1_aux/ qed-.
-
-fact ssta_inv_lref1_aux: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l, U⦄ → ∀j. T = #j →
- (∃∃K,V,W. ⇩[0, j] L ≡ K. ⓓV & ⦃G, K⦄ ⊢ V •[h, g] ⦃l, W⦄ &
- ⇧[0, j + 1] W ≡ U
- ) ∨
- (∃∃K,W,V,l0. ⇩[0, j] L ≡ K. ⓛW & ⦃G, K⦄ ⊢ W •[h, g] ⦃l0, V⦄ &
- ⇧[0, j + 1] W ≡ U & l = l0 + 1
- ).
-#h #g #G #L #T #U #l * -G -L -T -U -l
-[ #G #L #k #l #_ #j #H destruct
-| #G #L #K #V #W #U #i #l #HLK #HVW #HWU #j #H destruct /3 width=6/
-| #G #L #K #W #V #U #i #l #HLK #HWV #HWU #j #H destruct /3 width=8/
-| #a #I #G #L #V #T #U #l #_ #j #H destruct
-| #G #L #V #T #U #l #_ #j #H destruct
-| #G #L #W #T #U #l #_ #j #H destruct
-]
-qed-.
-
-lemma ssta_inv_lref1: ∀h,g,G,L,U,i,l. ⦃G, L⦄ ⊢ #i •[h, g] ⦃l, U⦄ →
- (∃∃K,V,W. ⇩[0, i] L ≡ K. ⓓV & ⦃G, K⦄ ⊢ V •[h, g] ⦃l, W⦄ &
- ⇧[0, i + 1] W ≡ U
- ) ∨
- (∃∃K,W,V,l0. ⇩[0, i] L ≡ K. ⓛW & ⦃G, K⦄ ⊢ W •[h, g] ⦃l0, V⦄ &
- ⇧[0, i + 1] W ≡ U & l = l0 + 1
- ).
-/2 width=3 by ssta_inv_lref1_aux/ qed-.
-
-fact ssta_inv_gref1_aux: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l, U⦄ → ∀p0. T = §p0 → ⊥.
-#h #g #G #L #T #U #l * -G -L -T -U -l
-[ #G #L #k #l #_ #p0 #H destruct
-| #G #L #K #V #W #U #i #l #_ #_ #_ #p0 #H destruct
-| #G #L #K #W #V #U #i #l #_ #_ #_ #p0 #H destruct
-| #a #I #G #L #V #T #U #l #_ #p0 #H destruct
-| #G #L #V #T #U #l #_ #p0 #H destruct
-| #G #L #W #T #U #l #_ #p0 #H destruct
-qed-.
-
-lemma ssta_inv_gref1: ∀h,g,G,L,U,p,l. ⦃G, L⦄ ⊢ §p •[h, g] ⦃l, U⦄ → ⊥.
-/2 width=10 by ssta_inv_gref1_aux/ qed-.
-
-fact ssta_inv_bind1_aux: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l, U⦄ →
- ∀a,I,X,Y. T = ⓑ{a,I}Y.X →
- ∃∃Z. ⦃G, L.ⓑ{I}Y⦄ ⊢ X •[h, g] ⦃l, Z⦄ & U = ⓑ{a,I}Y.Z.
-#h #g #G #L #T #U #l * -G -L -T -U -l
-[ #G #L #k #l #_ #a #I #X #Y #H destruct
-| #G #L #K #V #W #U #i #l #_ #_ #_ #a #I #X #Y #H destruct
-| #G #L #K #W #V #U #i #l #_ #_ #_ #a #I #X #Y #H destruct
-| #b #J #G #L #V #T #U #l #HTU #a #I #X #Y #H destruct /2 width=3/
-| #G #L #V #T #U #l #_ #a #I #X #Y #H destruct
-| #G #L #W #T #U #l #_ #a #I #X #Y #H destruct
-]
-qed-.
-
-lemma ssta_inv_bind1: ∀h,g,a,I,G,L,Y,X,U,l. ⦃G, L⦄ ⊢ ⓑ{a,I}Y.X •[h, g] ⦃l, U⦄ →
- ∃∃Z. ⦃G, L.ⓑ{I}Y⦄ ⊢ X •[h, g] ⦃l, Z⦄ & U = ⓑ{a,I}Y.Z.
-/2 width=3 by ssta_inv_bind1_aux/ qed-.
-
-fact ssta_inv_appl1_aux: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l, U⦄ → ∀X,Y. T = ⓐY.X →
- ∃∃Z. ⦃G, L⦄ ⊢ X •[h, g] ⦃l, Z⦄ & U = ⓐY.Z.
-#h #g #G #L #T #U #l * -G -L -T -U -l
-[ #G #L #k #l #_ #X #Y #H destruct
-| #G #L #K #V #W #U #i #l #_ #_ #_ #X #Y #H destruct
-| #G #L #K #W #V #U #i #l #_ #_ #_ #X #Y #H destruct
-| #a #I #G #L #V #T #U #l #_ #X #Y #H destruct
-| #G #L #V #T #U #l #HTU #X #Y #H destruct /2 width=3/
-| #G #L #W #T #U #l #_ #X #Y #H destruct
-]
-qed-.
-
-lemma ssta_inv_appl1: ∀h,g,G,L,Y,X,U,l. ⦃G, L⦄ ⊢ ⓐY.X •[h, g] ⦃l, U⦄ →
- ∃∃Z. ⦃G, L⦄ ⊢ X •[h, g] ⦃l, Z⦄ & U = ⓐY.Z.
-/2 width=3 by ssta_inv_appl1_aux/ qed-.
-
-fact ssta_inv_cast1_aux: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l, U⦄ →
- ∀X,Y. T = ⓝY.X → ⦃G, L⦄ ⊢ X •[h, g] ⦃l, U⦄.
-#h #g #G #L #T #U #l * -G -L -T -U -l
-[ #G #L #k #l #_ #X #Y #H destruct
-| #G #L #K #V #W #U #l #i #_ #_ #_ #X #Y #H destruct
-| #G #L #K #W #V #U #l #i #_ #_ #_ #X #Y #H destruct
-| #a #I #G #L #V #T #U #l #_ #X #Y #H destruct
-| #G #L #V #T #U #l #_ #X #Y #H destruct
-| #G #L #W #T #U #l #HTU #X #Y #H destruct //
-]
-qed-.
-
-lemma ssta_inv_cast1: ∀h,g,G,L,X,Y,U,l. ⦃G, L⦄ ⊢ ⓝY.X •[h, g] ⦃l, U⦄ →
- ⦃G, L⦄ ⊢ X •[h, g] ⦃l, U⦄.
-/2 width=4 by ssta_inv_cast1_aux/ qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/static/aaa_lift.ma".
-include "basic_2/static/ssta.ma".
-
-(* STRATIFIED STATIC TYPE ASSIGNMENT ON TERMS *******************************)
-
-(* Properties on atomic arity assignment for terms **************************)
-
-lemma ssta_aaa: ∀h,g,G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∀U,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l, U⦄ → ⦃G, L⦄ ⊢ U ⁝ A.
-#h #g #G #L #T #A #H elim H -G -L -T -A
-[ #G #L #k #U #l #H
- elim (ssta_inv_sort1 … H) -H #_ #H destruct //
-| #I #G #L #K #V #B #i #HLK #HV #IHV #U #l #H
- elim (ssta_inv_lref1 … H) -H * #K0 #V0 #W0 [2: #l0 ] #HLK0 #HVW0 #HU [ #H ]
- lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H0 destruct
- lapply (ldrop_fwd_ldrop2 … HLK) -HLK #HLK
- @(aaa_lift … HLK … HU) -HU -L // -HV /2 width=2/
-| #a #G #L #V #T #B #A #HV #_ #_ #IHT #X #l #H
- elim (ssta_inv_bind1 … H) -H #U #HTU #H destruct /3 width=2/
-| #a #G #L #V #T #B #A #HV #_ #_ #IHT #X #l #H
- elim (ssta_inv_bind1 … H) -H #U #HTU #H destruct /3 width=2/
-| #G #L #V #T #B #A #HV #_ #_ #IHT #X #l #H
- elim (ssta_inv_appl1 … H) -H #U #HTU #H destruct /3 width=3/
-| #G #L #V #T #A #_ #_ #IHV #IHT #X #l #H
- lapply (ssta_inv_cast1 … H) -H /2 width=2/
-]
-qed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/relocation/ldrop_ldrop.ma".
-include "basic_2/static/ssta.ma".
-
-(* STRATIFIED STATIC TYPE ASSIGNMENT ON TERMS *******************************)
-
-(* Properties on relocation *************************************************)
-
-lemma ssta_lift: ∀h,g,G,L1,T1,U1,l. ⦃G, L1⦄ ⊢ T1 •[h, g] ⦃l, U1⦄ →
- ∀L2,d,e. ⇩[d, e] L2 ≡ L1 → ∀T2. ⇧[d, e] T1 ≡ T2 →
- ∀U2. ⇧[d, e] U1 ≡ U2 → ⦃G, L2⦄ ⊢ T2 •[h, g] ⦃l, U2⦄.
-#h #g #G #L1 #T1 #U1 #l #H elim H -G -L1 -T1 -U1 -l
-[ #G #L1 #k #l #Hkl #L2 #d #e #HL21 #X1 #H1 #X2 #H2
- >(lift_inv_sort1 … H1) -X1
- >(lift_inv_sort1 … H2) -X2 /2 width=1/
-| #G #L1 #K1 #V1 #W1 #W #i #l #HLK1 #_ #HW1 #IHVW1 #L2 #d #e #HL21 #X #H #U2 #HWU2
- elim (lift_inv_lref1 … H) * #Hid #H destruct
- [ elim (lift_trans_ge … HW1 … HWU2 ?) -W // #W2 #HW12 #HWU2
- elim (ldrop_trans_le … HL21 … HLK1 ?) -L1 /2 width=2/ #X #HLK2 #H
- elim (ldrop_inv_skip2 … H ?) -H /2 width=1/ -Hid #K2 #V2 #HK21 #HV12 #H destruct
- /3 width=8/
- | lapply (lift_trans_be … HW1 … HWU2 ? ?) -W // /2 width=1/ #HW1U2
- lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 // -Hid /3 width=8/
- ]
-| #G #L1 #K1 #W1 #V1 #W #i #l #HLK1 #_ #HW1 #IHWV1 #L2 #d #e #HL21 #X #H #U2 #HWU2
- elim (lift_inv_lref1 … H) * #Hid #H destruct
- [ elim (lift_trans_ge … HW1 … HWU2 ?) -W // <minus_plus #W #HW1 #HWU2
- elim (ldrop_trans_le … HL21 … HLK1 ?) -L1 /2 width=2/ #X #HLK2 #H
- elim (ldrop_inv_skip2 … H ?) -H /2 width=1/ -Hid #K2 #W2 #HK21 #HW12 #H destruct
- lapply (lift_mono … HW1 … HW12) -HW1 #H destruct
- elim (lift_total V1 (d-i-1) e) /3 width=8/
- | lapply (lift_trans_be … HW1 … HWU2 ? ?) -W // /2 width=1/ #HW1U2
- lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 // -Hid /3 width=8/
- ]
-| #a #I #G #L1 #V1 #T1 #U1 #l #_ #IHTU1 #L2 #d #e #HL21 #X1 #H1 #X2 #H2
- elim (lift_inv_bind1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H destruct
- elim (lift_inv_bind1 … H2) -H2 #X #U2 #H1 #HU12 #H2 destruct
- lapply (lift_mono … H1 … HV12) -H1 #H destruct /4 width=5/
-| #G #L1 #V1 #T1 #U1 #l #_ #IHTU1 #L2 #d #e #HL21 #X1 #H1 #X2 #H2
- elim (lift_inv_flat1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H destruct
- elim (lift_inv_flat1 … H2) -H2 #X #U2 #H1 #HU12 #H2 destruct
- lapply (lift_mono … H1 … HV12) -H1 #H destruct /4 width=5/
-| #G #L1 #W1 #T1 #U1 #l #_ #IHTU1 #L2 #d #e #HL21 #X #H #U2 #HU12
- elim (lift_inv_flat1 … H) -H #W2 #T2 #HW12 #HT12 #H destruct /3 width=5/
-]
-qed.
-
-lemma ssta_inv_lift1: ∀h,g,G,L2,T2,U2,l. ⦃G, L2⦄ ⊢ T2 •[h, g] ⦃l, U2⦄ →
- ∀L1,d,e. ⇩[d, e] L2 ≡ L1 → ∀T1. ⇧[d, e] T1 ≡ T2 →
- ∃∃U1. ⦃G, L1⦄ ⊢ T1 •[h, g] ⦃l, U1⦄ & ⇧[d, e] U1 ≡ U2.
-#h #g #G #L2 #T2 #U2 #l #H elim H -G -L2 -T2 -U2 -l
-[ #G #L2 #k #l #Hkl #L1 #d #e #_ #X #H
- >(lift_inv_sort2 … H) -X /3 width=3/
-| #G #L2 #K2 #V2 #W2 #W #i #l #HLK2 #HVW2 #HW2 #IHVW2 #L1 #d #e #HL21 #X #H
- elim (lift_inv_lref2 … H) * #Hid #H destruct [ -HVW2 | -IHVW2 ]
- [ elim (ldrop_conf_lt … HL21 … HLK2 ?) -L2 // #K1 #V1 #HLK1 #HK21 #HV12
- elim (IHVW2 … HK21 … HV12) -K2 -V2 #W1 #HVW1 #HW12
- elim (lift_trans_le … HW12 … HW2 ?) -W2 // >minus_plus <plus_minus_m_m // -Hid /3 width=6/
- | lapply (ldrop_conf_ge … HL21 … HLK2 ?) -L2 // #HL1K2
- elim (le_inv_plus_l … Hid) -Hid #Hdie #ei
- elim (lift_split … HW2 d (i-e+1) ? ? ?) -HW2 // [3: /2 width=1/ ]
- [ #W0 #HW20 <le_plus_minus_comm // >minus_minus_m_m /2 width=1/ /3 width=6/
- | <le_plus_minus_comm //
- ]
- ]
-| #G #L2 #K2 #W2 #V2 #W #i #l #HLK2 #HWV2 #HW2 #IHWV2 #L1 #d #e #HL21 #X #H
- elim (lift_inv_lref2 … H) * #Hid #H destruct [ -HWV2 | -IHWV2 ]
- [ elim (ldrop_conf_lt … HL21 … HLK2 ?) -L2 // #K1 #W1 #HLK1 #HK21 #HW12
- elim (IHWV2 … HK21 … HW12) -K2 #V1 #HWV1 #_
- elim (lift_trans_le … HW12 … HW2 ?) -W2 // >minus_plus <plus_minus_m_m // -Hid /3 width=6/
- | lapply (ldrop_conf_ge … HL21 … HLK2 ?) -L2 // #HL1K2
- elim (le_inv_plus_l … Hid) -Hid #Hdie #ei
- elim (lift_split … HW2 d (i-e+1) ? ? ?) -HW2 // [3: /2 width=1/ ]
- [ #W0 #HW20 <le_plus_minus_comm // >minus_minus_m_m /2 width=1/ /3 width=6/
- | <le_plus_minus_comm //
- ]
- ]
-| #a #I #G #L2 #V2 #T2 #U2 #l #_ #IHTU2 #L1 #d #e #HL21 #X #H
- elim (lift_inv_bind2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
- elim (IHTU2 (L1.ⓑ{I}V1) … HT12) -IHTU2 -HT12 /2 width=1/ -HL21 /3 width=5/
-| #G #L2 #V2 #T2 #U2 #l #_ #IHTU2 #L1 #d #e #HL21 #X #H
- elim (lift_inv_flat2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
- elim (IHTU2 … HL21 … HT12) -L2 -HT12 /3 width=5/
-| #G #L2 #W2 #T2 #U2 #l #_ #IHTU2 #L1 #d #e #HL21 #X #H
- elim (lift_inv_flat2 … H) -H #W1 #T1 #HW12 #HT12 #H destruct
- elim (IHTU2 … HL21 … HT12) -L2 -HT12 /3 width=3/
-]
-qed-.
-
-(* Advanced forvard lemmas **************************************************)
-
-lemma ssta_fwd_correct: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l, U⦄ →
- ∃T0. ⦃G, L⦄ ⊢ U •[h, g] ⦃l-1, T0⦄.
-#h #g #G #L #T #U #l #H elim H -G -L -T -U -l
-[ /4 width=2/
-| #G #L #K #V #W #W0 #i #l #HLK #_ #HW0 * #V0 #HWV0
- lapply (ldrop_fwd_ldrop2 … HLK) -HLK #HLK
- elim (lift_total V0 0 (i+1)) /3 width=10/
-| #G #L #K #W #V #V0 #i #l #HLK #HWV #HWV0 #_
- lapply (ldrop_fwd_ldrop2 … HLK) -HLK #HLK
- elim (lift_total V 0 (i+1)) /3 width=10/
-| #a #I #G #L #V #T #U #l #_ * /3 width=2/
-| #G #L #V #T #U #l #_ * #T0 #HUT0 /3 width=2/
-| #G #L #W #T #U #l #_ * /2 width=2/
-]
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/static/ssta_lift.ma".
-
-(* STRATIFIED STATIC TYPE ASSIGNMENT ON TERMS *******************************)
-
-(* Main properties **********************************************************)
-
-theorem ssta_mono: ∀h,g,G,L,T,U1,l1. ⦃G, L⦄ ⊢ T •[h, g] ⦃l1, U1⦄ →
- ∀U2,l2. ⦃G, L⦄ ⊢ T •[h, g] ⦃l2, U2⦄ → l1 = l2 ∧ U1 = U2.
-#h #g #G #L #T #U1 #l1 #H elim H -G -L -T -U1 -l1
-[ #G #L #k #l #Hkl #X #l2 #H
- elim (ssta_inv_sort1 … H) -H #Hkl2 #H destruct
- >(deg_mono … Hkl2 … Hkl) -g -L -l2 /2 width=1/
-| #G #L #K #V #W #U1 #i #l1 #HLK #_ #HWU1 #IHVW #U2 #l2 #H
- elim (ssta_inv_lref1 … H) -H * #K0 #V0 #W0 [2: #l0] #HLK0 #HVW0 #HW0U2
- lapply (ldrop_mono … HLK0 … HLK) -HLK -HLK0 #H destruct
- lapply (IHVW … HVW0) -IHVW -HVW0 * #H1 #H2 destruct
- >(lift_mono … HWU1 … HW0U2) -W0 -U1 /2 width=1/
-| #G #L #K #W #V #U1 #i #l1 #HLK #_ #HWU1 #IHWV #U2 #l2 #H
- elim (ssta_inv_lref1 … H) -H * #K0 #W0 #V0 [2: #l0 ] #HLK0 #HWV0 #HV0U2
- lapply (ldrop_mono … HLK0 … HLK) -HLK -HLK0 #H destruct
- lapply (IHWV … HWV0) -IHWV -HWV0 * #H1 #H2 destruct
- >(lift_mono … HWU1 … HV0U2) -W -U1 /2 width=1/
-| #a #I #G #L #V #T #U1 #l1 #_ #IHTU1 #X #l2 #H
- elim (ssta_inv_bind1 … H) -H #U2 #HTU2 #H destruct
- elim (IHTU1 … HTU2) -T /3 width=1/
-| #G #L #V #T #U1 #l1 #_ #IHTU1 #X #l2 #H
- elim (ssta_inv_appl1 … H) -H #U2 #HTU2 #H destruct
- elim (IHTU1 … HTU2) -T /3 width=1/
-| #G #L #W1 #T #U1 #l1 #_ #IHTU1 #U2 #l2 #H
- lapply (ssta_inv_cast1 … H) -H #HTU2
- elim (IHTU1 … HTU2) -T /2 width=1/
-]
-qed-.
-
-(* Advanced inversion lemmas ************************************************)
-
-lemma ssta_inv_refl_pos: ∀h,g,G,L,T,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l+1, T⦄ → ⊥.
-#h #g #G #L #T #l #HTT
-elim (ssta_fwd_correct … HTT) <minus_plus_m_m #U #HTU
-elim (ssta_mono … HTU … HTT) -h -L #H #_ -T -U
-elim (plus_xySz_x_false 0 l 0 ?) //
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
-
-notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 • break [ term 46 h, break term 46 g ] break ⦃ term 46 l , break term 46 T2 ⦄ )"
- non associative with precedence 45
- for @{ 'StaticType $h $g $G $L $T1 $T2 $l }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/ssta.ma".
+include "basic_2/static/aaa_lift.ma".
+include "basic_2/static/aaa_da.ma".
+
+(* ATONIC ARITY ASSIGNMENT FOR TERMS ****************************************)
+
+(* Properties on stratified static type assignment for terms ****************)
+
+lemma aaa_ssta_conf: ∀h,g,G,L. Conf3 … (aaa G L) (ssta h g G L).
+#h #g #G #L #T #A #H elim H -G -L -T -A
+[ #G #L #k #U #H
+ lapply (ssta_inv_sort1 … H) -H #H destruct //
+| #I #G #L #K #V #B #i #HLK #HV #IHV #U #H
+ elim (ssta_inv_lref1 … H) -H * #K0 #V0 #W0 #HLK0 #HVW0 #HU
+ lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H0 destruct
+ lapply (ldrop_fwd_drop2 … HLK) -HLK #HLK
+ @(aaa_lift … HLK … HU) -HU -L // -HV /2 width=2/
+| #a #G #L #V #T #B #A #HV #_ #_ #IHT #X #H
+ elim (ssta_inv_bind1 … H) -H #U #HTU #H destruct /3 width=2/
+| #a #G #L #V #T #B #A #HV #_ #_ #IHT #X #H
+ elim (ssta_inv_bind1 … H) -H #U #HTU #H destruct /3 width=2/
+| #G #L #V #T #B #A #HV #_ #_ #IHT #X #H
+ elim (ssta_inv_appl1 … H) -H #U #HTU #H destruct /3 width=3/
+| #G #L #V #T #A #_ #_ #IHV #IHT #X #H
+ lapply (ssta_inv_cast1 … H) -H /2 width=2/
+]
+qed-.
+
+(* Forward lemmas on stratified static type assignment for terms ************)
+
+lemma aaa_fwd_ssta: ∀h,g,G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∃U. ⦃G, L⦄ ⊢ T •[h, g] U.
+#h #g #G #L #T #A #H elim (aaa_fwd_da … H) -H /2 width=3 by da_ssta/
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/notation/relations/dpredstar_6.ma".
+include "basic_2/unfold/lsstas.ma".
+include "basic_2/computation/cprs.ma".
+
+(* DECOMPOSED EXTENDED PARALLEL COMPUTATION ON TERMS ************************)
+
+definition cpds: ∀h. sd h → relation4 genv lenv term term ≝
+ λh,g,G,L,T1,T2.
+ ∃∃T,l1,l2. l2 ≤ l1 & ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 & ⦃G, L⦄ ⊢ T1 •*[h, g, l2] T & ⦃G, L⦄ ⊢ T ➡* T2.
+
+interpretation "decomposed extended parallel computation (term)"
+ 'DPRedStar h g G L T1 T2 = (cpds h g G L T1 T2).
+
+(* Basic properties *********************************************************)
+
+lemma ssta_cprs_cpds: ∀h,g,G,L,T1,T,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T1 •[h, g] T →
+ ⦃G, L⦄ ⊢ T ➡* T2 → ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2.
+/3 width=7/ qed.
+
+lemma lsstas_cpds: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l → ⦃G, L⦄ ⊢ T1 •*[h, g, l] T2 → ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2.
+/2 width=7/ qed.
+
+lemma cprs_cpds: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l → ⦃G, L⦄ ⊢ T1 ➡* T2 → ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2.
+/2 width=7/ qed.
+
+lemma cpds_refl: ∀h,g,G,L,T,l. ⦃G, L⦄ ⊢ T ▪[h, g] l → ⦃G, L⦄ ⊢ T •*➡*[h, g] T.
+/2 width=2/ qed.
+
+lemma cpds_strap1: ∀h,g,G,L,T1,T,T2.
+ ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T → ⦃G, L⦄ ⊢ T ➡ T2 → ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2.
+#h #g #G #L #T1 #T #T2 * /3 width=9/
+qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/unfold/lsstas_aaa.ma".
+include "basic_2/computation/cpxs_aaa.ma".
+include "basic_2/computation/cpds.ma".
+
+(* DECOMPOSED EXTENDED PARALLEL COMPUTATION ON TERMS ************************)
+
+(* Properties on atomic arity assignment for terms **************************)
+
+lemma cpds_aaa_conf: ∀h,g,G,L. Conf3 … (aaa G L) (cpds h g G L).
+#h #g #G #L #A #T #HT #U * /3 width=6 by lsstas_aaa_conf, cprs_aaa_conf/
+qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/unfold/lsstas_lsstas.ma".
+include "basic_2/computation/lprs_cprs.ma".
+include "basic_2/computation/cpxs_cpxs.ma".
+include "basic_2/computation/cpds.ma".
+
+(* DECOMPOSED EXTENDED PARALLEL COMPUTATION ON TERMS ************************)
+
+(* Advanced properties ******************************************************)
+
+lemma cpds_strap2: ∀h,g,G,L,T1,T,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 →
+ ⦃G, L⦄ ⊢ T1 •[h, g] T → ⦃G, L⦄ ⊢ T •*➡*[h, g] T2 → ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2.
+#h #g #G #L #T1 #T #T2 #l #Hl #HT1 *
+#T0 #l0 #l1 #Hl10 #HT #HT0 #HT02
+lapply (ssta_da_conf … HT1 … Hl) <minus_plus_m_m #H0T
+lapply (da_mono … H0T … HT) -HT -H0T #H destruct
+/3 width=7 by lsstas_step_sn, le_S_S, ex4_3_intro/
+qed.
+
+lemma cpds_cprs_trans: ∀h,g,G,L,T1,T,T2.
+ ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T → ⦃G, L⦄ ⊢ T ➡* T2 → ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2.
+#h #g #G #L #T1 #T #T2 * /3 width=9 by cprs_trans, ex4_3_intro/
+qed-.
+
+lemma lsstas_cpds_trans: ∀h,g,G,L,T1,T,T2,l1,l2.
+ l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 →
+ ⦃G, L⦄ ⊢ T1 •*[h, g, l2] T → ⦃G, L⦄ ⊢ T •*➡*[h, g] T2 → ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2.
+#h #g #G #L #T1 #T #T2 #l1 #l2 #Hl21 #Hl1 #HT1 * #T0 #l3 #l4 #Hl43 #Hl3 #HT0 #HT02
+lapply (lsstas_da_conf … HT1 … Hl1) #H0T
+lapply (da_mono … H0T … Hl3) -H0T -Hl3 #H destruct
+lapply (le_minus_to_plus_r … Hl21 Hl43) -Hl21 -Hl43
+/3 width=8 by lsstas_trans, ex4_3_intro/
+qed-.
+
+(* Advanced inversion lemmas ************************************************)
+
+lemma cpds_inv_abst1: ∀h,g,a,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓛ{a}V1.T1 •*➡*[h, g] U2 →
+ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡* V2 & ⦃G, L.ⓛV1⦄ ⊢ T1 •*➡*[h, g] T2 &
+ U2 = ⓛ{a}V2.T2.
+#h #g #a #G #L #V1 #T1 #U2 * #X #l1 #l2 #Hl21 #Hl1 #H1 #H2
+lapply (da_inv_bind … Hl1) -Hl1 #Hl1
+elim (lsstas_inv_bind1 … H1) -H1 #U #HTU1 #H destruct
+elim (cprs_inv_abst1 … H2) -H2 #V2 #T2 #HV12 #HUT2 #H destruct
+/3 width=7 by ex4_3_intro, ex3_2_intro/
+qed-.
+
+lemma cpds_inv_abbr_abst: ∀h,g,a1,a2,G,L,V1,W2,T1,T2. ⦃G, L⦄ ⊢ ⓓ{a1}V1.T1 •*➡*[h, g] ⓛ{a2}W2.T2 →
+ ∃∃T. ⦃G, L.ⓓV1⦄ ⊢ T1 •*➡*[h, g] T & ⇧[0, 1] ⓛ{a2}W2.T2 ≡ T & a1 = true.
+#h #g #a1 #a2 #G #L #V1 #W2 #T1 #T2 * #X #l1 #l2 #Hl21 #Hl1 #H1 #H2
+lapply (da_inv_bind … Hl1) -Hl1 #Hl1
+elim (lsstas_inv_bind1 … H1) -H1 #U1 #HTU1 #H destruct
+elim (cprs_inv_abbr1 … H2) -H2 *
+[ #V2 #U2 #HV12 #HU12 #H destruct
+| /3 width=7 by ex4_3_intro, ex3_intro/
+]
+qed-.
+
+(* Advanced forward lemmas **************************************************)
+
+lemma cpds_fwd_cpxs: ∀h,g,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2 → ⦃G, L⦄ ⊢ T1 ➡*[h, g] T2.
+#h #g #G #L #T1 #T2 * /3 width=5 by cpxs_trans, lsstas_cpxs, cprs_cpxs/
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/unfold/lsstas_lift.ma".
+include "basic_2/computation/cprs_lift.ma".
+include "basic_2/computation/cpds.ma".
+
+(* DECOMPOSED EXTENDED PARALLEL COMPUTATION ON TERMS ************************)
+
+(* Relocation properties ****************************************************)
+
+lemma cpds_lift: ∀h,g,G. l_liftable (cpds h g G).
+#h #g #G #K #T1 #T2 * #T #l1 #l2 #Hl12 #Hl1 #HT1 #HT2 #L #s #d #e
+elim (lift_total T d e)
+/3 width=16 by cprs_lift, da_lift, lsstas_lift, ex4_3_intro/
+qed.
+
+lemma cpds_inv_lift1: ∀h,g,G. l_deliftable_sn (cpds h g G).
+#h #g #G #L #U1 #U2 * #U #l1 #l2 #Hl12 #Hl1 #HU1 #HU2 #K #s #d #e #HLK #T1 #HTU1
+lapply (da_inv_lift … Hl1 … HLK … HTU1) -Hl1 #Hl1
+elim (lsstas_inv_lift1 … HU1 … HLK … HTU1) -U1 #T #HTU #HT1
+elim (cprs_inv_lift1 … HU2 … HLK … HTU) -U -L
+/3 width=9 by ex4_3_intro, ex2_intro/
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/notation/relations/dpconvstar_6.ma".
+include "basic_2/unfold/lsstas.ma".
+include "basic_2/equivalence/cpcs.ma".
+
+(* DECOMPOSED EXTENDED PARALLEL EQUIVALENCE FOR TERMS ***********************)
+
+definition cpes: ∀h. sd h → relation4 genv lenv term term ≝
+ λh,g,G,L,T1,T2.
+ ∃∃T,l1,l2. l2 ≤ l1 & ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 & ⦃G, L⦄ ⊢ T1 •*[h, g, l2] T & ⦃G, L⦄ ⊢ T ⬌* T2.
+
+interpretation "decomposed extended parallel equivalence (term)"
+ 'DPConvStar h g G L T1 T2 = (cpes h g G L T1 T2).
+
+(* Basic properties *********************************************************)
+
+lemma ssta_cpcs_cpes: ∀h,g,G,L,T1,T,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T1 •[h, g] T →
+ ⦃G, L⦄ ⊢ T ⬌* T2 → ⦃G, L⦄ ⊢ T1 •*⬌*[h, g] T2.
+/3 width=7/ qed.
+
+lemma lsstas_cpes: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l → ⦃G, L⦄ ⊢ T1 •*[h, g, l] T2 → ⦃G, L⦄ ⊢ T1 •*⬌*[h, g] T2.
+/2 width=7/ qed.
+
+lemma cpcs_cpes: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l → ⦃G, L⦄ ⊢ T1 ⬌* T2 → ⦃G, L⦄ ⊢ T1 •*⬌*[h, g] T2.
+/2 width=7/ qed.
+
+lemma cpes_refl: ∀h,g,G,L,T,l. ⦃G, L⦄ ⊢ T ▪[h, g] l → ⦃G, L⦄ ⊢ T •*⬌*[h, g] T.
+/2 width=2/ qed.
+
+lemma cpes_strap1: ∀h,g,G,L,T1,T,T2.
+ ⦃G, L⦄ ⊢ T1 •*⬌*[h, g] T → ⦃G, L⦄ ⊢ T ⬌ T2 → ⦃G, L⦄ ⊢ T1 •*⬌*[h, g] T2.
+#h #g #G #L #T1 #T #T2 * /3 width=9/
+qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/substitution/ldrop_ldrop.ma".
+include "basic_2/multiple/fqus_alt.ma".
+include "basic_2/static/ssta.ma".
+include "basic_2/reduction/cpx.ma".
+
+(* CONTEXT-SENSITIVE EXTENDED PARALLEL REDUCTION FOR TERMS ******************)
+
+(* Advanced properties ******************************************************)
+
+lemma ssta_cpx: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 •[h, g] T2 →
+ ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2.
+#h #g #G #L #T1 #T2 #l #H elim H -G -L -T1 -T2
+[ /3 width=4 by cpx_st, da_inv_sort/
+| #G #L #K #V #U #W #i #HLK #_ #HWU #IHVW #H
+ elim (da_inv_lref … H) -H * #K0 #V0 [| #l0 ] #HLK0
+ lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct /3 width=7 by cpx_delta/
+| #G #L #K #W #U #l0 #i #HLK #_ #HWU #H
+ elim (da_inv_lref … H) -H * #K0 #W0 [| #l1 ] #HLK0
+ lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct /2 width=7 by cpx_delta/
+| /4 width=2 by cpx_bind, da_inv_bind/
+| /4 width=3 by cpx_flat, da_inv_flat/
+| /4 width=3 by cpx_eps, da_inv_flat/
+]
+qed.
+
+(* Relocation properties ****************************************************)
+
+lemma cpx_lift: ∀h,g,G. l_liftable (cpx h g G).
+#h #g #G #K #T1 #T2 #H elim H -G -K -T1 -T2
+[ #I #G #K #L #s #d #e #_ #U1 #H1 #U2 #H2
+ >(lift_mono … H1 … H2) -H1 -H2 //
+| #G #K #k #l #Hkl #L #s #d #e #_ #U1 #H1 #U2 #H2
+ >(lift_inv_sort1 … H1) -U1
+ >(lift_inv_sort1 … H2) -U2 /2 width=2 by cpx_st/
+| #I #G #K #KV #V #V2 #W2 #i #HKV #HV2 #HVW2 #IHV2 #L #s #d #e #HLK #U1 #H #U2 #HWU2
+ elim (lift_inv_lref1 … H) * #Hid #H destruct
+ [ elim (lift_trans_ge … HVW2 … HWU2) -W2 // <minus_plus #W2 #HVW2 #HWU2
+ elim (ldrop_trans_le … HLK … HKV) -K /2 width=2 by lt_to_le/ #X #HLK #H
+ elim (ldrop_inv_skip2 … H) -H /2 width=1 by lt_plus_to_minus_r/ -Hid
+ #K #Y #HKV #HVY #H destruct /3 width=10 by cpx_delta/
+ | lapply (lift_trans_be … HVW2 … HWU2 ? ?) -W2 /2 width=1 by le_S/ >plus_plus_comm_23 #HVU2
+ lapply (ldrop_trans_ge_comm … HLK … HKV ?) -K /3 width=7 by cpx_delta, ldrop_inv_gen/
+ ]
+| #a #I #G #K #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #s #d #e #HLK #U1 #H1 #U2 #H2
+ elim (lift_inv_bind1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 destruct
+ elim (lift_inv_bind1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /4 width=6 by cpx_bind, ldrop_skip/
+| #I #G #K #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #s #d #e #HLK #U1 #H1 #U2 #H2
+ elim (lift_inv_flat1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 destruct
+ elim (lift_inv_flat1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /3 width=6 by cpx_flat/
+| #G #K #V #T1 #T #T2 #_ #HT2 #IHT1 #L #s #d #e #HLK #U1 #H #U2 #HTU2
+ elim (lift_inv_bind1 … H) -H #VV1 #TT1 #HVV1 #HTT1 #H destruct
+ elim (lift_conf_O1 … HTU2 … HT2) -T2 /4 width=6 by cpx_zeta, ldrop_skip/
+| #G #K #V #T1 #T2 #_ #IHT12 #L #s #d #e #HLK #U1 #H #U2 #HTU2
+ elim (lift_inv_flat1 … H) -H #VV1 #TT1 #HVV1 #HTT1 #H destruct /3 width=6 by cpx_eps/
+| #G #K #V1 #V2 #T #_ #IHV12 #L #s #d #e #HLK #U1 #H #U2 #HVU2
+ elim (lift_inv_flat1 … H) -H #VV1 #TT1 #HVV1 #HTT1 #H destruct /3 width=6 by cpx_ct/
+| #a #G #K #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #L #s #d #e #HLK #X1 #HX1 #X2 #HX2
+ elim (lift_inv_flat1 … HX1) -HX1 #V0 #X #HV10 #HX #HX1 destruct
+ elim (lift_inv_bind1 … HX) -HX #W0 #T0 #HW0 #HT10 #HX destruct
+ elim (lift_inv_bind1 … HX2) -HX2 #X #T3 #HX #HT23 #HX2 destruct
+ elim (lift_inv_flat1 … HX) -HX #W3 #V3 #HW23 #HV23 #HX destruct /4 width=6 by cpx_beta, ldrop_skip/
+| #a #G #K #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV1 #IHW12 #IHT12 #L #s #d #e #HLK #X1 #HX1 #X2 #HX2
+ elim (lift_inv_flat1 … HX1) -HX1 #V0 #X #HV10 #HX #HX1 destruct
+ elim (lift_inv_bind1 … HX) -HX #W0 #T0 #HW0 #HT10 #HX destruct
+ elim (lift_inv_bind1 … HX2) -HX2 #W3 #X #HW23 #HX #HX2 destruct
+ elim (lift_inv_flat1 … HX) -HX #V3 #T3 #HV3 #HT23 #HX destruct
+ elim (lift_trans_ge … HV2 … HV3) -V2 /4 width=6 by cpx_theta, ldrop_skip/
+]
+qed.
+
+lemma cpx_inv_lift1: ∀h,g,G. l_deliftable_sn (cpx h g G).
+#h #g #G #L #U1 #U2 #H elim H -G -L -U1 -U2
+[ * #i #G #L #K #s #d #e #_ #T1 #H
+ [ lapply (lift_inv_sort2 … H) -H #H destruct /2 width=3 by cpx_atom, lift_sort, ex2_intro/
+ | elim (lift_inv_lref2 … H) -H * #Hid #H destruct /3 width=3 by cpx_atom, lift_lref_ge_minus, lift_lref_lt, ex2_intro/
+ | lapply (lift_inv_gref2 … H) -H #H destruct /2 width=3 by cpx_atom, lift_gref, ex2_intro/
+ ]
+| #G #L #k #l #Hkl #K #s #d #e #_ #T1 #H
+ lapply (lift_inv_sort2 … H) -H #H destruct /3 width=3 by cpx_st, lift_sort, ex2_intro/
+| #I #G #L #LV #V #V2 #W2 #i #HLV #HV2 #HVW2 #IHV2 #K #s #d #e #HLK #T1 #H
+ elim (lift_inv_lref2 … H) -H * #Hid #H destruct
+ [ elim (ldrop_conf_lt … HLK … HLV) -L // #L #U #HKL #HLV #HUV
+ elim (IHV2 … HLV … HUV) -V #U2 #HUV2 #HU2
+ elim (lift_trans_le … HUV2 … HVW2) -V2 // >minus_plus <plus_minus_m_m /3 width=9 by cpx_delta, ex2_intro/
+ | elim (le_inv_plus_l … Hid) #Hdie #Hei
+ lapply (ldrop_conf_ge … HLK … HLV ?) -L // #HKLV
+ elim (lift_split … HVW2 d (i - e + 1)) -HVW2 /3 width=1 by le_S, le_S_S/ -Hid -Hdie
+ #V1 #HV1 >plus_minus // <minus_minus /2 width=1 by le_S/ <minus_n_n <plus_n_O /3 width=9 by cpx_delta, ex2_intro/
+ ]
+| #a #I #G #L #V1 #V2 #U1 #U2 #_ #_ #IHV12 #IHU12 #K #s #d #e #HLK #X #H
+ elim (lift_inv_bind2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct
+ elim (IHV12 … HLK … HWV1) -IHV12 #W2 #HW12 #HWV2
+ elim (IHU12 … HTU1) -IHU12 -HTU1 /3 width=6 by cpx_bind, ldrop_skip, lift_bind, ex2_intro/
+| #I #G #L #V1 #V2 #U1 #U2 #_ #_ #IHV12 #IHU12 #K #s #d #e #HLK #X #H
+ elim (lift_inv_flat2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct
+ elim (IHV12 … HLK … HWV1) -V1
+ elim (IHU12 … HLK … HTU1) -U1 -HLK /3 width=5 by cpx_flat, lift_flat, ex2_intro/
+| #G #L #V #U1 #U #U2 #_ #HU2 #IHU1 #K #s #d #e #HLK #X #H
+ elim (lift_inv_bind2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct
+ elim (IHU1 (K.ⓓW1) s … HTU1) /2 width=1/ -L -U1 #T #HTU #HT1
+ elim (lift_div_le … HU2 … HTU) -U /3 width=5 by cpx_zeta, ex2_intro/
+| #G #L #V #U1 #U2 #_ #IHU12 #K #s #d #e #HLK #X #H
+ elim (lift_inv_flat2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct
+ elim (IHU12 … HLK … HTU1) -L -U1 /3 width=3 by cpx_eps, ex2_intro/
+| #G #L #V1 #V2 #U1 #_ #IHV12 #K #s #d #e #HLK #X #H
+ elim (lift_inv_flat2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct
+ elim (IHV12 … HLK … HWV1) -L -V1 /3 width=3 by cpx_ct, ex2_intro/
+| #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #K #s #d #e #HLK #X #HX
+ elim (lift_inv_flat2 … HX) -HX #V0 #Y #HV01 #HY #HX destruct
+ elim (lift_inv_bind2 … HY) -HY #W0 #T0 #HW01 #HT01 #HY destruct
+ elim (IHV12 … HLK … HV01) -V1 #V3 #HV32 #HV03
+ elim (IHT12 (K.ⓛW0) s … HT01) -T1 /2 width=1 by ldrop_skip/ #T3 #HT32 #HT03
+ elim (IHW12 … HLK … HW01) -W1
+ /4 width=7 by cpx_beta, lift_bind, lift_flat, ex2_intro/
+| #a #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV1 #IHW12 #IHT12 #K #s #d #e #HLK #X #HX
+ elim (lift_inv_flat2 … HX) -HX #V0 #Y #HV01 #HY #HX destruct
+ elim (lift_inv_bind2 … HY) -HY #W0 #T0 #HW01 #HT01 #HY destruct
+ elim (IHV1 … HLK … HV01) -V1 #V3 #HV3 #HV03
+ elim (IHT12 (K.ⓓW0) s … HT01) -T1 /2 width=1 by ldrop_skip/ #T3 #HT32 #HT03
+ elim (IHW12 … HLK … HW01) -W1 #W3 #HW32 #HW03
+ elim (lift_trans_le … HV3 … HV2) -V
+ /4 width=9 by cpx_theta, lift_bind, lift_flat, ex2_intro/
+]
+qed-.
+
+(* Properties on supclosure *************************************************)
+
+lemma fqu_cpx_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ →
+ ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡[h, g] U2 →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡[h, g] U1 & ⦃G1, L1, U1⦄ ⊐ ⦃G2, L2, U2⦄.
+#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2
+/3 width=3 by fqu_pair_sn, fqu_bind_dx, fqu_flat_dx, cpx_pair_sn, cpx_bind, cpx_flat, ex2_intro/
+[ #I #G #L #V2 #U2 #HVU2
+ elim (lift_total U2 0 1)
+ /4 width=7 by fqu_drop, cpx_delta, ldrop_pair, ldrop_drop, ex2_intro/
+| #G #L #K #T1 #U1 #e #HLK1 #HTU1 #T2 #HTU2
+ elim (lift_total T2 0 (e+1))
+ /3 width=11 by cpx_lift, fqu_drop, ex2_intro/
+]
+qed-.
+
+lemma fqu_ssta_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ →
+ ∀U2. ⦃G2, L2⦄ ⊢ T2 •[h, g] U2 →
+ ∀l. ⦃G2, L2⦄ ⊢ T2 ▪[h, g] l+1 →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡[h, g] U1 & ⦃G1, L1, U1⦄ ⊐ ⦃G2, L2, U2⦄.
+/3 width=5 by fqu_cpx_trans, ssta_cpx/ qed-.
+
+lemma fquq_cpx_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ →
+ ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡[h, g] U2 →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡[h, g] U1 & ⦃G1, L1, U1⦄ ⊐⸮ ⦃G2, L2, U2⦄.
+#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H #U2 #HTU2 elim (fquq_inv_gen … H) -H
+[ #HT12 elim (fqu_cpx_trans … HT12 … HTU2) /3 width=3 by fqu_fquq, ex2_intro/
+| * #H1 #H2 #H3 destruct /2 width=3 by ex2_intro/
+]
+qed-.
+
+lemma fquq_ssta_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ →
+ ∀U2. ⦃G2, L2⦄ ⊢ T2 •[h, g] U2 →
+ ∀l. ⦃G2, L2⦄ ⊢ T2 ▪[h, g] l+1 →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡[h, g] U1 & ⦃G1, L1, U1⦄ ⊐⸮ ⦃G2, L2, U2⦄.
+/3 width=5 by fquq_cpx_trans, ssta_cpx/ qed-.
+
+lemma fqup_cpx_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T2⦄ →
+ ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡[h, g] U2 →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡[h, g] U1 & ⦃G1, L1, U1⦄ ⊐+ ⦃G2, L2, U2⦄.
+#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2
+[ #G2 #L2 #T2 #H12 #U2 #HTU2 elim (fqu_cpx_trans … H12 … HTU2) -T2
+ /3 width=3 by fqu_fqup, ex2_intro/
+| #G #G2 #L #L2 #T #T2 #_ #HT2 #IHT1 #U2 #HTU2
+ elim (fqu_cpx_trans … HT2 … HTU2) -T2 #T2 #HT2 #HTU2
+ elim (IHT1 … HT2) -T /3 width=7 by fqup_strap1, ex2_intro/
+]
+qed-.
+
+lemma fqus_cpx_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ →
+ ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡[h, g] U2 →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡[h, g] U1 & ⦃G1, L1, U1⦄ ⊐* ⦃G2, L2, U2⦄.
+#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H #U2 #HTU2 elim (fqus_inv_gen … H) -H
+[ #HT12 elim (fqup_cpx_trans … HT12 … HTU2) /3 width=3 by fqup_fqus, ex2_intro/
+| * #H1 #H2 #H3 destruct /2 width=3 by ex2_intro/
+]
+qed-.
+
+lemma fqu_cpx_trans_neq: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ →
+ ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡[h, g] U2 → (T2 = U2 → ⊥) →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡[h, g] U1 & T1 = U1 → ⊥ & ⦃G1, L1, U1⦄ ⊐ ⦃G2, L2, U2⦄.
+#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2
+[ #I #G #L #V1 #V2 #HV12 #_ elim (lift_total V2 0 1)
+ #U2 #HVU2 @(ex3_intro … U2)
+ [1,3: /3 width=7 by fqu_drop, cpx_delta, ldrop_pair, ldrop_drop/
+ | #H destruct /2 width=7 by lift_inv_lref2_be/
+ ]
+| #I #G #L #V1 #T #V2 #HV12 #H @(ex3_intro … (②{I}V2.T))
+ [1,3: /2 width=4 by fqu_pair_sn, cpx_pair_sn/
+ | #H0 destruct /2 width=1 by/
+ ]
+| #a #I #G #L #V #T1 #T2 #HT12 #H @(ex3_intro … (ⓑ{a,I}V.T2))
+ [1,3: /2 width=4 by fqu_bind_dx, cpx_bind/
+ | #H0 destruct /2 width=1 by/
+ ]
+| #I #G #L #V #T1 #T2 #HT12 #H @(ex3_intro … (ⓕ{I}V.T2))
+ [1,3: /2 width=4 by fqu_flat_dx, cpx_flat/
+ | #H0 destruct /2 width=1 by/
+ ]
+| #G #L #K #T1 #U1 #e #HLK #HTU1 #T2 #HT12 #H elim (lift_total T2 0 (e+1))
+ #U2 #HTU2 @(ex3_intro … U2)
+ [1,3: /2 width=10 by cpx_lift, fqu_drop/
+ | #H0 destruct /3 width=5 by lift_inj/
+]
+qed-.
+
+lemma fquq_cpx_trans_neq: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ →
+ ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡[h, g] U2 → (T2 = U2 → ⊥) →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡[h, g] U1 & T1 = U1 → ⊥ & ⦃G1, L1, U1⦄ ⊐⸮ ⦃G2, L2, U2⦄.
+#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H12 #U2 #HTU2 #H elim (fquq_inv_gen … H12) -H12
+[ #H12 elim (fqu_cpx_trans_neq … H12 … HTU2 H) -T2
+ /3 width=4 by fqu_fquq, ex3_intro/
+| * #HG #HL #HT destruct /3 width=4 by ex3_intro/
+]
+qed-.
+
+lemma fqup_cpx_trans_neq: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T2⦄ →
+ ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡[h, g] U2 → (T2 = U2 → ⊥) →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡[h, g] U1 & T1 = U1 → ⊥ & ⦃G1, L1, U1⦄ ⊐+ ⦃G2, L2, U2⦄.
+#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind_dx … H) -G1 -L1 -T1
+[ #G1 #L1 #T1 #H12 #U2 #HTU2 #H elim (fqu_cpx_trans_neq … H12 … HTU2 H) -T2
+ /3 width=4 by fqu_fqup, ex3_intro/
+| #G #G1 #L #L1 #T #T1 #H1 #_ #IH12 #U2 #HTU2 #H elim (IH12 … HTU2 H) -T2
+ #U1 #HTU1 #H #H12 elim (fqu_cpx_trans_neq … H1 … HTU1 H) -T1
+ /3 width=8 by fqup_strap2, ex3_intro/
+]
+qed-.
+
+lemma fqus_cpx_trans_neq: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ →
+ ∀U2. ⦃G2, L2⦄ ⊢ T2 ➡[h, g] U2 → (T2 = U2 → ⊥) →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡[h, g] U1 & T1 = U1 → ⊥ & ⦃G1, L1, U1⦄ ⊐* ⦃G2, L2, U2⦄.
+#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H12 #U2 #HTU2 #H elim (fqus_inv_gen … H12) -H12
+[ #H12 elim (fqup_cpx_trans_neq … H12 … HTU2 H) -T2
+ /3 width=4 by fqup_fqus, ex3_intro/
+| * #HG #HL #HT destruct /3 width=4 by ex3_intro/
+]
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/multiple/fqus_fqus.ma".
+include "basic_2/unfold/lsstas_lift.ma".
+include "basic_2/reduction/cpx_lift.ma".
+include "basic_2/computation/cpxs.ma".
+
+(* CONTEXT-SENSITIVE EXTENDED PARALLEL COMPUTATION ON TERMS *****************)
+
+(* Advanced properties ******************************************************)
+
+lemma lsstas_cpxs: ∀h,g,G,L,T1,T2,l1. ⦃G, L⦄ ⊢ T1 •* [h, g, l1] T2 →
+ ∀l2. ⦃G, L⦄ ⊢ T1 ▪ [h, g] l2 → l1 ≤ l2 → ⦃G, L⦄ ⊢ T1 ➡*[h, g] T2.
+#h #g #G #L #T1 #T2 #l1 #H @(lsstas_ind_dx … H) -T2 -l1 //
+#l1 #T #T2 #HT1 #HT2 #IHT1 #l2 #Hl2 #Hl12
+lapply (lsstas_da_conf … HT1 … Hl2) -HT1
+>(plus_minus_m_m (l2-l1) 1 ?)
+[ /4 width=5 by cpxs_strap1, ssta_cpx, lt_to_le/
+| /2 width=1 by monotonic_le_minus_r/
+]
+qed.
+
+lemma cpxs_delta: ∀h,g,I,G,L,K,V,V2,i.
+ ⇩[i] L ≡ K.ⓑ{I}V → ⦃G, K⦄ ⊢ V ➡*[h, g] V2 →
+ ∀W2. ⇧[0, i+1] V2 ≡ W2 → ⦃G, L⦄ ⊢ #i ➡*[h, g] W2.
+#h #g #I #G #L #K #V #V2 #i #HLK #H elim H -V2
+[ /3 width=9 by cpx_cpxs, cpx_delta/
+| #V1 lapply (ldrop_fwd_drop2 … HLK) -HLK
+ elim (lift_total V1 0 (i+1)) /4 width=12 by cpx_lift, cpxs_strap1/
+]
+qed.
+
+(* Advanced inversion lemmas ************************************************)
+
+lemma cpxs_inv_lref1: ∀h,g,G,L,T2,i. ⦃G, L⦄ ⊢ #i ➡*[h, g] T2 →
+ T2 = #i ∨
+ ∃∃I,K,V1,T1. ⇩[i] L ≡ K.ⓑ{I}V1 & ⦃G, K⦄ ⊢ V1 ➡*[h, g] T1 &
+ ⇧[0, i+1] T1 ≡ T2.
+#h #g #G #L #T2 #i #H @(cpxs_ind … H) -T2 /2 width=1 by or_introl/
+#T #T2 #_ #HT2 *
+[ #H destruct
+ elim (cpx_inv_lref1 … HT2) -HT2 /2 width=1 by or_introl/
+ * /4 width=7 by cpx_cpxs, ex3_4_intro, or_intror/
+| * #I #K #V1 #T1 #HLK #HVT1 #HT1
+ lapply (ldrop_fwd_drop2 … HLK) #H0LK
+ elim (cpx_inv_lift1 … HT2 … H0LK … HT1) -H0LK -T
+ /4 width=7 by cpxs_strap1, ex3_4_intro, or_intror/
+]
+qed-.
+
+(* Relocation properties ****************************************************)
+
+lemma cpxs_lift: ∀h,g,G. l_liftable (cpxs h g G).
+/3 width=10 by cpx_lift, cpxs_strap1, l_liftable_LTC/ qed.
+
+lemma cpxs_inv_lift1: ∀h,g,G. l_deliftable_sn (cpxs h g G).
+/3 width=6 by l_deliftable_sn_LTC, cpx_inv_lift1/
+qed-.
+
+(* Properties on supclosure *************************************************)
+
+lemma fqu_cpxs_trans: ∀h,g,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡*[h, g] U2 →
+ ∀T1. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊐ ⦃G2, L2, U2⦄.
+#h #g #G1 #G2 #L1 #L2 #T2 #U2 #H @(cpxs_ind_dx … H) -T2 /2 width=3 by ex2_intro/
+#T #T2 #HT2 #_ #IHTU2 #T1 #HT1 elim (fqu_cpx_trans … HT1 … HT2) -T
+#T #HT1 #HT2 elim (IHTU2 … HT2) -T2 /3 width=3 by cpxs_strap2, ex2_intro/
+qed-.
+
+lemma fquq_cpxs_trans: ∀h,g,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡*[h, g] U2 →
+ ∀T1. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊐⸮ ⦃G2, L2, U2⦄.
+#h #g #G1 #G2 #L1 #L2 #T2 #U2 #HTU2 #T1 #H elim (fquq_inv_gen … H) -H
+[ #HT12 elim (fqu_cpxs_trans … HTU2 … HT12) /3 width=3 by fqu_fquq, ex2_intro/
+| * #H1 #H2 #H3 destruct /2 width=3 by ex2_intro/
+]
+qed-.
+
+lemma fquq_lsstas_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ →
+ ∀U2,l1. ⦃G2, L2⦄ ⊢ T2 •*[h, g, l1] U2 →
+ ∀l2. ⦃G2, L2⦄ ⊢ T2 ▪ [h, g] l2 → l1 ≤ l2 →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊐⸮ ⦃G2, L2, U2⦄.
+/3 width=5 by fquq_cpxs_trans, lsstas_cpxs/ qed-.
+
+lemma fqup_cpxs_trans: ∀h,g,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡*[h, g] U2 →
+ ∀T1. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T2⦄ →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊐+ ⦃G2, L2, U2⦄.
+#h #g #G1 #G2 #L1 #L2 #T2 #U2 #H @(cpxs_ind_dx … H) -T2 /2 width=3 by ex2_intro/
+#T #T2 #HT2 #_ #IHTU2 #T1 #HT1 elim (fqup_cpx_trans … HT1 … HT2) -T
+#U1 #HTU1 #H2 elim (IHTU2 … H2) -T2 /3 width=3 by cpxs_strap2, ex2_intro/
+qed-.
+
+lemma fqus_cpxs_trans: ∀h,g,G1,G2,L1,L2,T2,U2. ⦃G2, L2⦄ ⊢ T2 ➡*[h, g] U2 →
+ ∀T1. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊐* ⦃G2, L2, U2⦄.
+#h #g #G1 #G2 #L1 #L2 #T2 #U2 #HTU2 #T1 #H elim (fqus_inv_gen … H) -H
+[ #HT12 elim (fqup_cpxs_trans … HTU2 … HT12) /3 width=3 by fqup_fqus, ex2_intro/
+| * #H1 #H2 #H3 destruct /2 width=3 by ex2_intro/
+]
+qed-.
+
+lemma fqus_lsstas_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ →
+ ∀U2,l1. ⦃G2, L2⦄ ⊢ T2 •*[h, g, l1] U2 →
+ ∀l2. ⦃G2, L2⦄ ⊢ T2 ▪ [h, g] l2 → l1 ≤ l2 →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡*[h, g] U1 & ⦃G1, L1, U1⦄ ⊐* ⦃G2, L2, U2⦄.
+/3 width=7 by fqus_cpxs_trans, lsstas_cpxs/ qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/reduction/cpx_lift.ma".
+include "basic_2/reduction/fpb.ma".
+
+(* "BIG TREE" PARALLEL REDUCTION FOR CLOSURES *******************************)
+
+(* Advanced properties ******************************************************)
+
+lemma ssta_fpb: ∀h,g,G,L,T1,T2,l.
+ ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T1 •[h, g] T2 →
+ ⦃G, L, T1⦄ ≽[h, g] ⦃G, L, T2⦄.
+/3 width=5 by fpb_cpx, ssta_cpx/ qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/computation/fpbu_lift.ma".
+include "basic_2/computation/fpbg.ma".
+
+(* GENERAL "BIG TREE" PARALLEL COMPUTATION FOR CLOSURES *********************)
+
+(* Advanced properties ******************************************************)
+
+lemma lsstas_fpbg: ∀h,g,G,L,T1,T2,l2. ⦃G, L⦄ ⊢ T1 •*[h, g, l2] T2 → (T1 = T2 → ⊥) →
+ ∀l1. l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 → ⦃G, L, T1⦄ >≡[h, g] ⦃G, L, T2⦄.
+/5 width=5 by fpbc_fpbg, fpbu_fpbc, lsstas_fpbu/ qed.
+
+lemma ssta_fpbg: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 →
+ ⦃G, L⦄ ⊢ T1 •[h, g] T2 → ⦃G, L, T1⦄ >≡[h, g] ⦃G, L, T2⦄.
+/4 width=2 by fpbc_fpbg, fpbu_fpbc, ssta_fpbu/ qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/reduction/fpb_lift.ma".
+include "basic_2/computation/cpxs_lift.ma".
+include "basic_2/computation/fpbs.ma".
+
+(* "BIG TREE" PARALLEL COMPUTATION FOR CLOSURES *****************************)
+
+(* Advanced properties ******************************************************)
+
+lemma lsstas_fpbs: ∀h,g,G,L,T1,T2,l2. ⦃G, L⦄ ⊢ T1 •*[h, g, l2] T2 →
+ ∀l1. l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 → ⦃G, L, T1⦄ ≥[h, g] ⦃G, L, T2⦄.
+/3 width=5 by cpxs_fpbs, lsstas_cpxs/ qed.
+
+lemma ssta_fpbs: ∀h,g,G,L,T,U,l.
+ ⦃G, L⦄ ⊢ T ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T •[h, g] U →
+ ⦃G, L, T⦄ ≥[h, g] ⦃G, L, U⦄.
+/4 width=2 by fpb_fpbs, ssta_fpb/ qed.
+
+(* Note: this is used in the closure proof *)
+lemma cpr_lpr_ssta_fpbs: ∀h,g,G,L1,L2,T1,T2,U2,l2.
+ ⦃G, L1⦄ ⊢ T1 ➡ T2 → ⦃G, L1⦄ ⊢ ➡ L2 →
+ ⦃G, L2⦄ ⊢ T2 ▪[h, g] l2+1 → ⦃G, L2⦄ ⊢ T2 •[h, g] U2 →
+ ⦃G, L1, T1⦄ ≥[h, g] ⦃G, L2, U2⦄.
+/4 width=5 by fpbs_strap1, cpr_lpr_fpbs, ssta_cpx, fpb_cpx/ qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/ssta_ssta.ma".
+include "basic_2/computation/cpxs_lift.ma".
+include "basic_2/computation/fpbu.ma".
+
+(* UNITARY "BIG TREE" PROPER PARALLEL COMPUTATION FOR CLOSURES **************)
+
+(* Advanced properties ******************************************************)
+
+lemma lsstas_fpbu: ∀h,g,G,L,T1,T2,l2. ⦃G, L⦄ ⊢ T1 •*[h, g, l2] T2 → (T1 = T2 → ⊥) →
+ ∀l1. l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 → ⦃G, L, T1⦄ ≻[h, g] ⦃G, L, T2⦄.
+/4 width=5 by fpbu_cpxs, lsstas_cpxs/ qed.
+
+lemma ssta_fpbu: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 →
+ ⦃G, L⦄ ⊢ T1 •[h, g] T2 → ⦃G, L, T1⦄ ≻[h, g] ⦃G, L, T2⦄.
+#h #g #G #L #T1 #T2 #l #HT1 #HT12 elim (eq_term_dec T1 T2)
+/3 width=5 by ssta_lsstas, lsstas_fpbu/ #H destruct
+elim (ssta_inv_refl_pos … HT1 … HT12)
+qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/notation/relations/statictypestar_7.ma".
+include "basic_2/static/ssta.ma".
+
+(* NAT-ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *****************)
+
+definition lsstas: ∀h. sd h → genv → lenv → nat → relation term ≝
+ λh,g,G,L. lstar … (ssta h g G L).
+
+interpretation "nat-iterated stratified static type assignment (term)"
+ 'StaticTypeStar h g G L l T U = (lsstas h g G L l T U).
+
+(* Basic eliminators ********************************************************)
+
+lemma lsstas_ind_sn: ∀h,g,G,L,U2. ∀R:relation2 nat term.
+ R 0 U2 → (
+ ∀l,T,U1. ⦃G, L⦄ ⊢ T •[h, g] U1 → ⦃G, L⦄ ⊢ U1 •* [h, g, l] U2 →
+ R l U1 → R (l+1) T
+ ) →
+ ∀l,T. ⦃G, L⦄ ⊢ T •*[h, g, l] U2 → R l T.
+/3 width=5 by lstar_ind_l/ qed-.
+
+lemma lsstas_ind_dx: ∀h,g,G,L,T. ∀R:relation2 nat term.
+ R 0 T → (
+ ∀l,U1,U2. ⦃G, L⦄ ⊢ T •* [h, g, l] U1 → ⦃G, L⦄ ⊢ U1 •[h, g] U2 →
+ R l U1 → R (l+1) U2
+ ) →
+ ∀l,U. ⦃G, L⦄ ⊢ T •*[h, g, l] U → R l U.
+/3 width=5 by lstar_ind_r/ qed-.
+
+(* Basic inversion lemmas ***************************************************)
+
+lemma lsstas_inv_O: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •*[h, g, 0] U → T = U.
+/2 width=4 by lstar_inv_O/ qed-.
+
+lemma lsstas_inv_SO: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •*[h, g, 1] U → ⦃G, L⦄ ⊢ T •[h, g] U.
+/2 width=1 by lstar_inv_step/ qed-.
+
+lemma lsstas_inv_step_sn: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 •*[h, g, l+1] T2 →
+ ∃∃T. ⦃G, L⦄ ⊢ T1 •[h, g] T & ⦃G, L⦄ ⊢ T •*[h, g, l] T2.
+/2 width=3 by lstar_inv_S/ qed-.
+
+lemma lsstas_inv_step_dx: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 •*[h, g, l+1] T2 →
+ ∃∃T. ⦃G, L⦄ ⊢ T1 •*[h, g, l] T & ⦃G, L⦄ ⊢ T •[h, g] T2.
+/2 width=3 by lstar_inv_S_dx/ qed-.
+
+lemma lsstas_inv_sort1: ∀h,g,G,L,X,k,l. ⦃G, L⦄ ⊢ ⋆k •*[h, g, l] X → X = ⋆((next h)^l k).
+#h #g #G #L #X #k #l #H @(lsstas_ind_dx … H) -X -l //
+#l #X #X0 #_ #H #IHX destruct
+lapply (ssta_inv_sort1 … H) -H #H destruct
+>iter_SO //
+qed-.
+
+lemma lsstas_inv_gref1: ∀h,g,G,L,X,p,l. ⦃G, L⦄ ⊢ §p •*[h, g, l+1] X → ⊥.
+#h #g #G #L #X #p #l #H elim (lsstas_inv_step_sn … H) -H
+#U #H #HUX elim (ssta_inv_gref1 … H)
+qed-.
+
+lemma lsstas_inv_bind1: ∀h,g,a,I,G,L,V,T,X,l. ⦃G, L⦄ ⊢ ⓑ{a,I}V.T •*[h, g, l] X →
+ ∃∃U. ⦃G, L.ⓑ{I}V⦄ ⊢ T •*[h, g, l] U & X = ⓑ{a,I}V.U.
+#h #g #a #I #G #L #V #T #X #l #H @(lsstas_ind_dx … H) -X -l [ /2 width=3/ ]
+#l #X #X0 #_ #HX0 * #U #HTU #H destruct
+elim (ssta_inv_bind1 … HX0) -HX0 #U0 #HU0 #H destruct /3 width=3/
+qed-.
+
+lemma lsstas_inv_appl1: ∀h,g,G,L,V,T,X,l. ⦃G, L⦄ ⊢ ⓐV.T •*[h, g, l] X →
+ ∃∃U. ⦃G, L⦄ ⊢ T •*[h, g, l] U & X = ⓐV.U.
+#h #g #G #L #V #T #X #l #H @(lsstas_ind_dx … H) -X -l [ /2 width=3/ ]
+#l #X #X0 #_ #HX0 * #U #HTU #H destruct
+elim (ssta_inv_appl1 … HX0) -HX0 #U0 #HU0 #H destruct /3 width=3/
+qed-.
+
+lemma lsstas_inv_cast1: ∀h,g,G,L,W,T,U,l. ⦃G, L⦄ ⊢ ⓝW.T •*[h, g, l+1] U → ⦃G, L⦄ ⊢ T •*[h, g, l+1] U.
+#h #g #G #L #W #T #X #l #H elim (lsstas_inv_step_sn … H) -H
+#U #H #HUX lapply (ssta_inv_cast1 … H) -H /2 width=3/
+qed-.
+
+(* Basic properties *********************************************************)
+
+lemma lsstas_refl: ∀h,g,G,L. reflexive … (lsstas h g G L 0).
+// qed.
+
+lemma ssta_lsstas: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U → ⦃G, L⦄ ⊢ T •*[h, g, 1] U.
+/2 width=1/ qed.
+
+lemma lsstas_step_sn: ∀h,g,G,L,T1,U1,U2,l. ⦃G, L⦄ ⊢ T1 •[h, g] U1 → ⦃G, L⦄ ⊢ U1 •*[h, g, l] U2 →
+ ⦃G, L⦄ ⊢ T1 •*[h, g, l+1] U2.
+/2 width=3/ qed.
+
+lemma lsstas_step_dx: ∀h,g,G,L,T1,T2,U2,l. ⦃G, L⦄ ⊢ T1 •*[h, g, l] T2 → ⦃G, L⦄ ⊢ T2 •[h, g] U2 →
+ ⦃G, L⦄ ⊢ T1 •*[h, g, l+1] U2.
+/2 width=3/ qed.
+
+lemma lsstas_split: ∀h,g,G,L. inv_ltransitive … (lsstas h g G L).
+/2 width=1 by lstar_inv_ltransitive/ qed-.
+
+lemma lsstas_sort: ∀h,g,G,L,l,k. ⦃G, L⦄ ⊢ ⋆k •*[h, g, l] ⋆((next h)^l k).
+#h #g #G #L #l @(nat_ind_plus … l) -l //
+#l #IHl #k >iter_SO /2 width=3/
+qed.
+
+lemma lsstas_bind: ∀h,g,I,G,L,V,T,U,l. ⦃G, L.ⓑ{I}V⦄ ⊢ T •*[h, g, l] U →
+ ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V.T •*[h, g, l] ⓑ{a,I}V.U.
+#h #g #I #G #L #V #T #U #l #H @(lsstas_ind_dx … H) -U -l // /3 width=3/
+qed.
+
+lemma lsstas_appl: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •*[h, g, l] U →
+ ∀V.⦃G, L⦄ ⊢ ⓐV.T •*[h, g, l] ⓐV.U.
+#h #g #G #L #T #U #l #H @(lsstas_ind_dx … H) -U -l // /3 width=3/
+qed.
+
+lemma lsstas_cast: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •*[h, g, l+1] U →
+ ∀W. ⦃G, L⦄ ⊢ ⓝW.T •*[h, g, l+1] U.
+#h #g #G #L #T #U #l #H elim (lsstas_inv_step_sn … H) -H /3 width=3/
+qed.
+
+(* Basic_1: removed theorems 7:
+ sty1_abbr sty1_appl sty1_bind sty1_cast2
+ sty1_correct sty1_lift sty1_trans
+*)
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/aaa_ssta.ma".
+include "basic_2/unfold/lsstas.ma".
+
+(* NAT-ITERATED STATIC TYPE ASSIGNMENT FOR TERMS ****************************)
+
+(* Properties on atomic arity assignment for terms **************************)
+
+lemma aaa_lsstas_conf: ∀h,g,G,L,l. Conf3 … (aaa G L) (lsstas h g G L l).
+/3 width=6 by aaa_ssta_conf, lstar_Conf3/ qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/notation/relations/statictypestaralt_7.ma".
+include "basic_2/unfold/lsstas_lift.ma".
+
+(* NAT-ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *****************)
+
+(* alternative definition of lsstas *)
+inductive lsstasa (h) (g): genv → relation4 lenv nat term term ≝
+| lsstasa_O : ∀G,L,T. lsstasa h g G L 0 T T
+| lsstasa_sort: ∀G,L,l,k. lsstasa h g G L l (⋆k) (⋆((next h)^l k))
+| lsstasa_ldef: ∀G,L,K,V,W,U,i,l. ⇩[i] L ≡ K.ⓓV → lsstasa h g G K (l+1) V W →
+ ⇧[0, i+1] W ≡ U → lsstasa h g G L (l+1) (#i) U
+| lsstasa_ldec: ∀G,L,K,W,V,U,i,l,l0. ⇩[i] L ≡ K.ⓛW → ⦃G, K⦄ ⊢ W ▪[h, g] l0 →
+ lsstasa h g G K l W V → ⇧[0, i+1] V ≡ U → lsstasa h g G L (l+1) (#i) U
+| lsstasa_bind: ∀a,I,G,L,V,T,U,l. lsstasa h g G (L.ⓑ{I}V) l T U →
+ lsstasa h g G L l (ⓑ{a,I}V.T) (ⓑ{a,I}V.U)
+| lsstasa_appl: ∀G,L,V,T,U,l. lsstasa h g G L l T U → lsstasa h g G L l (ⓐV.T) (ⓐV.U)
+| lsstasa_cast: ∀G,L,W,T,U,l. lsstasa h g G L (l+1) T U → lsstasa h g G L (l+1) (ⓝW.T) U
+.
+
+interpretation "nat-iterated stratified static type assignment (term) alternative"
+ 'StaticTypeStarAlt h g G L l T U = (lsstasa h g G L l T U).
+
+(* Base properties **********************************************************)
+
+lemma ssta_lsstasa: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U → ⦃G, L⦄ ⊢ T ••*[h, g, 1] U.
+#h #g #G #L #T #U #H elim H -G -L -T -U
+/2 width=8 by lsstasa_O, lsstasa_sort, lsstasa_ldef, lsstasa_ldec, lsstasa_bind, lsstasa_appl, lsstasa_cast/
+qed.
+
+lemma lsstasa_step_dx: ∀h,g,G,L,T1,T,l. ⦃G, L⦄ ⊢ T1 ••*[h, g, l] T →
+ ∀T2. ⦃G, L⦄ ⊢ T •[h, g] T2 → ⦃G, L⦄ ⊢ T1 ••*[h, g, l+1] T2.
+#h #g #G #L #T1 #T #l #H elim H -G -L -T1 -T -l
+[ /2 width=1/
+| #G #L #l #k #X #H >(ssta_inv_sort1 … H) -X >commutative_plus //
+| #G #L #K #V #W #U #i #l #HLK #_ #HWU #IHVW #U2 #HU2
+ lapply (ldrop_fwd_drop2 … HLK) #H
+ elim (ssta_inv_lift1 … HU2 … H … HWU) -H -U /3 width=6 by lsstasa_ldef/
+| #G #L #K #W #V #U #i #l #l0 #HLK #HWl0 #_ #HVU #IHWV #U2 #HU2
+ lapply (ldrop_fwd_drop2 … HLK) #H
+ elim (ssta_inv_lift1 … HU2 … H … HVU) -H -U /3 width=8 by lsstasa_ldec/
+| #a #I #G #L #V #T1 #U1 #l #_ #IHTU1 #X #H
+ elim (ssta_inv_bind1 … H) -H #U #HU1 #H destruct /3 width=1 by lsstasa_bind/
+| #G #L #V #T1 #U1 #l #_ #IHTU1 #X #H
+ elim (ssta_inv_appl1 … H) -H #U #HU1 #H destruct /3 width=1 by lsstasa_appl/
+| /3 width=1 by lsstasa_cast/
+]
+qed.
+
+(* Main properties **********************************************************)
+
+theorem lsstas_lsstasa: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •*[h, g, l] U → ⦃G, L⦄ ⊢ T ••*[h, g, l] U.
+#h #g #G #L #T #U #l #H @(lsstas_ind_dx … H) -U -l /2 width=3 by lsstasa_step_dx, lsstasa_O/
+qed.
+
+(* Main inversion lemmas ****************************************************)
+
+theorem lsstasa_inv_lsstas: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T ••*[h, g, l] U → ⦃G, L⦄ ⊢ T •*[h, g, l] U.
+#h #g #G #L #T #U #l #H elim H -G -L -T -U -l
+/2 width=8 by lsstas_inv_SO, lsstas_ldec, lsstas_ldef, lsstas_cast, lsstas_appl, lsstas_bind/
+qed-.
+
+(* Advanced eliminators *****************************************************)
+
+lemma lsstas_ind_alt: ∀h,g. ∀R:genv→relation4 lenv nat term term.
+ (∀G,L,T. R G L O T T) →
+ (∀G,L,l,k. R G L l (⋆k) (⋆((next h)^l k))) → (
+ ∀G,L,K,V,W,U,i,l.
+ ⇩[i] L ≡ K.ⓓV → ⦃G, K⦄ ⊢ V •*[h, g, l+1] W → ⇧[O, i+1] W ≡ U →
+ R G K (l+1) V W → R G L (l+1) (#i) U
+ ) → (
+ ∀G,L,K,W,V,U,i,l,l0.
+ ⇩[i] L ≡ K.ⓛW → ⦃G, K⦄ ⊢ W ▪[h, g] l0 →
+ ⦃G, K⦄ ⊢ W •*[h, g, l]V → ⇧[O, i+1] V ≡ U →
+ R G K l W V → R G L (l+1) (#i) U
+ ) → (
+ ∀a,I,G,L,V,T,U,l. ⦃G, L.ⓑ{I}V⦄ ⊢ T •*[h, g, l] U →
+ R G (L.ⓑ{I}V) l T U → R G L l (ⓑ{a,I}V.T) (ⓑ{a,I}V.U)
+ ) → (
+ ∀G,L,V,T,U,l. ⦃G, L⦄ ⊢ T •*[h, g, l] U →
+ R G L l T U → R G L l (ⓐV.T) (ⓐV.U)
+ ) → (
+ ∀G,L,W,T,U,l. ⦃G, L⦄⊢ T •*[h, g, l+1] U →
+ R G L (l+1) T U → R G L (l+1) (ⓝW.T) U
+ ) →
+ ∀G,L,l,T,U. ⦃G, L⦄ ⊢ T •*[h, g, l] U → R G L l T U.
+#h #g #R #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #IH7 #G #L #l #T #U #H
+elim (lsstas_lsstasa … H) /3 width=10 by lsstasa_inv_lsstas/
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/ssta_lift.ma".
+include "basic_2/unfold/lsstas.ma".
+
+(* NAT-ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *****************)
+
+(* Properties on relocation *************************************************)
+
+lemma lsstas_lift: ∀h,g,G,l. l_liftable (llstar … (ssta h g G) l).
+/3 width=10 by l_liftable_llstar, ssta_lift/ qed.
+
+(* Inversion lemmas on relocation *******************************************)
+
+lemma lsstas_inv_lift1: ∀h,g,G,l. l_deliftable_sn (llstar … (ssta h g G) l).
+/3 width=6 by l_deliftable_sn_llstar, ssta_inv_lift1/ qed-.
+
+(* Advanced inversion lemmas ************************************************)
+
+lemma lsstas_inv_lref1: ∀h,g,G,L,U,i,l. ⦃G, L⦄ ⊢ #i •*[h, g, l+1] U →
+ (∃∃K,V,W. ⇩[i] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •*[h, g, l+1] W &
+ ⇧[0, i + 1] W ≡ U
+ ) ∨
+ (∃∃K,W,V,l0. ⇩[i] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W ▪[h, g] l0 &
+ ⦃G, K⦄ ⊢ W •*[h, g, l] V & ⇧[0, i + 1] V ≡ U
+ ).
+#h #g #G #L #U #i #l #H elim (lsstas_inv_step_sn … H) -H
+#X #H #HXU elim (ssta_inv_lref1 … H) -H
+* #K [ #V #W | #W #l0 ] #HLK [ #HVW | #HWl0 ] #HWX
+lapply (ldrop_fwd_drop2 … HLK) #H0LK
+elim (lsstas_inv_lift1 … HXU … H0LK … HWX) -H0LK -X
+/4 width=8 by lsstas_step_sn, ex4_4_intro, ex3_3_intro, or_introl, or_intror/
+qed-.
+
+(* Advanced forward lemmas **************************************************)
+
+lemma lsstas_fwd_correct: ∀h,g,G,L,T1,U1. ⦃G, L⦄ ⊢ T1 •[h, g] U1 →
+ ∀T2,l. ⦃G, L⦄ ⊢ T1 •*[h, g, l] T2 →
+ ∃U2. ⦃G, L⦄ ⊢ T2 •[h, g] U2.
+#h #g #G #L #T1 #U1 #HTU1 #T2 #l #H @(lsstas_ind_dx … H) -l -T2 [ /2 width=3 by ex_intro/ ] -HTU1
+#l #T #T2 #_ #HT2 #_ -T1 -U1 -l
+elim (ssta_fwd_correct … HT2) -T /2 width=2 by ex_intro/
+qed-.
+
+(* Advanced properties ******************************************************)
+
+lemma lsstas_total: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U →
+ ∀l. ∃U0. ⦃G, L⦄ ⊢ T •*[h, g, l] U0.
+#h #g #G #L #T #U #HTU #l @(nat_ind_plus … l) -l [ /2 width=2 by lstar_O, ex_intro/ ]
+#l * #U0 #HTU0
+elim (lsstas_fwd_correct … HTU … HTU0) -U /3 width=4 by lsstas_step_dx, ex_intro/
+qed-.
+
+lemma lsstas_ldef: ∀h,g,G,L,K,V,i. ⇩[i] L ≡ K.ⓓV →
+ ∀W,l. ⦃G, K⦄ ⊢ V •*[h, g, l+1] W →
+ ∀U. ⇧[0, i+1] W ≡ U → ⦃G, L⦄ ⊢ #i •*[h, g, l+1] U.
+#h #g #G #L #K #V #i #HLK #W #l #HVW #U #HWU
+lapply (ldrop_fwd_drop2 … HLK)
+elim (lsstas_inv_step_sn … HVW) -HVW #W0
+elim (lift_total W0 0 (i+1)) /3 width=12 by lsstas_step_sn, ssta_ldef, lsstas_lift/
+qed.
+
+lemma lsstas_ldec: ∀h,g,G,L,K,W,i. ⇩[i] L ≡ K.ⓛW → ∀l0. ⦃G, K⦄ ⊢ W ▪[h, g] l0 →
+ ∀V,l. ⦃G, K⦄ ⊢ W •*[h, g, l] V →
+ ∀U. ⇧[0, i+1] V ≡ U → ⦃G, L⦄ ⊢ #i •*[h, g, l+1] U.
+#h #g #G #L #K #W #i #HLK #T #HWT #V #l #HWV #U #HVU
+lapply (ldrop_fwd_drop2 … HLK) #H
+elim (lift_total W 0 (i+1)) /3 width=12 by lsstas_step_sn, ssta_ldec, lsstas_lift/
+qed.
+
+(* Properties on degree assignment for terms ********************************)
+
+lemma lsstas_da_conf: ∀h,g,G,L,T,U,l1. ⦃G, L⦄ ⊢ T •*[h, g, l1] U →
+ ∀l2. ⦃G, L⦄ ⊢ T ▪[h, g] l2 → ⦃G, L⦄ ⊢ U ▪[h, g] l2-l1.
+#h #g #G #L #T #U #l1 #H @(lsstas_ind_dx … H) -U -l1 //
+#l1 #U #U0 #_ #HU0 #IHTU #l2 #HT
+<minus_plus /3 width=3 by ssta_da_conf/
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/ssta_ssta.ma".
+include "basic_2/unfold/lsstas_lift.ma".
+
+(* NAT-ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *****************)
+
+(* Main properties **********************************************************)
+
+theorem lsstas_trans: ∀h,g,G,L. ltransitive … (lsstas h g G L).
+/2 width=3 by lstar_ltransitive/ qed-.
+
+theorem lsstas_mono: ∀h,g,G,L,l. singlevalued … (lsstas h g G L l).
+/3 width=7 by ssta_mono, lstar_singlevalued/ qed-.
+
+theorem lsstas_conf_le: ∀h,g,G,L,T,U1,l1. ⦃G, L⦄ ⊢ T •*[h, g, l1] U1 →
+ ∀U2,l2. l1 ≤ l2 → ⦃G, L⦄ ⊢ T •*[h, g, l2] U2 →
+ ⦃G, L⦄ ⊢ U1 •*[h, g, l2 - l1] U2.
+#h #g #G #L #T #U1 #l1 #HTU1 #U2 #l2 #Hl12
+>(plus_minus_m_m … Hl12) in ⊢ (%→?); -Hl12 >commutative_plus #H
+elim (lsstas_split … H) -H #U #HTU
+>(lsstas_mono … HTU … HTU1) -T //
+qed-.
+
+(* Advanced properties ******************************************************)
+
+lemma lsstas_ssta_conf_pos: ∀h,g,G,L,T,U1. ⦃G, L⦄ ⊢ T •[h, g] U1 →
+ ∀U2,l. ⦃G, L⦄ ⊢ T •*[h, g, l+1] U2 → ⦃G, L⦄ ⊢ U1 •*[h, g, l] U2.
+#h #g #G #L #T #U1 #HTU1 #U2 #l #HTU2
+lapply (lsstas_conf_le … T U1 1 … HTU2) -HTU2 // /2 width=1/
+qed-.
+
+lemma lsstas_strip_pos: ∀h,g,G,L,T1,U1. ⦃G, L⦄ ⊢ T1 •[h, g] U1 →
+ ∀T2,l. ⦃G, L⦄ ⊢ T1 •*[h, g, l+1] T2 →
+ ∃∃U2. ⦃G, L⦄ ⊢ T2 •[h, g] U2 & ⦃G, L⦄ ⊢ U1 •*[h, g, l+1] U2.
+#h #g #G #L #T1 #U1 #HTU1 #T2 #l #HT12
+elim (lsstas_fwd_correct … HTU1 … HT12)
+lapply (lsstas_ssta_conf_pos … HTU1 … HT12) -T1 /3 width=5/
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/dynamic/lsubsv_lsstas.ma".
+
+(* LOCAL ENVIRONMENT REFINEMENT FOR STRATIFIED NATIVE VALIDITY **************)
+
+(* Properties on decomposed extended parallel computation on terms **********)
+
+lemma lsubsv_cpds_trans: ∀h,g,G,L2,T1,T2. ⦃G, L2⦄ ⊢ T1 •*➡*[h, g] T2 →
+ ∀L1. G ⊢ L1 ¡⫃[h, g] L2 →
+ ∃∃T. ⦃G, L1⦄ ⊢ T1 •*➡*[h, g] T & ⦃G, L1⦄ ⊢ T2 ➡* T.
+#h #g #G #L2 #T1 #T2 * #T #l1 #l2 #Hl21 #Hl1 #HT1 #HT2 #L1 #HL12
+lapply (lsubsv_cprs_trans … HL12 … HT2) -HT2 #HT2
+elim (lsubsv_lsstas_trans … HT1 … Hl1 … HL12) // #T0 #HT10 #HT0
+lapply (lsubsv_fwd_lsubd … HL12) -HL12 #HL12
+lapply (lsubd_da_trans … Hl1 … HL12) -L2 #Hl1
+lapply (cpcs_cprs_strap1 … HT0 … HT2) -T #HT02
+elim (cpcs_inv_cprs … HT02) -HT02 /3 width=7/
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/lsubd_da.ma".
+include "basic_2/unfold/lsstas_alt.ma".
+include "basic_2/equivalence/cpcs_cpcs.ma".
+include "basic_2/dynamic/lsubsv_ldrop.ma".
+include "basic_2/dynamic/lsubsv_lsubd.ma".
+
+(* LOCAL ENVIRONMENT REFINEMENT FOR STRATIFIED NATIVE VALIDITY **************)
+
+(* Properties on nat-iterated stratified static type assignment *************)
+
+lemma lsubsv_lsstas_trans: ∀h,g,G,L2,T,U2,l1. ⦃G, L2⦄ ⊢ T •*[h, g, l1] U2 →
+ ∀l2. l1 ≤ l2 → ⦃G, L2⦄ ⊢ T ▪[h, g] l2 →
+ ∀L1. G ⊢ L1 ¡⫃[h, g] L2 →
+ ∃∃U1. ⦃G, L1⦄ ⊢ T •*[h, g, l1] U1 & ⦃G, L1⦄ ⊢ U1 ⬌* U2.
+#h #g #G #L2 #T #U #l1 #H @(lsstas_ind_alt … H) -G -L2 -T -U -l1
+[1,2: /2 width=3 by lstar_O, ex2_intro/
+| #G #L2 #K2 #X #Y #U #i #l1 #HLK2 #_ #HYU #IHXY #l2 #Hl12 #Hl2 #L1 #HL12
+ elim (da_inv_lref … Hl2) -Hl2 * #K0 #V0 [| #l0 ] #HK0 #HV0
+ lapply (ldrop_mono … HK0 … HLK2) -HK0 #H destruct
+ elim (lsubsv_ldrop_O1_trans … HL12 … HLK2) -L2 #X #H #HLK1
+ elim (lsubsv_inv_pair2 … H) -H * #K1 [ | -HYU -IHXY -HLK1 ]
+ [ #HK12 #H destruct
+ elim (IHXY … Hl12 HV0 … HK12) -K2 -l2 #T #HXT #HTY
+ lapply (ldrop_fwd_drop2 … HLK1) #H
+ elim (lift_total T 0 (i+1))
+ /3 width=12 by lsstas_ldef, cpcs_lift, ex2_intro/
+ | #V #l0 #_ #_ #_ #_ #_ #_ #_ #H destruct
+ ]
+| #G #L2 #K2 #X #Y #U #i #l1 #l #HLK2 #_ #_ #HYU #IHXY #l2 #Hl12 #Hl2 #L1 #HL12 -l
+ elim (da_inv_lref … Hl2) -Hl2 * #K0 #V0 [| #l0 ] #HK0 #HV0 [| #H1 ]
+ lapply (ldrop_mono … HK0 … HLK2) -HK0 #H2 destruct
+ lapply (le_plus_to_le_r … Hl12) -Hl12 #Hl12
+ elim (lsubsv_ldrop_O1_trans … HL12 … HLK2) -L2 #X #H #HLK1
+ elim (lsubsv_inv_pair2 … H) -H * #K1 [| ]
+ [ #HK12 #H destruct
+ lapply (lsubsv_fwd_lsubd … HK12) #H
+ lapply (lsubd_da_trans … HV0 … H) -H
+ elim (IHXY … Hl12 HV0 … HK12) -K2 -Hl12 #Y0
+ lapply (ldrop_fwd_drop2 … HLK1)
+ elim (lift_total Y0 0 (i+1))
+ /3 width=12 by lsstas_ldec, cpcs_lift, ex2_intro/
+ | #V #l #_ #_ #HVX #_ #HV #HX #HK12 #_ #H destruct
+ lapply (da_mono … HX … HV0) -HX #H destruct
+ elim (IHXY … Hl12 HV0 … HK12) -K2 #Y0 #HXY0 #HY0
+ elim (da_ssta … HV) -HV #W #HVW
+ elim (lsstas_total … HVW (l1+1)) -W #W #HVW
+ lapply (HVX … Hl12 HVW HXY0) -HVX -Hl12 -HXY0 #HWY0
+ lapply (cpcs_trans … HWY0 … HY0) -Y0
+ lapply (ldrop_fwd_drop2 … HLK1)
+ elim (lift_total W 0 (i+1))
+ /4 width=12 by lsstas_ldef, lsstas_cast, cpcs_lift, ex2_intro/
+ ]
+| #a #I #G #L2 #V2 #T2 #U2 #l1 #_ #IHTU2 #l2 #Hl12 #Hl2 #L1 #HL12
+ lapply (da_inv_bind … Hl2) -Hl2 #Hl2
+ elim (IHTU2 … Hl2 (L1.ⓑ{I}V2) …) // [2: /2 width=1/ ] -L2
+ /3 width=3 by lsstas_bind, cpcs_bind_dx, ex2_intro/
+| #G #L2 #V2 #T2 #U2 #l1 #_ #IHTU2 #l2 #Hl12 #Hl2 #L1 #HL12
+ lapply (da_inv_flat … Hl2) -Hl2 #Hl2
+ elim (IHTU2 … Hl2 … HL12) -L2 //
+ /3 width=5 by lsstas_appl, cpcs_flat, ex2_intro/
+| #G #L2 #W2 #T2 #U2 #l1 #_ #IHTU2 #l2 #Hl12 #Hl2 #L1 #HL12
+ lapply (da_inv_flat … Hl2) -Hl2 #Hl2
+ elim (IHTU2 … Hl2 … HL12) -L2 //
+ /3 width=3 by lsstas_cast, ex2_intro/
+]
+qed-.
+
+lemma lsubsv_ssta_trans: ∀h,g,G,L2,T,U2. ⦃G, L2⦄ ⊢ T •[h, g] U2 →
+ ∀l. ⦃G, L2⦄ ⊢ T ▪[h, g] l+1 →
+ ∀L1. G ⊢ L1 ¡⫃[h, g] L2 →
+ ∃∃U1. ⦃G, L1⦄ ⊢ T •[h, g] U1 & ⦃G, L1⦄ ⊢ U1 ⬌* U2.
+#h #g #G #L2 #T #U2 #H #l #HTl #L1 #HL12
+elim ( lsubsv_lsstas_trans … U2 1 … HTl … HL12)
+/3 width=3 by lsstas_inv_SO, ssta_lsstas, ex2_intro/
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/computation/cpds_cpds.ma".
+include "basic_2/dynamic/snv_aaa.ma".
+include "basic_2/dynamic/lsubsv_cpds.ma".
+include "basic_2/dynamic/lsubsv_cpcs.ma".
+
+(* LOCAL ENVIRONMENT REFINEMENT FOR STRATIFIED NATIVE VALIDITY **************)
+
+(* Properties concerning stratified native validity *************************)
+
+lemma lsubsv_snv_trans: ∀h,g,G,L2,T. ⦃G, L2⦄ ⊢ T ¡[h, g] →
+ ∀L1. G ⊢ L1 ¡⫃[h, g] L2 → ⦃G, L1⦄ ⊢ T ¡[h, g].
+#h #g #G #L2 #T #H elim H -G -L2 -T //
+[ #I #G #L2 #K2 #V #i #HLK2 #_ #IHV #L1 #HL12
+ elim (lsubsv_ldrop_O1_trans … HL12 … HLK2) -L2 #X #H #HLK1
+ elim (lsubsv_inv_pair2 … H) -H * #K1
+ [ #HK12 #H destruct /3 width=5 by snv_lref/
+ | #W #l #H1V #H1W #HWV #_ #HWl #_ #_ #H1 #H2 destruct -IHV
+ /3 width=10 by snv_scast, snv_lref/
+ ]
+| #a #I #G #L2 #V #T #_ #_ #IHV #IHT #L1 #HL12 destruct
+ /4 width=1 by snv_bind, lsubsv_pair/
+| #a #G #L2 #V #W #W0 #T #U #l #_ #_ #HVl #HVW #HW0 #HTU #IHV #IHT #L1 #HL12
+ lapply (lsubsv_cprs_trans … HL12 … HW0) -HW0 #HW0
+ elim (lsubsv_ssta_trans … HVW … HVl … HL12) -HVW #W1 #HVW1 #HW1
+ lapply (cpcs_cprs_strap1 … HW1 … HW0) -W #HW10
+ lapply (lsubd_da_trans … HVl L1 ?) -HVl /2 width=1 by lsubsv_fwd_lsubd/ #HVl
+ elim (lsubsv_cpds_trans … HTU … HL12) -HTU #X #HTU #H
+ elim (cprs_inv_abst1 … H) -H #W #U2 #HW0 #_ #H destruct
+ lapply (cpcs_cprs_strap1 … HW10 … HW0) -W0 #H
+ elim (cpcs_inv_cprs … H) -H #W0 #HW10 #HW0
+ /4 width=11 by snv_appl, cpds_cprs_trans, cprs_bind/
+| #G #L2 #W #T #U #l #_ #_ #HTl #HTU #HUW #IHW #IHT #L1 #HL12
+ lapply (lsubsv_cpcs_trans … HL12 … HUW) -HUW #HUW
+ elim (lsubsv_ssta_trans … HTU … HTl … HL12) -HTU #U0 #HTU0 #HU0
+ lapply (lsubd_da_trans … HTl L1 ?) -HTl
+ /4 width=5 by lsubsv_fwd_lsubd, snv_cast, cpcs_trans/
+]
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/notation/relations/nativevalid_5.ma".
+include "basic_2/computation/cpds.ma".
+include "basic_2/equivalence/cpcs.ma".
+
+(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
+
+definition scast: ∀h. sd h → nat → relation4 genv lenv term term ≝
+ λh,g,l,G,L,V,W. ∀V0,W0,l0.
+ l0 ≤ l → ⦃G, L⦄ ⊢ V •*[h, g, l0+1] V0 → ⦃G, L⦄ ⊢ W •*[h, g, l0] W0 → ⦃G, L⦄ ⊢ V0 ⬌* W0.
+
+(* activate genv *)
+inductive snv (h:sh) (g:sd h): relation3 genv lenv term ≝
+| snv_sort: ∀G,L,k. snv h g G L (⋆k)
+| snv_lref: ∀I,G,L,K,V,i. ⇩[i] L ≡ K.ⓑ{I}V → snv h g G K V → snv h g G L (#i)
+| snv_bind: ∀a,I,G,L,V,T. snv h g G L V → snv h g G (L.ⓑ{I}V) T → snv h g G L (ⓑ{a,I}V.T)
+| snv_appl: ∀a,G,L,V,W,W0,T,U,l. snv h g G L V → snv h g G L T →
+ ⦃G, L⦄ ⊢ V ▪[h, g] l+1 → ⦃G, L⦄ ⊢ V •[h, g] W → ⦃G, L⦄ ⊢ W ➡* W0 →
+ ⦃G, L⦄ ⊢ T •*➡*[h, g] ⓛ{a}W0.U → snv h g G L (ⓐV.T)
+| snv_cast: ∀G,L,W,T,U,l. snv h g G L W → snv h g G L T →
+ ⦃G, L⦄ ⊢ T ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T •[h, g] U → ⦃G, L⦄ ⊢ U ⬌* W → snv h g G L (ⓝW.T)
+.
+
+interpretation "stratified native validity (term)"
+ 'NativeValid h g G L T = (snv h g G L T).
+
+(* Basic inversion lemmas ***************************************************)
+
+fact snv_inv_lref_aux: ∀h,g,G,L,X. ⦃G, L⦄ ⊢ X ¡[h, g] → ∀i. X = #i →
+ ∃∃I,K,V. ⇩[i] L ≡ K.ⓑ{I}V & ⦃G, K⦄ ⊢ V ¡[h, g].
+#h #g #G #L #X * -G -L -X
+[ #G #L #k #i #H destruct
+| #I #G #L #K #V #i0 #HLK #HV #i #H destruct /2 width=5 by ex2_3_intro/
+| #a #I #G #L #V #T #_ #_ #i #H destruct
+| #a #G #L #V #W #W0 #T #U #l #_ #_ #_ #_ #_ #_ #i #H destruct
+| #G #L #W #T #U #l #_ #_ #_ #_ #_ #i #H destruct
+]
+qed-.
+
+lemma snv_inv_lref: ∀h,g,G,L,i. ⦃G, L⦄ ⊢ #i ¡[h, g] →
+ ∃∃I,K,V. ⇩[i] L ≡ K.ⓑ{I}V & ⦃G, K⦄ ⊢ V ¡[h, g].
+/2 width=3 by snv_inv_lref_aux/ qed-.
+
+fact snv_inv_gref_aux: ∀h,g,G,L,X. ⦃G, L⦄ ⊢ X ¡[h, g] → ∀p. X = §p → ⊥.
+#h #g #G #L #X * -G -L -X
+[ #G #L #k #p #H destruct
+| #I #G #L #K #V #i #_ #_ #p #H destruct
+| #a #I #G #L #V #T #_ #_ #p #H destruct
+| #a #G #L #V #W #W0 #T #U #l #_ #_ #_ #_ #_ #_ #p #H destruct
+| #G #L #W #T #U #l #_ #_ #_ #_ #_ #p #H destruct
+]
+qed-.
+
+lemma snv_inv_gref: ∀h,g,G,L,p. ⦃G, L⦄ ⊢ §p ¡[h, g] → ⊥.
+/2 width=8 by snv_inv_gref_aux/ qed-.
+
+fact snv_inv_bind_aux: ∀h,g,G,L,X. ⦃G, L⦄ ⊢ X ¡[h, g] → ∀a,I,V,T. X = ⓑ{a,I}V.T →
+ ⦃G, L⦄ ⊢ V ¡[h, g] ∧ ⦃G, L.ⓑ{I}V⦄ ⊢ T ¡[h, g].
+#h #g #G #L #X * -G -L -X
+[ #G #L #k #a #I #V #T #H destruct
+| #I0 #G #L #K #V0 #i #_ #_ #a #I #V #T #H destruct
+| #b #I0 #G #L #V0 #T0 #HV0 #HT0 #a #I #V #T #H destruct /2 width=1 by conj/
+| #b #G #L #V0 #W0 #W00 #T0 #U0 #l #_ #_ #_ #_#_ #_ #a #I #V #T #H destruct
+| #G #L #W0 #T0 #U0 #l #_ #_ #_ #_ #_ #a #I #V #T #H destruct
+]
+qed-.
+
+lemma snv_inv_bind: ∀h,g,a,I,G,L,V,T. ⦃G, L⦄ ⊢ ⓑ{a,I}V.T ¡[h, g] →
+ ⦃G, L⦄ ⊢ V ¡[h, g] ∧ ⦃G, L.ⓑ{I}V⦄ ⊢ T ¡[h, g].
+/2 width=4 by snv_inv_bind_aux/ qed-.
+
+fact snv_inv_appl_aux: ∀h,g,G,L,X. ⦃G, L⦄ ⊢ X ¡[h, g] → ∀V,T. X = ⓐV.T →
+ ∃∃a,W,W0,U,l. ⦃G, L⦄ ⊢ V ¡[h, g] & ⦃G, L⦄ ⊢ T ¡[h, g] &
+ ⦃G, L⦄ ⊢ V ▪[h, g] l+1 & ⦃G, L⦄ ⊢ V •[h, g] W & ⦃G, L⦄ ⊢ W ➡* W0 &
+ ⦃G, L⦄ ⊢ T •*➡*[h, g] ⓛ{a}W0.U.
+#h #g #G #L #X * -L -X
+[ #G #L #k #V #T #H destruct
+| #I #G #L #K #V0 #i #_ #_ #V #T #H destruct
+| #a #I #G #L #V0 #T0 #_ #_ #V #T #H destruct
+| #a #G #L #V0 #W0 #W00 #T0 #U0 #l #HV0 #HT0 #Hl #HVW0 #HW00 #HTU0 #V #T #H destruct /2 width=8 by ex6_5_intro/
+| #G #L #W0 #T0 #U0 #l #_ #_ #_ #_ #_ #V #T #H destruct
+]
+qed-.
+
+lemma snv_inv_appl: ∀h,g,G,L,V,T. ⦃G, L⦄ ⊢ ⓐV.T ¡[h, g] →
+ ∃∃a,W,W0,U,l. ⦃G, L⦄ ⊢ V ¡[h, g] & ⦃G, L⦄ ⊢ T ¡[h, g] &
+ ⦃G, L⦄ ⊢ V ▪[h, g] l+1 & ⦃G, L⦄ ⊢ V •[h, g] W & ⦃G, L⦄ ⊢ W ➡* W0 &
+ ⦃G, L⦄ ⊢ T •*➡*[h, g] ⓛ{a}W0.U.
+/2 width=3 by snv_inv_appl_aux/ qed-.
+
+fact snv_inv_cast_aux: ∀h,g,G,L,X. ⦃G, L⦄ ⊢ X ¡[h, g] → ∀W,T. X = ⓝW.T →
+ ∃∃U,l. ⦃G, L⦄ ⊢ W ¡[h, g] & ⦃G, L⦄ ⊢ T ¡[h, g] &
+ ⦃G, L⦄ ⊢ T ▪[h, g] l+1 & ⦃G, L⦄ ⊢ T •[h, g] U & ⦃G, L⦄ ⊢ U ⬌* W.
+#h #g #G #L #X * -G -L -X
+[ #G #L #k #W #T #H destruct
+| #I #G #L #K #V #i #_ #_ #W #T #H destruct
+| #a #I #G #L #V #T0 #_ #_ #W #T #H destruct
+| #a #G #L #V #W0 #W00 #T0 #U #l #_ #_ #_ #_ #_ #_ #W #T #H destruct
+| #G #L #W0 #T0 #U0 #l #HW0 #HT0 #Hl #HTU0 #HUW0 #W #T #H destruct /2 width=4 by ex5_2_intro/
+]
+qed-.
+
+lemma snv_inv_cast: ∀h,g,G,L,W,T. ⦃G, L⦄ ⊢ ⓝW.T ¡[h, g] →
+ ∃∃U,l. ⦃G, L⦄ ⊢ W ¡[h, g] & ⦃G, L⦄ ⊢ T ¡[h, g] &
+ ⦃G, L⦄ ⊢ T ▪[h, g] l+1 & ⦃G, L⦄ ⊢ T •[h, g] U & ⦃G, L⦄ ⊢ U ⬌* W.
+/2 width=3 by snv_inv_cast_aux/ qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/computation/csx_aaa.ma".
+include "basic_2/computation/cpds_aaa.ma".
+include "basic_2/equivalence/cpcs_aaa.ma".
+include "basic_2/dynamic/snv.ma".
+
+(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
+
+(* Forward lemmas on atomic arity assignment for terms **********************)
+
+lemma snv_fwd_aaa: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] → ∃A. ⦃G, L⦄ ⊢ T ⁝ A.
+#h #g #G #L #T #H elim H -G -L -T
+[ /2 width=2/
+| #I #G #L #K #V #i #HLK #_ * /3 width=6/
+| #a * #G #L #V #T #_ #_ * #B #HV * #A #HA /3 width=2/
+| #a #G #L #V #W #W0 #T #U #l #_ #_ #Hl #HVW #HW0 #HTU * #B #HV * #X #HT
+ lapply (aaa_cpds_conf h g … HV W0 ?) [ -HTU /3 width=4/ ] -W #HW0 (**) (* auto fail without -HTU *)
+ lapply (aaa_cpds_conf … HT … HTU) -HTU #H
+ elim (aaa_inv_abst … H) -H #B0 #A #H1 #HU #H2 destruct
+ lapply (aaa_mono … H1 … HW0) -W0 #H destruct /3 width=4/
+| #G #L #W #T #U #l #_ #_ #_ #HTU #HUW * #B #HW * #A #HT
+ lapply (aaa_ssta_conf … HT … HTU) -HTU #H
+ lapply (aaa_cpcs_mono … HUW … H … HW) -HUW -H #H destruct /3 width=3/
+]
+qed-.
+
+lemma snv_fwd_csx: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] → ⦃G, L⦄ ⊢ ⬊*[h, g] T.
+#h #g #G #L #T #H elim (snv_fwd_aaa … H) -H /2 width=2/
+qed-.
+
+(* Advanced forward lemmas **************************************************)
+
+lemma snv_fwd_da: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] → ∃l. ⦃G, L⦄ ⊢ T ▪[h, g] l.
+#h #g #G #L #T #H elim (snv_fwd_aaa … H) -H /2 width=2 by aaa_fwd_da/
+qed-.
+
+lemma snv_fwd_ssta: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] → ∃U. ⦃G, L⦄ ⊢ T •[h, g] U.
+#h #g #G #L #T #H elim (snv_fwd_aaa … H) -H /2 width=2 by aaa_fwd_ssta/
+qed-.
+
+lemma snv_lsstas_fwd_correct: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 ¡[h, g] → ⦃G, L⦄ ⊢ T1 •* [h, g, l] T2 →
+ ∃U2. ⦃G, L⦄ ⊢ T2 •[h, g] U2.
+#h #g #G #L #T1 #T2 #l #HT1 #HT12
+elim (snv_fwd_ssta … HT1) -HT1 /2 width=5 by lsstas_fwd_correct/
+qed-.
+
+(* Advanced properties ******************************************************)
+
+lemma snv_scast: ∀h,g,G,L,V,W,l. ⦃G, L⦄ ⊢ V ¡[h, g] → ⦃G, L⦄ ⊢ W ¡[h, g] →
+ scast h g l G L V W → ⦃G, L⦄ ⊢V ▪[h, g] l+1 → ⦃G, L⦄ ⊢ ⓝW.V ¡[h, g].
+#h #g #G #L #V #W #l #HV #HW #H #Hl
+elim (snv_fwd_ssta … HV) /4 width=6 by snv_cast, ssta_lsstas/
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/unfold/lsstas_lsstas.ma".
+include "basic_2/computation/fpbs_lift.ma".
+include "basic_2/computation/fpbg_fleq.ma".
+include "basic_2/equivalence/cpes_cpds.ma".
+include "basic_2/dynamic/snv.ma".
+
+(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
+
+(* Inductive premises for the preservation results **************************)
+
+definition IH_snv_cpr_lpr: ∀h:sh. sd h → relation3 genv lenv term ≝
+ λh,g,G,L1,T1. ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ T2 ¡[h, g].
+
+definition IH_da_cpr_lpr: ∀h:sh. sd h → relation3 genv lenv term ≝
+ λh,g,G,L1,T1. ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀l. ⦃G, L1⦄ ⊢ T1 ▪[h, g] l →
+ ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
+ ⦃G, L2⦄ ⊢ T2 ▪[h, g] l.
+
+definition IH_lsstas_cpr_lpr: ∀h:sh. sd h → relation3 genv lenv term ≝
+ λh,g,G,L1,T1. ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀l1,l2. l2 ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 →
+ ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, g, l2] U1 →
+ ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
+ ∃∃U2. ⦃G, L2⦄ ⊢ T2 •*[h, g, l2] U2 & ⦃G, L2⦄ ⊢ U1 ⬌* U2.
+
+definition IH_snv_lsstas: ∀h:sh. sd h → relation3 genv lenv term ≝
+ λh,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] →
+ ∀l1,l2. l2 ≤ l1 → ⦃G, L⦄ ⊢ T ▪[h, g] l1 →
+ ∀U. ⦃G, L⦄ ⊢ T •*[h, g, l2] U → ⦃G, L⦄ ⊢ U ¡[h, g].
+
+(* Properties for the preservation results **********************************)
+
+fact snv_cprs_lpr_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
+ ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀T2. ⦃G, L1⦄ ⊢ T1 ➡* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ T2 ¡[h, g].
+#h #g #G0 #L0 #T0 #IH #G #L1 #T1 #HLT0 #HT1 #T2 #H
+@(cprs_ind … H) -T2 /4 width=6 by fpbg_fpbs_trans, cprs_fpbs/
+qed-.
+
+fact da_cprs_lpr_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
+ ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀l. ⦃G, L1⦄ ⊢ T1 ▪[h, g] l →
+ ∀T2. ⦃G, L1⦄ ⊢ T1 ➡* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ T2 ▪[h, g] l.
+#h #g #G0 #L0 #T0 #IH2 #IH1 #G #L1 #T1 #HLT0 #HT1 #l #Hl #T2 #H
+@(cprs_ind … H) -T2 /4 width=10 by snv_cprs_lpr_aux, fpbg_fpbs_trans, cprs_fpbs/
+qed-.
+
+fact da_cpcs_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
+ ∀G,L,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L, T1⦄ → ⦃G, L⦄ ⊢ T1 ¡[h, g] →
+ ∀T2. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L, T2⦄ → ⦃G, L⦄ ⊢ T2 ¡[h, g] →
+ ∀l1. ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 → ∀l2. ⦃G, L⦄ ⊢ T2 ▪[h, g] l2 →
+ ⦃G, L⦄ ⊢ T1 ⬌* T2 → l1 = l2.
+#h #g #G0 #L0 #T0 #IH2 #IH1 #G #L #T1 #HLT01 #HT1 #T2 #HLT02 #HT2 #l1 #Hl1 #l2 #Hl2 #H
+elim (cpcs_inv_cprs … H) -H /4 width=18 by da_cprs_lpr_aux, da_mono/
+qed-.
+
+fact ssta_cpr_lpr_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lsstas_cpr_lpr h g G1 L1 T1) →
+ ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀l. ⦃G, L1⦄ ⊢ T1 ▪[h, g] l+1 →
+ ∀U1. ⦃G, L1⦄ ⊢ T1 •[h, g] U1 →
+ ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
+ ∃∃U2. ⦃G, L2⦄ ⊢ T2 •[h, g] U2 & ⦃G, L2⦄ ⊢ U1 ⬌* U2.
+#h #g #G0 #L0 #T0 #IH #G #L1 #T1 #H01 #HT1 #l #Hl #U1 #HTU1 #T2 #HT12 #L2 #HL12
+elim (IH … H01 … 1 … Hl U1 … HT12 … HL12) -H01 -Hl -HT12 -HL12
+/3 width=3 by lsstas_inv_SO, ssta_lsstas, ex2_intro/
+qed-.
+
+fact lsstas_cprs_lpr_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lsstas_cpr_lpr h g G1 L1 T1) →
+ ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀l1,l2. l2 ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 →
+ ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, g, l2] U1 →
+ ∀T2. ⦃G, L1⦄ ⊢ T1 ➡* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
+ ∃∃U2. ⦃G, L2⦄ ⊢ T2 •*[h, g, l2] U2 & ⦃G, L2⦄ ⊢ U1 ⬌* U2.
+#h #g #G0 #L0 #T0 #IH3 #IH2 #IH1 #G #L1 #T1 #H01 #HT1 #l1 #l2 #Hl21 #Hl1 #U1 #HTU1 #T2 #H
+@(cprs_ind … H) -T2 [ /2 width=10 by/ ]
+#T #T2 #HT1T #HTT2 #IHT1 #L2 #HL12
+elim (IHT1 L1) // -IHT1 #U #HTU #HU1
+elim (IH1 … Hl21 … HTU … HTT2 … HL12) -IH1 -HTU -HTT2
+[2: /3 width=12 by da_cprs_lpr_aux/
+|3: /3 width=10 by snv_cprs_lpr_aux/
+|4: /3 width=5 by fpbg_fpbs_trans, cprs_fpbs/
+] -G0 -L0 -T0 -T1 -T -l1
+/4 width=5 by lpr_cpcs_conf, cpcs_trans, ex2_intro/
+qed-.
+
+fact lsstas_cpcs_lpr_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lsstas_cpr_lpr h g G1 L1 T1) →
+ ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀l,l1. l ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 → ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, g, l] U1 →
+ ∀T2. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T2⦄ → ⦃G, L1⦄ ⊢ T2 ¡[h, g] →
+ ∀l2. l ≤ l2 → ⦃G, L1⦄ ⊢ T2 ▪[h, g] l2 → ∀U2. ⦃G, L1⦄ ⊢ T2 •*[h, g, l] U2 →
+ ⦃G, L1⦄ ⊢ T1 ⬌* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ U1 ⬌* U2.
+#h #g #G0 #L0 #T0 #IH3 #IH2 #IH1 #G #L1 #T1 #H01 #HT1 #l #l1 #Hl1 #HTl1 #U1 #HTU1 #T2 #H02 #HT2 #l2 #Hl2 #HTl2 #U2 #HTU2 #H #L2 #HL12
+elim (cpcs_inv_cprs … H) -H #T #H1 #H2
+elim (lsstas_cprs_lpr_aux … H01 HT1 … Hl1 HTl1 … HTU1 … H1 … HL12) -T1 /2 width=1 by/ #W1 #H1 #HUW1
+elim (lsstas_cprs_lpr_aux … H02 HT2 … Hl2 HTl2 … HTU2 … H2 … HL12) -T2 /2 width=1 by/ #W2 #H2 #HUW2 -L0 -T0
+lapply (lsstas_mono … H1 … H2) -h -T -l #H destruct /2 width=3 by cpcs_canc_dx/
+qed-.
+
+fact snv_ssta_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lsstas h g G1 L1 T1) →
+ ∀G,L,T. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L, T⦄ → ⦃G, L⦄ ⊢ T ¡[h, g] →
+ ∀l. ⦃G, L⦄ ⊢ T ▪[h, g] l+1 →
+ ∀U. ⦃G, L⦄ ⊢ T •[h, g] U → ⦃G, L⦄ ⊢ U ¡[h, g].
+/3 width=8 by lsstas_inv_SO, ssta_lsstas/ qed-.
+
+fact lsstas_cpds_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lsstas h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lsstas_cpr_lpr h g G1 L1 T1) →
+ ∀G,L,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L, T1⦄ → ⦃G, L⦄ ⊢ T1 ¡[h, g] →
+ ∀l1,l2. l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 →
+ ∀U1. ⦃G, L⦄ ⊢ T1 •*[h, g, l2] U1 → ∀T2. ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2 →
+ ∃∃U2,l. l ≤ l2 & ⦃G, L⦄ ⊢ T2 •*[h, g, l] U2 & ⦃G, L⦄ ⊢ U1 •*⬌*[h, g] U2.
+#h #g #G0 #L0 #T0 #IH4 #IH3 #IH2 #IH1 #G #L #T1 #H01 #HT1 #l1 #l2 #Hl21 #Hl1 #U1 #HTU1 #T2 * #T #l0 #l #Hl0 #H #HT1T #HTT2
+lapply (da_mono … H … Hl1) -H #H destruct
+lapply (lsstas_da_conf … HTU1 … Hl1) #Hl12
+elim (le_or_ge l2 l) #Hl2
+[ lapply (lsstas_conf_le … HTU1 … HT1T) -HT1T
+ /5 width=11 by cpds_cpes_dx, monotonic_le_minus_l, ex3_2_intro, ex4_3_intro/
+| lapply (lsstas_da_conf … HT1T … Hl1) #Hl1l
+ lapply (lsstas_conf_le … HT1T … HTU1) -HTU1 // #HTU1
+ elim (lsstas_cprs_lpr_aux … IH3 IH2 IH1 … Hl1l … HTU1 … HTT2 L) -IH3 -IH2 -IH1 -Hl1l -HTU1 -HTT2
+ /3 width=8 by cpcs_cpes, fpbg_fpbs_trans, lsstas_fpbs, monotonic_le_minus_l, ex3_2_intro/
+]
+qed-.
+
+fact cpds_cpr_lpr_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lsstas_cpr_lpr h g G1 L1 T1) →
+ ∀G,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G, L1, T1⦄ → ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀U1. ⦃G, L1⦄ ⊢ T1 •*➡*[h, g] U1 →
+ ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
+ ∃∃U2. ⦃G, L2⦄ ⊢ T2 •*➡*[h, g] U2 & ⦃G, L2⦄ ⊢ U1 ➡* U2.
+#h #g #G0 #L0 #T0 #IH2 #IH1 #G #L1 #T1 #H01 #HT1 #U1 * #W1 #l1 #l2 #Hl21 #Hl1 #HTW1 #HWU1 #T2 #HT12 #L2 #HL12
+elim (IH1 … H01 … HTW1 … HT12 … HL12) -IH1 // #W2 #HTW2 #HW12
+lapply (IH2 … H01 … Hl1 … HT12 … HL12) -L0 -T0 // -T1
+lapply (lpr_cprs_conf … HL12 … HWU1) -L1 #HWU1
+lapply (cpcs_canc_sn … HW12 HWU1) -W1 #H
+elim (cpcs_inv_cprs … H) -H /3 width=7 by ex4_3_intro, ex2_intro/
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/lsubd_da.ma".
+include "basic_2/computation/cpds_cpds.ma".
+include "basic_2/dynamic/snv_aaa.ma".
+include "basic_2/dynamic/snv_cpcs.ma".
+
+(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
+
+(* Properties on degree assignment for terms ********************************)
+
+fact da_cpr_lpr_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lsstas h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
+ ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_da_cpr_lpr h g G1 L1 T1.
+#h #g #G0 #L0 #T0 #IH3 #IH2 #IH1 #G1 #L1 * * [|||| * ]
+[ #k #_ #_ #_ #_ #l #H2 #X3 #H3 #L2 #_ -IH3 -IH2 -IH1
+ lapply (da_inv_sort … H2) -H2
+ lapply (cpr_inv_sort1 … H3) -H3 #H destruct /2 width=1 by da_sort/
+| #i #HG0 #HL0 #HT0 #H1 #l #H2 #X3 #H3 #L2 #HL12 destruct -IH3 -IH2
+ elim (snv_inv_lref … H1) -H1 #I0 #K0 #X0 #H #HX0
+ elim (da_inv_lref … H2) -H2 * #K1 [ #V1 | #W1 #l1 ] #HLK1 [ #HV1 | #HW1 #H ] destruct
+ lapply (ldrop_mono … H … HLK1) -H #H destruct
+ elim (cpr_inv_lref1 … H3) -H3
+ [1,3: #H destruct
+ lapply (fqup_lref … G1 … HLK1)
+ elim (lpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #H #HLK2
+ elim (lpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
+ /4 width=10 by da_ldef, da_ldec, fqup_fpbg/
+ |2,4: * #K0 #V0 #W0 #H #HVW0 #HW0
+ lapply (ldrop_mono … H … HLK1) -H #H destruct
+ lapply (fqup_lref … G1 … HLK1)
+ elim (lpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #H #HLK2
+ elim (lpr_inv_pair1 … H) -H #K2 #V2 #HK12 #_ #H destruct
+ lapply (ldrop_fwd_drop2 … HLK2) -V2
+ /4 width=8 by da_lift, fqup_fpbg/
+ ]
+| #p #_ #_ #HT0 #H1 destruct -IH3 -IH2 -IH1
+ elim (snv_inv_gref … H1)
+| #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #l #H2 #X3 #H3 #L2 #HL12 destruct -IH2
+ elim (snv_inv_bind … H1) -H1 #_ #HT1
+ lapply (da_inv_bind … H2) -H2
+ elim (cpr_inv_bind1 … H3) -H3 *
+ [ #V2 #T2 #HV12 #HT12 #H destruct
+ /4 width=9 by da_bind, fqup_fpbg, lpr_pair/
+ | #T2 #HT12 #HT2 #H1 #H2 destruct
+ /4 width=11 by da_inv_lift, fqup_fpbg, lpr_pair, ldrop_drop/
+ ]
+| #V1 #T1 #HG0 #HL0 #HT0 #H1 #l #H2 #X3 #H3 #L2 #HL12 destruct
+ elim (snv_inv_appl … H1) -H1 #b0 #W1 #W0 #T0 #l0 #HV1 #HT1 #Hl0 #HVW1 #HW10 #HT10
+ lapply (da_inv_flat … H2) -H2 #Hl
+ elim (cpr_inv_appl1 … H3) -H3 *
+ [ #V2 #T2 #HV12 #HT12 #H destruct -IH3 -IH2 /4 width=7 by da_flat, fqup_fpbg/
+ | #b #V2 #W #W2 #U1 #U2 #HV12 #HW2 #HU12 #H1 #H2 destruct
+ elim (snv_inv_bind … HT1) -HT1 #HW #HU1
+ lapply (da_inv_bind … Hl) -Hl #Hl
+ elim (cpds_inv_abst1 … HT10) -HT10 #W3 #U3 #HW3 #_ #H destruct -U3
+ lapply (cprs_div … HW3 … HW10) -W3 #HWW1
+ lapply (ssta_da_conf … HVW1 … Hl0) <minus_plus_m_m #H
+ elim (snv_fwd_da … HW) #l1 #Hl1
+ lapply (IH3 … HV1 … 1 … Hl0 W1 ?) /2 width=2 by fqup_fpbg, ssta_lsstas/ #HW1
+ lapply (da_cpcs_aux … IH2 IH1 … Hl1 … H … HWW1) -H
+ /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, ssta_fpbs/ #H destruct
+ lapply (IH1 … HV1 … Hl0 … HV12 … HL12) -HV1 -Hl0 -HV12 [ /2 by fqup_fpbg/ ] #Hl0
+ lapply (IH1 … Hl1 … HW2 … HL12) -Hl1 // /2 width=1 by fqup_fpbg/ -HW
+ lapply (IH1 … HU1 … Hl … HU12 (L2.ⓛW2) ?) -IH1 -HU1 -Hl -HU12 [1,2: /2 by fqup_fpbg, lpr_pair/ ] -HL12 -HW2
+ /4 width=6 by da_bind, lsubd_da_trans, lsubd_abbr/
+ | #b #V #V2 #W #W2 #U1 #U2 #HV1 #HV2 #HW2 #HU12 #H1 #H2 destruct -IH3 -IH2 -V -W0 -T0 -l0 -HV1 -HVW1
+ elim (snv_inv_bind … HT1) -HT1 #_
+ lapply (da_inv_bind … Hl) -Hl
+ /5 width=9 by da_bind, da_flat, fqup_fpbg, lpr_pair/
+ ]
+| #W1 #T1 #HG0 #HL0 #HT0 #H1 #l #H2 #X3 #H3 #L2 #HL12 destruct -IH3 -IH2
+ elim (snv_inv_cast … H1) -H1 #U1 #l0 #HW1 #HT1 #Hl0 #HTU1 #HUW1
+ lapply (da_inv_flat … H2) -H2 #Hl
+ elim (cpr_inv_cast1 … H3) -H3
+ [ * #W2 #T2 #HW12 #HT12 #H destruct /4 width=7 by da_flat, fqup_fpbg/
+ | /3 width=7 by fqup_fpbg/
+ ]
+]
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/computation/cpds_lift.ma".
+include "basic_2/equivalence/cpcs_cpcs.ma".
+include "basic_2/dynamic/snv.ma".
+
+(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
+
+(* Relocation properties ****************************************************)
+
+lemma snv_lift: ∀h,g,G,K,T. ⦃G, K⦄ ⊢ T ¡[h, g] → ∀L,s,d,e. ⇩[s, d, e] L ≡ K →
+ ∀U. ⇧[d, e] T ≡ U → ⦃G, L⦄ ⊢ U ¡[h, g].
+#h #g #G #K #T #H elim H -G -K -T
+[ #G #K #k #L #s #d #e #_ #X #H
+ >(lift_inv_sort1 … H) -X -K -d -e //
+| #I #G #K #K0 #V #i #HK0 #_ #IHV #L #s #d #e #HLK #X #H
+ elim (lift_inv_lref1 … H) * #Hid #H destruct
+ [ elim (ldrop_trans_le … HLK … HK0) -K /2 width=2 by lt_to_le/ #X #HL0 #H
+ elim (ldrop_inv_skip2 … H) -H /2 width=1 by lt_plus_to_minus_r/ -Hid #L0 #W #HLK0 #HVW #H destruct
+ /3 width=9 by snv_lref/
+ | lapply (ldrop_trans_ge … HLK … HK0 ?) -K
+ /3 width=9 by snv_lref, ldrop_inv_gen/
+ ]
+| #a #I #G #K #V #T #_ #_ #IHV #IHT #L #s #d #e #HLK #X #H
+ elim (lift_inv_bind1 … H) -H #W #U #HVW #HTU #H destruct
+ /4 width=5 by snv_bind, ldrop_skip/
+| #a #G #K #V #V0 #V1 #T #T1 #l #_ #_ #Hl #HV0 #HV01 #HT1 #IHV #IHT #L #s #d #e #HLK #X #H
+ elim (lift_inv_flat1 … H) -H #W #U #HVW #HTU #H destruct
+ elim (lift_total V0 d e) #W0 #HVW0
+ elim (lift_total V1 d e) #W1 #HVW1
+ elim (lift_total T1 (d+1) e) #U1 #HTU1
+ @(snv_appl … a … W0 … W1 … U1 l)
+ [1,2,3,4,5: /2 width=10 by cprs_lift, ssta_lift, da_lift/ ]
+ @(cpds_lift … HT1 … HLK … HTU) /2 width=1 by lift_bind/ (**) (* full auto raises typecjhecker failure *)
+| #G #K #V0 #T #V #l #_ #_ #Hl #HTV #HV0 #IHV0 #IHT #L #s #d #e #HLK #X #H
+ elim (lift_inv_flat1 … H) -H #W0 #U #HVW0 #HTU #H destruct
+ elim (lift_total V d e)
+ /3 width=12 by snv_cast, cpcs_lift, ssta_lift, da_lift/
+]
+qed.
+
+lemma snv_inv_lift: ∀h,g,G,L,U. ⦃G, L⦄ ⊢ U ¡[h, g] → ∀K,s,d,e. ⇩[s, d, e] L ≡ K →
+ ∀T. ⇧[d, e] T ≡ U → ⦃G, K⦄ ⊢ T ¡[h, g].
+#h #g #G #L #U #H elim H -G -L -U
+[ #G #L #k #K #s #d #e #_ #X #H
+ >(lift_inv_sort2 … H) -X -L -d -e //
+| #I #G #L #L0 #W #i #HL0 #_ #IHW #K #s #d #e #HLK #X #H
+ elim (lift_inv_lref2 … H) * #Hid #H destruct
+ [ elim (ldrop_conf_le … HLK … HL0) -L /2 width=2 by lt_to_le/ #X #HK0 #H
+ elim (ldrop_inv_skip1 … H) -H /2 width=1 by lt_plus_to_minus_r/ -Hid #K0 #V #HLK0 #HVW #H destruct
+ /3 width=12 by snv_lref/
+ | lapply (ldrop_conf_ge … HLK … HL0 ?) -L /3 width=9 by snv_lref/
+ ]
+| #a #I #G #L #W #U #_ #_ #IHW #IHU #K #s #d #e #HLK #X #H
+ elim (lift_inv_bind2 … H) -H #V #T #HVW #HTU #H destruct
+ /4 width=5 by snv_bind, ldrop_skip/
+| #a #G #L #W #W0 #W1 #U #U1 #l #_ #_ #Hl #HW0 #HW01 #HU1 #IHW #IHU #K #s #d #e #HLK #X #H
+ elim (lift_inv_flat2 … H) -H #V #T #HVW #HTU #H destruct
+ lapply (da_inv_lift … Hl … HLK … HVW) -Hl #Hl
+ elim (ssta_inv_lift1 … HW0 … HLK … HVW) -HW0 #V0 #HVW0 #HV0
+ elim (cprs_inv_lift1 … HW01 … HLK … HVW0) -W0 #V1 #HVW1 #HV01
+ elim (cpds_inv_lift1 … HU1 … HLK … HTU) -HU1 #X #H #HTU
+ elim (lift_inv_bind2 … H) -H #Y #T1 #HY #HTU1 #H destruct
+ lapply (lift_inj … HY … HVW1) -HY #H destruct
+ /3 width=8 by snv_appl/
+| #G #L #W0 #U #W #l #_ #_ #Hl #HUW #HW0 #IHW0 #IHU #K #s #d #e #HLK #X #H
+ elim (lift_inv_flat2 … H) -H #V0 #T #HVW0 #HTU #H destruct
+ lapply (da_inv_lift … Hl … HLK … HTU) -Hl #Hl
+ elim (ssta_inv_lift1 … HUW … HLK … HTU) -HUW #V #HVW #HTV
+ lapply (cpcs_inv_lift G … HLK … HVW … HVW0 ?) // -W
+ /3 width=8 by snv_cast/
+]
+qed-.
+
+(* Advanced properties ******************************************************)
+
+lemma snv_fqu_conf: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ →
+ ⦃G1, L1⦄ ⊢ T1 ¡[h, g] → ⦃G2, L2⦄ ⊢ T2 ¡[h, g].
+#h #g #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2
+[ #I1 #G1 #L1 #V1 #H
+ elim (snv_inv_lref … H) -H #I2 #L2 #V2 #H #HV2
+ lapply (ldrop_inv_O2 … H) -H #H destruct //
+|2: *
+|5,6: /3 width=8 by snv_inv_lift/
+]
+[1,3: #a #I #G1 #L1 #V1 #T1 #H elim (snv_inv_bind … H) -H //
+|2,4: * #G1 #L1 #V1 #T1 #H
+ [1,3: elim (snv_inv_appl … H) -H //
+ |2,4: elim (snv_inv_cast … H) -H //
+ ]
+]
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/dynamic/snv_lift.ma".
+include "basic_2/dynamic/snv_cpcs.ma".
+include "basic_2/dynamic/lsubsv_snv.ma".
+
+(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
+
+(* Properties on context-free parallel reduction for local environments *****)
+
+fact snv_cpr_lpr_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lsstas h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lsstas_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
+ ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_snv_cpr_lpr h g G1 L1 T1.
+#h #g #G0 #L0 #T0 #IH4 #IH3 #IH2 #IH1 #G1 #L1 * * [|||| * ]
+[ #k #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #_ destruct -IH4 -IH3 -IH2 -IH1 -H1
+ >(cpr_inv_sort1 … H2) -X //
+| #i #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #HL12 destruct -IH4 -IH3 -IH2
+ elim (snv_inv_lref … H1) -H1 #I #K1 #V1 #HLK1 #HV1
+ elim (lpr_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2
+ elim (lpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
+ lapply (fqup_lref … G1 … HLK1) #HKL
+ elim (cpr_inv_lref1 … H2) -H2
+ [ #H destruct -HLK1 /4 width=10 by fqup_fpbg, snv_lref/
+ | * #K0 #V0 #W0 #H #HVW0 #W0 -HV12
+ lapply (ldrop_mono … H … HLK1) -HLK1 -H #H destruct
+ lapply (ldrop_fwd_drop2 … HLK2) -HLK2 /4 width=8 by fqup_fpbg, snv_lift/
+ ]
+| #p #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #HL12 destruct -IH4 -IH3 -IH2 -IH1
+ elim (snv_inv_gref … H1)
+| #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #HL12 destruct -IH4 -IH3 -IH2
+ elim (snv_inv_bind … H1) -H1 #HV1 #HT1
+ elim (cpr_inv_bind1 … H2) -H2 *
+ [ #V2 #T2 #HV12 #HT12 #H destruct /4 width=8 by fqup_fpbg, snv_bind, lpr_pair/
+ | #T2 #HT12 #HXT2 #H1 #H2 destruct -HV1
+ /4 width=10 by fqup_fpbg, snv_inv_lift, lpr_pair, ldrop_drop/
+ ]
+| #V1 #T1 #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #HL12 destruct
+ elim (snv_inv_appl … H1) -H1 #a #W10 #W1 #U1 #l0 #HV1 #HT1 #Hl0 #HVW1 #HW10 #HTU1
+ elim (cpr_inv_appl1 … H2) -H2 *
+ [ #V2 #T2 #HV12 #HT12 #H destruct -IH4
+ lapply (IH1 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #HV2
+ lapply (IH1 … HT12 … HL12) /2 width=1 by fqup_fpbg/ #HT2
+ lapply (IH2 … Hl0 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #H2l0
+ elim (ssta_cpr_lpr_aux … IH3 … Hl0 … HVW1 … HV12 … HL12) -Hl0 -HVW1 -HV12 /2 width=1 by fqup_fpbg/ -HV1 #W2 #HVW2 #HW12
+ elim (cpds_cpr_lpr_aux … IH2 IH3 … HTU1 … HT12 … HL12) /2 width=1 by fqup_fpbg/ -HT12 -HTU1 #X #HTU2 #H
+ elim (cprs_inv_abst1 … H) -H #W20 #U2 #HW120 #_ #H destruct
+ lapply (lpr_cprs_conf … HL12 … HW10) -L1 #HW10
+ lapply (cpcs_cprs_strap1 … HW10 … HW120) -W1 #HW120
+ lapply (cpcs_canc_sn … HW12 HW120) -W10 #HW20
+ elim (cpcs_inv_cprs … HW20) -HW20 #W0 #HW20 #HW200
+ lapply (cpds_cprs_trans … (ⓛ{a}W0.U2) HTU2 ?)
+ /2 width=7 by snv_appl, cprs_bind/
+ | #b #V2 #W20 #W2 #T20 #T2 #HV12 #HW202 #HT202 #H1 #H2 destruct
+ elim (snv_inv_bind … HT1) -HT1 #HW20 #HT20
+ elim (cpds_inv_abst1 … HTU1) -HTU1 #W30 #T30 #HW230 #_ #H destruct -T30
+ lapply (cprs_div … HW10 … HW230) -W30 #HW120
+ lapply (snv_ssta_aux … IH4 … Hl0 … HVW1) /2 width=1 by fqup_fpbg/ #HW10
+ lapply (ssta_da_conf … HVW1 … Hl0) <minus_plus_m_m #HlW10
+ elim (snv_fwd_da … HW20) #l #Hl
+ lapply (da_cpcs_aux … IH1 IH2 … HlW10 … Hl … HW120) // -HlW10
+ /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, ssta_fpbs/ #H destruct
+ lapply (IH2 … Hl0 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #HlV2
+ lapply (IH2 … Hl … HW202 … HL12) /2 width=1 by fqup_fpbg/ #HlW2
+ elim (ssta_cpr_lpr_aux … IH3 … Hl0 … HVW1 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #W3 #HV2W3 #HW103
+ lapply (ssta_da_conf … HV2W3 … HlV2) <minus_plus_m_m #HlW3
+ lapply (cpcs_cpr_strap1 … HW120 … HW202) -HW120 #HW102
+ lapply (lpr_cpcs_conf … HL12 … HW102) -HW102 #HW102
+ lapply (cpcs_canc_sn … HW103 … HW102) -W10 #HW32
+ lapply (IH1 … HV12 … HL12) /2 width=1 by fqup_fpbg/ -HV1 #HV2
+ lapply (IH1 … HW202 … HL12) /2 width=1 by fqup_fpbg/ -HW20 #HW2
+ lapply (IH1 … HT20 … HT202 … (L2.ⓛW2) ?) /2 width=1 by fqup_fpbg, lpr_pair/ -HT20 #HT2
+ lapply (snv_ssta_aux … IH4 … HlV2 … HV2W3)
+ /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_fpbs/ #HW3
+ lapply (lsubsv_snv_trans … HT2 (L2.ⓓⓝW2.V2) ?) -HT2 /3 width=3 by snv_bind, snv_cast/
+ @(lsubsv_abbr … l) /3 width=7 by fqup_fpbg/ #W #W0 #l0 #Hl0 #HV2W #HW20
+ lapply (lsstas_ssta_conf_pos … HV2W3 … HV2W) -HV2W #HW3W
+ @(lsstas_cpcs_lpr_aux … IH1 IH2 IH3 … HlW3 … HW3W … HlW2 … HW20 … HW32) //
+ [ /3 width=9 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_ssta_fpbs/
+ | /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_fpbs/
+ ]
+ | #b #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HV02 #HW02 #HT02 #H1 #H2 destruct -IH4
+ elim (snv_inv_bind … HT1) -HT1 #HW0 #HT0
+ elim (cpds_inv_abbr_abst … HTU1) -HTU1 #X #HTU0 #HX #H destruct
+ elim (lift_inv_bind1 … HX) -HX #W3 #U3 #HW13 #_ #H destruct
+ lapply (lpr_cprs_conf … HL12 … HW10) -HW10 #HW10
+ elim (cpds_cpr_lpr_aux … IH2 IH3 … HTU0 … HT02 (L2.ⓓW2)) /2 width=1 by fqup_fpbg, lpr_pair/ -HTU0 #X #HTU2 #H
+ elim (cprs_inv_abst1 … H) -H #W #U2 #HW1 #_ #H destruct -U3
+ elim (ssta_cpr_lpr_aux … IH3 … HVW1 … HV10 … HL12) /2 width=2 by fqup_fpbg/ -IH3 -HVW1 #X #H1 #H2
+ lapply (cpcs_canc_sn … H2 HW10) -W10 #H2
+ elim (lift_total X 0 1) #W20 #H3
+ lapply (ssta_lift … H1 (L2.ⓓW2) … HV02 … H3) /2 width=2 by ldrop_drop/ -H1 #HVW20
+ lapply (cpcs_lift … (L2.ⓓW2) … H3 … HW13 H2) /2 width=2 by ldrop_drop/ -HW13 -H3 -H2 #HW320
+ lapply (cpcs_cprs_strap1 … HW320 … HW1) -W3 #HW20
+ elim (cpcs_inv_cprs … HW20) -HW20 #W3 #HW203 #HW3
+ lapply (cpds_cprs_trans … (ⓛ{a}W3.U2) HTU2 ?) /2 width=1 by cprs_bind/ -HW3 -HTU2 #HTU2
+ lapply (IH2 … Hl0 … HV10 … HL12) /2 width=1 by fqup_fpbg/ -IH2 -Hl0 #Hl0
+ lapply (da_lift … Hl0 (L2.ⓓW2) … HV02) /2 width=2 by ldrop_drop/ -Hl0 #Hl0
+ lapply (IH1 … HW02 … HL12) /2 width=1 by fqup_fpbg/ -HW0 #HW2
+ lapply (IH1 … HV10 … HL12) /2 width=1 by fqup_fpbg/ -HV1 -HV10 #HV0
+ lapply (IH1 … HT02 (L2.ⓓW2) ?) /2 width=1 by fqup_fpbg, lpr_pair/ -L1 #HT2
+ lapply (snv_lift … HV0 (L2.ⓓW2) … HV02) /3 width=7 by snv_bind, snv_appl, ldrop_drop/
+ ]
+| #W1 #T1 #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #HL12 destruct -IH4
+ elim (snv_inv_cast … H1) -H1 #U1 #l0 #HW1 #HT1 #Hl0 #HTU1 #HUW1
+ elim (cpr_inv_cast1 … H2) -H2
+ [ * #W2 #T2 #HW12 #HT12 #H destruct
+ lapply (cpcs_cprs_strap1 … HUW1 W2 ?) /2 width=1 by cpr_cprs/ -HUW1 #H1
+ lapply (IH1 … HW12 … HL12) /2 width=1 by fqup_fpbg/ -HW1 -HW12 #HW2
+ lapply (IH1 … HT12 … HL12) /2 width=1 by fqup_fpbg/ -IH1 #HT2
+ elim (ssta_cpr_lpr_aux … IH3 … Hl0 … HTU1 … HT12 … HL12) /2 width=2 by fqup_fpbg/ -IH3 -HTU1 #U2 #HTU2 #HU12
+ lapply (IH2 … Hl0 … HT12 … HL12) /2 width=1 by fqup_fpbg/ -IH2 -HT1 -HT12 -Hl0 #Hl0
+ /4 width=7 by snv_cast, lpr_cpcs_conf, cpcs_canc_sn/
+ | #H -IH3 -IH2 -HW1 -HTU1 -HUW1
+ lapply (IH1 … H … HL12) /2 width=1 by fqup_fpbg/
+ ]
+]
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/dynamic/snv_lift.ma".
+include "basic_2/dynamic/snv_cpcs.ma".
+
+(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
+
+(* Properties on nat-iterated stratified static type assignment for terms ***)
+
+fact snv_lsstas_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lsstas_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lsstas h g G1 L1 T1) →
+ ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_snv_lsstas h g G1 L1 T1.
+#h #g #G0 #L0 #T0 #IH4 #IH3 #IH2 #IH1 #G1 #L1 * * [|||| * ]
+[ #k #HG0 #HL0 #HT0 #_ #l1 #l2 #Hl21 #Hl1 #X #H2 destruct -IH4 -IH3 -IH2 -IH1
+ >(lsstas_inv_sort1 … H2) -X //
+| #i #HG0 #HL0 #HT0 #H1 #l1 #l2 @(nat_ind_plus … l2) -l2 [ #_ | #l2 #_ #Hl21 ] #Hl1 #X #H2 destruct -IH4 -IH3 -IH2
+ [ lapply (lsstas_inv_O … H2) -H2 #H destruct // ]
+ elim (snv_inv_lref … H1) -H1 #I0 #K0 #X0 #HLK0 #HX0
+ elim (da_inv_lref … Hl1) -Hl1 * #K1 [ #V1 | #W1 #l ] #HLK1 [ #Hl1 | #Hl #H ]
+ lapply (ldrop_mono … HLK0 … HLK1) -HLK0 #H0 destruct
+ elim (lsstas_inv_lref1 … H2) -H2 * #K0 #Y0 #X0 [2,4: #l0 ] #HLK0 [1,2: #HYl0 ] #HYX0 #HX0
+ lapply (ldrop_mono … HLK0 … HLK1) -HLK0 #H destruct
+ [ lapply (le_plus_to_le_r … Hl21) -Hl21 #Hl21 ]
+ lapply (fqup_lref … G1 … HLK1) #H
+ lapply (ldrop_fwd_drop2 … HLK1) -HLK1 /4 width=8 by fqup_fpbg, snv_lift/
+| #p #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X #H2 destruct -IH4 -IH3 -IH2 -IH1
+ elim (snv_inv_gref … H1)
+| #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X #H2 destruct -IH4 -IH3 -IH2
+ elim (snv_inv_bind … H1) -H1 #HV1 #HT1
+ lapply (da_inv_bind … Hl1) -Hl1 #Hl1
+ elim (lsstas_inv_bind1 … H2) -H2 #U1 #HTU1 #H destruct /4 width=8 by fqup_fpbg, snv_bind/
+| #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X #H2 destruct
+ elim (snv_inv_appl … H1) -H1 #a #W1 #W0 #T0 #l0 #HV1 #HT1 #Hl0 #HVW1 #HW10 #HT10
+ lapply (da_inv_flat … Hl1) -Hl1 #Hl1
+ elim (lsstas_inv_appl1 … H2) -H2 #U1 #HTU1 #H destruct
+ lapply (IH1 … HT1 … Hl1 … HTU1) /2 width=1 by fqup_fpbg/ #HU1
+ elim (lsstas_cpds_aux … IH1 IH4 IH3 IH2 … Hl1 … HTU1 … HT10) -IH4 -IH3 -IH2 -IH1 /2 width=1 by fqup_fpbg/ -T1 -l1 #X #l #_ #H #HU10 -l2
+ elim (lsstas_inv_bind1 … H) -H #U0 #_ #H destruct -T0 -l
+ elim (cpes_inv_abst2 … HU10) -HU10 #W2 #U2 #HU12 #HU02
+ elim (cprs_inv_abst … HU02) -HU02 #HW02 #_
+ /3 width=7 by snv_appl, cprs_trans/
+| #W1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 @(nat_ind_plus … l2) -l2 [ #_ | #l2 #_ #Hl21 ] #Hl1 #X #H2 destruct -IH4 -IH3 -IH2
+ [ lapply (lsstas_inv_O … H2) -H2 #H destruct // ]
+ elim (snv_inv_cast … H1) -H1
+ lapply (da_inv_flat … Hl1) -Hl1
+ lapply (lsstas_inv_cast1 … H2) -H2 /3 width=8 by fqup_fpbg/
+]
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/computation/cpds_cpds.ma".
+include "basic_2/dynamic/snv_aaa.ma".
+include "basic_2/dynamic/snv_cpcs.ma".
+include "basic_2/dynamic/lsubsv_lsstas.ma".
+
+(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
+
+(* Properties on sn parallel reduction for local environments ***************)
+
+fact lsstas_cpr_lpr_aux: ∀h,g,G0,L0,T0.
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lsstas h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
+ (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lsstas_cpr_lpr h g G1 L1 T1) →
+ ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_lsstas_cpr_lpr h g G1 L1 T1.
+#h #g #G0 #L0 #T0 #IH4 #IH3 #IH2 #IH1 #G1 #L1 * * [|||| * ]
+[ #k #_ #_ #_ #_ #l1 #l2 #_ #_ #X2 #H2 #X3 #H3 #L2 #_ -IH4 -IH3 -IH2 -IH1
+ >(lsstas_inv_sort1 … H2) -X2
+ >(cpr_inv_sort1 … H3) -X3 /2 width=3 by cpr_atom, ex2_intro/
+| #i #HG0 #HL0 #HT0 #H1 #l1 #l2 @(nat_ind_plus … l2) -l2 [ #_ | #l2 #_ #Hl21 ] #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct -IH4 -IH3
+ [ lapply (lsstas_inv_O … H2) -H2 #H destruct -IH1 -H1 -l1 /4 width=5 by lpr_cpcs_conf, cpr_cpcs_dx, ex2_intro/ ]
+ elim (snv_inv_lref … H1) -H1 #I0 #K0 #X0 #HK0 #HX0
+ elim (da_inv_lref … Hl1) -Hl1 * #K1 [ #V1 | #W1 #l0 ] #HLK1 [ #HVl1 | #HWl1 #H destruct ]
+ lapply (ldrop_mono … HK0 … HLK1) -HK0 #H destruct
+ elim (lsstas_inv_lref1 … H2) -H2 * #K0 #V0 #W0 [2,4: #l ] #HK0 [1,2: #Hl ] #HW0 #HX2
+ lapply (ldrop_mono … HK0 … HLK1) -HK0 #H destruct
+ [ lapply (da_mono … Hl … HWl1) -Hl #H destruct
+ lapply (le_plus_to_le_r … Hl21) -Hl21 #Hl21
+ ]
+ lapply (fqup_lref … G1 … HLK1) #HKV1
+ elim (lpr_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2
+ elim (lpr_inv_pair1 … H) -H #K2 [ #W2 | #V2 ] #HK12 [ #HW12 | #HV12 ] #H destruct
+ lapply (ldrop_fwd_drop2 … HLK2) #H2
+ elim (cpr_inv_lref1 … H3) -H3
+ [1,3: #H destruct -HLK1
+ |2,4: * #K0 #V0 #X0 #H #HVX0 #HX0
+ lapply (ldrop_mono … H … HLK1) -H -HLK1 #H destruct
+ ]
+ [ elim (IH1 … HWl1 … HW0 … HW12 … HK12) -IH1 -HW0 /2 width=1 by fqup_fpbg/ #V2 #HWV2 #HV2
+ elim (lift_total V2 0 (i+1))
+ /6 width=12 by fqup_fpbg, cpcs_lift, lsstas_ldec, ex2_intro/
+ | elim (IH1 … HVl1 … HW0 … HV12 … HK12) -IH1 -HVl1 -HW0 -HV12 -HK12 -IH2 /2 width=1 by fqup_fpbg/ #W2 #HVW2 #HW02
+ elim (lift_total W2 0 (i+1))
+ /4 width=12 by cpcs_lift, lsstas_ldef, ex2_intro/
+ | elim (IH1 … HVl1 … HW0 … HVX0 … HK12) -IH1 -HVl1 -HW0 -HVX0 -HK12 -IH2 -V2 /2 width=1 by fqup_fpbg/ -l1 #W2 #HXW2 #HW02
+ elim (lift_total W2 0 (i+1))
+ /3 width=12 by cpcs_lift, lsstas_lift, ex2_intro/
+ ]
+| #p #_ #_ #HT0 #H1 destruct -IH4 -IH3 -IH2 -IH1
+ elim (snv_inv_gref … H1)
+| #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct -IH4 -IH3 -IH2
+ elim (snv_inv_bind … H1) -H1 #_ #HT1
+ lapply (da_inv_bind … Hl1) -Hl1 #Hl1
+ elim (lsstas_inv_bind1 … H2) -H2 #U1 #HTU1 #H destruct
+ elim (cpr_inv_bind1 … H3) -H3 *
+ [ #V2 #T2 #HV12 #HT12 #H destruct
+ elim (IH1 … Hl1 … HTU1 … HT12 (L2.ⓑ{I}V2)) -IH1 -Hl1 -HTU1 -HT12 /2 width=1 by fqup_fpbg, lpr_pair/ -T1
+ /4 width=5 by cpcs_bind2, lpr_cpr_conf, lsstas_bind, ex2_intro/
+ | #T3 #HT13 #HXT3 #H1 #H2 destruct
+ elim (IH1 … Hl1 … HTU1 … HT13 (L2.ⓓV1)) -IH1 -Hl1 -HTU1 -HT13 /2 width=1 by fqup_fpbg, lpr_pair/ -T1 -HL12 #U3 #HTU3 #HU13
+ elim (lsstas_inv_lift1 … HTU3 L2 … HXT3) -T3
+ /5 width=8 by cpcs_cpr_strap1, cpcs_bind1, cpr_zeta, ldrop_drop, ex2_intro/
+ ]
+| #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct
+ elim (snv_inv_appl … H1) -H1 #a #W1 #W10 #U10 #l0 #HV1 #HT1 #Hl0 #HVW1 #HW10 #HTU10
+ lapply (da_inv_flat … Hl1) -Hl1 #Hl1
+ elim (lsstas_inv_appl1 … H2) -H2 #U1 #HTU1 #H destruct
+ elim (cpr_inv_appl1 … H3) -H3 *
+ [ #V2 #T2 #HV12 #HT12 #H destruct -a -l0 -W1 -W10 -U10 -HV1 -IH4 -IH3 -IH2
+ elim (IH1 … Hl1 … HTU1 … HT12 … HL12) -IH1 -Hl1 -HTU1
+ /4 width=5 by fqup_fpbg, cpcs_flat, lpr_cpr_conf, lsstas_appl, ex2_intro/
+ | #b #V2 #W2 #W3 #T2 #T3 #HV12 #HW23 #HT23 #H1 #H2 destruct
+ elim (snv_inv_bind … HT1) -HT1 #HW2 #HT2
+ lapply (da_inv_bind … Hl1) -Hl1 #Hl1
+ elim (lsstas_inv_bind1 … HTU1) -HTU1 #U2 #HTU2 #H destruct
+ elim (cpds_inv_abst1 … HTU10) -HTU10 #W0 #U0 #HW20 #_ #H destruct
+ lapply (cprs_div … HW10 … HW20) -W0 #HW12
+ lapply (ssta_da_conf … HVW1 … Hl0) <minus_plus_m_m #H
+ elim (snv_fwd_da … HW2) #l #Hl
+ lapply (IH4 … HV1 … 1 … Hl0 W1 ?) /2 width=1 by fqup_fpbg, ssta_lsstas/ #HW1
+ lapply (da_cpcs_aux … IH3 IH2 … H … Hl … HW12) // -H
+ /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, ssta_fpbs/ #H destruct
+ lapply (IH3 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #HV2
+ lapply (IH2 … Hl0 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #HV2l
+ elim (IH1 … 1 … Hl0 … W1 … HV12 … HL12) /2 width=1 by fqup_fpbg, ssta_lsstas/ -HVW1 #W4 #H #HW14
+ lapply (lsstas_inv_SO … H) #HV2W4
+ lapply (ssta_da_conf … HV2W4 … HV2l) <minus_plus_m_m #HW4l
+ lapply (IH4 … HV2 … HV2l … H) -H /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_fpbs/ #HW4
+ lapply (IH3 … HW23 … HL12) /2 width=1 by fqup_fpbg/ #HW3
+ lapply (IH2 … Hl … HW23 … HL12) /2 width=1 by fqup_fpbg/ #HW3l
+ elim (IH1 … Hl1 … HTU2 … HT23 (L2.ⓛW3)) -HTU2 /2 width=1 by fqup_fpbg, lpr_pair/ #U3 #HTU3 #HU23
+ lapply (cpcs_cpr_strap1 … HW12 … HW23) #H
+ lapply (lpr_cpcs_conf … HL12 … H) -H #H
+ lapply (cpcs_canc_sn … HW14 H) -H #HW43
+ elim (lsubsv_lsstas_trans … HTU3 … Hl21 … (L2.ⓓⓝW3.V2)) -HTU3
+ [ #U4 #HT3U4 #HU43 -HW12 -HW3 -HW3l -W4 -IH2 -IH3 -IH4
+ @(ex2_intro … (ⓓ{b}ⓝW3.V2.U4)) /2 width=1 by lsstas_bind/ -HT3U4
+ @(cpcs_canc_dx … (ⓓ{b}ⓝW3.V2.U3)) /2 width=1 by cpcs_bind_dx/ -HU43
+ @(cpcs_cpr_strap1 … (ⓐV2.ⓛ{b}W3.U3)) /2 width=1 by cpr_beta/
+ /4 width=3 by cpcs_flat, cpcs_bind2, lpr_cpr_conf/
+ | -U3
+ @(lsubsv_abbr … l) /3 width=7 by fqup_fpbg/
+ #W #W0 #l0 #Hl0 #HV2W #HW30
+ lapply (lsstas_ssta_conf_pos … HV2W4 … HV2W) -HV2W #HW4W
+ @(lsstas_cpcs_lpr_aux … IH3 IH2 IH1 … Hl0 … HW4W … Hl0 … HW30 … HW43) //
+ [ /3 width=9 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_ssta_fpbs/
+ | /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_fpbs/
+ ]
+ | -IH1 -IH3 -IH4 /3 width=9 by fqup_fpbg, lpr_pair/
+ ]
+ | #b #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HV02 #HW02 #HT02 #H1 #H2 destruct -a -l0 -W1 -W10 -HV1 -IH4 -IH3 -IH2
+ elim (snv_inv_bind … HT1) -HT1 #_ #HT0
+ lapply (da_inv_bind … Hl1) -Hl1 #Hl1
+ elim (lsstas_inv_bind1 … HTU1) -HTU1 #U0 #HTU0 #H destruct
+ elim (IH1 … Hl1 … HTU0 … HT02 (L2.ⓓW2)) -IH1 -Hl1 -HTU0 /2 width=1 by fqup_fpbg, lpr_pair/ -T0 #U2 #HTU2 #HU02
+ lapply (lpr_cpr_conf … HL12 … HV10) -HV10 #HV10
+ lapply (lpr_cpr_conf … HL12 … HW02) -L1 #HW02
+ lapply (cpcs_bind2 b … HW02 … HU02) -HW02 -HU02 #HU02
+ lapply (cpcs_flat … HV10 … HU02 Appl) -HV10 -HU02 #HU02
+ lapply (cpcs_cpr_strap1 … HU02 (ⓓ{b}W2.ⓐV2.U2) ?)
+ /4 width=3 by lsstas_appl, lsstas_bind, cpr_theta, ex2_intro/
+ ]
+| #W1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 @(nat_ind_plus … l2) -l2 [ #_ | #l2 #_ #Hl21 ] #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct -IH4 -IH3 -IH2
+ [ lapply (lsstas_inv_O … H2) -H2 #H destruct -IH1 -H1 -l1 /4 width=5 by lpr_cpcs_conf, cpr_cpcs_dx, ex2_intro/ ]
+ elim (snv_inv_cast … H1) -H1 #U1 #l #_ #HT1 #_ #_ #_ -U1 -l
+ lapply (da_inv_flat … Hl1) -Hl1 #Hl1
+ lapply (lsstas_inv_cast1 … H2) -H2 #HTU1
+ elim (cpr_inv_cast1 … H3) -H3
+ [ * #U2 #T2 #_ #HT12 #H destruct
+ elim (IH1 … Hl1 … HTU1 … HT12 … HL12) -IH1 -Hl1 -HTU1 -HL12
+ /3 width=3 by fqup_fpbg, lsstas_cast, ex2_intro/
+ | #HT1X3
+ elim (IH1 … Hl1 … HTU1 … HT1X3 … HL12) -IH1 -Hl1 -HTU1 -HL12
+ /2 width=3 by fqup_fpbg, ex2_intro/
+ ]
+]
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/computation/fsb_aaa.ma".
+include "basic_2/dynamic/snv_da_lpr.ma".
+include "basic_2/dynamic/snv_lsstas.ma".
+include "basic_2/dynamic/snv_lsstas_lpr.ma".
+include "basic_2/dynamic/snv_lpr.ma".
+
+(* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
+
+(* Main preservation properties *********************************************)
+
+lemma snv_preserve: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] →
+ ∧∧ IH_da_cpr_lpr h g G L T
+ & IH_snv_cpr_lpr h g G L T
+ & IH_snv_lsstas h g G L T
+ & IH_lsstas_cpr_lpr h g G L T.
+#h #g #G #L #T #HT elim (snv_fwd_aaa … HT) -HT
+#A #HT @(aaa_ind_fpbg h g … HT) -G -L -T -A
+#G #L #T #A #_ #IH -A @and4_intro
+[ letin aux ≝ da_cpr_lpr_aux | letin aux ≝ snv_cpr_lpr_aux
+| letin aux ≝ snv_lsstas_aux | letin aux ≝ lsstas_cpr_lpr_aux
+]
+@(aux … G L T) // #G0 #L0 #T0 #H elim (IH … H) -IH -H //
+qed-.
+
+theorem da_cpr_lpr: ∀h,g,G,L,T. IH_da_cpr_lpr h g G L T.
+#h #g #G #L #T #HT elim (snv_preserve … HT) /2 width=1 by/
+qed-.
+
+theorem snv_cpr_lpr: ∀h,g,G,L,T. IH_snv_cpr_lpr h g G L T.
+#h #g #G #L #T #HT elim (snv_preserve … HT) /2 width=1 by/
+qed-.
+
+theorem snv_lsstas: ∀h,g,G,L,T. IH_snv_lsstas h g G L T.
+#h #g #G #L #T #HT elim (snv_preserve … HT) /2 width=5 by/
+qed-.
+
+theorem lsstas_cpr_lpr: ∀h,g,G,L,T. IH_lsstas_cpr_lpr h g G L T.
+#h #g #G #L #T #HT elim (snv_preserve … HT) /2 width=3 by/
+qed-.
+
+(* Advanced preservation properties *****************************************)
+
+lemma snv_cprs_lpr: ∀h,g,G,L1,T1. ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀T2. ⦃G, L1⦄ ⊢ T1 ➡* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ T2 ¡[h, g].
+#h #g #G #L1 #T1 #HT1 #T2 #H
+@(cprs_ind … H) -T2 /3 width=5 by snv_cpr_lpr/
+qed-.
+
+lemma da_cprs_lpr: ∀h,g,G,L1,T1. ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀l. ⦃G, L1⦄ ⊢ T1 ▪[h, g] l →
+ ∀T2. ⦃G, L1⦄ ⊢ T1 ➡* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ T2 ▪[h, g] l.
+#h #g #G #L1 #T1 #HT1 #l #Hl #T2 #H
+@(cprs_ind … H) -T2 /3 width=6 by snv_cprs_lpr, da_cpr_lpr/
+qed-.
+
+lemma da_cpcs: ∀h,g,G,L,T1. ⦃G, L⦄ ⊢ T1 ¡[h, g] →
+ ∀T2. ⦃G, L⦄ ⊢ T2 ¡[h, g] →
+ ∀l1. ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 → ∀l2. ⦃G, L⦄ ⊢ T2 ▪[h, g] l2 →
+ ⦃G, L⦄ ⊢ T1 ⬌* T2 → l1 = l2.
+#h #g #G #L #T1 #HT1 #T2 #HT2 #l1 #Hl1 #l2 #Hl2 #H
+elim (cpcs_inv_cprs … H) -H /3 width=12 by da_cprs_lpr, da_mono/
+qed-.
+
+lemma ssta_cpr_lpr: ∀h,g,G,L1,T1. ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀l. ⦃G, L1⦄ ⊢ T1 ▪[h, g] l+1 →
+ ∀U1. ⦃G, L1⦄ ⊢ T1 •[h, g] U1 →
+ ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
+ ∃∃U2. ⦃G, L2⦄ ⊢ T2 •[h, g] U2 & ⦃G, L2⦄ ⊢ U1 ⬌* U2.
+#h #g #G #L1 #T1 #HT1 #l #Hl #U1 #HTU1 #T2 #HT12 #L2 #HL12
+elim (lsstas_cpr_lpr … 1 … Hl U1 … HT12 … HL12) -Hl -HT12 -HL12
+/3 width=3 by lsstas_inv_SO, ssta_lsstas, ex2_intro/
+qed-.
+
+lemma lsstas_cprs_lpr: ∀h,g,G,L1,T1. ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀l1,l2. l2 ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 →
+ ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, g, l2] U1 →
+ ∀T2. ⦃G, L1⦄ ⊢ T1 ➡* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
+ ∃∃U2. ⦃G, L2⦄ ⊢ T2 •*[h, g, l2] U2 & ⦃G, L2⦄ ⊢ U1 ⬌* U2.
+#h #g #G #L1 #T1 #HT1 #l1 #l2 #Hl21 #Hl1 #U1 #HTU1 #T2 #H
+@(cprs_ind … H) -T2 [ /2 width=9 by lsstas_cpr_lpr/ ]
+#T #T2 #HT1T #HTT2 #IHT1 #L2 #HL12
+elim (IHT1 L1) // -IHT1 #U #HTU #HU1
+elim (lsstas_cpr_lpr … Hl21 … HTU … HTT2 … HL12) -HTU -HTT2
+[2,3: /2 width=6 by snv_cprs_lpr, da_cprs_lpr/ ] -T1 -T -l1
+/4 width=5 by lpr_cpcs_conf, cpcs_trans, ex2_intro/
+qed-.
+
+lemma lsstas_cpcs_lpr: ∀h,g,G,L1,T1. ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀l,l1. l ≤ l1 → ⦃G, L1⦄ ⊢ T1 ▪[h, g] l1 → ∀U1. ⦃G, L1⦄ ⊢ T1 •*[h, g, l] U1 →
+ ∀T2. ⦃G, L1⦄ ⊢ T2 ¡[h, g] →
+ ∀l2. l ≤ l2 → ⦃G, L1⦄ ⊢ T2 ▪[h, g] l2 → ∀U2. ⦃G, L1⦄ ⊢ T2 •*[h, g, l] U2 →
+ ⦃G, L1⦄ ⊢ T1 ⬌* T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ U1 ⬌* U2.
+#h #g #G #L1 #T1 #HT1 #l #l1 #Hl1 #HTl1 #U1 #HTU1 #T2 #HT2 #l2 #Hl2 #HTl2 #U2 #HTU2 #H #L2 #HL12
+elim (cpcs_inv_cprs … H) -H #T #H1 #H2
+elim (lsstas_cprs_lpr … HT1 … Hl1 HTl1 … HTU1 … H1 … HL12) -T1 #W1 #H1 #HUW1
+elim (lsstas_cprs_lpr … HT2 … Hl2 HTl2 … HTU2 … H2 … HL12) -T2 #W2 #H2 #HUW2
+lapply (lsstas_mono … H1 … H2) -h -T -l #H destruct /2 width=3 by cpcs_canc_dx/
+qed-.
+
+lemma snv_ssta: ∀h,g,G,L,T. ⦃G, L⦄ ⊢ T ¡[h, g] →
+ ∀l. ⦃G, L⦄ ⊢ T ▪[h, g] l+1 →
+ ∀U. ⦃G, L⦄ ⊢ T •[h, g] U → ⦃G, L⦄ ⊢ U ¡[h, g].
+/3 width=7 by lsstas_inv_SO, ssta_lsstas, snv_lsstas/ qed-.
+
+lemma lsstas_cpds: ∀h,g,G,L,T1. ⦃G, L⦄ ⊢ T1 ¡[h, g] →
+ ∀l1,l2. l2 ≤ l1 → ⦃G, L⦄ ⊢ T1 ▪[h, g] l1 →
+ ∀U1. ⦃G, L⦄ ⊢ T1 •*[h, g, l2] U1 → ∀T2. ⦃G, L⦄ ⊢ T1 •*➡*[h, g] T2 →
+ ∃∃U2,l. l ≤ l2 & ⦃G, L⦄ ⊢ T2 •*[h, g, l] U2 & ⦃G, L⦄ ⊢ U1 •*⬌*[h, g] U2.
+#h #g #G #L #T1 #HT1 #l1 #l2 #Hl21 #Hl1 #U1 #HTU1 #T2 * #T #l0 #l #Hl0 #H #HT1T #HTT2
+lapply (da_mono … H … Hl1) -H #H destruct
+lapply (lsstas_da_conf … HTU1 … Hl1) #Hl12
+elim (le_or_ge l2 l) #Hl2
+[ lapply (lsstas_conf_le … HTU1 … HT1T) -HT1T //
+ /5 width=11 by cpds_cpes_dx, monotonic_le_minus_l, ex3_2_intro, ex4_3_intro/
+| lapply (lsstas_da_conf … HT1T … Hl1) #Hl1l
+ lapply (lsstas_conf_le … HT1T … HTU1) -HTU1 // #HTU1
+ elim (lsstas_cprs_lpr … Hl1l … HTU1 … HTT2 L) -Hl1l -HTU1 -HTT2
+ /3 width=7 by snv_lsstas, cpcs_cpes, monotonic_le_minus_l, ex3_2_intro/
+]
+qed-.
+
+lemma cpds_cpr_lpr: ∀h,g,G,L1,T1. ⦃G, L1⦄ ⊢ T1 ¡[h, g] →
+ ∀U1. ⦃G, L1⦄ ⊢ T1 •*➡*[h, g] U1 →
+ ∀T2. ⦃G, L1⦄ ⊢ T1 ➡ T2 → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 →
+ ∃∃U2. ⦃G, L2⦄ ⊢ T2 •*➡*[h, g] U2 & ⦃G, L2⦄ ⊢ U1 ➡* U2.
+#h #g #G #L1 #T1 #HT1 #U1 * #W1 #l1 #l2 #Hl21 #Hl1 #HTW1 #HWU1 #T2 #HT12 #L2 #HL12
+elim (lsstas_cpr_lpr … HTW1 … HT12 … HL12) // #W2 #HTW2 #HW12
+lapply (da_cpr_lpr … Hl1 … HT12 … HL12) // -T1
+lapply (lpr_cprs_conf … HL12 … HWU1) -L1 #HWU1
+lapply (cpcs_canc_sn … HW12 HWU1) -W1 #H
+elim (cpcs_inv_cprs … H) -H /3 width=7 by ex4_3_intro, ex2_intro/
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/notation/relations/statictype_6.ma".
+include "basic_2/static/da.ma".
+
+(* STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS ******************************)
+
+(* activate genv *)
+inductive ssta (h) (g): relation4 genv lenv term term ≝
+| ssta_sort: ∀G,L,k. ssta h g G L (⋆k) (⋆(next h k))
+| ssta_ldef: ∀G,L,K,V,U,W,i. ⇩[i] L ≡ K.ⓓV → ssta h g G K V W →
+ ⇧[0, i + 1] W ≡ U → ssta h g G L (#i) U
+| ssta_ldec: ∀G,L,K,W,U,l,i. ⇩[i] L ≡ K.ⓛW → ⦃G, K⦄ ⊢ W ▪[h, g] l →
+ ⇧[0, i + 1] W ≡ U → ssta h g G L (#i) U
+| ssta_bind: ∀a,I,G,L,V,T,U. ssta h g G (L.ⓑ{I}V) T U →
+ ssta h g G L (ⓑ{a,I}V.T) (ⓑ{a,I}V.U)
+| ssta_appl: ∀G,L,V,T,U. ssta h g G L T U → ssta h g G L (ⓐV.T) (ⓐV.U)
+| ssta_cast: ∀G,L,W,T,U. ssta h g G L T U → ssta h g G L (ⓝW.T) U
+.
+
+interpretation "stratified static type assignment (term)"
+ 'StaticType h g G L T U = (ssta h g G L T U).
+
+(* Basic inversion lemmas ************************************************)
+
+fact ssta_inv_sort1_aux: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U → ∀k0. T = ⋆k0 →
+ U = ⋆(next h k0).
+#h #g #G #L #T #U * -G -L -T -U
+[ #G #L #k #k0 #H destruct //
+| #G #L #K #V #U #W #i #_ #_ #_ #k0 #H destruct
+| #G #L #K #W #U #l #i #_ #_ #_ #k0 #H destruct
+| #a #I #G #L #V #T #U #_ #k0 #H destruct
+| #G #L #V #T #U #_ #k0 #H destruct
+| #G #L #W #T #U #_ #k0 #H destruct
+]
+qed-.
+
+lemma ssta_inv_sort1: ∀h,g,G,L,U,k. ⦃G, L⦄ ⊢ ⋆k •[h, g] U → U = ⋆(next h k).
+/2 width=6 by ssta_inv_sort1_aux/ qed-.
+
+fact ssta_inv_lref1_aux: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U → ∀j. T = #j →
+ (∃∃K,V,W. ⇩[j] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •[h, g] W &
+ ⇧[0, j + 1] W ≡ U
+ ) ∨
+ (∃∃K,W,l. ⇩[j] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W ▪[h, g] l &
+ ⇧[0, j + 1] W ≡ U
+ ).
+#h #g #G #L #T #U * -G -L -T -U
+[ #G #L #k #j #H destruct
+| #G #L #K #V #U #W #i #HLK #HVW #HWU #j #H destruct /3 width=6 by ex3_3_intro, or_introl/
+| #G #L #K #W #U #l #i #HLK #HWl #HWU #j #H destruct /3 width=6 by ex3_3_intro, or_intror/
+| #a #I #G #L #V #T #U #_ #j #H destruct
+| #G #L #V #T #U #_ #j #H destruct
+| #G #L #W #T #U #_ #j #H destruct
+]
+qed-.
+
+lemma ssta_inv_lref1: ∀h,g,G,L,U,i. ⦃G, L⦄ ⊢ #i •[h, g] U →
+ (∃∃K,V,W. ⇩[i] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •[h, g] W &
+ ⇧[0, i + 1] W ≡ U
+ ) ∨
+ (∃∃K,W,l. ⇩[i] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W ▪[h, g] l &
+ ⇧[0, i + 1] W ≡ U
+ ).
+/2 width=3 by ssta_inv_lref1_aux/ qed-.
+
+fact ssta_inv_gref1_aux: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U → ∀p0. T = §p0 → ⊥.
+#h #g #G #L #T #U * -G -L -T -U
+[ #G #L #k #p0 #H destruct
+| #G #L #K #V #U #W #i #_ #_ #_ #p0 #H destruct
+| #G #L #K #W #U #l #i #_ #_ #_ #p0 #H destruct
+| #a #I #G #L #V #T #U #_ #p0 #H destruct
+| #G #L #V #T #U #_ #p0 #H destruct
+| #G #L #W #T #U #_ #p0 #H destruct
+]
+qed-.
+
+lemma ssta_inv_gref1: ∀h,g,G,L,U,p. ⦃G, L⦄ ⊢ §p •[h, g] U → ⊥.
+/2 width=9 by ssta_inv_gref1_aux/ qed-.
+
+fact ssta_inv_bind1_aux: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U →
+ ∀b,J,X,Y. T = ⓑ{b,J}Y.X →
+ ∃∃Z. ⦃G, L.ⓑ{J}Y⦄ ⊢ X •[h, g] Z & U = ⓑ{b,J}Y.Z.
+#h #g #G #L #T #U * -G -L -T -U
+[ #G #L #k #b #J #X #Y #H destruct
+| #G #L #K #V #U #W #i #_ #_ #_ #b #J #X #Y #H destruct
+| #G #L #K #W #U #l #i #_ #_ #_ #b #J #X #Y #H destruct
+| #a #I #G #L #V #T #U #HTU #b #J #X #Y #H destruct /2 width=3 by ex2_intro/
+| #G #L #V #T #U #_ #b #J #X #Y #H destruct
+| #G #L #W #T #U #_ #b #J #X #Y #H destruct
+]
+qed-.
+
+lemma ssta_inv_bind1: ∀h,g,b,J,G,L,Y,X,U. ⦃G, L⦄ ⊢ ⓑ{b,J}Y.X •[h, g] U →
+ ∃∃Z. ⦃G, L.ⓑ{J}Y⦄ ⊢ X •[h, g] Z & U = ⓑ{b,J}Y.Z.
+/2 width=3 by ssta_inv_bind1_aux/ qed-.
+
+fact ssta_inv_appl1_aux: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U → ∀X,Y. T = ⓐY.X →
+ ∃∃Z. ⦃G, L⦄ ⊢ X •[h, g] Z & U = ⓐY.Z.
+#h #g #G #L #T #U * -G -L -T -U
+[ #G #L #k #X #Y #H destruct
+| #G #L #K #V #U #W #i #_ #_ #_ #X #Y #H destruct
+| #G #L #K #W #U #l #i #_ #_ #_ #X #Y #H destruct
+| #a #I #G #L #V #T #U #_ #X #Y #H destruct
+| #G #L #V #T #U #HTU #X #Y #H destruct /2 width=3 by ex2_intro/
+| #G #L #W #T #U #_ #X #Y #H destruct
+]
+qed-.
+
+lemma ssta_inv_appl1: ∀h,g,G,L,Y,X,U. ⦃G, L⦄ ⊢ ⓐY.X •[h, g] U →
+ ∃∃Z. ⦃G, L⦄ ⊢ X •[h, g] Z & U = ⓐY.Z.
+/2 width=3 by ssta_inv_appl1_aux/ qed-.
+
+fact ssta_inv_cast1_aux: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U → ∀X,Y. T = ⓝY.X →
+ ⦃G, L⦄ ⊢ X •[h, g] U.
+#h #g #G #L #T #U * -G -L -T -U
+[ #G #L #k #X #Y #H destruct
+| #G #L #K #V #U #W #i #_ #_ #_ #X #Y #H destruct
+| #G #L #K #W #U #l #i #_ #_ #_ #X #Y #H destruct
+| #a #I #G #L #V #T #U #_ #X #Y #H destruct
+| #G #L #V #T #U #_ #X #Y #H destruct
+| #G #L #W #T #U #HTU #X #Y #H destruct //
+]
+qed-.
+
+lemma ssta_inv_cast1: ∀h,g,G,L,X,Y,U. ⦃G, L⦄ ⊢ ⓝY.X •[h, g] U → ⦃G, L⦄ ⊢ X •[h, g] U.
+/2 width=4 by ssta_inv_cast1_aux/ qed-.
+
+(* Inversion lemmas on degree assignment for terms **************************)
+
+lemma ssta_inv_da: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U →
+ ∃l. ⦃G, L⦄ ⊢ T ▪[h, g] l.
+#h #g #G #L #T #U #H elim H -G -L -T -U
+[ #G #L #k elim (deg_total h g k) /3 width=2 by da_sort, ex_intro/
+| #G #L #K #V #U #W #i #HLK #_ #_ * /3 width=5 by da_ldef, ex_intro/
+| #G #L #K #W #U #l #i #HLK #HWl #_ /3 width=5 by da_ldec, ex_intro/
+| #a #I #G #L #V #T #U #_ * /3 width=2 by da_bind, ex_intro/
+| #G #L #V #T #U #_ * /3 width=2 by da_flat, ex_intro/
+| #G #L #W #T #U #_ * /3 width=2 by da_flat, ex_intro/
+]
+qed-.
+
+(* Properties on degree assignment for terms ********************************)
+
+lemma da_ssta: ∀h,g,G,L,T,l. ⦃G, L⦄ ⊢ T ▪[h, g] l →
+ ∃U. ⦃G, L⦄ ⊢ T •[h, g] U.
+#h #g #G #L #T #l #H elim H -G -L -T -l
+[ /2 width=2/
+| #G #L #K #V #i #l #HLK #_ * #W #HVW
+ elim (lift_total W 0 (i+1)) /3 width=7 by ssta_ldef, ex_intro/
+| #G #L #K #W #i #l #HLK #HW #_
+ elim (lift_total W 0 (i+1)) /3 width=7 by ssta_ldec, ex_intro/
+| #a #I #G #L #V #T #l #_ * /3 width=2 by ssta_bind, ex_intro/
+| * #G #L #V #T #l #_ * /3 width=2 by ssta_appl, ssta_cast, ex_intro/
+]
+qed-.
+
+(* Basic_1: removed theorems 7:
+ sty0_gen_sort sty0_gen_lref sty0_gen_bind sty0_gen_appl sty0_gen_cast
+ sty0_lift sty0_correct
+*)
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/da_lift.ma".
+include "basic_2/static/ssta.ma".
+
+(* STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS ******************************)
+
+(* Properties on relocation *************************************************)
+
+lemma ssta_lift: ∀h,g,G. l_liftable (ssta h g G).
+#h #g #G #L1 #T1 #U1 #H elim H -G -L1 -T1 -U1
+[ #G #L1 #k #L2 #s #d #e #HL21 #X1 #H1 #X2 #H2
+ >(lift_inv_sort1 … H1) -X1
+ >(lift_inv_sort1 … H2) -X2 //
+| #G #L1 #K1 #V1 #U1 #W1 #i #HLK1 #_ #HWU1 #IHVW1 #L2 #s #d #e #HL21 #X #H #U2 #HU12
+ elim (lift_inv_lref1 … H) * #Hid #H destruct
+ [ elim (lift_trans_ge … HWU1 … HU12) -U1 // #W2 #HW12 #HWU2
+ elim (ldrop_trans_le … HL21 … HLK1) -L1 /2 width=2 by lt_to_le/ #X #HLK2 #H
+ elim (ldrop_inv_skip2 … H) -H /2 width=1 by lt_plus_to_minus_r/ -Hid #K2 #V2 #HK21 #HV12 #H destruct
+ /3 width=9 by ssta_ldef/
+ | lapply (lift_trans_be … HWU1 … HU12 ? ?) -U1 /2 width=1 by le_S/ #HW1U2
+ lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 // -Hid
+ /3 width=9 by ssta_ldef, ldrop_inv_gen/
+ ]
+| #G #L1 #K1 #W1 #U1 #l #i #HLK1 #HW1l #HWU1 #L2 #s #d #e #HL21 #X #H #U2 #HU12
+ elim (lift_inv_lref1 … H) * #Hid #H destruct
+ [ elim (lift_trans_ge … HWU1 … HU12) -U1 // <minus_plus #W2 #HW12 #HWU2
+ elim (ldrop_trans_le … HL21 … HLK1) -L1 /2 width=2 by lt_to_le/ #X #HLK2 #H
+ elim (ldrop_inv_skip2 … H) -H /2 width=1 by lt_plus_to_minus_r/ -Hid #K2 #W #HK21 #HW1 #H destruct
+ lapply (lift_mono … HW1 … HW12) -HW1 #H destruct
+ /3 width=11 by da_lift, ssta_ldec/
+ | lapply (lift_trans_be … HWU1 … HU12 ? ?) -U1 /2 width=1 by le_S/ #HW1U2
+ lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 // -Hid
+ /3 width=8 by ssta_ldec, ldrop_inv_gen/
+ ]
+| #a #I #G #L1 #V1 #T1 #U1 #_ #IHTU1 #L2 #s #d #e #HL21 #X1 #H1 #X2 #H2
+ elim (lift_inv_bind1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H destruct
+ elim (lift_inv_bind1 … H2) -H2 #X #U2 #H1 #HU12 #H2 destruct
+ lapply (lift_mono … H1 … HV12) -H1 #H destruct /4 width=6 by ssta_bind, ldrop_skip/
+| #G #L1 #V1 #T1 #U1 #_ #IHTU1 #L2 #s #d #e #HL21 #X1 #H1 #X2 #H2
+ elim (lift_inv_flat1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H destruct
+ elim (lift_inv_flat1 … H2) -H2 #X #U2 #H1 #HU12 #H2 destruct
+ lapply (lift_mono … H1 … HV12) -H1 #H destruct /4 width=6 by ssta_appl/
+| #G #L1 #W1 #T1 #U1 #_ #IHTU1 #L2 #s #d #e #HL21 #X #H #U2 #HU12
+ elim (lift_inv_flat1 … H) -H #W2 #T2 #_ #HT12 #H destruct /3 width=6 by ssta_cast/
+]
+qed.
+
+(* Inversion lemmas on relocation *******************************************)
+
+lemma ssta_inv_lift1: ∀h,g,G. l_deliftable_sn (ssta h g G).
+#h #g #G #L2 #T2 #U2 #H elim H -G -L2 -T2 -U2
+[ #G #L2 #k #L1 #s #d #e #_ #X #H
+ >(lift_inv_sort2 … H) -X /2 width=3 by ssta_sort, lift_sort, ex2_intro/
+| #G #L2 #K2 #V2 #U2 #W2 #i #HLK2 #HVW2 #HWU2 #IHVW2 #L1 #s #d #e #HL21 #X #H
+ elim (lift_inv_lref2 … H) * #Hid #H destruct [ -HVW2 | -IHVW2 ]
+ [ elim (ldrop_conf_lt … HL21 … HLK2) -L2 // #K1 #V1 #HLK1 #HK21 #HV12
+ elim (IHVW2 … HK21 … HV12) -K2 -V2 #W1 #HW12 #HVW1
+ elim (lift_trans_le … HW12 … HWU2) -W2 // >minus_plus <plus_minus_m_m
+ /3 width=8 by ssta_ldef, ex2_intro/
+ | lapply (ldrop_conf_ge … HL21 … HLK2 ?) -L2 // #HL1K2
+ elim (le_inv_plus_l … Hid) -Hid #Hdie #ei
+ elim (lift_split … HWU2 d (i-e+1)) -HWU2 // [3: /2 width=1 by le_S/ ]
+ [ #W0 #HW20 <le_plus_minus_comm // >minus_minus_m_m
+ /3 width=8 by ssta_ldef, le_S, ex2_intro/
+ | <le_plus_minus_comm //
+ ]
+ ]
+| #G #L2 #K2 #W2 #U2 #l #i #HLK2 #HW2l #HWU2 #L1 #s #d #e #HL21 #X #H
+ elim (lift_inv_lref2 … H) * #Hid #H destruct
+ [ elim (ldrop_conf_lt … HL21 … HLK2) -L2 // #K1 #W1 #HLK1 #HK21 #HW12
+ lapply (da_inv_lift … HW2l … HK21 … HW12) -K2
+ elim (lift_trans_le … HW12 … HWU2) -W2 // >minus_plus <plus_minus_m_m
+ /3 width=8 by ssta_ldec, ex2_intro/
+ | lapply (ldrop_conf_ge … HL21 … HLK2 ?) -L2 // #HL1K2
+ elim (le_inv_plus_l … Hid) -Hid #Hdie #ei
+ elim (lift_split … HWU2 d (i-e+1)) -HWU2 // [3: /2 width=1 by le_S/ ]
+ [ #W0 #HW20 <le_plus_minus_comm // >minus_minus_m_m
+ /3 width=8 by ssta_ldec, le_S, ex2_intro/
+ | <le_plus_minus_comm //
+ ]
+ ]
+| #a #I #G #L2 #V2 #T2 #U2 #_ #IHTU2 #L1 #s #d #e #HL21 #X #H
+ elim (lift_inv_bind2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
+ elim (IHTU2 (L1.ⓑ{I}V1) … HT12) -IHTU2 -HT12
+ /3 width=5 by ssta_bind, ldrop_skip, lift_bind, ex2_intro/
+| #G #L2 #V2 #T2 #U2 #_ #IHTU2 #L1 #s #d #e #HL21 #X #H
+ elim (lift_inv_flat2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
+ elim (IHTU2 … HL21 … HT12) -L2 -HT12
+ /3 width=5 by ssta_appl, lift_flat, ex2_intro/
+| #G #L2 #W2 #T2 #U2 #_ #IHTU2 #L1 #s #d #e #HL21 #X #H
+ elim (lift_inv_flat2 … H) -H #W1 #T1 #_ #HT12 #H destruct
+ elim (IHTU2 … HL21 … HT12) -L2 -HT12
+ /3 width=3 by ssta_cast, ex2_intro/
+]
+qed-.
+
+(* Advanced properties ******************************************************)
+
+lemma ssta_da_conf: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U →
+ ∀l. ⦃G, L⦄ ⊢ T ▪[h, g] l → ⦃G, L⦄ ⊢ U ▪[h, g] l-1.
+#h #g #G #L #T #U #H elim H -G -L -T -U
+[ #G #L #k #l #H
+ lapply (da_inv_sort … H) -H /3 width=1 by da_sort, deg_next/
+| #G #L #K #V #U #W #i #HLK #_ #HWU #IHVW #l #H
+ elim (da_inv_lref … H) -H * #K0 #V0 [| #l0] #HLK0 #HV0
+ lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct
+ lapply (ldrop_fwd_drop2 … HLK) -HLK /3 width=8 by da_lift/
+| #G #L #K #W #U #l0 #i #HLK #_ #HWU #l #H -l0
+ elim (da_inv_lref … H) -H * #K0 #V0 [| #l1] #HLK0 #HV0 [| #H0 ]
+ lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct
+ lapply (ldrop_fwd_drop2 … HLK) -HLK /3 width=8 by da_lift/
+| #a #I #G #L #V #T #U #_ #IHTU #l #H
+ lapply (da_inv_bind … H) -H /3 width=1 by da_bind/
+| #G #L #V #T #U #_ #IHTU #l #H
+ lapply (da_inv_flat … H) -H /3 width=1 by da_flat/
+| #G #L #W #T #U #_ #IHTU #l #H
+ lapply (da_inv_flat … H) -H /2 width=1 by /
+]
+qed-.
+
+(* Advanced forvard lemmas **************************************************)
+
+lemma ssta_fwd_correct: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U →
+ ∃T0. ⦃G, L⦄ ⊢ U •[h, g] T0.
+#h #g #G #L #T #U #H elim H -G -L -T -U
+[ /2 width=2/
+| #G #L #K #V #U #W #i #HLK #_ #HWU * #T #HWT
+ lapply (ldrop_fwd_drop2 … HLK) -HLK #HLK
+ elim (lift_total T 0 (i+1)) /3 width=11 by ssta_lift, ex_intro/
+| #G #L #K #W #U #l #i #HLK #HWl #HWU
+ elim (da_ssta … HWl) -HWl #T #HWT
+ lapply (ldrop_fwd_drop2 … HLK) -HLK #HLK
+ elim (lift_total T 0 (i+1)) /3 width=11 by ssta_lift, ex_intro/
+| #a #I #G #L #V #T #U #_ * /3 width=2 by ssta_bind, ex_intro/
+| #G #L #V #T #U #_ * #T0 #HUT0 /3 width=2 by ssta_appl, ex_intro/
+| #G #L #W #T #U #_ * /2 width=2 by ex_intro/
+]
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/multiple/llpx_sn_ldrop.ma".
+include "basic_2/static/ssta.ma".
+
+(* STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS ******************************)
+
+(* Properties on lazy sn pointwise extensions *******************************)
+
+lemma ssta_llpx_sn_conf: ∀R. (∀L. reflexive … (R L)) → l_liftable R →
+ ∀h,g,G. s_r_confluent1 … (ssta h g G) (llpx_sn R 0).
+#R #H1R #H2R #h #g #G #Ls #T1 #T2 #H elim H -G -Ls -T1 -T2
+[ /3 width=4 by llpx_sn_fwd_length, llpx_sn_sort/
+| #G #Ls #Ks #V1s #W2s #V2s #i #HLKs #_ #HVW2s #IHV12s #Ld #H elim (llpx_sn_inv_lref_ge_sn … H … HLKs) // -H
+ #Kd #V1d #HLKd #HV1s #HV1sd
+ lapply (ldrop_fwd_drop2 … HLKs) -HLKs #HLKs
+ lapply (ldrop_fwd_drop2 … HLKd) -HLKd #HLKd
+ @(llpx_sn_lift_le … HLKs HLKd … HVW2s) -HLKs -HLKd -HVW2s /2 width=1 by/ (**) (* full auto too slow *)
+| #G #Ls #Ks #V1s #W1s #l #i #HLKs #Hl #HVW1s #Ld #H elim (llpx_sn_inv_lref_ge_sn … H … HLKs) // -H
+ #Kd #V1d #HLKd #HV1s #HV1sd
+ lapply (ldrop_fwd_drop2 … HLKs) -HLKs #HLKs
+ lapply (ldrop_fwd_drop2 … HLKd) -HLKd #HLKd
+ @(llpx_sn_lift_le … HLKs HLKd … HVW1s) -HLKs -HLKd -HVW1s /2 width=1 by/ (**) (* full auto too slow *)
+| #a #I #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_bind_O … H) -H
+ /4 width=5 by llpx_sn_bind_repl_SO, llpx_sn_bind/
+| #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H
+ /3 width=1 by llpx_sn_flat/
+| #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H
+ /3 width=1 by llpx_sn_flat/
+]
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/da_da.ma".
+include "basic_2/static/ssta_lift.ma".
+
+(* STRATIFIED STATIC TYPE ASSIGNMENT ON TERMS *******************************)
+
+(* Advanced inversion lemmas ************************************************)
+
+lemma ssta_inv_refl_pos: ∀h,g,G,L,T,l. ⦃G, L⦄ ⊢ T ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T •[h, g] T → ⊥.
+#h #g #G #L #T #l #H1T #HTT
+lapply (ssta_da_conf … HTT … H1T) -HTT <minus_plus_m_m #H2T
+lapply (da_mono … H2T … H1T) -h -G -L -T #H
+elim (plus_xySz_x_false 0 l 0) //
+qed-.
+
+(* Main properties **********************************************************)
+
+theorem ssta_mono: ∀h,g,G,L. singlevalued … (ssta h g G L).
+#h #g #G #L #T #U1 #H elim H -G -L -T -U1
+[ #G #L #k #X #H >(ssta_inv_sort1 … H) -X //
+| #G #L #K #V #U1 #W #i #HLK #_ #HWU1 #IHVW #U2 #H
+ elim (ssta_inv_lref1 … H) -H * #K0 #V0 #W0 #HLK0 #HVW0 #HW0U2
+ lapply (ldrop_mono … HLK0 … HLK) -HLK -HLK0 #H destruct
+ lapply (IHVW … HVW0) -IHVW -HVW0 #H destruct
+ >(lift_mono … HWU1 … HW0U2) -W0 -U1 //
+| #G #L #K #W #U1 #l #i #HLK #HWl #HWU1 #U2 #H
+ elim (ssta_inv_lref1 … H) -H * #K0 #W0 #l0 #HLK0 #HWl0 #HW0U2
+ lapply (ldrop_mono … HLK0 … HLK) -HLK -HLK0 #H destruct
+ lapply (da_mono … HWl0 … HWl) -HWl0 #H destruct
+ >(lift_mono … HWU1 … HW0U2) -W -U1 //
+| #a #I #G #L #V #T #U1 #_ #IHTU1 #X #H
+ elim (ssta_inv_bind1 … H) -H #U2 #HTU2 #H destruct /3 width=1/
+| #G #L #V #T #U1 #_ #IHTU1 #X #H
+ elim (ssta_inv_appl1 … H) -H #U2 #HTU2 #H destruct /3 width=1/
+| #G #L #W #T #U1 #_ #IHTU1 #U2 #H
+ lapply (ssta_inv_cast1 … H) -H /2 width=1/
+]
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
+
+notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 • break [ term 46 h , break term 46 g ] break term 46 T2 )"
+ non associative with precedence 45
+ for @{ 'StaticType $h $g $G $L $T1 $T2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
+
+notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 •* break [ term 46 h , break term 46 g , break term 46 l ] break term 46 T2 )"
+ non associative with precedence 45
+ for @{ 'StaticTypeStar $h $g $G $L $l $T1 $T2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
+
+notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 • • * break [ term 46 h , break term 46 g , break term 46 l ] break term 46 T2 )"
+ non associative with precedence 45
+ for @{ 'StaticTypeStarAlt $h $g $G $L $l $T1 $T2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/notation/relations/statictype_7.ma".
+include "basic_2/grammar/genv.ma".
+include "basic_2/relocation/ldrop.ma".
+include "basic_2/static/sd.ma".
+
+(* STRATIFIED STATIC TYPE ASSIGNMENT ON TERMS *******************************)
+
+(* activate genv *)
+inductive ssta (h:sh) (g:sd h): nat → relation4 genv lenv term term ≝
+| ssta_sort: ∀G,L,k,l. deg h g k l → ssta h g l G L (⋆k) (⋆(next h k))
+| ssta_ldef: ∀G,L,K,V,W,U,i,l. ⇩[0, i] L ≡ K. ⓓV → ssta h g l G K V W →
+ ⇧[0, i + 1] W ≡ U → ssta h g l G L (#i) U
+| ssta_ldec: ∀G,L,K,W,V,U,i,l. ⇩[0, i] L ≡ K. ⓛW → ssta h g l G K W V →
+ ⇧[0, i + 1] W ≡ U → ssta h g (l+1) G L (#i) U
+| ssta_bind: ∀a,I,G,L,V,T,U,l. ssta h g l G (L. ⓑ{I} V) T U →
+ ssta h g l G L (ⓑ{a,I}V.T) (ⓑ{a,I}V.U)
+| ssta_appl: ∀G,L,V,T,U,l. ssta h g l G L T U →
+ ssta h g l G L (ⓐV.T) (ⓐV.U)
+| ssta_cast: ∀G,L,W,T,U,l. ssta h g l G L T U → ssta h g l G L (ⓝW.T) U
+.
+
+interpretation "stratified static type assignment (term)"
+ 'StaticType h g G L T U l = (ssta h g l G L T U).
+
+definition ssta_step: ∀h. sd h → relation4 genv lenv term term ≝
+ λh,g,G,L,T,U. ∃l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l+1, U⦄.
+
+(* Basic inversion lemmas ************************************************)
+
+fact ssta_inv_sort1_aux: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l, U⦄ → ∀k0. T = ⋆k0 →
+ deg h g k0 l ∧ U = ⋆(next h k0).
+#h #g #G #L #T #U #l * -G -L -T -U -l
+[ #G #L #k #l #Hkl #k0 #H destruct /2 width=1/
+| #G #L #K #V #W #U #i #l #_ #_ #_ #k0 #H destruct
+| #G #L #K #W #V #U #i #l #_ #_ #_ #k0 #H destruct
+| #a #I #G #L #V #T #U #l #_ #k0 #H destruct
+| #G #L #V #T #U #l #_ #k0 #H destruct
+| #G #L #W #T #U #l #_ #k0 #H destruct
+qed-.
+
+lemma ssta_inv_sort1: ∀h,g,G,L,U,k,l. ⦃G, L⦄ ⊢ ⋆k •[h, g] ⦃l, U⦄ →
+ deg h g k l ∧ U = ⋆(next h k).
+/2 width=5 by ssta_inv_sort1_aux/ qed-.
+
+fact ssta_inv_lref1_aux: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l, U⦄ → ∀j. T = #j →
+ (∃∃K,V,W. ⇩[0, j] L ≡ K. ⓓV & ⦃G, K⦄ ⊢ V •[h, g] ⦃l, W⦄ &
+ ⇧[0, j + 1] W ≡ U
+ ) ∨
+ (∃∃K,W,V,l0. ⇩[0, j] L ≡ K. ⓛW & ⦃G, K⦄ ⊢ W •[h, g] ⦃l0, V⦄ &
+ ⇧[0, j + 1] W ≡ U & l = l0 + 1
+ ).
+#h #g #G #L #T #U #l * -G -L -T -U -l
+[ #G #L #k #l #_ #j #H destruct
+| #G #L #K #V #W #U #i #l #HLK #HVW #HWU #j #H destruct /3 width=6/
+| #G #L #K #W #V #U #i #l #HLK #HWV #HWU #j #H destruct /3 width=8/
+| #a #I #G #L #V #T #U #l #_ #j #H destruct
+| #G #L #V #T #U #l #_ #j #H destruct
+| #G #L #W #T #U #l #_ #j #H destruct
+]
+qed-.
+
+lemma ssta_inv_lref1: ∀h,g,G,L,U,i,l. ⦃G, L⦄ ⊢ #i •[h, g] ⦃l, U⦄ →
+ (∃∃K,V,W. ⇩[0, i] L ≡ K. ⓓV & ⦃G, K⦄ ⊢ V •[h, g] ⦃l, W⦄ &
+ ⇧[0, i + 1] W ≡ U
+ ) ∨
+ (∃∃K,W,V,l0. ⇩[0, i] L ≡ K. ⓛW & ⦃G, K⦄ ⊢ W •[h, g] ⦃l0, V⦄ &
+ ⇧[0, i + 1] W ≡ U & l = l0 + 1
+ ).
+/2 width=3 by ssta_inv_lref1_aux/ qed-.
+
+fact ssta_inv_gref1_aux: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l, U⦄ → ∀p0. T = §p0 → ⊥.
+#h #g #G #L #T #U #l * -G -L -T -U -l
+[ #G #L #k #l #_ #p0 #H destruct
+| #G #L #K #V #W #U #i #l #_ #_ #_ #p0 #H destruct
+| #G #L #K #W #V #U #i #l #_ #_ #_ #p0 #H destruct
+| #a #I #G #L #V #T #U #l #_ #p0 #H destruct
+| #G #L #V #T #U #l #_ #p0 #H destruct
+| #G #L #W #T #U #l #_ #p0 #H destruct
+qed-.
+
+lemma ssta_inv_gref1: ∀h,g,G,L,U,p,l. ⦃G, L⦄ ⊢ §p •[h, g] ⦃l, U⦄ → ⊥.
+/2 width=10 by ssta_inv_gref1_aux/ qed-.
+
+fact ssta_inv_bind1_aux: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l, U⦄ →
+ ∀a,I,X,Y. T = ⓑ{a,I}Y.X →
+ ∃∃Z. ⦃G, L.ⓑ{I}Y⦄ ⊢ X •[h, g] ⦃l, Z⦄ & U = ⓑ{a,I}Y.Z.
+#h #g #G #L #T #U #l * -G -L -T -U -l
+[ #G #L #k #l #_ #a #I #X #Y #H destruct
+| #G #L #K #V #W #U #i #l #_ #_ #_ #a #I #X #Y #H destruct
+| #G #L #K #W #V #U #i #l #_ #_ #_ #a #I #X #Y #H destruct
+| #b #J #G #L #V #T #U #l #HTU #a #I #X #Y #H destruct /2 width=3/
+| #G #L #V #T #U #l #_ #a #I #X #Y #H destruct
+| #G #L #W #T #U #l #_ #a #I #X #Y #H destruct
+]
+qed-.
+
+lemma ssta_inv_bind1: ∀h,g,a,I,G,L,Y,X,U,l. ⦃G, L⦄ ⊢ ⓑ{a,I}Y.X •[h, g] ⦃l, U⦄ →
+ ∃∃Z. ⦃G, L.ⓑ{I}Y⦄ ⊢ X •[h, g] ⦃l, Z⦄ & U = ⓑ{a,I}Y.Z.
+/2 width=3 by ssta_inv_bind1_aux/ qed-.
+
+fact ssta_inv_appl1_aux: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l, U⦄ → ∀X,Y. T = ⓐY.X →
+ ∃∃Z. ⦃G, L⦄ ⊢ X •[h, g] ⦃l, Z⦄ & U = ⓐY.Z.
+#h #g #G #L #T #U #l * -G -L -T -U -l
+[ #G #L #k #l #_ #X #Y #H destruct
+| #G #L #K #V #W #U #i #l #_ #_ #_ #X #Y #H destruct
+| #G #L #K #W #V #U #i #l #_ #_ #_ #X #Y #H destruct
+| #a #I #G #L #V #T #U #l #_ #X #Y #H destruct
+| #G #L #V #T #U #l #HTU #X #Y #H destruct /2 width=3/
+| #G #L #W #T #U #l #_ #X #Y #H destruct
+]
+qed-.
+
+lemma ssta_inv_appl1: ∀h,g,G,L,Y,X,U,l. ⦃G, L⦄ ⊢ ⓐY.X •[h, g] ⦃l, U⦄ →
+ ∃∃Z. ⦃G, L⦄ ⊢ X •[h, g] ⦃l, Z⦄ & U = ⓐY.Z.
+/2 width=3 by ssta_inv_appl1_aux/ qed-.
+
+fact ssta_inv_cast1_aux: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l, U⦄ →
+ ∀X,Y. T = ⓝY.X → ⦃G, L⦄ ⊢ X •[h, g] ⦃l, U⦄.
+#h #g #G #L #T #U #l * -G -L -T -U -l
+[ #G #L #k #l #_ #X #Y #H destruct
+| #G #L #K #V #W #U #l #i #_ #_ #_ #X #Y #H destruct
+| #G #L #K #W #V #U #l #i #_ #_ #_ #X #Y #H destruct
+| #a #I #G #L #V #T #U #l #_ #X #Y #H destruct
+| #G #L #V #T #U #l #_ #X #Y #H destruct
+| #G #L #W #T #U #l #HTU #X #Y #H destruct //
+]
+qed-.
+
+lemma ssta_inv_cast1: ∀h,g,G,L,X,Y,U,l. ⦃G, L⦄ ⊢ ⓝY.X •[h, g] ⦃l, U⦄ →
+ ⦃G, L⦄ ⊢ X •[h, g] ⦃l, U⦄.
+/2 width=4 by ssta_inv_cast1_aux/ qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/aaa_lift.ma".
+include "basic_2/static/ssta.ma".
+
+(* STRATIFIED STATIC TYPE ASSIGNMENT ON TERMS *******************************)
+
+(* Properties on atomic arity assignment for terms **************************)
+
+lemma ssta_aaa: ∀h,g,G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∀U,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l, U⦄ → ⦃G, L⦄ ⊢ U ⁝ A.
+#h #g #G #L #T #A #H elim H -G -L -T -A
+[ #G #L #k #U #l #H
+ elim (ssta_inv_sort1 … H) -H #_ #H destruct //
+| #I #G #L #K #V #B #i #HLK #HV #IHV #U #l #H
+ elim (ssta_inv_lref1 … H) -H * #K0 #V0 #W0 [2: #l0 ] #HLK0 #HVW0 #HU [ #H ]
+ lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H0 destruct
+ lapply (ldrop_fwd_ldrop2 … HLK) -HLK #HLK
+ @(aaa_lift … HLK … HU) -HU -L // -HV /2 width=2/
+| #a #G #L #V #T #B #A #HV #_ #_ #IHT #X #l #H
+ elim (ssta_inv_bind1 … H) -H #U #HTU #H destruct /3 width=2/
+| #a #G #L #V #T #B #A #HV #_ #_ #IHT #X #l #H
+ elim (ssta_inv_bind1 … H) -H #U #HTU #H destruct /3 width=2/
+| #G #L #V #T #B #A #HV #_ #_ #IHT #X #l #H
+ elim (ssta_inv_appl1 … H) -H #U #HTU #H destruct /3 width=3/
+| #G #L #V #T #A #_ #_ #IHV #IHT #X #l #H
+ lapply (ssta_inv_cast1 … H) -H /2 width=2/
+]
+qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/relocation/ldrop_ldrop.ma".
+include "basic_2/static/ssta.ma".
+
+(* STRATIFIED STATIC TYPE ASSIGNMENT ON TERMS *******************************)
+
+(* Properties on relocation *************************************************)
+
+lemma ssta_lift: ∀h,g,G,L1,T1,U1,l. ⦃G, L1⦄ ⊢ T1 •[h, g] ⦃l, U1⦄ →
+ ∀L2,d,e. ⇩[d, e] L2 ≡ L1 → ∀T2. ⇧[d, e] T1 ≡ T2 →
+ ∀U2. ⇧[d, e] U1 ≡ U2 → ⦃G, L2⦄ ⊢ T2 •[h, g] ⦃l, U2⦄.
+#h #g #G #L1 #T1 #U1 #l #H elim H -G -L1 -T1 -U1 -l
+[ #G #L1 #k #l #Hkl #L2 #d #e #HL21 #X1 #H1 #X2 #H2
+ >(lift_inv_sort1 … H1) -X1
+ >(lift_inv_sort1 … H2) -X2 /2 width=1/
+| #G #L1 #K1 #V1 #W1 #W #i #l #HLK1 #_ #HW1 #IHVW1 #L2 #d #e #HL21 #X #H #U2 #HWU2
+ elim (lift_inv_lref1 … H) * #Hid #H destruct
+ [ elim (lift_trans_ge … HW1 … HWU2 ?) -W // #W2 #HW12 #HWU2
+ elim (ldrop_trans_le … HL21 … HLK1 ?) -L1 /2 width=2/ #X #HLK2 #H
+ elim (ldrop_inv_skip2 … H ?) -H /2 width=1/ -Hid #K2 #V2 #HK21 #HV12 #H destruct
+ /3 width=8/
+ | lapply (lift_trans_be … HW1 … HWU2 ? ?) -W // /2 width=1/ #HW1U2
+ lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 // -Hid /3 width=8/
+ ]
+| #G #L1 #K1 #W1 #V1 #W #i #l #HLK1 #_ #HW1 #IHWV1 #L2 #d #e #HL21 #X #H #U2 #HWU2
+ elim (lift_inv_lref1 … H) * #Hid #H destruct
+ [ elim (lift_trans_ge … HW1 … HWU2 ?) -W // <minus_plus #W #HW1 #HWU2
+ elim (ldrop_trans_le … HL21 … HLK1 ?) -L1 /2 width=2/ #X #HLK2 #H
+ elim (ldrop_inv_skip2 … H ?) -H /2 width=1/ -Hid #K2 #W2 #HK21 #HW12 #H destruct
+ lapply (lift_mono … HW1 … HW12) -HW1 #H destruct
+ elim (lift_total V1 (d-i-1) e) /3 width=8/
+ | lapply (lift_trans_be … HW1 … HWU2 ? ?) -W // /2 width=1/ #HW1U2
+ lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 // -Hid /3 width=8/
+ ]
+| #a #I #G #L1 #V1 #T1 #U1 #l #_ #IHTU1 #L2 #d #e #HL21 #X1 #H1 #X2 #H2
+ elim (lift_inv_bind1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H destruct
+ elim (lift_inv_bind1 … H2) -H2 #X #U2 #H1 #HU12 #H2 destruct
+ lapply (lift_mono … H1 … HV12) -H1 #H destruct /4 width=5/
+| #G #L1 #V1 #T1 #U1 #l #_ #IHTU1 #L2 #d #e #HL21 #X1 #H1 #X2 #H2
+ elim (lift_inv_flat1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H destruct
+ elim (lift_inv_flat1 … H2) -H2 #X #U2 #H1 #HU12 #H2 destruct
+ lapply (lift_mono … H1 … HV12) -H1 #H destruct /4 width=5/
+| #G #L1 #W1 #T1 #U1 #l #_ #IHTU1 #L2 #d #e #HL21 #X #H #U2 #HU12
+ elim (lift_inv_flat1 … H) -H #W2 #T2 #HW12 #HT12 #H destruct /3 width=5/
+]
+qed.
+
+lemma ssta_inv_lift1: ∀h,g,G,L2,T2,U2,l. ⦃G, L2⦄ ⊢ T2 •[h, g] ⦃l, U2⦄ →
+ ∀L1,d,e. ⇩[d, e] L2 ≡ L1 → ∀T1. ⇧[d, e] T1 ≡ T2 →
+ ∃∃U1. ⦃G, L1⦄ ⊢ T1 •[h, g] ⦃l, U1⦄ & ⇧[d, e] U1 ≡ U2.
+#h #g #G #L2 #T2 #U2 #l #H elim H -G -L2 -T2 -U2 -l
+[ #G #L2 #k #l #Hkl #L1 #d #e #_ #X #H
+ >(lift_inv_sort2 … H) -X /3 width=3/
+| #G #L2 #K2 #V2 #W2 #W #i #l #HLK2 #HVW2 #HW2 #IHVW2 #L1 #d #e #HL21 #X #H
+ elim (lift_inv_lref2 … H) * #Hid #H destruct [ -HVW2 | -IHVW2 ]
+ [ elim (ldrop_conf_lt … HL21 … HLK2 ?) -L2 // #K1 #V1 #HLK1 #HK21 #HV12
+ elim (IHVW2 … HK21 … HV12) -K2 -V2 #W1 #HVW1 #HW12
+ elim (lift_trans_le … HW12 … HW2 ?) -W2 // >minus_plus <plus_minus_m_m // -Hid /3 width=6/
+ | lapply (ldrop_conf_ge … HL21 … HLK2 ?) -L2 // #HL1K2
+ elim (le_inv_plus_l … Hid) -Hid #Hdie #ei
+ elim (lift_split … HW2 d (i-e+1) ? ? ?) -HW2 // [3: /2 width=1/ ]
+ [ #W0 #HW20 <le_plus_minus_comm // >minus_minus_m_m /2 width=1/ /3 width=6/
+ | <le_plus_minus_comm //
+ ]
+ ]
+| #G #L2 #K2 #W2 #V2 #W #i #l #HLK2 #HWV2 #HW2 #IHWV2 #L1 #d #e #HL21 #X #H
+ elim (lift_inv_lref2 … H) * #Hid #H destruct [ -HWV2 | -IHWV2 ]
+ [ elim (ldrop_conf_lt … HL21 … HLK2 ?) -L2 // #K1 #W1 #HLK1 #HK21 #HW12
+ elim (IHWV2 … HK21 … HW12) -K2 #V1 #HWV1 #_
+ elim (lift_trans_le … HW12 … HW2 ?) -W2 // >minus_plus <plus_minus_m_m // -Hid /3 width=6/
+ | lapply (ldrop_conf_ge … HL21 … HLK2 ?) -L2 // #HL1K2
+ elim (le_inv_plus_l … Hid) -Hid #Hdie #ei
+ elim (lift_split … HW2 d (i-e+1) ? ? ?) -HW2 // [3: /2 width=1/ ]
+ [ #W0 #HW20 <le_plus_minus_comm // >minus_minus_m_m /2 width=1/ /3 width=6/
+ | <le_plus_minus_comm //
+ ]
+ ]
+| #a #I #G #L2 #V2 #T2 #U2 #l #_ #IHTU2 #L1 #d #e #HL21 #X #H
+ elim (lift_inv_bind2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
+ elim (IHTU2 (L1.ⓑ{I}V1) … HT12) -IHTU2 -HT12 /2 width=1/ -HL21 /3 width=5/
+| #G #L2 #V2 #T2 #U2 #l #_ #IHTU2 #L1 #d #e #HL21 #X #H
+ elim (lift_inv_flat2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
+ elim (IHTU2 … HL21 … HT12) -L2 -HT12 /3 width=5/
+| #G #L2 #W2 #T2 #U2 #l #_ #IHTU2 #L1 #d #e #HL21 #X #H
+ elim (lift_inv_flat2 … H) -H #W1 #T1 #HW12 #HT12 #H destruct
+ elim (IHTU2 … HL21 … HT12) -L2 -HT12 /3 width=3/
+]
+qed-.
+
+(* Advanced forvard lemmas **************************************************)
+
+lemma ssta_fwd_correct: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l, U⦄ →
+ ∃T0. ⦃G, L⦄ ⊢ U •[h, g] ⦃l-1, T0⦄.
+#h #g #G #L #T #U #l #H elim H -G -L -T -U -l
+[ /4 width=2/
+| #G #L #K #V #W #W0 #i #l #HLK #_ #HW0 * #V0 #HWV0
+ lapply (ldrop_fwd_ldrop2 … HLK) -HLK #HLK
+ elim (lift_total V0 0 (i+1)) /3 width=10/
+| #G #L #K #W #V #V0 #i #l #HLK #HWV #HWV0 #_
+ lapply (ldrop_fwd_ldrop2 … HLK) -HLK #HLK
+ elim (lift_total V 0 (i+1)) /3 width=10/
+| #a #I #G #L #V #T #U #l #_ * /3 width=2/
+| #G #L #V #T #U #l #_ * #T0 #HUT0 /3 width=2/
+| #G #L #W #T #U #l #_ * /2 width=2/
+]
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/ssta_lift.ma".
+
+(* STRATIFIED STATIC TYPE ASSIGNMENT ON TERMS *******************************)
+
+(* Main properties **********************************************************)
+
+theorem ssta_mono: ∀h,g,G,L,T,U1,l1. ⦃G, L⦄ ⊢ T •[h, g] ⦃l1, U1⦄ →
+ ∀U2,l2. ⦃G, L⦄ ⊢ T •[h, g] ⦃l2, U2⦄ → l1 = l2 ∧ U1 = U2.
+#h #g #G #L #T #U1 #l1 #H elim H -G -L -T -U1 -l1
+[ #G #L #k #l #Hkl #X #l2 #H
+ elim (ssta_inv_sort1 … H) -H #Hkl2 #H destruct
+ >(deg_mono … Hkl2 … Hkl) -g -L -l2 /2 width=1/
+| #G #L #K #V #W #U1 #i #l1 #HLK #_ #HWU1 #IHVW #U2 #l2 #H
+ elim (ssta_inv_lref1 … H) -H * #K0 #V0 #W0 [2: #l0] #HLK0 #HVW0 #HW0U2
+ lapply (ldrop_mono … HLK0 … HLK) -HLK -HLK0 #H destruct
+ lapply (IHVW … HVW0) -IHVW -HVW0 * #H1 #H2 destruct
+ >(lift_mono … HWU1 … HW0U2) -W0 -U1 /2 width=1/
+| #G #L #K #W #V #U1 #i #l1 #HLK #_ #HWU1 #IHWV #U2 #l2 #H
+ elim (ssta_inv_lref1 … H) -H * #K0 #W0 #V0 [2: #l0 ] #HLK0 #HWV0 #HV0U2
+ lapply (ldrop_mono … HLK0 … HLK) -HLK -HLK0 #H destruct
+ lapply (IHWV … HWV0) -IHWV -HWV0 * #H1 #H2 destruct
+ >(lift_mono … HWU1 … HV0U2) -W -U1 /2 width=1/
+| #a #I #G #L #V #T #U1 #l1 #_ #IHTU1 #X #l2 #H
+ elim (ssta_inv_bind1 … H) -H #U2 #HTU2 #H destruct
+ elim (IHTU1 … HTU2) -T /3 width=1/
+| #G #L #V #T #U1 #l1 #_ #IHTU1 #X #l2 #H
+ elim (ssta_inv_appl1 … H) -H #U2 #HTU2 #H destruct
+ elim (IHTU1 … HTU2) -T /3 width=1/
+| #G #L #W1 #T #U1 #l1 #_ #IHTU1 #U2 #l2 #H
+ lapply (ssta_inv_cast1 … H) -H #HTU2
+ elim (IHTU1 … HTU2) -T /2 width=1/
+]
+qed-.
+
+(* Advanced inversion lemmas ************************************************)
+
+lemma ssta_inv_refl_pos: ∀h,g,G,L,T,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l+1, T⦄ → ⊥.
+#h #g #G #L #T #l #HTT
+elim (ssta_fwd_correct … HTT) <minus_plus_m_m #U #HTU
+elim (ssta_mono … HTU … HTT) -h -L #H #_ -T -U
+elim (plus_xySz_x_false 0 l 0 ?) //
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
+
+notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 • break [ term 46 h, break term 46 g ] break ⦃ term 46 l , break term 46 T2 ⦄ )"
+ non associative with precedence 45
+ for @{ 'StaticType $h $g $G $L $T1 $T2 $l }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/notation/relations/statictypestar_6.ma".
-include "basic_2/static/ssta.ma".
-
-(* ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *********************)
-
-definition sstas: ∀h. sd h → relation4 genv lenv term term ≝
- λh,g,G,L. star … (ssta_step h g G L).
-
-interpretation "iterated stratified static type assignment (term)"
- 'StaticTypeStar h g G L T U = (sstas h g G L T U).
-
-(* Basic eliminators ********************************************************)
-
-lemma sstas_ind: ∀h,g,G,L,T. ∀R:predicate term.
- R T → (
- ∀U1,U2,l. ⦃G, L⦄ ⊢ T •* [h, g] U1 → ⦃G, L⦄ ⊢ U1 •[h, g] ⦃l+1, U2⦄ →
- R U1 → R U2
- ) →
- ∀U. ⦃G, L⦄ ⊢ T •*[h, g] U → R U.
-#h #g #G #L #T #R #IH1 #IH2 #U #H elim H -U //
-#U1 #U2 #H * /2 width=5/
-qed-.
-
-lemma sstas_ind_dx: ∀h,g,G,L,U2. ∀R:predicate term.
- R U2 → (
- ∀T,U1,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l+1, U1⦄ → ⦃G, L⦄ ⊢ U1 •* [h, g] U2 →
- R U1 → R T
- ) →
- ∀T. ⦃G, L⦄ ⊢ T •*[h, g] U2 → R T.
-#h #g #G #L #U2 #R #IH1 #IH2 #T #H @(star_ind_l … T H) -T //
-#T #T0 * /2 width=5/
-qed-.
-
-(* Basic properties *********************************************************)
-
-lemma sstas_refl: ∀h,g,G,L. reflexive … (sstas h g G L).
-// qed.
-
-lemma ssta_sstas: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l+1, U⦄ → ⦃G, L⦄ ⊢ T •*[h, g] U.
-/3 width=2 by R_to_star, ex_intro/ qed. (**) (* auto fails without trace *)
-
-lemma sstas_strap1: ∀h,g,G,L,T1,T2,U2,l. ⦃G, L⦄ ⊢ T1 •*[h, g] T2 → ⦃G, L⦄ ⊢ T2 •[h, g] ⦃l+1, U2⦄ →
- ⦃G, L⦄ ⊢ T1 •*[h, g] U2.
-/3 width=4 by sstep, ex_intro/ (**) (* auto fails without trace *)
-qed.
-
-lemma sstas_strap2: ∀h,g,G,L,T1,U1,U2,l. ⦃G, L⦄ ⊢ T1 •[h, g] ⦃l+1, U1⦄ → ⦃G, L⦄ ⊢ U1 •*[h, g] U2 →
- ⦃G, L⦄ ⊢ T1 •*[h, g] U2.
-/3 width=3 by star_compl, ex_intro/ (**) (* auto fails without trace *)
-qed.
-
-(* Basic inversion lemmas ***************************************************)
-
-lemma sstas_inv_bind1: ∀h,g,a,I,G,L,Y,X,U. ⦃G, L⦄ ⊢ ⓑ{a,I}Y.X •*[h, g] U →
- ∃∃Z. ⦃G, L.ⓑ{I}Y⦄ ⊢ X •*[h, g] Z & U = ⓑ{a,I}Y.Z.
-#h #g #a #I #G #L #Y #X #U #H @(sstas_ind … H) -U /2 width=3/
-#T #U #l #_ #HTU * #Z #HXZ #H destruct
-elim (ssta_inv_bind1 … HTU) -HTU #Z0 #HZ0 #H destruct /3 width=4/
-qed-.
-
-lemma sstas_inv_appl1: ∀h,g,G,L,Y,X,U. ⦃G, L⦄ ⊢ ⓐY.X •*[h, g] U →
- ∃∃Z. ⦃G, L⦄ ⊢ X •*[h, g] Z & U = ⓐY.Z.
-#h #g #G #L #Y #X #U #H @(sstas_ind … H) -U /2 width=3/
-#T #U #l #_ #HTU * #Z #HXZ #H destruct
-elim (ssta_inv_appl1 … HTU) -HTU #Z0 #HZ0 #H destruct /3 width=4/
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/static/ssta_aaa.ma".
-include "basic_2/unfold/sstas.ma".
-
-(* ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *********************)
-
-(* Properties on atomic arity assignment for terms **************************)
-
-lemma sstas_aaa: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •*[h, g] U →
- ∀A. ⦃G, L⦄ ⊢ T ⁝ A → ⦃G, L⦄ ⊢ U ⁝ A.
-#h #g #G #L #T #U #H @(sstas_ind_dx … H) -T // /3 width=6/
-qed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/static/ssta_lift.ma".
-include "basic_2/unfold/sstas.ma".
-
-(* ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *********************)
-
-(* Advanced forward lemmas **************************************************)
-
-lemma sstas_fwd_correct: ∀h,g,G,L,T1,U1,l1. ⦃G, L⦄ ⊢ T1 •[h, g] ⦃l1, U1⦄ →
- ∀T2. ⦃G, L⦄ ⊢ T1 •*[h, g] T2 →
- ∃∃U2,l2. ⦃G, L⦄ ⊢ T2 •[h, g] ⦃l2, U2⦄.
-#h #g #G #L #T1 #U1 #l1 #HTU1 #T2 #H @(sstas_ind … H) -T2 [ /2 width=3/ ] -HTU1
-#T #T2 #l #_ #HT2 * #U #l0 #_ -l0
-elim (ssta_fwd_correct … HT2) -T /2 width=3/
-qed-.
-
-(* Properties on relocation *************************************************)
-
-lemma sstas_lift: ∀h,g,G,L1,T1,U1. ⦃G, L1⦄ ⊢ T1 •*[h, g] U1 →
- ∀L2,d,e. ⇩[d, e] L2 ≡ L1 → ∀T2. ⇧[d, e] T1 ≡ T2 →
- ∀U2. ⇧[d, e] U1 ≡ U2 → ⦃G, L2⦄ ⊢ T2 •*[h, g] U2.
-#h #g #G #L1 #T1 #U1 #H @(sstas_ind_dx … H) -T1
-[ #L2 #d #e #HL21 #X #HX #U2 #HU12
- >(lift_mono … HX … HU12) -X //
-| #T0 #U0 #l0 #HTU0 #_ #IHU01 #L2 #d #e #HL21 #T2 #HT02 #U2 #HU12
- elim (lift_total U0 d e) /3 width=10/
-]
-qed.
-
-(* Inversion lemmas on relocation *******************************************)
-
-lemma sstas_inv_lift1: ∀h,g,G,L2,T2,U2. ⦃G, L2⦄ ⊢ T2 •*[h, g] U2 →
- ∀L1,d,e. ⇩[d, e] L2 ≡ L1 → ∀T1. ⇧[d, e] T1 ≡ T2 →
- ∃∃U1. ⦃G, L1⦄ ⊢ T1 •*[h, g] U1 & ⇧[d, e] U1 ≡ U2.
-#h #g #G #L2 #T2 #U2 #H @(sstas_ind_dx … H) -T2 /2 width=3/
-#T0 #U0 #l0 #HTU0 #_ #IHU01 #L1 #d #e #HL21 #U1 #HU12
-elim (ssta_inv_lift1 … HTU0 … HL21 … HU12) -HTU0 -HU12 #U #HU1 #HU0
-elim (IHU01 … HL21 … HU0) -IHU01 -HL21 -U0 /3 width=4/
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/static/ssta_ssta.ma".
-include "basic_2/unfold/sstas.ma".
-
-(* ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *********************)
-
-(* Advanced inversion lemmas ************************************************)
-
-lemma sstas_inv_O: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •*[h, g] U →
- ∀T0. ⦃G, L⦄ ⊢ T •[h, g] ⦃0, T0⦄ → U = T.
-#h #g #G #L #T #U #H @(sstas_ind_dx … H) -T //
-#T0 #U0 #l0 #HTU0 #_ #_ #T1 #HT01
-elim (ssta_mono … HTU0 … HT01) <plus_n_Sm #H destruct
-qed-.
-
-(* Advanced properties ******************************************************)
-
-lemma sstas_strip: ∀h,g,G,L,T,U1. ⦃G, L⦄ ⊢ T •*[h, g] U1 →
- ∀U2,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l, U2⦄ →
- T = U1 ∨ ⦃G, L⦄ ⊢ U2 •*[h, g] U1.
-#h #g #G #L #T #U1 #H1 @(sstas_ind_dx … H1) -T /2 width=1/
-#T #U #l0 #HTU #HU1 #_ #U2 #l #H2
-elim (ssta_mono … H2 … HTU) -H2 -HTU #H1 #H2 destruct /2 width=1/
-qed-.
-
-(* Main properties **********************************************************)
-
-theorem sstas_trans: ∀h,g,G,L,T1,U. ⦃G, L⦄ ⊢ T1 •*[h, g] U →
- ∀T2. ⦃G, L⦄ ⊢ U •*[h, g] T2 → ⦃G, L⦄ ⊢ T1 •*[h, g] T2.
-/2 width=3/ qed-.
-
-theorem sstas_conf: ∀h,g,G,L,T,U1. ⦃G, L⦄ ⊢ T •*[h, g] U1 →
- ∀U2. ⦃G, L⦄ ⊢ T •*[h, g] U2 →
- ⦃G, L⦄ ⊢ U1 •*[h, g] U2 ∨ ⦃G, L⦄ ⊢ U2 •*[h, g] U1.
-#h #g #G #L #T #U1 #H1 @(sstas_ind_dx … H1) -T /2 width=1/
-#T #U #l #HTU #HU1 #IHU1 #U2 #H2
-elim (sstas_strip … H2 … HTU) #H destruct
-[ -H2 -IHU1 /3 width=4/
-| -T /2 width=1/
-]
-qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/notation/relations/statictypestar_6.ma".
+include "basic_2/static/ssta.ma".
+
+(* ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *********************)
+
+definition sstas: ∀h. sd h → relation4 genv lenv term term ≝
+ λh,g,G,L. star … (ssta_step h g G L).
+
+interpretation "iterated stratified static type assignment (term)"
+ 'StaticTypeStar h g G L T U = (sstas h g G L T U).
+
+(* Basic eliminators ********************************************************)
+
+lemma sstas_ind: ∀h,g,G,L,T. ∀R:predicate term.
+ R T → (
+ ∀U1,U2,l. ⦃G, L⦄ ⊢ T •* [h, g] U1 → ⦃G, L⦄ ⊢ U1 •[h, g] ⦃l+1, U2⦄ →
+ R U1 → R U2
+ ) →
+ ∀U. ⦃G, L⦄ ⊢ T •*[h, g] U → R U.
+#h #g #G #L #T #R #IH1 #IH2 #U #H elim H -U //
+#U1 #U2 #H * /2 width=5/
+qed-.
+
+lemma sstas_ind_dx: ∀h,g,G,L,U2. ∀R:predicate term.
+ R U2 → (
+ ∀T,U1,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l+1, U1⦄ → ⦃G, L⦄ ⊢ U1 •* [h, g] U2 →
+ R U1 → R T
+ ) →
+ ∀T. ⦃G, L⦄ ⊢ T •*[h, g] U2 → R T.
+#h #g #G #L #U2 #R #IH1 #IH2 #T #H @(star_ind_l … T H) -T //
+#T #T0 * /2 width=5/
+qed-.
+
+(* Basic properties *********************************************************)
+
+lemma sstas_refl: ∀h,g,G,L. reflexive … (sstas h g G L).
+// qed.
+
+lemma ssta_sstas: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l+1, U⦄ → ⦃G, L⦄ ⊢ T •*[h, g] U.
+/3 width=2 by R_to_star, ex_intro/ qed. (**) (* auto fails without trace *)
+
+lemma sstas_strap1: ∀h,g,G,L,T1,T2,U2,l. ⦃G, L⦄ ⊢ T1 •*[h, g] T2 → ⦃G, L⦄ ⊢ T2 •[h, g] ⦃l+1, U2⦄ →
+ ⦃G, L⦄ ⊢ T1 •*[h, g] U2.
+/3 width=4 by sstep, ex_intro/ (**) (* auto fails without trace *)
+qed.
+
+lemma sstas_strap2: ∀h,g,G,L,T1,U1,U2,l. ⦃G, L⦄ ⊢ T1 •[h, g] ⦃l+1, U1⦄ → ⦃G, L⦄ ⊢ U1 •*[h, g] U2 →
+ ⦃G, L⦄ ⊢ T1 •*[h, g] U2.
+/3 width=3 by star_compl, ex_intro/ (**) (* auto fails without trace *)
+qed.
+
+(* Basic inversion lemmas ***************************************************)
+
+lemma sstas_inv_bind1: ∀h,g,a,I,G,L,Y,X,U. ⦃G, L⦄ ⊢ ⓑ{a,I}Y.X •*[h, g] U →
+ ∃∃Z. ⦃G, L.ⓑ{I}Y⦄ ⊢ X •*[h, g] Z & U = ⓑ{a,I}Y.Z.
+#h #g #a #I #G #L #Y #X #U #H @(sstas_ind … H) -U /2 width=3/
+#T #U #l #_ #HTU * #Z #HXZ #H destruct
+elim (ssta_inv_bind1 … HTU) -HTU #Z0 #HZ0 #H destruct /3 width=4/
+qed-.
+
+lemma sstas_inv_appl1: ∀h,g,G,L,Y,X,U. ⦃G, L⦄ ⊢ ⓐY.X •*[h, g] U →
+ ∃∃Z. ⦃G, L⦄ ⊢ X •*[h, g] Z & U = ⓐY.Z.
+#h #g #G #L #Y #X #U #H @(sstas_ind … H) -U /2 width=3/
+#T #U #l #_ #HTU * #Z #HXZ #H destruct
+elim (ssta_inv_appl1 … HTU) -HTU #Z0 #HZ0 #H destruct /3 width=4/
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/ssta_aaa.ma".
+include "basic_2/unfold/sstas.ma".
+
+(* ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *********************)
+
+(* Properties on atomic arity assignment for terms **************************)
+
+lemma sstas_aaa: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •*[h, g] U →
+ ∀A. ⦃G, L⦄ ⊢ T ⁝ A → ⦃G, L⦄ ⊢ U ⁝ A.
+#h #g #G #L #T #U #H @(sstas_ind_dx … H) -T // /3 width=6/
+qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/ssta_lift.ma".
+include "basic_2/unfold/sstas.ma".
+
+(* ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *********************)
+
+(* Advanced forward lemmas **************************************************)
+
+lemma sstas_fwd_correct: ∀h,g,G,L,T1,U1,l1. ⦃G, L⦄ ⊢ T1 •[h, g] ⦃l1, U1⦄ →
+ ∀T2. ⦃G, L⦄ ⊢ T1 •*[h, g] T2 →
+ ∃∃U2,l2. ⦃G, L⦄ ⊢ T2 •[h, g] ⦃l2, U2⦄.
+#h #g #G #L #T1 #U1 #l1 #HTU1 #T2 #H @(sstas_ind … H) -T2 [ /2 width=3/ ] -HTU1
+#T #T2 #l #_ #HT2 * #U #l0 #_ -l0
+elim (ssta_fwd_correct … HT2) -T /2 width=3/
+qed-.
+
+(* Properties on relocation *************************************************)
+
+lemma sstas_lift: ∀h,g,G,L1,T1,U1. ⦃G, L1⦄ ⊢ T1 •*[h, g] U1 →
+ ∀L2,d,e. ⇩[d, e] L2 ≡ L1 → ∀T2. ⇧[d, e] T1 ≡ T2 →
+ ∀U2. ⇧[d, e] U1 ≡ U2 → ⦃G, L2⦄ ⊢ T2 •*[h, g] U2.
+#h #g #G #L1 #T1 #U1 #H @(sstas_ind_dx … H) -T1
+[ #L2 #d #e #HL21 #X #HX #U2 #HU12
+ >(lift_mono … HX … HU12) -X //
+| #T0 #U0 #l0 #HTU0 #_ #IHU01 #L2 #d #e #HL21 #T2 #HT02 #U2 #HU12
+ elim (lift_total U0 d e) /3 width=10/
+]
+qed.
+
+(* Inversion lemmas on relocation *******************************************)
+
+lemma sstas_inv_lift1: ∀h,g,G,L2,T2,U2. ⦃G, L2⦄ ⊢ T2 •*[h, g] U2 →
+ ∀L1,d,e. ⇩[d, e] L2 ≡ L1 → ∀T1. ⇧[d, e] T1 ≡ T2 →
+ ∃∃U1. ⦃G, L1⦄ ⊢ T1 •*[h, g] U1 & ⇧[d, e] U1 ≡ U2.
+#h #g #G #L2 #T2 #U2 #H @(sstas_ind_dx … H) -T2 /2 width=3/
+#T0 #U0 #l0 #HTU0 #_ #IHU01 #L1 #d #e #HL21 #U1 #HU12
+elim (ssta_inv_lift1 … HTU0 … HL21 … HU12) -HTU0 -HU12 #U #HU1 #HU0
+elim (IHU01 … HL21 … HU0) -IHU01 -HL21 -U0 /3 width=4/
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/ssta_ssta.ma".
+include "basic_2/unfold/sstas.ma".
+
+(* ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *********************)
+
+(* Advanced inversion lemmas ************************************************)
+
+lemma sstas_inv_O: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •*[h, g] U →
+ ∀T0. ⦃G, L⦄ ⊢ T •[h, g] ⦃0, T0⦄ → U = T.
+#h #g #G #L #T #U #H @(sstas_ind_dx … H) -T //
+#T0 #U0 #l0 #HTU0 #_ #_ #T1 #HT01
+elim (ssta_mono … HTU0 … HT01) <plus_n_Sm #H destruct
+qed-.
+
+(* Advanced properties ******************************************************)
+
+lemma sstas_strip: ∀h,g,G,L,T,U1. ⦃G, L⦄ ⊢ T •*[h, g] U1 →
+ ∀U2,l. ⦃G, L⦄ ⊢ T •[h, g] ⦃l, U2⦄ →
+ T = U1 ∨ ⦃G, L⦄ ⊢ U2 •*[h, g] U1.
+#h #g #G #L #T #U1 #H1 @(sstas_ind_dx … H1) -T /2 width=1/
+#T #U #l0 #HTU #HU1 #_ #U2 #l #H2
+elim (ssta_mono … H2 … HTU) -H2 -HTU #H1 #H2 destruct /2 width=1/
+qed-.
+
+(* Main properties **********************************************************)
+
+theorem sstas_trans: ∀h,g,G,L,T1,U. ⦃G, L⦄ ⊢ T1 •*[h, g] U →
+ ∀T2. ⦃G, L⦄ ⊢ U •*[h, g] T2 → ⦃G, L⦄ ⊢ T1 •*[h, g] T2.
+/2 width=3/ qed-.
+
+theorem sstas_conf: ∀h,g,G,L,T,U1. ⦃G, L⦄ ⊢ T •*[h, g] U1 →
+ ∀U2. ⦃G, L⦄ ⊢ T •*[h, g] U2 →
+ ⦃G, L⦄ ⊢ U1 •*[h, g] U2 ∨ ⦃G, L⦄ ⊢ U2 •*[h, g] U1.
+#h #g #G #L #T #U1 #H1 @(sstas_ind_dx … H1) -T /2 width=1/
+#T #U #l #HTU #HU1 #IHU1 #U2 #H2
+elim (sstas_strip … H2 … HTU) #H destruct
+[ -H2 -IHU1 /3 width=4/
+| -T /2 width=1/
+]
+qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/notation/relations/statictype_5.ma".
-include "basic_2/grammar/genv.ma".
-include "basic_2/relocation/ldrop.ma".
-include "basic_2/static/sh.ma".
-
-(* STATIC TYPE ASSIGNMENT ON TERMS ******************************************)
-
-(* activate genv *)
-inductive sta (h:sh): relation4 genv lenv term term ≝
-| sta_sort: ∀G,L,k. sta h G L (⋆k) (⋆(next h k))
-| sta_ldef: ∀G,L,K,V,W,U,i. ⇩[0, i] L ≡ K.ⓓV → sta h G K V W →
- ⇧[0, i + 1] W ≡ U → sta h G L (#i) U
-| sta_ldec: ∀G,L,K,W,V,U,i. ⇩[0, i] L ≡ K.ⓛW → sta h G K W V →
- ⇧[0, i + 1] W ≡ U → sta h G L (#i) U
-| sta_bind: ∀a,I,G,L,V,T,U. sta h G (L.ⓑ{I}V) T U →
- sta h G L (ⓑ{a,I}V.T) (ⓑ{a,I}V.U)
-| sta_appl: ∀G,L,V,T,U. sta h G L T U → sta h G L (ⓐV.T) (ⓐV.U)
-| sta_cast: ∀G,L,W,T,U. sta h G L T U → sta h G L (ⓝW.T) U
-.
-
-interpretation "static type assignment (term)"
- 'StaticType h G L T U = (sta h G L T U).
-
-(* Basic inversion lemmas ************************************************)
-
-fact sta_inv_sort1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀k0. T = ⋆k0 →
- U = ⋆(next h k0).
-#h #G #L #T #U * -G -L -T -U
-[ #G #L #k #k0 #H destruct //
-| #G #L #K #V #W #U #i #_ #_ #_ #k0 #H destruct
-| #G #L #K #W #V #U #i #_ #_ #_ #k0 #H destruct
-| #a #I #G #L #V #T #U #_ #k0 #H destruct
-| #G #L #V #T #U #_ #k0 #H destruct
-| #G #L #W #T #U #_ #k0 #H destruct
-qed-.
-
-(* Basic_1: was: sty0_gen_sort *)
-lemma sta_inv_sort1: ∀h,G,L,U,k. ⦃G, L⦄ ⊢ ⋆k •[h] U → U = ⋆(next h k).
-/2 width=5 by sta_inv_sort1_aux/ qed-.
-
-fact sta_inv_lref1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀j. T = #j →
- (∃∃K,V,W. ⇩[0, j] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •[h] W &
- ⇧[0, j + 1] W ≡ U
- ) ∨
- (∃∃K,W,V. ⇩[0, j] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W •[h] V &
- ⇧[0, j + 1] W ≡ U
- ).
-#h #G #L #T #U * -G -L -T -U
-[ #G #L #k #j #H destruct
-| #G #L #K #V #W #U #i #HLK #HVW #HWU #j #H destruct /3 width=6/
-| #G #L #K #W #V #U #i #HLK #HWV #HWU #j #H destruct /3 width=6/
-| #a #I #G #L #V #T #U #_ #j #H destruct
-| #G #L #V #T #U #_ #j #H destruct
-| #G #L #W #T #U #_ #j #H destruct
-]
-qed-.
-
-(* Basic_1: was sty0_gen_lref *)
-lemma sta_inv_lref1: ∀h,G,L,U,i. ⦃G, L⦄ ⊢ #i •[h] U →
- (∃∃K,V,W. ⇩[0, i] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •[h] W &
- ⇧[0, i + 1] W ≡ U
- ) ∨
- (∃∃K,W,V. ⇩[0, i] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W •[h] V &
- ⇧[0, i + 1] W ≡ U
- ).
-/2 width=3 by sta_inv_lref1_aux/ qed-.
-
-fact sta_inv_gref1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀p0. T = §p0 → ⊥.
-#h #G #L #T #U * -G -L -T -U
-[ #G #L #k #p0 #H destruct
-| #G #L #K #V #W #U #i #_ #_ #_ #p0 #H destruct
-| #G #L #K #W #V #U #i #_ #_ #_ #p0 #H destruct
-| #a #I #G #L #V #T #U #_ #p0 #H destruct
-| #G #L #V #T #U #_ #p0 #H destruct
-| #G #L #W #T #U #_ #p0 #H destruct
-qed-.
-
-lemma sta_inv_gref1: ∀h,G,L,U,p. ⦃G, L⦄ ⊢ §p •[h] U → ⊥.
-/2 width=8 by sta_inv_gref1_aux/ qed-.
-
-fact sta_inv_bind1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀b,J,X,Y. T = ⓑ{b,J}Y.X →
- ∃∃Z. ⦃G, L.ⓑ{J}Y⦄ ⊢ X •[h] Z & U = ⓑ{b,J}Y.Z.
-#h #G #L #T #U * -G -L -T -U
-[ #G #L #k #b #J #X #Y #H destruct
-| #G #L #K #V #W #U #i #_ #_ #_ #b #J #X #Y #H destruct
-| #G #L #K #W #V #U #i #_ #_ #_ #b #J #X #Y #H destruct
-| #a #I #G #L #V #T #U #HTU #b #J #X #Y #H destruct /2 width=3/
-| #G #L #V #T #U #_ #b #J #X #Y #H destruct
-| #G #L #W #T #U #_ #b #J #X #Y #H destruct
-]
-qed-.
-
-(* Basic_1: was: sty0_gen_bind *)
-lemma sta_inv_bind1: ∀h,b,J,G,L,Y,X,U. ⦃G, L⦄ ⊢ ⓑ{b,J}Y.X •[h] U →
- ∃∃Z. ⦃G, L.ⓑ{J}Y⦄ ⊢ X •[h] Z & U = ⓑ{b,J}Y.Z.
-/2 width=3 by sta_inv_bind1_aux/ qed-.
-
-fact sta_inv_appl1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀X,Y. T = ⓐY.X →
- ∃∃Z. ⦃G, L⦄ ⊢ X •[h] Z & U = ⓐY.Z.
-#h #G #L #T #U * -G -L -T -U
-[ #G #L #k #X #Y #H destruct
-| #G #L #K #V #W #U #i #_ #_ #_ #X #Y #H destruct
-| #G #L #K #W #V #U #i #_ #_ #_ #X #Y #H destruct
-| #a #I #G #L #V #T #U #_ #X #Y #H destruct
-| #G #L #V #T #U #HTU #X #Y #H destruct /2 width=3/
-| #G #L #W #T #U #_ #X #Y #H destruct
-]
-qed-.
-
-(* Basic_1: was: sty0_gen_appl *)
-lemma sta_inv_appl1: ∀h,G,L,Y,X,U. ⦃G, L⦄ ⊢ ⓐY.X •[h] U →
- ∃∃Z. ⦃G, L⦄ ⊢ X •[h] Z & U = ⓐY.Z.
-/2 width=3 by sta_inv_appl1_aux/ qed-.
-
-fact sta_inv_cast1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀X,Y. T = ⓝY.X →
- ⦃G, L⦄ ⊢ X •[h] U.
-#h #G #L #T #U * -G -L -T -U
-[ #G #L #k #X #Y #H destruct
-| #G #L #K #V #W #U #i #_ #_ #_ #X #Y #H destruct
-| #G #L #K #W #V #U #i #_ #_ #_ #X #Y #H destruct
-| #a #I #G #L #V #T #U #_ #X #Y #H destruct
-| #G #L #V #T #U #_ #X #Y #H destruct
-| #G #L #W #T #U #HTU #X #Y #H destruct //
-]
-qed-.
-
-(* Basic_1: was: sty0_gen_cast *)
-lemma sta_inv_cast1: ∀h,G,L,X,Y,U. ⦃G, L⦄ ⊢ ⓝY.X •[h] U → ⦃G, L⦄ ⊢ X •[h] U.
-/2 width=4 by sta_inv_cast1_aux/ qed-.
-
-(* Inversion lrmmas on static type assignment for terms *********************)
-
-lemma da_inv_sta: ∀h,g,G,L,T,l. ⦃G, L⦄ ⊢ T ▪[h, g] l →
- ∃U. ⦃G, L⦄ ⊢ T •[h] U.
-#h #g #G #L #T #l #H elim H -G -L -T -l
-[ /2 width=2/
-| #G #L #K #V #i #l #HLK #_ * #W #HVW
- elim (lift_total W 0 (i+1)) /3 width=7/
-| #G #L #K #W #i #l #HLK #_ * #V #HWV
- elim (lift_total W 0 (i+1)) /3 width=7/
-| #a #I #G #L #V #T #l #_ * /3 width=2/
-| * #G #L #V #T #l #_ * /3 width=2/
-]
-qed-.
-
-(* Properties on static type assignment for terms ***************************)
-
-lemma sta_da: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U →
- ∃l. ⦃G, L⦄ ⊢ T ▪[h, g] l.
-#h #g #G #L #T #U #H elim H -G -L -T -U
-[ #G #L #k elim (deg_total h g k) /3 width=2/
-| #G #L #K #V #W #W0 #i #HLK #_ #_ * /3 width=5/
-| #G #L #K #W #V #W0 #i #HLK #_ #_ * /3 width=5/
-| #a #I #G #L #V #T #U #_ * /3 width=2/
-| #G #L #V #T #U #_ * /3 width=2/
-| #G #L #W #T #U #_ * /3 width=2/
-]
-qed-.
+++ /dev/null
-(* Forward lemmas on stratified static type assignment for terms ************)
-
-lemma aaa_fwd_ssta: ∀h,g,G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∃U. ⦃G, L⦄ ⊢ T •[h, g] U.
-#h #G #L #T #A #H elim H -G -L -T -A
-[ /2 width=2/
-| * #G #L #K [ #V | #W ] #B #i #HLK #_ * [ #W | #V ] #HVW
- elim (lift_total W 0 (i+1)) /3 width=7/
-| #a #G #L #V #T #B #A #_ #_ #_ * /3 width=2/
-| #a #G #L #V #T #B #A #_ #_ #_ * /3 width=2/
-| #G #L #V #T #B #A #_ #_ #_ * /3 width=2/
-| #G #L #W #T #A #_ #_ #_ * /3 width=2/
-]
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/relocation/ldrop_ldrop.ma".
-include "basic_2/static/sta.ma".
-
-(* STATIC TYPE ASSIGNMENT ON TERMS ******************************************)
-
-(* Properties on relocation *************************************************)
-
-(* Basic_1: was: sty0_lift *)
-lemma sta_lift: ∀h,G. l_liftable (sta h G).
-#h #G #L1 #T1 #U1 #H elim H -G -L1 -T1 -U1
-[ #G #L1 #k #L2 #d #e #HL21 #X1 #H1 #X2 #H2
- >(lift_inv_sort1 … H1) -X1
- >(lift_inv_sort1 … H2) -X2 //
-| #G #L1 #K1 #V1 #W1 #W #i #HLK1 #_ #HW1 #IHVW1 #L2 #d #e #HL21 #X #H #U2 #HWU2
- elim (lift_inv_lref1 … H) * #Hid #H destruct
- [ elim (lift_trans_ge … HW1 … HWU2) -W // #W2 #HW12 #HWU2
- elim (ldrop_trans_le … HL21 … HLK1) -L1 /2 width=2/ #X #HLK2 #H
- elim (ldrop_inv_skip2 … H) -H /2 width=1/ -Hid #K2 #V2 #HK21 #HV12 #H destruct
- /3 width=8/
- | lapply (lift_trans_be … HW1 … HWU2 ? ?) -W // /2 width=1/ #HW1U2
- lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 // -Hid /3 width=8/
- ]
-| #G #L1 #K1 #W1 #V1 #W #i #HLK1 #_ #HW1 #IHWV1 #L2 #d #e #HL21 #X #H #U2 #HWU2
- elim (lift_inv_lref1 … H) * #Hid #H destruct
- [ elim (lift_trans_ge … HW1 … HWU2) -W // <minus_plus #W #HW1 #HWU2
- elim (ldrop_trans_le … HL21 … HLK1) -L1 /2 width=2/ #X #HLK2 #H
- elim (ldrop_inv_skip2 … H) -H /2 width=1/ -Hid #K2 #W2 #HK21 #HW12 #H destruct
- lapply (lift_mono … HW1 … HW12) -HW1 #H destruct
- elim (lift_total V1 (d-i-1) e) /3 width=8/
- | lapply (lift_trans_be … HW1 … HWU2 ? ?) -W // /2 width=1/ #HW1U2
- lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 // -Hid /3 width=8/
- ]
-| #a #I #G #L1 #V1 #T1 #U1 #_ #IHTU1 #L2 #d #e #HL21 #X1 #H1 #X2 #H2
- elim (lift_inv_bind1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H destruct
- elim (lift_inv_bind1 … H2) -H2 #X #U2 #H1 #HU12 #H2 destruct
- lapply (lift_mono … H1 … HV12) -H1 #H destruct /4 width=5/
-| #G #L1 #V1 #T1 #U1 #_ #IHTU1 #L2 #d #e #HL21 #X1 #H1 #X2 #H2
- elim (lift_inv_flat1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H destruct
- elim (lift_inv_flat1 … H2) -H2 #X #U2 #H1 #HU12 #H2 destruct
- lapply (lift_mono … H1 … HV12) -H1 #H destruct /4 width=5/
-| #G #L1 #W1 #T1 #U1 #_ #IHTU1 #L2 #d #e #HL21 #X #H #U2 #HU12
- elim (lift_inv_flat1 … H) -H #W2 #T2 #_ #HT12 #H destruct /3 width=5/
-]
-qed.
-
-(* Note: apparently this was missing in basic_1 *)
-lemma sta_inv_lift1: ∀h,G. l_deliftable_sn (sta h G).
-#h #G #L2 #T2 #U2 #H elim H -G -L2 -T2 -U2
-[ #G #L2 #k #L1 #d #e #_ #X #H
- >(lift_inv_sort2 … H) -X /2 width=3/
-| #G #L2 #K2 #V2 #W2 #W #i #HLK2 #HVW2 #HW2 #IHVW2 #L1 #d #e #HL21 #X #H
- elim (lift_inv_lref2 … H) * #Hid #H destruct [ -HVW2 | -IHVW2 ]
- [ elim (ldrop_conf_lt … HL21 … HLK2) -L2 // #K1 #V1 #HLK1 #HK21 #HV12
- elim (IHVW2 … HK21 … HV12) -K2 -V2 #W1 #HW12 #HVW1
- elim (lift_trans_le … HW12 … HW2) -W2 // >minus_plus <plus_minus_m_m // -Hid /3 width=8/
- | lapply (ldrop_conf_ge … HL21 … HLK2 ?) -L2 // #HL1K2
- elim (le_inv_plus_l … Hid) -Hid #Hdie #ei
- elim (lift_split … HW2 d (i-e+1)) -HW2 // [3: /2 width=1/ ]
- [ #W0 #HW20 <le_plus_minus_comm // >minus_minus_m_m /2 width=1/ /3 width=8/
- | <le_plus_minus_comm //
- ]
- ]
-| #G #L2 #K2 #W2 #V2 #W #i #HLK2 #HWV2 #HW2 #IHWV2 #L1 #d #e #HL21 #X #H
- elim (lift_inv_lref2 … H) * #Hid #H destruct [ -HWV2 | -IHWV2 ]
- [ elim (ldrop_conf_lt … HL21 … HLK2) -L2 // #K1 #W1 #HLK1 #HK21 #HW12
- elim (IHWV2 … HK21 … HW12) -K2 #V1 #_ #HWV1
- elim (lift_trans_le … HW12 … HW2) -W2 // >minus_plus <plus_minus_m_m // -Hid /3 width=8/
- | lapply (ldrop_conf_ge … HL21 … HLK2 ?) -L2 // #HL1K2
- elim (le_inv_plus_l … Hid) -Hid #Hdie #ei
- elim (lift_split … HW2 d (i-e+1)) -HW2 // [3: /2 width=1/ ]
- [ #W0 #HW20 <le_plus_minus_comm // >minus_minus_m_m /2 width=1/ /3 width=8/
- | <le_plus_minus_comm //
- ]
- ]
-| #a #I #G #L2 #V2 #T2 #U2 #_ #IHTU2 #L1 #d #e #HL21 #X #H
- elim (lift_inv_bind2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
- elim (IHTU2 (L1.ⓑ{I}V1) … HT12) -IHTU2 -HT12 /2 width=1/ -HL21 /3 width=5/
-| #G #L2 #V2 #T2 #U2 #_ #IHTU2 #L1 #d #e #HL21 #X #H
- elim (lift_inv_flat2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
- elim (IHTU2 … HL21 … HT12) -L2 -HT12 /3 width=5/
-| #G #L2 #W2 #T2 #U2 #_ #IHTU2 #L1 #d #e #HL21 #X #H
- elim (lift_inv_flat2 … H) -H #W1 #T1 #_ #HT12 #H destruct
- elim (IHTU2 … HL21 … HT12) -L2 -HT12 /3 width=3/
-]
-qed-.
-
-(* Advanced forvard lemmas **************************************************)
-
-(* Basic_1: was: sty0_correct *)
-lemma sta_fwd_correct: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∃T0. ⦃G, L⦄ ⊢ U •[h] T0.
-#h #G #L #T #U #H elim H -G -L -T -U
-[ /2 width=2/
-| #G #L #K #V #W #W0 #i #HLK #_ #HW0 * #V0 #HWV0
- lapply (ldrop_fwd_ldrop2 … HLK) -HLK #HLK
- elim (lift_total V0 0 (i+1)) /3 width=10/
-| #G #L #K #W #V #V0 #i #HLK #HWV #HWV0 #_
- lapply (ldrop_fwd_ldrop2 … HLK) -HLK #HLK
- elim (lift_total V 0 (i+1)) /3 width=10/
-| #a #I #G #L #V #T #U #_ * /3 width=2/
-| #G #L #V #T #U #_ * #T0 #HUT0 /3 width=2/
-| #G #L #W #T #U #_ * /2 width=2/
-]
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/relocation/ldrop_ldrop.ma".
-include "basic_2/static/sta.ma".
-
-(* STATIC TYPE ASSIGNMENT ON TERMS ******************************************)
-
-(* Main properties **********************************************************)
-
-(* Note: apparently this was missing in basic_1 *)
-theorem sta_mono: ∀h,G,L. singlevalued … (sta h G L).
-#h #G #L #T #U1 #H elim H -G -L -T -U1
-[ #G #L #k #X #H >(sta_inv_sort1 … H) -X //
-| #G #L #K #V #W #U1 #i #HLK #_ #HWU1 #IHVW #U2 #H
- elim (sta_inv_lref1 … H) -H * #K0 #V0 #W0 #HLK0 #HVW0 #HW0U2
- lapply (ldrop_mono … HLK0 … HLK) -HLK -HLK0 #H destruct
- lapply (IHVW … HVW0) -IHVW -HVW0 #H destruct
- >(lift_mono … HWU1 … HW0U2) -W0 -U1 //
-| #G #L #K #W #V #U1 #i #HLK #_ #HWU1 #IHWV #U2 #H
- elim (sta_inv_lref1 … H) -H * #K0 #W0 #V0 #HLK0 #HWV0 #HV0U2
- lapply (ldrop_mono … HLK0 … HLK) -HLK -HLK0 #H destruct
- lapply (IHWV … HWV0) -IHWV -HWV0 #H destruct
- >(lift_mono … HWU1 … HV0U2) -W -U1 //
-| #a #I #G #L #V #T #U1 #_ #IHTU1 #X #H
- elim (sta_inv_bind1 … H) -H #U2 #HTU2 #H destruct /3 width=1/
-| #G #L #V #T #U1 #_ #IHTU1 #X #H
- elim (sta_inv_appl1 … H) -H #U2 #HTU2 #H destruct /3 width=1/
-| #G #L #W #T #U1 #_ #IHTU1 #U2 #H
- lapply (sta_inv_cast1 … H) -H /2 width=1/
-]
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
-
-notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 • break [ term 46 h ] break term 46 T2 )"
- non associative with precedence 45
- for @{ 'StaticType $h $G $L $T1 $T2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
+
+notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 • break [ term 46 h ] break term 46 T2 )"
+ non associative with precedence 45
+ for @{ 'StaticType $h $G $L $T1 $T2 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
-
-notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 • break [ term 46 h , break term 46 g ] break term 46 T2 )"
- non associative with precedence 45
- for @{ 'StaticType $h $g $G $L $T1 $T2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
+
+notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 •* break [ term 46 h , break term 46 l ] break term 46 T2 )"
+ non associative with precedence 45
+ for @{ 'StaticTypeStar $h $G $L $l $T1 $T2 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
-
-notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 •* break [ term 46 h , break term 46 g , break term 46 l ] break term 46 T2 )"
- non associative with precedence 45
- for @{ 'StaticTypeStar $h $g $G $L $l $T1 $T2 }.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
+
+notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 • • * break [ term 46 h , break term 46 l ] break term 46 T2 )"
+ non associative with precedence 45
+ for @{ 'StaticTypeStarAlt $h $G $L $l $T1 $T2 }.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
-
-notation "hvbox( ⦃ term 46 G , break term 46 L ⦄ ⊢ break term 46 T1 • • * break [ term 46 h , break term 46 g , break term 46 l ] break term 46 T2 )"
- non associative with precedence 45
- for @{ 'StaticTypeStarAlt $h $g $G $L $l $T1 $T2 }.
include "basic_2/substitution/ldrop_ldrop.ma".
include "basic_2/multiple/fqus_alt.ma".
-include "basic_2/static/ssta.ma".
+include "basic_2/static/sta.ma".
+include "basic_2/static/da.ma".
include "basic_2/reduction/cpx.ma".
(* CONTEXT-SENSITIVE EXTENDED PARALLEL REDUCTION FOR TERMS ******************)
(* Advanced properties ******************************************************)
-lemma ssta_cpx: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 •[h, g] T2 →
- ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2.
+lemma sta_cpx: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 •[h] T2 →
+ ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T1 ➡[h, g] T2.
#h #g #G #L #T1 #T2 #l #H elim H -G -L -T1 -T2
[ /3 width=4 by cpx_st, da_inv_sort/
-| #G #L #K #V #U #W #i #HLK #_ #HWU #IHVW #H
+| #G #L #K #V1 #V2 #W2 #i #HLK #_ #HVW2 #IHV12 #H
elim (da_inv_lref … H) -H * #K0 #V0 [| #l0 ] #HLK0
lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct /3 width=7 by cpx_delta/
-| #G #L #K #W #U #l0 #i #HLK #_ #HWU #H
+| #G #L #K #W1 #W2 #V1 #i #HLK #_ #HWV1 #IHW12 #H
elim (da_inv_lref … H) -H * #K0 #W0 [| #l1 ] #HLK0
- lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct /2 width=7 by cpx_delta/
+ lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct /3 width=7 by cpx_delta/
| /4 width=2 by cpx_bind, da_inv_bind/
| /4 width=3 by cpx_flat, da_inv_flat/
| /4 width=3 by cpx_eps, da_inv_flat/
]
qed-.
-lemma fqu_ssta_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ →
- ∀U2. ⦃G2, L2⦄ ⊢ T2 •[h, g] U2 →
- ∀l. ⦃G2, L2⦄ ⊢ T2 ▪[h, g] l+1 →
- ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡[h, g] U1 & ⦃G1, L1, U1⦄ ⊐ ⦃G2, L2, U2⦄.
-/3 width=5 by fqu_cpx_trans, ssta_cpx/ qed-.
+lemma fqu_sta_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ →
+ ∀U2. ⦃G2, L2⦄ ⊢ T2 •[h] U2 →
+ ∀l. ⦃G2, L2⦄ ⊢ T2 ▪[h, g] l+1 →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡[h, g] U1 & ⦃G1, L1, U1⦄ ⊐ ⦃G2, L2, U2⦄.
+/3 width=5 by fqu_cpx_trans, sta_cpx/ qed-.
lemma fquq_cpx_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ →
∀U2. ⦃G2, L2⦄ ⊢ T2 ➡[h, g] U2 →
]
qed-.
-lemma fquq_ssta_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ →
- ∀U2. ⦃G2, L2⦄ ⊢ T2 •[h, g] U2 →
- ∀l. ⦃G2, L2⦄ ⊢ T2 ▪[h, g] l+1 →
- ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡[h, g] U1 & ⦃G1, L1, U1⦄ ⊐⸮ ⦃G2, L2, U2⦄.
-/3 width=5 by fquq_cpx_trans, ssta_cpx/ qed-.
+lemma fquq_sta_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ →
+ ∀U2. ⦃G2, L2⦄ ⊢ T2 •[h] U2 →
+ ∀l. ⦃G2, L2⦄ ⊢ T2 ▪[h, g] l+1 →
+ ∃∃U1. ⦃G1, L1⦄ ⊢ T1 ➡[h, g] U1 & ⦃G1, L1, U1⦄ ⊐⸮ ⦃G2, L2, U2⦄.
+/3 width=5 by fquq_cpx_trans, sta_cpx/ qed-.
lemma fqup_cpx_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T2⦄ →
∀U2. ⦃G2, L2⦄ ⊢ T2 ➡[h, g] U2 →
(* Properties on atomic arity assignment for terms **************************)
-lemma aaa_fpb_conf: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≽[h, g] ⦃G2, L2, T2⦄ →
+lemma fpb_aaa_conf: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ≽[h, g] ⦃G2, L2, T2⦄ →
∀A1. ⦃G1, L1⦄ ⊢ T1 ⁝ A1 → ∃A2. ⦃G2, L2⦄ ⊢ T2 ⁝ A2.
#h #g #G1 #G2 #L1 #L2 #T1 #T2 * -G2 -L2 -T2
-/3 width=6 by aaa_lleq_conf, aaa_lpx_conf, aaa_cpx_conf, aaa_fquq_conf, ex_intro/
+/3 width=6 by aaa_lleq_conf, lpx_aaa_conf, cpx_aaa_conf, aaa_fquq_conf, ex_intro/
qed-.
(* Advanced properties ******************************************************)
-lemma ssta_fpb: ∀h,g,G,L,T1,T2,l.
- ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T1 •[h, g] T2 →
+lemma sta_fpb: ∀h,g,G,L,T1,T2,l.
+ ⦃G, L⦄ ⊢ T1 ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T1 •[h] T2 →
⦃G, L, T1⦄ ≽[h, g] ⦃G, L, T2⦄.
-/3 width=5 by fpb_cpx, ssta_cpx/ qed.
+/3 width=4 by fpb_cpx, sta_cpx/ qed.
(* Properties on atomic arity assignment for terms **************************)
(* Note: lemma 500 *)
-lemma aaa_cpx_lpx_conf: ∀h,g,G,L1,T1,A. ⦃G, L1⦄ ⊢ T1 ⁝ A →
+lemma cpx_lpx_aaa_conf: ∀h,g,G,L1,T1,A. ⦃G, L1⦄ ⊢ T1 ⁝ A →
∀T2. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2 →
∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → ⦃G, L2⦄ ⊢ T2 ⁝ A.
#h #g #G #L1 #T1 #A #H elim H -G -L1 -T1 -A
]
qed-.
-lemma aaa_cpx_conf: ∀h,g,G,L,T1,A. ⦃G, L⦄ ⊢ T1 ⁝ A → ∀T2. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 → ⦃G, L⦄ ⊢ T2 ⁝ A.
-/2 width=7 by aaa_cpx_lpx_conf/ qed-.
+lemma cpx_aaa_conf: ∀h,g,G,L,T1,A. ⦃G, L⦄ ⊢ T1 ⁝ A → ∀T2. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 → ⦃G, L⦄ ⊢ T2 ⁝ A.
+/2 width=7 by cpx_lpx_aaa_conf/ qed-.
-lemma aaa_lpx_conf: ∀h,g,G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A → ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → ⦃G, L2⦄ ⊢ T ⁝ A.
-/2 width=7 by aaa_cpx_lpx_conf/ qed-.
+lemma lpx_aaa_conf: ∀h,g,G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A → ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → ⦃G, L2⦄ ⊢ T ⁝ A.
+/2 width=7 by cpx_lpx_aaa_conf/ qed-.
-lemma aaa_cpr_conf: ∀G,L,T1,A. ⦃G, L⦄ ⊢ T1 ⁝ A → ∀T2. ⦃G, L⦄ ⊢ T1 ➡ T2 → ⦃G, L⦄ ⊢ T2 ⁝ A.
-/3 width=5 by aaa_cpx_conf, cpr_cpx/ qed-.
+lemma cpr_aaa_conf: ∀G,L,T1,A. ⦃G, L⦄ ⊢ T1 ⁝ A → ∀T2. ⦃G, L⦄ ⊢ T1 ➡ T2 → ⦃G, L⦄ ⊢ T2 ⁝ A.
+/3 width=5 by cpx_aaa_conf, cpr_cpx/ qed-.
-lemma aaa_lpr_conf: ∀G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ T ⁝ A.
-/3 width=5 by aaa_lpx_conf, lpr_lpx/ qed-.
+lemma lpr_aaa_conf: ∀G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ T ⁝ A.
+/3 width=5 by lpx_aaa_conf, lpr_lpx/ qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/static/da.ma".
-include "basic_2/static/aaa.ma".
-
-(* ATONIC ARITY ASSIGNMENT FOR TERMS ****************************************)
-
-(* Forward lemmas on degree assignment for terms ****************************)
-
-lemma aaa_fwd_da: ∀h,g,G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∃l. ⦃G, L⦄ ⊢ T ▪[h, g] l.
-#h #g #G #L #T #A #H elim H -G -L -T -A
-[ #G #L #k elim (deg_total … g k) /3 width=2/
-| * #G #L #K [ #V | #W ] #B #i #HLK #_ * /3 width=5/
-| #a #G #L #V #T #B #A #_ #_ #_ * /3 width=2/
-| #a #G #L #V #T #B #A #_ #_ #_ * /3 width=2/
-| #G #L #V #T #B #A #_ #_ #_ * /3 width=2/
-| #G #L #W #T #A #_ #_ #_ * /3 width=2/
-]
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/static/ssta.ma".
-include "basic_2/static/aaa_lift.ma".
-include "basic_2/static/aaa_da.ma".
-
-(* ATONIC ARITY ASSIGNMENT FOR TERMS ****************************************)
-
-(* Properties on stratified static type assignment for terms ****************)
-
-lemma aaa_ssta_conf: ∀h,g,G,L. Conf3 … (aaa G L) (ssta h g G L).
-#h #g #G #L #T #A #H elim H -G -L -T -A
-[ #G #L #k #U #H
- lapply (ssta_inv_sort1 … H) -H #H destruct //
-| #I #G #L #K #V #B #i #HLK #HV #IHV #U #H
- elim (ssta_inv_lref1 … H) -H * #K0 #V0 #W0 #HLK0 #HVW0 #HU
- lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H0 destruct
- lapply (ldrop_fwd_drop2 … HLK) -HLK #HLK
- @(aaa_lift … HLK … HU) -HU -L // -HV /2 width=2/
-| #a #G #L #V #T #B #A #HV #_ #_ #IHT #X #H
- elim (ssta_inv_bind1 … H) -H #U #HTU #H destruct /3 width=2/
-| #a #G #L #V #T #B #A #HV #_ #_ #IHT #X #H
- elim (ssta_inv_bind1 … H) -H #U #HTU #H destruct /3 width=2/
-| #G #L #V #T #B #A #HV #_ #_ #IHT #X #H
- elim (ssta_inv_appl1 … H) -H #U #HTU #H destruct /3 width=3/
-| #G #L #V #T #A #_ #_ #IHV #IHT #X #H
- lapply (ssta_inv_cast1 … H) -H /2 width=2/
-]
-qed-.
-
-(* Forward lemmas on stratified static type assignment for terms ************)
-
-lemma aaa_fwd_ssta: ∀h,g,G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∃U. ⦃G, L⦄ ⊢ T •[h, g] U.
-#h #g #G #L #T #A #H elim (aaa_fwd_da … H) -H /2 width=3 by da_ssta/
-qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/da_sta.ma".
+include "basic_2/static/sta_aaa.ma".
+
+(* DEGREE ASSIGNMENT FOR TERMS **********************************************)
+
+(* Properties on atomic arity assignment for terms **************************)
+
+lemma aaa_da: ∀h,g,G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∃l. ⦃G, L⦄ ⊢ T ▪[h, g] l.
+#h #g #G #L #T #A #H elim (aaa_sta h … H) -A /2 width=2 by sta_da/
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/sta.ma".
+include "basic_2/static/da_da.ma".
+
+(* Properties on static type assignment for terms ***************************)
+
+lemma da_sta_conf: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U →
+ ∀l. ⦃G, L⦄ ⊢ T ▪[h, g] l → ⦃G, L⦄ ⊢ U ▪[h, g] l-1.
+#h #g #G #L #T #U #H elim H -G -L -T -U
+[ #G #L #k #l #H
+ lapply (da_inv_sort … H) -H /3 width=1 by da_sort, deg_next/
+| #G #L #K #V #U #W #i #HLK #_ #HWU #IHVW #l #H
+ elim (da_inv_lref … H) -H * #K0 #V0 [| #l0] #HLK0 #HV0
+ lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct
+ lapply (ldrop_fwd_drop2 … HLK) -HLK /3 width=8 by da_lift/
+| #G #L #K #W #V #U #i #HLK #_ #HWU #IHWV #l #H
+ elim (da_inv_lref … H) -H * #K0 #V0 [| #l0] #HLK0 #HV0 [| #H0 ]
+ lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct
+ lapply (ldrop_fwd_drop2 … HLK) -HLK /3 width=8 by da_lift/
+| #a #I #G #L #V #T #U #_ #IHTU #l #H
+ lapply (da_inv_bind … H) -H /3 width=1 by da_bind/
+| #G #L #V #T #U #_ #IHTU #l #H
+ lapply (da_inv_flat … H) -H /3 width=1 by da_flat/
+| #G #L #W #T #U #_ #IHTU #l #H
+ lapply (da_inv_flat … H) -H /2 width=1 by/
+]
+qed-.
+
+lemma sta_da: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U →
+ ∃l. ⦃G, L⦄ ⊢ T ▪[h, g] l.
+#h #g #G #L #T #U #H elim H -G -L -T -U
+[ #G #L #k elim (deg_total h g k) /3 width=2 by da_sort, ex_intro/
+| #G #L #K #V #W #W0 #i #HLK #_ #_ * /3 width=5 by da_ldef, ex_intro/
+| #G #L #K #W #V #W0 #i #HLK #_ #_ * /3 width=5 by da_ldec, ex_intro/
+| #a #I #G #L #V #T #U #_ * /3 width=2 by da_bind, ex_intro/
+| #G #L #V #T #U #_ * /3 width=2 by da_flat, ex_intro/
+| #G #L #W #T #U #_ * /3 width=2 by da_flat, ex_intro/
+]
+qed-.
+
+(* Inversion lrmmas on static type assignment for terms *********************)
+
+lemma da_inv_sta: ∀h,g,G,L,T,l. ⦃G, L⦄ ⊢ T ▪[h, g] l →
+ ∃U. ⦃G, L⦄ ⊢ T •[h] U.
+#h #g #G #L #T #l #H elim H -G -L -T -l
+[ /2 width=2/
+| #G #L #K #V #i #l #HLK #_ * #W #HVW
+ elim (lift_total W 0 (i+1)) /3 width=7 by sta_ldef, ex_intro/
+| #G #L #K #W #i #l #HLK #_ * #V #HWV
+ elim (lift_total W 0 (i+1)) /3 width=7 by sta_ldec, ex_intro/
+| #a #I #G #L #V #T #l #_ * /3 width=2 by sta_bind, ex_intro/
+| * #G #L #V #T #l #_ * /3 width=2 by sta_appl, sta_cast, ex_intro/
+]
+qed-.
+
+lemma sta_inv_refl_pos: ∀h,g,G,L,T,l. ⦃G, L⦄ ⊢ T ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T •[h] T → ⊥.
+#h #g #G #L #T #l #H1T #HTT
+lapply (da_sta_conf … HTT … H1T) -HTT <minus_plus_m_m #H2T
+lapply (da_mono … H2T … H1T) -h -G -L -T #H
+elim (plus_xySz_x_false 0 l 0) //
+qed-.
G ⊢ K1 ⁝⫃ K2 & I = Abbr & L2 = K2.ⓛW & X = ⓝW.V.
#G #L1 #L2 * -L1 -L2
[ #J #K1 #X #H destruct
-| #I #L1 #L2 #V #HL12 #J #K1 #X #H destruct /3 width=3/
-| #L1 #L2 #W #V #A #HV #HW #HL12 #J #K1 #X #H destruct /3 width=9/
+| #I #L1 #L2 #V #HL12 #J #K1 #X #H destruct /3 width=3 by ex2_intro, or_introl/
+| #L1 #L2 #W #V #A #HV #HW #HL12 #J #K1 #X #H destruct /3 width=9 by or_intror, ex6_4_intro/
]
qed-.
G ⊢ K1 ⁝⫃ K2 & I = Abst & L1 = K1.ⓓⓝW.V.
#G #L1 #L2 * -L1 -L2
[ #J #K2 #U #H destruct
-| #I #L1 #L2 #V #HL12 #J #K2 #U #H destruct /3 width=3/
-| #L1 #L2 #W #V #A #HV #HW #HL12 #J #K2 #U #H destruct /3 width=7/
+| #I #L1 #L2 #V #HL12 #J #K2 #U #H destruct /3 width=3 by ex2_intro, or_introl/
+| #L1 #L2 #W #V #A #HV #HW #HL12 #J #K2 #U #H destruct /3 width=7 by or_intror, ex5_3_intro/
]
qed-.
(* Basic forward lemmas *****************************************************)
lemma lsuba_fwd_lsubr: ∀G,L1,L2. G ⊢ L1 ⁝⫃ L2 → L1 ⫃ L2.
-#G #L1 #L2 #H elim H -L1 -L2 // /2 width=1/
+#G #L1 #L2 #H elim H -L1 -L2 /2 width=1 by lsubr_bind, lsubr_abst/
qed-.
(* Basic properties *********************************************************)
lemma lsuba_refl: ∀G,L. G ⊢ L ⁝⫃ L.
-#G #L elim L -L // /2 width=1/
+#G #L elim L -L /2 width=1 by lsuba_atom, lsuba_pair/
qed.
+
+(* Note: the constant 0 cannot be generalized *)
+lemma lsuba_ldrop_O1_conf: ∀G,L1,L2. G ⊢ L1 ⁝⫃ L2 → ∀K1,s,e. ⇩[s, 0, e] L1 ≡ K1 →
+ ∃∃K2. G ⊢ K1 ⁝⫃ K2 & ⇩[s, 0, e] L2 ≡ K2.
+#G #L1 #L2 #H elim H -L1 -L2
+[ /2 width=3 by ex2_intro/
+| #I #L1 #L2 #V #_ #IHL12 #K1 #s #e #H
+ elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK1
+ [ destruct
+ elim (IHL12 L1 s 0) -IHL12 // #X #HL12 #H
+ <(ldrop_inv_O2 … H) in HL12; -H /3 width=3 by lsuba_pair, ldrop_pair, ex2_intro/
+ | elim (IHL12 … HLK1) -L1 /3 width=3 by ldrop_drop_lt, ex2_intro/
+ ]
+| #L1 #L2 #W #V #A #HV #HW #_ #IHL12 #K1 #s #e #H
+ elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK1
+ [ destruct
+ elim (IHL12 L1 s 0) -IHL12 // #X #HL12 #H
+ <(ldrop_inv_O2 … H) in HL12; -H /3 width=3 by lsuba_abbr, ldrop_pair, ex2_intro/
+ | elim (IHL12 … HLK1) -L1 /3 width=3 by ldrop_drop_lt, ex2_intro/
+ ]
+]
+qed-.
+
+(* Note: the constant 0 cannot be generalized *)
+lemma lsuba_ldrop_O1_trans: ∀G,L1,L2. G ⊢ L1 ⁝⫃ L2 → ∀K2,s,e. ⇩[s, 0, e] L2 ≡ K2 →
+ ∃∃K1. G ⊢ K1 ⁝⫃ K2 & ⇩[s, 0, e] L1 ≡ K1.
+#G #L1 #L2 #H elim H -L1 -L2
+[ /2 width=3 by ex2_intro/
+| #I #L1 #L2 #V #_ #IHL12 #K2 #s #e #H
+ elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK2
+ [ destruct
+ elim (IHL12 L2 s 0) -IHL12 // #X #HL12 #H
+ <(ldrop_inv_O2 … H) in HL12; -H /3 width=3 by lsuba_pair, ldrop_pair, ex2_intro/
+ | elim (IHL12 … HLK2) -L2 /3 width=3 by ldrop_drop_lt, ex2_intro/
+ ]
+| #L1 #L2 #W #V #A #HV #HW #_ #IHL12 #K2 #s #e #H
+ elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK2
+ [ destruct
+ elim (IHL12 L2 s 0) -IHL12 // #X #HL12 #H
+ <(ldrop_inv_O2 … H) in HL12; -H /3 width=3 by lsuba_abbr, ldrop_pair, ex2_intro/
+ | elim (IHL12 … HLK2) -L2 /3 width=3 by ldrop_drop_lt, ex2_intro/
+ ]
+]
+qed-.
(**************************************************************************)
include "basic_2/static/aaa_aaa.ma".
-include "basic_2/static/lsuba_ldrop.ma".
+include "basic_2/static/lsuba.ma".
(* LOCAL ENVIRONMENT REFINEMENT FOR ATOMIC ARITY ASSIGNMENT *****************)
| #I #G #L1 #K1 #V #A #i #HLK1 #HV #IHV #L2 #HL12
elim (lsuba_ldrop_O1_conf … HL12 … HLK1) -L1 #X #H #HLK2
elim (lsuba_inv_pair1 … H) -H * #K2
- [ #HK12 #H destruct /3 width=5/
+ [ #HK12 #H destruct /3 width=5 by aaa_lref/
| #W0 #V0 #A0 #HV0 #HW0 #_ #H1 #H2 #H3 destruct
- lapply (aaa_mono … HV0 … HV) #H destruct -V0 /2 width=5/
+ lapply (aaa_mono … HV0 … HV) #H destruct -V0 /2 width=5 by aaa_lref/
]
-| /4 width=2/
-| /4 width=1/
-| /3 width=3/
-| /3 width=1/
+| /4 width=2 by lsuba_pair, aaa_abbr/
+| /4 width=1 by lsuba_pair, aaa_abst/
+| /3 width=3 by aaa_appl/
+| /3 width=1 by aaa_cast/
]
qed-.
| #I #G #L2 #K2 #V #A #i #HLK2 #H1V #IHV #L1 #HL12
elim (lsuba_ldrop_O1_trans … HL12 … HLK2) -L2 #X #H #HLK1
elim (lsuba_inv_pair2 … H) -H * #K1
- [ #HK12 #H destruct /3 width=5/
+ [ #HK12 #H destruct /3 width=5 by aaa_lref/
| #V0 #A0 #HV0 #H2V #_ #H1 #H2 destruct
- lapply (aaa_mono … H2V … H1V) #H destruct -K2 /2 width=5/
+ lapply (aaa_mono … H2V … H1V) #H destruct -K2 /2 width=5 by aaa_lref/
]
-| /4 width=2/
-| /4 width=1/
-| /3 width=3/
-| /3 width=1/
+| /4 width=2 by lsuba_pair, aaa_abbr/
+| /4 width=1 by lsuba_pair, aaa_abst/
+| /3 width=3 by aaa_appl/
+| /3 width=1 by aaa_cast/
]
qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/static/lsuba.ma".
-
-(* LOCAL ENVIRONMENT REFINEMENT FOR ATOMIC ARITY ASSIGNMENT *****************)
-
-(* Properties concerning basic local environment slicing ********************)
-
-(* Note: the constant 0 cannot be generalized *)
-lemma lsuba_ldrop_O1_conf: ∀G,L1,L2. G ⊢ L1 ⁝⫃ L2 → ∀K1,s,e. ⇩[s, 0, e] L1 ≡ K1 →
- ∃∃K2. G ⊢ K1 ⁝⫃ K2 & ⇩[s, 0, e] L2 ≡ K2.
-#G #L1 #L2 #H elim H -L1 -L2
-[ /2 width=3/
-| #I #L1 #L2 #V #_ #IHL12 #K1 #s #e #H
- elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK1
- [ destruct
- elim (IHL12 L1 s 0) -IHL12 // #X #HL12 #H
- <(ldrop_inv_O2 … H) in HL12; -H /3 width=3 by lsuba_pair, ldrop_pair, ex2_intro/
- | elim (IHL12 … HLK1) -L1 /3 width=3 by ldrop_drop_lt, ex2_intro/
- ]
-| #L1 #L2 #W #V #A #HV #HW #_ #IHL12 #K1 #s #e #H
- elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK1
- [ destruct
- elim (IHL12 L1 s 0) -IHL12 // #X #HL12 #H
- <(ldrop_inv_O2 … H) in HL12; -H /3 width=3 by lsuba_abbr, ldrop_pair, ex2_intro/
- | elim (IHL12 … HLK1) -L1 /3 width=3 by ldrop_drop_lt, ex2_intro/
- ]
-]
-qed-.
-
-(* Note: the constant 0 cannot be generalized *)
-lemma lsuba_ldrop_O1_trans: ∀G,L1,L2. G ⊢ L1 ⁝⫃ L2 → ∀K2,s,e. ⇩[s, 0, e] L2 ≡ K2 →
- ∃∃K1. G ⊢ K1 ⁝⫃ K2 & ⇩[s, 0, e] L1 ≡ K1.
-#G #L1 #L2 #H elim H -L1 -L2
-[ /2 width=3/
-| #I #L1 #L2 #V #_ #IHL12 #K2 #s #e #H
- elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK2
- [ destruct
- elim (IHL12 L2 s 0) -IHL12 // #X #HL12 #H
- <(ldrop_inv_O2 … H) in HL12; -H /3 width=3 by lsuba_pair, ldrop_pair, ex2_intro/
- | elim (IHL12 … HLK2) -L2 /3 width=3 by ldrop_drop_lt, ex2_intro/
- ]
-| #L1 #L2 #W #V #A #HV #HW #_ #IHL12 #K2 #s #e #H
- elim (ldrop_inv_O1_pair1 … H) -H * #He #HLK2
- [ destruct
- elim (IHL12 L2 s 0) -IHL12 // #X #HL12 #H
- <(ldrop_inv_O2 … H) in HL12; -H /3 width=3 by lsuba_abbr, ldrop_pair, ex2_intro/
- | elim (IHL12 … HLK2) -L2 /3 width=3 by ldrop_drop_lt, ex2_intro/
- ]
-]
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/notation/relations/statictype_6.ma".
-include "basic_2/static/da.ma".
-
-(* STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS ******************************)
-
-(* activate genv *)
-inductive ssta (h) (g): relation4 genv lenv term term ≝
-| ssta_sort: ∀G,L,k. ssta h g G L (⋆k) (⋆(next h k))
-| ssta_ldef: ∀G,L,K,V,U,W,i. ⇩[i] L ≡ K.ⓓV → ssta h g G K V W →
- ⇧[0, i + 1] W ≡ U → ssta h g G L (#i) U
-| ssta_ldec: ∀G,L,K,W,U,l,i. ⇩[i] L ≡ K.ⓛW → ⦃G, K⦄ ⊢ W ▪[h, g] l →
- ⇧[0, i + 1] W ≡ U → ssta h g G L (#i) U
-| ssta_bind: ∀a,I,G,L,V,T,U. ssta h g G (L.ⓑ{I}V) T U →
- ssta h g G L (ⓑ{a,I}V.T) (ⓑ{a,I}V.U)
-| ssta_appl: ∀G,L,V,T,U. ssta h g G L T U → ssta h g G L (ⓐV.T) (ⓐV.U)
-| ssta_cast: ∀G,L,W,T,U. ssta h g G L T U → ssta h g G L (ⓝW.T) U
-.
-
-interpretation "stratified static type assignment (term)"
- 'StaticType h g G L T U = (ssta h g G L T U).
-
-(* Basic inversion lemmas ************************************************)
-
-fact ssta_inv_sort1_aux: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U → ∀k0. T = ⋆k0 →
- U = ⋆(next h k0).
-#h #g #G #L #T #U * -G -L -T -U
-[ #G #L #k #k0 #H destruct //
-| #G #L #K #V #U #W #i #_ #_ #_ #k0 #H destruct
-| #G #L #K #W #U #l #i #_ #_ #_ #k0 #H destruct
-| #a #I #G #L #V #T #U #_ #k0 #H destruct
-| #G #L #V #T #U #_ #k0 #H destruct
-| #G #L #W #T #U #_ #k0 #H destruct
-]
-qed-.
-
-lemma ssta_inv_sort1: ∀h,g,G,L,U,k. ⦃G, L⦄ ⊢ ⋆k •[h, g] U → U = ⋆(next h k).
-/2 width=6 by ssta_inv_sort1_aux/ qed-.
-
-fact ssta_inv_lref1_aux: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U → ∀j. T = #j →
- (∃∃K,V,W. ⇩[j] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •[h, g] W &
- ⇧[0, j + 1] W ≡ U
- ) ∨
- (∃∃K,W,l. ⇩[j] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W ▪[h, g] l &
- ⇧[0, j + 1] W ≡ U
- ).
-#h #g #G #L #T #U * -G -L -T -U
-[ #G #L #k #j #H destruct
-| #G #L #K #V #U #W #i #HLK #HVW #HWU #j #H destruct /3 width=6 by ex3_3_intro, or_introl/
-| #G #L #K #W #U #l #i #HLK #HWl #HWU #j #H destruct /3 width=6 by ex3_3_intro, or_intror/
-| #a #I #G #L #V #T #U #_ #j #H destruct
-| #G #L #V #T #U #_ #j #H destruct
-| #G #L #W #T #U #_ #j #H destruct
-]
-qed-.
-
-lemma ssta_inv_lref1: ∀h,g,G,L,U,i. ⦃G, L⦄ ⊢ #i •[h, g] U →
- (∃∃K,V,W. ⇩[i] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •[h, g] W &
- ⇧[0, i + 1] W ≡ U
- ) ∨
- (∃∃K,W,l. ⇩[i] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W ▪[h, g] l &
- ⇧[0, i + 1] W ≡ U
- ).
-/2 width=3 by ssta_inv_lref1_aux/ qed-.
-
-fact ssta_inv_gref1_aux: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U → ∀p0. T = §p0 → ⊥.
-#h #g #G #L #T #U * -G -L -T -U
-[ #G #L #k #p0 #H destruct
-| #G #L #K #V #U #W #i #_ #_ #_ #p0 #H destruct
-| #G #L #K #W #U #l #i #_ #_ #_ #p0 #H destruct
-| #a #I #G #L #V #T #U #_ #p0 #H destruct
-| #G #L #V #T #U #_ #p0 #H destruct
-| #G #L #W #T #U #_ #p0 #H destruct
-]
-qed-.
-
-lemma ssta_inv_gref1: ∀h,g,G,L,U,p. ⦃G, L⦄ ⊢ §p •[h, g] U → ⊥.
-/2 width=9 by ssta_inv_gref1_aux/ qed-.
-
-fact ssta_inv_bind1_aux: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U →
- ∀b,J,X,Y. T = ⓑ{b,J}Y.X →
- ∃∃Z. ⦃G, L.ⓑ{J}Y⦄ ⊢ X •[h, g] Z & U = ⓑ{b,J}Y.Z.
-#h #g #G #L #T #U * -G -L -T -U
-[ #G #L #k #b #J #X #Y #H destruct
-| #G #L #K #V #U #W #i #_ #_ #_ #b #J #X #Y #H destruct
-| #G #L #K #W #U #l #i #_ #_ #_ #b #J #X #Y #H destruct
-| #a #I #G #L #V #T #U #HTU #b #J #X #Y #H destruct /2 width=3 by ex2_intro/
-| #G #L #V #T #U #_ #b #J #X #Y #H destruct
-| #G #L #W #T #U #_ #b #J #X #Y #H destruct
-]
-qed-.
-
-lemma ssta_inv_bind1: ∀h,g,b,J,G,L,Y,X,U. ⦃G, L⦄ ⊢ ⓑ{b,J}Y.X •[h, g] U →
- ∃∃Z. ⦃G, L.ⓑ{J}Y⦄ ⊢ X •[h, g] Z & U = ⓑ{b,J}Y.Z.
-/2 width=3 by ssta_inv_bind1_aux/ qed-.
-
-fact ssta_inv_appl1_aux: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U → ∀X,Y. T = ⓐY.X →
- ∃∃Z. ⦃G, L⦄ ⊢ X •[h, g] Z & U = ⓐY.Z.
-#h #g #G #L #T #U * -G -L -T -U
-[ #G #L #k #X #Y #H destruct
-| #G #L #K #V #U #W #i #_ #_ #_ #X #Y #H destruct
-| #G #L #K #W #U #l #i #_ #_ #_ #X #Y #H destruct
-| #a #I #G #L #V #T #U #_ #X #Y #H destruct
-| #G #L #V #T #U #HTU #X #Y #H destruct /2 width=3 by ex2_intro/
-| #G #L #W #T #U #_ #X #Y #H destruct
-]
-qed-.
-
-lemma ssta_inv_appl1: ∀h,g,G,L,Y,X,U. ⦃G, L⦄ ⊢ ⓐY.X •[h, g] U →
- ∃∃Z. ⦃G, L⦄ ⊢ X •[h, g] Z & U = ⓐY.Z.
-/2 width=3 by ssta_inv_appl1_aux/ qed-.
-
-fact ssta_inv_cast1_aux: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U → ∀X,Y. T = ⓝY.X →
- ⦃G, L⦄ ⊢ X •[h, g] U.
-#h #g #G #L #T #U * -G -L -T -U
-[ #G #L #k #X #Y #H destruct
-| #G #L #K #V #U #W #i #_ #_ #_ #X #Y #H destruct
-| #G #L #K #W #U #l #i #_ #_ #_ #X #Y #H destruct
-| #a #I #G #L #V #T #U #_ #X #Y #H destruct
-| #G #L #V #T #U #_ #X #Y #H destruct
-| #G #L #W #T #U #HTU #X #Y #H destruct //
-]
-qed-.
-
-lemma ssta_inv_cast1: ∀h,g,G,L,X,Y,U. ⦃G, L⦄ ⊢ ⓝY.X •[h, g] U → ⦃G, L⦄ ⊢ X •[h, g] U.
-/2 width=4 by ssta_inv_cast1_aux/ qed-.
-
-(* Inversion lemmas on degree assignment for terms **************************)
-
-lemma ssta_inv_da: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U →
- ∃l. ⦃G, L⦄ ⊢ T ▪[h, g] l.
-#h #g #G #L #T #U #H elim H -G -L -T -U
-[ #G #L #k elim (deg_total h g k) /3 width=2 by da_sort, ex_intro/
-| #G #L #K #V #U #W #i #HLK #_ #_ * /3 width=5 by da_ldef, ex_intro/
-| #G #L #K #W #U #l #i #HLK #HWl #_ /3 width=5 by da_ldec, ex_intro/
-| #a #I #G #L #V #T #U #_ * /3 width=2 by da_bind, ex_intro/
-| #G #L #V #T #U #_ * /3 width=2 by da_flat, ex_intro/
-| #G #L #W #T #U #_ * /3 width=2 by da_flat, ex_intro/
-]
-qed-.
-
-(* Properties on degree assignment for terms ********************************)
-
-lemma da_ssta: ∀h,g,G,L,T,l. ⦃G, L⦄ ⊢ T ▪[h, g] l →
- ∃U. ⦃G, L⦄ ⊢ T •[h, g] U.
-#h #g #G #L #T #l #H elim H -G -L -T -l
-[ /2 width=2/
-| #G #L #K #V #i #l #HLK #_ * #W #HVW
- elim (lift_total W 0 (i+1)) /3 width=7 by ssta_ldef, ex_intro/
-| #G #L #K #W #i #l #HLK #HW #_
- elim (lift_total W 0 (i+1)) /3 width=7 by ssta_ldec, ex_intro/
-| #a #I #G #L #V #T #l #_ * /3 width=2 by ssta_bind, ex_intro/
-| * #G #L #V #T #l #_ * /3 width=2 by ssta_appl, ssta_cast, ex_intro/
-]
-qed-.
-
-(* Basic_1: removed theorems 7:
- sty0_gen_sort sty0_gen_lref sty0_gen_bind sty0_gen_appl sty0_gen_cast
- sty0_lift sty0_correct
-*)
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/static/da_lift.ma".
-include "basic_2/static/ssta.ma".
-
-(* STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS ******************************)
-
-(* Properties on relocation *************************************************)
-
-lemma ssta_lift: ∀h,g,G. l_liftable (ssta h g G).
-#h #g #G #L1 #T1 #U1 #H elim H -G -L1 -T1 -U1
-[ #G #L1 #k #L2 #s #d #e #HL21 #X1 #H1 #X2 #H2
- >(lift_inv_sort1 … H1) -X1
- >(lift_inv_sort1 … H2) -X2 //
-| #G #L1 #K1 #V1 #U1 #W1 #i #HLK1 #_ #HWU1 #IHVW1 #L2 #s #d #e #HL21 #X #H #U2 #HU12
- elim (lift_inv_lref1 … H) * #Hid #H destruct
- [ elim (lift_trans_ge … HWU1 … HU12) -U1 // #W2 #HW12 #HWU2
- elim (ldrop_trans_le … HL21 … HLK1) -L1 /2 width=2 by lt_to_le/ #X #HLK2 #H
- elim (ldrop_inv_skip2 … H) -H /2 width=1 by lt_plus_to_minus_r/ -Hid #K2 #V2 #HK21 #HV12 #H destruct
- /3 width=9 by ssta_ldef/
- | lapply (lift_trans_be … HWU1 … HU12 ? ?) -U1 /2 width=1 by le_S/ #HW1U2
- lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 // -Hid
- /3 width=9 by ssta_ldef, ldrop_inv_gen/
- ]
-| #G #L1 #K1 #W1 #U1 #l #i #HLK1 #HW1l #HWU1 #L2 #s #d #e #HL21 #X #H #U2 #HU12
- elim (lift_inv_lref1 … H) * #Hid #H destruct
- [ elim (lift_trans_ge … HWU1 … HU12) -U1 // <minus_plus #W2 #HW12 #HWU2
- elim (ldrop_trans_le … HL21 … HLK1) -L1 /2 width=2 by lt_to_le/ #X #HLK2 #H
- elim (ldrop_inv_skip2 … H) -H /2 width=1 by lt_plus_to_minus_r/ -Hid #K2 #W #HK21 #HW1 #H destruct
- lapply (lift_mono … HW1 … HW12) -HW1 #H destruct
- /3 width=11 by da_lift, ssta_ldec/
- | lapply (lift_trans_be … HWU1 … HU12 ? ?) -U1 /2 width=1 by le_S/ #HW1U2
- lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 // -Hid
- /3 width=8 by ssta_ldec, ldrop_inv_gen/
- ]
-| #a #I #G #L1 #V1 #T1 #U1 #_ #IHTU1 #L2 #s #d #e #HL21 #X1 #H1 #X2 #H2
- elim (lift_inv_bind1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H destruct
- elim (lift_inv_bind1 … H2) -H2 #X #U2 #H1 #HU12 #H2 destruct
- lapply (lift_mono … H1 … HV12) -H1 #H destruct /4 width=6 by ssta_bind, ldrop_skip/
-| #G #L1 #V1 #T1 #U1 #_ #IHTU1 #L2 #s #d #e #HL21 #X1 #H1 #X2 #H2
- elim (lift_inv_flat1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H destruct
- elim (lift_inv_flat1 … H2) -H2 #X #U2 #H1 #HU12 #H2 destruct
- lapply (lift_mono … H1 … HV12) -H1 #H destruct /4 width=6 by ssta_appl/
-| #G #L1 #W1 #T1 #U1 #_ #IHTU1 #L2 #s #d #e #HL21 #X #H #U2 #HU12
- elim (lift_inv_flat1 … H) -H #W2 #T2 #_ #HT12 #H destruct /3 width=6 by ssta_cast/
-]
-qed.
-
-(* Inversion lemmas on relocation *******************************************)
-
-lemma ssta_inv_lift1: ∀h,g,G. l_deliftable_sn (ssta h g G).
-#h #g #G #L2 #T2 #U2 #H elim H -G -L2 -T2 -U2
-[ #G #L2 #k #L1 #s #d #e #_ #X #H
- >(lift_inv_sort2 … H) -X /2 width=3 by ssta_sort, lift_sort, ex2_intro/
-| #G #L2 #K2 #V2 #U2 #W2 #i #HLK2 #HVW2 #HWU2 #IHVW2 #L1 #s #d #e #HL21 #X #H
- elim (lift_inv_lref2 … H) * #Hid #H destruct [ -HVW2 | -IHVW2 ]
- [ elim (ldrop_conf_lt … HL21 … HLK2) -L2 // #K1 #V1 #HLK1 #HK21 #HV12
- elim (IHVW2 … HK21 … HV12) -K2 -V2 #W1 #HW12 #HVW1
- elim (lift_trans_le … HW12 … HWU2) -W2 // >minus_plus <plus_minus_m_m
- /3 width=8 by ssta_ldef, ex2_intro/
- | lapply (ldrop_conf_ge … HL21 … HLK2 ?) -L2 // #HL1K2
- elim (le_inv_plus_l … Hid) -Hid #Hdie #ei
- elim (lift_split … HWU2 d (i-e+1)) -HWU2 // [3: /2 width=1 by le_S/ ]
- [ #W0 #HW20 <le_plus_minus_comm // >minus_minus_m_m
- /3 width=8 by ssta_ldef, le_S, ex2_intro/
- | <le_plus_minus_comm //
- ]
- ]
-| #G #L2 #K2 #W2 #U2 #l #i #HLK2 #HW2l #HWU2 #L1 #s #d #e #HL21 #X #H
- elim (lift_inv_lref2 … H) * #Hid #H destruct
- [ elim (ldrop_conf_lt … HL21 … HLK2) -L2 // #K1 #W1 #HLK1 #HK21 #HW12
- lapply (da_inv_lift … HW2l … HK21 … HW12) -K2
- elim (lift_trans_le … HW12 … HWU2) -W2 // >minus_plus <plus_minus_m_m
- /3 width=8 by ssta_ldec, ex2_intro/
- | lapply (ldrop_conf_ge … HL21 … HLK2 ?) -L2 // #HL1K2
- elim (le_inv_plus_l … Hid) -Hid #Hdie #ei
- elim (lift_split … HWU2 d (i-e+1)) -HWU2 // [3: /2 width=1 by le_S/ ]
- [ #W0 #HW20 <le_plus_minus_comm // >minus_minus_m_m
- /3 width=8 by ssta_ldec, le_S, ex2_intro/
- | <le_plus_minus_comm //
- ]
- ]
-| #a #I #G #L2 #V2 #T2 #U2 #_ #IHTU2 #L1 #s #d #e #HL21 #X #H
- elim (lift_inv_bind2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
- elim (IHTU2 (L1.ⓑ{I}V1) … HT12) -IHTU2 -HT12
- /3 width=5 by ssta_bind, ldrop_skip, lift_bind, ex2_intro/
-| #G #L2 #V2 #T2 #U2 #_ #IHTU2 #L1 #s #d #e #HL21 #X #H
- elim (lift_inv_flat2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
- elim (IHTU2 … HL21 … HT12) -L2 -HT12
- /3 width=5 by ssta_appl, lift_flat, ex2_intro/
-| #G #L2 #W2 #T2 #U2 #_ #IHTU2 #L1 #s #d #e #HL21 #X #H
- elim (lift_inv_flat2 … H) -H #W1 #T1 #_ #HT12 #H destruct
- elim (IHTU2 … HL21 … HT12) -L2 -HT12
- /3 width=3 by ssta_cast, ex2_intro/
-]
-qed-.
-
-(* Advanced properties ******************************************************)
-
-lemma ssta_da_conf: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U →
- ∀l. ⦃G, L⦄ ⊢ T ▪[h, g] l → ⦃G, L⦄ ⊢ U ▪[h, g] l-1.
-#h #g #G #L #T #U #H elim H -G -L -T -U
-[ #G #L #k #l #H
- lapply (da_inv_sort … H) -H /3 width=1 by da_sort, deg_next/
-| #G #L #K #V #U #W #i #HLK #_ #HWU #IHVW #l #H
- elim (da_inv_lref … H) -H * #K0 #V0 [| #l0] #HLK0 #HV0
- lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct
- lapply (ldrop_fwd_drop2 … HLK) -HLK /3 width=8 by da_lift/
-| #G #L #K #W #U #l0 #i #HLK #_ #HWU #l #H -l0
- elim (da_inv_lref … H) -H * #K0 #V0 [| #l1] #HLK0 #HV0 [| #H0 ]
- lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct
- lapply (ldrop_fwd_drop2 … HLK) -HLK /3 width=8 by da_lift/
-| #a #I #G #L #V #T #U #_ #IHTU #l #H
- lapply (da_inv_bind … H) -H /3 width=1 by da_bind/
-| #G #L #V #T #U #_ #IHTU #l #H
- lapply (da_inv_flat … H) -H /3 width=1 by da_flat/
-| #G #L #W #T #U #_ #IHTU #l #H
- lapply (da_inv_flat … H) -H /2 width=1 by /
-]
-qed-.
-
-(* Advanced forvard lemmas **************************************************)
-
-lemma ssta_fwd_correct: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U →
- ∃T0. ⦃G, L⦄ ⊢ U •[h, g] T0.
-#h #g #G #L #T #U #H elim H -G -L -T -U
-[ /2 width=2/
-| #G #L #K #V #U #W #i #HLK #_ #HWU * #T #HWT
- lapply (ldrop_fwd_drop2 … HLK) -HLK #HLK
- elim (lift_total T 0 (i+1)) /3 width=11 by ssta_lift, ex_intro/
-| #G #L #K #W #U #l #i #HLK #HWl #HWU
- elim (da_ssta … HWl) -HWl #T #HWT
- lapply (ldrop_fwd_drop2 … HLK) -HLK #HLK
- elim (lift_total T 0 (i+1)) /3 width=11 by ssta_lift, ex_intro/
-| #a #I #G #L #V #T #U #_ * /3 width=2 by ssta_bind, ex_intro/
-| #G #L #V #T #U #_ * #T0 #HUT0 /3 width=2 by ssta_appl, ex_intro/
-| #G #L #W #T #U #_ * /2 width=2 by ex_intro/
-]
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/multiple/llpx_sn_ldrop.ma".
-include "basic_2/static/ssta.ma".
-
-(* STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS ******************************)
-
-(* Properties on lazy sn pointwise extensions *******************************)
-
-lemma ssta_llpx_sn_conf: ∀R. (∀L. reflexive … (R L)) → l_liftable R →
- ∀h,g,G. s_r_confluent1 … (ssta h g G) (llpx_sn R 0).
-#R #H1R #H2R #h #g #G #Ls #T1 #T2 #H elim H -G -Ls -T1 -T2
-[ /3 width=4 by llpx_sn_fwd_length, llpx_sn_sort/
-| #G #Ls #Ks #V1s #W2s #V2s #i #HLKs #_ #HVW2s #IHV12s #Ld #H elim (llpx_sn_inv_lref_ge_sn … H … HLKs) // -H
- #Kd #V1d #HLKd #HV1s #HV1sd
- lapply (ldrop_fwd_drop2 … HLKs) -HLKs #HLKs
- lapply (ldrop_fwd_drop2 … HLKd) -HLKd #HLKd
- @(llpx_sn_lift_le … HLKs HLKd … HVW2s) -HLKs -HLKd -HVW2s /2 width=1 by/ (**) (* full auto too slow *)
-| #G #Ls #Ks #V1s #W1s #l #i #HLKs #Hl #HVW1s #Ld #H elim (llpx_sn_inv_lref_ge_sn … H … HLKs) // -H
- #Kd #V1d #HLKd #HV1s #HV1sd
- lapply (ldrop_fwd_drop2 … HLKs) -HLKs #HLKs
- lapply (ldrop_fwd_drop2 … HLKd) -HLKd #HLKd
- @(llpx_sn_lift_le … HLKs HLKd … HVW1s) -HLKs -HLKd -HVW1s /2 width=1 by/ (**) (* full auto too slow *)
-| #a #I #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_bind_O … H) -H
- /4 width=5 by llpx_sn_bind_repl_SO, llpx_sn_bind/
-| #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H
- /3 width=1 by llpx_sn_flat/
-| #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H
- /3 width=1 by llpx_sn_flat/
-]
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/static/da_da.ma".
-include "basic_2/static/ssta_lift.ma".
-
-(* STRATIFIED STATIC TYPE ASSIGNMENT ON TERMS *******************************)
-
-(* Advanced inversion lemmas ************************************************)
-
-lemma ssta_inv_refl_pos: ∀h,g,G,L,T,l. ⦃G, L⦄ ⊢ T ▪[h, g] l+1 → ⦃G, L⦄ ⊢ T •[h, g] T → ⊥.
-#h #g #G #L #T #l #H1T #HTT
-lapply (ssta_da_conf … HTT … H1T) -HTT <minus_plus_m_m #H2T
-lapply (da_mono … H2T … H1T) -h -G -L -T #H
-elim (plus_xySz_x_false 0 l 0) //
-qed-.
-
-(* Main properties **********************************************************)
-
-theorem ssta_mono: ∀h,g,G,L. singlevalued … (ssta h g G L).
-#h #g #G #L #T #U1 #H elim H -G -L -T -U1
-[ #G #L #k #X #H >(ssta_inv_sort1 … H) -X //
-| #G #L #K #V #U1 #W #i #HLK #_ #HWU1 #IHVW #U2 #H
- elim (ssta_inv_lref1 … H) -H * #K0 #V0 #W0 #HLK0 #HVW0 #HW0U2
- lapply (ldrop_mono … HLK0 … HLK) -HLK -HLK0 #H destruct
- lapply (IHVW … HVW0) -IHVW -HVW0 #H destruct
- >(lift_mono … HWU1 … HW0U2) -W0 -U1 //
-| #G #L #K #W #U1 #l #i #HLK #HWl #HWU1 #U2 #H
- elim (ssta_inv_lref1 … H) -H * #K0 #W0 #l0 #HLK0 #HWl0 #HW0U2
- lapply (ldrop_mono … HLK0 … HLK) -HLK -HLK0 #H destruct
- lapply (da_mono … HWl0 … HWl) -HWl0 #H destruct
- >(lift_mono … HWU1 … HW0U2) -W -U1 //
-| #a #I #G #L #V #T #U1 #_ #IHTU1 #X #H
- elim (ssta_inv_bind1 … H) -H #U2 #HTU2 #H destruct /3 width=1/
-| #G #L #V #T #U1 #_ #IHTU1 #X #H
- elim (ssta_inv_appl1 … H) -H #U2 #HTU2 #H destruct /3 width=1/
-| #G #L #W #T #U1 #_ #IHTU1 #U2 #H
- lapply (ssta_inv_cast1 … H) -H /2 width=1/
-]
-qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/notation/relations/statictype_5.ma".
+include "basic_2/grammar/genv.ma".
+include "basic_2/substitution/ldrop.ma".
+include "basic_2/static/sh.ma".
+
+(* STATIC TYPE ASSIGNMENT ON TERMS ******************************************)
+
+(* activate genv *)
+inductive sta (h:sh): relation4 genv lenv term term ≝
+| sta_sort: ∀G,L,k. sta h G L (⋆k) (⋆(next h k))
+| sta_ldef: ∀G,L,K,V,W,U,i. ⇩[i] L ≡ K.ⓓV → sta h G K V W →
+ ⇧[0, i + 1] W ≡ U → sta h G L (#i) U
+| sta_ldec: ∀G,L,K,W,V,U,i. ⇩[i] L ≡ K.ⓛW → sta h G K W V →
+ ⇧[0, i + 1] W ≡ U → sta h G L (#i) U
+| sta_bind: ∀a,I,G,L,V,T,U. sta h G (L.ⓑ{I}V) T U →
+ sta h G L (ⓑ{a,I}V.T) (ⓑ{a,I}V.U)
+| sta_appl: ∀G,L,V,T,U. sta h G L T U → sta h G L (ⓐV.T) (ⓐV.U)
+| sta_cast: ∀G,L,W,T,U. sta h G L T U → sta h G L (ⓝW.T) U
+.
+
+interpretation "static type assignment (term)"
+ 'StaticType h G L T U = (sta h G L T U).
+
+(* Basic inversion lemmas ************************************************)
+
+fact sta_inv_sort1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀k0. T = ⋆k0 →
+ U = ⋆(next h k0).
+#h #G #L #T #U * -G -L -T -U
+[ #G #L #k #k0 #H destruct //
+| #G #L #K #V #W #U #i #_ #_ #_ #k0 #H destruct
+| #G #L #K #W #V #U #i #_ #_ #_ #k0 #H destruct
+| #a #I #G #L #V #T #U #_ #k0 #H destruct
+| #G #L #V #T #U #_ #k0 #H destruct
+| #G #L #W #T #U #_ #k0 #H destruct
+qed-.
+
+(* Basic_1: was: sty0_gen_sort *)
+lemma sta_inv_sort1: ∀h,G,L,U,k. ⦃G, L⦄ ⊢ ⋆k •[h] U → U = ⋆(next h k).
+/2 width=5 by sta_inv_sort1_aux/ qed-.
+
+fact sta_inv_lref1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀j. T = #j →
+ (∃∃K,V,W. ⇩[j] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •[h] W &
+ ⇧[0, j+1] W ≡ U
+ ) ∨
+ (∃∃K,W,V. ⇩[j] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W •[h] V &
+ ⇧[0, j+1] W ≡ U
+ ).
+#h #G #L #T #U * -G -L -T -U
+[ #G #L #k #j #H destruct
+| #G #L #K #V #W #U #i #HLK #HVW #HWU #j #H destruct /3 width=6 by or_introl, ex3_3_intro/
+| #G #L #K #W #V #U #i #HLK #HWV #HWU #j #H destruct /3 width=6 by or_intror, ex3_3_intro/
+| #a #I #G #L #V #T #U #_ #j #H destruct
+| #G #L #V #T #U #_ #j #H destruct
+| #G #L #W #T #U #_ #j #H destruct
+]
+qed-.
+
+(* Basic_1: was sty0_gen_lref *)
+lemma sta_inv_lref1: ∀h,G,L,U,i. ⦃G, L⦄ ⊢ #i •[h] U →
+ (∃∃K,V,W. ⇩[i] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •[h] W &
+ ⇧[0, i+1] W ≡ U
+ ) ∨
+ (∃∃K,W,V. ⇩[i] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W •[h] V &
+ ⇧[0, i+1] W ≡ U
+ ).
+/2 width=3 by sta_inv_lref1_aux/ qed-.
+
+fact sta_inv_gref1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀p0. T = §p0 → ⊥.
+#h #G #L #T #U * -G -L -T -U
+[ #G #L #k #p0 #H destruct
+| #G #L #K #V #W #U #i #_ #_ #_ #p0 #H destruct
+| #G #L #K #W #V #U #i #_ #_ #_ #p0 #H destruct
+| #a #I #G #L #V #T #U #_ #p0 #H destruct
+| #G #L #V #T #U #_ #p0 #H destruct
+| #G #L #W #T #U #_ #p0 #H destruct
+qed-.
+
+lemma sta_inv_gref1: ∀h,G,L,U,p. ⦃G, L⦄ ⊢ §p •[h] U → ⊥.
+/2 width=8 by sta_inv_gref1_aux/ qed-.
+
+fact sta_inv_bind1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀b,J,X,Y. T = ⓑ{b,J}Y.X →
+ ∃∃Z. ⦃G, L.ⓑ{J}Y⦄ ⊢ X •[h] Z & U = ⓑ{b,J}Y.Z.
+#h #G #L #T #U * -G -L -T -U
+[ #G #L #k #b #J #X #Y #H destruct
+| #G #L #K #V #W #U #i #_ #_ #_ #b #J #X #Y #H destruct
+| #G #L #K #W #V #U #i #_ #_ #_ #b #J #X #Y #H destruct
+| #a #I #G #L #V #T #U #HTU #b #J #X #Y #H destruct /2 width=3 by ex2_intro/
+| #G #L #V #T #U #_ #b #J #X #Y #H destruct
+| #G #L #W #T #U #_ #b #J #X #Y #H destruct
+]
+qed-.
+
+(* Basic_1: was: sty0_gen_bind *)
+lemma sta_inv_bind1: ∀h,b,J,G,L,Y,X,U. ⦃G, L⦄ ⊢ ⓑ{b,J}Y.X •[h] U →
+ ∃∃Z. ⦃G, L.ⓑ{J}Y⦄ ⊢ X •[h] Z & U = ⓑ{b,J}Y.Z.
+/2 width=3 by sta_inv_bind1_aux/ qed-.
+
+fact sta_inv_appl1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀X,Y. T = ⓐY.X →
+ ∃∃Z. ⦃G, L⦄ ⊢ X •[h] Z & U = ⓐY.Z.
+#h #G #L #T #U * -G -L -T -U
+[ #G #L #k #X #Y #H destruct
+| #G #L #K #V #W #U #i #_ #_ #_ #X #Y #H destruct
+| #G #L #K #W #V #U #i #_ #_ #_ #X #Y #H destruct
+| #a #I #G #L #V #T #U #_ #X #Y #H destruct
+| #G #L #V #T #U #HTU #X #Y #H destruct /2 width=3 by ex2_intro/
+| #G #L #W #T #U #_ #X #Y #H destruct
+]
+qed-.
+
+(* Basic_1: was: sty0_gen_appl *)
+lemma sta_inv_appl1: ∀h,G,L,Y,X,U. ⦃G, L⦄ ⊢ ⓐY.X •[h] U →
+ ∃∃Z. ⦃G, L⦄ ⊢ X •[h] Z & U = ⓐY.Z.
+/2 width=3 by sta_inv_appl1_aux/ qed-.
+
+fact sta_inv_cast1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀X,Y. T = ⓝY.X →
+ ⦃G, L⦄ ⊢ X •[h] U.
+#h #G #L #T #U * -G -L -T -U
+[ #G #L #k #X #Y #H destruct
+| #G #L #K #V #W #U #i #_ #_ #_ #X #Y #H destruct
+| #G #L #K #W #V #U #i #_ #_ #_ #X #Y #H destruct
+| #a #I #G #L #V #T #U #_ #X #Y #H destruct
+| #G #L #V #T #U #_ #X #Y #H destruct
+| #G #L #W #T #U #HTU #X #Y #H destruct //
+]
+qed-.
+
+(* Basic_1: was: sty0_gen_cast *)
+lemma sta_inv_cast1: ∀h,G,L,X,Y,U. ⦃G, L⦄ ⊢ ⓝY.X •[h] U → ⦃G, L⦄ ⊢ X •[h] U.
+/2 width=4 by sta_inv_cast1_aux/ qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/sta.ma".
+include "basic_2/static/aaa_lift.ma".
+
+(* STATIC TYPE ASSIGNMENT FOR TERMS *****************************************)
+
+(* Properties on atomic arity assignment for terms **************************)
+
+lemma aaa_sta: ∀h,G,L,T,A. ⦃G, L⦄ ⊢ T ⁝ A → ∃U. ⦃G, L⦄ ⊢ T •[h] U.
+#h #G #L #T #A #H elim H -G -L -T -A
+[ /2 width=2 by sta_sort, ex_intro/
+| * #G #L #K [ #V | #W ] #B #i #HLK #_ * [ #W | #V ] #HVW
+ elim (lift_total W 0 (i+1)) /3 width=7 by sta_ldef, sta_ldec, ex_intro/
+| #a #G #L #V #T #B #A #_ #_ #_ * /3 width=2 by sta_bind, ex_intro/
+| #a #G #L #V #T #B #A #_ #_ #_ * /3 width=2 by sta_bind, ex_intro/
+| #G #L #V #T #B #A #_ #_ #_ * /3 width=2 by sta_appl, ex_intro/
+| #G #L #W #T #A #_ #_ #_ * /3 width=2 by sta_cast, ex_intro/
+]
+qed-.
+
+lemma sta_aaa_conf: ∀h,G,L. Conf3 … (aaa G L) (sta h G L).
+#h #G #L #T #A #H elim H -G -L -T -A
+[ #G #L #k #U #H
+ lapply (sta_inv_sort1 … H) -H #H destruct //
+| #I #G #L #K #V #B #i #HLK #HV #IHV #U #H
+ elim (sta_inv_lref1 … H) -H * #K0 #V0 #W0 #HLK0 #HVW0 #HU
+ lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H0 destruct
+ lapply (ldrop_fwd_drop2 … HLK) -HLK #HLK
+ @(aaa_lift … HLK … HU) -HU -L /2 width=2 by/
+| #a #G #L #V #T #B #A #HV #_ #_ #IHT #X #H
+ elim (sta_inv_bind1 … H) -H #U #HTU #H destruct /3 width=2 by aaa_abbr/
+| #a #G #L #V #T #B #A #HV #_ #_ #IHT #X #H
+ elim (sta_inv_bind1 … H) -H #U #HTU #H destruct /3 width=2 by aaa_abst/
+| #G #L #V #T #B #A #HV #_ #_ #IHT #X #H
+ elim (sta_inv_appl1 … H) -H #U #HTU #H destruct /3 width=3 by aaa_appl/
+| #G #L #V #T #A #_ #_ #IHV #IHT #X #H
+ lapply (sta_inv_cast1 … H) -H /2 width=2 by/
+]
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/substitution/ldrop_ldrop.ma".
+include "basic_2/static/sta.ma".
+
+(* STATIC TYPE ASSIGNMENT ON TERMS ******************************************)
+
+(* Properties on relocation *************************************************)
+
+(* Basic_1: was: sty0_lift *)
+lemma sta_lift: ∀h,G. l_liftable (sta h G).
+#h #G #L1 #T1 #U1 #H elim H -G -L1 -T1 -U1
+[ #G #L1 #k #L2 #s #d #e #HL21 #X1 #H1 #X2 #H2
+ >(lift_inv_sort1 … H1) -X1
+ >(lift_inv_sort1 … H2) -X2 //
+| #G #L1 #K1 #V1 #W1 #W #i #HLK1 #_ #HW1 #IHVW1 #L2 #s #d #e #HL21 #X #H #U2 #HWU2
+ elim (lift_inv_lref1 … H) * #Hid #H destruct
+ [ elim (lift_trans_ge … HW1 … HWU2) -W // #W2 #HW12 #HWU2
+ elim (ldrop_trans_le … HL21 … HLK1) -L1 /2 width=2 by lt_to_le/ #X #HLK2 #H
+ elim (ldrop_inv_skip2 … H) -H /2 width=1 by lt_plus_to_minus_r/ -Hid #K2 #V2 #HK21 #HV12 #H destruct
+ /3 width=9 by sta_ldef/
+ | lapply (lift_trans_be … HW1 … HWU2 ? ?) -W /2 width=1 by le_S/ #HW1U2
+ lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 /3 width=9 by sta_ldef, ldrop_inv_gen/
+ ]
+| #G #L1 #K1 #W1 #V1 #W #i #HLK1 #_ #HW1 #IHWV1 #L2 #s #d #e #HL21 #X #H #U2 #HWU2
+ elim (lift_inv_lref1 … H) * #Hid #H destruct
+ [ elim (lift_trans_ge … HW1 … HWU2) -W // <minus_plus #W #HW1 #HWU2
+ elim (ldrop_trans_le … HL21 … HLK1) -L1 /2 width=2 by lt_to_le/ #X #HLK2 #H
+ elim (ldrop_inv_skip2 … H) -H /2 width=1 by lt_plus_to_minus_r/ -Hid #K2 #W2 #HK21 #HW12 #H destruct
+ lapply (lift_mono … HW1 … HW12) -HW1 #H destruct
+ elim (lift_total V1 (d-i-1) e) /3 width=9 by sta_ldec/
+ | lapply (lift_trans_be … HW1 … HWU2 ? ?) -W /2 width=1 by le_S/ #HW1U2
+ lapply (ldrop_trans_ge … HL21 … HLK1 ?) -L1 /3 width=9 by sta_ldec, ldrop_inv_gen/
+ ]
+| #a #I #G #L1 #V1 #T1 #U1 #_ #IHTU1 #L2 #s #d #e #HL21 #X1 #H1 #X2 #H2
+ elim (lift_inv_bind1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H destruct
+ elim (lift_inv_bind1 … H2) -H2 #X #U2 #H1 #HU12 #H2 destruct
+ lapply (lift_mono … H1 … HV12) -H1 #H destruct /4 width=6 by sta_bind, ldrop_skip/
+| #G #L1 #V1 #T1 #U1 #_ #IHTU1 #L2 #s #d #e #HL21 #X1 #H1 #X2 #H2
+ elim (lift_inv_flat1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H destruct
+ elim (lift_inv_flat1 … H2) -H2 #X #U2 #H1 #HU12 #H2 destruct
+ lapply (lift_mono … H1 … HV12) -H1 #H destruct /4 width=6 by sta_appl/
+| #G #L1 #W1 #T1 #U1 #_ #IHTU1 #L2 #s #d #e #HL21 #X #H #U2 #HU12
+ elim (lift_inv_flat1 … H) -H #W2 #T2 #_ #HT12 #H destruct /3 width=6 by sta_cast/
+]
+qed.
+
+(* Note: apparently this was missing in basic_1 *)
+lemma sta_inv_lift1: ∀h,G. l_deliftable_sn (sta h G).
+#h #G #L2 #T2 #U2 #H elim H -G -L2 -T2 -U2
+[ #G #L2 #k #L1 #s #d #e #_ #X #H
+ >(lift_inv_sort2 … H) -X /2 width=3 by sta_sort, lift_sort, ex2_intro/
+| #G #L2 #K2 #V2 #W2 #W #i #HLK2 #HVW2 #HW2 #IHVW2 #L1 #s #d #e #HL21 #X #H
+ elim (lift_inv_lref2 … H) * #Hid #H destruct [ -HVW2 | -IHVW2 ]
+ [ elim (ldrop_conf_lt … HL21 … HLK2) -L2 // #K1 #V1 #HLK1 #HK21 #HV12
+ elim (IHVW2 … HK21 … HV12) -K2 -V2 #W1 #HW12 #HVW1
+ elim (lift_trans_le … HW12 … HW2) -W2 // >minus_plus <plus_minus_m_m /3 width=8 by sta_ldef, ex2_intro/
+ | lapply (ldrop_conf_ge … HL21 … HLK2 ?) -L2 // #HL1K2
+ elim (le_inv_plus_l … Hid) -Hid #Hdie #ei
+ elim (lift_split … HW2 d (i-e+1)) -HW2 /2 width=1 by le_S_S, le_S/
+ #W0 #HW20 <le_plus_minus_comm // >minus_minus_m_m /3 width=8 by sta_ldef, le_S, ex2_intro/
+ ]
+| #G #L2 #K2 #W2 #V2 #W #i #HLK2 #HWV2 #HW2 #IHWV2 #L1 #s #d #e #HL21 #X #H
+ elim (lift_inv_lref2 … H) * #Hid #H destruct [ -HWV2 | -IHWV2 ]
+ [ elim (ldrop_conf_lt … HL21 … HLK2) -L2 // #K1 #W1 #HLK1 #HK21 #HW12
+ elim (IHWV2 … HK21 … HW12) -K2 #V1 #_ #HWV1
+ elim (lift_trans_le … HW12 … HW2) -W2 // >minus_plus <plus_minus_m_m /3 width=8 by sta_ldec, ex2_intro/
+ | lapply (ldrop_conf_ge … HL21 … HLK2 ?) -L2 // #HL1K2
+ elim (le_inv_plus_l … Hid) -Hid #Hdie #ei
+ elim (lift_split … HW2 d (i-e+1)) -HW2 /2 width=1 by le_S_S, le_S/
+ #W0 #HW20 <le_plus_minus_comm // >minus_minus_m_m /3 width=8 by sta_ldec, le_S, ex2_intro/
+ ]
+| #a #I #G #L2 #V2 #T2 #U2 #_ #IHTU2 #L1 #s #d #e #HL21 #X #H
+ elim (lift_inv_bind2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
+ elim (IHTU2 (L1.ⓑ{I}V1) … HT12) -IHTU2 -HT12 /3 width=5 by sta_bind, ldrop_skip, lift_bind, ex2_intro/
+| #G #L2 #V2 #T2 #U2 #_ #IHTU2 #L1 #s #d #e #HL21 #X #H
+ elim (lift_inv_flat2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
+ elim (IHTU2 … HL21 … HT12) -L2 -HT12 /3 width=5 by sta_appl, lift_flat, ex2_intro/
+| #G #L2 #W2 #T2 #U2 #_ #IHTU2 #L1 #s #d #e #HL21 #X #H
+ elim (lift_inv_flat2 … H) -H #W1 #T1 #_ #HT12 #H destruct
+ elim (IHTU2 … HL21 … HT12) -L2 -HT12 /3 width=3 by sta_cast, ex2_intro/
+]
+qed-.
+
+(* Advanced forvard lemmas **************************************************)
+
+(* Basic_1: was: sty0_correct *)
+lemma sta_fwd_correct: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∃T0. ⦃G, L⦄ ⊢ U •[h] T0.
+#h #G #L #T #U #H elim H -G -L -T -U
+[ /2 width=2/
+| #G #L #K #V #W #W0 #i #HLK #_ #HW0 * #V0 #HWV0
+ lapply (ldrop_fwd_drop2 … HLK) -HLK #HLK
+ elim (lift_total V0 0 (i+1)) /3 width=11 by ex_intro, sta_lift/
+| #G #L #K #W #V #V0 #i #HLK #HWV #HWV0 #_
+ lapply (ldrop_fwd_drop2 … HLK) -HLK #HLK
+ elim (lift_total V 0 (i+1)) /3 width=11 by ex_intro, sta_lift/
+| #a #I #G #L #V #T #U #_ * /3 width=2 by sta_bind, ex_intro/
+| #G #L #V #T #U #_ * #T0 #HUT0 /3 width=2 by sta_appl, ex_intro/
+| #G #L #W #T #U #_ * /2 width=2 by ex_intro/
+]
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/multiple/llpx_sn_ldrop.ma".
+include "basic_2/static/sta.ma".
+
+(* STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS ******************************)
+
+(* Properties on lazy sn pointwise extensions *******************************)
+
+lemma sta_llpx_sn_conf: ∀R. (∀L. reflexive … (R L)) → l_liftable R →
+ ∀h,G. s_r_confluent1 … (sta h G) (llpx_sn R 0).
+#R #H1R #H2R #h #G #Ls #T1 #T2 #H elim H -G -Ls -T1 -T2
+[ /3 width=4 by llpx_sn_fwd_length, llpx_sn_sort/
+| #G #Ls #Ks #V1s #W2s #V2s #i #HLKs #_ #HVW2s #IHV12s #Ld #H elim (llpx_sn_inv_lref_ge_sn … H … HLKs) // -H
+ #Kd #V1d #HLKd #HV1s #HV1sd
+ lapply (ldrop_fwd_drop2 … HLKs) -HLKs #HLKs
+ lapply (ldrop_fwd_drop2 … HLKd) -HLKd #HLKd
+ @(llpx_sn_lift_le … HLKs HLKd … HVW2s) -HLKs -HLKd -HVW2s /2 width=1 by/ (**) (* full auto too slow *)
+| #G #Ls #Ks #V1s #W1s #V2s #i #HLKs #_ #HV12s #IHVW1s #Ld #H elim (llpx_sn_inv_lref_ge_sn … H … HLKs) // -H
+ #Kd #V1d #HLKd #HV1s #HV1sd
+ lapply (ldrop_fwd_drop2 … HLKs) -HLKs #HLKs
+ lapply (ldrop_fwd_drop2 … HLKd) -HLKd #HLKd
+ @(llpx_sn_lift_le … HLKs HLKd … HV12s) -HLKs -HLKd -HV12s /2 width=1 by/ (**) (* full auto too slow *)
+| #a #I #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_bind_O … H) -H
+ /4 width=5 by llpx_sn_bind_repl_SO, llpx_sn_bind/
+| #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H
+ /3 width=1 by llpx_sn_flat/
+| #G #Ls #V #T1 #T2 #_ #IHT12 #Ld #H elim (llpx_sn_inv_flat … H) -H
+ /3 width=1 by llpx_sn_flat/
+]
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/substitution/ldrop_ldrop.ma".
+include "basic_2/static/sta.ma".
+
+(* STATIC TYPE ASSIGNMENT ON TERMS ******************************************)
+
+(* Main properties **********************************************************)
+
+(* Note: apparently this was missing in basic_1 *)
+theorem sta_mono: ∀h,G,L. singlevalued … (sta h G L).
+#h #G #L #T #U1 #H elim H -G -L -T -U1
+[ #G #L #k #X #H >(sta_inv_sort1 … H) -X //
+| #G #L #K #V #W #U1 #i #HLK #_ #HWU1 #IHVW #U2 #H
+ elim (sta_inv_lref1 … H) -H * #K0 #V0 #W0 #HLK0 #HVW0 #HW0U2
+ lapply (ldrop_mono … HLK0 … HLK) -HLK -HLK0 #H destruct
+ lapply (IHVW … HVW0) -IHVW -HVW0 #H destruct
+ >(lift_mono … HWU1 … HW0U2) -W0 -U1 //
+| #G #L #K #W #V #U1 #i #HLK #_ #HWU1 #IHWV #U2 #H
+ elim (sta_inv_lref1 … H) -H * #K0 #W0 #V0 #HLK0 #HWV0 #HV0U2
+ lapply (ldrop_mono … HLK0 … HLK) -HLK -HLK0 #H destruct
+ lapply (IHWV … HWV0) -IHWV -HWV0 #H destruct
+ >(lift_mono … HWU1 … HV0U2) -W -U1 //
+| #a #I #G #L #V #T #U1 #_ #IHTU1 #X #H
+ elim (sta_inv_bind1 … H) -H #U2 #HTU2 #H destruct /3 width=1 by eq_f/
+| #G #L #V #T #U1 #_ #IHTU1 #X #H
+ elim (sta_inv_appl1 … H) -H #U2 #HTU2 #H destruct /3 width=1 by eq_f/
+| #G #L #W #T #U1 #_ #IHTU1 #U2 #H
+ lapply (sta_inv_cast1 … H) -H /2 width=1 by/
+]
+qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/notation/relations/statictypestar_7.ma".
-include "basic_2/static/ssta.ma".
-
-(* NAT-ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *****************)
-
-definition lsstas: ∀h. sd h → genv → lenv → nat → relation term ≝
- λh,g,G,L. lstar … (ssta h g G L).
-
-interpretation "nat-iterated stratified static type assignment (term)"
- 'StaticTypeStar h g G L l T U = (lsstas h g G L l T U).
-
-(* Basic eliminators ********************************************************)
-
-lemma lsstas_ind_sn: ∀h,g,G,L,U2. ∀R:relation2 nat term.
- R 0 U2 → (
- ∀l,T,U1. ⦃G, L⦄ ⊢ T •[h, g] U1 → ⦃G, L⦄ ⊢ U1 •* [h, g, l] U2 →
- R l U1 → R (l+1) T
- ) →
- ∀l,T. ⦃G, L⦄ ⊢ T •*[h, g, l] U2 → R l T.
-/3 width=5 by lstar_ind_l/ qed-.
-
-lemma lsstas_ind_dx: ∀h,g,G,L,T. ∀R:relation2 nat term.
- R 0 T → (
- ∀l,U1,U2. ⦃G, L⦄ ⊢ T •* [h, g, l] U1 → ⦃G, L⦄ ⊢ U1 •[h, g] U2 →
- R l U1 → R (l+1) U2
- ) →
- ∀l,U. ⦃G, L⦄ ⊢ T •*[h, g, l] U → R l U.
-/3 width=5 by lstar_ind_r/ qed-.
-
-(* Basic inversion lemmas ***************************************************)
-
-lemma lsstas_inv_O: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •*[h, g, 0] U → T = U.
-/2 width=4 by lstar_inv_O/ qed-.
-
-lemma lsstas_inv_SO: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •*[h, g, 1] U → ⦃G, L⦄ ⊢ T •[h, g] U.
-/2 width=1 by lstar_inv_step/ qed-.
-
-lemma lsstas_inv_step_sn: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 •*[h, g, l+1] T2 →
- ∃∃T. ⦃G, L⦄ ⊢ T1 •[h, g] T & ⦃G, L⦄ ⊢ T •*[h, g, l] T2.
-/2 width=3 by lstar_inv_S/ qed-.
-
-lemma lsstas_inv_step_dx: ∀h,g,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 •*[h, g, l+1] T2 →
- ∃∃T. ⦃G, L⦄ ⊢ T1 •*[h, g, l] T & ⦃G, L⦄ ⊢ T •[h, g] T2.
-/2 width=3 by lstar_inv_S_dx/ qed-.
-
-lemma lsstas_inv_sort1: ∀h,g,G,L,X,k,l. ⦃G, L⦄ ⊢ ⋆k •*[h, g, l] X → X = ⋆((next h)^l k).
-#h #g #G #L #X #k #l #H @(lsstas_ind_dx … H) -X -l //
-#l #X #X0 #_ #H #IHX destruct
-lapply (ssta_inv_sort1 … H) -H #H destruct
->iter_SO //
-qed-.
-
-lemma lsstas_inv_gref1: ∀h,g,G,L,X,p,l. ⦃G, L⦄ ⊢ §p •*[h, g, l+1] X → ⊥.
-#h #g #G #L #X #p #l #H elim (lsstas_inv_step_sn … H) -H
-#U #H #HUX elim (ssta_inv_gref1 … H)
-qed-.
-
-lemma lsstas_inv_bind1: ∀h,g,a,I,G,L,V,T,X,l. ⦃G, L⦄ ⊢ ⓑ{a,I}V.T •*[h, g, l] X →
- ∃∃U. ⦃G, L.ⓑ{I}V⦄ ⊢ T •*[h, g, l] U & X = ⓑ{a,I}V.U.
-#h #g #a #I #G #L #V #T #X #l #H @(lsstas_ind_dx … H) -X -l [ /2 width=3/ ]
-#l #X #X0 #_ #HX0 * #U #HTU #H destruct
-elim (ssta_inv_bind1 … HX0) -HX0 #U0 #HU0 #H destruct /3 width=3/
-qed-.
-
-lemma lsstas_inv_appl1: ∀h,g,G,L,V,T,X,l. ⦃G, L⦄ ⊢ ⓐV.T •*[h, g, l] X →
- ∃∃U. ⦃G, L⦄ ⊢ T •*[h, g, l] U & X = ⓐV.U.
-#h #g #G #L #V #T #X #l #H @(lsstas_ind_dx … H) -X -l [ /2 width=3/ ]
-#l #X #X0 #_ #HX0 * #U #HTU #H destruct
-elim (ssta_inv_appl1 … HX0) -HX0 #U0 #HU0 #H destruct /3 width=3/
-qed-.
-
-lemma lsstas_inv_cast1: ∀h,g,G,L,W,T,U,l. ⦃G, L⦄ ⊢ ⓝW.T •*[h, g, l+1] U → ⦃G, L⦄ ⊢ T •*[h, g, l+1] U.
-#h #g #G #L #W #T #X #l #H elim (lsstas_inv_step_sn … H) -H
-#U #H #HUX lapply (ssta_inv_cast1 … H) -H /2 width=3/
-qed-.
-
-(* Basic properties *********************************************************)
-
-lemma lsstas_refl: ∀h,g,G,L. reflexive … (lsstas h g G L 0).
-// qed.
-
-lemma ssta_lsstas: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U → ⦃G, L⦄ ⊢ T •*[h, g, 1] U.
-/2 width=1/ qed.
-
-lemma lsstas_step_sn: ∀h,g,G,L,T1,U1,U2,l. ⦃G, L⦄ ⊢ T1 •[h, g] U1 → ⦃G, L⦄ ⊢ U1 •*[h, g, l] U2 →
- ⦃G, L⦄ ⊢ T1 •*[h, g, l+1] U2.
-/2 width=3/ qed.
-
-lemma lsstas_step_dx: ∀h,g,G,L,T1,T2,U2,l. ⦃G, L⦄ ⊢ T1 •*[h, g, l] T2 → ⦃G, L⦄ ⊢ T2 •[h, g] U2 →
- ⦃G, L⦄ ⊢ T1 •*[h, g, l+1] U2.
-/2 width=3/ qed.
-
-lemma lsstas_split: ∀h,g,G,L. inv_ltransitive … (lsstas h g G L).
-/2 width=1 by lstar_inv_ltransitive/ qed-.
-
-lemma lsstas_sort: ∀h,g,G,L,l,k. ⦃G, L⦄ ⊢ ⋆k •*[h, g, l] ⋆((next h)^l k).
-#h #g #G #L #l @(nat_ind_plus … l) -l //
-#l #IHl #k >iter_SO /2 width=3/
-qed.
-
-lemma lsstas_bind: ∀h,g,I,G,L,V,T,U,l. ⦃G, L.ⓑ{I}V⦄ ⊢ T •*[h, g, l] U →
- ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V.T •*[h, g, l] ⓑ{a,I}V.U.
-#h #g #I #G #L #V #T #U #l #H @(lsstas_ind_dx … H) -U -l // /3 width=3/
-qed.
-
-lemma lsstas_appl: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •*[h, g, l] U →
- ∀V.⦃G, L⦄ ⊢ ⓐV.T •*[h, g, l] ⓐV.U.
-#h #g #G #L #T #U #l #H @(lsstas_ind_dx … H) -U -l // /3 width=3/
-qed.
-
-lemma lsstas_cast: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •*[h, g, l+1] U →
- ∀W. ⦃G, L⦄ ⊢ ⓝW.T •*[h, g, l+1] U.
-#h #g #G #L #T #U #l #H elim (lsstas_inv_step_sn … H) -H /3 width=3/
-qed.
-
-(* Basic_1: removed theorems 7:
- sty1_abbr sty1_appl sty1_bind sty1_cast2
- sty1_correct sty1_lift sty1_trans
-*)
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/static/aaa_ssta.ma".
-include "basic_2/unfold/lsstas.ma".
-
-(* NAT-ITERATED STATIC TYPE ASSIGNMENT FOR TERMS ****************************)
-
-(* Properties on atomic arity assignment for terms **************************)
-
-lemma aaa_lsstas_conf: ∀h,g,G,L,l. Conf3 … (aaa G L) (lsstas h g G L l).
-/3 width=6 by aaa_ssta_conf, lstar_Conf3/ qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/notation/relations/statictypestaralt_7.ma".
-include "basic_2/unfold/lsstas_lift.ma".
-
-(* NAT-ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *****************)
-
-(* alternative definition of lsstas *)
-inductive lsstasa (h) (g): genv → relation4 lenv nat term term ≝
-| lsstasa_O : ∀G,L,T. lsstasa h g G L 0 T T
-| lsstasa_sort: ∀G,L,l,k. lsstasa h g G L l (⋆k) (⋆((next h)^l k))
-| lsstasa_ldef: ∀G,L,K,V,W,U,i,l. ⇩[i] L ≡ K.ⓓV → lsstasa h g G K (l+1) V W →
- ⇧[0, i+1] W ≡ U → lsstasa h g G L (l+1) (#i) U
-| lsstasa_ldec: ∀G,L,K,W,V,U,i,l,l0. ⇩[i] L ≡ K.ⓛW → ⦃G, K⦄ ⊢ W ▪[h, g] l0 →
- lsstasa h g G K l W V → ⇧[0, i+1] V ≡ U → lsstasa h g G L (l+1) (#i) U
-| lsstasa_bind: ∀a,I,G,L,V,T,U,l. lsstasa h g G (L.ⓑ{I}V) l T U →
- lsstasa h g G L l (ⓑ{a,I}V.T) (ⓑ{a,I}V.U)
-| lsstasa_appl: ∀G,L,V,T,U,l. lsstasa h g G L l T U → lsstasa h g G L l (ⓐV.T) (ⓐV.U)
-| lsstasa_cast: ∀G,L,W,T,U,l. lsstasa h g G L (l+1) T U → lsstasa h g G L (l+1) (ⓝW.T) U
-.
-
-interpretation "nat-iterated stratified static type assignment (term) alternative"
- 'StaticTypeStarAlt h g G L l T U = (lsstasa h g G L l T U).
-
-(* Base properties **********************************************************)
-
-lemma ssta_lsstasa: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U → ⦃G, L⦄ ⊢ T ••*[h, g, 1] U.
-#h #g #G #L #T #U #H elim H -G -L -T -U
-/2 width=8 by lsstasa_O, lsstasa_sort, lsstasa_ldef, lsstasa_ldec, lsstasa_bind, lsstasa_appl, lsstasa_cast/
-qed.
-
-lemma lsstasa_step_dx: ∀h,g,G,L,T1,T,l. ⦃G, L⦄ ⊢ T1 ••*[h, g, l] T →
- ∀T2. ⦃G, L⦄ ⊢ T •[h, g] T2 → ⦃G, L⦄ ⊢ T1 ••*[h, g, l+1] T2.
-#h #g #G #L #T1 #T #l #H elim H -G -L -T1 -T -l
-[ /2 width=1/
-| #G #L #l #k #X #H >(ssta_inv_sort1 … H) -X >commutative_plus //
-| #G #L #K #V #W #U #i #l #HLK #_ #HWU #IHVW #U2 #HU2
- lapply (ldrop_fwd_drop2 … HLK) #H
- elim (ssta_inv_lift1 … HU2 … H … HWU) -H -U /3 width=6 by lsstasa_ldef/
-| #G #L #K #W #V #U #i #l #l0 #HLK #HWl0 #_ #HVU #IHWV #U2 #HU2
- lapply (ldrop_fwd_drop2 … HLK) #H
- elim (ssta_inv_lift1 … HU2 … H … HVU) -H -U /3 width=8 by lsstasa_ldec/
-| #a #I #G #L #V #T1 #U1 #l #_ #IHTU1 #X #H
- elim (ssta_inv_bind1 … H) -H #U #HU1 #H destruct /3 width=1 by lsstasa_bind/
-| #G #L #V #T1 #U1 #l #_ #IHTU1 #X #H
- elim (ssta_inv_appl1 … H) -H #U #HU1 #H destruct /3 width=1 by lsstasa_appl/
-| /3 width=1 by lsstasa_cast/
-]
-qed.
-
-(* Main properties **********************************************************)
-
-theorem lsstas_lsstasa: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T •*[h, g, l] U → ⦃G, L⦄ ⊢ T ••*[h, g, l] U.
-#h #g #G #L #T #U #l #H @(lsstas_ind_dx … H) -U -l /2 width=3 by lsstasa_step_dx, lsstasa_O/
-qed.
-
-(* Main inversion lemmas ****************************************************)
-
-theorem lsstasa_inv_lsstas: ∀h,g,G,L,T,U,l. ⦃G, L⦄ ⊢ T ••*[h, g, l] U → ⦃G, L⦄ ⊢ T •*[h, g, l] U.
-#h #g #G #L #T #U #l #H elim H -G -L -T -U -l
-/2 width=8 by lsstas_inv_SO, lsstas_ldec, lsstas_ldef, lsstas_cast, lsstas_appl, lsstas_bind/
-qed-.
-
-(* Advanced eliminators *****************************************************)
-
-lemma lsstas_ind_alt: ∀h,g. ∀R:genv→relation4 lenv nat term term.
- (∀G,L,T. R G L O T T) →
- (∀G,L,l,k. R G L l (⋆k) (⋆((next h)^l k))) → (
- ∀G,L,K,V,W,U,i,l.
- ⇩[i] L ≡ K.ⓓV → ⦃G, K⦄ ⊢ V •*[h, g, l+1] W → ⇧[O, i+1] W ≡ U →
- R G K (l+1) V W → R G L (l+1) (#i) U
- ) → (
- ∀G,L,K,W,V,U,i,l,l0.
- ⇩[i] L ≡ K.ⓛW → ⦃G, K⦄ ⊢ W ▪[h, g] l0 →
- ⦃G, K⦄ ⊢ W •*[h, g, l]V → ⇧[O, i+1] V ≡ U →
- R G K l W V → R G L (l+1) (#i) U
- ) → (
- ∀a,I,G,L,V,T,U,l. ⦃G, L.ⓑ{I}V⦄ ⊢ T •*[h, g, l] U →
- R G (L.ⓑ{I}V) l T U → R G L l (ⓑ{a,I}V.T) (ⓑ{a,I}V.U)
- ) → (
- ∀G,L,V,T,U,l. ⦃G, L⦄ ⊢ T •*[h, g, l] U →
- R G L l T U → R G L l (ⓐV.T) (ⓐV.U)
- ) → (
- ∀G,L,W,T,U,l. ⦃G, L⦄⊢ T •*[h, g, l+1] U →
- R G L (l+1) T U → R G L (l+1) (ⓝW.T) U
- ) →
- ∀G,L,l,T,U. ⦃G, L⦄ ⊢ T •*[h, g, l] U → R G L l T U.
-#h #g #R #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #IH7 #G #L #l #T #U #H
-elim (lsstas_lsstasa … H) /3 width=10 by lsstasa_inv_lsstas/
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/static/ssta_lift.ma".
-include "basic_2/unfold/lsstas.ma".
-
-(* NAT-ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *****************)
-
-(* Properties on relocation *************************************************)
-
-lemma lsstas_lift: ∀h,g,G,l. l_liftable (llstar … (ssta h g G) l).
-/3 width=10 by l_liftable_llstar, ssta_lift/ qed.
-
-(* Inversion lemmas on relocation *******************************************)
-
-lemma lsstas_inv_lift1: ∀h,g,G,l. l_deliftable_sn (llstar … (ssta h g G) l).
-/3 width=6 by l_deliftable_sn_llstar, ssta_inv_lift1/ qed-.
-
-(* Advanced inversion lemmas ************************************************)
-
-lemma lsstas_inv_lref1: ∀h,g,G,L,U,i,l. ⦃G, L⦄ ⊢ #i •*[h, g, l+1] U →
- (∃∃K,V,W. ⇩[i] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •*[h, g, l+1] W &
- ⇧[0, i + 1] W ≡ U
- ) ∨
- (∃∃K,W,V,l0. ⇩[i] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W ▪[h, g] l0 &
- ⦃G, K⦄ ⊢ W •*[h, g, l] V & ⇧[0, i + 1] V ≡ U
- ).
-#h #g #G #L #U #i #l #H elim (lsstas_inv_step_sn … H) -H
-#X #H #HXU elim (ssta_inv_lref1 … H) -H
-* #K [ #V #W | #W #l0 ] #HLK [ #HVW | #HWl0 ] #HWX
-lapply (ldrop_fwd_drop2 … HLK) #H0LK
-elim (lsstas_inv_lift1 … HXU … H0LK … HWX) -H0LK -X
-/4 width=8 by lsstas_step_sn, ex4_4_intro, ex3_3_intro, or_introl, or_intror/
-qed-.
-
-(* Advanced forward lemmas **************************************************)
-
-lemma lsstas_fwd_correct: ∀h,g,G,L,T1,U1. ⦃G, L⦄ ⊢ T1 •[h, g] U1 →
- ∀T2,l. ⦃G, L⦄ ⊢ T1 •*[h, g, l] T2 →
- ∃U2. ⦃G, L⦄ ⊢ T2 •[h, g] U2.
-#h #g #G #L #T1 #U1 #HTU1 #T2 #l #H @(lsstas_ind_dx … H) -l -T2 [ /2 width=3 by ex_intro/ ] -HTU1
-#l #T #T2 #_ #HT2 #_ -T1 -U1 -l
-elim (ssta_fwd_correct … HT2) -T /2 width=2 by ex_intro/
-qed-.
-
-(* Advanced properties ******************************************************)
-
-lemma lsstas_total: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h, g] U →
- ∀l. ∃U0. ⦃G, L⦄ ⊢ T •*[h, g, l] U0.
-#h #g #G #L #T #U #HTU #l @(nat_ind_plus … l) -l [ /2 width=2 by lstar_O, ex_intro/ ]
-#l * #U0 #HTU0
-elim (lsstas_fwd_correct … HTU … HTU0) -U /3 width=4 by lsstas_step_dx, ex_intro/
-qed-.
-
-lemma lsstas_ldef: ∀h,g,G,L,K,V,i. ⇩[i] L ≡ K.ⓓV →
- ∀W,l. ⦃G, K⦄ ⊢ V •*[h, g, l+1] W →
- ∀U. ⇧[0, i+1] W ≡ U → ⦃G, L⦄ ⊢ #i •*[h, g, l+1] U.
-#h #g #G #L #K #V #i #HLK #W #l #HVW #U #HWU
-lapply (ldrop_fwd_drop2 … HLK)
-elim (lsstas_inv_step_sn … HVW) -HVW #W0
-elim (lift_total W0 0 (i+1)) /3 width=12 by lsstas_step_sn, ssta_ldef, lsstas_lift/
-qed.
-
-lemma lsstas_ldec: ∀h,g,G,L,K,W,i. ⇩[i] L ≡ K.ⓛW → ∀l0. ⦃G, K⦄ ⊢ W ▪[h, g] l0 →
- ∀V,l. ⦃G, K⦄ ⊢ W •*[h, g, l] V →
- ∀U. ⇧[0, i+1] V ≡ U → ⦃G, L⦄ ⊢ #i •*[h, g, l+1] U.
-#h #g #G #L #K #W #i #HLK #T #HWT #V #l #HWV #U #HVU
-lapply (ldrop_fwd_drop2 … HLK) #H
-elim (lift_total W 0 (i+1)) /3 width=12 by lsstas_step_sn, ssta_ldec, lsstas_lift/
-qed.
-
-(* Properties on degree assignment for terms ********************************)
-
-lemma lsstas_da_conf: ∀h,g,G,L,T,U,l1. ⦃G, L⦄ ⊢ T •*[h, g, l1] U →
- ∀l2. ⦃G, L⦄ ⊢ T ▪[h, g] l2 → ⦃G, L⦄ ⊢ U ▪[h, g] l2-l1.
-#h #g #G #L #T #U #l1 #H @(lsstas_ind_dx … H) -U -l1 //
-#l1 #U #U0 #_ #HU0 #IHTU #l2 #HT
-<minus_plus /3 width=3 by ssta_da_conf/
-qed-.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "basic_2/static/ssta_ssta.ma".
-include "basic_2/unfold/lsstas_lift.ma".
-
-(* NAT-ITERATED STRATIFIED STATIC TYPE ASSIGNMENT FOR TERMS *****************)
-
-(* Main properties **********************************************************)
-
-theorem lsstas_trans: ∀h,g,G,L. ltransitive … (lsstas h g G L).
-/2 width=3 by lstar_ltransitive/ qed-.
-
-theorem lsstas_mono: ∀h,g,G,L,l. singlevalued … (lsstas h g G L l).
-/3 width=7 by ssta_mono, lstar_singlevalued/ qed-.
-
-theorem lsstas_conf_le: ∀h,g,G,L,T,U1,l1. ⦃G, L⦄ ⊢ T •*[h, g, l1] U1 →
- ∀U2,l2. l1 ≤ l2 → ⦃G, L⦄ ⊢ T •*[h, g, l2] U2 →
- ⦃G, L⦄ ⊢ U1 •*[h, g, l2 - l1] U2.
-#h #g #G #L #T #U1 #l1 #HTU1 #U2 #l2 #Hl12
->(plus_minus_m_m … Hl12) in ⊢ (%→?); -Hl12 >commutative_plus #H
-elim (lsstas_split … H) -H #U #HTU
->(lsstas_mono … HTU … HTU1) -T //
-qed-.
-
-(* Advanced properties ******************************************************)
-
-lemma lsstas_ssta_conf_pos: ∀h,g,G,L,T,U1. ⦃G, L⦄ ⊢ T •[h, g] U1 →
- ∀U2,l. ⦃G, L⦄ ⊢ T •*[h, g, l+1] U2 → ⦃G, L⦄ ⊢ U1 •*[h, g, l] U2.
-#h #g #G #L #T #U1 #HTU1 #U2 #l #HTU2
-lapply (lsstas_conf_le … T U1 1 … HTU2) -HTU2 // /2 width=1/
-qed-.
-
-lemma lsstas_strip_pos: ∀h,g,G,L,T1,U1. ⦃G, L⦄ ⊢ T1 •[h, g] U1 →
- ∀T2,l. ⦃G, L⦄ ⊢ T1 •*[h, g, l+1] T2 →
- ∃∃U2. ⦃G, L⦄ ⊢ T2 •[h, g] U2 & ⦃G, L⦄ ⊢ U1 •*[h, g, l+1] U2.
-#h #g #G #L #T1 #U1 #HTU1 #T2 #l #HT12
-elim (lsstas_fwd_correct … HTU1 … HT12)
-lapply (lsstas_ssta_conf_pos … HTU1 … HT12) -T1 /3 width=5/
-qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/notation/relations/statictypestar_6.ma".
+include "basic_2/static/sta.ma".
+
+(* NAT-ITERATED STATIC TYPE ASSIGNMENT FOR TERMS ****************************)
+
+definition lstas: ∀h. genv → lenv → nat → relation term ≝
+ λh,G,L. lstar … (sta h G L).
+
+interpretation "nat-iterated static type assignment (term)"
+ 'StaticTypeStar h G L l T U = (lstas h G L l T U).
+
+(* Basic eliminators ********************************************************)
+
+lemma lstas_ind_sn: ∀h,G,L,U2. ∀R:relation2 nat term.
+ R 0 U2 → (
+ ∀l,T,U1. ⦃G, L⦄ ⊢ T •[h] U1 → ⦃G, L⦄ ⊢ U1 •* [h, l] U2 →
+ R l U1 → R (l+1) T
+ ) →
+ ∀l,T. ⦃G, L⦄ ⊢ T •*[h, l] U2 → R l T.
+/3 width=5 by lstar_ind_l/ qed-.
+
+lemma lstas_ind_dx: ∀h,G,L,T. ∀R:relation2 nat term.
+ R 0 T → (
+ ∀l,U1,U2. ⦃G, L⦄ ⊢ T •* [h, l] U1 → ⦃G, L⦄ ⊢ U1 •[h] U2 →
+ R l U1 → R (l+1) U2
+ ) →
+ ∀l,U. ⦃G, L⦄ ⊢ T •*[h, l] U → R l U.
+/3 width=5 by lstar_ind_r/ qed-.
+
+(* Basic inversion lemmas ***************************************************)
+
+lemma lstas_inv_O: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •*[h, 0] U → T = U.
+/2 width=4 by lstar_inv_O/ qed-.
+
+lemma lstas_inv_SO: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •*[h, 1] U → ⦃G, L⦄ ⊢ T •[h] U.
+/2 width=1 by lstar_inv_step/ qed-.
+
+lemma lstas_inv_step_sn: ∀h,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 •*[h, l+1] T2 →
+ ∃∃T. ⦃G, L⦄ ⊢ T1 •[h] T & ⦃G, L⦄ ⊢ T •*[h, l] T2.
+/2 width=3 by lstar_inv_S/ qed-.
+
+lemma lstas_inv_step_dx: ∀h,G,L,T1,T2,l. ⦃G, L⦄ ⊢ T1 •*[h, l+1] T2 →
+ ∃∃T. ⦃G, L⦄ ⊢ T1 •*[h, l] T & ⦃G, L⦄ ⊢ T •[h] T2.
+/2 width=3 by lstar_inv_S_dx/ qed-.
+
+lemma lstas_inv_sort1: ∀h,G,L,X,k,l. ⦃G, L⦄ ⊢ ⋆k •*[h, l] X → X = ⋆((next h)^l k).
+#h #G #L #X #k #l #H @(lstas_ind_dx … H) -X -l //
+#l #X #X0 #_ #H #IHX destruct
+lapply (sta_inv_sort1 … H) -H #H destruct
+>iter_SO //
+qed-.
+
+lemma lstas_inv_gref1: ∀h,G,L,X,p,l. ⦃G, L⦄ ⊢ §p •*[h, l+1] X → ⊥.
+#h #G #L #X #p #l #H elim (lstas_inv_step_sn … H) -H
+#U #H #HUX elim (sta_inv_gref1 … H)
+qed-.
+
+lemma lstas_inv_bind1: ∀h,a,I,G,L,V,T,X,l. ⦃G, L⦄ ⊢ ⓑ{a,I}V.T •*[h, l] X →
+ ∃∃U. ⦃G, L.ⓑ{I}V⦄ ⊢ T •*[h, l] U & X = ⓑ{a,I}V.U.
+#h #a #I #G #L #V #T #X #l #H @(lstas_ind_dx … H) -X -l /2 width=3 by ex2_intro/
+#l #X #X0 #_ #HX0 * #U #HTU #H destruct
+elim (sta_inv_bind1 … HX0) -HX0 #U0 #HU0 #H destruct /3 width=3 by lstar_dx, ex2_intro/
+qed-.
+
+lemma lstas_inv_appl1: ∀h,G,L,V,T,X,l. ⦃G, L⦄ ⊢ ⓐV.T •*[h, l] X →
+ ∃∃U. ⦃G, L⦄ ⊢ T •*[h, l] U & X = ⓐV.U.
+#h #G #L #V #T #X #l #H @(lstas_ind_dx … H) -X -l /2 width=3 by ex2_intro/
+#l #X #X0 #_ #HX0 * #U #HTU #H destruct
+elim (sta_inv_appl1 … HX0) -HX0 #U0 #HU0 #H destruct /3 width=3 by lstar_dx, ex2_intro/
+qed-.
+
+lemma lstas_inv_cast1: ∀h,G,L,W,T,U,l. ⦃G, L⦄ ⊢ ⓝW.T •*[h, l+1] U → ⦃G, L⦄ ⊢ T •*[h, l+1] U.
+#h #G #L #W #T #X #l #H elim (lstas_inv_step_sn … H) -H
+#U #H #HUX lapply (sta_inv_cast1 … H) -H /2 width=3 by lstar_S/
+qed-.
+
+(* Basic properties *********************************************************)
+
+lemma lstas_refl: ∀h,G,L. reflexive … (lstas h G L 0).
+// qed.
+
+lemma sta_lstas: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ⦃G, L⦄ ⊢ T •*[h, 1] U.
+/2 width=1 by lstar_step/ qed.
+
+lemma lstas_step_sn: ∀h,G,L,T1,U1,U2,l. ⦃G, L⦄ ⊢ T1 •[h] U1 → ⦃G, L⦄ ⊢ U1 •*[h, l] U2 →
+ ⦃G, L⦄ ⊢ T1 •*[h, l+1] U2.
+/2 width=3 by lstar_S/ qed.
+
+lemma lstas_step_dx: ∀h,G,L,T1,T2,U2,l. ⦃G, L⦄ ⊢ T1 •*[h, l] T2 → ⦃G, L⦄ ⊢ T2 •[h] U2 →
+ ⦃G, L⦄ ⊢ T1 •*[h, l+1] U2.
+/2 width=3 by lstar_dx/ qed.
+
+lemma lstas_split: ∀h,G,L. inv_ltransitive … (lstas h G L).
+/2 width=1 by lstar_inv_ltransitive/ qed-.
+
+lemma lstas_sort: ∀h,G,L,l,k. ⦃G, L⦄ ⊢ ⋆k •*[h, l] ⋆((next h)^l k).
+#h #G #L #l @(nat_ind_plus … l) -l //
+#l #IHl #k >iter_SO /2 width=3 by sta_sort, lstas_step_dx/
+qed.
+
+lemma lstas_bind: ∀h,I,G,L,V,T,U,l. ⦃G, L.ⓑ{I}V⦄ ⊢ T •*[h, l] U →
+ ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V.T •*[h, l] ⓑ{a,I}V.U.
+#h #I #G #L #V #T #U #l #H @(lstas_ind_dx … H) -U -l /3 width=3 by sta_bind, lstar_O, lstas_step_dx/
+qed.
+
+lemma lstas_appl: ∀h,G,L,T,U,l. ⦃G, L⦄ ⊢ T •*[h, l] U →
+ ∀V.⦃G, L⦄ ⊢ ⓐV.T •*[h, l] ⓐV.U.
+#h #G #L #T #U #l #H @(lstas_ind_dx … H) -U -l /3 width=3 by sta_appl, lstar_O, lstas_step_dx/
+qed.
+
+lemma lstas_cast: ∀h,G,L,T,U,l. ⦃G, L⦄ ⊢ T •*[h, l+1] U →
+ ∀W. ⦃G, L⦄ ⊢ ⓝW.T •*[h, l+1] U.
+#h #G #L #T #U #l #H elim (lstas_inv_step_sn … H) -H /3 width=3 by sta_cast, lstas_step_sn/
+qed.
+
+(* Basic_1: removed theorems 7:
+ sty1_abbr sty1_appl sty1_bind sty1_cast2
+ sty1_correct sty1_lift sty1_trans
+*)
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/sta_aaa.ma".
+include "basic_2/unfold/lstas.ma".
+
+(* NAT-ITERATED STATIC TYPE ASSIGNMENT FOR TERMS ****************************)
+
+(* Properties on atomic arity assignment for terms **************************)
+
+lemma lstas_aaa_conf: ∀h,G,L,l. Conf3 … (aaa G L) (lstas h G L l).
+/3 width=6 by sta_aaa_conf, lstar_Conf3/ qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/notation/relations/statictypestaralt_6.ma".
+include "basic_2/unfold/lstas_lift.ma".
+
+(* NAT-ITERATED STATIC TYPE ASSIGNMENT FOR TERMS ****************************)
+
+(* alternative definition of lstas *)
+inductive lstasa (h): genv → relation4 lenv nat term term ≝
+| lstasa_O : ∀G,L,T. lstasa h G L 0 T T
+| lstasa_sort: ∀G,L,l,k. lstasa h G L l (⋆k) (⋆((next h)^l k))
+| lstasa_ldef: ∀G,L,K,V,W,U,i,l. ⇩[i] L ≡ K.ⓓV → lstasa h G K (l+1) V W →
+ ⇧[0, i+1] W ≡ U → lstasa h G L (l+1) (#i) U
+| lstasa_ldec: ∀G,L,K,W,V,V0,U,i,l. ⇩[i] L ≡ K.ⓛW → ⦃G, K⦄ ⊢ W •[h] V0 →
+ lstasa h G K l W V → ⇧[0, i+1] V ≡ U → lstasa h G L (l+1) (#i) U
+| lstasa_bind: ∀a,I,G,L,V,T,U,l. lstasa h G (L.ⓑ{I}V) l T U →
+ lstasa h G L l (ⓑ{a,I}V.T) (ⓑ{a,I}V.U)
+| lstasa_appl: ∀G,L,V,T,U,l. lstasa h G L l T U → lstasa h G L l (ⓐV.T) (ⓐV.U)
+| lstasa_cast: ∀G,L,W,T,U,l. lstasa h G L (l+1) T U → lstasa h G L (l+1) (ⓝW.T) U
+.
+
+interpretation "nat-iterated static type assignment (term) alternative"
+ 'StaticTypeStarAlt h G L l T U = (lstasa h G L l T U).
+
+(* Base properties **********************************************************)
+
+lemma sta_lstasa: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ⦃G, L⦄ ⊢ T ••*[h, 1] U.
+#h #G #L #T #U #H elim H -G -L -T -U
+/2 width=8 by lstasa_O, lstasa_sort, lstasa_ldef, lstasa_ldec, lstasa_bind, lstasa_appl, lstasa_cast/
+qed.
+
+lemma lstasa_step_dx: ∀h,G,L,T1,T,l. ⦃G, L⦄ ⊢ T1 ••*[h, l] T →
+ ∀T2. ⦃G, L⦄ ⊢ T •[h] T2 → ⦃G, L⦄ ⊢ T1 ••*[h, l+1] T2.
+#h #G #L #T1 #T #l #H elim H -G -L -T1 -T -l
+[ /2 width=1 by sta_lstasa/
+| #G #L #l #k #X #H >(sta_inv_sort1 … H) -X >commutative_plus //
+| #G #L #K #V #W #U #i #l #HLK #_ #HWU #IHVW #U2 #HU2
+ lapply (ldrop_fwd_drop2 … HLK) #H
+ elim (sta_inv_lift1 … HU2 … H … HWU) -H -U /3 width=6 by lstasa_ldef/
+| #G #L #K #W #V #V0 #U #i #l #HLK #HWl0 #_ #HVU #IHWV #U2 #HU2
+ lapply (ldrop_fwd_drop2 … HLK) #H
+ elim (sta_inv_lift1 … HU2 … H … HVU) -H -U /3 width=8 by lstasa_ldec/
+| #a #I #G #L #V #T1 #U1 #l #_ #IHTU1 #X #H
+ elim (sta_inv_bind1 … H) -H #U #HU1 #H destruct /3 width=1 by lstasa_bind/
+| #G #L #V #T1 #U1 #l #_ #IHTU1 #X #H
+ elim (sta_inv_appl1 … H) -H #U #HU1 #H destruct /3 width=1 by lstasa_appl/
+| /3 width=1 by lstasa_cast/
+]
+qed.
+
+(* Main properties **********************************************************)
+
+theorem lstas_lstasa: ∀h,G,L,T,U,l. ⦃G, L⦄ ⊢ T •*[h, l] U → ⦃G, L⦄ ⊢ T ••*[h, l] U.
+#h #G #L #T #U #l #H @(lstas_ind_dx … H) -U -l /2 width=3 by lstasa_step_dx, lstasa_O/
+qed.
+
+(* Main inversion lemmas ****************************************************)
+
+theorem lstasa_inv_lstas: ∀h,G,L,T,U,l. ⦃G, L⦄ ⊢ T ••*[h, l] U → ⦃G, L⦄ ⊢ T •*[h, l] U.
+#h #G #L #T #U #l #H elim H -G -L -T -U -l
+/2 width=8 by lstas_inv_SO, lstas_ldec, lstas_ldef, lstas_cast, lstas_appl, lstas_bind/
+qed-.
+
+(* Advanced eliminators *****************************************************)
+
+lemma lstas_ind_alt: ∀h. ∀R:genv→relation4 lenv nat term term.
+ (∀G,L,T. R G L O T T) →
+ (∀G,L,l,k. R G L l (⋆k) (⋆((next h)^l k))) → (
+ ∀G,L,K,V,W,U,i,l.
+ ⇩[i] L ≡ K.ⓓV → ⦃G, K⦄ ⊢ V •*[h, l+1] W → ⇧[O, i+1] W ≡ U →
+ R G K (l+1) V W → R G L (l+1) (#i) U
+ ) → (
+ ∀G,L,K,W,V,V0,U,i,l.
+ ⇩[i] L ≡ K.ⓛW → ⦃G, K⦄ ⊢ W •[h] V0 →
+ ⦃G, K⦄ ⊢ W •*[h, l]V → ⇧[O, i+1] V ≡ U →
+ R G K l W V → R G L (l+1) (#i) U
+ ) → (
+ ∀a,I,G,L,V,T,U,l. ⦃G, L.ⓑ{I}V⦄ ⊢ T •*[h, l] U →
+ R G (L.ⓑ{I}V) l T U → R G L l (ⓑ{a,I}V.T) (ⓑ{a,I}V.U)
+ ) → (
+ ∀G,L,V,T,U,l. ⦃G, L⦄ ⊢ T •*[h, l] U →
+ R G L l T U → R G L l (ⓐV.T) (ⓐV.U)
+ ) → (
+ ∀G,L,W,T,U,l. ⦃G, L⦄⊢ T •*[h, l+1] U →
+ R G L (l+1) T U → R G L (l+1) (ⓝW.T) U
+ ) →
+ ∀G,L,l,T,U. ⦃G, L⦄ ⊢ T •*[h, l] U → R G L l T U.
+#h #R #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #IH7 #G #L #l #T #U #H
+elim (lstas_lstasa … H) /3 width=10 by lstasa_inv_lstas/
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/unfold/lstas.ma".
+include "basic_2/static/da_sta.ma".
+
+(* NAT-ITERATED STATIC TYPE ASSIGNMENT FOR TERMS ****************************)
+
+(* Properties on degree assignment for terms ********************************)
+
+lemma lstas_da_conf: ∀h,g,G,L,T,U,l1. ⦃G, L⦄ ⊢ T •*[h, l1] U →
+ ∀l2. ⦃G, L⦄ ⊢ T ▪[h, g] l2 → ⦃G, L⦄ ⊢ U ▪[h, g] l2-l1.
+#h #g #G #L #T #U #l1 #H @(lstas_ind_dx … H) -U -l1 //
+#l1 #U #U0 #_ #HU0 #IHTU #l2 #HT
+<minus_plus /3 width=3 by da_sta_conf/
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/sta_lift.ma".
+include "basic_2/unfold/lstas.ma".
+
+(* NAT-ITERATED STATIC TYPE ASSIGNMENT FOR TERMS ****************************)
+
+(* Properties on relocation *************************************************)
+
+lemma lstas_lift: ∀h,G,l. l_liftable (llstar … (sta h G) l).
+/3 width=10 by l_liftable_llstar, sta_lift/ qed.
+
+(* Inversion lemmas on relocation *******************************************)
+
+lemma lstas_inv_lift1: ∀h,G,l. l_deliftable_sn (llstar … (sta h G) l).
+/3 width=6 by l_deliftable_sn_llstar, sta_inv_lift1/ qed-.
+
+(* Advanced inversion lemmas ************************************************)
+
+lemma lstas_inv_lref1: ∀h,G,L,U,i,l. ⦃G, L⦄ ⊢ #i •*[h, l+1] U →
+ (∃∃K,V,W. ⇩[i] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •*[h, l+1] W &
+ ⇧[0, i+1] W ≡ U
+ ) ∨
+ (∃∃K,W,V,V0. ⇩[i] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W •[h] V0 &
+ ⦃G, K⦄ ⊢ W •*[h, l] V & ⇧[0, i+1] V ≡ U
+ ).
+#h #G #L #U #i #l #H elim (lstas_inv_step_sn … H) -H
+#X #H #HXU elim (sta_inv_lref1 … H) -H
+* #K #V #W #HLK #HVW #HWX
+lapply (ldrop_fwd_drop2 … HLK) #H0LK
+elim (lstas_inv_lift1 … HXU … H0LK … HWX) -H0LK -X
+/4 width=8 by lstas_step_sn, ex4_4_intro, ex3_3_intro, or_introl, or_intror/
+qed-.
+
+(* Advanced forward lemmas **************************************************)
+
+lemma lstas_fwd_correct: ∀h,G,L,T1,U1. ⦃G, L⦄ ⊢ T1 •[h] U1 →
+ ∀T2,l. ⦃G, L⦄ ⊢ T1 •*[h, l] T2 →
+ ∃U2. ⦃G, L⦄ ⊢ T2 •[h] U2.
+#h #G #L #T1 #U1 #HTU1 #T2 #l #H @(lstas_ind_dx … H) -l -T2 /2 width=3 by ex_intro/ -HTU1
+#l #T #T2 #_ #HT2 #_ -T1 -U1 -l
+elim (sta_fwd_correct … HT2) -T /2 width=2 by ex_intro/
+qed-.
+
+(* Advanced properties ******************************************************)
+
+lemma lstas_total: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U →
+ ∀l. ∃U0. ⦃G, L⦄ ⊢ T •*[h, l] U0.
+#h #G #L #T #U #HTU #l @(nat_ind_plus … l) -l /2 width=2 by ex_intro/
+#l * #U0 #HTU0 elim (lstas_fwd_correct … HTU … HTU0) -U
+/3 width=4 by lstas_step_dx, ex_intro/
+qed-.
+
+lemma lstas_ldef: ∀h,G,L,K,V,i. ⇩[i] L ≡ K.ⓓV →
+ ∀W,l. ⦃G, K⦄ ⊢ V •*[h, l+1] W →
+ ∀U. ⇧[0, i+1] W ≡ U → ⦃G, L⦄ ⊢ #i •*[h, l+1] U.
+#h #G #L #K #V #i #HLK #W #l #HVW #U #HWU
+lapply (ldrop_fwd_drop2 … HLK)
+elim (lstas_inv_step_sn … HVW) -HVW #W0
+elim (lift_total W0 0 (i+1)) /3 width=12 by lstas_step_sn, sta_ldef, lstas_lift/
+qed.
+
+lemma lstas_ldec: ∀h,G,L,K,W,i. ⇩[i] L ≡ K.ⓛW → ∀V0. ⦃G, K⦄ ⊢ W •[h] V0 →
+ ∀V,l. ⦃G, K⦄ ⊢ W •*[h, l] V →
+ ∀U. ⇧[0, i+1] V ≡ U → ⦃G, L⦄ ⊢ #i •*[h, l+1] U.
+#h #G #L #K #W #i #HLK #V0 #HWV0 #V #l #HWV #U #HVU
+lapply (ldrop_fwd_drop2 … HLK) #H
+elim (lift_total W 0 (i+1)) /3 width=12 by lstas_step_sn, sta_ldec, lstas_lift/
+qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "basic_2/static/sta_sta.ma".
+include "basic_2/unfold/lstas_lift.ma".
+
+(* NAT-ITERATED STATIC TYPE ASSIGNMENT FOR TERMS ****************************)
+
+(* Main properties **********************************************************)
+
+theorem lstas_trans: ∀h,G,L. ltransitive … (lstas h G L).
+/2 width=3 by lstar_ltransitive/ qed-.
+
+theorem lstas_mono: ∀h,G,L,l. singlevalued … (lstas h G L l).
+/3 width=7 by sta_mono, lstar_singlevalued/ qed-.
+
+theorem lstas_conf_le: ∀h,G,L,T,U1,l1. ⦃G, L⦄ ⊢ T •*[h, l1] U1 →
+ ∀U2,l2. l1 ≤ l2 → ⦃G, L⦄ ⊢ T •*[h, l2] U2 →
+ ⦃G, L⦄ ⊢ U1 •*[h, l2-l1] U2.
+#h #G #L #T #U1 #l1 #HTU1 #U2 #l2 #Hl12
+>(plus_minus_m_m … Hl12) in ⊢ (%→?); -Hl12 >commutative_plus #H
+elim (lstas_split … H) -H #U #HTU
+>(lstas_mono … HTU … HTU1) -T //
+qed-.
+
+(* Advanced properties ******************************************************)
+
+lemma lstas_sta_conf_pos: ∀h,G,L,T,U1. ⦃G, L⦄ ⊢ T •[h] U1 →
+ ∀U2,l. ⦃G, L⦄ ⊢ T •*[h, l+1] U2 → ⦃G, L⦄ ⊢ U1 •*[h, l] U2.
+#h #G #L #T #U1 #HTU1 #U2 #l #HTU2
+lapply (lstas_conf_le … T U1 1 … HTU2) -HTU2 /2 width=1 by sta_lstas/
+qed-.
+
+lemma lstas_strip_pos: ∀h,G,L,T1,U1. ⦃G, L⦄ ⊢ T1 •[h] U1 →
+ ∀T2,l. ⦃G, L⦄ ⊢ T1 •*[h, l+1] T2 →
+ ∃∃U2. ⦃G, L⦄ ⊢ T2 •[h] U2 & ⦃G, L⦄ ⊢ U1 •*[h, l+1] U2.
+#h #G #L #T1 #U1 #HTU1 #T2 #l #HT12
+elim (lstas_fwd_correct … HTU1 … HT12)
+lapply (lstas_sta_conf_pos … HTU1 … HT12) -T1 /3 width=5 by lstas_step_dx, ex2_intro/
+qed-.
]
*)
[ { "local env. ref. for stratified native validity" * } {
- [ "lsubsv ( ? ⊢ ? ¡⫃[?,?] ? )" "lsubsv_ldrop" + "lsubsv_lsubd" + "lsubsv_lsuba" + "lsubsv_lsstas" + "lsubsv_cpds" + "lsubsv_cpcs" + "lsubsv_snv" * ]
+ [ "lsubsv ( ? ⊢ ? ¡⫃[?,?] ? )" "lsubsv_lsubd" + "lsubsv_lsuba" + "lsubsv_lstas" + "lsubsv_cpds" + "lsubsv_cpcs" + "lsubsv_snv" * ]
}
]
[ { "stratified native validity" * } {
- [ "snv ( ⦃?,?⦄ ⊢ ? ¡[?,?] )" "snv_lift" + "snv_da_lpr" + "snv_aaa" + "snv_lsstas" + "snv_lsstas_lpr" + "snv_lpr" + "snv_cpcs" + "snv_preserve" * ]
+ [ "snv ( ⦃?,?⦄ ⊢ ? ¡[?,?] )" "snv_lift" + "snv_aaa" + "snv_da_lpr" + "snv_lstas" + "snv_lstas_lpr" + "snv_lpr" + "snv_cpcs" + "snv_preserve" * ]
}
]
}
}
]
[ { "iterated static type assignment" * } {
- [ "lsstas ( ⦃?,?⦄ ⊢ ? •*[?,?,?] ? )" "lsstas_alt ( ⦃?,?⦄ ⊢ ? ••*[?,?,?] ? )" "lsstas_lift" + "lsstas_aaa" + "lsstas_lsstas" * ]
+ [ "lstas ( ⦃?,?⦄ ⊢ ? •*[?,?,?] ? )" "lstas_alt ( ⦃?,?⦄ ⊢ ? ••*[?,?,?] ? )" "lstas_lift" + "lstas_aaa" + "lstas_da" + "lstas_lstas" * ]
}
]
}
]
class "grass"
[ { "static typing" * } {
- [ { "local env. ref. for atomic arity assignment" * } {
- [ "lsuba ( ? ⊢ ? ⁝⫃ ? )" "lsuba_ldrop" + "lsuba_aaa" + "lsuba_lsuba" * ]
+ [ { "local env. ref. for degree assignment" * } {
+ [ "lsubd ( ? ⊢ ? ▪⫃ ? )" "lsubd_da" + "lsubd_lsubd" * ]
}
]
- [ { "atomic arity assignment" * } {
- [ "aaa ( ⦃?,?⦄ ⊢ ? ⁝ ? )" "aaa_lift" + "aaa_lifts" + "aaa_fqus" + "aaa_lleq" + "aaa_da" + "aaa_ssta" + "aaa_aaa" * ]
+ [ { "degree assignment" * } {
+ [ "da ( ⦃?,?⦄ ⊢ ? ▪[?,?] ? )" "da_lift" + "da_aaa" + "da_sta" + "da_da" * ]
}
]
[ { "stratified static type assignment" * } {
- [ "ssta ( ⦃?,?⦄ ⊢ ? •[?,?] ? )" "ssta_lift" + "ssta_lpx_sn" + "ssta_ssta" * ]
+ [ "sta ( ⦃?,?⦄ ⊢ ? •[?,?] ? )" "sta_lift" + "sta_lpx_sn" + "sta_aaa" + "sta_sta" * ]
}
]
- [ { "local env. ref. for degree assignment" * } {
- [ "lsubd ( ? ⊢ ? ▪⫃ ? )" "lsubd_da" + "lsubd_lsubd" * ]
+ [ { "parameters" * } {
+ [ "sh" "sd" * ]
}
]
- [ { "degree assignment" * } {
- [ "da ( ⦃?,?⦄ ⊢ ? ▪[?,?] ? )" "da_lift" + "da_da" * ]
+ [ { "local env. ref. for atomic arity assignment" * } {
+ [ "lsuba ( ? ⊢ ? ⁝⫃ ? )" "lsuba_aaa" + "lsuba_lsuba" * ]
}
]
- [ { "parameters" * } {
- [ "sh" "sd" * ]
+ [ { "atomic arity assignment" * } {
+ [ "aaa ( ⦃?,?⦄ ⊢ ? ⁝ ? )" "aaa_lift" + "aaa_lifts" + "aaa_fqus" + "aaa_lleq" + "aaa_aaa" * ]
}
]
[ { "restricted local env. ref." * } {