The setting
In a space-bounded simulation of a capped one-tape Turing machine running for at most steps, the tape is partitioned into contiguous blocks of size at a chosen offset modulo , where grows like . The computation is grouped into epochs of single-block visits, and each epoch is subdivided into rounds of visits. Storing the full tape is too expensive; instead, an implicit directed acyclic graph of fixed-width words records the checkpoint blocks at the start of each epoch and the partial controller histories after the first visits of epoch , ending at the final epoch history.
The Lean library formalizes this construction in two parts. First, it packages a time cap and an offset index into a block-partition site using a power-of-two parameter . Second, it defines an abstract block-visit tour and builds its epoch word graph as a weighted dependency circuit over a prime field , proving that the checkpoint and epoch-copy vertices satisfy the required polynomial bit identities and that any space-computable family of bounded-word tours yields a space-uniform circuit family.
Stack-machine computability and weighted dependency circuits
For natural numbers , , and , the base- digit of at position is โฆ, and the base- digit packing of a sequence of length is โฆ. For a word width , a natural number , and a coordinate , the augmented bit coordinate is (1)โฆ Given a degree bound , the Lean library tests primality by trial division of all with and selects a prime modulus satisfying below the search bound by bounded witness search; its associated prime field is .
To encode pairs of natural numbers as single words, each bit is escaped as the two-bit list โฆ, a pair of bit lists is framed by concatenating the escaped bits of , a delimiter bit , and โฆ, and a bit list is evaluated as a natural number with least-significant bit firstโฆ. The paired encoding is the value of the framed binary representations of and .โฆ
Space-bounded computation is formalized by deterministic stack machines. A stack machine over a public alphabet , an argument tape index set , a stack index set , and an output set has a finite control state set , an initial state, and a transition table.โฆ Its read-only inputs consist of a public word and -indexed binary argument tapes, each padded with left and right endmarkersโฆ; heads start at position and move left, stay, or move right (clamped at and past the end of the tape). Its store holds the read-only head positions and -indexed binary stacks updated by keeping, pushing a bit, or popping the top bit. A halting execution within space is a halting transition run from the initial state in which every visited stack has length at most .โฆ
Let be an index set, a family of public words, and a space bound. A function satisfies the growth bound if there exists with for all โฆ, and satisfies the bit-length bound if the binary length satisfies the growth boundโฆ. A family is space-bounded computable from and an auxiliary input in space if there exist a finite auxiliary stack set , a constant , and a stack machine with a single port stack and no argument tapes that, for every , transforms the binary representation of into that of on input within stack height using empty initial and final auxiliary stacks.โฆ For a reindexing map , reindexed space-bounded computability on is space-bounded computability with pulled-back inputs and space bound .โฆ
A weighted dependency circuit consists of a word width , an auxiliary child count , a node count with node index set , and for each node : a Boolean base flag, a distinguished head child , auxiliary children for , a guess length , a base value, a proposal function , an allowance function , and a semantic value .โฆ Its outer polynomial degree is โฆ, and its circuit prime field is for the chosen prime modulus of that degreeโฆ.
A family of weighted dependency circuits is a space-uniform circuit family for public inputs , space bound , and checkpoint parameter if:
the word width and auxiliary child count of are space-bounded computable from and in space ;
the node count and register size satisfy the bit-length bound;
for every reindexing and auxiliary input from which and a node index are reindexed space-computable in space , the base flag, guess length, head child, and base value are reindexed space-computable from ; likewise, whenever the arguments are also reindexed space-computable from , so are the -th auxiliary child for , the proposal function for , , and , and the allowance function for , , , and .
Offset sites and abstract block-visit tours
For a time cap with binary length , the fifth-root exponent is โฆ, and the power-of-two block parameter is (2) which is positive. An offset block partition site consists of a time cap , a positive parameter , and an offset in .โฆ
A scene is a pair consisting of a controller word and a block array .โฆ An abstract block-visit tour consists of a positive round parameter , a controller bit width , a positive block count , an initial controller word , an initial block array , a block selector satisfying for all , and a visit map .โฆ
From , set the epoch visit count , the number of tour epochs , the controller radix , the common word width , and the round guess bit length . The reference evolution starts at and advances at each step by applying to the current controller and selected block , updating the controller and that block while leaving all other blocks unchanged.โฆ For , the packed controller history of length starting at visit is (3)โฆ For a block index , a packed controller transcript , and an initial block word , the -step local replay starts at for and advances at step by testing whether on the -th base- slice of equals , in which case it applies to that slice and the current buffer, updates the buffer, and conjoins the flag with bitwise equality of the output controller and the -th slice of .โฆ
A tour is a bounded-word tour if , for every , and for all and the pair satisfies and .โฆ A family of tours is a space-computable tour family for public inputs , space bound , and checkpoint parameter if , , , and are space-bounded computable from and in space , the register size of โs verification circuit (defined below) satisfies the bit-length bound, and for every reindexing and auxiliary input from which is reindexed space-computable (with all reindexed space-computability below taken from the same auxiliary input ):
is reindexed space-computable for any reindexed space-computable ;
is reindexed space-computable for any reindexed space-computable satisfying for all ;
, where , is reindexed space-computable for any reindexed space-computable and satisfying and for all .
The epoch word graph
Fix an abstract block-visit tour and let be the number of columns per epoch. The tour verification circuit has word width , auxiliary child count , and vertices indexed by . Each vertex has epoch , column , and round index . For , write and ; in each epoch , the columns are the checkpoint block vertices , column is the epoch-start copy vertex , and columns for are the round history vertices .
Writing for truncated subtraction on , the components of at a vertex are defined as follows. A vertex is a base vertex when and โฆ, with base value if and otherwiseโฆ. Its guess length is if and otherwise.โฆ Its distinguished head child and -th auxiliary child are (4) For a round history vertex , setting , the proposed round history for a parent history word and guess is .โฆ The proposal function and local consistency check are (5) where is the output block buffer of and is the Boolean consistency flag of . The semantic value of is (6)โฆ Let be the circuit prime field of . A vertex satisfies the required vertex bit identity at if, setting and casting each natural number into , (7)โฆ
The claim
Definition. For an abstract block-visit tour , the tour target vertex is (8)โฆ For natural numbers and , the choice site is the offset block partition site (9)โฆ
Theorem. Let be an abstract block-visit tour with circuit prime field , and assume that is a bounded-word tour.
For all natural numbers , , and with and , the checkpoint block vertex satisfies the required vertex bit identity in , with : (10)โฆ
For all natural numbers and with , the epoch-start copy vertex satisfies the required vertex bit identity in , with : (11)โฆ
Let be a space-computable tour family for public inputs , space bound , and checkpoint parameter . If every is a bounded-word tour, then (12)โฆ
What is checked
The definitions and claims above are stated over an abstract block-visit tour with its tour verification circuit over the chosen prime field , a space-computable family of bounded-word tours under the stack-machine space model, and natural numbers and defining an offset block partition site. Beyond these results, the Lean library proves that for every so that the offset modulus in (9) is positive.โฆ