Documentation

LeanAPAP.Prereqs.Expect.Basic

Average over a finset #

This file defines Finset.expect, the average (aka expectation) of a function over a finset.

Notation #

def Finset.expect {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] (s : Finset ι) (f : ια) :
α

Average of a function over a finset. If the finset is empty, this is equal to zero.

Equations
Instances For
    • 𝔼 i ∈ s, f i is notation for Finset.expect s f. It is the expectation of f i where i ranges over the finite set s (either a Finset or a Set with a Fintype instance).
    • 𝔼 x, f x is notation for Finset.expect Finset.univ f. It is the expectation of f i where i ranges over the finite domain of f.
    • 𝔼 i ∈ s with p i, f i is notation for Finset.expect (Finset.filter p s) f.
    • 𝔼 (i ∈ s) (j ∈ t), f i j is notation for Finset.expect (s ×ˢ t) (fun ⟨i, j⟩ ↦ f i j).

    These support destructuring, for example 𝔼 ⟨i, j⟩ ∈ s ×ˢ t, f i j.

    Notation: "𝔼" bigOpBinders* ("with" term)? "," term

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      Delaborator for Finset.expect. The pp.piBinderTypes option controls whether to show the domain type when the expect is over Finset.univ.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem Finset.expect_univ {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {f : ια} [Fintype ι] :
        (Finset.expect Finset.univ fun (x : ι) => f x) = ((Fintype.card ι))⁻¹ Finset.sum Finset.univ fun (x : ι) => f x
        @[simp]
        theorem Finset.expect_empty {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] (f : ια) :
        @[simp]
        theorem Finset.expect_singleton {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] (f : ια) (i : ι) :
        Finset.expect {i} f = f i
        @[simp]
        theorem Finset.expect_const_zero {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] (s : Finset ι) :
        (Finset.expect s fun (_i : ι) => 0) = 0
        theorem Finset.expect_congr {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f : ια} {g : ια} {t : Finset ι} (hst : s = t) (h : xt, f x = g x) :
        (Finset.expect s fun (i : ι) => f i) = Finset.expect t fun (i : ι) => g i
        theorem Finset.expectWith_congr {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f : ια} {g : ια} (p : ιProp) [DecidablePred p] (h : xs, p xf x = g x) :
        (Finset.expect (Finset.filter (fun (i : ι) => p i) s) fun (i : ι) => f i) = Finset.expect (Finset.filter (fun (i : ι) => p i) s) fun (i : ι) => g i
        theorem Finset.expect_sum_comm {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] (s : Finset ι) (t : Finset κ) (f : ικα) :
        (Finset.expect s fun (i : ι) => Finset.sum t fun (j : κ) => f i j) = Finset.sum t fun (j : κ) => Finset.expect s fun (i : ι) => f i j
        theorem Finset.expect_comm {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] (s : Finset ι) (t : Finset κ) (f : ικα) :
        (Finset.expect s fun (i : ι) => Finset.expect t fun (j : κ) => f i j) = Finset.expect t fun (j : κ) => Finset.expect s fun (i : ι) => f i j
        theorem Finset.expect_eq_zero {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f : ια} (h : is, f i = 0) :
        (Finset.expect s fun (i : ι) => f i) = 0
        theorem Finset.exists_ne_zero_of_expect_ne_zero {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f : ια} (h : (Finset.expect s fun (i : ι) => f i) 0) :
        ∃ i ∈ s, f i 0
        theorem Finset.expect_add_distrib {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] (s : Finset ι) (f : ια) (g : ια) :
        (Finset.expect s fun (i : ι) => f i + g i) = (Finset.expect s fun (i : ι) => f i) + Finset.expect s fun (i : ι) => g i
        theorem Finset.expect_add_expect_comm {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} (f₁ : ια) (f₂ : ια) (g₁ : ια) (g₂ : ια) :
        ((Finset.expect s fun (i : ι) => f₁ i + f₂ i) + Finset.expect s fun (i : ι) => g₁ i + g₂ i) = (Finset.expect s fun (i : ι) => f₁ i + g₁ i) + Finset.expect s fun (i : ι) => f₂ i + g₂ i
        theorem Finset.expect_eq_single_of_mem {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f : ια} (i : ι) (hi : i s) (h : js, j if j = 0) :
        (Finset.expect s fun (i : ι) => f i) = (s.card)⁻¹ f i
        theorem Finset.expect_ite_zero {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] (s : Finset ι) (p : ιProp) [DecidablePred p] (h : is, js, p ip ji = j) (a : α) :
        (Finset.expect s fun (i : ι) => if p i then a else 0) = if ∃ i ∈ s, p i then (s.card)⁻¹ a else 0

        See also Finset.expect_boole.

        @[simp]
        theorem Finset.expect_dite_eq {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} [DecidableEq ι] (i : ι) (f : (j : ι) → i = jα) :
        (Finset.expect s fun (j : ι) => if h : i = j then f j h else 0) = if i s then (s.card)⁻¹ f i else 0
        @[simp]
        theorem Finset.expect_dite_eq' {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} [DecidableEq ι] (i : ι) (f : (j : ι) → j = iα) :
        (Finset.expect s fun (j : ι) => if h : j = i then f j h else 0) = if i s then (s.card)⁻¹ f i else 0
        @[simp]
        theorem Finset.expect_ite_eq {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} [DecidableEq ι] (i : ι) (f : ια) :
        (Finset.expect s fun (j : ι) => if i = j then f j else 0) = if i s then (s.card)⁻¹ f i else 0
        @[simp]
        theorem Finset.expect_ite_eq' {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} [DecidableEq ι] (i : ι) (f : ια) :
        (Finset.expect s fun (j : ι) => if j = i then f j else 0) = if i s then (s.card)⁻¹ f i else 0
        theorem Finset.expect_bij {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f : ια} {t : Finset κ} {g : κα} (i : (a : ι) → a sκ) (hi : ∀ (a : ι) (ha : a s), i a ha t) (h : ∀ (a : ι) (ha : a s), f a = g (i a ha)) (i_inj : ∀ (a₁ : ι) (ha₁ : a₁ s) (a₂ : ι) (ha₂ : a₂ s), i a₁ ha₁ = i a₂ ha₂a₁ = a₂) (i_surj : bt, ∃ (a : ι) (ha : a s), i a ha = b) :
        (Finset.expect s fun (x : ι) => f x) = Finset.expect t fun (x : κ) => g x
        theorem Finset.expect_nbij {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f : ια} {t : Finset κ} {g : κα} (i : ικ) (hi : as, i a t) (h : as, f a = g (i a)) (i_inj : Set.InjOn i s) (i_surj : Set.SurjOn i s t) :
        (Finset.expect s fun (x : ι) => f x) = Finset.expect t fun (x : κ) => g x
        theorem Finset.expect_bij' {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f : ια} {t : Finset κ} {g : κα} (i : (a : ι) → a sκ) (j : (a : κ) → a tι) (hi : ∀ (a : ι) (ha : a s), i a ha t) (hj : ∀ (a : κ) (ha : a t), j a ha s) (left_inv : ∀ (a : ι) (ha : a s), j (i a ha) = a) (right_inv : ∀ (a : κ) (ha : a t), i (j a ha) = a) (h : ∀ (a : ι) (ha : a s), f a = g (i a ha)) :
        (Finset.expect s fun (x : ι) => f x) = Finset.expect t fun (x : κ) => g x
        theorem Finset.expect_nbij' {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f : ια} {t : Finset κ} {g : κα} (i : ικ) (j : κι) (hi : as, i a t) (hj : at, j a s) (left_inv : as, j (i a) = a) (right_inv : at, i (j a) = a) (h : as, f a = g (i a)) :
        (Finset.expect s fun (x : ι) => f x) = Finset.expect t fun (x : κ) => g x
        theorem Finset.expect_equiv {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f : ια} {t : Finset κ} {g : κα} (e : ι κ) (hst : ∀ (i : ι), i s e i t) (hfg : is, f i = g (e i)) :
        (Finset.expect s fun (i : ι) => f i) = Finset.expect t fun (i : κ) => g i

        Finset.expect_equiv is a specialization of Finset.expect_bij that automatically fills in most arguments.

        theorem Finset.expect_product' {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {t : Finset κ} (f : ικα) :
        (Finset.expect (s ×ˢ t) fun (x : ι × κ) => f x.1 x.2) = Finset.expect s fun (x : ι) => Finset.expect t fun (y : κ) => f x y
        @[simp]
        theorem Finset.expect_image {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {f : ια} {t : Finset κ} [DecidableEq ι] {m : κι} (hm : Set.InjOn m t) :
        (Finset.expect (Finset.image m t) fun (i : ι) => f i) = Finset.expect t fun (i : κ) => f (m i)
        @[simp]
        theorem Finset.expect_inv_index {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] [DecidableEq ι] [InvolutiveInv ι] (s : Finset ι) (f : ια) :
        (Finset.expect s⁻¹ fun (i : ι) => f i) = Finset.expect s fun (i : ι) => f i⁻¹
        @[simp]
        theorem Finset.expect_neg_index {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] [DecidableEq ι] [InvolutiveNeg ι] (s : Finset ι) (f : ια) :
        (Finset.expect (-s) fun (i : ι) => f i) = Finset.expect s fun (i : ι) => f (-i)
        theorem map_expect {ι : Type u_1} {α : Type u_3} {β : Type u_4} [AddCommMonoid α] [Module ℚ≥0 α] [AddCommMonoid β] [Module ℚ≥0 β] {F : Type u_5} [FunLike F α β] [LinearMapClass F ℚ≥0 α β] (g : F) (f : ια) (s : Finset ι) :
        g (Finset.expect s fun (x : ι) => f x) = Finset.expect s fun (x : ι) => g (f x)
        @[simp]
        theorem Finset.card_smul_expect {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] (s : Finset ι) (f : ια) :
        (s.card Finset.expect s fun (i : ι) => f i) = Finset.sum s fun (i : ι) => f i
        @[simp]
        theorem Fintype.card_smul_expect {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] [Fintype ι] (f : ια) :
        (Fintype.card ι Finset.expect Finset.univ fun (i : ι) => f i) = Finset.sum Finset.univ fun (i : ι) => f i
        @[simp]
        theorem Finset.expect_const {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} (hs : s.Nonempty) (a : α) :
        (Finset.expect s fun (_i : ι) => a) = a
        theorem Finset.smul_expect {ι : Type u_1} {α : Type u_3} [AddCommMonoid α] [Module ℚ≥0 α] {G : Type u_5} [DistribSMul G α] [SMulCommClass G ℚ≥0 α] (a : G) (s : Finset ι) (f : ια) :
        (a Finset.expect s fun (i : ι) => f i) = Finset.expect s fun (i : ι) => a f i
        theorem Finset.expect_sub_distrib {ι : Type u_1} {α : Type u_3} [AddCommGroup α] [Module ℚ≥0 α] (s : Finset ι) (f : ια) (g : ια) :
        (Finset.expect s fun (i : ι) => f i - g i) = (Finset.expect s fun (i : ι) => f i) - Finset.expect s fun (i : ι) => g i
        @[simp]
        theorem Finset.expect_neg_distrib {ι : Type u_1} {α : Type u_3} [AddCommGroup α] [Module ℚ≥0 α] (s : Finset ι) (f : ια) :
        (Finset.expect s fun (i : ι) => -f i) = -Finset.expect s fun (i : ι) => f i
        def Finset.balance {ι : Type u_1} {α : Type u_3} [AddCommGroup α] [Module ℚ≥0 α] [Fintype ι] (f : ια) :
        ια
        Equations
        Instances For
          theorem Finset.balance_apply {ι : Type u_1} {α : Type u_3} [AddCommGroup α] [Module ℚ≥0 α] [Fintype ι] (f : ια) (x : ι) :
          Finset.balance f x = f x - Finset.expect Finset.univ fun (y : ι) => f y
          @[simp]
          theorem Finset.balance_zero {ι : Type u_1} {α : Type u_3} [AddCommGroup α] [Module ℚ≥0 α] [Fintype ι] :
          @[simp]
          theorem Finset.balance_add {ι : Type u_1} {α : Type u_3} [AddCommGroup α] [Module ℚ≥0 α] [Fintype ι] (f : ια) (g : ια) :
          @[simp]
          theorem Finset.balance_sub {ι : Type u_1} {α : Type u_3} [AddCommGroup α] [Module ℚ≥0 α] [Fintype ι] (f : ια) (g : ια) :
          @[simp]
          theorem Finset.balance_neg {ι : Type u_1} {α : Type u_3} [AddCommGroup α] [Module ℚ≥0 α] [Fintype ι] (f : ια) :
          @[simp]
          theorem Finset.sum_balance {ι : Type u_1} {α : Type u_3} [AddCommGroup α] [Module ℚ≥0 α] [Fintype ι] (f : ια) :
          (Finset.sum Finset.univ fun (x : ι) => Finset.balance f x) = 0
          @[simp]
          theorem Finset.expect_balance {ι : Type u_1} {α : Type u_3} [AddCommGroup α] [Module ℚ≥0 α] [Fintype ι] (f : ια) :
          (Finset.expect Finset.univ fun (x : ι) => Finset.balance f x) = 0
          @[simp]
          theorem Finset.balance_idem {ι : Type u_1} {α : Type u_3} [AddCommGroup α] [Module ℚ≥0 α] [Fintype ι] (f : ια) :
          @[simp]
          theorem Finset.map_balance {ι : Type u_1} {α : Type u_3} {β : Type u_4} [AddCommGroup α] [Module ℚ≥0 α] [Field β] [Module ℚ≥0 β] [Fintype ι] {F : Type u_5} [FunLike F α β] [LinearMapClass F ℚ≥0 α β] (g : F) (f : ια) (a : ι) :
          g (Finset.balance f a) = Finset.balance (g f) a
          @[simp]
          theorem Finset.card_mul_expect {ι : Type u_1} {α : Type u_3} [Semiring α] [Module ℚ≥0 α] (s : Finset ι) (f : ια) :
          (s.card * Finset.expect s fun (i : ι) => f i) = Finset.sum s fun (i : ι) => f i
          @[simp]
          theorem Fintype.card_mul_expect {ι : Type u_1} {α : Type u_3} [Semiring α] [Module ℚ≥0 α] [Fintype ι] (f : ια) :
          ((Fintype.card ι) * Finset.expect Finset.univ fun (i : ι) => f i) = Finset.sum Finset.univ fun (i : ι) => f i
          theorem Finset.expect_mul {ι : Type u_1} {α : Type u_3} [Semiring α] [Module ℚ≥0 α] [IsScalarTower ℚ≥0 α α] (s : Finset ι) (f : ια) (a : α) :
          (Finset.expect s fun (i : ι) => f i) * a = Finset.expect s fun (i : ι) => f i * a
          theorem Finset.mul_expect {ι : Type u_1} {α : Type u_3} [Semiring α] [Module ℚ≥0 α] [SMulCommClass ℚ≥0 α α] (s : Finset ι) (f : ια) (a : α) :
          (a * Finset.expect s fun (i : ι) => f i) = Finset.expect s fun (i : ι) => a * f i
          theorem Finset.expect_mul_expect {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [Semiring α] [Module ℚ≥0 α] [IsScalarTower ℚ≥0 α α] [SMulCommClass ℚ≥0 α α] (s : Finset ι) (t : Finset κ) (f : ια) (g : κα) :
          ((Finset.expect s fun (i : ι) => f i) * Finset.expect t fun (j : κ) => g j) = Finset.expect s fun (i : ι) => Finset.expect t fun (j : κ) => f i * g j
          theorem Finset.expect_pow {ι : Type u_1} {α : Type u_3} [CommSemiring α] [Module ℚ≥0 α] [IsScalarTower ℚ≥0 α α] [SMulCommClass ℚ≥0 α α] (s : Finset ι) (f : ια) (n : ) :
          (Finset.expect s fun (i : ι) => f i) ^ n = Finset.expect (s^^n) fun (p : Fin nι) => Finset.prod Finset.univ fun (i : Fin n) => f (p i)
          theorem Finset.expect_indicate_eq {ι : Type u_1} {α : Type u_3} [Semifield α] [CharZero α] [Fintype ι] [Nonempty ι] [DecidableEq ι] (f : ια) (x : ι) :
          (Finset.expect Finset.univ fun (i : ι) => (if x = i then (Fintype.card ι) else 0) * f i) = f x
          theorem Finset.expect_indicate_eq' {ι : Type u_1} {α : Type u_3} [Semifield α] [CharZero α] [Fintype ι] [Nonempty ι] [DecidableEq ι] (f : ια) (x : ι) :
          (Finset.expect Finset.univ fun (i : ι) => (if i = x then (Fintype.card ι) else 0) * f i) = f x
          theorem Finset.expect_eq_sum_div_card {ι : Type u_1} {α : Type u_3} [Semifield α] [CharZero α] (s : Finset ι) (f : ια) :
          (Finset.expect s fun (i : ι) => f i) = (Finset.sum s fun (i : ι) => f i) / s.card
          theorem Fintype.expect_eq_sum_div_card {ι : Type u_1} {α : Type u_3} [Semifield α] [CharZero α] [Fintype ι] (f : ια) :
          (Finset.expect Finset.univ fun (i : ι) => f i) = (Finset.sum Finset.univ fun (i : ι) => f i) / (Fintype.card ι)
          theorem Finset.expect_div {ι : Type u_1} {α : Type u_3} [Semifield α] [CharZero α] (s : Finset ι) (f : ια) (a : α) :
          (Finset.expect s fun (i : ι) => f i) / a = Finset.expect s fun (i : ι) => f i / a

          Order #

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

          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_3} [OrderedAddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} [PosSMulMono ℚ≥0 α] (hs : s.Nonempty) (f : ια) (a : α) (h : xs, f x a) :
          (Finset.expect s fun (i : ι) => f i) a
          theorem Finset.le_expect {ι : Type u_1} {α : Type u_3} [OrderedAddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} [PosSMulMono ℚ≥0 α] (hs : s.Nonempty) (f : ια) (a : α) (h : xs, a f x) :
          a Finset.expect s fun (i : ι) => f i
          theorem Finset.expect_nonneg {ι : Type u_1} {α : Type u_3} [OrderedAddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f : ια} [PosSMulMono ℚ≥0 α] (hf : is, 0 f i) :
          0 Finset.expect s fun (i : ι) => f i
          theorem Finset.le_expect_of_subadditive {ι : Type u_1} {α : Type u_3} {β : Type u_4} [OrderedAddCommMonoid α] [Module ℚ≥0 α] [OrderedAddCommMonoid β] [Module ℚ≥0 β] [PosSMulMono ℚ≥0 β] (m : αβ) (h_zero : m 0 = 0) (h_add : ∀ (a b : α), m (a + b) m a + m b) (h_div : ∀ (a : α) (n : ), m ((n)⁻¹ a) = (n)⁻¹ m a) (s : Finset ι) (f : ια) :
          m (Finset.expect s fun (i : ι) => f i) Finset.expect s fun (i : ι) => m (f i)

          If m is a subadditive function (m (x + y) ≤ m x + m y, f 1 = 1), and f i, i ∈ s, is a finite family of elements, then m (𝔼 i in s, f i) ≤ 𝔼 i in s, m (f i).

          theorem Finset.expect_pos {ι : Type u_1} {α : Type u_3} [OrderedCancelAddCommMonoid α] [Module ℚ≥0 α] {s : Finset ι} {f : ια} [PosSMulStrictMono ℚ≥0 α] (hf : is, 0 < f i) (hs : s.Nonempty) :
          0 < Finset.expect s fun (i : ι) => f i
          theorem Finset.abs_expect_le_expect_abs {ι : Type u_1} {α : Type u_3} [LinearOrderedAddCommGroup α] [Module ℚ≥0 α] [PosSMulMono ℚ≥0 α] (s : Finset ι) (f : ια) :
          |Finset.expect s fun (i : ι) => f i| Finset.expect s fun (i : ι) => |f i|
          @[simp]
          theorem algebraMap.coe_expect {ι : Type u_1} {α : Type u_3} {β : Type u_4} [Semifield α] [CharZero α] [Semifield β] [CharZero β] [Algebra α β] (s : Finset ι) (f : ια) :
          (Finset.expect s fun (i : ι) => f i) = Finset.expect s fun (i : ι) => (f i)
          theorem Fintype.expect_bijective {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [Fintype ι] [Fintype κ] [AddCommMonoid α] [Module ℚ≥0 α] (e : ικ) (he : Function.Bijective e) (f : ια) (g : κα) (h : ∀ (x : ι), f x = g (e x)) :
          (Finset.expect Finset.univ fun (i : ι) => f i) = Finset.expect Finset.univ fun (i : κ) => g i

          Fintype.expect_bijective is a variant of Finset.expect_bij that accepts Function.Bijective.

          See Function.Bijective.expect_comp for a version without h.

          theorem Fintype.expect_equiv {ι : Type u_1} {κ : Type u_2} {α : Type u_3} [Fintype ι] [Fintype κ] [AddCommMonoid α] [Module ℚ≥0 α] (e : ι κ) (f : ια) (g : κα) (h : ∀ (x : ι), f x = g (e x)) :
          (Finset.expect Finset.univ fun (i : ι) => f i) = Finset.expect Finset.univ fun (i : κ) => g i

          Fintype.expect_equiv is a specialization of Finset.expect_bij that automatically fills in most arguments.

          See Equiv.expect_comp for a version without h.

          @[simp]
          theorem Fintype.expect_const {ι : Type u_1} {α : Type u_3} [Fintype ι] [AddCommMonoid α] [Module ℚ≥0 α] [Nonempty ι] (a : α) :
          (Finset.expect Finset.univ fun (_i : ι) => a) = a
          theorem Fintype.expect_ite_zero {ι : Type u_1} {α : Type u_3} [Fintype ι] [AddCommMonoid α] [Module ℚ≥0 α] (p : ιProp) [DecidablePred p] (h : ∀ (i j : ι), p ip ji = j) (a : α) :
          (Finset.expect Finset.univ fun (i : ι) => if p i then a else 0) = if ∃ (i : ι), p i then ((Fintype.card ι))⁻¹ a else 0
          @[simp]
          theorem Fintype.expect_dite_eq {ι : Type u_1} {α : Type u_3} [Fintype ι] [AddCommMonoid α] [Module ℚ≥0 α] [DecidableEq ι] (i : ι) (f : (j : ι) → i = jα) :
          (Finset.expect Finset.univ fun (j : ι) => if h : i = j then f j h else 0) = ((Fintype.card ι))⁻¹ f i
          @[simp]
          theorem Fintype.expect_dite_eq' {ι : Type u_1} {α : Type u_3} [Fintype ι] [AddCommMonoid α] [Module ℚ≥0 α] [DecidableEq ι] (i : ι) (f : (j : ι) → j = iα) :
          (Finset.expect Finset.univ fun (j : ι) => if h : j = i then f j h else 0) = ((Fintype.card ι))⁻¹ f i
          @[simp]
          theorem Fintype.expect_ite_eq {ι : Type u_1} {α : Type u_3} [Fintype ι] [AddCommMonoid α] [Module ℚ≥0 α] [DecidableEq ι] (i : ι) (f : ια) :
          (Finset.expect Finset.univ fun (j : ι) => if i = j then f j else 0) = ((Fintype.card ι))⁻¹ f i
          @[simp]
          theorem Fintype.expect_ite_eq' {ι : Type u_1} {α : Type u_3} [Fintype ι] [AddCommMonoid α] [Module ℚ≥0 α] [DecidableEq ι] (i : ι) (f : ια) :
          (Finset.expect Finset.univ fun (j : ι) => if j = i then f j else 0) = ((Fintype.card ι))⁻¹ f i
          @[simp]
          theorem Fintype.expect_one {ι : Type u_1} {α : Type u_3} [Fintype ι] [Semiring α] [Module ℚ≥0 α] [Nonempty ι] :
          (Finset.expect Finset.univ fun (_i : ι) => 1) = 1
          theorem Fintype.expect_eq_zero_iff_of_nonneg {ι : Type u_1} {α : Type u_3} [Fintype ι] [OrderedAddCommMonoid α] [Module ℚ≥0 α] {f : ια} [Nonempty ι] (hf : 0 f) :
          (Finset.expect Finset.univ fun (i : ι) => f i) = 0 f = 0
          theorem Fintype.expect_eq_zero_iff_of_nonpos {ι : Type u_1} {α : Type u_3} [Fintype ι] [OrderedAddCommMonoid α] [Module ℚ≥0 α] {f : ια} [Nonempty ι] (hf : f 0) :
          (Finset.expect Finset.univ fun (i : ι) => f i) = 0 f = 0
          @[simp]
          theorem RCLike.coe_balance {ι : Type u_1} {α : Type u_3} [RCLike α] [Fintype ι] (f : ι) (a : ι) :
          (Finset.balance f a) = Finset.balance (RCLike.ofReal f) a
          @[simp]
          theorem RCLike.coe_comp_balance {ι : Type u_1} {α : Type u_3} [RCLike α] [Fintype ι] (f : ι) :
          RCLike.ofReal Finset.balance f = Finset.balance (RCLike.ofReal f)