Size-sensitive reductions, summed disjoint-instance lists, and live-workspace accumulation #
Fine-grained and exact exponential reductions fall into three reusable patterns:
- Single-instance size-sensitive reductions (
Cslib.Complexity.SizeSensitiveReduction): a polynomial-time maptoFun : α → βwith an explicit affine parameter boundμB (toFun a) ≤ scale * μA a + offset. Keepingscaleandoffsetseparate preserves the exact multiplicative ratescale * δwhen transferring2 ^ (δ * μB)bounds, while absorbing2 ^ (δ * offset)into the leading constant (SizeSensitiveReduction.decidableInExpTime,SizeSensitiveReduction.decidableInSubexpTime) and bounding workspace in terms of input, intermediate instance length, and simulated space rather than simulated running time (SizeSensitiveReduction.exists_computableInO_comp). - Materialized disjoint-instance batches (
Cslib.Complexity.InstanceBatch,Cslib.Complexity.CNFInstanceBatch,Cslib.Complexity.DisjointBatchReduction): a batch of instancesxs : InstanceBatch βwith summed parameterxs.sumMeasure μ = (xs.items.map μ).sumprocessed sequentially viaTuring.MultiTapeTM.ComputableInO.foldl, together with a capped binary counterCslib.Complexity.CappedNatAcckeeping live accumulator bit-length polynomial during exact counting sums. - Depth-first stack accumulation (
Cslib.Complexity.StackAccumulationSpec): sequential depth-first generation and accumulation over up to2 ^ ν(a)leaf subinstances without materializing the exponentially long output list, abstracting the disjoint-list / sparsification search pattern (Cslib.BinaryBranching). Time accumulates across all rounds while maximum live workspace depends only on the live stack, accumulator, binary round counter, and single-leaf solver space.
Main definitions #
Cslib.Complexity.SizeSensitiveReduction: polynomial-time map withμB (f a) ≤ scale * μA a + offset.Cslib.Complexity.InstanceBatch,Cslib.Complexity.CNFInstanceBatch: instance lists with summed parameter measures andenc_structure-backed declared-variable CNF batches.Cslib.Complexity.CappedNatAcc:enc_structure-backed capped binary sum accumulator with polynomially bounded bit length.Cslib.Complexity.DisjointBatchReduction: polynomial-time reduction producing anInstanceBatchwith linearly boundedsumMeasure.Cslib.Complexity.StackSearchState,Cslib.Complexity.StackNodeInput,Cslib.Complexity.StackCombineInput,Cslib.Complexity.StackAccumulationSpec: depth-first stack generation and sequential leaf accumulation with independent time and live-workspace bounds.
Main results #
Cslib.Complexity.SizeSensitiveReduction.refl,.trans,.decidableInExpTime,.decidableInSubexpTime,.exists_computableInO_comp,.computableInPolySpace_comp.Cslib.Complexity.DisjointBatchReduction.exists_computableInO_foldl,.decidableInExpTime_or,.decidableInSubexpTime_or,.exists_computableInO_cappedSum.Cslib.Complexity.StackAccumulationSpec.exists_computableInO_run,.decidableInExpTime_of_stack,.decidableInSubexpTime_of_stack,.exists_computableInO_cappedSum_of_stack,.run_eq_foldl_leafWords,.run_cappedSum_eq_root.
References #
Single-instance size-sensitive reductions #
A size-sensitive reduction from (α, encA, μA) to (β, encB, μB)
[IPZ01]: a polynomial-time map toFun : α → β with explicit multiplicative
scale scale and additive offset offset bounding μB (toFun a) ≤ scale * μA a + offset.
- toFun : α → β
The instance map.
- scale : ℕ
Multiplicative parameter factor.
- offset : ℕ
Additive parameter offset.
- computableInPolyTime_toFun : Turing.MultiTapeTM.ComputableInPolyTime self.toFun encA encB
Polynomial-time certificate for
toFun. Affine parameter bound on reduced instances.
Composition of size-sensitive reductions, multiplying scales and composing offsets.
Encoded output length of a size-sensitive reduction is polynomially bounded in encoded input length.
A membership-preserving SizeSensitiveReduction induces PolyTimeReducible.
A count-preserving SizeSensitiveReduction induces ParsimoniousReducible.
Exact-scale exponential-time transfer. A decider for B within time
2 ^ (δ * μB b) * poly(|b|) transfers along r to a decider for A within time
2 ^ (r.scale * δ * μA a) * poly(|a|), keeping r.scale * δ independent of r.offset.
Subexponential-time transfer along a size-sensitive reduction.
Independent time and live-workspace composition. Composing g (ComputableInO g encB encC Tg Sg) with r bounds workspace by a polynomial in |encA a| plus Sg (r.toFun a) (never by
Tg (r.toFun a)), so polynomial space transfers without bounding space by simulated time.
Polynomial space transfers along any SizeSensitiveReduction.
Summed parameter lists and capped binary accumulators #
The empty batch of subinstances.
A single-element batch.
Concatenation of two subinstance batches.
Number of subinstances in the batch.
Summed parameter measure ∑ a ∈ xs.items, μ a.
Maximum parameter measure max_{a ∈ xs.items} μ a (0 on the empty batch).
Every subinstance in a batch has measure at most the batch's summed measure.
The maximum subinstance measure is bounded by the summed measure.
Encoding of InstanceBatch α as the framed list of its items (encList encA).
A concrete batch of CNF formulas over a shared number declaredVars of declared variables,
as produced by disjoint/counting sparsification.
- declaredVars : ℕ
Shared number of declared variables
0, …, declaredVars - 1. Disjoint subformulas whose satisfying assignments partition or cover the target set.
Instances For
The tuple of the fields of encCNFInstanceBatch.
Framed encoding of a CNFInstanceBatch: declaredVars in unary followed by the framed list of
CNF formulas.
View a CNFInstanceBatch as an InstanceBatch (CNF ℕ).
Sum of declared-variable model counts across all formulas in b.
Disjunctive satisfiability across the formulas in b.
Summed distinct-variable measure across the formulas in b.
The tuple of the fields of encCappedNatAcc.
Framed binary encoding of CappedNatAcc.
Initialize a capped accumulator at 0 with cap c.
Folding CappedNatAcc.add over xs preserves cap and computes min cap (acc.total + sum).
Folding CappedNatAcc.add from init c yields min c ((xs.map g).sum).
When the true sum does not exceed c, the capped fold computes (xs.map g).sum exactly.
Materialized disjoint-instance list reductions with summed measure #
A polynomial-time reduction mapping each source instance a : α to an InstanceBatch β whose
summed target measure sumMeasure μB is bounded by scale * μA a + offset.
- toBatch : α → InstanceBatch β
Batch generator.
- scale : ℕ
Multiplicative parameter factor on the summed target measure.
- offset : ℕ
Additive parameter offset on the summed target measure.
- computableInPolyTime_toBatch : Turing.MultiTapeTM.ComputableInPolyTime self.toBatch encA (encInstanceBatch encB)
Polynomial-time certificate for
toBatch.
Every SizeSensitiveReduction embeds as a singleton DisjointBatchReduction with the same
scale and offset.
Every subinstance in r.toBatch a individually satisfies μB b ≤ r.scale * μA a + r.offset.
Encoded length of the materialized batch r.toBatch a is polynomially bounded in |encA a|.
Sequential left-fold resource transfer with bounded live workspace.
Evaluating g : β → γ sequentially across (r.toBatch a).items and folding answers via a
polynomial-time combine : δ → γ → δ whose prefix accumulators stay polynomially bounded in bit
length runs in polynomial live workspace whenever g has polynomial workspace Sg, and within
accumulated time O(poly(|a|) + ((r.toBatch a).length + 1) * (poly(|a|) + listMax Tg ...)).
Exponential-time OR transfer over a summed-measure disjoint-instance batch.
If a ∈ A ↔ ∃ b ∈ (r.toBatch a).items, b ∈ B, then a decider for B within time
2 ^ (δ * μB b) * poly(|b|) transfers to a decider for A within time
2 ^ (r.scale * δ * μA a) * poly(|a|).
Subexponential-time OR transfer over a summed-measure disjoint-instance batch.
Capped summed-counting transfer with polynomial live workspace.
When countA a = ((r.toBatch a).items.map countB).sum ≤ 2 ^ capBits a with capBits computable
in polynomial time in unary, and countB has ComputableInO countB encB encNat Tg Sg with
PolyBounded length Sg and Tg b ≤ k * (2 ^ (δ * μB b) * (|b| + 1) ^ e) + k, countA is
computable in time O(2 ^ (r.scale * δ * μA a) * (|a| + 1) ^ E) AND polynomial live workspace
(ComputableInPolySpace countA encA encNat).
Depth-first stack accumulation over exponentially many disjoint subinstances #
Node-inspection input pairing the runtime context with the current top-of-stack node.
- ctx : κ
Captured runtime context.
- node : σ
Current node inspected at the top of the stack.
Instances For
Leaf-update input pairing the runtime context, current accumulator, and leaf solver answer.
- ctx : κ
Captured runtime context.
- acc : δ
Current running accumulator.
- leafVal : γ
Leaf solver output on the popped leaf subinstance.
Instances For
Framed encoding of StackNodeInput κ σ.
Depth-first stack accumulation specification.
Packages a polynomial-time stack generator and accumulator over nodes σ producing leaf
subinstances β whose solver outputs γ are folded into δ over rounds a binary-counted
iterations without materializing the exponentially long leaf list.
- defaultNode : σ
Fallback node used by
List.headDon empty stacks (never inspected on active steps). - initCtx : α → κ
Runtime context extracted from input
a. - initStack : α → List σ
Initial node stack extracted from input
a. - initAcc : α → δ
Initial accumulator extracted from input
a. - rounds : α → ℕ
Binary round budget for the depth-first traversal.
- isLeaf : StackNodeInput κ σ → Bool
Leaf test on
(ctx, topNode). - leafInstance : StackNodeInput κ σ → β
Leaf subinstance extracted at a leaf node
(ctx, topNode). - expand : StackNodeInput κ σ → List σ
Children pushed in place of a non-leaf node
(ctx, topNode). - combine : StackCombineInput κ δ γ → δ
Accumulator update at a leaf given
(ctx, acc, leafVal). - computableInPolyTime_initCtx : Turing.MultiTapeTM.ComputableInPolyTime self.initCtx encA encK
Polynomial-time certificate for
initCtx. - computableInPolyTime_initStack : Turing.MultiTapeTM.ComputableInPolyTime self.initStack encA (Turing.MultiTapeTM.encList encS)
Polynomial-time certificate for
initStack. - computableInPolyTime_initAcc : Turing.MultiTapeTM.ComputableInPolyTime self.initAcc encA encD
Polynomial-time certificate for
initAcc. - computableInPolyTime_rounds : Turing.MultiTapeTM.ComputableInPolyTime self.rounds encA Turing.MultiTapeTM.encNat
Polynomial-time certificate for
roundsin binary (encNat). - computableInPolyTime_isLeaf : Turing.MultiTapeTM.ComputableInPolyTime self.isLeaf (encStackNodeInput encK encS) Turing.MultiTapeTM.encBool
Polynomial-time certificate for
isLeaf. - computableInPolyTime_leafInstance : Turing.MultiTapeTM.ComputableInPolyTime self.leafInstance (encStackNodeInput encK encS) encB
Polynomial-time certificate for
leafInstance. - computableInPolyTime_expand : Turing.MultiTapeTM.ComputableInPolyTime self.expand (encStackNodeInput encK encS) (Turing.MultiTapeTM.encList encS)
Polynomial-time certificate for
expand. - computableInPolyTime_combine : Turing.MultiTapeTM.ComputableInPolyTime self.combine (encStackCombineInput encK encD encG) encD
Polynomial-time certificate for
combine.
Initial StackSearchState on input a.
Current (ctx, head) node pair on top of st.stack.
Whether st is at an active leaf step (st.stack is nonempty and its head is a leaf).
One step of depth-first stack accumulation with leaf solver g : β → γ.
Execute S.rounds a depth-first steps and return the final accumulator.
Single-step independent time and space bound via exists_computableInO_searchStep.
Accumulated-time and polynomial-live-workspace transfer for S.run g.
When the live encoded search state and leaf answers are polynomially bounded along S.rounds a
and g has polynomial workspace Sg, S.run g runs in polynomial live workspace
(ComputableInPolySpace (S.run g) encA encD) and within accumulated time
O(poly(|a|) + (S.rounds a + 1) * (poly(|a|) + leafMax a)), without materializing the leaf list.
Exponential-time decision transfer along a Boolean-OR StackAccumulationSpec.
When S.rounds a ≤ K₀ * 2 ^ (ν a) with ν a ≤ μA a / M + K₁ and every active leaf subinstance
satisfies μB b ≤ scale * μA a + offset, a decider for B within time
2 ^ (δ * μB b) * poly(|b|) transfers to A within time
2 ^ ((1 / M + scale * δ) * μA a) * poly(|a|).
Subexponential-time decision transfer along a family of Boolean-OR stack reductions.
Capped summed-counting transfer along StackAccumulationSpec with polynomial live
workspace.
Given a CappedNatAcc-accumulating stack specification S whose final (S.run countB a).total
equals countA a, with S.rounds a ≤ K₀ * 2 ^ (ν a), ν a ≤ μA a / M + K₁, leaf measure
μB b ≤ scale * μA a + offset, and leaf counter ComputableInO countB encB encNat Tg Sg with
PolyBounded length Sg, countA is computable in polynomial live workspace AND time
O(2 ^ ((1 / M + scale * δ) * μA a) * (|a| + 1) ^ E).
Bridge to BinaryBranching and disjoint sparsification #
When S expands inner states to the two children [T.next s false, T.next s true] of a
BinaryBranching rule T, iterating S.step g agrees at every step with T.searchStep.
Leaf-word fold theorem (BinaryBranching / sparsification bridge).
For a terminating BinaryBranching rule T on input a starting at [root] with leaf depth at
most h and 2 * L.length ≤ S.rounds a on the duplicate-free list L of leaf words, S.run g a
equals the fold over all leaf states L.map (T.walk root) while every intermediate stack has
length at most h + 1 and holds only tree nodes of depth at most h.
Exact additive root recovery for capped disjoint-branching sums.
When val : σ → ℕ is additive across the children of every inner state (val t = val (next false) + val (next true)), g computes val on leaves, and val root ≤ cap, a CappedNatAcc stack
traversal recovers val root exactly.