\begin{lemma}[Safe and exact digit scanning]
Let a byte slice of length at most $9223372036854120458$ be the
concatenation of a list of ASCII decimal digits and a tail whose first byte,
if any, is not an ASCII decimal digit.  For every initial unsigned
accumulator, the extracted \texttt{try\_parse\_digits} returns normally, and
its returned slice is exactly that tail.
\end{lemma}
\begin{proof}
Put $C=9223372036854120458$ and let $L$ be the input length.  By
\noderef{Assumptions}, the target has 64-bit \texttt{usize} and
\texttt{isize}; in particular $L\leq C<2^{63}<2^{64}$.  We audit the two
loops in \noderef{num_imp_dec2flt_parse_try_parse_digits}.

In the first loop, a read is made only when at least eight bytes remain.
Thus \noderef{SliceU8_Insts_Dec2flt_modelNumImpDec2fltCommonByteSlice_read_u64}
copies an in-bounds eight-byte prefix and returns its little-endian word.
We first show that the predicate in
\noderef{num_imp_dec2flt_common_is_8digits} accepts exactly when all eight
bytes are digits.  Soundness in the forward direction is the only subtle
part.  Write the bytes as $b_0,\ldots,b_7$.  In the wrapping subtraction by
eight copies of \texttt{0x30}, induct from the least significant byte.  The
incoming borrow is initially zero.  If $b_i<48$, the result byte is in
$[208,255]$, contradicting the accepted word's zero \texttt{0x80} bit.
Consequently $b_i\geq48$, no borrow leaves that byte, and the result-byte
high bit further gives $b_i\leq175$.  In the wrapping addition by eight
copies of \texttt{0x46}, the incoming carry is likewise initially zero.
Under the preceding bound, $b_i\geq58$ would produce a byte in $[128,245]$,
again contradicting the zero high bit.  Hence $b_i\leq57$ and no carry
leaves the byte.  Both inductions cross all seven byte boundaries, so there
is no false positive.  Conversely, bytes in $[48,57]$ plainly create neither
a borrow nor a high bit in either operation, so the test accepts them.

On an accepted word, the checked subtraction in
\noderef{num_imp_dec2flt_parse_parse_8digits} produces a word $v'<2^{60}$.
Its checked multiplication by ten is below $10\cdot2^{60}<2^{64}$; the
checked shift by eight is defined and below $2^{52}$, and the checked sum is
below $10\cdot2^{60}+2^{52}<2^{64}$.  The later shifts by $16$ and $32$ are
also in range.  The intervening masked multiplications and addition are
wrapping, and the word after the final shift is at most $2^{32}-1$, so its
checked cast to \texttt{u32} succeeds.  The outer accumulator update is
wrapping.  The continuing branch then drops exactly the eight bytes just
read.  Each continuation strictly reduces the remaining length, so the
first loop terminates after consuming whole eight-byte blocks contained in
the stated digit prefix.  It cannot cross into the tail, because a block
containing its nondigit first byte fails the exact test.

The scalar loop starts on the resulting suffix.  At count $j$ its guard
$j<$ the suffix length justifies the byte access.  For a digit, wrapping
subtraction by $48$ gives a value below ten, the byte-to-\texttt{u64} cast is
exact, the accumulator multiplication and addition are wrapping, and the
checked increment gives $j+1$ no larger than the suffix length and hence no
larger than $L<2^{64}$.  It therefore consumes all remaining bytes of the
given digit prefix.  At the first tail byte the digit test fails, or at an
empty tail the length guard fails.  The final slice begins at this bounded
count, so it succeeds and equals the unconsumed tail.  This proves both the
normal return and the asserted exact remainder for every initial
accumulator.
\end{proof}
