Avizienis signed-digit streams and approximation residues #
This module formalizes the redundant radix-2 signed-digit stream representation over the alphabet
{-6, ..., 6} and the reduction of exact stream generation to mod-2^q integer approximation
residues from [OpenAI2026LogSpace, Section 10.1, Lemma 10.1].
A sequence x : ℕ → ℤ with |x j| ≤ 6 represents the real number
streamVal x = ∑' j, (x j : ℝ) / 2 ^ j, with finite K-place truncation
streamPrefix x K = ∑ j ∈ range (K + 1), (x j : ℝ) / 2 ^ j satisfying
|streamVal x - streamPrefix x K| ≤ 6 / 2 ^ K.
Conversely, if |z| ≤ 1 and deterministic integers N : ℕ → ℤ satisfy the scaled approximation
bound |N t - 2 ^ t * z| < 2 for every t : ℕ, then the difference digits diffDigit N 0 = N 0
and diffDigit N (t + 1) = N (t + 1) - 2 * N t belong to {-6, ..., 6}, telescope to
N T / 2 ^ T, sum to z, and can be decoded uniquely from N t % 2 ^ q and N (t - 1) % 2 ^ q
for any q ≥ 4. Moreover, signed floor shifts preserve residues: (a / 2 ^ s) % 2 ^ q equals
(a % 2 ^ (q + s)) / 2 ^ s for every signed integer a : ℤ.
Main definitions #
Cslib.SignedDigitStream.IsSignedDigit,Cslib.SignedDigitStream.IsSignedStream: the redundant digit alphabet{-6, ..., 6}and valid digit streams.Cslib.SignedDigitStream.intPrefix,Cslib.SignedDigitStream.streamPrefix,Cslib.SignedDigitStream.streamVal: scaled integer prefixes, real finite prefixes, and infinite real stream values.Cslib.SignedDigitStream.suffixStream: zeroed-prefix remainder streamx - x^{[K]}.Cslib.SignedDigitStream.IsScaledApprox,Cslib.SignedDigitStream.diffDigit: scaled integer approximations|N t - 2 ^ t * z| < 2and telescoping difference digits.Cslib.SignedDigitStream.centeredResidue,Cslib.SignedDigitStream.decodeDiffResidue: unique signed-digit recovery from mod-2^qresidues (q ≥ 4).
Main results #
Cslib.SignedDigitStream.abs_streamVal_sub_streamPrefix_le: tail error bound6 / 2 ^ K.Cslib.SignedDigitStream.diffDigit_isSignedStream,Cslib.SignedDigitStream.hasSum_diffDigit,Cslib.SignedDigitStream.streamVal_diffDigit: Lemma 10.1 exact stream synthesis from approximations.Cslib.SignedDigitStream.decodeDiffResidue_eq_diffDigit: Lemma 10.1 mod-2^qresidue decoding.Cslib.SignedDigitStream.ediv_two_pow_emod_eq: signed floor-shift congruence modulo2^q.
References #
- OpenAI, Exact Derandomization of Logarithmic Space: L = RL = BPL,
Section 10.1 (Equations (10.1)--(10.4) and Lemma 10.1) and Section 10.3 (Equation (10.11))
(23 September 2026, revision
7ef5c0cc, not peer reviewed).
A redundant radix-2 signed digit in the alphabet {-6, ..., 6}.
A stream of redundant radix-2 signed digits in {-6, ..., 6}.
The real number ∑_{j = 0}^∞ x_j 2^{-j} represented by a digit stream.
Centered representative of r modulo 2 ^ q in (-2 ^ (q - 1), 2 ^ (q - 1)].
Tail truncation bound [OpenAI2026LogSpace, (10.2)]: truncating a signed-digit stream after
place K incurs error at most 6 / 2 ^ K.
Lemma 10.1 (digit range) [OpenAI2026LogSpace, Lemma 10.1]: difference digits of any scaled
approximation to z ∈ [-1, 1] lie in {-6, ..., 6} (indeed |z_0| ≤ 2 and |z_{t+1}| ≤ 5).
Lemma 10.1 (residue decoding) [OpenAI2026LogSpace, Lemma 10.1]: for q ≥ 4, the place-t
difference digit is uniquely determined by N t % 2 ^ q and N (t - 1) % 2 ^ q.
Signed floor-shift residue identity [OpenAI2026LogSpace, (10.11)]: discarding the low s
bits of the canonical (q + s)-bit Euclidean residue computes the mod-2^q residue of the signed
floor quotient a / 2 ^ s for every signed integer a : ℤ.