Section While_TerminatesIn.
Variable (T T' : Rel (tapes sig n) nat).

Lemma While_TerminatesIn_ind :
pM ⊨ R ->
projT1 pM ↓ T' ->
(forall (tin : tapes sig n) (k : nat),
T tin k ->
exists k1,
T' tin k1 /\
(forall ymid tmid, R tin (Some ymid, tmid) -> k1 <= k) /\
(forall tmid, R tin (None, tmid) -> exists k2, T tmid k2 /\ 1 + k1 + k2 <= k)) ->
WhileTM ↓T.