\begin{theorem}
For every normally successful numeric execution whose trace selects a raw pair for final assembly, the selected pair's signed biased-exponent field lies between 0 and 2047 inclusive.
\end{theorem}
\begin{proof}
Write $F_0$ for the \texttt{Float} component reached through the
\texttt{traitsFloatExtInst} field of
\noderef{F64_Insts_Dec2flt_modelNumImpDec2fltLemireU64}.  By
\noderef{F64_Insts_Dec2flt_modelNumImpTraitsFloatExtU64} that component is
exactly \noderef{F64_Insts_Dec2flt_modelNumImpTraitsFloatU64}.  We first
evaluate the f64 constants used below.  By
\noderef{F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_BITS},
\texttt{BITS}$=64$.  The declaration
\noderef{F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_SIG_TOTAL_BITS} calls the
operation \noderef{ModelF64MantissaDigits}, which returns $53$.  Thus the
checked subtraction in \noderef{num_imp_traits_Float_SIG_BITS_default} is
$53-1=52$, and \texttt{SIG_BITS}$=52$.  The two checked subtractions in
\noderef{num_imp_traits_Float_EXP_BITS_default} are $64-52=12$ and
$12-1=11$, so \texttt{EXP_BITS}$=11$.  In
\noderef{num_imp_traits_Float_EXP_SAT_default}, the shift count $11$ is below
the 32-bit width, $1\mathbin{\mathtt{<<}}11=2048$, and the following checked
subtraction gives \texttt{EXP_SAT}$=2047$.  Hence
\noderef{num_imp_traits_Float_INFINITE_POWER_default} casts the in-range
unsigned value $2047$ to the signed value $2047$, while
\noderef{num_imp_traits_Float_EXP_BIAS_default} shifts $2047$ right once and
gives $1023$.  Finally \noderef{num_imp_traits_Float_EXP_MIN_default} casts
$1023$ exactly, subtracts one without overflow, and negates $1022$, giving
\texttt{EXP_MIN}$=-1022$.  These computations also show that every monadic
operation in the constant chain succeeds.  The other f64 constants which are
read in the integer converter are $-342$, $308$, $-4$, and $23$ by
\noderef{F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_SMALLEST_POWER_OF_TEN},
\noderef{F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_LARGEST_POWER_OF_TEN},
\noderef{F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_MIN_EXPONENT_ROUND_TO_EVEN},
and
\noderef{F64_Insts_Dec2flt_modelNumImpTraitsFloatU64_MAX_EXPONENT_ROUND_TO_EVEN}.

We next prove the following range fact directly from
\noderef{num_imp_dec2flt_lemire_compute_float}:
\[
 \texttt{compute_float}(F_0,q,w)=\texttt{ok }b
 \quad\Longrightarrow\quad
 b.p_{\rm biased}=-1\quad\hbox{or}\quad
 0\leq b.p_{\rm biased}\leq2047.                 \tag{1}
\]
The pair carrier has the two extracted fields \texttt{m} and
\texttt{p_biased}.  The three eager calls to
\noderef{num_imp_dec2flt_common_BiasedFp_zero_pow2} produce, respectively,
$fp_0=(0,0)$, $fp_\infty=(0,2047)$, and $fp_{\rm error}=(0,-1)$; this accounts
for the zero-mantissa return, the two decimal-cutoff returns, and the
approximation-error return.  If none of those returns is taken, then $w\ne0$
and $-342\leq q\leq308$.  Consequently its leading-zero count is in
$0,\ldots,63$, normalization shifts by a legal count, the cast of
\texttt{SIG_BITS} to \texttt{usize} is $52$, and the checked precision
addition is $52+3=55$.  The identical table bounds $-342$ and $308$ in
\noderef{num_imp_dec2flt_table_SMALLEST_POWER_OF_FIVE} and
\noderef{num_imp_dec2flt_table_LARGEST_POWER_OF_FIVE}, together with the
651-entry declaration
\noderef{num_imp_dec2flt_table_POWER_OF_FIVE_128}, show that
\noderef{num_imp_dec2flt_lemire_compute_product_approx} receives a legal
precision and a table index $q-(-342)$ in $0,\ldots,650$.  Its mask shift is
therefore legal.  The two widening casts and 128-bit product in
\noderef{num_imp_dec2flt_lemire_full_multiplication} are exact because the
product of two 64-bit words fits in 128 bits; its shift by 64 is legal.  A
possible checked increment of the returned high limb, and every operation in
the product approximation which could nevertheless fail, is bound through
the surrounding result monad: such a failure would make the assumed
\texttt{compute_float} equation a failure rather than \texttt{ok }b.  No
range conclusion below is inferred from a value on such a failing branch.

