\begin{lemma}[Sharp slow-path overflow witness]
Let \texttt{first} be eleven ASCII zeroes, followed by the nineteen bytes of
\texttt{1000000000000000080}, followed by $2147483618$ ASCII zeroes, and let
\texttt{body} be \texttt{0.} followed by \texttt{first}.  There are Aeneas
byte slices with those contents, and an empty remainder slice, for which
\[
 |\texttt{body}|=2147483650,\qquad
 |\texttt{first}|=2147483648=2^{31},\qquad
 |\texttt{remainder}|=0.
\]
On \texttt{body}, \texttt{parse\_number} returns a record with mantissa
$1000000000000000080$, exponent $-30$, negative flag false, and many-digits
flag true.  The native fast path returns \texttt{None}.  The two adjacent
\texttt{compute\_float} calls return respectively
$(448160529771025,983)$ and $(448160529771026,983)$, and their extracted
comparison is false, so dispatch is forced to the slow parser.

For the slow decimal parser, the narrowing cast of $2^{31}$ to
\texttt{i32} is \texttt{i32::MIN}, and checked subtraction of that value
from zero returns \texttt{fail integerOverflow}.  Consequently both
\texttt{parse\_decimal\_seq(body)} and the binary64 specialization of
\texttt{parse\_long\_mantissa(body)} return
\texttt{fail integerOverflow}.
\end{lemma}
\begin{proof}
Put $K=2147483618=2^{31}-30$.  By \noderef{Assumptions}, the configured
\texttt{usize} and \texttt{isize} carriers have 64 bits.  Hence the three
lists in the statement, whose lengths are below $2^{32}$, define Aeneas
slices.  The nineteen-byte block has length $19$, so direct list arithmetic
gives
\[
  |\texttt{first}|=11+19+K=2147483648,
  \qquad |\texttt{body}|=2+2147483648=2147483650.
\]
The chosen remainder is the empty slice and therefore has length zero.

We first execute the number helper.  In
\noderef{num_imp_dec2flt_parse_parse_partial_number}, the first call to
\noderef{num_imp_dec2flt_parse_try_parse_digits} first examines the initial
eight bytes.  By
\noderef{SliceU8_Insts_Dec2flt_modelNumImpDec2fltCommonByteSlice_read_u64},
the loaded word has those bytes in little-endian order, and direct evaluation
of \noderef{num_imp_dec2flt_common_is_8digits} is false because its second
byte is the point, $46$, not an ASCII digit.  The scalar loop therefore
consumes just the initial integer byte $48$ and leaves the point, with
accumulator zero.

After splitting at that point, the second digit scan starts on
\texttt{first}.  Its length is $2^{31}$, a multiple of eight, and all its
bytes lie between $48$ and $57$.  At each bulk iteration the read above is
in bounds, \noderef{num_imp_dec2flt_common_is_8digits} evaluates to true,
and \noderef{num_imp_dec2flt_parse_parse_8digits} returns the base-ten value
of those eight bytes.  Indeed, after subtracting the all-$48$ word, that
definition has eight bytes in $0,\ldots,9$; if this word is $v$, then
$v\leq9(2^{64}-1)/255$, so both the checked $10v$ and its following addition
of $v\mathbin{>{}>}8$ are below $2^{64}$.  The scan drops exactly eight bytes
per iteration and therefore terminates after $2^{28}$ iterations on the empty
suffix; its scalar tail has zero iterations.  Its outer multiply and add are
explicitly wrapping \texttt{u64} operations and cannot fail, and this
accumulated value will be discarded by the retry below.  By
\noderef{SliceU8_Insts_Dec2flt_modelNumImpDec2fltCommonByteSlice_offset_from},
the offset from the empty residual to \texttt{first} is
$|\texttt{first}|-0=2^{31}$.  This is in the signed 64-bit range, so its
negation and cast to \texttt{i64} are exact.  Together with the one integer
digit the total count is $1+2^{31}=2147483649>19$.

