\begin{lemma}[Slow normalization loop one with fixed endpoints]
Suppose $-324\leq p_0\leq0$, $e_0\geq0$, and $d_0$ has decimal cells and
positive-leading shape.  Fix $A<B$ through witnesses
\[
 A/2^{e_0}=V(d_0)+\eta_0,\qquad
 B/2^{e_0}=V(d_0)+u_0,\qquad0\leq\eta_0<u_0,\qquad
 d_0.\mathit{truncated}\iff0<\eta_0.
\]
The second extracted loop terminates after at most 21 left shifts, returns
`none', and has $e_1\leq e_0$, point zero, nonzero count, and first digit in
$[5,9]$.  Its retained count is at most 768, every retained digit is below
10, and its retained digits have the form $z::zs$, of length equal to the
retained count, with $5\leq z<10$.  It preserves the two fixed endpoints:
\[
 A/2^{e_1}=V(d_1)+\eta_1,\qquad
 B/2^{e_1}=V(d_1)+u_1,\qquad0\leq\eta_1<u_1,\qquad
 d_1.\mathit{truncated}\iff0<\eta_1.
\]
No lower bound on $e_1$ is claimed by this generic loop contract.
\end{lemma}
\begin{proof}
Use the loop-one definition in
\noderef{num_imp_dec2flt_slow_parse_long_mantissa}.  After $s$ left shifts,
write $q,r,e,z$ for the current record, point, exponent, and leading digit.
Maintain
\[
\begin{gathered}
-324\le r\le0,\qquad e_0-60s\le e\le e_0,\\
q\text{ has at most 768 decimal cells and retained word }z::z_s,
\quad1\le z<10,\\
A/2^e=V(q)+\eta_s,quad B/2^e=V(q)+u_s,quad
0\le\eta_s<u_s,quad q.\mathit{truncated}\iff0<\eta_s.              \tag{1}
\end{gathered}
\]
The simultaneous step budget is
\[
\begin{array}{ll}
r\le-19&\Longrightarrow 18s-r\le324,\\
-18\le r\le-2&\Longrightarrow s\le17,\\
r=-1, z<7&\Longrightarrow s\le18,\\
r=-1, z\ge7&\Longrightarrow s\le19,\\
r=0, z\le2&\Longrightarrow s\le19,\\
r=0, 3\le z<5&\Longrightarrow s\le20,\\
r=0, z\ge5&\Longrightarrow s\le21.
\end{array}                                                        \tag{2}
\]
For $s=0$, (1) is exactly the hypothesis.  If $r\le-19$, its lower bound
$r\ge-324$ gives $18s-r=-r\le324$; every other applicable clause of (2) is
immediate.

The seven clauses of (2), partitioned by $r$ and $z$, first give $s\le21$.
Together with $e_0\ge0$ and (1), this proves the pre-update lower bound
$e\ge-1260$.  Apply \noderef{P804_T1_LeftLoopStep} with the current
endpoints $A/2^e$ and $B/2^e$.  Its done alternative is possible precisely
at $r=0,z\ge5$ and supplies the unchanged extracted return.  Its continuation
alternative supplies the exact body and shift calls, $k\le60$, a successor
$q'$ with leading digit $z'$, and
\[
                              e'=e-k.                              \tag{3}
\]
The subtraction is safe where it occurs: the helper uses
$e\ge-1260$ to obtain $e-k\ge-1320>-2^{31}$, while $k\ge0$ and the intrinsic
I32 upper bound on $e$ give $e-k<2^{31}$.  Thus (3) is the mathematical value
of the checked subtraction, not an equation inferred only after termination.
Moreover, (1) and $k\le60$ give simultaneously
\[
 e_0-60(s+1)\le e-k=e'\le e_0.                                    \tag{4}
\]

The helper transports shape, sticky equivalence, and both endpoint errors
to $2^k(A/2^e)$ and $2^k(B/2^e)$.  The integer-power law and (3) identify
these quantities with $A/2^{e'}$ and $B/2^{e'}$, proving all endpoint clauses
of (1) for the successor.  Its point alternatives also keep
$-324\le r'\le0$: from $r\le-19$ one adds 18 or 19, from
$-18\le r<0$ one obtains $-1$ or zero, and from point zero one remains at
zero.  In particular $r'$ is never positive.  The extracted point-range
constant is $2047$ by
\noderef{num_imp_dec2flt_decimal_seq_DecimalSeq_DECIMAL_POINT_RANGE}; hence
the comparison that would replace the record by infinity is false at every
step.  This explicitly accounts for the reset branch in the extracted body.

We next prove preservation of (2), retaining the correlations supplied by
\noderef{P804_T1_LeftLoopStep}.  If $r\le-19$, then
$r'=r+18$ or $r'=r+19$.  While $r'\le-19$,
\[
 18(s+1)-r'\le18s-r\le324.
\]
If the step enters a later regime, $18s-r\le324$ and $r\le-19$ imply
$s\le16$, so $s+1\le17$, stronger than all relevant bounds.  If
$-18\le r\le-2$, the old $s\le17$ and $r'\in\{-1,0\}$ give
$s+1\le18$, again sufficient for each possible successor clause.

At $r=-1,z<7$, the old bound is $s\le18$.  A stall has
$r'=-1$ and, crucially, $z'\ge7$, so $s+1\le19$ proves the large-leading
point-minus-one clause.  A nonstall reaches point zero and
$s+1\le19$, sufficient regardless of its new leading category.  At
$r=-1,z\ge7$, the helper's correlated recovery gives both $r'=0$ and
$z'\ge5$; the old $s\le19$ therefore yields $s+1\le20\le21$.
Finally, a continuing point-zero state has $z<5$.  If $z\le2$, then
$s\le19$ and $z'\ge3$; thus $s+1\le20$, sufficient whether $z'<5$ or
$z'\ge5$.  If $3\le z<5$, then $s\le20$ and the helper gives $z'\ge5$,
so $s+1\le21$.  This proves every successor clause of (2).  It is also the
promised three-step tail analysis: a possible $(-1,z<7)$ stall moves to
$(-1,z\ge7)$, that state moves to $(0,z\ge5)$, while a low point-zero digit
moves first to the middle point-zero class and then to the exit class.

For well-foundedness use
\[
R(r,z)=
\begin{cases}
4(-r)+0,&r<0, z\ge7,\\
4(-r)+1,&r<0, z<7,\\
0,&r=0, z\ge5,\\
2,&r=0, z\le2,\\
1,&r=0, 3\le z<5.
\end{cases}
\]
Adding 18 or 19 to a point at most $-19$ strictly lowers the first component;
from points $-18$ through $-2$, reaching $-1$ or zero also strictly lowers
the displayed rank.  At point $-1$, a stall changes the final flag from one
to zero, and any move to point zero has new rank at most two, below the old
rank of at least four.  At point zero, the two correlated progress clauses
change rank $2$ to at most $1$, or rank $1$ to $0$.  Every continuation
therefore strictly decreases $R$, so the extracted loop rule terminates.

On termination (2)'s last clause gives $s\le21$.  The postcondition is
$r=0,z\ge5$; (1) also gives $z<10$, nonempty exact-length shape, all digit
bounds, the exact loop call, and the two endpoint witnesses.  Inequality (4)
gives the claimed $e_1\le e_0$.  No lower bound on $e_1$ beyond the generic
inductive one was used or asserted, completing precisely the stated
existential.
\end{proof}
