\begin{helper}[Exact reverse terminal-zero scan]
Let the bytes of a slice decompose as $A\mathbin{++}Z\mathbin{++}T$.
Assume $A$ is empty or ends in a byte that is neither ASCII zero nor the
point byte, every byte of $Z$ is ASCII zero or the point byte, and the reverse
scan begins at index $|A\mathbin{++}Z|$ with count $n$.  If adding the number
of zero bytes of $Z$ to $n$ is Usize-representable, the extracted trailing-zero
loop returns normally with exactly that sum.  Thus a point inside $Z$ is
skipped and contributes nothing, while every zero on either side contributes
one.
\end{helper}
\begin{proof}
Proceed by reverse induction on $Z$, using the loop and body in
\noderef{num_imp_dec2flt_decimal_seq_count_trailing_zeros}.  For the empty
suffix, if $A$ is empty the cursor is zero and the loop returns $n$
immediately.  Otherwise write $A=A'\mathbin{++}[b]$.  The cursor is positive,
checked subtraction by one produces $|A'|$, and exact slice indexing reads
$b$.  Since $b$ is neither 48 nor 46, the model changes
\texttt{scanning} to false without changing the cursor or count; the next
iteration returns $n$.

For a nonempty suffix write $Z=Z'\mathbin{++}[b]$.  Exact length arithmetic
shows that checked cursor subtraction produces $|A\mathbin{++}Z'|$, and the
indexed byte is $b$.  If $b=48$, the Usize bound justifies the checked count
increment and the body continues with $n+1$; reverse induction on $Z'$ then
returns
$(n+1)+\#_0(Z')=n+\#_0(Z)$.  If $b=46$, the body's point branch continues
with the same count; reverse induction gives
$n+\#_0(Z')=n+\#_0(Z)$.  These are the only cases by the suffix hypothesis.
The consumed-prefix cursor never enters $T$, so the argument also records the
precise stop state required by the parser.
\end{proof}
