Section Legacy.
Definition Nth'_Rel : pRel sig^+ bool 4 :=
fun tin '(yout, tout) =>
forall (l : list X) (n : nat) s0 s1 s2 s3,
tin[@Fin0] ≃(;s0) l ->
tin[@Fin1] ≃(;s1) n ->
isVoid_size tin[@Fin2] s2 ->
isVoid_size tin[@Fin3] s3 ->
match yout with
| true =>
exists (x : X),
nth_error l n = Some x /\
tout[@Fin0] ≃(;(Nth'_size l n)[@Fin0]s0) l /\
isVoid_size tout[@Fin1] ((Nth'_size l n)[@Fin1]s1) /\
tout[@Fin2] ≃(;(Nth'_size l n)[@Fin2]s2) x /\
isVoid_size tout[@Fin3] ((Nth'_size l n)[@Fin3]s3)
| false =>
nth_error l n = None /\
tout[@Fin0] ≃(;(Nth'_size l n)[@Fin0]s0) l /\
isVoid_size tout[@Fin1] ((Nth'_size l n)[@Fin1]s1) /\
isVoid_size tout[@Fin2] ((Nth'_size l n)[@Fin2]s2) /\
isVoid_size tout[@Fin3] ((Nth'_size l n)[@Fin3]s3)
end.
Definition Nth'_T : tRel sig^+ 4 :=
fun tin k => exists (l : list X) (n : nat),
tin[@Fin0] ≃ l /\
tin[@Fin1] ≃ n /\
isVoid tin[@Fin2] /\ isVoid tin[@Fin3] /\
Nth'_steps l n <= k.

Lemma Nth'_Terminates : projT1 Nth' ↓ Nth'_T.