lemmaroutine
Approximate integers give exact digit streams
Integers with yield an exact digit stream via residues mod
makes primitives exact, so errors do not accumulate
Lemma·
lem:arith-residue-stream·§10.1 Streams, records, and uniformityStatement (paper)
Suppose and, for each , a deterministic integer
satisfies
Set
Then and these digits represent exactly.
For any fixed integer , each output digit is determined by
the required residues modulo .
In plain English
If integers satisfy for , then the differences , are digits in that represent exactly. For any fixed , each digit is determined by the residues of the needed modulo .
Why it's here
This lets every primitive be specified by cheap approximations and still produce an exact digit stream, which is what the reciprocal lemma and the interface theorem rely on when composing primitives. The digits telescope, so . The error bound makes each small, and a small integer is recovered from its residue modulo once , so only low-order bits of need to be kept.
Classified routine:
This is the standard conversion from integer approximations to a redundant signed-digit expansion, as in exact real arithmetic (e.g., Avizienis-style redundant digits and Boehm-type approximation functions). Telescoping and bounding each digit is direct, and recovering a small integer from its residue mod is elementary.
Uses
Nothing else in the paper
Used by
Sources
PaperOpen
- Section
- §10.1 Streams, records, and uniformity
- Page
- —
- Label
lem:arith-residue-stream- Line
sections/arithmetic.tex:57
Leannot aligned
Phase 2 aligns this node to a Lean declaration.