\begin{lemma}[Returned-record semantics of decimal left shift]
For a decimal sequence $d$, write
\[
 V(d)=\operatorname{fold}_{10}
   (d.\mathit{digits}[0:d.\mathit{num\_digits}])
   10^{d.\mathit{decimal\_point}-d.\mathit{num\_digits}}.
\]
Let $0\le k\le60$, suppose $V(d)>0$, and suppose every cell in the stored
prefix is a decimal digit.  If the extracted left shift by $k$ returns $d'$,
then there is a real number $\rho$ such that
\[
 0\le \rho<10^{d'.\mathit{decimal\_point}-768},
\]
\[
 V(d')=2^kV(d)-\rho
\]
and
\[
 d'.\mathit{truncated}=\mathrm{true}
 \quad\Longleftrightarrow\quad
 d.\mathit{truncated}=\mathrm{true}\ \text{or}\ \rho>0.
\]
\end{lemma}
\begin{proof}
Put $n=d.\mathit{num\_digits}$ and $p=d.\mathit{decimal\_point}$, and first
use only the list that occurs in the definition of $V$:
\[
 x=d.\mathit{digits}[0:n],\qquad I=\operatorname{fold}_{10}(x).
\]
If $n=0$, the actual take-zero list $x$ is empty, its base-ten fold is zero,
and therefore $V(d)=0\cdot10^p=0$.  This contradicts $V(d)>0$, so $n>0$.
Consequently the zero-count return in the unfolded definition
\noderef{num_imp_dec2flt_decimal_seq_DecimalSeq_left_shift} is impossible.

Follow the successful nonzero execution through the digit-growth call and
the checked width addition to its first call of
\texttt{left\_shift\_loop0}.  Its first body step decrements the positive
read index $n$ and then reads cell $n-1$.  A failing decrement or array read
cannot lie on an execution whose enclosing call returns normally.  The
digit array has exactly 768 cells by
\noderef{num_imp_dec2flt_decimal_seq_DecimalSeq}, and the cap has value 768
by \noderef{num_imp_dec2flt_decimal_seq_DecimalSeq_MAX_DIGITS}; hence the
successful read gives $n-1<768$, and therefore $n\le768$.  This also covers
an unrestricted Aeneas state whose count initially exceeds its physical
array: such a state cannot meet the successful-call hypothesis.

Only now name the physical cells $a_0,\ldots,a_{n-1}$ and put
\[
 I_r=\sum_{j=n-r}^{n-1}a_j10^{n-1-j}.
\]
The established bound makes all these cells physical, the definition of the
base-ten fold gives $I=I_n$, and hence $V(d)=I10^{p-n}$.  In particular
$I>0$, since the scale is positive and $V(d)>0$.

Handle $k=0$ separately.  The digit-growth routine in the unfolded left
shift returns $q=0$: its two table reads and empty comparison slice at index
zero are certified by \noderef{DecimalLeftShiftTableCertificate}, and direct
unfolding of
\noderef{num_imp_dec2flt_decimal_seq_number_of_digits_decimal_left_shift}
then takes the zero high field.  In the first reverse loop, a shift by zero changes a
cell $a$ into $a$, the incoming carry is initially zero, division by ten
returns quotient zero because $a<10$, and the remainder is $a$.  The read
and write indices therefore decrease together from $n$.  Equivalently,
\noderef{DecimalLeftShiftFirstLoopSemantics} gives cursor and carry zero,
the original length-$n$ digit list, and an unchanged Boolean because every
destination is below 768.  Apply
\noderef{DecimalLeftShiftSecondLoopSemantics} with cursor and carry zero;
its zero-padding premise is vacuous, its output list is empty, and it leaves
both the array and Boolean unchanged.  The cap comparison selects $n$, the
cast of zero is zero, the point addition returns $p$, and the terminal trim
preserves the value and truncation Boolean by
\noderef{DecimalSeqTrimSemantics}.  Taking $\rho=0$ proves both displayed
claims in this case.  The additional strict bound also holds because every
real power of the positive base 10 is positive, so
$0<10^{d'.\mathit{decimal\_point}-768}$.

Assume now $k>0$, and set $B=2^k$.  Let $h$ be the unique positive integer
with
\[
                         10^{h-1}<B<10^h.                 \tag{1}
\]
Such an $h$ exists with $1\le h\le19$: powers of ten are strictly
increasing, $1<B$, and $B\le2^{60}<10^{19}$.  Apply
\noderef{DecimalLeftShiftDigitGrowth} using (1), the just-proved
$n\le768$, and the decimal-cell hypothesis.  It says that the extracted
digit-growth call returns a number $q$ equal to $h$ or $h-1$ according as
$IB$ does or does not reach $10^{n+h-1}$.  Consequently
\[
                         IB<10^{n+q}.                     \tag{2}
\]
Indeed, in the $q=h$ branch the decimal-digit bound $I<10^n$ and
$B<10^h$ give the result; in the $q=h-1$ branch it is exactly the negation
of the threshold test.  Thus $L:=n+q$ is a fixed output width for $IB$,
possibly with leading zeroes when the input itself has leading zeroes.  In particular
$0\le q\le19$, so the checked addition $n+q$ is far below the maximum
machine-size value and returns $L$.

Apply \noderef{DecimalLeftShiftFirstLoopSemantics} to the first reverse
carry loop with input array $d.\mathit{digits}$, read index $n$, write index
$L=n+q$, zero carry, and the original truncation Boolean.  Its hypotheses
are exactly $k\le60$, the just-proved $n\le768$, $n\le L$, and the stated
decimal-digit condition.  Unfolding the successful outer call supplies the
required normal return of this loop.  The helper returns a digit list
$e=(e_0,\ldots,e_{n-1})$, a carry $c_n<B$, and a write index $w_1$ with
$w_1+n=L$.  Thus $w_1=q$, and, if $W_n$ is the base-ten fold of $e$,
\[
                         BI=c_n10^n+W_n.                 \tag{8}
\]
Every position $q+j<768$ visited by this loop contains $e_j$, every cell
outside $[q,L)$ is unchanged, and its returned Boolean is the input Boolean
OR nonzeroness of exactly those $e_j$ whose destination $q+j$ is at least
768.  These are the array and sticky premises needed below.

The second reverse loop expands $c_n$ into the remaining $q$ leading product
digits.  First, (2) and (8) give
$c_n10^n\le BI<10^{n+q}$, hence $c_n<10^q$.  We also establish the
zero-padding premise of \noderef{DecimalLeftShiftSecondLoopSemantics}.
Fix $j<q$ with $j<768$ and suppose
$c_n<10^{q-j-1}$.  The first-loop unchanged-region clause identifies its
cell at $j$ with the original input cell.  If the growth comparison selected
$q=h$, combining this carry bound with $W_n<10^n$ in (8) would give
$BI<10^{n+h-1}$, contradicting the selected threshold.  If it selected
$q=h-1$, first $j<n$: otherwise the same upper bound, together with
$I\ge1$ and $10^q<B$, would give $BI<B\le BI$.  Were the original cell at
$j$ nonzero, positional base-ten bounds would give
$I\ge10^{n-j-1}$; multiplying by $B>10^q$ would then contradict the strict
upper bound on $BI$ obtained from (8), the assumed carry bound, and
$W_n<10^n$.  Thus the cell is zero in either growth branch.

Apply \noderef{DecimalLeftShiftSecondLoopSemantics} with these two premises
and the normal loop return supplied by the successful outer call.  It yields
a length-$q$ decimal list whose fold is $c_n$, stores that list in every
physical position below $q$, preserves all cells at or beyond $q$, and sets
the Boolean precisely for its nonzero digits with destinations at least 768.
The helper's padded-prefix conclusion covers the case in which the carry has
fewer than $q$ decimal digits: all unwritten positions before its final
cursor are the just-proved original leading zeroes.  Concatenating this list
with $e$ and using (8) therefore gives the complete fixed-width base-ten
expansion of $BI$, while combining the helpers' two Boolean equivalences
accounts for exactly every omitted nonzero digit.

Combining the two loop invariants, let
$b_0,\ldots,b_{L-1}$ be the width-$L$ base-ten expansion of $IB$, padded by
leading zeroes when necessary.  Before trimming, the
returned array stores $b_j$ at every $j<\min(L,768)$, its count is
$m=\min(L,768)$, its point is $p+q$, and its Boolean is
\[
 d.\mathit{truncated}\ \mathsf{or}\
       (\exists j,\ 768\le j<L\ \text{and}\ b_j>0).       \tag{9}
\]
The point addition is checked safely: $q\le19$, and a normally returned
outer call proves the required I32 range side condition.  The count cap is
exactly the branch selecting 768 when $L>768$.

Define the omitted integer suffix
\[
 E=\sum_{j=768}^{L-1} b_j10^{L-1-j},
\]
with $E=0$ when $L\le768$, and define
\[
   \rho=E10^{p+q-L}.                           \tag{10}
\]
All summands and the scale in (10) are nonnegative, so $\rho\ge0$, and
$\rho>0$ holds exactly when some omitted digit is positive.  Splitting the
base-ten expansion of $IB$ after the first $m$ digits shows that the
pre-trim record value is
\[
 (IB)10^{p-n}-\rho=2^kV(d)-\rho;                         \tag{11}
\]
here $p+q-L=p-n$ because $L=n+q$.  Its count is at most the 768-cell array
length, so \noderef{DecimalSeqTrimSemantics} applies to the terminal trim.
That lemma preserves the record value and truncation Boolean.  Equations
(9)--(11) therefore hold for the actual returned $d'$; it also preserves the
point, so $d'.\mathit{decimal\_point}=p+q$.

It remains to check the strict loss bound.  If $E=0$, then $\rho=0$ and the
bound follows from positivity of a power of 10.  If $E>0$, the omitted suffix
is nonempty, so $L>m$.  Since $m=\min(L,768)$, this forces $m=768$.  Every
omitted cell is one of the decimal product digits and is therefore below 10.
Induction over these $L-768$ cells gives the strict base-ten fold estimate
\[
 E<10^{L-768}.
\]
Multiplying by the positive scale in (10) and using the preserved point gives
\[
 \rho < 10^{L-768}10^{p+q-L}
       =10^{p+q-768}
       =10^{d'.\mathit{decimal\_point}-768}.
\]
This is a bound on the suffix discarded by this one shift, not on any error
accumulated across several shifts.  Since the second
disjunct of (9) is equivalent to $\rho>0$, they give exactly the asserted
strict bound, value equation, and Boolean equivalence.
\end{proof}
