Section MoveValue.
Variable sig : finType.
Variable (sigX sigY X Y : Type) (cX : codable sigX X) (cY : codable sigY Y) (I1 : Retract sigX sig) (I2 : Retract sigY sig).
Definition MoveValue : pTM sig^+ unit 2 :=
LiftTapes (Reset _) [|Fin1|];;
CopyValue _;;
LiftTapes (Reset _) [|Fin0|].
Definition MoveValue_size_x {sigX : Type} {cX : codable sigX X} (x : X) (sx : nat) := S (size x + sx).
Definition MoveValue_size_y {sigX sigY : Type} {cX : codable sigX X} {cY : codable sigY Y} (x : X) (y : Y) (sy : nat) := sy + size cY y -size x.
Definition MoveValue_Rel : pRel sig^+ unit 2 :=
ignoreParam (
fun tin tout =>
forall (x : X) (y : Y) (sx sy : nat),
tin[@Fin0] ≃(;sx) x ->
tin[@Fin1] ≃(;sy) y ->
isVoid_size tout[@Fin0] (MoveValue_size_x x sx) /\
tout[@Fin1] ≃(;MoveValue_size_y x y sy) x).
Definition MoveValue_steps {sigX sigY:Type} {cX : codable sigX X} {cY : codable sigY Y} (x:X) (y:Y) := 43 + 16 *size x + 4 * size cY y.

Lemma MoveValue_Terminates :
projT1 MoveValue ↓ (fun tin k => exists (x : X) (y : Y), tin[@Fin0] ≃ x /\ tin[@Fin1] ≃ y /\ MoveValue_steps x y <= k).