\begin{lemma}[Byte-digit decoding and fold transport]
For every U8 list $B$ the following hold, writing $\delta(b)=b.\mathit{val}-48$
with natural subtraction. If all its bytes have values in $[48,57]$,
all members of $\operatorname{map}(\delta,B)$ are below ten, and
$\operatorname{map}(\mathit{val},B)=
\operatorname{map}(d\mapsto48+d,\operatorname{map}(\delta,B))$.
Moreover, for any natural list $D$ whose encoded value map equals
$\operatorname{map}(\mathit{val},B)$, its decoding is exactly $D$,
$|B|=|D|$, and for every function $H:\mathbb N\times\mathbb N\to\mathbb N$
and starting accumulator $a$,
\[
\operatorname{foldl}((n,b)\mapsto H(n,\delta(b)),a,B)
=\operatorname{foldl}(H,a,D).
\]
No digit-range hypothesis on $D$ is needed for this second assertion.
\end{lemma}
\begin{proof}
If $48\le b.\mathit{val}\le57$, subtraction gives
$\delta(b)<10$ and $48+\delta(b)=b.\mathit{val}$. Every decoded
member comes from such a byte; mapping the latter equality proves
the reencoding assertion. For the second assertion, map natural
subtraction by 48 over the assumed value-map equality. On an encoded
natural number $d$, $(48+d)-48=d$, without any bound on $d$.
Composition of maps therefore gives $\operatorname{map}(\delta,B)=D$.
Taking lengths yields $|B|=|D|$. To prove fold transport, induct on $B$
and generalize the accumulator. The empty fold is $a$ on both sides.
For a head $b$, both folds first update to $H(a,\delta(b))$; induction
at that accumulator equates the remaining folds. Replace the decoded
list by $D$. The arbitrary function $H$ includes both ordinary decimal
accumulation and the pre-update $2^{59}$ cutoff fold, so this argument
does not change when updates stop.
\end{proof}
