\begin{lemma}[Safe scientific-prefix parsing]
Let a byte slice consist of an optional exponent sign, a nonempty maximal
prefix of decimal digit bytes, and an arbitrary tail whose first byte, when
present, is not a digit.  The extracted \texttt{parse\_scientific} returns
normally with that tail unconsumed.  Its exponent lies in
$[-655359,655359]$; for at most five exponent digits it lies in
$[-99999,99999]$; and it is nonnegative unless the optional sign is minus.
\end{lemma}
\begin{proof}
Unfold \noderef{num_imp_dec2flt_parse_parse_scientific}.  After its guarded
optional-sign split, the loop sees exactly the digit prefix followed by the
stated tail.  Maintain the exact count bound $k\leq q$, where $q$ is the
digit-prefix length, together with $0\leq a\leq655359$.  If $k<q$, the
indexed byte belongs to the digit prefix; by \noderef{ModelU8IsAsciiDigit}
the digit test succeeds, and its wrapping subtraction by 48
is in $[0,9]$.  When $a<65536$, the checked update is
$10a+d\leq655359<2^{63}$; otherwise the guard preserves $a$.  The checked
count increment remains at most $q$ and hence within the slice length and
\texttt{usize} range.  If $k=q$, either the slice ends or the next byte is
the first tail byte.  Maximality and \noderef{ModelU8IsAsciiDigit} make that
byte fail the digit test, so the loop stops at exactly $q$ and slicing there
returns exactly the supplied
tail.

For the short bound, additionally maintain $a<10^k$ while $q\leq5$.  At a
continuing digit step, $10a+d<10^{k+1}$; since $k<q\leq5$, the cap guard is
necessarily taken.  At termination this gives $a<10^q\leq10^5$, hence
$a\leq99999$.  The first digit exists by nonemptiness and is recognized by
the ASCII-digit test.  The optional leading plus leaves the nonnegative
accumulator unchanged.  A leading minus invokes checked negation only after
the accumulator is known to be at most $655359$, far from the signed
minimum, and gives the corresponding two-sided coarse and short bounds.
Thus every sign case returns normally with the claimed exact residual slice,
bounds, and polarity.
\end{proof}
