\begin{lemma}[Integral leading-zero adjustment]
Let a starting byte slice of length at most \(9223372036854775807\) consist
of a list \(D\) of decimal digit bytes followed by a tail whose first byte,
if any, is neither a decimal digit nor a decimal point.  Let an
\texttt{isize} \(n\) have value \(|D|-19\).
The extracted \texttt{adjust\_many\_digit\_count} call returns normally.
Moreover, if its result \(a\) is positive, then
\[
 D=Z\mathbin{++}[b]\mathbin{++}R,
 \qquad Z\text{ consists only of zero bytes},
 \qquad 49\leq b\leq57,
 \qquad a=|D|-19-|Z|.
\]
\end{lemma}
\begin{proof}
Unfold the adjustment loop in
\noderef{num_imp_dec2flt_parse_adjust_many_digit_count}.  Use the natural
measure \(2(|s|-j)+1\) while the loop is scanning and
\(2(|s|-j)\) after scanning stops, where \(j\) is the scan index.  While
scanning within the digit list, maintain a decomposition
\(D=Z\mathbin{++}R\), where \(Z\) contains only byte 48, together with
\[
 j=|Z| \quad\hbox{and}\quad c=|D|-19-|Z|,
\]
for the current count \(c\).  If scanning has stopped, maintain either
\(c\leq0\), or a decomposition
\(D=Z\mathbin{++}[b]\mathbin{++}R\) with \(Z\) all zero bytes,
\(49\leq b\leq57\), and the same count equation.

At a remaining zero digit, the extracted saturating subtraction computes
\(48-(48-1)=1\).  Its cast to \texttt{isize} is exact, so both the index and
zero-prefix length increase by one and the count decreases by one.  The
invariant is preserved and the measure strictly decreases.  At a nonzero
digit, decimality and inequality with byte 48 give the bounds
\(49\leq b\leq57\).  The loop changes the scanning flag without changing
the count or index; this supplies the second invariant alternative and
strictly decreases the parity part of the measure.

If the digit remainder is empty, the index is \(|D|\).  An empty tail ends
the loop with count \(-19\).  A nonempty tail begins with neither a digit nor
a point by hypothesis, so it stops scanning without changing the count,
again at \(-19\).  Thus neither case can yield a positive result.  All byte
accesses are guarded by the slice length.  The assumed bound
\(\lvert\mathtt{start}\rvert\leq9223372036854775807\) and the 64-bit scalar
widths from \noderef{Assumptions} put every count subtraction
and index increment within range.  Well-founded iteration therefore returns
normally, and a positive returned count excludes the nonpositive alternative,
leaving exactly the displayed significant-prefix decomposition.
\end{proof}

