The setting
To evaluate a large implicit computation in small space, one represents its intermediate values as words of a common bit width 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 , 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 , , and , the base- digit of at position is .β¦ For a natural number , let denote its binary bit length, equal to when and when .
For a Boolean predicate on and a bound , the bounded universal scan of below holds when holds for every (and holds vacuously when ).β¦ The bounded witness search of below returns the largest natural number for which holds, and returns if no such exists.β¦ For , the non-divisor check holds unless both and .β¦ The trial division primality test on holds when and the bounded universal scan of the non-divisor check for holds below .β¦
A prime modulus is a prime number , with associated prime field . A field vector over is a sequence .β¦ Given a degree bound , the valid prime modulus test accepts when and passes the trial division primality test.β¦ The chosen prime modulus for is the prime returned by bounded witness search for the valid prime modulus test below the search bound .β¦
For a width , a natural number , and a coordinate , the augmented bit coordinate is (1)β¦ The augmented Boolean vector of at width over a prime field is the field vector whose -th entry is the image of from (1) in .β¦
Space-bounded stack machines
A head move direction is one of three moves: left, stay, or right.β¦ Over an alphabet , a tape symbol with endmarkers is either a left endmarker , a letter , or a right endmarker .β¦ On a finite word , inspecting position returns , while inspecting position returns when and when . A single head step on from position leaves unchanged on stay, moves to on left, and moves to on right unless , in which case it stays at .β¦
For a public alphabet and an argument index set , a tuple of read-only input tapes consists of a public word and a family of bit strings with .β¦ Input head positions specify a public position in and an argument position in for each , with the initial head positions placing every head at . Input head observations record the marked symbol under the public head in and under each argument head in , obtained by applying tape inspection coordinatewise. A head movement tuple assigns a head move direction to the public tape and to each , advancing all heads coordinatewise by single head steps.
A stack operation on a bit stack in 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 and a stack index set , a machine store state pairs input head positions on with a family of bit stacks indexed by β¦; an initial store state places all input heads at with given initial stack contents (empty by default).β¦ Given an extra stack index set and a store state on port stacks , adjoining empty work stacks preserves the input head positions of , retains the stacks on , and initializes every stack in to empty, yielding a store state on .β¦ A store state satisfies the stack height bound if every stack has length at most .β¦ 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 with a stack operation for each , updating a store state by advancing its input heads and applying each stack operation to its stack.
A stack machine over public alphabet , argument index set , stack index set , and output set consists of a finite control state set , an initial state , and a transition table mapping a state in , input head observations, and top stack symbols to either a halting output in or a transition action pairing a next state in with a store transition update.β¦ A configuration of is a pair of a control state and a store state.β¦ On read-only input tapes , a single machine step evaluates the transition table at and either halts with the returned output or moves to the next state and updated store.β¦ For any transition function and state invariant on , a halting transition run from to with output is a finite chain of steps starting at and ending at where holds at every visited state, each intermediate step follows , and halts with .β¦ A space-bounded configuration run of on with bound is a halting transition run of single machine steps whose visited configurations all satisfy the stack height bound .β¦ A space-bounded execution of on with bound from store to store with output means there exists a final state admitting a space-bounded configuration run from to with output .β¦
Let be an index set and a space bound. A uniform stack-machine computation on read-only input tapes from initial stores to final stores on port stacks producing outputs exists if there are a finite auxiliary stack index set , a stack machine with stack set , and a constant such that for every , has a space-bounded execution on with bound from with adjoined empty -stacks to with adjoined empty -stacks returning .β¦ Packaging a word with no argument tapes forms a single public input tapeβ¦, and placing the canonical binary bits of on a single port stack with no argument tapes and head at forms a binary-encoded natural number store.β¦ A family is space-bounded computable from on public input words in space if there is a uniform stack-machine computation on the single public input tapes of transforming the binary-encoded stores of to those of in space with trivial output.β¦ Given a reindexing map , the reindexed space-bounded computation relation on is space-bounded computability with respect to and .β¦ Finally, a function satisfies the growth bound if there exists with for all β¦, and satisfies the bit-length bound if satisfies the growth bound.β¦
Weighted dependency circuits
A weighted dependency circuit specifies a word width , a secondary dependency count , and a node count with node set , together with the following maps:
a base indicator , where marks a base node and an internal node;
a distinguished dependency map and a secondary child map (both total, unused at base nodes);
a guess length and a base value ;
a proposal function taking a node, coordinate, guess, and head value, and an allowance function taking a node, coordinate, guess, child index, head value, and child value;
a semantic value .
The outer polynomial degree of is β¦, its chosen prime modulus is the chosen prime modulus for β¦, and its circuit field is .β¦ For each node , the witness domain size is β¦, and the augmented node value is the augmented Boolean vector over .β¦ The proposal factor and allowance factor are the images of and in . For any guess length , the edge coin price is (2)β¦
The definition
Definition. Let be a weighted dependency circuit with width , secondary dependency count , node count , node set , prime modulus , circuit field , and edge coin price as in (2).
First, is a valid circuit specification if and for every , if for every base node with , and if for every internal node with and every integer , (3)β¦ in .
Second, a node coin budget is valid for if for every internal node with , (4)β¦
Third, let be an index set, an alphabet, a family of weighted dependency circuits with parameters and node sets , let be a family of public input words, and let be a space bound and a parameter family. The family is space-uniform with respect to , , and if:
and are space-bounded computable from on in space ;
there exist constants such that for every , (5)β¦
for every index set , reindexing map , auxiliary input , and node family such that and are space-bounded computable from on in space , the four maps , , , and are space-bounded computable from on in space ;
under the same hypotheses on , for every space-bounded computable from on in space with for all , the map is space-bounded computable from on in space ;
under the same hypotheses on , for all space-bounded computable from on in space satisfying , , and for all , the map is space-bounded computable from on in space ;
under the same hypotheses on , for all space-bounded computable from on in space satisfying , , , , and for all , the map is space-bounded computable from on in space .
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 .
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 bit-length bounds.