Section MapCode.
Variable sig tau : Type.
Variable retr : Retract sig tau.
Variable (sigX X : Type) (cX : codable sigX X) (I_x : Retract sigX sig) (I : Retract sig tau).
Global Instance Retract_plus : Retract (boundary + sig) (boundary + tau) := Retract_sum _ _.
Notation "'f''" := (@Retr_f (boundary+sig) (boundary+tau) Retract_plus).
Notation "'g''" := (@Retr_g (boundary+sig) (boundary+tau) Retract_plus).
Local Arguments Retr_f {X Y} (Retract).
Local Arguments Retr_g {X Y} (Retract).
Local Instance I_x' : Retract sigX tau := ComposeRetract _ _.
(* Translation Functions *)
Notation injectTape := (mapTape f').
Notation surjectTape := (surjectTape g' (inl UNKNOWN)).
(* Check injectTape : tape (sig^+) -> tape (tau^+) . *)
(* Check surjectTape : tape (tau^+) -> tape (sig^+). *)

Lemma surject_inject_inr (x : boundary) (str : list (boundary+tau)) (code : list sig) :
surjectSymbols (inl x) Retract_plus str = map inr code ->
exists str' : list tau, str = map inr str' /\ map (Retr_g I) str' = map Some code.