The many-digit adjustment in
\noderef{num_imp_dec2flt_parse_adjust_many_digit_count} starts from
$2147483649-19=2147483630$.  Its loop subtracts one for the initial integer
zero and for each of the eleven fractional leading zeroes; the saturating
quantity for the point is $46-47=0$, and the loop stops at byte \texttt{1}.
The exact result is $2147483630-12=2147483618>0$.  Thus the
many-digit branch is selected.  In
\noderef{num_imp_dec2flt_parse_parse_many_digits}, the first call to
\noderef{num_imp_dec2flt_parse_try_parse_19digits} consumes the integer zero
and stops at the point with accumulator zero.  The exact declaration
\noderef{num_imp_dec2flt_parse_MIN_19DIGIT_INT} makes the loop cutoff
$10^{18}$.  Since zero is below it, the fractional branch skips the point and
restarts.  The checked-loop invariant after reading $j$ digits is that the
accumulator is the base-ten value of the first $j$ suffix digits and the
residual drops exactly those $j$ bytes.  The eleven leading zeroes preserve
zero.  The next nineteen digits are exactly
\texttt{1000000000000000080}; before the nineteenth digit the accumulator is
$100000000000000008<10^{18}$, and after it the accumulator is
$1000000000000000080\geq10^{18}$.  Every intermediate product and sum is at
most that final value and hence below $2^{64}$.  Thus the next guard stops
before the trailing zero run.  Exactly $11+19=30$ fractional bytes were
passed, so the cited \texttt{offset\_from} declaration returns 30; the model
negates it and adds the absent scientific exponent zero, yielding $-30$.

It follows that the record returned by
\noderef{num_imp_dec2flt_parse_parse_partial_number} has exactly the four
fields in the statement, and its returned consumed length is the full body
length.  The equality test in \noderef{num_imp_dec2flt_parse_parse_number}
therefore succeeds and gives \texttt{ok (some d)}.  Because
\noderef{F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64_MAX_EXPONENT_FAST_PATH}
is exactly $22$ and
\noderef{num_imp_dec2flt_Lemire_MIN_EXPONENT_FAST_PATH_default} negates that
value, the two methods selected by
\noderef{F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64} return respectively
$22$ and $-22$.  The first guard in
\noderef{num_imp_dec2flt_decimal_Decimal_can_use_fast_path} is therefore the
false comparison $-22\leq-30$.  The preceding precision setup in
\noderef{num_imp_dec2flt_decimal_Decimal_try_fast_path} is the extracted
no-op \texttt{ok ()} by
\noderef{num_imp_dec2flt_fpu_fpu_precision_set_precision}, so the whole
function receives that false guard and returns \texttt{ok none} before any
conversion or floating-point arithmetic.

We next check the two fixed-width conversions from
\noderef{num_imp_dec2flt_lemire_compute_float}.  The selected instance is
fixed by \noderef{F64_Insts_Dec2flt_modelNumImpTraitsFloatExtU64} and
\noderef{F64_Insts_Dec2flt_modelNumImpTraitsFloatU64}.  Its exact decimal
cutoffs are $-342$ and $308$ by
\noderef{F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_SMALLEST_POWER_OF_TEN}
and
\noderef{F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_LARGEST_POWER_OF_TEN}.
Thus $-30$ is between the cutoffs, and both mantissas are nonzero, so none of
the three early zero/infinity returns applies.  The calls to
\noderef{num_imp_dec2flt_common_BiasedFp_zero_pow2} used to construct those
sentinels all return normally.

