\begin{lemma}[Scientific scan of arbitrary byte slices]
For every Aeneas byte-slice carrier $s$, there exist an optional sign
$\sigma$, byte lists $D,R$, an optional I64 exponent $v$, and a residual
slice $r$ with the following properties. The slice contents are
$\operatorname{signBytes}(\sigma)\mathbin{++}D\mathbin{++}R$, where
the sign bytes are empty, [43], or [45] for absent, plus, or minus sign.
Every member of $D$ is an ASCII digit, and $R$ is empty or has a nondigit
head. The actual scientific call returns $\texttt{ok}(v,r)$, with
$r.\mathit{val}=R$; $v=\texttt{none}$ exactly when $D=[]$.
Whenever $v=\texttt{some}(e)$,
\[
-C\le e.\mathit{val}\le C,\qquad
e.\mathit{val}=\varepsilon(\sigma)
\operatorname{foldl}(\Phi,0,\operatorname{map}(b\mapsto b.\mathit{val}-48,D)),
\]
where $C=5764607523034234879$, $\varepsilon=-1$ only for minus,
and $\Phi(a,d)=10a+d$ if the old $a<2^{59}$, and $\Phi(a,d)=a$ otherwise.
The fold uses natural arithmetic. There is no length, UTF-8, or
exponent-digit-count restriction beyond the slice carrier itself.
\end{lemma}
\begin{proof}
Split the contents of $s$ into the empty case or a head and tail.
If the head is 45 or 43, choose respectively minus or plus and apply
\noderef{P364_T1_NumberHelperDigitPrefix} to the remaining list.
Otherwise choose no sign and apply that lemma to the original list.
It supplies the digit list $D$ and nondigit-headed or empty residual $R$.
In the no-sign case, if $D=[]$ and $R$ is nonempty, its head is the
original head and is neither 45 nor 43. Thus this decomposition also
has the extra no-sign condition in
\noderef{NumberHelperScientificClassificationSourceLength}.

Apply that classification theorem to the original carrier and this
decomposition. When $D=[]$, it returns normally with no exponent and
contents $R$, and the asserted conditional value clause is vacuous.
When $D\ne[]$, it returns normally with some exponent $e$ and contents
$R$, bounded by $[-C,C]$. Apply
\noderef{P9_T1_ScientificVocabularyFold} to the same decomposition.
Its nonempty, digit-range, nondigit-head and slice premises are precisely
the ones just established. It supplies another normal Some result with
the displayed signed natural fold. The two results of the same
Result-valued call are equal; injectivity of normal results, pairs and
Some identifies their exponents. This transfers the exact fold equation
to $e$ while retaining both bounds and the original residual.
In the two cases the option constructor is None exactly when $D=[]$.
The cited scanner results consume the whole maximal digit run, including
digits after updates stop; the fold retains a one-update overshoot and
does not replace it with the threshold.
\end{proof}
