Module docstring
{"# Average over a finset
This file defines Finset.expect, the average (aka expectation) of a function over a finset.
Notation
๐ผ i โ s, f iis notation forFinset.expect s f. It is the expectation off iwhereiranges over the finite sets(either aFinsetor aSetwith aFintypeinstance).๐ผ i, f iis notation forFinset.expect Finset.univ f. It is the expectation off iwhereiranges over the finite domain off.๐ผ i โ s with p i, f iis notation forFinset.expect (Finset.filter p s) f. This is referred to asexpectWithin lemma names.๐ผ (i โ s) (j โ t), f i jis notation forFinset.expect (s รหข t) (fun โจi, jโฉ โฆ f i j).
Implementation notes
This definition is a special case of the general convex comnination operator in a convex space. However: 1. We don't yet have general convex spaces. 2. The uniform weights case is a overwhelmingly useful special case which should have its own API.
When convex spaces are finally defined, we should redefine Finset.expect in terms of that convex
combination operator.
TODO
- Connect
Finset.expectwith the expectation oversin the probability theory sense. - Give a formulation of Jensen's inequality in this language. "}