Uncompiled stream query schedules for smooth estimators and row compression #
This module composes the uncompiled StreamSchedule helpers of
CslibFrontier.Computability.StreamArithmetic.Primitives into exact signed-digit query schedules
for smooth estimator and row-compression building blocks as intermediate steps after, and not
formalizations of, [OpenAI2026LogSpace, Sections 4.1, 8.2, 10.2--10.6]. Native Turing-machine or
counter-program space realization remains open and is tracked in #9181.
Because QueryProg continuations are arbitrary host Lean functions, every StreamSchedule below
certifies only exact signed-digit stream evaluation (emits_signed, emits_exact) and
digit-query index lookahead (j ≤ t + lookaheadCoeff * slack), with lookaheadCoeff depending
only on κ and child lookahead coefficients (not on d, m, n, K, or items). No
uniformity, computability, or Turing-machine workspace bound is claimed. For
Cslib.RowCompression.newDefault and Cslib.RowCompression.update, intermediate piecewise-linear
combinations whose unscaled range exceeds [-1, 1] are evaluated at dyadically rescaled
magnitudes (/ 4, / 16, / 32, / 64) inside [-1, 1] and restored to exact unscaled values
via shiftClip.
Main definitions #
Cslib.StreamArithmetic.FixedScheduleandCslib.StreamArithmetic.FixedSchedule.guardStruct: helper bundle pinningslack,ValidEnv, andtargetValin its type so DAG combinators expose their specification without unfolding multi-stage compositions.Cslib.StreamArithmetic.StreamSchedule.abs: exact absolute-value query schedule|S| = max S (-S).Cslib.StreamArithmetic.clippedAtomInvSchedule: uncompiled query schedule computing1 / (2 * max (1 / 2) (min 1 q)).Cslib.StreamArithmetic.polynomialTransition4Schedule,Cslib.StreamArithmetic.dyadicSwitchNormSchedule,Cslib.StreamArithmetic.dyadicWeightNormSchedule: uncompiled query schedules computingCslib.polynomialTransition4,Cslib.SignedDigitStream.dyadicSwitch, andCslib.SignedDigitStream.dyadicWeight.Cslib.StreamArithmetic.invScaledNormSchedule,Cslib.StreamArithmetic.invOneAddScaledSchedule,Cslib.StreamArithmetic.rationalRamp4NormSchedule: uncompiled query schedules computing the dyadic reciprocal leaf factor,1 / (1 + max 0 (2 ^ m * q)), andCslib.rationalRamp4Unit (2 ^ m * q) / 2 ^ mform ≤ κ * d.Cslib.StreamArithmetic.RowStreamIdx,Cslib.StreamArithmetic.RowSupportValidEnv,Cslib.StreamArithmetic.RowUpdateValidEnv: operand stream index and normalized environment preconditions for two-coordinate row compression (Cslib.RowCompression).Cslib.StreamArithmetic.rowCompressionThresholdSchedule,Cslib.StreamArithmetic.rowCompressionNewDefaultPrimSchedule,Cslib.StreamArithmetic.rowCompressionUpdatePrimSchedule,Cslib.StreamArithmetic.rowCompressionNewDefaultSchedule,Cslib.StreamArithmetic.rowCompressionUpdateSchedule: uncompiled primitive and composite query schedules forCslib.RowCompression.threshold,Cslib.RowCompression.newDefault, andCslib.RowCompression.update.
References #
- OpenAI, Exact Derandomization of Logarithmic Space: L = RL = BPL,
Sections 4.1, 8.2, and 10.2--10.6 (23 September 2026, revision
7ef5c0cc, not peer reviewed).
Uncompiled stream query schedule pinned to slack d, environment validity predicate V, and
semantic function valFn in its type (intermediate helper; not a machine-space certificate, see
#9181). Keeping combinator bodies non-@[expose] while exposing FixedSchedule.toSchedule makes
.slack, .ValidEnv, and .targetVal reduce in one step without unfolding multi-stage arithmetic
DAGs.
- inner : StreamSchedule Op Struct
Underlying
StreamSchedulepackaged by thisFixedSchedule. - target_eq {env : Op → ℕ → ℤ} {sEnv : Struct → Bool} : V env sEnv → self.inner.targetVal (fun (op : Op) => SignedDigitStream.streamVal (env op)) sEnv = valFn (fun (op : Op) => SignedDigitStream.streamVal (env op)) sEnv
Project a FixedSchedule back to a StreamSchedule with immediate definitional access to
slack := d, ValidEnv := V, and targetVal := valFn.
Wrap any StreamSchedule as a FixedSchedule.
Strengthen the precondition of a FixedSchedule to V₂.
Replace the semantic value function of a FixedSchedule with an extensionally equal expression
on valid environments.
Variable FixedSchedule reading operand stream op under V.
Exact negation on FixedSchedule.
Exact pairwise average (F₁ + F₂) / 2 on FixedSchedule.
Exact binary maximum on FixedSchedule.
Exact binary minimum on FixedSchedule.
Exact stream multiplication on FixedSchedule.
Exact absolute value |F| = max F (-F) on FixedSchedule.
Exact absolute-value query schedule |S| = max S (-S).
Exact shift-and-clip max (-1) (min 1 (2 ^ v * F)) on FixedSchedule.
Exact [1 / 4, 1] scaled reciprocal 1 / (64 * F) on FixedSchedule.
Static parameter conditional branch on FixedSchedule.
Structural indicator guard on FixedSchedule: emits F when sEnv sOp = true and 0 when
sEnv sOp = false, requiring V only when sEnv sOp = true.
Uncompiled FixedSchedule computing the clipped stochastic-atom inverse
1 / (2 * max (1 / 2) (min 1 (S.targetVal val sEnv))) (not a machine-space certificate; see
#9181).
Uncompiled StreamSchedule computing the clipped stochastic-atom inverse
1 / (2 * max (1 / 2) (min 1 (S.targetVal val sEnv))) (helper; not a machine-space certificate,
see #9181).
Uncompiled FixedSchedule computing the degree-7 smooth switch
Cslib.polynomialTransition4 (f val sEnv).
Uncompiled StreamSchedule computing Cslib.polynomialTransition4 (S.targetVal val sEnv)
(helper; not a machine-space certificate, see #9181).
Uncompiled FixedSchedule computing
dyadicSwitch r (2 ^ (m + 1) * max 0 (W.targetVal val sEnv)) for r ≤ m ≤ κ * W.slack.
Uncompiled StreamSchedule computing
dyadicSwitch r (2 ^ (m + 1) * max 0 (W.targetVal val sEnv)) when r ≤ m ≤ κ * W.slack (helper;
not a machine-space certificate, see #9181).
Uncompiled FixedSchedule computing the smooth dyadic partition-of-unity weight
dyadicWeight m r (2 ^ (m + 1) * max 0 (W.targetVal val sEnv)).
Uncompiled StreamSchedule computing
dyadicWeight m r (2 ^ (m + 1) * max 0 (W.targetVal val sEnv)) for any scale index r : ℕ when
m ≤ κ * W.slack (helper; not a machine-space certificate, see #9181).
Uncompiled FixedSchedule computing the r-th clamped dyadic reciprocal term
(1 / 2) * (1 / 2 ^ (r + 1)) / max (1 / 4) (min 1 (w / 2 ^ (r + 1))) for
w = 2 ^ (m + 1) * max 0 (W.targetVal val sEnv).
Uncompiled leaf reciprocal schedule
(1 / 2) * (1 / 2 ^ (r + 1)) * (1 / max (1 / 4) (min 1 (w / 2 ^ (r+1)))) for scale r in the
smooth dyadic reciprocal decomposition (helper; not a machine-space certificate, see #9181).
Uncompiled FixedSchedule computing 1 / (1 + max 0 (2 ^ m * S.targetVal val sEnv)) via the
smooth dyadic partition of unity over r ∈ {0, ..., m}.
Uncompiled StreamSchedule computing 1 / (1 + max 0 (2 ^ m * S.targetVal val sEnv)) for
m ≤ κ * S.slack via an (m + 1)-level balanced binary-tree average over dyadic
partition-of-unity terms (helper; not a machine-space certificate, see #9181).
Uncompiled FixedSchedule computing
Cslib.rationalRamp4Unit (2 ^ m * S.targetVal val sEnv) / 2 ^ m (helper after
[OpenAI2026LogSpace, Section 4.1]; see #9181).
Uncompiled StreamSchedule computing the normalized rational correction ramp
Cslib.rationalRamp4Unit (2 ^ m * S.targetVal val sEnv) / 2 ^ m whenever m ≤ κ * S.slack
(helper; not a machine-space certificate, see #9181).
Operand stream index for a single step of two-coordinate row compression
(Cslib.RowCompression).
- floor {ι : Type u} : RowStreamIdx ι
- oldDefault {ι : Type u} : RowStreamIdx ι
- entry {ι : Type u} (x : ι) (μ : Fin 2) : RowStreamIdx ι
Normalized signed-stream environment precondition on .floor, .oldDefault, and all active
support coordinates x ∈ items.
- floor_norm : IsNormSignedStream (env RowStreamIdx.floor)
- oldDefault_norm : IsNormSignedStream (env RowStreamIdx.oldDefault)
Normalized signed-stream environment precondition for Cslib.RowCompression.update at
coordinate y.
Uncompiled FixedSchedule computing Cslib.RowCompression.threshold via
zeroPaddedRankListSchedule (helper after [OpenAI2026LogSpace, Section 8.2, Lemmas 10.6--10.7];
see #9181).
Uncompiled primitive StreamSchedule over RowStreamIdx ι computing
Cslib.RowCompression.threshold items.toFinset n (helper; not a machine-space certificate, see
#9181).
Uncompiled FixedSchedule computing Cslib.RowCompression.newDefault via
rowCompressionThresholdFixed and zeroPaddedRankListSchedule (helper after
[OpenAI2026LogSpace, Section 8.2]; see #9181).
Uncompiled primitive StreamSchedule over RowStreamIdx ι computing
Cslib.RowCompression.newDefault items.toFinset n K (helper after [OpenAI2026LogSpace, (8.5)];
see #9181).
Uncompiled FixedSchedule computing Cslib.RowCompression.update for entry (y, ν) via
rowCompressionThresholdFixed and rowCompressionNewDefaultFixed (helper after
[OpenAI2026LogSpace, Section 8.2]; see #9181).
Uncompiled primitive StreamSchedule over RowStreamIdx ι computing coordinate (y, ν) of
the compressed row Cslib.RowCompression.update items.toFinset n K (helper after
[OpenAI2026LogSpace, (8.6)]; see #9181).
Compose rowCompressionNewDefaultPrimSchedule with child StreamSchedules for the floor,
old default, and active support entries (uncompiled helper; not a machine-space certificate, see
#9181).
Compose rowCompressionUpdatePrimSchedule with child StreamSchedules for the floor, old
default, and row entries (uncompiled helper; not a machine-space certificate, see #9181).