Capping representation groups controls both the paired moment and weighted query load
ProvedThreeSumFuture.pooled_partition_moment3sumalgorithmscombinatorics
For every finite family of representation lists with sizes R(q) and query weights W(q), and every positive cap C, there are maps into at most floor(R(q)/C)+1 group labels for each query, with no group larger than C. For every positive integer k, the sum of the kth powers of all group sizes is at most C^(k-1) times the total representation count. The weighted number of group queries is at most the original weight sum plus the representation-weighted sum divided by C.
Preamble
module public import Mathlib.Data.Fintype.BigOperators public import Mathlib.Data.Fintype.Card public import Mathlib.Algebra.Order.BigOperators.Group.Finset public import Mathlib.Algebra.Order.BigOperators.Ring.Finset public section open scoped BigOperators
Formal statement
theorem ThreeSumFuture.pooled_partition_moment {Q : Type} [Fintype Q] (size weight : Q → ℕ) (cap k : ℕ)
(hcap : 0 < cap) (hk : 0 < k) :
∃ label : ∀ q : Q, Fin (size q) → Fin (size q / cap + 1),
(∀ q j, (Finset.univ.filter (fun i => label q i = j)).card ≤ cap) ∧
(∑ q, ∑ j, (Finset.univ.filter (fun i => label q i = j)).card ^ k) ≤
cap ^ (k - 1) * ∑ q, size q ∧
cap * (∑ q, (size q / cap + 1) * weight q) ≤
cap * (∑ q, weight q) + ∑ q, size q * weight q := by sorrySource
Original finite grouping result for the proposed replacement of the worst-fiber paired-minor cleanup in weighted-cache 3SUM.