\begin{lemma}
Let $x$ be a nonnegative rational in the normal, non-overflow range
$2^{-1022}\leq x<2^{128}$.  Run the normal branch of
\noderef{Binary64ModelDefault}'s magnitude encoder: scan the binary64 normal
exponent fields, scale $x$ at the selected field, round the scaled rational
to the nearest integer with ties to even, and form the corresponding raw
magnitude word, carrying into the next exponent field when necessary.  The
resulting word satisfies the \texttt{roundsMagnitude} relation of
\noderef{DecimalGoalVocabularyDefault} for the real image of $x$.
\end{lemma}
\begin{proof}
Write $U=2^{52}$ and let $e$ be the final exponent field selected by the
scan.  The initial field is $1$, whose threshold is $2^{-1022}$, so the lower
hypothesis establishes the scan invariant $2^{e-1023}\leq x$.  At each scan
step the field either advances to the tested field, preserving that
invariant, or remains unchanged.  The bound $x<2^{128}<2^{1023}$ prevents the
last tested field from being selected.  Monotonicity of the scan index then
shows that the next field was rejected, hence
$x<2^{e+1-1023}$.

After scaling, $z=x2^{1075-e}$ therefore satisfies $U\leq z<2U$.  Put
$q=\lfloor z\rfloor$ and let $r$ be the numerator remainder over the positive
reduced denominator.  Thus $U\leq q<2U$ and
$z=q+r/\mathit{den}(z)$ with $0\leq r<\mathit{den}(z)$.  The encoder selects
$q+1$ exactly when $2r$ exceeds the denominator, or when equality holds and
$q$ is odd; otherwise it selects $q$.  The two corresponding raw words are
adjacent, including the case where the upper one carries to field $e+1$, by
\noderef{Binary64EncoderCarryArithmetic}.  Their decoded values are
respectively $q2^{e-1075}$ and $(q+1)2^{e-1075}$ by
\noderef{Binary64AdjacentNormalValues}, so the selected one is no farther
from $x$ than the other.
At equality the selected integer significand is even, and because $U$ and
the exponent-field contribution are even, the selected raw word is even.

The selected raw word is below the infinity word $2047U$.  By
\noderef{Binary64FiniteMagnitudeStrictMono}, every smaller finite competitor
has decoded value at most the lower adjacent value, and every larger one has
decoded value at least the upper adjacent value.  Elementary absolute-value
inequalities therefore make each such competitor no closer than the selected
word.  The real embedding of rationals preserves all powers, products,
orders, and the remainder decomposition used above.  Finally
$x<2^{128}<2^{1024}-2^{970}$, so the finite rather than infinity clause of
\texttt{roundsMagnitude} applies.  These facts give its nonnegativity,
finite-word bound, overflow-threshold, every-competitor minimization, and
even-tie clauses.
\end{proof}