For the remaining trait constants,
\noderef{F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_BITS} gives 64, while
\noderef{F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_SIG_TOTAL_BITS} and
\noderef{ModelF64MantissaDigits} give 53.  Substitution into
\noderef{num_imp_traits_Float_SIG_BITS_default},
\noderef{num_imp_traits_Float_EXP_BITS_default},
\noderef{num_imp_traits_Float_EXP_SAT_default}, and
\noderef{num_imp_traits_Float_EXP_BIAS_default} gives, in order,
\texttt{SIG\_BITS}$=52$, \texttt{EXP\_BITS}$=11$,
\texttt{EXP\_SAT}$=2047$, and \texttt{EXP\_BIAS}$=1023$.
Consequently the exact defaults
\noderef{num_imp_traits_Float_EXP_MIN_default} and
\noderef{num_imp_traits_Float_INFINITE_POWER_default} give
\texttt{EXP\_MIN}$=-1022$ and \texttt{INFINITE\_POWER}$=2047$.

Both mantissas have four leading zero bits, so normalization gives
$16000000000000001280$ and $16000000000000001296$, and the precision
argument is $52+3=55$.  The table bounds are exactly $-342$ and $308$ by
\noderef{num_imp_dec2flt_table_SMALLEST_POWER_OF_FIVE} and
\noderef{num_imp_dec2flt_table_LARGEST_POWER_OF_FIVE}; hence the assertions
for $q=-30$ succeed and the index is $-30-(-342)=312$.  The entry there in
\noderef{num_imp_dec2flt_table_POWER_OF_FIVE_128} is
$(11692013098647223345,11611831772799369869)$.  Expanding the two unsigned
128-bit products of the normalized mantissas in
\noderef{num_imp_dec2flt_lemire_full_multiplication}, and
\noderef{num_imp_dec2flt_lemire_compute_product_approx} gives
\[
\begin{array}{c|cc}
w_{\rm normalized} & \mathit{lo} & \mathit{hi}\\ \hline
16000000000000001280 & 13355886962484770048 & 10141204801825836022\\
16000000000000001296 & 15960655803744827408 & 10141204801825836032.
\end{array}
\]
Here the precision mask is $2^9-1=511$, and the two high limbs modulo $512$
are respectively $502$ and $0$, neither $511$.  Thus the optional second
multiplication is not taken.  Neither low limb is $2^{64}-1$, so the
approximation-error return is also not taken.  Both high limbs are at least
$2^{63}$, hence have upper bit one.  Direct evaluation of
\noderef{num_imp_dec2flt_lemire_power} at $-30$ is $-37$, so the biased
power arithmetic is
$-37+1-4-(-1022)+1=983$.  Shifting the two high limbs right by ten gives
$9903520314283042$ and $9903520314283043$.  The round-bit additions and the
following division by two give $4951760157141521$ and
$4951760157141522$; masking off the implicit $2^{52}$ bit gives
$448160529771025$ and $448160529771026$.  In both cases the low limb is
greater than one, so the conjunction for the tie-clearing branch is false.
All table indices, casts, additions, and shift counts just displayed lie in
their fixed-width ranges, and $983<2047$, so the final infinity guard is
false.  This establishes the two stated results.  Their
mantissas differ, so equality of the two records would contradict equality of
their mantissa projections; hence the records are unequal.  Unfolding
\noderef{num_imp_dec2flt_common_BiasedFp_Insts_CoreCmpPartialEqBiasedFp_eq}
returns \texttt{ok false}.

We now verify the dispatch assertion in the lemma statement directly from
\noderef{num_imp_dec2flt_dec2flt_with_trace}.  After the stated
\texttt{parse\_number} and fast-path results, the first conversion is
$(448160529771025,983)$.  Since \texttt{many\_digits} is true and
$983\geq0$, the extracted second-computation guard is true.  Its checked
mantissa increment succeeds because
$1000000000000000080+1=1000000000000000081<2^{64}$.  The stated second
conversion and false comparison therefore take the unequal arm, which keeps
the first mantissa, replaces its biased power by $-1$, and sets the
\texttt{forced\_deferral} flag.  The immediately following slow-path guard is
$-1<0$, so it invokes the binary64
\texttt{parse\_long\_mantissa(body)} call appearing in the statement.  Thus
the two unequal adjacent results do force slow dispatch; no caller
hypothesis is being used for this branch calculation.

