HepLean Documentation

Mathlib.Algebra.Order.BigOperators.Expect

Order properties of the average over a finset #

theorem Finset.expect_eq_zero_iff_of_nonneg {ι : Type u_1} {α : Type u_2} [OrderedAddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f : ια} (hs : s.Nonempty) (hf : is, 0 f i) :
(s.expect fun (i : ι) => f i) = 0 is, f i = 0
theorem Finset.expect_eq_zero_iff_of_nonpos {ι : Type u_1} {α : Type u_2} [OrderedAddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f : ια} (hs : s.Nonempty) (hf : is, f i 0) :
(s.expect fun (i : ι) => f i) = 0 is, f i = 0
theorem Finset.expect_le_expect {ι : Type u_1} {α : Type u_2} [OrderedAddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f g : ια} [PosSMulMono ℚ≥0 α] (hfg : is, f i g i) :
(s.expect fun (i : ι) => f i) s.expect fun (i : ι) => g i
theorem GCongr.expect_le_expect {ι : Type u_1} {α : Type u_2} [OrderedAddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f g : ια} [PosSMulMono ℚ≥0 α] (h : is, f i g i) :
s.expect f s.expect g

This is a (beta-reduced) version of the standard lemma Finset.expect_le_expect, convenient for the gcongr tactic.

theorem Finset.expect_le {ι : Type u_1} {α : Type u_2} [OrderedAddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f : ια} [PosSMulMono ℚ≥0 α] {a : α} (hs : s.Nonempty) (h : xs, f x a) :
(s.expect fun (i : ι) => f i) a
theorem Finset.le_expect {ι : Type u_1} {α : Type u_2} [OrderedAddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f : ια} [PosSMulMono ℚ≥0 α] {a : α} (hs : s.Nonempty) (h : xs, a f x) :
a s.expect fun (i : ι) => f i
theorem Finset.expect_nonneg {ι : Type u_1} {α : Type u_2} [OrderedAddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f : ια} [PosSMulMono ℚ≥0 α] (hf : is, 0 f i) :
0 s.expect fun (i : ι) => f i
theorem Finset.le_expect_nonempty_of_subadditive_on_pred {ι : Type u_1} {M : Type u_4} {N : Type u_5} [AddCommMonoid M] [Module ℚ≥0 M] [OrderedAddCommMonoid N] [Module ℚ≥0 N] [PosSMulMono ℚ≥0 N] {m : MN} {p : MProp} {f : ιM} {s : Finset ι} (h_add : ∀ (a b : M), p ap bm (a + b) m a + m b) (hp_add : ∀ (a b : M), p ap bp (a + b)) (h_div : ∀ (n : ) (a : M), p am ((↑n)⁻¹ a) = (↑n)⁻¹ m a) (hs_nonempty : s.Nonempty) (hs : is, p (f i)) :
m (s.expect fun (i : ι) => f i) s.expect fun (i : ι) => m (f i)

Let {a | p a} be an additive subsemigroup of an additive commutative monoid M. If m is a subadditive function (m (a + b) ≤ m a + m b) preserved under division by a natural, f is a function valued in that subsemigroup and s is a nonempty set, then m (𝔼 i ∈ s, f i) ≤ 𝔼 i ∈ s, m (f i).

theorem Finset.le_expect_nonempty_of_subadditive {ι : Type u_1} {M : Type u_4} {N : Type u_5} [AddCommMonoid M] [Module ℚ≥0 M] [OrderedAddCommMonoid N] [Module ℚ≥0 N] [PosSMulMono ℚ≥0 N] {f : ιM} {s : Finset ι} (m : MN) (h_mul : ∀ (a b : M), m (a + b) m a + m b) (h_div : ∀ (n : ) (a : M), m ((↑n)⁻¹ a) = (↑n)⁻¹ m a) (hs : s.Nonempty) :
m (s.expect fun (i : ι) => f i) s.expect fun (i : ι) => m (f i)

If m : M → N is a subadditive function (m (a + b) ≤ m a + m b) and s is a nonempty set, then m (𝔼 i ∈ s, f i) ≤ 𝔼 i ∈ s, m (f i).

