Combinatorial subset-pair unranking and streaming folds #
For Boolean Möbius reconstruction of low-degree polynomials ([OAI26c], Lemma 3.3, eq. (3.10)
and Proposition 3.4, pp. 24–26), the outer loop visits all subset pairs (E, U) of Fin n with
#E ≤ q and U ⊆ E, weighted by (-1) ^ (#E - #U), in C_q = ∑ s ≤ min q n, 2 ^ s * n.choose s
steps without materializing exponentially many subsets.
Main definitions #
Cslib.GenericRAM.SubsetPairFold.pascalTable,Cslib.GenericRAM.SubsetPairFold.subsetPairCount: dynamic-programming Pascal table and executable countC_q.Cslib.GenericRAM.SubsetPairFold.DecodedPair,Cslib.GenericRAM.SubsetPairFold.unrankSubsetPair,Cslib.GenericRAM.SubsetPairFold.ValidSubsetPair,Cslib.GenericRAM.SubsetPairFold.unrankValidSubsetPair,Cslib.GenericRAM.SubsetPairFold.validSubsetPairEquiv:(E, U)unranker and bijection (viaCslib.BitString.supportOfList).Cslib.GenericRAM.SubsetPairFold.pascalTableCertificate,Cslib.GenericRAM.SubsetPairFold.subsetPairCountCertificate,Cslib.GenericRAM.SubsetPairFold.unrankSubsetPairCertificate,Cslib.GenericRAM.SubsetPairFold.indexBody,Cslib.GenericRAM.SubsetPairFold.runPrefix,Cslib.GenericRAM.SubsetPairFold.run,Cslib.GenericRAM.SubsetPairFold.certificate: native resource certificates and streaming fold built onCslib.GenericRAM.IndexFold.run.
Main results #
Cslib.GenericRAM.SubsetPairFold.getD_pascalTable_eq_choose,Cslib.GenericRAM.SubsetPairFold.length_encNat_mem_pascalTable_le,Cslib.GenericRAM.SubsetPairFold.subsetPairCount_eq_sum,Cslib.GenericRAM.SubsetPairFold.subsetPairCount_eq,Cslib.GenericRAM.SubsetPairFold.subsetPairCount_pos,Cslib.GenericRAM.SubsetPairFold.subsetPairCount_le_three_pow,Cslib.GenericRAM.SubsetPairFold.length_encNat_subsetPairCount_le: DP table,C_qrefinement withCslib.subsetPairCount, and binary-length bounds.Cslib.GenericRAM.SubsetPairFold.bijective_unrankValidSubsetPair,Cslib.GenericRAM.SubsetPairFold.nodup_map_unrankSubsetPair,Cslib.GenericRAM.SubsetPairFold.existsUnique_unrankSubsetPair,Cslib.GenericRAM.SubsetPairFold.pascalTable_polyTime,Cslib.GenericRAM.SubsetPairFold.subsetPairCount_polyTime,Cslib.GenericRAM.SubsetPairFold.unrankSubsetPair_polyTime: bijection andfun_proppolytime.Cslib.GenericRAM.SubsetPairFold.run_eq_foldl_map,Cslib.GenericRAM.SubsetPairFold.run_mobius_eq_sum_restricted_subsets,Cslib.GenericRAM.SubsetPairFold.computableInO,Cslib.GenericRAM.SubsetPairFold.polyBounded_space_of_polyBounded: streaming fold and space.
References #
- OpenAI, The Exponential Time Hypothesis is False, Section 3.4 (Lemma 3.3, eq. (3.10)) and Section 3.5 (eq. (3.14) and Proposition 3.4), printed pp. 24–26.
Unrank r < C(n, k) using table = pascalTable n into a length-n weight-k bit list.
Instances For
Section 1: Dynamic-programming Pascal table and exact binary clock C_q #
pascalTable n has n + 1 rows.
In-bounds lookup in pascalTable n returns i.choose s.
Defaulted lookup in row i ≤ n of pascalTable n equals i.choose s for every s : ℕ.
Every binomial coefficient i.choose s for i ≤ n has binary length at most n + 1.
Every entry stored in pascalTable n has binary encoding length at most n + 1.
Executable subset-pair count C_q = ∑ s ≤ min q n, 2 ^ s * n.choose s ([OAI26c]).
Instances For
subsetPairCount n q equals ∑ s ∈ Finset.range (min q n + 1), 2 ^ s * n.choose s.
Refinement equality equating the DP subsetPairCount to Cslib.subsetPairCount.
subsetPairCount n q is strictly positive for all n, q (since (∅, ∅) is always valid).
When n ≤ q, subsetPairCount n q = 3 ^ n ([OAI26c], eq. (3.14)).
subsetPairCount n q ≤ 3 ^ n for all n, q : ℕ.
The binary index bound subsetPairCount n q occupies at most 2 * n + 1 bits in encNat.
Section 2: Polynomial-time combinatorial (E, U) unranker and bijection #
Decoded (indE, indU, negSign) triple: length-n indicators and Odd (#E - #U) flag.
Instances For
Combinatorial (E, U) unranker: decodes j < subsetPairCount n q into (indE, indU, negSign)
without materializing subsets, with deterministic empty-pair fallback for j ≥ C_q.
Instances For
Out-of-range indices j ≥ subsetPairCount n q return the empty-pair fallback.
The first indicator indE returned by unrankSubsetPair n q j has exact length n.
The second indicator indU returned by unrankSubsetPair n q j has exact length n.
Pointwise containment: every true position of indU is also true in indE.
Weight bound: indE has at most min q n (hence at most q) true entries.
The third component negSign is decide (Odd (indE.count true - indU.count true)).
Every decoded unrankSubsetPair n q j has #E ≤ q.
Every decoded unrankSubsetPair n q j satisfies U ⊆ E.
Map a valid index j : Fin (subsetPairCount n q) to its ValidSubsetPair n q.
Instances For
unrankValidSubsetPair n q is injective on Fin (subsetPairCount n q).
Summing 2 ^ #E over all E ⊆ Fin n with #E ≤ q yields subsetPairCount n q.
The finite type ValidSubsetPair n q has exact cardinality subsetPairCount n q.
unrankValidSubsetPair n q is a bijection onto ValidSubsetPair n q.
Equivalence between binary indices Fin (subsetPairCount n q) and ValidSubsetPair n q.
Instances For
Mapping unrankSubsetPair n q over List.range (subsetPairCount n q) has no duplicates.
Exact completeness: every valid pair (E, U) with #E ≤ q and U ⊆ E is decoded at a
unique index j < subsetPairCount n q.
Section 3: Plain ComputableInPolyTime and NativeCertificate witnesses #
Encoding for decoded (indE, indU, negSign) triples.
Instances For
pascalTable is computable in polynomial time from n in unary.
subsetPairCount is computable in polynomial time from (n, q) in unary.
unrankSubsetPair is computable in polynomial time from (n, q) in unary and j in binary.
Native certificate for pascalTable, selected via NativeCertificate.ofPolyTime.
Instances For
pascalTableCertificate has polynomial time and workspace bounds.
Native certificate for subsetPairCount, selected via NativeCertificate.ofPolyTime.
Instances For
subsetPairCountCertificate has polynomial time and workspace bounds.
Native certificate for unrankSubsetPair, selected via NativeCertificate.ofPolyTime.
Instances For
unrankSubsetPairCertificate has polynomial time and workspace bounds.
Section 4: Streaming IndexFold combinator (SubsetPairFold.run & computableInO) #
Stream all subsetPairCount n q valid (E, U) subset pairs through IndexFold.run.
Instances For
Every prefix accumulator equals the ordered range fold over decoded indices 0, …, m - 1.
SubsetPairFold.run agrees with folding over List.range (subsetPairCount n q).
SubsetPairFold.run agrees with folding over the mapped list of decoded pairs.
Commutative-monoid accumulation via run sums over all E ⊆ Fin n (#E ≤ q) and U ⊆ E.
Signed Möbius accumulation via run computes ∑_{#E ≤ q} ∑_{U ⊆ E} (-1) ^ (#E - #U) * g E U
over any commutative ring R ([OAI26c], Lemma 3.3 eq. (3.10), Proposition 3.4).
Native certificate for one indexBody round, retaining (n, q) in unary.
Instances For
Native certificate for SubsetPairFold.run, built on IndexFold.certificate.
Instances For
Polynomial overhead in n + q for subsetPairCount, unranking, and index maintenance.
Instances For
decodeOverhead is polynomially bounded in n + q.
Streaming resource bound for SubsetPairFold.run via IndexFold.computableInO: time scales
with subsetPairCount (dim a) (deg a) + 1 while live workspace is independent of C_q.
When dim, deg, and initial have polynomial certificates and B and Q are polynomially
bounded in the input length, the live workspace of SubsetPairFold.computableInO is polynomial.