Trimmed Yates passes and selected entries of the subset convolution #
Selected entries of the ranked subset convolution by the trimmed fast zeta transform, following the proof of [CIMY26], Theorem 2.2 (Section 2.1), after [BHKK07] and the trimmed transform of [BHKK10] cited there.
Fix a duplicate-free list l of coordinates and a threshold s. Stage k of Yates's algorithm on
F is yatesTransform c (l.take k) F; its value at X reads stage k - 1 only at X and at X
minus one coordinate.
- Preprocessing (
preprocess) runs every stage of the zeta transforms offandg, of their pointwise product and of its Möbius transform on the low sets: the subsets oflwith at mostselements (layers l 0 s), keeping every stage (Tables). - A query
C(query) runs the same stages on the high sets ofC: its subsets with at leastselements (layers (l.filter (· ∈ C)) s #C). A value at a set with fewer thanselements is read from the preprocessed stage of the same index (stages).
The query returns the covering product coveringProduct f g C (query_preprocess), which for
ranked inputs and #C = t₁ + t₂ is the subset convolution
(query_preprocess_eq_subsetConvolution). solve answers a list of queries after one
preprocessing (solve_eq_subsetConvolution).
This module defines the pure mathematical algorithm and proves its correctness over any commutative
ring. The Word-RAM implementation and running-time bound of [CIMY26], Theorem 2.2 are
in CslibFrontier.Algorithms.WordRAM.TrimmedYates.
Main definitions #
Cslib.Algorithms.Lean.TrimmedYates.tabulate: finite association-list lookup table on a domain.Cslib.Algorithms.Lean.TrimmedYates.layers: the subsets of a list with a given range of sizes.Cslib.Algorithms.Lean.TrimmedYates.stages: Yates's passes on a domain of sets, with a fallback table for small sets.Cslib.Algorithms.Lean.TrimmedYates.Tables,preprocess,query,solve: selected entries of the covering product and ranked subset convolution.
Main results #
Cslib.Algorithms.Lean.TrimmedYates.getD_stages: correctness of the trimmed passes.Cslib.Algorithms.Lean.TrimmedYates.query_preprocess,query_preprocess_eq_subsetConvolution,solve_eq_subsetConvolution: the queries return selected entries of the covering product, and of the subset convolution for ranked inputs.
References #
- A. Björklund, T. Husfeldt, P. Kaski, M. Koivisto, Fourier meets Möbius: fast subset convolution
- A. Björklund, T. Husfeldt, P. Kaski, M. Koivisto, Trimmed Moebius inversion and graphs of bounded degree
- T. M. Chan, R. Itakura, Z. Ma, Y. Yu, 3SUM Made Simpler (Without Matrix Multiplication), k-SUM Hypothesis Refuted for Odd k, and Real 3SUM/APSP Derandomized
Tables #
The lookup table of cell on the keys dom: a finite association-list map from each key of
dom to its value, read as 0 off dom.
The table of cell reads cell X at every key X of dom.
Layers of subsets #
The subsets of the elements of L with at least lo and at most hi elements, layer by
layer, each as the set of a sublist of L.
There are ∑_{lo ≤ j ≤ hi} (L.length choose j) layered subsets.
Trimmed passes #
Yates's passes with coefficient c in the coordinates l, on the cells dom, returning
every stage: stage 0 is t, and stage k + 1 is the pass in coordinate k of l applied to
stage k. A cell reads stage k at sets with at least s elements and the k-th table of fb
at smaller sets.
Correctness of the trimmed passes. Suppose that every cell of dom has at least s
elements, that t agrees with G on dom, and that removing a coordinate of l from a cell gives
a cell or a set satisfying P with fewer than s elements. If the k-th table of fb agrees
with stage k of G on the sets satisfying P with fewer than s elements, then every returned
stage k ≤ l.length agrees with stage k of G on dom.
Selected entries of the covering product #
The tables kept by the preprocessing phase: every stage of the trimmed transforms on the sets
with at most s elements.
Stage
kof the zeta transform of the left input.Stage
kof the zeta transform of the right input.Stage
kof the Möbius transform of the pointwise product of the two zeta transforms.
The preprocessing phase: every stage of the zeta transforms of f and g, and of the
Möbius transform of their pointwise product, on the subsets of l with at most s elements.
The query phase for C: the same stages on the subsets of C with at least s elements,
reading the preprocessed stages T at smaller sets. Returns the last stage at C.
Correctness #
Correctness of a query: if C is a set of coordinates of l with at least s elements,
the query after preprocessing returns the covering product coveringProduct f g C.
Ranked queries ([CIMY26], Problem 2.1): if f is supported on sets with t₁
elements and g on sets with t₂ elements, a query at a set C of t₁ + t₂ coordinates of l
returns the subset convolution ∑_{A ⊆ C} f A * g (C \ A), for every threshold
s ≤ t₁ + t₂.
Correctness of solve: for queries at sets of t₁ + t₂ coordinates of l, the answers
are the selected entries of the subset convolution of ranked inputs.