\begin{lemma}[Exact long decimal-sequence result]
Let \(N=2147483648\).  If an Aeneas byte slice \(s\) satisfies
\(s.\mathit{val}=\operatorname{replicate}(N,49\#\mathrm{u8})\), then there
is an array \(a\) of 768 unsigned bytes for which
\texttt{parse\_decimal\_seq(s)} returns the record
\[
 \{\mathit{num\_digits}=768,\ 
   \mathit{decimal\_point}=-2147483648,\ 
   \mathit{truncated}=\mathrm{true},\
   \mathit{digits}=a\}.
\]
\end{lemma}
\begin{proof}
Unfold the decimal parser in
\noderef{num_imp_dec2flt_decimal_seq_parse_decimal_seq}.  Its default record,
from
\noderef{num_imp_dec2flt_decimal_seq_DecimalSeq_Insts_CoreDefaultDefault_default},
has zero count, zero point, false truncation, and a 768-byte zero array.
The input is nonempty.  Its bounds-checked zeroth byte is \(49\), so the
leading-zero loop sees a byte unequal to \(48\) and immediately returns the
original slice.

Apply \noderef{SlowAccumulatedRoundingCount} to the following digit loop.  It
returns an empty residual slice and a sequence \(d_1\) with exact count \(N\),
zero point, and false truncation.  During those iterations the first 768
digits are the only array entries eligible for update; each scanned digit is
\(49-48=1\), and later iterations leave the bounded array alone.  Denote the
resulting array by \(a=d_1.\mathit{digits}\).  The theorem only needs this
array's fixed type, not an extensional expansion of its 768 entries.

The consumed length is \(N-0=N\).  The last bounds-checked input byte, at
index \(N-1=2147483647\), is \(49\), not ASCII zero; hence
\noderef{num_imp_dec2flt_decimal_seq_count_trailing_zeros} takes one loop
step and returns zero trailing zeroes.  Casting that zero to \texttt{i32}
gives zero.  The parser's cast of the consumed count is the 32-bit
two's-complement narrowing
\[
 \operatorname{hcast}_{\mathrm{i32}}(2147483648)
   = -2147483648.
\]
This equality follows directly by comparing the 32-bit vectors, whose
unsigned value on both sides is \(2^{31}\).  Adding it to the old point zero
does not overflow and gives \texttt{i32::MIN}.

Since \(N>768\), the parser exposes
\(\min(N,768)=768\) as its final digit count and changes the truncation flag
to true.  The cleanup range starts at 768 and ends at the fixed
\texttt{MAX\_DIGITS\_WITHOUT\_OVERFLOW} value 19, so its comparison is false
and it performs no update.  Substitution into the cited parser definition
gives exactly the displayed record.
\end{proof}
