Section StateWhile_TerminatesIn_coind.
Variable (T : F1 -> tRel sig n).
CoInductive StateWhile_T : F1 -> tRel sig n :=
| StateWhile_T_intro l t k k1 :
T l t k1 ->
(forall t' l1,
R l t (inl l1, t') ->
exists k2, StateWhile_T l1 t' k2 /\ 1 + k1 + k2 <= k) ->
(forall tmid l2,
R l t (inr l2, tmid) -> k1 <= k) ->
StateWhile_T l t k.

Lemma StateWhile_TerminatesIn l :
(forall l, pM l ⊨ R l) ->
(forall l, projT1 (pM l) ↓ T l) ->
StateWhileTM l ↓ StateWhile_T l.