Magnitudes of finite sums and products #
Main results #
Finset.abs_sum_mul_le: bounded signed linear combinations.Finset.sum_mul_le_of_card_support_le: sums of bounded products with few nonzero factors.Finset.abs_prod_le_one: products of coefficients bounded by one.List.abs_sum_map_le: a sum of at most unit integers is bounded by the list length.
References #
Adapted selectively from
Anthropic's pinned formal source.
Source pin: 16a5ce41304fcdaea4e0be7c132e1c361dc26da5.
List.abs_sum_map_le is moved from Samuel Schlesinger's AMS sketch
(CslibFrontier.Computability.Streaming.AMS).
theorem Finset.sum_mul_le_of_card_support_le {ι : Type u_1} {R : Type u_2} [Semiring R] [PartialOrder R] [IsOrderedRing R] [DecidableEq R] (s : Finset ι) {A D : ι → R} {CA CD : R} {K : ℕ} (hCA : 0 ≤ CA) (hCD : 0 ≤ CD) (hA : ∀ i ∈ s, A i ≤ CA) (hD0 : ∀ i ∈ s, 0 ≤ D i) (hD : ∀ i ∈ s, D i ≤ CD) (hK : {i ∈ s | A i ≠ 0}.card ≤ K) :
A sum of products A i * D i over s in which at most K of the factors A i are nonzero,
each at most CA, and every D i lies in [0, CD], is at most K * CA * CD.
theorem Finset.abs_sum_mul_le {ι : Type u_1} {R : Type u_2} [Ring R] [LinearOrder R] [IsOrderedRing R] (s : Finset ι) {c a : ι → R} {A : R} (hc : ∀ i ∈ s, |c i| ≤ 1) (ha : ∀ i ∈ s, |a i| ≤ A) :
If |c i| ≤ 1 and |a i| ≤ A for all i ∈ s, then |∑ i ∈ s, c i * a i| ≤ s.card * A.
theorem Finset.abs_prod_le_one {ι : Type u_1} {R : Type u_2} [CommRing R] [LinearOrder R] [IsStrictOrderedRing R] (s : Finset ι) {f : ι → R} (h : ∀ i ∈ s, |f i| ≤ 1) :
If |f i| ≤ 1 for all i ∈ s, then |∏ i ∈ s, f i| ≤ 1.