Documentation

CslibFrontier.Computability.Complexity.Classes.CountingSimulation.Interfaces

Interfaces of the deterministic counting simulation #

The deterministic simulation of nondeterministic and probabilistic time by blocking and tensor contraction (#1833) has two ingredients that are formalized separately. This module states them as interfaces, so that the assembly (Cslib.Complexity.CountingSimulation.exists_computableInO_count) can be proved from them, and each can be discharged on its own.

Parameters. A run of t steps is cut into numBlocks t = ⌈t / b⌉ intervals of blockLength t = b = ⌈log₂ (t + 2)⌉ steps and padded to paddedTime t = numBlocks t * b ≥ t steps. Each of heads blocked heads moves by at most one block per interval, so a run has one of at most 3 ^ (heads * numBlocks t) movement schedules.

Networks (Cslib.Complexity.CountingSimulation.NetworkFamily). A network for each input x, clock t and schedule σ, built in polynomial time from x, t in unary and σ in binary, whose values sum to the count being simulated at the padded time. Each network is admissible for the contraction algorithm at size t, with a constant of the family. This is the block-counting step of #1833 (milestone H3): blocking after Hopcroft, Paul and Valiant, with a Boolean tensor network for each schedule whose contraction counts the accepting choice strings with that schedule. It is new mathematics, not a cited result.

Contraction (Cslib.Complexity.CountingSimulation.ContractionAlgorithm). One native machine that, given a precision P and a network G, outputs value G % 2 ^ P, and that, on networks admissible at a size s ≥ 2 with 1 ≤ P ≤ D * s, runs within time K * (n + 1) ^ K * 2 ^ (K * s / √⌊log₂ s⌋) and space K * (n + 1) ^ K, where n is the encoded length of (P, G) and K depends only on the constants. This is the form in which the simulation uses the Boolean tensor contraction theorem [OpenAI2026ETH, Theorem D.1] with ℓ = 1 and maximum degree O(log s) (milestone T2 of #1833), with the exponent in the natural-number scale of Nat.exists_three_pow_mul_le_two_pow_div_sqrt_log_two. Like Theorem D.1 it is parameterized by a size s bounding the number of edges and the precision, rather than by the number of edges itself.

Both interfaces are generic in the representation of networks: their type N, its encoding, the contracted value : N → ℕ and the admissibility predicate Admissible C s G are parameters. The intended instance takes N to be an explicit Boolean tensor network with its number of row vertices, value its contraction, and Admissible C s G to say that G is bipartite with at most C * s edges and maximum degree at most C * log₂ s. This is Cslib.Complexity.CountingSimulation.ExplicitAdmissible, which also bounds the vertices and asks for full tables and at least s edges; the block-counting networks discharge the network interface with it (Cslib.Complexity.CountingSimulation.networkFamilies_explicitAdmissible).

Main definitions #

Main results #

References #

Blocking parameters #

The length ⌈log₂ (t + 2)⌉ of a time interval for a clock t.

Instances For

    The number ⌈t / blockLength t⌉ of time intervals for a clock t.

    The padded running time numBlocks t * blockLength t, a whole number of intervals.

    The number 3 ^ (heads * numBlocks t) of movement schedules of heads blocked heads.

    An interval has at least one step.

    Padding never shortens a run: t ≤ paddedTime t.

    An interval is no longer than the clock, from t = 2 on.

    The padded time stays linear: from t = 2 on, paddedTime t + 1 ≤ 2 * t, since padding adds less than one interval.

    The interfaces #

    structure Cslib.Complexity.CountingSimulation.ContractionAlgorithm {N : Type} (encN : N ↪ List Bool) (value : N → ℕ) (Admissible : ℕ → ℕ → N → Prop) :

    The contraction interface (the Boolean tensor contraction theorem, as the simulation uses it). One native certificate computes value G % 2 ^ P from the precision P in binary and the network G. For all constants C and D there is K such that on every network admissible at a size s ≥ 2 with constant C, and every precision 1 ≤ P ≤ D * s, the certificate's time is at most K * (n + 1) ^ K * 2 ^ (K * s / √⌊log₂ s⌋) and its space at most K * (n + 1) ^ K, where n is the encoded length of (P, G). Outside admissible inputs the certificate need only be correct.

    structure Cslib.Complexity.CountingSimulation.NetworkFamily {N : Type} (encN : N ↪ List Bool) (value : N → ℕ) (Admissible : ℕ → ℕ → N → Prop) (count : List Bool → ℕ → ℕ) :

    The network interface (the block-counting lemma, as the simulation uses it), for a count count x τ of the inputs x at padded time τ, such as the number of accepting choice strings of length τ of a fair-coin machine. The family has a number of blocked heads and an admissibility constant. Its network for the input x, the clock t and the schedule σ is computable in polynomial time from x, t in unary and σ in binary. Whenever |x| ≤ t and 2 ≤ t, the values of the networks of the scheduleCount heads t schedules sum to count x (paddedTime t), and each of these networks is admissible at size t.