\begin{helper}[Value computed by the rounding loop]
Let $d$ be a decimal sequence with count at most 768 and decimal retained
cells, and let $q\leq18$ be a usize.  Let $L$ be the list of retained digit
values and let $I$ be its base-ten value.  The extracted rounding loop from
zero through $q$ returns a U64 $n$.  If $q$ is below the count, then $n$ is
the base-ten value of the first $q$ digits of $L$.  If the count is at most
$q$, then $n=I10^{q-\mathrm{count}}$.
\end{helper}
\begin{proof}
Apply \noderef{DecimalSeqRoundLoopPrefixCore}.  It returns a U64 whose value
is the fold $F_q$ over the zero-padded digit function $D$ from that lemma.
The retained list has length equal to the count, because the backing array
has length 768 and the assumed count is at most 768.

For every $k$ at most the count, induction on $k$ shows that $F_k$ is the
base-ten fold of the first $k$ retained digits.  At the successor step the
definition of $D$ selects exactly digit $k$, and both folds perform the same
update $a\mapsto10a+L_k$.  This gives the first conditional conclusion at
$k=q$.

At the count itself, the same identity gives $F_{\mathrm{count}}=I$.
Beyond the count, $D$ is zero, so each additional step multiplies the fold by
ten.  A second induction gives
$F_{\mathrm{count}+t}=I10^t$ for every $t$.  When the count is at most $q$,
write $q=\mathrm{count}+(q-\mathrm{count})$ and substitute
$t=q-\mathrm{count}$.  This is the second conditional conclusion.
\end{proof}
