proposition: Lemma vector_inv_back {X n} (v : Vector.t X (S n)) E : { '(x, v') : X * Vector.t X n | v = Vector.cast (append v' (x ## vec_nil)) E }.
proof: Proof. destruct E. destruct (splitat n v) eqn:E. eexists (vec_head t0, t). erewrite <- append_splitat. 1: now rewrite cast_eq_refl. rewrite E. f_equal. eapply (Vector.caseS' t0). cbn. intros h. eapply Vector.case0. reflexivity. Qed.
imports: Undecidability.MinskyMachines(MM_computable MM_sss mm_utils) Undecidability.StackMachines(BSM_computable) Undecidability.Shared.Libs.DLW(vec pos sss subcode) Lia Vector Nat Arith List Undecidability.MinskyMachines.MM(mm_defs mm_utils mm_comp_strong)