\begin{helper}[Small-slice offset calculation]
\label{helper:ParserExactRoundingOffsets}
Let \texttt{whole} and \texttt{rest} be model byte slices.  If the length of
\texttt{whole} is at most $2^{31}-1$ and the length of \texttt{rest} is at
most that of \texttt{whole}, then the extracted byte-slice
\texttt{offset\_from rest whole} succeeds with an \texttt{isize} whose value is
\[
  |\texttt{whole}|-|\texttt{rest}|.
\]
\end{helper}

\begin{proof}
By \noderef{SliceU8_Insts_Dec2flt_modelNumImpDec2fltCommonByteSlice_offset_from},
the extracted operation casts both slice lengths from \texttt{usize} to
\texttt{isize} and subtracts the second cast value from the first.  Aeneas's
platform theorem gives the two possible pointer widths, $32$ and $64$ bits.
In either case the bound $|\texttt{whole}|\le 2^{31}-1$ makes both casts
in-bounds; the bound on \texttt{rest} supplies the corresponding smaller
cast.  The cast values are therefore the original natural lengths.

Their difference is nonnegative because
$|\texttt{rest}|\le|\texttt{whole}|$, and is at most
$|\texttt{whole}|\le2^{31}-1$.  Hence the signed subtraction is in bounds for
both possible pointer widths and returns precisely the stated natural
difference.
\end{proof}
