Sums with weights in the unit interval #
A sum ∑ i ∈ s, f i * c i with weights 0 ≤ f i ≤ 1 lies between the sum of the negative terms
of c and the sum of its positive terms. Both are sums of c over subsets of s, so any bound
on the absolute values of all subset sums of c also bounds every such weighted sum. Applying
this once in each variable gives the corresponding statement for a matrix w tested against
two weight vectors.
In regularity arguments this upgrades a discrepancy bound on rectangles s' × t' to one for
tests f i * g j with values in [0, 1], as needed for counting lemmas. Summing such a bound
over a further index then uses the crude estimate |∑ i ∈ s, f i| ≤ #s • B for terms bounded
by B in absolute value.
Main results #
Finset.abs_sum_mul_le_of_forall_subset: weighted sums are controlled by subset sums.Finset.abs_sum_sum_mul_mul_le_of_forall_subset: the two-variable version.Finset.abs_sum_le_card_nsmul: a sum of#sterms bounded byBin absolute value is bounded by#s • B.
If every subset sum of c over s has absolute value at most M, then so has every sum
∑ i ∈ s, f i * c i with weights 0 ≤ f i ≤ 1.
If every rectangle sum ∑ i ∈ s', ∑ j ∈ t', w i j with s' ⊆ s and t' ⊆ t has absolute
value at most M, then so has every sum ∑ i ∈ s, ∑ j ∈ t, f i * g j * w i j with weights in
[0, 1].
A sum of terms with absolute value at most B has absolute value at most #s • B.