\begin{lemma}[Saved-count finalization and exact fill]
Let $a$ be a scanned record, $n=a.\mathit{num\_digits.val}=|C|$,
and let $f:\texttt{Usize}$, $e:\texttt{I64}$, $c,z:\texttt{Usize}$.
Assume $n,f.\mathit{val}\le2^{63}-1$, false scan sticky flag,
$C=T\mathbin{++}0^{z.\mathit{val}}$, and a normal length-difference
equation $\texttt{len}(s)-\texttt{len}(u)=\texttt{ok}\ c$.
When $C\ne[]$, assume the actual reverse-count call on $(s,c)$ returns
$\texttt{ok}\ z$. Assume the first $\min(|C|,768)$ scan cells have
value list $\operatorname{take}(\min(|C|,768),C)$, and all 768 scan
cell values are below ten.

The following computation returns normally with $d$: if the scan count
is nonzero, compute that length difference and reverse count, subtract the
count from the scan count, then cap at 768, setting sticky true exactly
when the uncapped result exceeds 768; if the scan count is zero, retain
its count and flag. Call \texttt{final\_decimal\_point} with the ORIGINAL
scan count, $f,e$, fill loop 1 from the selected count to 19, and construct
the result from that count, point, flag, and array.

Its actual finalizer call equals $\texttt{ok}\ d.\mathit{decimal\_point}$.
Its point value is zero when $|C|=0$ and otherwise
$\max(-2047,\min(2047,|C|-f.\mathit{val}+e.\mathit{val}))$.
Its retained count is $r=\min(|T|,768)$, retained value list is
$\operatorname{take}(r,T)$, and sticky is true iff $768<|T|$.
The first $r$ actual U8 scan cells are preserved by filling. For every
$j<768$, the output cell is U8 zero on $r\le j<19$, and the scan cell
otherwise. All output cell values are below ten.
\end{lemma}
\begin{proof}
Use the finalization operations in
\noderef{num_imp_dec2flt_decimal_seq_parse_decimal_seq}. If $C=[]$,
the split implies $T=[]$ and $z.\mathit{val}=0$. The scan count is
Usize zero by value injectivity, so the branch retains count zero and
false flag, exactly $\min(|T|,768)$ and the required false equivalence.
There is no reverse-count call in this branch; the conditional hypothesis
about that call is not used.

If $C\ne[]$, its length is positive and the source takes the nonzero
arm. The two supplied actual call equations identify the length difference
and reverse-count results. Taking lengths of
$C=T\mathbin{++}0^{z.\mathit{val}}$ gives
$|C|=|T|+z.\mathit{val}$. Thus checked Usize subtraction is safe and
returns a kept count of exactly $|T|$. By the pinned MAX\_DIGITS constant
\noderef{num_imp_dec2flt_decimal_seq_DecimalSeq_MAX_DIGITS}, comparison
against the cap is exactly comparison against 768. The cap branch yields
count 768 and true flag when $|T|>768$; otherwise it yields $|T|$ and
the input false flag. Hence count $r$ and the sticky equivalence hold.

In either branch, \noderef{P9_T1_FinalPointExact} applies to the original
scan count and $f$, with their stated bounds, and to the arbitrary I64
$e$. It supplies the NORMAL actual finalizer result and exactly the point
formula. No bound on $n-f+e$ is assumed; that principal accounts for signed
saturation before clamping. Its operand is $n$, not $r$ or $|T|$.

Since $r\le|T|\le|C|$ and $r\le768$, taking $r$ entries of the
stored-prefix equation gives the scan's first $r$ values equal to
$\operatorname{take}(r,C)=\operatorname{take}(r,T)$, using the split.
Apply \noderef{P495_T1_FillExact} to selected count $r$ and the scan array.
It supplies the normal fill result, preserves precisely the first $r$
U8 cells, gives the displayed cell-by-cell equation, and propagates the
all-cell digit bound. Assemble these normal results in the indicated
monadic order to obtain $d$ and every asserted equation. In particular,
when $r\ge19$ the fill has no writes; it does not clear unused cells
through 768 or assume the retained prefix has a nonzero last cell.
\end{proof}
