Section CopyValue.
Variable (sig: finType) (sigX X : Type) (cX : codable sigX X) (I : Retract sigX sig).
Definition CopyValue :=
LiftTapes (MoveRight _) [|Fin0|];; CopySymbols_L (@isStart sig).
Definition CopyValue_size {sig: Type} {cX : codable sig X} (x : X) (s1 : nat) := s1 - S (size x).
Definition CopyValue_Rel : Rel (tapes (sig^+) 2) (unit * tapes (sig^+) 2) :=
ignoreParam (
fun tin tout =>
forall (x:X) (sx s1 : nat),
tin[@Fin0] ≃(;sx) x ->
isVoid_size tin[@Fin1] s1 ->
tout[@Fin0] ≃(;sx) x /\
tout[@Fin1] ≃(;CopyValue_size x s1) x
).
Definition CopyValue_steps {sig:Type} {cX : codable sig X} (x:X) := 25 + 12 *size x.

Lemma CopyValue_Terminates :
projT1 CopyValue ↓ (fun tin k => exists x:X, tin[@Fin0] ≃ x /\ CopyValue_steps x <= k).