Section AlphabetLifting.
Variable (sig tau : Type).
Variable (retr : Retract sig tau).
Definition LiftSpec_single (T : RegSpec sig) : RegSpec tau :=
match T with
| Contains r x => Contains (ComposeRetract retr r) x
| Contains_size r x s => Contains_size (ComposeRetract retr r) x s
| Void => Void
| Void_size s => Void_size s
| Custom p => Custom (fun t => p (surjectTape (Retr_g) (inl UNKNOWN) t))
end.
Variable (n : nat).
Definition LiftSpec (T : SpecV sig n) : SpecV tau n :=
Vector.map LiftSpec_single T.
End AlphabetLifting.

Lemma LiftSpec_withSpace_single (sig tau : Type) (I : Retract sig tau) (P : RegSpec sig) (s : nat) :
LiftSpec_single I (withSpace_single P s) = withSpace_single (LiftSpec_single I P) s.