Section Copy.
Variable sig : finType.
Variable f : sig -> sig.
Definition CopyChar : pTM sig unit 2 :=
Switch (LiftTapes ReadChar [|Fin0|])
(fun s : option sig =>
match s with
| None =>  Nop
| Some s => LiftTapes (Write (f s)) [|Fin1|]
end).
Definition CopyChar_Rel : pRel sig unit 2 :=
ignoreParam (
fun tin tout =>
tout[@Fin0] = tin[@Fin0] /\
tout[@Fin1] = tape_write tin[@Fin1] (map_opt f (current tin[@Fin0]))
).

Lemma CopyChar_Sem : CopyChar ⊨c(3) CopyChar_Rel.