\begin{theorem}[Uniform safe-length numeric acceptance]
Every source-valid nonempty Aeneas byte slice that is exactly the rendering of
an unsigned valid numeric lexeme and has length at most
$9223372036854120458$ makes the extracted \texttt{parse\_number} return
normally with \texttt{Some} of a decimal record.
\end{theorem}
\begin{proof}
Let $M=2^{63}-1$, let
$C=9223372036854120458=M-655349$, and write $L$ for the input length.  The
rendering equality and \noderef{DecimalGoalVocabularyDefault} identify the
bytes, in order, as an unsigned valid numeric grammar instance.  In particular
there is at least one significand digit, a present exponent has at least one
digit, and every digit byte is in $48,\ldots,57$.  The premise $L\leq C<M$
is stronger than the length part of \noderef{SourceValidByteSlice} and, by
\noderef{Assumptions}, all these lengths lie in both the 64-bit
\texttt{usize} and nonnegative \texttt{isize} ranges.

First audit \noderef{num_imp_dec2flt_parse_try_parse_digits}.  Its eight-byte
loop reads only under the guard that at least eight bytes remain.  Thus the
range copy in
\noderef{SliceU8_Insts_Dec2flt_modelNumImpDec2fltCommonByteSlice_read_u64}
is in bounds and returns those eight bytes as one little-endian word; the
continuing branch later drops exactly the same eight bytes.

We need the general, rather than merely example-specific, implication supplied
by the bit test in \noderef{num_imp_dec2flt_common_is_8digits}.  Write the
little-endian bytes of its argument $v$ as $b_0,\ldots,b_7$.  Its constants are
respectively eight copies of \texttt{0x46}, eight copies of \texttt{0x30}, and
eight copies of \texttt{0x80}.  Let $c_i$ be the carry into byte $i$ of the
wrapping addition by \texttt{0x4646464646464646}, and let $d_i$ be the borrow
into byte $i$ of the wrapping subtraction by
\texttt{0x3030303030303030}; initially $c_0=d_0=0$.  Acceptance says that in
every byte the high bit of both resulting words is zero, since their bitwise
OR has zero intersection with \texttt{0x8080808080808080}.

Induct first through the subtraction bytes.  If $d_i=0$ and $b_i<48$, the
result byte is $b_i-48+256\in[208,255]$, contrary to its zero high bit.
Therefore $b_i\geq48$, there is no outgoing borrow, and the result byte is
$b_i-48$.  Its zero high bit also gives $b_i-48<128$, hence $b_i\leq175$.
This establishes $48\leq b_i\leq175$ and $d_{i+1}=0$ at every byte, including
across all lower-byte boundaries.  Now induct through the addition bytes.  If
$c_i=0$ and $b_i\geq58$, the just-proved upper bound makes
$b_i+70\in[128,245]$, again contradicting the zero high bit.  Hence
$b_i\leq57$; then $b_i+70\leq127$, so there is no outgoing carry.  Starting
from $c_0=0$, this proves $c_i=0$ and $48\leq b_i\leq57$ for all eight bytes.
Thus the test has no false positive despite possible cross-byte carries and
borrows.

It remains to audit every checked operation in
\noderef{num_imp_dec2flt_parse_parse_8digits}.  For an accepted word, its
checked subtraction of \texttt{0x3030303030303030} has no borrow and produces
a word $v'$ whose bytes are all in $0,\ldots,9$.  In particular
$v'<\texttt{0x1000000000000000}=2^{60}$.  The checked multiplication by ten
is below $10\cdot2^{60}<2^{64}$, and the checked right shift by eight is
defined because $8<64$ and gives a value below $2^{52}$.  Their checked sum is
therefore below $10\cdot2^{60}+2^{52}<2^{64}$.  The later right shifts by
$16$ and $32$ are likewise defined because both counts are below $64$; the
intervening masks, multiplications, and addition are explicitly wrapping.
Whatever wrapped word $w<2^{64}$ those operations produce, its final shift
$w\mathbin{\mathtt{>>}}32$ is at most $2^{32}-1$.  The checked cast to
\texttt{u32} therefore succeeds, and the final widening back to \texttt{u64}
is exact.

The outer accumulator multiplication and addition are explicitly wrapping.
The scalar loop indexes only when its count is below the remaining length,
uses wrapping byte subtraction and wrapping accumulator operations, casts only
a byte to \texttt{u64}, and increments the count to a value at most that
length.  Its final slice begins at that bounded count.  Hence both digit-scan
invocations terminate normally at the first nondigit.  By
\noderef{SliceU8_Insts_Dec2flt_modelNumImpDec2fltCommonByteSlice_offset_from},
their offsets cast the lengths of a slice and one of its suffixes to
\texttt{isize} and take the checked difference.  Both casts are exact at
length at most $L$, and each difference is a nonnegative value at most $L$.

