Documentation

CslibFrontier.Foundations.Algebra.FiniteMagnitude

Magnitudes of finite sums and products #

Main results #

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.abs_sum_le_card_mul {ι : Type u_1} {R : Type u_2} [Ring R] [LinearOrder R] [IsOrderedRing R] (s : Finset ι) {f : ι → R} {A : R} (h : ∀ i ∈ s, |f i| ≤ A) :
|∑ i ∈ s, f i| ≤ ↑s.card * A

If |f i| ≤ A for all i ∈ s, then |∑ i ∈ s, f i| ≤ s.card * A.

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) :
∑ i ∈ s, A i * D i ≤ ↑K * CA * CD

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) :
|∑ i ∈ s, c i * a i| ≤ ↑s.card * 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) :
|∏ i ∈ s, f i| ≤ 1

If |f i| ≤ 1 for all i ∈ s, then |∏ i ∈ s, f i| ≤ 1.

theorem List.abs_sum_map_le {α : Type u_1} {f : α → ℤ} (hf : ∀ (a : α), |f a| ≤ 1) (s : List α) :
|(map f s).sum| ≤ ↑s.length

A sum of at most unit integers is bounded by the number of terms.