(* * Copying Machines and Helper functions for verifying machines using [CopySymbols] ane [MoveToSymbol] *)
From Undecidability Require Export TM.Compound.CopySymbols TM.Compound.MoveToSymbol.
Local Generalizable All Variables.
Set Default Proof Using "Type".
(* Don't simplify [skipn (S n) xs]; only, if the number and the lists are constructors *)
Local Arguments skipn { A } !n !l.
Local Arguments plus : simpl never.
Local Arguments mult : simpl never.

Corollary CopySymbols_correct_midtape ls m rs x rs' t2 :
stop m = false ->
(forall x, List.In x rs -> stop x = false) ->
stop x = true ->
CopySymbols_Fun stop (midtape ls m (rs ++ x :: rs'), t2) =
(midtape (rev rs ++ m :: ls) x rs',
midtape (rev rs ++ m :: left (t2)) x (skipn (S (|rs|)) (right t2))).