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.
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.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.
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.
Markov heavy-variable bound (§5.5, p. 38): for 0 < b₀ and variables < n,
(heavyVarList n b₀ sys).length ≤ (sys.map fun eq => (equationVars eq).length).sum / b₀.
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).
Instances For
Outcome of preparing a single heavy-variable branch (S ↦ vals) (§5.5 of [OAI26c]).
- 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
Instances For
Instances For
Structural option view of BranchOutcome for native encoding and option elimination.
Instances For
Native binary encoding of BranchOutcome (n' in unary, sys' as framed nested lists).
Instances For
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 [OAI26c]): 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.
Instances For
Dispatch a BranchOutcome to an external counting oracle solver on .reduced branches.
Instances For
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.
Instances For
Native encoding of BranchInput (n in unary, S and sys as framed lists).
Instances For
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).
Stream all 2 ^ |S| heavy-variable assignments via BooleanFold.run without materializing the
assignment list, returning (finalIdx, (|S|, (inp, totalCount))).
Instances For
Total common-zero count computed by streaming 2 ^ |S| heavy-variable branches.
Instances For
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.
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.
Instances For
Per-branch native callback certificate for branchBody solver (for a fixed solver).
Instances For
Full streaming native certificate for streamBranches solver (for a fixed solver).
Instances For
Full streaming native certificate for countByBranching solver (for a fixed solver).
Instances For
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 [OAI26c]).
Solver-independent polynomial overhead per streaming round and for initialization.
Instances For
stepOverhead is polynomially bounded in the encoded input length.
Space-efficient streaming ComputableInO bound for streamBranches (§5.5 of
[OAI26c]): 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
[OAI26c]): 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|).