\begin{lemma}[A nonempty right shift does not increase the decimal point]
Let $d$ have a positive base-ten fold in its recorded prefix and let every
recorded cell be a decimal digit.  If the extracted right shift by
$k\leq60$ succeeds with a nonempty output $d'$, then
\[
 d'.\mathit{decimal\_point}\leq d.\mathit{decimal\_point}.
\]
\end{lemma}
\begin{proof}
Unfold the extracted right-shift call and name the result of its prefix loop
$(d_0,r,a,z)$.  Its successful return equation, the positive input fold, the
decimal-cell hypothesis, and $k\leq60$ meet all hypotheses of
\noderef{DecimalRightShiftPrefixLoopSemantics}.  That theorem states
$d_0=d$, $z=\mathsf{false}$, and $1\leq r$.  Its two alternatives also give
either $r\leq d.\mathit{num\_digits}\leq768$ or
$r\leq d.\mathit{num\_digits}+k\leq828$.  Hence the extracted cast of $r$
to a signed 32-bit integer is in range and has integer value $r$.

Because the whole right shift returns successfully, its checked subtraction
of one from that cast and its subsequent checked point subtraction both
succeed.  The scalar subtraction specifications therefore identify the
prospective point as
\[
 p'=d.\mathit{decimal\_point}-(r-1)
    =d.\mathit{decimal\_point}-r+1.                 \tag{1}
\]
If $p'$ is below the extracted point range, the definition returns the reset
record, whose count is zero; this contradicts the assumed nonempty output.
Thus the nonreset branch is taken.

Invert in turn the successful checked power, mask subtraction, main digit
loop, and final digit loop.  These operations can alter the digits, count,
and sticky flag, but the record passed to the final extracted trim has point
exactly $p'$.  Unfolding that successful trim shows that its assertion and
trim loop succeed and that its returned structure changes only
$\mathit{num\_digits}$; consequently
$d'.\mathit{decimal\_point}=p'$.  Finally $1\leq r$ in (1) gives
$p'\leq d.\mathit{decimal\_point}$, which is the claim.
\end{proof}
