OctoInform Beta

OpenAI preprint, September 2026 Β· Β§2. An evaluator with weighted dependency paths

Β§2. Implicit word graph and weighted paths: Factored prime-field identities, coin budgets covering edge prices, and space-uniform circuit families

Weighted dependency circuits and space-uniform evaluation.

Hover over a blue or green term in the text, or a node in the graph, to find it in the other. Select it to read its declaration both in Lean and in words.

The setting

To evaluate a large implicit computation in small space, one represents its intermediate values as words of a common bit width dd attached to the vertices of a finite directed acyclic graph. Each non-base vertex depends on a distinguished vertex and a bounded list of further vertices, and its word is determined by a low-degree algebraic identity over a finite field. By weighting dependency edges according to the storage cost of their local algebraic parameters, a recursive evaluator can trade space against path weight along the graph.

In the Lean library, this implicit computation is formulated as a weighted dependency circuit over a prime field FF, together with three conditions: a validity specification tying each vertex value to its base rule or factored prime-field identity, a node coin budget bounding edge prices along dependencies, and a space-uniformity condition requiring the circuit’s structure and local functions to be computable by a uniform stack machine within a given space bound.

Prime fields and augmented Boolean vectors

For natural numbers mm, uu, and jj, the base-mm digit of uu at position jj is ⌊u/mjβŒ‹mod⁡m\lfloor u / m^j \rfloor \bmod m.✦ For a natural number uu, let len(u)\mathrm{len}(u) denote its binary bit length, equal to 00 when u=0u = 0 and ⌊log⁡2uβŒ‹+1\lfloor \log_2 u \rfloor + 1 when uβ‰₯1u \ge 1.

For a Boolean predicate qq on β„•\mathbb{N} and a bound mβˆˆβ„•m \in \mathbb{N}, the bounded universal scan of qq below mm holds when q(j)q(j) holds for every j<mj < m (and holds vacuously when m=0m = 0).✦ The bounded witness search of qq below mm returns the largest natural number j<mj < m for which q(j)q(j) holds, and returns 00 if no such jj exists.✦ For p,mβˆˆβ„•p, m \in \mathbb{N}, the non-divisor check holds unless both 2≀m2 \le m and pmod⁡m=0p \bmod m = 0.✦ The trial division primality test on pβˆˆβ„•p \in \mathbb{N} holds when pβ‰₯2p \ge 2 and the bounded universal scan of the non-divisor check for pp holds below pp.✦

A prime modulus is a prime number pβˆˆβ„•p \in \mathbb{N}, with associated prime field 𝔽p=β„€/pβ„€\mathbb{F}_p = \mathbb{Z}/p\mathbb{Z}. A field vector over 𝔽p\mathbb{F}_p is a sequence ℕ→𝔽p\mathbb{N} \to \mathbb{F}_p.✦ Given a degree bound Dβˆˆβ„•D \in \mathbb{N}, the valid prime modulus test accepts pβˆˆβ„•p \in \mathbb{N} when p>D+1p > D + 1 and pp passes the trial division primality test.✦ The chosen prime modulus for DD is the prime pp returned by bounded witness search for the valid prime modulus test below the search bound 2(D+1)+12(D + 1) + 1.✦