There are two copies of the remaining calculation in the extracted
definition: one below the \texttt{lo = u64::MAX} test when the additional
$-27\leq q\leq55$ test succeeds, and one below its false branch.  They are
textually identical, so we check both by checking that common block.  Shifting
the high product limb right by 63 is legal and yields an
\texttt{upperbit} in $\{0,1\}$.  Its cast to \texttt{i32} is exact;
$64+\texttt{upperbit}$ is 64 or 65; and the checked subtractions of 52 and 3
give the legal mantissa shift 9 or 10.  The cast of $q$ from \texttt{i64} to
\texttt{i32} is exact because $-342\leq q\leq308$.  In
\noderef{num_imp_dec2flt_lemire_power}, the checked constant addition is
$152170+65536=217706$, the product with $q$ lies between $-74455452$ and
$67053448$ and hence the wrapping product equals the mathematical product,
the shift by 16 is legal, and adding 63 gives a value between $-1074$ and
$1086$.  Adding \texttt{upperbit}, casting the leading-zero count exactly,
subtracting that count, subtracting \texttt{EXP_MIN}$=-1022$, and adding one
therefore keep the intermediate \texttt{power2} between $-114$ and $2110$.
All those signed additions and subtractions are consequently in range.  This
discharges the casts, shifts, and checked arithmetic through the
\texttt{power2} test in each duplicated block.

If \texttt{power2 <= 0}, its checked negation is at most 114 and cannot be the
forbidden negation of \texttt{i32::MIN}.  The following checked addition by
one is at most 115.  A value at least 64 returns $fp_0$; otherwise the repeated
addition by one gives a shift count in $1,\ldots,63$.  The two right shifts,
by that count and by one, are legal; the conjunction with one is total by
\noderef{ModelU64BitAnd}; and if the intervening mantissa addition overflowed,
the result monad would preclude the assumed successful return.  The shift
$1\mathbin{\mathtt{<<}}52$ is legal by \noderef{ModelU64Shl}.  The returned
exponent is the signed cast of the Boolean comparison, hence exactly zero or
one.

If \texttt{power2 > 0}, all round-to-even subbranches alter only the
mantissa.  Their casts of $-4$ and $23$ to \texttt{i64} are exact; the
conjunctions are total; and their shifts use the already established count 9
or 10.  The final low-bit conjunction gives zero or one.  A failing checked
mantissa increment again cannot occur on an \texttt{ok} path, and the
following right shift by one is legal because $1<64$.  The threshold
$2\mathbin{\mathtt{<<}}52$ and replacement $1\mathbin{\mathtt{<<}}52$ use the
legal count 52.  If rounding carries, the checked exponent increment is at
most $2111$; otherwise the exponent remains \texttt{power2}.  Clearing the
implicit bit uses one more legal shift by 52 and a total conjunction.  The
last test compares this final exponent $p$ with 2047.  If $p\geq2047$ the
function returns $fp_\infty$; if not, it returns a record with
$0<p<2047$.  This proves (1) in both duplicated branches, including every
ordinary, underflow, and sentinel return.

