Section LiftNM.
Variable sig : finType.
Variable m n : nat.
Variable F : finType.
Variable pM : pTM sig F m.
Variable I : Vector.t ((Fin.t n)) m.
Variable I_dupfree : dupfree I.
Definition LiftTapes_trans :=
fun '(q, sym ) =>
let (q', act) := trans (m := projT1 pM) (q, select I sym) in
(q', fill_default I (None, Nmove) act).
Definition LiftTapes_TM : TM sig n :=
{|
trans := LiftTapes_trans;
start := start (projT1 pM);
halt := halt (m := projT1 pM);
|}.
Definition LiftTapes : pTM sig F n := (LiftTapes_TM; projT2 pM).
Definition selectConf : mconfig sig (state LiftTapes_TM) n -> mconfig sig (state (projT1 pM)) m :=
fun c => mk_mconfig (cstate c) (select I (ctapes c)).
End LiftNM.
Arguments LiftTapes : simpl never.
Notation "pM @ ts" := (LiftTapes pM ts) (at level 41, only parsing).
(* * Tactic Support *)
(* TODO: Some of this is probably deprecated, e.g. the [app_tapes] stuff *)
Fixpoint not_indexb {n} (v : list (Fin.t n)) (i : Fin.t n) {struct v}: bool :=
match v with
[]%list => true
| (i'::v)%list => if Fin.eqb i' i then false else not_indexb v i
end.
Arguments not_indexb : simpl nomatch.

Lemma not_index_reflect_helper2 n' (l : list _) (P : Fin.t n' -> Prop):
(forall i : Fin.t n', if not_indexb l i then P i else True)
-> (forall i : Fin.t n', not_index (Vector.of_list l) i  -> P i).