The areas / V06. Rings, fields and ordered algebra
Mathlib.Algebra.Order.Chebyshev
17 declarations. Mathlib docs · Source
Chebyshev's sum inequality and Abel's inequality
This file proves the Chebyshev sum inequality, as well as Abel's inequality.
Chebyshev's inequality states (∑ i ∈ s, f i) * (∑ i ∈ s, g i) ≤ #s * ∑ i ∈ s, f i * g i
when f g : ι → α monovary, and the reverse inequality when f and g antivary.
Abel's inequality controls a weighted sum of a sequence f multiplied by an antitone nonnegative
sequence g in terms of the partial sums of f.
Main declarations
MonovaryOn.sum_mul_sum_le_card_mul_sum: Chebyshev's inequality.AntivaryOn.card_mul_sum_le_sum_mul_sum: Chebyshev's inequality, dual version.sq_sum_le_card_mul_sum_sq: Special case of Chebyshev's inequality whenf = g.Finset.sum_mul_le_sum_mul_of_sum_range_le,Finset.sum_mul_le_mul_of_sum_range_le,Finset.mul_le_sum_mul_of_le_sum_range,Finset.abs_sum_mul_le_mul_of_abs_sum_range_le: Abel's inequality and its one-sided and absolute-value forms.
Implementation notes
In fact, we don't need much compatibility between the addition and multiplication of α, so we can
actually decouple them by replacing multiplication with scalar multiplication and making f and g
land in different types.
As a bonus, this makes the dual statement trivial. The multiplication versions are provided for
convenience.
The case for Monotone/Antitone pairs of functions over a LinearOrder is not deduced in this
file because it is easily deducible from the Monovary API.
Scalar multiplication versions
Multiplication versions
Special cases of the above when scalar multiplication is actually multiplication.
theorem MonovaryOn.sum_smul_sum_le_card_smul_sum E1 #
∀ {ι : Type u_1} {α : Type u_2} {β : Type u_3} [inst : Semiring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α]
[ExistsAddOfLE α] [inst_4 : AddCommMonoid β] [inst_5 : LinearOrder β] [IsOrderedCancelAddMonoid β]
[inst_7 : Module α β] [PosSMulMono α β] {s : Finset ι} {f : ι → α} {g : ι → β},
MonovaryOn f g ↑s → (∑ i ∈ s, f i) • ∑ i ∈ s, g i ≤ s.card • ∑ i ∈ s, f i • g i
Chebyshev's Sum Inequality: When f and g monovary together (e.g. they are both
monotone/antitone), the scalar product of their sum is less than the size of the set times their
scalar product.
theorem AntivaryOn.card_smul_sum_le_sum_smul_sum E1 #
∀ {ι : Type u_1} {α : Type u_2} {β : Type u_3} [inst : Semiring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α]
[ExistsAddOfLE α] [inst_4 : AddCommMonoid β] [inst_5 : LinearOrder β] [IsOrderedCancelAddMonoid β]
[inst_7 : Module α β] [PosSMulMono α β] {s : Finset ι} {f : ι → α} {g : ι → β},
AntivaryOn f g ↑s → s.card • ∑ i ∈ s, f i • g i ≤ (∑ i ∈ s, f i) • ∑ i ∈ s, g i
Chebyshev's Sum Inequality: When f and g antivary together (e.g. one is monotone, the
other is antitone), the scalar product of their sum is less than the size of the set times their
scalar product.
theorem Monovary.sum_smul_sum_le_card_smul_sum E1 #
∀ {ι : Type u_1} {α : Type u_2} {β : Type u_3} [inst : Semiring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α]
[ExistsAddOfLE α] [inst_4 : AddCommMonoid β] [inst_5 : LinearOrder β] [IsOrderedCancelAddMonoid β]
[inst_7 : Module α β] [PosSMulMono α β] {f : ι → α} {g : ι → β} [inst_9 : Fintype ι],
Monovary f g → (∑ i, f i) • ∑ i, g i ≤ Fintype.card ι • ∑ i, f i • g i
Chebyshev's Sum Inequality: When f and g monovary together (e.g. they are both
monotone/antitone), the scalar product of their sum is less than the size of the set times their
scalar product.
theorem Antivary.card_smul_sum_le_sum_smul_sum E1 #
∀ {ι : Type u_1} {α : Type u_2} {β : Type u_3} [inst : Semiring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α]
[ExistsAddOfLE α] [inst_4 : AddCommMonoid β] [inst_5 : LinearOrder β] [IsOrderedCancelAddMonoid β]
[inst_7 : Module α β] [PosSMulMono α β] {f : ι → α} {g : ι → β} [inst_9 : Fintype ι],
Antivary f g → Fintype.card ι • ∑ i, f i • g i ≤ (∑ i, f i) • ∑ i, g i
Chebyshev's Sum Inequality: When f and g antivary together (e.g. one is monotone, the
other is antitone), the scalar product of their sum is less than the size of the set times their
scalar product.
theorem MonovaryOn.sum_mul_sum_le_card_mul_sum E3 #
∀ {ι : Type u_1} {α : Type u_2} [inst : Semiring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α] [ExistsAddOfLE α]
{s : Finset ι} {f g : ι → α}, MonovaryOn f g ↑s → (∑ i ∈ s, f i) * ∑ i ∈ s, g i ≤ ↑s.card * ∑ i ∈ s, f i * g i
Chebyshev's Sum Inequality: When f and g monovary together (e.g. they are both
monotone/antitone), the product of their sum is less than the size of the set times their scalar
product.
theorem AntivaryOn.card_mul_sum_le_sum_mul_sum E3 #
∀ {ι : Type u_1} {α : Type u_2} [inst : Semiring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α] [ExistsAddOfLE α]
{s : Finset ι} {f g : ι → α}, AntivaryOn f g ↑s → ↑s.card * ∑ i ∈ s, f i * g i ≤ (∑ i ∈ s, f i) * ∑ i ∈ s, g i
Chebyshev's Sum Inequality: When f and g antivary together (e.g. one is monotone, the
other is antitone), the product of their sum is greater than the size of the set times their scalar
product.
theorem pow_sum_le_card_mul_sum_pow E2 #
∀ {ι : Type u_1} {α : Type u_2} [inst : Semiring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α] [ExistsAddOfLE α]
{s : Finset ι} {f : ι → α},
(∀ i ∈ s, 0 ≤ f i) → ∀ (n : ℕ), (∑ i ∈ s, f i) ^ (n + 1) ≤ ↑s.card ^ n * ∑ i ∈ s, f i ^ (n + 1)
Special case of Jensen's inequality for sums of powers.
theorem sq_sum_le_card_mul_sum_sq E3 #
∀ {ι : Type u_1} {α : Type u_2} [inst : Semiring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α] [ExistsAddOfLE α]
{s : Finset ι} {f : ι → α}, (∑ i ∈ s, f i) ^ 2 ≤ ↑s.card * ∑ i ∈ s, f i ^ 2
Special case of Chebyshev's Sum Inequality or the Cauchy-Schwarz Inequality: The square of the sum is less than the size of the set times the sum of the squares.
theorem Multiset.sq_sum_le_card_mul_sum_sq E3 #
∀ {α : Type u_2} [inst : Semiring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α] [ExistsAddOfLE α]
(m : Multiset α), m.sum ^ 2 ≤ ↑m.card * (Multiset.map (fun x ↦ x ^ 2) m).sum
Special case of Chebyshev's Sum Inequality or the Cauchy-Schwarz Inequality for a multiset: the square of the sum is at most the cardinality times the sum of the squares.
theorem Monovary.sum_mul_sum_le_card_mul_sum E1 #
∀ {ι : Type u_1} {α : Type u_2} [inst : Semiring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α] [ExistsAddOfLE α]
{f g : ι → α} [inst_4 : Fintype ι], Monovary f g → (∑ i, f i) * ∑ i, g i ≤ ↑(Fintype.card ι) * ∑ i, f i * g i
Chebyshev's Sum Inequality: When f and g monovary together (e.g. they are both
monotone/antitone), the product of their sum is less than the size of the set times their scalar
product.
theorem Antivary.card_mul_sum_le_sum_mul_sum E1 #
∀ {ι : Type u_1} {α : Type u_2} [inst : Semiring α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α] [ExistsAddOfLE α]
{f g : ι → α} [inst_4 : Fintype ι], Antivary f g → ↑(Fintype.card ι) * ∑ i, f i * g i ≤ (∑ i, f i) * ∑ i, g i
Chebyshev's Sum Inequality: When f and g antivary together (e.g. one is monotone, the
other is antitone), the product of their sum is less than the size of the set times their scalar
product.
theorem pow_sum_div_card_le_sum_pow E2 #
∀ {ι : Type u_1} {α : Type u_2} [inst : Semifield α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α] [ExistsAddOfLE α]
{s : Finset ι} {f : ι → α},
(∀ i ∈ s, 0 ≤ f i) → ∀ (n : ℕ), (∑ i ∈ s, f i) ^ (n + 1) / ↑s.card ^ n ≤ ∑ i ∈ s, f i ^ (n + 1)
Special case of Jensen's inequality for sums of powers.
theorem sum_div_card_sq_le_sum_sq_div_card E1 #
∀ {ι : Type u_1} {α : Type u_2} [inst : Semifield α] [inst_1 : LinearOrder α] [IsStrictOrderedRing α] [ExistsAddOfLE α]
{s : Finset ι} {f : ι → α}, ((∑ i ∈ s, f i) / ↑s.card) ^ 2 ≤ (∑ i ∈ s, f i ^ 2) / ↑s.card
theorem Finset.sum_mul_le_sum_mul_of_sum_range_le E3 #
∀ {R : Type u_4} {f c g : ℕ → R} {n : ℕ} [inst : Ring R] [inst_1 : PartialOrder R] [IsOrderedRing R],
(∀ k ≤ n, ∑ i ∈ Finset.range k, f i ≤ ∑ i ∈ Finset.range k, c i) →
0 ≤ g → AntitoneOn g (Set.Iio n) → ∑ i ∈ Finset.range n, f i * g i ≤ ∑ i ∈ Finset.range n, c i * g i
Abel's inequality (comparison form): if the partial sums of f are dominated by those of
c up to n, and g is nonnegative and antitone, then the g-weighted sum of f is dominated by
that of c.
theorem Finset.sum_mul_le_mul_of_sum_range_le E3 #
∀ {R : Type u_4} {f g : ℕ → R} {M : R} {n : ℕ} [inst : Ring R] [inst_1 : PartialOrder R] [IsOrderedRing R],
(∀ k ≤ n, ∑ i ∈ Finset.range k, f i ≤ M) →
0 ≤ g → AntitoneOn g (Set.Iio n) → ∑ i ∈ Finset.range n, f i * g i ≤ M * g 0
Abel's inequality (one-sided upper form): if every partial sum of f up to n is at most
M, and g is nonnegative and antitone, then ∑ i ∈ range n, f i * g i ≤ M * g 0.
theorem Finset.mul_le_sum_mul_of_le_sum_range E3 #
∀ {R : Type u_4} {f g : ℕ → R} {m : R} {n : ℕ} [inst : Ring R] [inst_1 : PartialOrder R] [IsOrderedRing R],
(∀ k ≤ n, m ≤ ∑ i ∈ Finset.range k, f i) →
0 ≤ g → AntitoneOn g (Set.Iio n) → m * g 0 ≤ ∑ i ∈ Finset.range n, f i * g i
Abel's inequality (one-sided lower form): if every partial sum of f up to n is at least
m, and g is nonnegative and antitone, then m * g 0 ≤ ∑ i ∈ range n, f i * g i.
theorem Finset.abs_sum_mul_le_mul_of_abs_sum_range_le E3 #
∀ {R : Type u_4} {f g : ℕ → R} {M : R} {n : ℕ} [inst : Ring R] [inst_1 : LinearOrder R] [IsOrderedRing R],
(∀ k ≤ n, |∑ i ∈ Finset.range k, f i| ≤ M) →
0 ≤ g → AntitoneOn g (Set.Iio n) → |∑ i ∈ Finset.range n, f i * g i| ≤ M * g 0
Abel's inequality: if every partial sum of f up to n has absolute value at most M, and
g is nonnegative and antitone, then |∑ i ∈ range n, f i * g i| ≤ M * g 0.