Average over a finset #
This file defines Finset.expect
, the average (aka expectation) of a function over a finset.
Notation #
𝔼 i ∈ s, f i
is notation forFinset.expect s f
. It is the expectation off i
wherei
ranges over the finite sets
(either aFinset
or aSet
with aFintype
instance).𝔼 x, f x
is notation forFinset.expect Finset.univ f
. It is the expectation off i
wherei
ranges over the finite domain off
.𝔼 i ∈ s with p i, f i
is notation forFinset.expect (Finset.filter p s) f
. This is referred to asexpectWith
in lemma names.𝔼 (i ∈ s) (j ∈ t), f i j
is notation forFinset.expect (s ×ˢ t) (fun ⟨i, j⟩ ↦ f i j)
.
Equations
- «term_/ℚ_» = Lean.ParserDescr.trailingNode `term_/ℚ_ 1022 0 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " /ℚ ") (Lean.ParserDescr.cat `term 0))
Instances For
Average of a function over a finset. If the finset is empty, this is equal to zero.
Equations
- Finset.expect s f = (↑s.card)⁻¹ • Finset.sum s f
Instances For
𝔼 i ∈ s, f i
is notation forFinset.expect s f
. It is the expectation off i
wherei
ranges over the finite sets
(either aFinset
or aSet
with aFintype
instance).𝔼 x, f x
is notation forFinset.expect Finset.univ f
. It is the expectation off i
wherei
ranges over the finite domain off
.𝔼 i ∈ s with p i, f i
is notation forFinset.expect (Finset.filter p s) f
.𝔼 (i ∈ s) (j ∈ t), f i j
is notation forFinset.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
See also Finset.expect_boole
.
Finset.expect_equiv
is a specialization of Finset.expect_bij
that automatically fills in
most arguments.
Equations
- Finset.balance f = f - Function.const ι (Finset.expect Finset.univ fun (y : ι) => f y)
Instances For
Order #
This is a (beta-reduced) version of the standard lemma Finset.expect_le_expect
,
convenient for the gcongr
tactic.
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)
.
Fintype.expect_bijective
is a variant of Finset.expect_bij
that accepts
Function.Bijective
.
See Function.Bijective.expect_comp
for a version without h
.
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
.
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