Commit 2024-09-17 18:34 fe83e801

View on Github →

feat: Expectation of a function over a finset (#15883) Define the expectation of a function f : ι → M over a finset s : Finset ι as ∑ i ∈ s, f i divided by s.card. Naïvely, this requires M to be a semifield but, since s.card⁻¹ is rational, we can get away with assuming M to be a NNRat-module. This generality is important to talk about expectation of functions. From LeanAPAP

Estimated changes

added theorem Finset.card_mul_expect
added def Finset.expect
added theorem Finset.expect_bij'
added theorem Finset.expect_bij
added theorem Finset.expect_comm
added theorem Finset.expect_congr
added theorem Finset.expect_const
added theorem Finset.expect_dite_eq'
added theorem Finset.expect_dite_eq
added theorem Finset.expect_div
added theorem Finset.expect_empty
added theorem Finset.expect_eq_zero
added theorem Finset.expect_equiv
added theorem Finset.expect_image
added theorem Finset.expect_ite_eq'
added theorem Finset.expect_ite_eq
added theorem Finset.expect_ite_zero
added theorem Finset.expect_mul
added theorem Finset.expect_nbij'
added theorem Finset.expect_nbij
added theorem Finset.expect_pow
added theorem Finset.expect_product'
added theorem Finset.expect_product
added theorem Finset.expect_sum_comm
added theorem Finset.expect_univ
added theorem Finset.mul_expect
added theorem Finset.smul_expect
added theorem Fintype.expect_const
added theorem Fintype.expect_dite_eq
added theorem Fintype.expect_equiv
added theorem Fintype.expect_ite_eq'
added theorem Fintype.expect_ite_eq
added theorem Fintype.expect_one
added theorem algebraMap.coe_expect
added theorem map_expect