For a width dβˆˆβ„•d \in \mathbb{N}, a natural number uu, and a coordinate iβˆˆβ„•i \in \mathbb{N}, the augmented bit coordinate is augd(u,i)={⌊u/2iβŒ‹mod⁡2,i<d,1,i=d,0,i>d.\mathrm{aug}_d(u, i) = \begin{cases} \lfloor u / 2^i \rfloor \bmod 2, & i < d, \\ 1, & i = d, \\ 0, & i > d. \end{cases}(1)✦ The augmented Boolean vector of uu at width dd over a prime field 𝔽p\mathbb{F}_p is the field vector uΒ―d:ℕ→𝔽p\overline{u}_d : \mathbb{N} \to \mathbb{F}_p whose ii-th entry is the image of augd(u,i)\mathrm{aug}_d(u, i) from (1) in 𝔽p\mathbb{F}_p.✦

Space-bounded stack machines

A head move direction is one of three moves: left, stay, or right.✦ Over an alphabet AA, a tape symbol with endmarkers is either a left endmarker ⊳\triangleright, a letter a∈Aa \in A, or a right endmarker ⊲\triangleleft.✦ On a finite word w=(w0,…,wβ„“βˆ’1)∈A*w = (w_0, \dots, w_{\ell - 1}) \in A^*, inspecting position 00 returns ⊳\triangleright, while inspecting position r+1r + 1 returns wrw_r when r<β„“r < \ell and ⊲\triangleleft when rβ‰₯β„“r \ge \ell. A single head step on ww from position rβˆˆβ„•r \in \mathbb{N} leaves rr unchanged on stay, moves to max⁡(rβˆ’1,0)\max(r - 1, 0) on left, and moves to r+1r + 1 on right unless r>β„“r > \ell, in which case it stays at rr.✦

For a public alphabet XX and an argument index set JJ, a tuple of read-only input tapes consists of a public word wpub∈X*w_{\mathrm{pub}} \in X^* and a family of bit strings (wj)j∈J(w_j)_{j \in J} with wj∈{0,1}*w_j \in \{0, 1\}^*.✦ Input head positions specify a public position in β„•\mathbb{N} and an argument position in β„•\mathbb{N} for each j∈Jj \in J, with the initial head positions placing every head at 00. Input head observations record the marked symbol under the public head in XX and under each argument head in {0,1}\{0, 1\}, obtained by applying tape inspection coordinatewise. A head movement tuple assigns a head move direction to the public tape and to each j∈Jj \in J, advancing all heads coordinatewise by single head steps.

A stack operation on a bit stack in {0,1}*\{0, 1\}^* either keeps the stack unchanged, pushes a bit onto the top, or pops the top bit (leaving an empty stack empty). For an argument index set JJ and a stack index set KK, a machine store state pairs input head positions on JJ with a family of bit stacks indexed by KK✦; an initial store state places all input heads at 00 with given initial stack contents (empty by default).✦ Given an extra stack index set Kβ€²K' and a store state ss on port stacks LL, adjoining empty work stacks preserves the input head positions of ss, retains the stacks on LL, and initializes every stack in Kβ€²K' to empty, yielding a store state on LβŠ”Kβ€²L \sqcup K'.✦ A store state satisfies the stack height bound Bβˆˆβ„•B \in \mathbb{N} if every stack has length at most BB.✦ Its top stack symbols record the top bit of each nonempty stack (and an empty marker otherwise).✦ A store transition update combines a head movement tuple on JJ with a stack operation for each k∈Kk \in K, updating a store state by advancing its input heads and applying each stack operation to its stack.

A stack machine MM over public alphabet XX, argument index set JJ, stack index set KK, and output set YY consists of a finite control state set QQ, an initial state q0∈Qq_0 \in Q, and a transition table mapping a state in QQ, input head observations, and top stack symbols to either a halting output in YY or a transition action pairing a next state in QQ with a store transition update.✦ A configuration of MM is a pair (q,s)(q, s) of a control state and a store state.✦ On read-only input tapes ΞΉ\iota, a single machine step evaluates the transition table at (q,s)(q, s) and either halts with the returned output or moves to the next state and updated store.✦ For any transition function f:Οƒβ†’YβŠ”Οƒf : \sigma \to Y \sqcup \sigma and state invariant 𝒫\mathcal{P} on Οƒ\sigma, a halting transition run from ss to tt with output yy is a finite chain of steps starting at ss and ending at tt where 𝒫\mathcal{P} holds at every visited state, each intermediate step follows ff, and f(t)f(t) halts with yy.✦ A space-bounded configuration run of MM on ΞΉ\iota with bound Bβˆˆβ„•B \in \mathbb{N} is a halting transition run of single machine steps whose visited configurations all satisfy the stack height bound BB.✦ A space-bounded execution of MM on ΞΉ\iota with bound BB from store ss to store tt with output yy means there exists a final state q∈Qq \in Q admitting a space-bounded configuration run from (q0,s)(q_0, s) to (q,t)(q, t) with output yy.✦

Let II be an index set and S:Iβ†’β„•S : I \to \mathbb{N} a space bound. A uniform stack-machine computation on read-only input tapes ΞΉ:Iβ†’Inputs(X,J)\iota : I \to \mathrm{Inputs}(X, J) from initial stores aa to final stores bb on port stacks LL producing outputs y:Iβ†’Yy : I \to Y exists if there are a finite auxiliary stack index set KK, a stack machine MM with stack set LβŠ”KL \sqcup K, and a constant cβˆˆβ„•c \in \mathbb{N} such that for every i∈Ii \in I, MM has a space-bounded execution on ΞΉ(i)\iota(i) with bound c(S(i)+1)c(S(i) + 1) from a(i)a(i) with adjoined empty KK-stacks to b(i)b(i) with adjoined empty KK-stacks returning y(i)y(i).✦ Packaging a word w∈X*w \in X^* with no argument tapes forms a single public input tape✦, and placing the canonical binary bits of mβˆˆβ„•m \in \mathbb{N} on a single port stack with no argument tapes and head at 00 forms a binary-encoded natural number store.✦ A family b:Iβ†’β„•b : I \to \mathbb{N} is space-bounded computable from a:Iβ†’β„•a : I \to \mathbb{N} on public input words x:Iβ†’X*x : I \to X^* in space SS if there is a uniform stack-machine computation on the single public input tapes of xx transforming the binary-encoded stores of aa to those of bb in space SS with trivial output.✦ Given a reindexing map r:Uβ†’Ir : U \to I, the reindexed space-bounded computation relation on UU is space-bounded computability with respect to x∘rx \circ r and S∘rS \circ r.✦ Finally, a function f:Iβ†’β„•f : I \to \mathbb{N} satisfies the O(S)O(S) growth bound if there exists cβˆˆβ„•c \in \mathbb{N} with f(i)≀c(S(i)+1)f(i) \le c(S(i) + 1) for all i∈Ii \in I✦, and satisfies the O(S)O(S) bit-length bound if i↦len(f(i))i \mapsto \mathrm{len}(f(i)) satisfies the O(S)O(S) growth bound.✦

Weighted dependency circuits

A weighted dependency circuit CC specifies a word width dβˆˆβ„•d \in \mathbb{N}, a secondary dependency count Nβˆˆβ„•N \in \mathbb{N}, and a node count nβˆˆβ„•n \in \mathbb{N} with node set V={0,…,nβˆ’1}V = \{0, \dots, n - 1\}, together with the following maps:

  • a base indicator Ξ²:Vβ†’{0,1}\beta : V \to \{0, 1\}, where 11 marks a base node and 00 an internal node;

  • a distinguished dependency map Ξ·:Vβ†’V\eta : V \to V and a secondary child map Ο‡:VΓ—β„•β†’V\chi : V \times \mathbb{N} \to V (both total, unused at base nodes);

  • a guess length g:Vβ†’β„•g : V \to \mathbb{N} and a base value Ξ±:Vβ†’β„•\alpha : V \to \mathbb{N};

  • a proposal function Ο€:VΓ—β„•3β†’β„•\pi : V \times \mathbb{N}^3 \to \mathbb{N} taking a node, coordinate, guess, and head value, and an allowance function Ο„:VΓ—β„•5β†’β„•\tau : V \times \mathbb{N}^5 \to \mathbb{N} taking a node, coordinate, guess, child index, head value, and child value;

  • a semantic value Ξ½:Vβ†’β„•\nu : V \to \mathbb{N}.

The outer polynomial degree of CC is Ξ”=(N+1)d\Delta = (N + 1)d✦, its chosen prime modulus is the chosen prime modulus pp for Ξ”\Delta✦, and its circuit field is F=𝔽pF = \mathbb{F}_p.✦ For each node v∈Vv \in V, the witness domain size is 2g(v)2^{g(v)}✦, and the augmented node value is the augmented Boolean vector Ξ½Β―(v)=Ξ½(v)Β―d\overline{\nu}(v) = \overline{\nu(v)}_d over FF.✦ The proposal factor G:VΓ—β„•3β†’FG : V \times \mathbb{N}^3 \to F and allowance factor A:VΓ—β„•5β†’FA : V \times \mathbb{N}^5 \to F are the images of Ο€\pi and Ο„\tau in FF. For any guess length mβˆˆβ„•m \in \mathbb{N}, the edge coin price is Ο‰(m)=100(len(n)+len(d)+len(N)+len(p)+m+2).\omega(m) = 100\bigl(\mathrm{len}(n) + \mathrm{len}(d) + \mathrm{len}(N) + \mathrm{len}(p) + m + 2\bigr).(2)✦

The definition

Definition. Let CC be a weighted dependency circuit with width dd, secondary dependency count NN, node count nn, node set V={0,…,nβˆ’1}V = \{0, \dots, n - 1\}, prime modulus pp, circuit field FF, and edge coin price Ο‰\omega as in (2).

First, CC is a valid circuit specification if Ξ½(v)<2d\nu(v) < 2^d and g(v)≀dg(v) \le d for every v∈Vv \in V, if Ξ½(v)=Ξ±(v)\nu(v) = \alpha(v) for every base node v∈Vv \in V with Ξ²(v)=1\beta(v) = 1, and if for every internal node v∈Vv \in V with Ξ²(v)=0\beta(v) = 0 and every integer 0≀z≀d0 \le z \le d, βˆ‘y=02g(v)βˆ’1G(v,z,y,Ξ½(Ξ·(v)))β‹…βˆi=0Nβˆ’1A(v,z,y,i,Ξ½(Ξ·(v)),Ξ½(Ο‡(v,i)))=Ξ½Β―(v)z\begin{aligned} &\sum_{y = 0}^{2^{g(v)} - 1} G\bigl(v, z, y, \nu(\eta(v))\bigr) \\ &\qquad \cdot \prod_{i = 0}^{N - 1} A\bigl(v, z, y, i, \nu(\eta(v)), \nu(\chi(v, i))\bigr) = \overline{\nu}(v)_z \end{aligned}(3)✦ in FF.

Second, a node coin budget Ο•:Vβ†’β„•\phi : V \to \mathbb{N} is valid for CC if for every internal node v∈Vv \in V with Ξ²(v)=0\beta(v) = 0, Ο•(Ξ·(v))+Ο‰(0)≀ϕ(v),Ο•(Ο‡(v,i))+Ο‰(g(v))≀ϕ(v)for all 0≀i<N.\begin{aligned} \phi\bigl(\eta(v)\bigr) + \omega(0) &\le \phi(v), \\ \phi\bigl(\chi(v, i)\bigr) + \omega\bigl(g(v)\bigr) &\le \phi(v) \quad \text{for all } 0 \le i < N. \end{aligned}(4)✦

Third, let II be an index set, XX an alphabet, (Ci)i∈I(C_i)_{i \in I} a family of weighted dependency circuits with parameters di,Ni,ni,pid_i, N_i, n_i, p_i and node sets ViV_i, let x:Iβ†’X*x : I \to X^* be a family of public input words, and let S,a0:Iβ†’β„•S, a_0 : I \to \mathbb{N} be a space bound and a parameter family. The family (Ci)i∈I(C_i)_{i \in I} is space-uniform with respect to xx, SS, and a0a_0 if:

  1. i↦dii \mapsto d_i and i↦Nii \mapsto N_i are space-bounded computable from a0a_0 on xx in space SS;

  2. there exist constants c1,c2βˆˆβ„•c_1, c_2 \in \mathbb{N} such that for every i∈Ii \in I, len(ni)≀c1(S(i)+1),len(pidi+1)≀c2(S(i)+1);\begin{aligned} \mathrm{len}(n_i) &\le c_1\bigl(S(i) + 1\bigr), \\ \mathrm{len}\bigl(p_i^{d_i + 1}\bigr) &\le c_2\bigl(S(i) + 1\bigr); \end{aligned}(5)✦

  3. for every index set UU, reindexing map r:Uβ†’Ir : U \to I, auxiliary input a:Uβ†’β„•a : U \to \mathbb{N}, and node family v(u)∈Vr(u)v(u) \in V_{r(u)} such that a0∘ra_0 \circ r and vv are space-bounded computable from aa on x∘rx \circ r in space S∘rS \circ r, the four maps u↦βr(u)(v(u))u \mapsto \beta_{r(u)}(v(u)), u↦gr(u)(v(u))u \mapsto g_{r(u)}(v(u)), u↦ηr(u)(v(u))u \mapsto \eta_{r(u)}(v(u)), and u↦αr(u)(v(u))u \mapsto \alpha_{r(u)}(v(u)) are space-bounded computable from aa on x∘rx \circ r in space S∘rS \circ r;

  4. under the same hypotheses on U,r,a,vU, r, a, v, for every j:Uβ†’β„•j : U \to \mathbb{N} space-bounded computable from aa on x∘rx \circ r in space S∘rS \circ r with j(u)≀Nr(u)j(u) \le N_{r(u)} for all u∈Uu \in U, the map u↦χr(u)(v(u),j(u))u \mapsto \chi_{r(u)}(v(u), j(u)) is space-bounded computable from aa on x∘rx \circ r in space S∘rS \circ r;

  5. under the same hypotheses on U,r,a,vU, r, a, v, for all z,y,h:Uβ†’β„•z, y, h : U \to \mathbb{N} space-bounded computable from aa on x∘rx \circ r in space S∘rS \circ r satisfying z(u)≀dr(u)+1z(u) \le d_{r(u)} + 1, y(u)≀2dr(u)y(u) \le 2^{d_{r(u)}}, and h(u)<2dr(u)h(u) < 2^{d_{r(u)}} for all u∈Uu \in U, the map u↦πr(u)(v(u),z(u),y(u),h(u))u \mapsto \pi_{r(u)}(v(u), z(u), y(u), h(u)) is space-bounded computable from aa on x∘rx \circ r in space S∘rS \circ r;

  6. under the same hypotheses on U,r,a,vU, r, a, v, for all z,y,j,h,t:Uβ†’β„•z, y, j, h, t : U \to \mathbb{N} space-bounded computable from aa on x∘rx \circ r in space S∘rS \circ r satisfying z(u)≀dr(u)+1z(u) \le d_{r(u)} + 1, y(u)≀2dr(u)y(u) \le 2^{d_{r(u)}}, j(u)≀Nr(u)j(u) \le N_{r(u)}, h(u)<2dr(u)h(u) < 2^{d_{r(u)}}, and t(u)<2dr(u)t(u) < 2^{d_{r(u)}} for all u∈Uu \in U, the map u↦τr(u)(v(u),z(u),y(u),j(u),h(u),t(u))u \mapsto \tau_{r(u)}(v(u), z(u), y(u), j(u), h(u), t(u)) is space-bounded computable from aa on x∘rx \circ r in space S∘rS \circ r.

In the paper, the result reads: the implicit word graph separates base, ordinary, and history vertices, with ordinary vertices governed by total Boolean word functions, history vertices governed by a characteristic-two factored sum-product identity, and every vertex assigned a maximum path weight W(V)W(V).

What is checked

The Lean library states the valid circuit specification in (3) and the valid node coin budget in (4) over an arbitrary weighted dependency circuit with its chosen prime field, augmented Boolean values, and edge coin price, and states space-uniformity in (5) over an arbitrary indexed family of weighted dependency circuits with read-only public input words, a space bound, and a parameter family using uniform stack-machine computations and O(S)O(S) bit-length bounds.