Heavy-variable branching and streaming common-zero accumulation #
Implements the heavy-variable branching reduction and space-efficient streaming accumulator from
§5.5 (Proof of Theorem 2.2, pp. 38–39) of OpenAI, The Exponential Time Hypothesis is
False over SparsePolyCompile, bridged to SparseEquations and BooleanFold.
Main definitions #
extendAssignment,rootCount,toFinsetEquation,heavyVarList,relabelFreeVar,freeVarEquiv: common-zero countN(P), heavy-variable filter, and dense[n] \ S ≃ [n - |S|].substituteEquation,relabelEquation,BranchOutcome,prepareBranch,branchRootCount,branchCountOracle: simultaneous(S, vals)substitution, short-circuiting, and oracle dispatch.BranchInput,encBranchInput,branchBody,streamBranches,countByBranching,branchCountCertificate,branchBodyCertificate,certificate,countCertificate,stepOverhead: streamingBooleanFoldcombinator and native time/space certificates.reducedCost,maxReducedCost: the cost of a solver on a reduced branch, and its maximum over the branches.
Main results #
rootCount_eq_commonZeroCount,toFinset_heavyVarList_eq_heavyVars,length_heavyVarList_le_div,prepareBranch_reduced_canonical,prepareBranch_reduced_degree_le,prepareBranch_reduced_length_le,prepareBranch_reduced_varDegree_le,length_enc_reduced_le_parent,length_enc_reduced_le.branchRootCount_prepareBranch,sum_branch_count_eq_rootCount,streamBranches_correct,countByBranching_eq_rootCount,runPrefix_sum_le_two_pow,computableInPolyTime_prepareBranch,streamBranches_computableInO,countByBranching_computableInO,polyBounded_branchWorkspace.le_maxReducedCost,maxReducedCost_le: bounds on the maximum branch cost.
References #
- OpenAI, The Exponential Time Hypothesis is False, §5.5 (pp. 38–39)
1. Common-Zero Counting, SparseEquations Bridges, and heavyVarList #
Specification bridge to SparseEquations.commonZeroCount: for any canonical sparse 𝔽₂
system sys on < n variables, rootCount n sys agrees with Cslib.BitString.commonZeroCount.
Specification bridge to SparseEquations.heavyVars: heavyVarList n b₀ sys enumerates
Cslib.BitString.heavyVars in strictly increasing order.
2. Order-Preserving Dense Free-Variable Relabeling #
For S.Nodup, relabelFreeVar S is strictly increasing from u ∉ S to any larger v.
For S.Nodup, relabelFreeVar S is injective on all variables outside S.
3. Multi-Variable Substitution, Canonicalization, and prepareBranch #
Substitute (S, vals) across eq and cancel duplicate monomials modulo 2 (looking up the
first index S.idxOf v if S has duplicates, defaulting missing entries ≥ vals.length to
false, and ignoring trailing vals entries past S.length).
Outcome of preparing a single heavy-variable branch (S ↦ vals) (§5.5 of [OAI26k]).
- contradiction : BranchOutcome
Contradictory constant equation
1 = 0([[]]) appeared;0satisfying completions. - tautology (freeVars : ℕ) : BranchOutcome
All equations simplified to
0 = 0; all2 ^ freeVarscompletions satisfy the system. - reduced (freeVars : ℕ) (sys : List (List (List ℕ))) : BranchOutcome
Non-empty reduced system on
freeVars = n - |S|densely relabeled free variables.
Instances For
Structural option view of BranchOutcome for native encoding and option elimination.
Native binary encoding of BranchOutcome (n' in unary, sys' as framed nested lists).
For S.Nodup in < n and canonical sys on < n, any .reduced n' sys' branch has
n' = n - S.length, sys' ≠ [], [] ∉ sys', [[]] ∉ sys', and canonical < n' equations.
Degree preservation: if sys has degree at most k, so does any reduced branch sys'.
Monomial-count and scope-width preservation across prepareBranch.
Per-variable incidence preservation: for S.Nodup and u ∉ S, varDegree (relabelFreeVar S u)
on any .reduced branch sys' never exceeds varDegree u sys.
Uniform free-variable incidence preservation (§5.5 of [OAI26k]): for S.Nodup in < n,
if every u < n outside S has varDegree u sys ≤ b₀, every u' < n' in sys' has ≤ b₀.
4. Exact Common-Zero Count Preservation #
Exact common-zero count represented by a BranchOutcome.
Dispatch a BranchOutcome to an external counting oracle solver on .reduced branches.
Single-branch exactness: for S.Nodup in < n, sys on < n, and vals.length = S.length,
branchRootCount (prepareBranch n S vals sys) counts common zeros extending (S, vals).
Exponential-branching decomposition identity: for S.Nodup in < n and sys on < n,
summing branchCountOracle solver over 0 ≤ idx < 2 ^ S.length via lowBits S.length idx equals
rootCount n sys whenever solver is exact on .reduced branches.
5. Plain Polynomial-Time Certificates for heavyVarList and prepareBranch #
Computing heavyVarList n b₀ sys (n in unary, b₀ in binary) is polynomial-time.
relabelFreeVar is computable in polynomial time.
relabelEquation is computable in polynomial time.
substituteEquation is computable in polynomial time.
prepareBranch is computable in polynomial time.
6. Space-Efficient Streaming BooleanFold Combinator #
Input tuple (n, S, sys) for streaming heavy-variable branching.
Total variable count n of a BranchInput.
Heavy-variable list and equation-system pair (S, sys) of a BranchInput.
Heavy-variable list S of a BranchInput.
Equation system sys of a BranchInput.
Streaming state (finalIdx, (|S|, (inp, totalCount))) returned by streamBranches.
Retained (|S|, (inp, totalCount)) step state of a BranchStreamState.
Retained (inp, totalCount) accumulator pair of a BranchStreamState.
Running or final common-zero count of a BranchStreamState.
Native encoding of BranchInput (n in unary, S and sys as framed lists).
Encoded-size non-expansion against the parent system: every .reduced n' sys' branch produced
by prepareBranch has encoded solver input (n', sys') no longer than the parent (n, sys).
Encoded-size non-expansion: every .reduced n' sys' branch produced by prepareBranch has
encoded solver input (n', sys') no longer than the parent encBranchInput (n, S, sys).
Callback input tuple ((|S|, vals), (inp, accSum)) for branchBody.
Width and bit-vector pair (|S|, vals) of a PrepareStepInput.
Assignment bit-vector vals of a PrepareStepInput.
Retained (inp, accSum) accumulator pair of a PrepareStepInput.
Retained BranchInput of a PrepareStepInput.
Running common-zero accumulator accSum of a PrepareStepInput.
Single streaming step of heavy-variable branching.
Stream all 2 ^ |S| heavy-variable assignments via BooleanFold.run without materializing the
assignment list, returning (finalIdx, (|S|, (inp, totalCount))).
Total common-zero count computed by streaming 2 ^ |S| heavy-variable branches.
Prefix invariant of BooleanFold.runPrefix: inp is preserved and the accumulator holds the
sum of the first j decoded branch counts.
Streaming correctness: for S.Nodup in < n and sys on < n, (streamBranches solver (n, S, sys)).2.2 = ((n, S, sys), rootCount n sys) when solver is exact on .reduced branches.
Streaming count correctness: for S.Nodup in < n and sys on < n, countByBranching solver (n, S, sys) = rootCount n sys when solver is exact on .reduced branches.
The cost of every reduced branch is at most maxReducedCost.
maxReducedCost is at most any bound on the costs of the reduced branches.
Selected-branch native certificate for branchCountOracle solver: a fixed csolver runs ONLY
on .reduced n' sys' outcomes, while .contradiction emits 0 and .tautology n' emits 2 ^ n'
via BooleanFold.clock in linear time and space.
Per-branch native callback certificate for branchBody solver (for a fixed solver).
Full streaming native certificate for streamBranches solver (for a fixed solver).
Full streaming native certificate for countByBranching solver (for a fixed solver).
Prefix sum bound: when solver n' sys' ≤ 2 ^ n' on reduced branches of inp, every streaming
prefix j ≤ 2 ^ |S| keeps the running sum at most j * 2 ^ (n - |S|).
When |S| ≤ n and solver n' sys' ≤ 2 ^ n' on reduced branches, the running sum satisfies
Z ≤ 2 ^ n throughout the entire streaming traversal (§5.5 p. 39 of [OAI26k]).
Solver-independent polynomial overhead per streaming round and for initialization.
stepOverhead is polynomially bounded in the encoded input length.
Space-efficient streaming ComputableInO bound for streamBranches (§5.5 of
[OAI26k]): for fixed solver bounded by 2 ^ n' with time ≤ R_solver and space
≤ Q_solver on .reduced branches, runs in time O(stepOverhead |inp| + (2 ^ |S| + 1) * (stepOverhead |inp| + R_solver inp)) and workspace O(stepOverhead |inp| + Q_solver inp).
Space-efficient streaming ComputableInO bound for countByBranching (§5.5 of
[OAI26k]): for fixed solver bounded by 2 ^ n' with time ≤ R_solver and space
≤ Q_solver on .reduced branches, returns the total count in time O(stepOverhead |inp| + (2 ^ |S| + 1) * (stepOverhead |inp| + R_solver inp)) and workspace O(stepOverhead |inp| + Q_solver inp) (with no 2 ^ |S| factor in workspace).
Polynomial-workspace preservation: whenever Q_solver is polynomially bounded in the encoded
input length, the total streaming workspace stepOverhead |inp| + Q_solver inp is also
polynomially bounded (independent of 2 ^ |S|).