We also need the stronger slow-converter fact obtained from
\noderef{num_imp_dec2flt_slow_parse_long_mantissa}:
\[
 \texttt{parse_long_mantissa}(F_0,t)=\texttt{ok }b
 \quad\Longrightarrow\quad 0\leq b.p_{\rm biased}\leq2047.       \tag{2}
\]
After the same successfully evaluated zero and infinity sentinels, a failure
of \noderef{num_imp_dec2flt_decimal_seq_parse_decimal_seq} propagates and so
is excluded by the displayed premise.  A sequence with no digits or decimal
point below $-324$ returns $fp_0$; one with decimal point at least 310 returns
$fp_\infty$.  It remains to inspect the three extracted loops.

For loop 0 use the invariant
\[
 \texttt{loop_result}=\texttt{none}
 \quad\hbox{or}\quad
 \texttt{loop_result}=\texttt{some }fp_0.                         \tag{3}
\]
It holds initially.  A body iteration either leaves that field unchanged,
terminates when it is already \texttt{some}, or, after a call through
\noderef{num_imp_dec2flt_slow_parse_long_mantissa_closure_Insts_CoreOpsFunctionFnTupleUsizeUsize_call}
and \noderef{num_imp_dec2flt_decimal_seq_DecimalSeq_right_shift}, stores
exactly \texttt{some }$fp_0$ when the shifted decimal point is below the
negative range constant.  Thus (3) is inductive.  Every narrowing cast,
negation, exponent addition, shift-helper operation, array operation, or
decimal shift which fails makes the loop and hence the outer call fail; on a
successful transition the checked arithmetic has its displayed mathematical
meaning.  Therefore a returned \texttt{some} from loop 0 is exactly $fp_0$.

Loop 1 has the analogous invariant
\[
 \texttt{loop_result}=\texttt{none}
 \quad\hbox{or}\quad
 \texttt{loop_result}=\texttt{some }fp_\infty.                    \tag{4}
\]
The field again starts as \texttt{none}; the only assignments to it occur
after either left-shift branch and assign exactly \texttt{some }$fp_\infty$.
The other iterations preserve it, and a body presented with \texttt{some}
terminates.  The zero-index array read, sign change and cast of the decimal
point, closure call, casts of the shift, checked exponent subtraction, and
the calls to \noderef{num_imp_dec2flt_decimal_seq_DecimalSeq_left_shift} are
all monadic predecessors of the loop result.  A failure in any one is
therefore incompatible with a successful outer return.  Hence a returned
\texttt{some} from loop 1 is exactly $fp_\infty$.