It remains to execute the beginning of the slow parser.  In
\noderef{num_imp_dec2flt_decimal_seq_parse_decimal_seq},
\noderef{num_imp_dec2flt_decimal_seq_DecimalSeq_Insts_CoreDefaultDefault_default}
first creates a sequence with \texttt{num\_digits}$=0$ and a zeroed array of
length 768; the same bound is the exact
\noderef{num_imp_dec2flt_decimal_seq_DecimalSeq_MAX_DIGITS} value.  The
leading-zero loop removes the integer zero and leaves the point, and the
first call to \noderef{num_imp_dec2flt_decimal_seq_parse_digits_into_seq}
consumes no byte.  The point branch names the entire fractional suffix
\texttt{first}, of length $2^{31}$.  Its fractional leading-zero loop removes
exactly eleven bytes and stops at \texttt{1}, leaving
$19+K=2147483637$ digits.

At a bulk-loop state with stored count $i$, the guard requires at least eight
remaining bytes and $i+8<768$.  All remaining bytes are digits.  Hence the
direct declarations
\noderef{SliceU8_Insts_Dec2flt_modelNumImpDec2fltCommonByteSlice_read_u64},
\noderef{num_imp_dec2flt_common_is_8digits}, and
\noderef{SliceU8_Insts_Dec2flt_modelNumImpDec2fltCommonByteSlice_write_u64}
respectively read the next eight bytes, accept them, subtract byte $48$ and
write the eight digit values, after which the loop drops eight bytes and
adds eight to $i$.  The subtraction is nonnegative bytewise, the destination
slice has length $768-i\geq16$ at every executed start, and the written
eight-byte prefix is therefore in bounds.  The possible starting counts are therefore
$0,8,\ldots,752$.  Each of these 95 starts succeeds because
$752+8=760<768$; at the next start $i=760$, the storage guard is the false
statement $760+8<768$.  Thus the bulk loop performs exactly 95 iterations,
consumes and stores $95\cdot8=760$ digits, and leaves
$2147483637-760=2147482877$ digits.

The following scalar digit loop consumes all those remaining bytes.  By
\noderef{num_imp_dec2flt_decimal_seq_DecimalSeq_try_add_digit}, each
iteration increments \texttt{num\_digits}, but it updates the array only
while the old count is below 768.  Starting from 760, exactly its first eight
iterations store, filling indices $760$ through $767$; all later iterations
leave the now 768-element stored prefix unchanged while continuing to count
and consume digits.  The largest count is
$760+2147482877=2147483637<2^{64}$, so no checked \texttt{usize} increment
fails.  The returned residual is empty, of the same contents and length zero
as the chosen \texttt{remainder}.

The next three lines of the pinned decimal-sequence definition cast those
two lengths and subtract.  Aeneas \texttt{UScalar.hcast} is the Rust
truncating \texttt{as} cast; with the 64-bit source width from
\noderef{Assumptions}, the low 32 bits of $2^{31}$ denote
$-2147483648=\texttt{i32::MIN}$, while zero casts to zero.  The extracted
subtraction is checked signed subtraction.  Its mathematical result would
be $2147483648$, one above \texttt{i32::MAX}, so it returns
\texttt{fail integerOverflow}.  This happens before trailing-zero counting
or any later decimal arithmetic.  Result-monad binding propagates the same
failure out of \texttt{parse\_decimal\_seq}.  Finally,
\noderef{num_imp_dec2flt_slow_parse_long_mantissa} first constructs its zero
and infinity records normally using the cited \texttt{zero\_pow2} and
\texttt{INFINITE\_POWER} declarations, then binds
\texttt{parse\_decimal\_seq} before examining the decimal sequence.  The
identical failure therefore propagates from that bind.  It also propagates
from the slow call selected in the dispatcher calculation above, before any
assembly.  This proves every conjunct and the stated forced-dispatch claim.
\end{proof}