If a point is present, removing it is guarded by \texttt{split\_first}; the
second digit scan has the same safety argument.  Its fractional count is at
most $L$, its checked negation lies in the signed range, and the cast to
\texttt{i64} is exact because \texttt{isize} and \texttt{i64} are both
64-bit.  The checked addition of integer and fractional digit counts is the
number of significand digits and is at most $L$.  Validity makes that number
positive, so the extracted zero-digit rejection is not taken.

For a present exponent, the marker case of
\noderef{num_imp_dec2flt_parse_parse_partial_number} removes exactly the
\texttt{e} or \texttt{E} byte.  Let $q\geq1$ be the number of exponent digits.
The rendering premise says that the saved suffix is an optional sign followed
by exactly those $q$ digit bytes, with no further byte.  We now establish the
normal result and full consumption directly, rather than obtaining either from
the conditional statement of
\noderef{NumberHelperScientificExponentBounds}.

Unfold \noderef{num_imp_dec2flt_parse_parse_scientific} on this saved suffix.
Its first \texttt{split\_first} either removes the unique optional plus or minus
sign, or observes the first digit and retains the original suffix.  In every
case the resulting slice consists of exactly the $q$ digits.  It is nonempty,
so the index at zero is in bounds, and its first byte passes
\texttt{is\_ascii\_digit}.  Induct on $j=0,\ldots,q$ in the scientific loop.
At the start of iteration $j$, the count is $j$, the first $j$ exponent digits
have been visited, and the accumulator $a$ lies in $[0,655359]$.  If $j<q$,
the guarded index reads exponent digit $j$ and wrapping subtraction by 48
gives its value $d\in[0,9]$.  When $a<65536$, the checked operations compute
$10a+d\leq10\cdot65535+9=655359<2^{63}$; when $a\geq65536$, no arithmetic
update is made.  The checked count increment gives $j+1\leq q\leq L<C<2^{63}$,
so it also lies in the configured \texttt{usize} range.  Thus every one of the
$q$ digit iterations succeeds, including iterations after the accumulator has
stopped changing.  At count $q$ the length guard is false.  Slicing the
digit-only suffix at the in-bounds index $q$ leaves the empty slice.  Finally,
the optional checked negation is safe on $[0,655359]$.  Hence
\texttt{parse\_scientific} returns normally with \texttt{Some} of a value $E$
and an empty remainder, and the option-branch in the partial parser takes its
\texttt{Continue} case.

Only now apply the first, conditional clause of
\noderef{NumberHelperScientificExponentBounds} to that established return;
it gives $|E|\leq655359$.  We must still check the addition to the point
exponent.  For $q\leq5$, the just-described decimal accumulation gives
$|E|\leq10^q-1$; for $q\geq6$, the guarded loop gives
$|E|\leq655359$.  If $E\geq0$, then $-F+E$ lies between $-F\geq-L>-2^{63}$
and $E\leq655359$, so both sides are safe.  If $E<0$ and $F=0$, the sum is at
least $-655359$.  Finally suppose $E<0$ and $F>0$.  A point is present and the
exponent spelling contains the marker, its mandatory minus sign, and the $q$
digits, so $F\leq L-(q+3)$.  Therefore
\[
 F+|E|\leq
 \begin{cases}
 L-(q+3)+(10^q-1),&q\leq5,\\
 L-(q+3)+655359,&q\geq6.
 \end{cases}
\]
The first expression is maximized at $q=5$ and is $L+99991$; the second is
maximized at $q=6$ and is $L+655350$.  Since
$C+655350=M+1=2^{63}$, the sum $-F+E$ is never below
$-2^{63}$.  Its positive side is at most $655359<M$.  Thus the checked
\texttt{i64} addition succeeds, including equality at \texttt{i64::MIN}.
The offset of the remaining suffix from the original input is again between
zero and $L$, and its cast through \texttt{isize} to \texttt{usize} succeeds.

If there are at most nineteen significand digits, all remaining checked
operations have now been discharged and the extracted function returns its
record.  Otherwise subtracting nineteen from the positive digit count is
safe.  In \noderef{num_imp_dec2flt_parse_adjust_many_digit_count}, each access
is guarded by the scan index being below $L$, and each increment is at most
$L$.  The constant subtraction $48-1$, saturating byte subtraction, and byte
cast are safe.  A point decrements the count by zero and a leading zero by
one.  If there are $D$ significand digits, at most $D$ such zeros can be
removed from $D-19$, so every intermediate adjusted count is at least $-19$;
there is no signed underflow.