theorem Finset.le_expect_of_subadditive_on_pred {ι : Type u_1} {M : Type u_4} {N : Type u_5} [AddCommMonoid M] [Module ℚ≥0 M] [OrderedAddCommMonoid N] [Module ℚ≥0 N] [PosSMulMono ℚ≥0 N] {m : MN} {p : MProp} {f : ιM} {s : Finset ι} (h_zero : m 0 = 0) (h_add : ∀ (a b : M), p ap bm (a + b) m a + m b) (hp_add : ∀ (a b : M), p ap bp (a + b)) (h_div : ∀ (n : ) (a : M), p am ((↑n)⁻¹ a) = (↑n)⁻¹ m a) (hs : is, p (f i)) :
m (s.expect fun (i : ι) => f i) s.expect fun (i : ι) => m (f i)

Let {a | p a} be a subsemigroup of a commutative monoid M. If m is a subadditive function (m (x + y) ≤ m x + m y, m 0 = 0) preserved under division by a natural and f is a function valued in that subsemigroup, then m (𝔼 i ∈ s, f i) ≤ 𝔼 i ∈ s, m (f i).

theorem Finset.le_expect_of_subadditive {ι : Type u_1} {M : Type u_4} {N : Type u_5} [AddCommMonoid M] [Module ℚ≥0 M] [OrderedAddCommMonoid N] [Module ℚ≥0 N] [PosSMulMono ℚ≥0 N] {m : MN} {f : ιM} {s : Finset ι} (h_zero : m 0 = 0) (h_add : ∀ (a b : M), m (a + b) m a + m b) (h_div : ∀ (n : ) (a : M), m ((↑n)⁻¹ a) = (↑n)⁻¹ m a) :
m (s.expect fun (i : ι) => f i) s.expect fun (i : ι) => m (f i)

If m is a subadditive function (m (x + y) ≤ m x + m y, m 0 = 0) preserved under division by a natural, then m (𝔼 i ∈ s, f i) ≤ 𝔼 i ∈ s, m (f i).

theorem Finset.expect_pos {ι : Type u_1} {α : Type u_2} [OrderedCancelAddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f : ια} [PosSMulStrictMono ℚ≥0 α] (hf : is, 0 < f i) (hs : s.Nonempty) :
0 < s.expect fun (i : ι) => f i
theorem Finset.exists_lt_of_lt_expect {ι : Type u_1} {α : Type u_2} [LinearOrderedAddCommMonoid α] [Module ℚ≥0 α] [PosSMulMono ℚ≥0 α] {s : Finset ι} {f : ια} {a : α} (hs : s.Nonempty) (h : a < s.expect fun (i : ι) => f i) :
xs, a < f x
theorem Finset.exists_lt_of_expect_lt {ι : Type u_1} {α : Type u_2} [LinearOrderedAddCommMonoid α] [Module ℚ≥0 α] [PosSMulMono ℚ≥0 α] {s : Finset ι} {f : ια} {a : α} (hs : s.Nonempty) (h : (s.expect fun (i : ι) => f i) < a) :
xs, f x < a
theorem Finset.abs_expect_le {ι : Type u_1} {α : Type u_2} [LinearOrderedAddCommGroup α] [Module ℚ≥0 α] [PosSMulMono ℚ≥0 α] (s : Finset ι) (f : ια) :
|s.expect fun (i : ι) => f i| s.expect fun (i : ι) => |f i|
theorem Finset.expect_mul_sq_le_sq_mul_sq {ι : Type u_1} {R : Type u_3} [LinearOrderedCommSemiring R] [ExistsAddOfLE R] [Module ℚ≥0 R] [PosSMulMono ℚ≥0 R] (s : Finset ι) (f g : ιR) :
(s.expect fun (i : ι) => f i * g i) ^ 2 (s.expect fun (i : ι) => f i ^ 2) * s.expect fun (i : ι) => g i ^ 2

Cauchy-Schwarz inequality in terms of Finset.expect.

theorem Fintype.expect_eq_zero_iff_of_nonneg {ι : Type u_1} {α : Type u_2} [Fintype ι] [OrderedAddCommMonoid α] [Module ℚ≥0 α] {f : ια} [Nonempty ι] (hf : 0 f) :
(Finset.univ.expect fun (i : ι) => f i) = 0 f = 0
theorem Fintype.expect_eq_zero_iff_of_nonpos {ι : Type u_1} {α : Type u_2} [Fintype ι] [OrderedAddCommMonoid α] [Module ℚ≥0 α] {f : ια} [Nonempty ι] (hf : f 0) :
(Finset.univ.expect fun (i : ι) => f i) = 0 f = 0