For loop 2 use the exit invariant
\[
 \text{if the loop returns \texttt{ok }(d',e), then }e\geq-1022.  \tag{5}
\]
Indeed, its body returns \texttt{done} only when the test
\texttt{EXP_MIN > exp2} is false, which is precisely
$\texttt{exp2}\geq-1022$.  In the true branch the positive checked difference
$-1022-\texttt{exp2}$ is cast to \texttt{usize}, capped by
\noderef{num_imp_dec2flt_slow_parse_long_mantissa_MAX_SHIFT} at 60, passed to
\noderef{num_imp_dec2flt_decimal_seq_DecimalSeq_right_shift}, cast back
exactly from the interval $0,\ldots,60$, and added to \texttt{exp2} before a
\texttt{cont}.  Any subtraction, cast, shift, or addition failure propagates,
so a successful loop return must eventually be a \texttt{done} return and
satisfies (5).

If (3) or (4) supplies a result, it is one of the two sentinels and satisfies
(2).  Otherwise the main path first computes the checked
\[
 x=e-(-1022)+1
\]
from the loop-2 exponent $e$.  By (5), $x\geq1$.  If $x\geq2047$, the first
guard returns $fp_\infty$; otherwise $1\leq x\leq2046$.  The cast
\texttt{SIG_BITS}$=52$ to \texttt{usize}, the checked addition producing 53,
the decimal left shift by 53, and the call to
\noderef{num_imp_dec2flt_decimal_seq_DecimalSeq_round} must all succeed on the
assumed normal path.  The shifts $1\mathbin{\mathtt{<<}}53$ and
$1\mathbin{\mathtt{<<}}52$ are legal.  Without a rounding carry, the returned
exponent is $x$ or the successful checked value $x-1$, hence belongs to
$[0,2046]$.  With a carry, the checked $e'=e+1$ is followed by a second
guard on
$x'=e'-(-1022)+1=x+1$.  If $x'\geq2047$ it returns $fp_\infty$; otherwise
$2\leq x'\leq2046$, and the returned exponent is $x'$ or $x'-1$, again in
$[0,2046]$.  The mask subtractions from $2^{52}$ cannot underflow and the
final conjunctions are total.  Any failing checked $e+1$, subtraction,
addition, decimal shift/round, scalar shift, or cast would propagate instead
of yielding the assumed \texttt{ok }b.  This proves (2) with all direct,
loop-result, carrying, and noncarrying exits covered.

Now unfold \noderef{num_imp_dec2flt_dec2flt_with_trace} under the theorem's
assumed result.  The six trace constructors appearing in that extracted
definition are disjoint.  The empty-input and
sign-only branches return \texttt{EmptyInput} and \texttt{SignOnly}; numeric
failure followed by special failure returns \texttt{Invalid}; numeric failure
followed by special success returns \texttt{Special}; and successful
\texttt{try_fast_path} returns \texttt{FastPath}.  None can equal the assumed
\texttt{Assembled tr}.  Hence
\noderef{num_imp_dec2flt_parse_parse_number} returned \texttt{some }$r$ and
\noderef{num_imp_dec2flt_decimal_Decimal_try_fast_path} returned
\texttt{none}; the call to
\noderef{num_imp_dec2flt_parse_parse_inf_nan} is not made on this branch.

The first integer call returns a pair satisfying (1).  When
\texttt{many_digits} is false, or its first exponent is negative, the second
guard is false and the post-comparison pair is the first pair.  Otherwise the
checked addition $r.\texttt{mantissa}+1$ and the second integer call must both
succeed, since either failure would propagate and contradict the assumed
outer \texttt{ok}.  The second result also satisfies (1).  The comparison is
the total field comparison in
\noderef{num_imp_dec2flt_common_BiasedFp_Insts_CoreCmpPartialEqBiasedFp_eq}.
If it reports equality the code retains the first pair; if it reports
inequality the record update retains the first mantissa and writes exponent
$-1$.  Thus in every case the post-comparison exponent is $-1$ or is in
$[0,2047]$.

If that exponent is negative, the dispatcher selects the successfully
returned slow pair, which satisfies (2).  If it is not negative, the
dispatcher selects the post-comparison pair itself, whose exponent is then in
$[0,2047]$.  Therefore, before assembly in either branch, the local
\texttt{selected_pair} has exponent in $[0,2047]$.  The next
\texttt{IScalar.hcast .U64} is a total sign-extending bit-vector cast, rather
than a range-checking cast; on the range just proved it nevertheless agrees
with the ordinary nonnegative conversion.  The following shift uses the
already computed count 52, the OR is total by \noderef{ModelU64BitOr}, and any failure in those assembly
operations, \noderef{num_imp_dec2flt_biased_fp_to_float}, or final negation
would contradict the assumed successful result.

Finally, the two sign branches in that same extracted definition build
\texttt{Dec2FltTrace.Assembled} records, placing that same local pair
in the \texttt{selected_pair} field.  Constructor injectivity applied to the
assumed equality identifies the constructed record with $tr$, and hence
identifies its pair with $tr.\texttt{selected_pair}$.  Transferring the range
proved above gives
$0\leq tr.\texttt{selected_pair}.p_{\rm biased}\leq2047$, as required.  The
\texttt{sourceString} premise from \noderef{DecimalGoalVocabularyDefault} is
needed to state the supplied source-domain
goal faithfully but no additional lexical property is needed for this
model-internal range argument.
\end{proof}
