(* *)
(**************************************************************************)
+include "ground_2/lib/lstar.ma".
include "basic_2/notation/relations/rdrop_4.ma".
include "basic_2/grammar/lenv_length.ma".
-include "basic_2/grammar/lenv_weight.ma".
+include "basic_2/grammar/cl_restricted_weight.ma".
include "basic_2/relocation/lift.ma".
(* LOCAL ENVIRONMENT SLICING ************************************************)
]
qed.
+lemma l_deliftable_sn_llstar: ∀R. l_deliftable_sn R →
+ ∀l. l_deliftable_sn (llstar … R l).
+#R #HR #l #L #U1 #U2 #H @(lstar_ind_r … l U2 H) -l -U2
+[ /2 width=3/
+| #l #U #U2 #_ #HU2 #IHU1 #K #d #e #HLK #T1 #HTU1
+ elim (IHU1 … HLK … HTU1) -IHU1 -U1 #T #HTU #HT1
+ elim (HR … HU2 … HLK … HTU) -HR -L -U /3 width=5/
+]
+qed.
+
(* Basic forvard lemmas *****************************************************)
(* Basic_1: was: drop_S *)
#L1 #L2 #d #e #H lapply (ldrop_fwd_length … H) -H /2 width=1/
qed-.
+lemma ldrop_fwd_length_eq: ∀L1,L2,K1,K2,d,e. ⇩[d, e] L1 ≡ K1 → ⇩[d, e] L2 ≡ K2 →
+ |L1| = |L2| → |K1| = |K2|.
+#L1 #L2 #K1 #K2 #d #e #HLK1 #HLK2 #HL12
+lapply (ldrop_fwd_length … HLK1) -HLK1
+lapply (ldrop_fwd_length … HLK2) -HLK2
+/2 width=2 by injective_plus_r/ (**) (* full auto fails *)
+qed-.
+
lemma ldrop_fwd_lw: ∀L1,L2,d,e. ⇩[d, e] L1 ≡ L2 → ♯{L2} ≤ ♯{L1}.
#L1 #L2 #d #e #H elim H -L1 -L2 -d -e // normalize
[ /2 width=3/
]
qed-.
+lemma ldrop_fwd_rfw: ∀I,L,K,V,i. ⇩[O, i] L ≡ K.ⓑ{I}V → ♯{K, V} < ♯{L, #i}.
+#I #L #K #V #i #HLK lapply (ldrop_fwd_lw … HLK) -HLK
+normalize in ⊢ (%→?%%); /2 width=1 by le_S_S/
+qed-.
+
(* Advanced inversion lemmas ************************************************)
fact ldrop_inv_O2_aux: ∀d,e,L1,L2. ⇩[d, e] L1 ≡ L2 → e = 0 → L1 = L2.