It remains to audit the positive adjusted-count retry in
\noderef{num_imp_dec2flt_parse_parse_many_digits}.  Write $D$ for the total
number of significand digits and $z$ for the number of its leading zero digits
when the optional point is ignored (take $z=D$ when every significand digit is
zero).  Starting from $D-19$, the scan in
\noderef{num_imp_dec2flt_parse_adjust_many_digit_count} visits precisely these
$z$ leading zero bytes and, if it occurs among them, the point byte: saturation
makes the point decrement zero, while each zero decrement is one.  It then
stops at the first nonzero significand digit, or at the exponent marker or end
when all $D$ digits are zero.  Thus its result is exactly $D-19-z$.  All its
intermediate values are at least $-19$, as noted above.  The retry premise
$n_{\rm digits3}>0$ therefore implies $D-z\geq20$ and in particular that a
nonzero significand digit exists.

By \noderef{num_imp_dec2flt_parse_MIN_19DIGIT_INT}, the retry guard constant is
exactly $1000000000000000000=10^{18}$.  The loop
\noderef{num_imp_dec2flt_parse_try_parse_19digits} multiplies only while its
accumulator is below this constant.  Thus each checked update is at most
$10\cdot(10^{18}-1)+9=10^{19}-1<2^{64}$; byte-to-\texttt{u64} casts and
guarded splits are also safe.  If the threshold is reached before a point,
the retry base exponent is the nonnegative number of remaining integer
digits.  With no explicit exponent it is at most $L-19$.  With $q$ exponent
digits it is at most $L-q-20$, since the spelling also contains the marker.
Adding a nonnegative $E$ is therefore at most $L+99974$ for $q\leq5$, and at
most $L+655333$ for $q\geq6$; the latter maximum occurs at $q=6$.  At
$L\leq C$ this is at most $M-16$, so the cast and checked addition succeed.
Adding a negative $E$ only lowers a nonnegative base by at most $655359$ and
cannot underflow.

It remains to justify the extracted one-byte slice in the other retry branch.
Suppose the first retry scan returns an accumulator below the cited
$10^{18}$ constant.  It cannot have stopped at its threshold guard, so by the
numeric grammar it stopped at the first nondigit, or at the end.  If the
spelling had no point, it would have consumed all $D$ significand digits before
reaching an exponent marker or the end.  But $D-z\geq20$ says that, from the
first nonzero digit onward, there are at least twenty digits.  After the first
nineteen of them, the exact recurrence $a\mapsto10a+d$ has a nineteen-digit
value and hence is at least $10^{18}$, exactly the cited guard constant.  The
next guard must therefore force the threshold exit, contradicting the assumed
low returned accumulator.  A point must
therefore be present.  The initial full digit scan saved \texttt{s1} (the
\texttt{int\_end} argument) as the suffix beginning with that point.  The retry
scan starts at the original slice, classifies the same integer digit prefix,
and, since it did not reach the threshold, stops exactly at that same point.
Its returned slice is consequently equal to \texttt{int\_end}, is nonempty,
and has point byte first.  The extracted slice at index one is therefore
in-bounds and is exactly the suffix immediately after the point.

The second scan starts on that fractional suffix.  It may pass arbitrarily
many leading fractional zeros before its accumulator reaches the threshold,
but it cannot consume more than the full fractional count $F$.  Its offset is
therefore in $[0,F]$, and its negated retry base is in $[-F,0]$.  Adding $E$
is safe by cases, without asserting a false uniform absolute-value bound.  If
$E\geq0$, the sum is at least $-F\geq-L>-2^{63}$, so it cannot underflow, and
its positive side is at most $E\leq655359$.  If $E<0$, its spelling contains
the exponent marker, the mandatory minus sign, and its $q$ digits in addition
to the point and $F$ fractional digits.  Hence $F\leq L-(q+3)$, and the same
accumulator estimates give
\[
 F+|E|\leq
 \begin{cases}
 L-(q+3)+(10^q-1)\leq L+99991,&q\leq5,\\
 L-(q+3)+655359\leq L+655350,&q\geq6.
 \end{cases}
\]
Thus the negative side is at least
$-(L+655350)\geq-(C+655350)=-2^{63}$, including the allowed endpoint.
This checks both retry branches, every offset, the offset negation, the
\texttt{isize}-to-\texttt{i64} cast, and the final checked addition.

Consequently \noderef{num_imp_dec2flt_parse_parse_partial_number} returns
normally with \texttt{Some} of a record and with its consumed-length field
equal to $L$: the rendering premise says the valid numeric spelling occupies
the whole input, so its final suffix is empty.  The length comparison in
\noderef{num_imp_dec2flt_parse_parse_number} therefore succeeds and that
function returns the same record in \texttt{Some}, as required.
\end{proof}
