Uncompiled stream query schedules, lookahead composition, and allowance arithmetic #
This module provides uncompiled query-schedule / lookahead helpers and standalone arithmetic inequalities as intermediate steps after, and not formalizations of, [OpenAI2026LogSpace, Sections 10.5--10.6, Lemma 10.8, Theorem 10.9]. Native Turing-machine or counter-program space realization remains open and is tracked in #9181.
A StreamSchedule Op Struct at slack d ≥ 1 packages:
- a domain precondition
ValidEnvon operand streams and structural leaves, - an exact mathematical target value
targetVal : (Op → ℝ) → (Struct → Bool) → ℝin[-1, 1], - a family of uncompiled conditional query trees
digitProg : ℕ → QueryProg Op Struct ℤ, - exact stream emission proofs (
emits_signed,emits_exact) showing that emitted digits form a valid{-6, ..., 6}stream summing totargetVal, and - a digit-query place lookahead bound
j ≤ t + lookaheadCoeff * slackon every digit query actually executed in(digitProg t).activeQueries env sEnv.
Because QueryProg continuations are arbitrary host Lean functions, StreamSchedule and
BoolSchedule certify only exact signed-digit stream semantics and digit-query index lookahead;
they certify neither uniformity, computability, query counts, nor Turing-machine workspace.
Separately, AllowanceBound and its telescoping lemmas are pure arithmetic inequalities on
natural-number parameters after [OpenAI2026LogSpace, (10.18)].
Main definitions #
Cslib.StreamArithmetic.IsNormSignedStream: signed-digit stream with value in[-1, 1].Cslib.StreamArithmetic.AllowanceBound: standalone pure-arithmetic inequality after [OpenAI2026LogSpace, (10.18)].Cslib.StreamArithmetic.StreamSchedule: uncompiled exact-stream query schedule with digit-place lookahead at slackd ≥ 1.Cslib.StreamArithmetic.StreamSchedule.compOfLookahead: uncompiled stage-composition helper preserving exact stream evaluation and adding lookahead coefficients.Cslib.StreamArithmetic.BoolSchedule: uncompiled clock-zero Boolean query schedule with digit-place lookahead.Cslib.StreamArithmetic.bufferedTestSchedule: uncompiled query-schedule helper after [OpenAI2026LogSpace, Lemma 10.8].
Main results #
Cslib.StreamArithmetic.AllowanceBound.mono_coeff,AllowanceBound.comp_child: pure-arithmetic coefficient unification and clock-difference telescoping helpers.Cslib.StreamArithmetic.scheduleOfMod16Prog: lifts any mod-16 scaled-approximation residue query tree with bounded lookahead to aStreamScheduleviadecodeDiffResidue 4.Cslib.StreamArithmetic.bufferedTestSchedule_true_of_two_mul_lt,bufferedTestSchedule_false_of_le: soundness and completeness ofbufferedTestSchedule.
References #
- OpenAI, Exact Derandomization of Logarithmic Space: L = RL = BPL,
Sections 10.5--10.6 (after Lemma 10.8 and Theorem 10.9; 23 September 2026, revision
7ef5c0cc, not peer reviewed).
A signed-digit stream in {-6, ..., 6} whose represented real value lies in [-1, 1].
Standalone pure-arithmetic clock-overshoot and suspended-record inequality after, and not a
machine-space formalization of, [OpenAI2026LogSpace, (10.18), Theorem 10.9] (native space
realization is tracked in #9181). For a digit-query place some j it requires lookahead
j ≤ t + c * d and L ≤ a * d + b * (t - j); for a clock-zero query none it requires
L ≤ a * d + b * t.
Pure-arithmetic coefficient-unification helper after [OpenAI2026LogSpace, Theorem 10.9 proof]
(not a machine-space bound; see #9181): increasing b₀ to b ≥ b₀ is absorbed by increasing a₀
to a₀ + (b - b₀) * c₀.
Pure-arithmetic clock-difference telescoping helper after [OpenAI2026LogSpace, Theorem 10.9] (not a machine-space bound; see #9181).
Uncompiled conditional query schedule for an exact signed-digit stream at slack slack ≥ 1.
This is an intermediate query-semantics and lookahead helper after, and not a formalization of,
[OpenAI2026LogSpace, Theorem 10.9] (native space realization is tracked in #9181): it packages
exact signed-digit emission (emits_signed, emits_exact) and digit-query place lookahead
(j ≤ t + lookaheadCoeff * slack) over host QueryProg trees, without certifying uniformity,
computability, query counts, or Turing-machine workspace.
- slack : ℕ
Slack parameter
d ≥ 1scaling the digit-query lookahead bound. Precondition on operand streams and structural leaves.
Exact real value in
[-1, 1]represented by the emitted stream.Uncompiled deterministic conditional query tree emitting place
t.- lookaheadCoeff : ℕ
Lookahead multiplier
cbounding every executed digit query byj ≤ t + c * slack. - lookahead (t : ℕ) (env : Op → ℕ → ℤ) (sEnv : Struct → Bool) {op : Op} {j : ℕ} : QueryEvent.digit op j ∈ (self.digitProg t).activeQueries env sEnv → j ≤ t + self.lookaheadCoeff * self.slack
Emitted digits of a StreamSchedule form a normalized signed stream in [-1, 1] whenever
S.ValidEnv env sEnv.
Strengthen the environment precondition of a StreamSchedule.
Rewrite the mathematical targetVal of a StreamSchedule on valid environments.
Uncompiled stage-composition helper after, and not a formalization of,
[OpenAI2026LogSpace, Theorem 10.9] (native space realization is tracked in #9181): substituting
child StreamSchedules whose lookahead coefficients are uniformly bounded by cC preserves exact
signed-digit stream evaluation and adds lookahead coefficients (parent.lookaheadCoeff + cC),
without certifying uniformity, computability, or Turing-machine workspace.
Structural-leaf conditional branch between two StreamSchedules (uncompiled query-schedule
helper after [OpenAI2026LogSpace, Section 10.5, Lemma 10.6]; see #9181). Only the branch selected
by sEnv sOp is evaluated or required to satisfy ValidEnv.
Uncompiled clock-zero finite Boolean query schedule at slack slack ≥ 1. This is an
intermediate query-semantics and lookahead helper after, and not a formalization of,
[OpenAI2026LogSpace, Lemma 10.8] (native space realization is tracked in #9181): it records the
digit-query lookahead bound j ≤ lookaheadCoeff * slack on executed queries without certifying
uniformity, computability, query counts, or Turing-machine workspace.
- slack : ℕ
Slack parameter
d ≥ 1scaling the clock-zero lookahead bound. Uncompiled deterministic conditional query tree computing the Boolean test.
- lookaheadCoeff : ℕ
Lookahead multiplier
cbounding every executed digit query byj ≤ c * slack. - lookahead (env : Op → ℕ → ℤ) (sEnv : Struct → Bool) {op : Op} {j : ℕ} : QueryEvent.digit op j ∈ self.prog.activeQueries env sEnv → j ≤ self.lookaheadCoeff * self.slack
Lift a mod-16 approximation residue query tree resProg ((resProg s).eval = N s % 16) to an
exact difference-digit query tree via decodeDiffResidue 4 (after [OpenAI2026LogSpace,
Lemma 10.1]).
Package any mod-16 scaled-approximation residue query tree with bounded digit-place lookahead
into an uncompiled StreamSchedule (not a machine-space certificate; see #9181).
Uncompiled windowed low-residue reader computing intPrefix (env op) K % 2 ^ W by querying
digits in Ico (K + 1 - W) (K + 1) (helper after [OpenAI2026LogSpace, Lemma 10.3]; see #9181).
Uncompiled top-down prefix comparator query tree comparing env op against a fixed digit
sequence bound through place K (helper after [OpenAI2026LogSpace, Lemma 10.3]; see #9181).
Uncompiled query-schedule helper after, and not a formalization of,
[OpenAI2026LogSpace, Lemma 10.8] (native space realization is tracked in #9181): when
M + R ≤ κ * d, bufferedTestProg queries only digit places j ≤ M + R + 7 ≤ (κ + 7) * d.
No uniformity or machine workspace bound is claimed.