\begin{theorem}[Concrete failure of exact rounding]
\label{thm:ParserExactRoundingWitness}
There are a model string $s$, a decimal lexeme $x$, and a binary64 value $f$
with the following concrete values and properties.  The bytes of $s$ are the
ASCII encoding of
\[
  0.\underbrace{00\cdots0}_{65535\text{ zeros}}1e655360.
\]
The lexeme $x$ has no sign, integer digits $[0]$, fractional digits consisting
of $65535$ zeros followed by $1$, and the unsigned decimal exponent $655360$.
The value $f$ has binary64 word $4607182418800017408$, namely the word for
$1.0$.  The string is a source string, the lexeme is valid, rendering the
lexeme gives exactly the bytes of $s$, and the extracted public parser returns
$f$ successfully on $s$.  Nevertheless, there is no binary64 magnitude which
both rounds the exact magnitude of $x$ according to
\texttt{roundsMagnitude} and acquires the lexical sign of $x$ to yield $f$.
\end{theorem}

\begin{proof}
Let $s$, $x$, and $f$ have the concrete values in the statement.  Their byte,
lexeme, and word equalities are definitional.  The byte list has length
$65545$, hence satisfies the model string bound.  Encode the displayed ASCII
string character by character.  ASCII `0', `.', `1', `e', `6', `5', and `3'
encode respectively to bytes $48,46,49,101,54,53,51$; mapping the repeated
zero characters therefore gives precisely the symbolic repeated-byte segment.
This supplies the string required by \texttt{sourceString} in
\noderef{DecimalGoalVocabularyDefault}.

Every integer and fractional digit lies below ten, the integer part is
nonempty, and the exponent digit list is nonempty, so $x$ satisfies
\texttt{validNumeric}.  Expanding \texttt{renderNumeric} and the ASCII digit
encoding yields the stated bytes.  The parser execution is exactly
\noderef{ParserExactRoundingExecution}: its hypothesis is the concrete byte
equality already established, and its conclusion is the required successful
return of the word for $1.0$.

It remains to show that the contract conclusion is false.  Folding the
$65535$ fractional zeros leaves zero, appending the final digit gives
significand $1$, and the fractional length is $65536$.  Thus
\texttt{exactMagnitude} from \noderef{DecimalGoalVocabularyDefault} is
$10^{655360-65536}=10^{589824}$.

Suppose some binary64 magnitude rounded that real and then, with the positive
lexical sign, yielded $f$.  By \noderef{Binary64ModelDefault}, every finite
binary64 value represented by a word other than positive infinity denotes a
real strictly below $2^{1024}-2^{970}$.  But
\[
  2^{1024}-2^{970}\le 2^{1024}\le 10^{1024}\le 10^{589824}.
\]
Consequently the strict upper condition in \texttt{roundsMagnitude} rules out
every non-infinity word, so the magnitude word must be the positive-infinity
word $2047\cdot2^{52}$.  Since $x$ is nonnegative,
\texttt{signedMagnitude} would then require that word to equal the word of
$f$, namely $4607182418800017408$.  Direct arithmetic shows these words are
unequal.  This contradiction proves the final negation and hence all clauses
of the witness theorem.
\end{proof}
