Explicit block-counting networks #
The block-counting network of a schedule (Turing.MultiTapePTM.blockNetwork) carries structured
letters on its edges: control records and block contents (Turing.MultiTapePTM.BlockLetter).
This module writes it out as an explicit Boolean tensor network
(Cslib.Circuits.Frontier.ExplicitTensorNetwork), the form that a contraction algorithm reads,
completing the construction of Lemma 2.2 of the note Deterministic simulations of
nondeterministic and randomized time (30 October 2026) formalized in issue #1833:
- Binarize by a concrete injective code of the letters
(
Turing.MultiTapePTM.letterCode), inletterBits k s b = (s + k + 4) * bbits, wheresnumbers the states. A letter is numbered byTuring.MultiTapePTM.letterEquiv, composed of the standard numberings of finite products, sums, options and functions (finProdFinEquiv,finSumFinEquiv,finSuccEquiv,finFunctionFinEquiv); its code is the binary digits of its number. - Subdivide every Boolean edge by an equality tensor, which makes the network bipartite.
- Write out (
Cslib.Circuits.Frontier.TensorNetwork.toExplicit), numbering the old vertices (the intervals and sinks) first and the subdivision vertices after them, both by concrete numberings (Turing.MultiTapePTM.explicitVertexEquiv,Turing.MultiTapePTM.explicitEdgeEquiv).
Each step preserves the contraction, so the explicit networks of the schedules still sum to the
accepting count (Turing.MultiTapePTM.sum_contraction_explicitBlockNetwork).
Size. With q intervals, k work tapes and m = letterBits k s b, the explicit network has
2 * (q * (3 * k + 1) * m) edges and maximum degree at most 2 * (3 * k + 1) * m, both O(b) per
interval. Its first q * (3 * k + 2) vertices are the rows of a bipartition: every edge has
exactly one port at a row and one at a column
(Cslib.Circuits.Frontier.DescribedNetwork.IsRowsFirstBipartite). Every table has length
2 ^ (number of ports), and its entries are at most 2 ^ b.
These are the inputs of the Boolean tensor contraction theorem [OpenAI2026ETH, Theorem D.1]
as the counting simulation of #1833 uses it: with b = ⌈log₂ (t + 2)⌉ and q * b ≤ 2 t, the
networks have O(t) edges and maximum degree O(log t).
Main definitions #
Turing.MultiTapePTM.letterEquiv,Turing.MultiTapePTM.letterCode,Turing.MultiTapePTM.letterBits: the numbering and binary code of the letters.Turing.MultiTapePTM.blockEdgeEquiv,Turing.MultiTapePTM.explicitVertexEquiv,Turing.MultiTapePTM.explicitEdgeEquiv: the numberings of edges and vertices.Turing.MultiTapePTM.explicitBlockNetwork: the explicit block-counting network of a schedule.
Main results #
Turing.MultiTapePTM.letterCode_injective: the code is injective.Turing.MultiTapePTM.contraction_explicitBlockNetwork: writing the network out preserves its contraction.Turing.MultiTapePTM.sum_contraction_explicitBlockNetwork: summed over the schedules, the contractions are the accepting count.Turing.MultiTapePTM.admissible_explicitBlockNetwork: at a clocktwithb = O(log t)andq * b ≤ 2 t, the network is rows-first bipartite withO(t)edges and degreeO(log t).Turing.MultiTapePTM.numEdges_explicitBlockNetwork,Turing.MultiTapePTM.length_vertices_explicitBlockNetwork,Turing.MultiTapePTM.maxDegree_explicitBlockNetwork_le,Turing.MultiTapePTM.isRowsFirstBipartite_explicitBlockNetwork,Turing.MultiTapePTM.length_table_explicitBlockNetwork,Turing.MultiTapePTM.entry_le_explicitBlockNetwork: size, degree, bipartition and tables.
References #
The output tracks numbered empty ↦ 0, accept ↦ 1, other ↦ 2.
Numbering and coding the letters #
The letters numbered: the control records first (Turing.MultiTapePTM.controlEquiv),
then the block contents (Turing.MultiTapePTM.contentsEquiv).
The number of bits of a letter: (s + k + 4) * b, for s states and k work tapes.
Every letter number fits in letterBits k s b bits.
The letter code: the letterBits k s b binary digits, least significant first, of the
number of a letter (Turing.MultiTapePTM.letterEquiv).
The letter code is injective: letter numbers fit in letterBits k s b bits.
Numbering the edges and vertices #
The vertices of the explicit network numbered: the old vertices first (the intervals, then the
sinks in the order of their edges), then the subdivision vertices, one for each copy (e, j) of an
edge.
The explicit network #
The explicit block-counting network of the schedule σ: the block-counting network
binarized by the letter code (Turing.MultiTapePTM.letterCode), subdivided by equality tensors
and written out with the old vertices first. Its first q * (3 * k + 2) vertices are the rows of
its bipartition.
Writing the network out preserves its contraction.
The block-counting identity for the explicit networks (the note's Lemma 2.2, equation
(2)). Summed over the movement schedules of q > 0 intervals of b bits, the contractions of the
explicit block-counting networks are the accepting count on q * b bits.
The explicit network has 2 * (q * (3 * k + 1) * letterBits k s b) edges: two halves of each
of the letterBits k s b copies of each of the q * (3 * k + 1) edges.
The explicit network has q * (3 * k + 2) old vertices and one subdivision vertex for each
copy of an edge.
The degree bound: at most 2 * (3 * k + 1) * letterBits k s b ports at every vertex,
O(b) for a fixed machine.
The bipartition: the first q * (3 * k + 2) vertices, the old ones, are rows; every edge
joins an old vertex to a subdivision vertex.
Admissibility at a clock t. With blocks of b ≤ 3 ⌊log₂ t⌋ steps and padded time
q * b ≤ 2 t, the explicit network is rows-first bipartite with O(t) edges and maximum degree
O(log t), with the constant 6 (3 k + 1) (s + k + 4) of the machine. For the counting
simulation, b = ⌈log₂ (t + 2)⌉ (Nat.clog_two_add_two_le_three_mul_log_two).
Every table of the explicit network lists the values at all bits on its ports.
The entry bound: every table entry of the explicit network is at most 2 ^ b.