probability.moments
⟷
Mathlib.Probability.Moments
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -67,7 +67,7 @@ def centralMoment (X : Ω → ℝ) (p : ℕ) (μ : Measure Ω) : ℝ :=
#print ProbabilityTheory.moment_zero /-
@[simp]
theorem moment_zero (hp : p ≠ 0) : moment 0 p μ = 0 := by
- simp only [moment, hp, zero_pow', Ne.def, not_false_iff, Pi.zero_apply, integral_const,
+ simp only [moment, hp, zero_pow, Ne.def, not_false_iff, Pi.zero_apply, integral_const,
Algebra.id.smul_eq_mul, MulZeroClass.mul_zero]
#align probability_theory.moment_zero ProbabilityTheory.moment_zero
-/
@@ -76,7 +76,7 @@ theorem moment_zero (hp : p ≠ 0) : moment 0 p μ = 0 := by
@[simp]
theorem centralMoment_zero (hp : p ≠ 0) : centralMoment 0 p μ = 0 := by
simp only [central_moment, hp, Pi.zero_apply, integral_const, Algebra.id.smul_eq_mul,
- MulZeroClass.mul_zero, zero_sub, Pi.pow_apply, Pi.neg_apply, neg_zero, zero_pow', Ne.def,
+ MulZeroClass.mul_zero, zero_sub, Pi.pow_apply, Pi.neg_apply, neg_zero, zero_pow, Ne.def,
not_false_iff]
#align probability_theory.central_moment_zero ProbabilityTheory.centralMoment_zero
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -347,7 +347,16 @@ theorem aestronglyMeasurable_exp_mul_add {X Y : Ω → ℝ}
#print ProbabilityTheory.aestronglyMeasurable_exp_mul_sum /-
theorem aestronglyMeasurable_exp_mul_sum {X : ι → Ω → ℝ} {s : Finset ι}
(h_int : ∀ i ∈ s, AEStronglyMeasurable (fun ω => exp (t * X i ω)) μ) :
- AEStronglyMeasurable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by classical
+ AEStronglyMeasurable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by
+ classical
+ induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
+ · simp only [Pi.zero_apply, sum_apply, sum_empty, MulZeroClass.mul_zero, NormedSpace.exp_zero]
+ exact ae_strongly_measurable_const
+ · have : ∀ i : ι, i ∈ s → ae_strongly_measurable (fun ω : Ω => NormedSpace.exp (t * X i ω)) μ :=
+ fun i hi => h_int i (mem_insert_of_mem hi)
+ specialize h_rec this
+ rw [sum_insert hi_notin_s]
+ apply ae_strongly_measurable_exp_mul_add (h_int i (mem_insert_self _ _)) h_rec
#align probability_theory.ae_strongly_measurable_exp_mul_sum ProbabilityTheory.aestronglyMeasurable_exp_mul_sum
-/
@@ -366,14 +375,33 @@ theorem IndepFun.integrable_exp_mul_add {X Y : Ω → ℝ} (h_indep : IndepFun X
theorem iIndepFun.integrable_exp_mul_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
(h_indep : iIndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
{s : Finset ι} (h_int : ∀ i ∈ s, Integrable (fun ω => exp (t * X i ω)) μ) :
- Integrable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by classical
+ Integrable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by
+ classical
+ induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
+ · simp only [Pi.zero_apply, sum_apply, sum_empty, MulZeroClass.mul_zero, NormedSpace.exp_zero]
+ exact integrable_const _
+ · have : ∀ i : ι, i ∈ s → integrable (fun ω : Ω => NormedSpace.exp (t * X i ω)) μ := fun i hi =>
+ h_int i (mem_insert_of_mem hi)
+ specialize h_rec this
+ rw [sum_insert hi_notin_s]
+ refine' indep_fun.integrable_exp_mul_add _ (h_int i (mem_insert_self _ _)) h_rec
+ exact (h_indep.indep_fun_finset_sum_of_not_mem h_meas hi_notin_s).symm
#align probability_theory.Indep_fun.integrable_exp_mul_sum ProbabilityTheory.iIndepFun.integrable_exp_mul_sum
-/
#print ProbabilityTheory.iIndepFun.mgf_sum /-
theorem iIndepFun.mgf_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
(h_indep : iIndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
- (s : Finset ι) : mgf (∑ i in s, X i) μ t = ∏ i in s, mgf (X i) μ t := by classical
+ (s : Finset ι) : mgf (∑ i in s, X i) μ t = ∏ i in s, mgf (X i) μ t := by
+ classical
+ induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
+ · simp only [sum_empty, mgf_zero_fun, measure_univ, ENNReal.one_toReal, prod_empty]
+ · have h_int' : ∀ i : ι, ae_strongly_measurable (fun ω : Ω => NormedSpace.exp (t * X i ω)) μ :=
+ fun i => ((h_meas i).const_mul t).exp.AEStronglyMeasurable
+ rw [sum_insert hi_notin_s,
+ indep_fun.mgf_add (h_indep.indep_fun_finset_sum_of_not_mem h_meas hi_notin_s).symm (h_int' i)
+ (ae_strongly_measurable_exp_mul_sum fun i hi => h_int' i),
+ h_rec, prod_insert hi_notin_s]
#align probability_theory.Indep_fun.mgf_sum ProbabilityTheory.iIndepFun.mgf_sum
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -347,16 +347,7 @@ theorem aestronglyMeasurable_exp_mul_add {X Y : Ω → ℝ}
#print ProbabilityTheory.aestronglyMeasurable_exp_mul_sum /-
theorem aestronglyMeasurable_exp_mul_sum {X : ι → Ω → ℝ} {s : Finset ι}
(h_int : ∀ i ∈ s, AEStronglyMeasurable (fun ω => exp (t * X i ω)) μ) :
- AEStronglyMeasurable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by
- classical
- induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
- · simp only [Pi.zero_apply, sum_apply, sum_empty, MulZeroClass.mul_zero, NormedSpace.exp_zero]
- exact ae_strongly_measurable_const
- · have : ∀ i : ι, i ∈ s → ae_strongly_measurable (fun ω : Ω => NormedSpace.exp (t * X i ω)) μ :=
- fun i hi => h_int i (mem_insert_of_mem hi)
- specialize h_rec this
- rw [sum_insert hi_notin_s]
- apply ae_strongly_measurable_exp_mul_add (h_int i (mem_insert_self _ _)) h_rec
+ AEStronglyMeasurable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by classical
#align probability_theory.ae_strongly_measurable_exp_mul_sum ProbabilityTheory.aestronglyMeasurable_exp_mul_sum
-/
@@ -375,33 +366,14 @@ theorem IndepFun.integrable_exp_mul_add {X Y : Ω → ℝ} (h_indep : IndepFun X
theorem iIndepFun.integrable_exp_mul_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
(h_indep : iIndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
{s : Finset ι} (h_int : ∀ i ∈ s, Integrable (fun ω => exp (t * X i ω)) μ) :
- Integrable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by
- classical
- induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
- · simp only [Pi.zero_apply, sum_apply, sum_empty, MulZeroClass.mul_zero, NormedSpace.exp_zero]
- exact integrable_const _
- · have : ∀ i : ι, i ∈ s → integrable (fun ω : Ω => NormedSpace.exp (t * X i ω)) μ := fun i hi =>
- h_int i (mem_insert_of_mem hi)
- specialize h_rec this
- rw [sum_insert hi_notin_s]
- refine' indep_fun.integrable_exp_mul_add _ (h_int i (mem_insert_self _ _)) h_rec
- exact (h_indep.indep_fun_finset_sum_of_not_mem h_meas hi_notin_s).symm
+ Integrable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by classical
#align probability_theory.Indep_fun.integrable_exp_mul_sum ProbabilityTheory.iIndepFun.integrable_exp_mul_sum
-/
#print ProbabilityTheory.iIndepFun.mgf_sum /-
theorem iIndepFun.mgf_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
(h_indep : iIndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
- (s : Finset ι) : mgf (∑ i in s, X i) μ t = ∏ i in s, mgf (X i) μ t := by
- classical
- induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
- · simp only [sum_empty, mgf_zero_fun, measure_univ, ENNReal.one_toReal, prod_empty]
- · have h_int' : ∀ i : ι, ae_strongly_measurable (fun ω : Ω => NormedSpace.exp (t * X i ω)) μ :=
- fun i => ((h_meas i).const_mul t).exp.AEStronglyMeasurable
- rw [sum_insert hi_notin_s,
- indep_fun.mgf_add (h_indep.indep_fun_finset_sum_of_not_mem h_meas hi_notin_s).symm (h_int' i)
- (ae_strongly_measurable_exp_mul_sum fun i hi => h_int' i),
- h_rec, prod_insert hi_notin_s]
+ (s : Finset ι) : mgf (∑ i in s, X i) μ t = ∏ i in s, mgf (X i) μ t := by classical
#align probability_theory.Indep_fun.mgf_sum ProbabilityTheory.iIndepFun.mgf_sum
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -136,7 +136,7 @@ def cgf (X : Ω → ℝ) (μ : Measure Ω) (t : ℝ) : ℝ :=
#print ProbabilityTheory.mgf_zero_fun /-
@[simp]
theorem mgf_zero_fun : mgf 0 μ t = (μ Set.univ).toReal := by
- simp only [mgf, Pi.zero_apply, MulZeroClass.mul_zero, exp_zero, integral_const,
+ simp only [mgf, Pi.zero_apply, MulZeroClass.mul_zero, NormedSpace.exp_zero, integral_const,
Algebra.id.smul_eq_mul, mul_one]
#align probability_theory.mgf_zero_fun ProbabilityTheory.mgf_zero_fun
-/
@@ -197,7 +197,8 @@ theorem cgf_const [IsProbabilityMeasure μ] (c : ℝ) : cgf (fun _ => c) μ t =
#print ProbabilityTheory.mgf_zero' /-
@[simp]
theorem mgf_zero' : mgf X μ 0 = (μ Set.univ).toReal := by
- simp only [mgf, MulZeroClass.zero_mul, exp_zero, integral_const, Algebra.id.smul_eq_mul, mul_one]
+ simp only [mgf, MulZeroClass.zero_mul, NormedSpace.exp_zero, integral_const,
+ Algebra.id.smul_eq_mul, mul_one]
#align probability_theory.mgf_zero' ProbabilityTheory.mgf_zero'
-/
@@ -247,10 +248,11 @@ theorem mgf_nonneg : 0 ≤ mgf X μ t :=
theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) : 0 < mgf X μ t :=
by
simp_rw [mgf]
- have : ∫ x : Ω, exp (t * X x) ∂μ = ∫ x : Ω in Set.univ, exp (t * X x) ∂μ := by
+ have :
+ ∫ x : Ω, NormedSpace.exp (t * X x) ∂μ = ∫ x : Ω in Set.univ, NormedSpace.exp (t * X x) ∂μ := by
simp only [measure.restrict_univ]
rw [this, set_integral_pos_iff_support_of_nonneg_ae _ _]
- · have h_eq_univ : (Function.support fun x : Ω => exp (t * X x)) = Set.univ :=
+ · have h_eq_univ : (Function.support fun x : Ω => NormedSpace.exp (t * X x)) = Set.univ :=
by
ext1 x
simp only [Function.mem_support, Set.mem_univ, iff_true_iff]
@@ -287,8 +289,10 @@ theorem cgf_neg : cgf (-X) μ t = cgf X μ (-t) := by simp_rw [cgf, mgf_neg]
theorem IndepFun.exp_mul {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ) (s t : ℝ) :
IndepFun (fun ω => exp (s * X ω)) (fun ω => exp (t * Y ω)) μ :=
by
- have h_meas : ∀ t, Measurable fun x => exp (t * x) := fun t => (measurable_id'.const_mul t).exp
- change indep_fun ((fun x => exp (s * x)) ∘ X) ((fun x => exp (t * x)) ∘ Y) μ
+ have h_meas : ∀ t, Measurable fun x => NormedSpace.exp (t * x) := fun t =>
+ (measurable_id'.const_mul t).exp
+ change
+ indep_fun ((fun x => NormedSpace.exp (s * x)) ∘ X) ((fun x => NormedSpace.exp (t * x)) ∘ Y) μ
exact indep_fun.comp h_indep (h_meas s) (h_meas t)
#align probability_theory.indep_fun.exp_mul ProbabilityTheory.IndepFun.exp_mul
-/
@@ -299,7 +303,7 @@ theorem IndepFun.mgf_add {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ)
(hY : AEStronglyMeasurable (fun ω => exp (t * Y ω)) μ) :
mgf (X + Y) μ t = mgf X μ t * mgf Y μ t :=
by
- simp_rw [mgf, Pi.add_apply, mul_add, exp_add]
+ simp_rw [mgf, Pi.add_apply, mul_add, NormedSpace.exp_add]
exact (h_indep.exp_mul t t).integral_mul hX hY
#align probability_theory.indep_fun.mgf_add ProbabilityTheory.IndepFun.mgf_add
-/
@@ -308,10 +312,10 @@ theorem IndepFun.mgf_add {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ)
theorem IndepFun.mgf_add' {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ) (hX : AEStronglyMeasurable X μ)
(hY : AEStronglyMeasurable Y μ) : mgf (X + Y) μ t = mgf X μ t * mgf Y μ t :=
by
- have A : Continuous fun x : ℝ => exp (t * x) := by continuity
- have h'X : ae_strongly_measurable (fun ω => exp (t * X ω)) μ :=
+ have A : Continuous fun x : ℝ => NormedSpace.exp (t * x) := by continuity
+ have h'X : ae_strongly_measurable (fun ω => NormedSpace.exp (t * X ω)) μ :=
A.ae_strongly_measurable.comp_ae_measurable hX.ae_measurable
- have h'Y : ae_strongly_measurable (fun ω => exp (t * Y ω)) μ :=
+ have h'Y : ae_strongly_measurable (fun ω => NormedSpace.exp (t * Y ω)) μ :=
A.ae_strongly_measurable.comp_ae_measurable hY.ae_measurable
exact h_indep.mgf_add h'X h'Y
#align probability_theory.indep_fun.mgf_add' ProbabilityTheory.IndepFun.mgf_add'
@@ -335,7 +339,7 @@ theorem aestronglyMeasurable_exp_mul_add {X Y : Ω → ℝ}
(h_int_Y : AEStronglyMeasurable (fun ω => exp (t * Y ω)) μ) :
AEStronglyMeasurable (fun ω => exp (t * (X + Y) ω)) μ :=
by
- simp_rw [Pi.add_apply, mul_add, exp_add]
+ simp_rw [Pi.add_apply, mul_add, NormedSpace.exp_add]
exact ae_strongly_measurable.mul h_int_X h_int_Y
#align probability_theory.ae_strongly_measurable_exp_mul_add ProbabilityTheory.aestronglyMeasurable_exp_mul_add
-/
@@ -346,10 +350,10 @@ theorem aestronglyMeasurable_exp_mul_sum {X : ι → Ω → ℝ} {s : Finset ι}
AEStronglyMeasurable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by
classical
induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
- · simp only [Pi.zero_apply, sum_apply, sum_empty, MulZeroClass.mul_zero, exp_zero]
+ · simp only [Pi.zero_apply, sum_apply, sum_empty, MulZeroClass.mul_zero, NormedSpace.exp_zero]
exact ae_strongly_measurable_const
- · have : ∀ i : ι, i ∈ s → ae_strongly_measurable (fun ω : Ω => exp (t * X i ω)) μ := fun i hi =>
- h_int i (mem_insert_of_mem hi)
+ · have : ∀ i : ι, i ∈ s → ae_strongly_measurable (fun ω : Ω => NormedSpace.exp (t * X i ω)) μ :=
+ fun i hi => h_int i (mem_insert_of_mem hi)
specialize h_rec this
rw [sum_insert hi_notin_s]
apply ae_strongly_measurable_exp_mul_add (h_int i (mem_insert_self _ _)) h_rec
@@ -362,7 +366,7 @@ theorem IndepFun.integrable_exp_mul_add {X Y : Ω → ℝ} (h_indep : IndepFun X
(h_int_Y : Integrable (fun ω => exp (t * Y ω)) μ) :
Integrable (fun ω => exp (t * (X + Y) ω)) μ :=
by
- simp_rw [Pi.add_apply, mul_add, exp_add]
+ simp_rw [Pi.add_apply, mul_add, NormedSpace.exp_add]
exact (h_indep.exp_mul t t).integrable_mul h_int_X h_int_Y
#align probability_theory.indep_fun.integrable_exp_mul_add ProbabilityTheory.IndepFun.integrable_exp_mul_add
-/
@@ -374,9 +378,9 @@ theorem iIndepFun.integrable_exp_mul_sum [IsProbabilityMeasure μ] {X : ι →
Integrable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by
classical
induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
- · simp only [Pi.zero_apply, sum_apply, sum_empty, MulZeroClass.mul_zero, exp_zero]
+ · simp only [Pi.zero_apply, sum_apply, sum_empty, MulZeroClass.mul_zero, NormedSpace.exp_zero]
exact integrable_const _
- · have : ∀ i : ι, i ∈ s → integrable (fun ω : Ω => exp (t * X i ω)) μ := fun i hi =>
+ · have : ∀ i : ι, i ∈ s → integrable (fun ω : Ω => NormedSpace.exp (t * X i ω)) μ := fun i hi =>
h_int i (mem_insert_of_mem hi)
specialize h_rec this
rw [sum_insert hi_notin_s]
@@ -392,8 +396,8 @@ theorem iIndepFun.mgf_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
classical
induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
· simp only [sum_empty, mgf_zero_fun, measure_univ, ENNReal.one_toReal, prod_empty]
- · have h_int' : ∀ i : ι, ae_strongly_measurable (fun ω : Ω => exp (t * X i ω)) μ := fun i =>
- ((h_meas i).const_mul t).exp.AEStronglyMeasurable
+ · have h_int' : ∀ i : ι, ae_strongly_measurable (fun ω : Ω => NormedSpace.exp (t * X i ω)) μ :=
+ fun i => ((h_meas i).const_mul t).exp.AEStronglyMeasurable
rw [sum_insert hi_notin_s,
indep_fun.mgf_add (h_indep.indep_fun_finset_sum_of_not_mem h_meas hi_notin_s).symm (h_int' i)
(ae_strongly_measurable_exp_mul_sum fun i hi => h_int' i),
@@ -422,23 +426,26 @@ theorem measure_ge_le_exp_mul_mgf [IsFiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
by
cases' ht.eq_or_lt with ht_zero_eq ht_pos
· rw [ht_zero_eq.symm]
- simp only [neg_zero, MulZeroClass.zero_mul, exp_zero, mgf_zero', one_mul]
+ simp only [neg_zero, MulZeroClass.zero_mul, NormedSpace.exp_zero, mgf_zero', one_mul]
rw [ENNReal.toReal_le_toReal (measure_ne_top μ _) (measure_ne_top μ _)]
exact measure_mono (Set.subset_univ _)
calc
- (μ {ω | ε ≤ X ω}).toReal = (μ {ω | exp (t * ε) ≤ exp (t * X ω)}).toReal :=
+ (μ {ω | ε ≤ X ω}).toReal =
+ (μ {ω | NormedSpace.exp (t * ε) ≤ NormedSpace.exp (t * X ω)}).toReal :=
by
congr with ω
simp only [exp_le_exp, eq_iff_iff]
exact
⟨fun h => mul_le_mul_of_nonneg_left h ht_pos.le, fun h => le_of_mul_le_mul_left h ht_pos⟩
- _ ≤ (exp (t * ε))⁻¹ * μ[fun ω => exp (t * X ω)] :=
+ _ ≤ (NormedSpace.exp (t * ε))⁻¹ * μ[fun ω => NormedSpace.exp (t * X ω)] :=
by
have :
- exp (t * ε) * (μ {ω | exp (t * ε) ≤ exp (t * X ω)}).toReal ≤ μ[fun ω => exp (t * X ω)] :=
+ NormedSpace.exp (t * ε) *
+ (μ {ω | NormedSpace.exp (t * ε) ≤ NormedSpace.exp (t * X ω)}).toReal ≤
+ μ[fun ω => NormedSpace.exp (t * X ω)] :=
mul_meas_ge_le_integral_of_nonneg (fun x => (exp_pos _).le) h_int _
- rwa [mul_comm (exp (t * ε))⁻¹, ← div_eq_mul_inv, le_div_iff' (exp_pos _)]
- _ = exp (-t * ε) * mgf X μ t := by rw [neg_mul, exp_neg]; rfl
+ rwa [mul_comm (NormedSpace.exp (t * ε))⁻¹, ← div_eq_mul_inv, le_div_iff' (exp_pos _)]
+ _ = NormedSpace.exp (-t * ε) * mgf X μ t := by rw [neg_mul, NormedSpace.exp_neg]; rfl
#align probability_theory.measure_ge_le_exp_mul_mgf ProbabilityTheory.measure_ge_le_exp_mul_mgf
-/
@@ -464,7 +471,7 @@ theorem measure_ge_le_exp_cgf [IsFiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
(μ {ω | ε ≤ X ω}).toReal ≤ exp (-t * ε + cgf X μ t) :=
by
refine' (measure_ge_le_exp_mul_mgf ε ht h_int).trans _
- rw [exp_add]
+ rw [NormedSpace.exp_add]
exact mul_le_mul le_rfl (le_exp_log _) mgf_nonneg (exp_pos _).le
#align probability_theory.measure_ge_le_exp_cgf ProbabilityTheory.measure_ge_le_exp_cgf
-/
@@ -476,7 +483,7 @@ theorem measure_le_le_exp_cgf [IsFiniteMeasure μ] (ε : ℝ) (ht : t ≤ 0)
(μ {ω | X ω ≤ ε}).toReal ≤ exp (-t * ε + cgf X μ t) :=
by
refine' (measure_le_le_exp_mul_mgf ε ht h_int).trans _
- rw [exp_add]
+ rw [NormedSpace.exp_add]
exact mul_le_mul le_rfl (le_exp_log _) mgf_nonneg (exp_pos _).le
#align probability_theory.measure_le_le_exp_cgf ProbabilityTheory.measure_le_le_exp_cgf
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,7 +3,7 @@ Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
-import Mathbin.Probability.Variance
+import Probability.Variance
#align_import probability.moments from "leanprover-community/mathlib"@"1b089e3bdc3ce6b39cd472543474a0a137128c6c"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,14 +2,11 @@
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-
-! This file was ported from Lean 3 source module probability.moments
-! leanprover-community/mathlib commit 1b089e3bdc3ce6b39cd472543474a0a137128c6c
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Probability.Variance
+#align_import probability.moments from "leanprover-community/mathlib"@"1b089e3bdc3ce6b39cd472543474a0a137128c6c"
+
/-!
# Moments and moment generating function
mathlib commit https://github.com/leanprover-community/mathlib/commit/d30d31261cdb4d2f5e612eabc3c4bf45556350d5
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
! This file was ported from Lean 3 source module probability.moments
-! leanprover-community/mathlib commit 85453a2a14be8da64caf15ca50930cf4c6e5d8de
+! leanprover-community/mathlib commit 1b089e3bdc3ce6b39cd472543474a0a137128c6c
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -13,6 +13,9 @@ import Mathbin.Probability.Variance
/-!
# Moments and moment generating function
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
## Main definitions
* `probability_theory.moment X p μ`: `p`th moment of a real random variable `X` with respect to
mathlib commit https://github.com/leanprover-community/mathlib/commit/f2ad3645af9effcdb587637dc28a6074edc813f9
@@ -50,29 +50,38 @@ namespace ProbabilityTheory
variable {Ω ι : Type _} {m : MeasurableSpace Ω} {X : Ω → ℝ} {p : ℕ} {μ : Measure Ω}
+#print ProbabilityTheory.moment /-
/-- Moment of a real random variable, `μ[X ^ p]`. -/
def moment (X : Ω → ℝ) (p : ℕ) (μ : Measure Ω) : ℝ :=
μ[X ^ p]
#align probability_theory.moment ProbabilityTheory.moment
+-/
+#print ProbabilityTheory.centralMoment /-
/-- Central moment of a real random variable, `μ[(X - μ[X]) ^ p]`. -/
def centralMoment (X : Ω → ℝ) (p : ℕ) (μ : Measure Ω) : ℝ :=
μ[(X - fun x => μ[X]) ^ p]
#align probability_theory.central_moment ProbabilityTheory.centralMoment
+-/
+#print ProbabilityTheory.moment_zero /-
@[simp]
theorem moment_zero (hp : p ≠ 0) : moment 0 p μ = 0 := by
simp only [moment, hp, zero_pow', Ne.def, not_false_iff, Pi.zero_apply, integral_const,
Algebra.id.smul_eq_mul, MulZeroClass.mul_zero]
#align probability_theory.moment_zero ProbabilityTheory.moment_zero
+-/
+#print ProbabilityTheory.centralMoment_zero /-
@[simp]
theorem centralMoment_zero (hp : p ≠ 0) : centralMoment 0 p μ = 0 := by
simp only [central_moment, hp, Pi.zero_apply, integral_const, Algebra.id.smul_eq_mul,
MulZeroClass.mul_zero, zero_sub, Pi.pow_apply, Pi.neg_apply, neg_zero, zero_pow', Ne.def,
not_false_iff]
#align probability_theory.central_moment_zero ProbabilityTheory.centralMoment_zero
+-/
+#print ProbabilityTheory.centralMoment_one' /-
theorem centralMoment_one' [IsFiniteMeasure μ] (h_int : Integrable X μ) :
centralMoment X 1 μ = (1 - (μ Set.univ).toReal) * μ[X] :=
by
@@ -80,7 +89,9 @@ theorem centralMoment_one' [IsFiniteMeasure μ] (h_int : Integrable X μ) :
rw [integral_sub h_int (integrable_const _)]
simp only [sub_mul, integral_const, Algebra.id.smul_eq_mul, one_mul]
#align probability_theory.central_moment_one' ProbabilityTheory.centralMoment_one'
+-/
+#print ProbabilityTheory.centralMoment_one /-
@[simp]
theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 :=
by
@@ -96,54 +107,74 @@ theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 :
exact h_sub.add (integrable_const _)
rw [integral_undef this]
#align probability_theory.central_moment_one ProbabilityTheory.centralMoment_one
+-/
+#print ProbabilityTheory.centralMoment_two_eq_variance /-
theorem centralMoment_two_eq_variance [IsFiniteMeasure μ] (hX : Memℒp X 2 μ) :
centralMoment X 2 μ = variance X μ := by rw [hX.variance_eq]; rfl
#align probability_theory.central_moment_two_eq_variance ProbabilityTheory.centralMoment_two_eq_variance
+-/
section MomentGeneratingFunction
variable {t : ℝ}
+#print ProbabilityTheory.mgf /-
/-- Moment generating function of a real random variable `X`: `λ t, μ[exp(t*X)]`. -/
def mgf (X : Ω → ℝ) (μ : Measure Ω) (t : ℝ) : ℝ :=
μ[fun ω => exp (t * X ω)]
#align probability_theory.mgf ProbabilityTheory.mgf
+-/
+#print ProbabilityTheory.cgf /-
/-- Cumulant generating function of a real random variable `X`: `λ t, log μ[exp(t*X)]`. -/
def cgf (X : Ω → ℝ) (μ : Measure Ω) (t : ℝ) : ℝ :=
log (mgf X μ t)
#align probability_theory.cgf ProbabilityTheory.cgf
+-/
+#print ProbabilityTheory.mgf_zero_fun /-
@[simp]
theorem mgf_zero_fun : mgf 0 μ t = (μ Set.univ).toReal := by
simp only [mgf, Pi.zero_apply, MulZeroClass.mul_zero, exp_zero, integral_const,
Algebra.id.smul_eq_mul, mul_one]
#align probability_theory.mgf_zero_fun ProbabilityTheory.mgf_zero_fun
+-/
+#print ProbabilityTheory.cgf_zero_fun /-
@[simp]
theorem cgf_zero_fun : cgf 0 μ t = log (μ Set.univ).toReal := by simp only [cgf, mgf_zero_fun]
#align probability_theory.cgf_zero_fun ProbabilityTheory.cgf_zero_fun
+-/
+#print ProbabilityTheory.mgf_zero_measure /-
@[simp]
theorem mgf_zero_measure : mgf X (0 : Measure Ω) t = 0 := by simp only [mgf, integral_zero_measure]
#align probability_theory.mgf_zero_measure ProbabilityTheory.mgf_zero_measure
+-/
+#print ProbabilityTheory.cgf_zero_measure /-
@[simp]
theorem cgf_zero_measure : cgf X (0 : Measure Ω) t = 0 := by
simp only [cgf, log_zero, mgf_zero_measure]
#align probability_theory.cgf_zero_measure ProbabilityTheory.cgf_zero_measure
+-/
+#print ProbabilityTheory.mgf_const' /-
@[simp]
theorem mgf_const' (c : ℝ) : mgf (fun _ => c) μ t = (μ Set.univ).toReal * exp (t * c) := by
simp only [mgf, integral_const, Algebra.id.smul_eq_mul]
#align probability_theory.mgf_const' ProbabilityTheory.mgf_const'
+-/
+#print ProbabilityTheory.mgf_const /-
@[simp]
theorem mgf_const (c : ℝ) [IsProbabilityMeasure μ] : mgf (fun _ => c) μ t = exp (t * c) := by
simp only [mgf_const', measure_univ, ENNReal.one_toReal, one_mul]
#align probability_theory.mgf_const ProbabilityTheory.mgf_const
+-/
+#print ProbabilityTheory.cgf_const' /-
@[simp]
theorem cgf_const' [IsFiniteMeasure μ] (hμ : μ ≠ 0) (c : ℝ) :
cgf (fun _ => c) μ t = log (μ Set.univ).toReal + t * c :=
@@ -154,39 +185,55 @@ theorem cgf_const' [IsFiniteMeasure μ] (hμ : μ ≠ 0) (c : ℝ) :
· rw [Ne.def, ENNReal.toReal_eq_zero_iff, measure.measure_univ_eq_zero]
simp only [hμ, measure_ne_top μ Set.univ, or_self_iff, not_false_iff]
#align probability_theory.cgf_const' ProbabilityTheory.cgf_const'
+-/
+#print ProbabilityTheory.cgf_const /-
@[simp]
theorem cgf_const [IsProbabilityMeasure μ] (c : ℝ) : cgf (fun _ => c) μ t = t * c := by
simp only [cgf, mgf_const, log_exp]
#align probability_theory.cgf_const ProbabilityTheory.cgf_const
+-/
+#print ProbabilityTheory.mgf_zero' /-
@[simp]
theorem mgf_zero' : mgf X μ 0 = (μ Set.univ).toReal := by
simp only [mgf, MulZeroClass.zero_mul, exp_zero, integral_const, Algebra.id.smul_eq_mul, mul_one]
#align probability_theory.mgf_zero' ProbabilityTheory.mgf_zero'
+-/
+#print ProbabilityTheory.mgf_zero /-
@[simp]
theorem mgf_zero [IsProbabilityMeasure μ] : mgf X μ 0 = 1 := by
simp only [mgf_zero', measure_univ, ENNReal.one_toReal]
#align probability_theory.mgf_zero ProbabilityTheory.mgf_zero
+-/
+#print ProbabilityTheory.cgf_zero' /-
@[simp]
theorem cgf_zero' : cgf X μ 0 = log (μ Set.univ).toReal := by simp only [cgf, mgf_zero']
#align probability_theory.cgf_zero' ProbabilityTheory.cgf_zero'
+-/
+#print ProbabilityTheory.cgf_zero /-
@[simp]
theorem cgf_zero [IsProbabilityMeasure μ] : cgf X μ 0 = 0 := by
simp only [cgf_zero', measure_univ, ENNReal.one_toReal, log_one]
#align probability_theory.cgf_zero ProbabilityTheory.cgf_zero
+-/
+#print ProbabilityTheory.mgf_undef /-
theorem mgf_undef (hX : ¬Integrable (fun ω => exp (t * X ω)) μ) : mgf X μ t = 0 := by
simp only [mgf, integral_undef hX]
#align probability_theory.mgf_undef ProbabilityTheory.mgf_undef
+-/
+#print ProbabilityTheory.cgf_undef /-
theorem cgf_undef (hX : ¬Integrable (fun ω => exp (t * X ω)) μ) : cgf X μ t = 0 := by
simp only [cgf, mgf_undef hX, log_zero]
#align probability_theory.cgf_undef ProbabilityTheory.cgf_undef
+-/
+#print ProbabilityTheory.mgf_nonneg /-
theorem mgf_nonneg : 0 ≤ mgf X μ t :=
by
refine' integral_nonneg _
@@ -194,7 +241,9 @@ theorem mgf_nonneg : 0 ≤ mgf X μ t :=
simp only [Pi.zero_apply]
exact (exp_pos _).le
#align probability_theory.mgf_nonneg ProbabilityTheory.mgf_nonneg
+-/
+#print ProbabilityTheory.mgf_pos' /-
theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) : 0 < mgf X μ t :=
by
simp_rw [mgf]
@@ -214,18 +263,26 @@ theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω
exact (exp_pos _).le
· rwa [integrable_on_univ]
#align probability_theory.mgf_pos' ProbabilityTheory.mgf_pos'
+-/
+#print ProbabilityTheory.mgf_pos /-
theorem mgf_pos [IsProbabilityMeasure μ] (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) :
0 < mgf X μ t :=
mgf_pos' (IsProbabilityMeasure.ne_zero μ) h_int_X
#align probability_theory.mgf_pos ProbabilityTheory.mgf_pos
+-/
+#print ProbabilityTheory.mgf_neg /-
theorem mgf_neg : mgf (-X) μ t = mgf X μ (-t) := by simp_rw [mgf, Pi.neg_apply, mul_neg, neg_mul]
#align probability_theory.mgf_neg ProbabilityTheory.mgf_neg
+-/
+#print ProbabilityTheory.cgf_neg /-
theorem cgf_neg : cgf (-X) μ t = cgf X μ (-t) := by simp_rw [cgf, mgf_neg]
#align probability_theory.cgf_neg ProbabilityTheory.cgf_neg
+-/
+#print ProbabilityTheory.IndepFun.exp_mul /-
/-- This is a trivial application of `indep_fun.comp` but it will come up frequently. -/
theorem IndepFun.exp_mul {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ) (s t : ℝ) :
IndepFun (fun ω => exp (s * X ω)) (fun ω => exp (t * Y ω)) μ :=
@@ -234,7 +291,9 @@ theorem IndepFun.exp_mul {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ) (s t :
change indep_fun ((fun x => exp (s * x)) ∘ X) ((fun x => exp (t * x)) ∘ Y) μ
exact indep_fun.comp h_indep (h_meas s) (h_meas t)
#align probability_theory.indep_fun.exp_mul ProbabilityTheory.IndepFun.exp_mul
+-/
+#print ProbabilityTheory.IndepFun.mgf_add /-
theorem IndepFun.mgf_add {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ)
(hX : AEStronglyMeasurable (fun ω => exp (t * X ω)) μ)
(hY : AEStronglyMeasurable (fun ω => exp (t * Y ω)) μ) :
@@ -243,7 +302,9 @@ theorem IndepFun.mgf_add {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ)
simp_rw [mgf, Pi.add_apply, mul_add, exp_add]
exact (h_indep.exp_mul t t).integral_mul hX hY
#align probability_theory.indep_fun.mgf_add ProbabilityTheory.IndepFun.mgf_add
+-/
+#print ProbabilityTheory.IndepFun.mgf_add' /-
theorem IndepFun.mgf_add' {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ) (hX : AEStronglyMeasurable X μ)
(hY : AEStronglyMeasurable Y μ) : mgf (X + Y) μ t = mgf X μ t * mgf Y μ t :=
by
@@ -254,7 +315,9 @@ theorem IndepFun.mgf_add' {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ) (hX : A
A.ae_strongly_measurable.comp_ae_measurable hY.ae_measurable
exact h_indep.mgf_add h'X h'Y
#align probability_theory.indep_fun.mgf_add' ProbabilityTheory.IndepFun.mgf_add'
+-/
+#print ProbabilityTheory.IndepFun.cgf_add /-
theorem IndepFun.cgf_add {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ)
(h_int_X : Integrable (fun ω => exp (t * X ω)) μ)
(h_int_Y : Integrable (fun ω => exp (t * Y ω)) μ) : cgf (X + Y) μ t = cgf X μ t + cgf Y μ t :=
@@ -264,17 +327,21 @@ theorem IndepFun.cgf_add {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ)
simp only [cgf, h_indep.mgf_add h_int_X.ae_strongly_measurable h_int_Y.ae_strongly_measurable]
exact log_mul (mgf_pos' hμ h_int_X).ne' (mgf_pos' hμ h_int_Y).ne'
#align probability_theory.indep_fun.cgf_add ProbabilityTheory.IndepFun.cgf_add
+-/
-theorem aEStronglyMeasurable_exp_mul_add {X Y : Ω → ℝ}
+#print ProbabilityTheory.aestronglyMeasurable_exp_mul_add /-
+theorem aestronglyMeasurable_exp_mul_add {X Y : Ω → ℝ}
(h_int_X : AEStronglyMeasurable (fun ω => exp (t * X ω)) μ)
(h_int_Y : AEStronglyMeasurable (fun ω => exp (t * Y ω)) μ) :
AEStronglyMeasurable (fun ω => exp (t * (X + Y) ω)) μ :=
by
simp_rw [Pi.add_apply, mul_add, exp_add]
exact ae_strongly_measurable.mul h_int_X h_int_Y
-#align probability_theory.ae_strongly_measurable_exp_mul_add ProbabilityTheory.aEStronglyMeasurable_exp_mul_add
+#align probability_theory.ae_strongly_measurable_exp_mul_add ProbabilityTheory.aestronglyMeasurable_exp_mul_add
+-/
-theorem aEStronglyMeasurable_exp_mul_sum {X : ι → Ω → ℝ} {s : Finset ι}
+#print ProbabilityTheory.aestronglyMeasurable_exp_mul_sum /-
+theorem aestronglyMeasurable_exp_mul_sum {X : ι → Ω → ℝ} {s : Finset ι}
(h_int : ∀ i ∈ s, AEStronglyMeasurable (fun ω => exp (t * X i ω)) μ) :
AEStronglyMeasurable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by
classical
@@ -286,8 +353,10 @@ theorem aEStronglyMeasurable_exp_mul_sum {X : ι → Ω → ℝ} {s : Finset ι}
specialize h_rec this
rw [sum_insert hi_notin_s]
apply ae_strongly_measurable_exp_mul_add (h_int i (mem_insert_self _ _)) h_rec
-#align probability_theory.ae_strongly_measurable_exp_mul_sum ProbabilityTheory.aEStronglyMeasurable_exp_mul_sum
+#align probability_theory.ae_strongly_measurable_exp_mul_sum ProbabilityTheory.aestronglyMeasurable_exp_mul_sum
+-/
+#print ProbabilityTheory.IndepFun.integrable_exp_mul_add /-
theorem IndepFun.integrable_exp_mul_add {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ)
(h_int_X : Integrable (fun ω => exp (t * X ω)) μ)
(h_int_Y : Integrable (fun ω => exp (t * Y ω)) μ) :
@@ -296,7 +365,9 @@ theorem IndepFun.integrable_exp_mul_add {X Y : Ω → ℝ} (h_indep : IndepFun X
simp_rw [Pi.add_apply, mul_add, exp_add]
exact (h_indep.exp_mul t t).integrable_mul h_int_X h_int_Y
#align probability_theory.indep_fun.integrable_exp_mul_add ProbabilityTheory.IndepFun.integrable_exp_mul_add
+-/
+#print ProbabilityTheory.iIndepFun.integrable_exp_mul_sum /-
theorem iIndepFun.integrable_exp_mul_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
(h_indep : iIndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
{s : Finset ι} (h_int : ∀ i ∈ s, Integrable (fun ω => exp (t * X i ω)) μ) :
@@ -312,7 +383,9 @@ theorem iIndepFun.integrable_exp_mul_sum [IsProbabilityMeasure μ] {X : ι →
refine' indep_fun.integrable_exp_mul_add _ (h_int i (mem_insert_self _ _)) h_rec
exact (h_indep.indep_fun_finset_sum_of_not_mem h_meas hi_notin_s).symm
#align probability_theory.Indep_fun.integrable_exp_mul_sum ProbabilityTheory.iIndepFun.integrable_exp_mul_sum
+-/
+#print ProbabilityTheory.iIndepFun.mgf_sum /-
theorem iIndepFun.mgf_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
(h_indep : iIndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
(s : Finset ι) : mgf (∑ i in s, X i) μ t = ∏ i in s, mgf (X i) μ t := by
@@ -326,7 +399,9 @@ theorem iIndepFun.mgf_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
(ae_strongly_measurable_exp_mul_sum fun i hi => h_int' i),
h_rec, prod_insert hi_notin_s]
#align probability_theory.Indep_fun.mgf_sum ProbabilityTheory.iIndepFun.mgf_sum
+-/
+#print ProbabilityTheory.iIndepFun.cgf_sum /-
theorem iIndepFun.cgf_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
(h_indep : iIndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
{s : Finset ι} (h_int : ∀ i ∈ s, Integrable (fun ω => exp (t * X i ω)) μ) :
@@ -337,7 +412,9 @@ theorem iIndepFun.cgf_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
· rw [h_indep.mgf_sum h_meas]
· exact (mgf_pos (h_int j hj)).ne'
#align probability_theory.Indep_fun.cgf_sum ProbabilityTheory.iIndepFun.cgf_sum
+-/
+#print ProbabilityTheory.measure_ge_le_exp_mul_mgf /-
/-- **Chernoff bound** on the upper tail of a real random variable. -/
theorem measure_ge_le_exp_mul_mgf [IsFiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
(h_int : Integrable (fun ω => exp (t * X ω)) μ) :
@@ -363,7 +440,9 @@ theorem measure_ge_le_exp_mul_mgf [IsFiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
rwa [mul_comm (exp (t * ε))⁻¹, ← div_eq_mul_inv, le_div_iff' (exp_pos _)]
_ = exp (-t * ε) * mgf X μ t := by rw [neg_mul, exp_neg]; rfl
#align probability_theory.measure_ge_le_exp_mul_mgf ProbabilityTheory.measure_ge_le_exp_mul_mgf
+-/
+#print ProbabilityTheory.measure_le_le_exp_mul_mgf /-
/-- **Chernoff bound** on the lower tail of a real random variable. -/
theorem measure_le_le_exp_mul_mgf [IsFiniteMeasure μ] (ε : ℝ) (ht : t ≤ 0)
(h_int : Integrable (fun ω => exp (t * X ω)) μ) :
@@ -376,7 +455,9 @@ theorem measure_le_le_exp_mul_mgf [IsFiniteMeasure μ] (ε : ℝ) (ht : t ≤ 0)
· simp_rw [Pi.neg_apply, neg_mul_neg]
exact h_int
#align probability_theory.measure_le_le_exp_mul_mgf ProbabilityTheory.measure_le_le_exp_mul_mgf
+-/
+#print ProbabilityTheory.measure_ge_le_exp_cgf /-
/-- **Chernoff bound** on the upper tail of a real random variable. -/
theorem measure_ge_le_exp_cgf [IsFiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
(h_int : Integrable (fun ω => exp (t * X ω)) μ) :
@@ -386,7 +467,9 @@ theorem measure_ge_le_exp_cgf [IsFiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
rw [exp_add]
exact mul_le_mul le_rfl (le_exp_log _) mgf_nonneg (exp_pos _).le
#align probability_theory.measure_ge_le_exp_cgf ProbabilityTheory.measure_ge_le_exp_cgf
+-/
+#print ProbabilityTheory.measure_le_le_exp_cgf /-
/-- **Chernoff bound** on the lower tail of a real random variable. -/
theorem measure_le_le_exp_cgf [IsFiniteMeasure μ] (ε : ℝ) (ht : t ≤ 0)
(h_int : Integrable (fun ω => exp (t * X ω)) μ) :
@@ -396,6 +479,7 @@ theorem measure_le_le_exp_cgf [IsFiniteMeasure μ] (ε : ℝ) (ht : t ≤ 0)
rw [exp_add]
exact mul_le_mul le_rfl (le_exp_log _) mgf_nonneg (exp_pos _).le
#align probability_theory.measure_le_le_exp_cgf ProbabilityTheory.measure_le_le_exp_cgf
+-/
end MomentGeneratingFunction
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -50,8 +50,6 @@ namespace ProbabilityTheory
variable {Ω ι : Type _} {m : MeasurableSpace Ω} {X : Ω → ℝ} {p : ℕ} {μ : Measure Ω}
-include m
-
/-- Moment of a real random variable, `μ[X ^ p]`. -/
def moment (X : Ω → ℝ) (p : ℕ) (μ : Measure Ω) : ℝ :=
μ[X ^ p]
mathlib commit https://github.com/leanprover-community/mathlib/commit/a3e83f0fa4391c8740f7d773a7a9b74e311ae2a3
@@ -200,7 +200,7 @@ theorem mgf_nonneg : 0 ≤ mgf X μ t :=
theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) : 0 < mgf X μ t :=
by
simp_rw [mgf]
- have : (∫ x : Ω, exp (t * X x) ∂μ) = ∫ x : Ω in Set.univ, exp (t * X x) ∂μ := by
+ have : ∫ x : Ω, exp (t * X x) ∂μ = ∫ x : Ω in Set.univ, exp (t * X x) ∂μ := by
simp only [measure.restrict_univ]
rw [this, set_integral_pos_iff_support_of_nonneg_ae _ _]
· have h_eq_univ : (Function.support fun x : Ω => exp (t * X x)) = Set.univ :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/7e5137f579de09a059a5ce98f364a04e221aabf0
@@ -364,7 +364,6 @@ theorem measure_ge_le_exp_mul_mgf [IsFiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
mul_meas_ge_le_integral_of_nonneg (fun x => (exp_pos _).le) h_int _
rwa [mul_comm (exp (t * ε))⁻¹, ← div_eq_mul_inv, le_div_iff' (exp_pos _)]
_ = exp (-t * ε) * mgf X μ t := by rw [neg_mul, exp_neg]; rfl
-
#align probability_theory.measure_ge_le_exp_mul_mgf ProbabilityTheory.measure_ge_le_exp_mul_mgf
/-- **Chernoff bound** on the lower tail of a real random variable. -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -75,7 +75,7 @@ theorem centralMoment_zero (hp : p ≠ 0) : centralMoment 0 p μ = 0 := by
not_false_iff]
#align probability_theory.central_moment_zero ProbabilityTheory.centralMoment_zero
-theorem centralMoment_one' [FiniteMeasure μ] (h_int : Integrable X μ) :
+theorem centralMoment_one' [IsFiniteMeasure μ] (h_int : Integrable X μ) :
centralMoment X 1 μ = (1 - (μ Set.univ).toReal) * μ[X] :=
by
simp only [central_moment, Pi.sub_apply, pow_one]
@@ -84,7 +84,7 @@ theorem centralMoment_one' [FiniteMeasure μ] (h_int : Integrable X μ) :
#align probability_theory.central_moment_one' ProbabilityTheory.centralMoment_one'
@[simp]
-theorem centralMoment_one [ProbabilityMeasure μ] : centralMoment X 1 μ = 0 :=
+theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 :=
by
by_cases h_int : integrable X μ
· rw [central_moment_one' h_int]
@@ -99,7 +99,7 @@ theorem centralMoment_one [ProbabilityMeasure μ] : centralMoment X 1 μ = 0 :=
rw [integral_undef this]
#align probability_theory.central_moment_one ProbabilityTheory.centralMoment_one
-theorem centralMoment_two_eq_variance [FiniteMeasure μ] (hX : Memℒp X 2 μ) :
+theorem centralMoment_two_eq_variance [IsFiniteMeasure μ] (hX : Memℒp X 2 μ) :
centralMoment X 2 μ = variance X μ := by rw [hX.variance_eq]; rfl
#align probability_theory.central_moment_two_eq_variance ProbabilityTheory.centralMoment_two_eq_variance
@@ -142,12 +142,12 @@ theorem mgf_const' (c : ℝ) : mgf (fun _ => c) μ t = (μ Set.univ).toReal * ex
#align probability_theory.mgf_const' ProbabilityTheory.mgf_const'
@[simp]
-theorem mgf_const (c : ℝ) [ProbabilityMeasure μ] : mgf (fun _ => c) μ t = exp (t * c) := by
+theorem mgf_const (c : ℝ) [IsProbabilityMeasure μ] : mgf (fun _ => c) μ t = exp (t * c) := by
simp only [mgf_const', measure_univ, ENNReal.one_toReal, one_mul]
#align probability_theory.mgf_const ProbabilityTheory.mgf_const
@[simp]
-theorem cgf_const' [FiniteMeasure μ] (hμ : μ ≠ 0) (c : ℝ) :
+theorem cgf_const' [IsFiniteMeasure μ] (hμ : μ ≠ 0) (c : ℝ) :
cgf (fun _ => c) μ t = log (μ Set.univ).toReal + t * c :=
by
simp only [cgf, mgf_const']
@@ -158,7 +158,7 @@ theorem cgf_const' [FiniteMeasure μ] (hμ : μ ≠ 0) (c : ℝ) :
#align probability_theory.cgf_const' ProbabilityTheory.cgf_const'
@[simp]
-theorem cgf_const [ProbabilityMeasure μ] (c : ℝ) : cgf (fun _ => c) μ t = t * c := by
+theorem cgf_const [IsProbabilityMeasure μ] (c : ℝ) : cgf (fun _ => c) μ t = t * c := by
simp only [cgf, mgf_const, log_exp]
#align probability_theory.cgf_const ProbabilityTheory.cgf_const
@@ -168,7 +168,7 @@ theorem mgf_zero' : mgf X μ 0 = (μ Set.univ).toReal := by
#align probability_theory.mgf_zero' ProbabilityTheory.mgf_zero'
@[simp]
-theorem mgf_zero [ProbabilityMeasure μ] : mgf X μ 0 = 1 := by
+theorem mgf_zero [IsProbabilityMeasure μ] : mgf X μ 0 = 1 := by
simp only [mgf_zero', measure_univ, ENNReal.one_toReal]
#align probability_theory.mgf_zero ProbabilityTheory.mgf_zero
@@ -177,7 +177,7 @@ theorem cgf_zero' : cgf X μ 0 = log (μ Set.univ).toReal := by simp only [cgf,
#align probability_theory.cgf_zero' ProbabilityTheory.cgf_zero'
@[simp]
-theorem cgf_zero [ProbabilityMeasure μ] : cgf X μ 0 = 0 := by
+theorem cgf_zero [IsProbabilityMeasure μ] : cgf X μ 0 = 0 := by
simp only [cgf_zero', measure_univ, ENNReal.one_toReal, log_one]
#align probability_theory.cgf_zero ProbabilityTheory.cgf_zero
@@ -217,9 +217,9 @@ theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω
· rwa [integrable_on_univ]
#align probability_theory.mgf_pos' ProbabilityTheory.mgf_pos'
-theorem mgf_pos [ProbabilityMeasure μ] (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) :
+theorem mgf_pos [IsProbabilityMeasure μ] (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) :
0 < mgf X μ t :=
- mgf_pos' (ProbabilityMeasure.ne_zero μ) h_int_X
+ mgf_pos' (IsProbabilityMeasure.ne_zero μ) h_int_X
#align probability_theory.mgf_pos ProbabilityTheory.mgf_pos
theorem mgf_neg : mgf (-X) μ t = mgf X μ (-t) := by simp_rw [mgf, Pi.neg_apply, mul_neg, neg_mul]
@@ -229,26 +229,25 @@ theorem cgf_neg : cgf (-X) μ t = cgf X μ (-t) := by simp_rw [cgf, mgf_neg]
#align probability_theory.cgf_neg ProbabilityTheory.cgf_neg
/-- This is a trivial application of `indep_fun.comp` but it will come up frequently. -/
-theorem IndepFunCat.exp_mul {X Y : Ω → ℝ} (h_indep : IndepFunCat X Y μ) (s t : ℝ) :
- IndepFunCat (fun ω => exp (s * X ω)) (fun ω => exp (t * Y ω)) μ :=
+theorem IndepFun.exp_mul {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ) (s t : ℝ) :
+ IndepFun (fun ω => exp (s * X ω)) (fun ω => exp (t * Y ω)) μ :=
by
have h_meas : ∀ t, Measurable fun x => exp (t * x) := fun t => (measurable_id'.const_mul t).exp
change indep_fun ((fun x => exp (s * x)) ∘ X) ((fun x => exp (t * x)) ∘ Y) μ
exact indep_fun.comp h_indep (h_meas s) (h_meas t)
-#align probability_theory.indep_fun.exp_mul ProbabilityTheory.IndepFunCat.exp_mul
+#align probability_theory.indep_fun.exp_mul ProbabilityTheory.IndepFun.exp_mul
-theorem IndepFunCat.mgf_add {X Y : Ω → ℝ} (h_indep : IndepFunCat X Y μ)
+theorem IndepFun.mgf_add {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ)
(hX : AEStronglyMeasurable (fun ω => exp (t * X ω)) μ)
(hY : AEStronglyMeasurable (fun ω => exp (t * Y ω)) μ) :
mgf (X + Y) μ t = mgf X μ t * mgf Y μ t :=
by
simp_rw [mgf, Pi.add_apply, mul_add, exp_add]
exact (h_indep.exp_mul t t).integral_mul hX hY
-#align probability_theory.indep_fun.mgf_add ProbabilityTheory.IndepFunCat.mgf_add
+#align probability_theory.indep_fun.mgf_add ProbabilityTheory.IndepFun.mgf_add
-theorem IndepFunCat.mgf_add' {X Y : Ω → ℝ} (h_indep : IndepFunCat X Y μ)
- (hX : AEStronglyMeasurable X μ) (hY : AEStronglyMeasurable Y μ) :
- mgf (X + Y) μ t = mgf X μ t * mgf Y μ t :=
+theorem IndepFun.mgf_add' {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ) (hX : AEStronglyMeasurable X μ)
+ (hY : AEStronglyMeasurable Y μ) : mgf (X + Y) μ t = mgf X μ t * mgf Y μ t :=
by
have A : Continuous fun x : ℝ => exp (t * x) := by continuity
have h'X : ae_strongly_measurable (fun ω => exp (t * X ω)) μ :=
@@ -256,9 +255,9 @@ theorem IndepFunCat.mgf_add' {X Y : Ω → ℝ} (h_indep : IndepFunCat X Y μ)
have h'Y : ae_strongly_measurable (fun ω => exp (t * Y ω)) μ :=
A.ae_strongly_measurable.comp_ae_measurable hY.ae_measurable
exact h_indep.mgf_add h'X h'Y
-#align probability_theory.indep_fun.mgf_add' ProbabilityTheory.IndepFunCat.mgf_add'
+#align probability_theory.indep_fun.mgf_add' ProbabilityTheory.IndepFun.mgf_add'
-theorem IndepFunCat.cgf_add {X Y : Ω → ℝ} (h_indep : IndepFunCat X Y μ)
+theorem IndepFun.cgf_add {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ)
(h_int_X : Integrable (fun ω => exp (t * X ω)) μ)
(h_int_Y : Integrable (fun ω => exp (t * Y ω)) μ) : cgf (X + Y) μ t = cgf X μ t + cgf Y μ t :=
by
@@ -266,7 +265,7 @@ theorem IndepFunCat.cgf_add {X Y : Ω → ℝ} (h_indep : IndepFunCat X Y μ)
· simp [hμ]
simp only [cgf, h_indep.mgf_add h_int_X.ae_strongly_measurable h_int_Y.ae_strongly_measurable]
exact log_mul (mgf_pos' hμ h_int_X).ne' (mgf_pos' hμ h_int_Y).ne'
-#align probability_theory.indep_fun.cgf_add ProbabilityTheory.IndepFunCat.cgf_add
+#align probability_theory.indep_fun.cgf_add ProbabilityTheory.IndepFun.cgf_add
theorem aEStronglyMeasurable_exp_mul_add {X Y : Ω → ℝ}
(h_int_X : AEStronglyMeasurable (fun ω => exp (t * X ω)) μ)
@@ -281,57 +280,57 @@ theorem aEStronglyMeasurable_exp_mul_sum {X : ι → Ω → ℝ} {s : Finset ι}
(h_int : ∀ i ∈ s, AEStronglyMeasurable (fun ω => exp (t * X i ω)) μ) :
AEStronglyMeasurable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by
classical
- induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
- · simp only [Pi.zero_apply, sum_apply, sum_empty, MulZeroClass.mul_zero, exp_zero]
- exact ae_strongly_measurable_const
- · have : ∀ i : ι, i ∈ s → ae_strongly_measurable (fun ω : Ω => exp (t * X i ω)) μ := fun i hi =>
- h_int i (mem_insert_of_mem hi)
- specialize h_rec this
- rw [sum_insert hi_notin_s]
- apply ae_strongly_measurable_exp_mul_add (h_int i (mem_insert_self _ _)) h_rec
+ induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
+ · simp only [Pi.zero_apply, sum_apply, sum_empty, MulZeroClass.mul_zero, exp_zero]
+ exact ae_strongly_measurable_const
+ · have : ∀ i : ι, i ∈ s → ae_strongly_measurable (fun ω : Ω => exp (t * X i ω)) μ := fun i hi =>
+ h_int i (mem_insert_of_mem hi)
+ specialize h_rec this
+ rw [sum_insert hi_notin_s]
+ apply ae_strongly_measurable_exp_mul_add (h_int i (mem_insert_self _ _)) h_rec
#align probability_theory.ae_strongly_measurable_exp_mul_sum ProbabilityTheory.aEStronglyMeasurable_exp_mul_sum
-theorem IndepFunCat.integrable_exp_mul_add {X Y : Ω → ℝ} (h_indep : IndepFunCat X Y μ)
+theorem IndepFun.integrable_exp_mul_add {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ)
(h_int_X : Integrable (fun ω => exp (t * X ω)) μ)
(h_int_Y : Integrable (fun ω => exp (t * Y ω)) μ) :
Integrable (fun ω => exp (t * (X + Y) ω)) μ :=
by
simp_rw [Pi.add_apply, mul_add, exp_add]
exact (h_indep.exp_mul t t).integrable_mul h_int_X h_int_Y
-#align probability_theory.indep_fun.integrable_exp_mul_add ProbabilityTheory.IndepFunCat.integrable_exp_mul_add
+#align probability_theory.indep_fun.integrable_exp_mul_add ProbabilityTheory.IndepFun.integrable_exp_mul_add
-theorem IndepFun.integrable_exp_mul_sum [ProbabilityMeasure μ] {X : ι → Ω → ℝ}
- (h_indep : IndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
+theorem iIndepFun.integrable_exp_mul_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
+ (h_indep : iIndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
{s : Finset ι} (h_int : ∀ i ∈ s, Integrable (fun ω => exp (t * X i ω)) μ) :
Integrable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by
classical
- induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
- · simp only [Pi.zero_apply, sum_apply, sum_empty, MulZeroClass.mul_zero, exp_zero]
- exact integrable_const _
- · have : ∀ i : ι, i ∈ s → integrable (fun ω : Ω => exp (t * X i ω)) μ := fun i hi =>
- h_int i (mem_insert_of_mem hi)
- specialize h_rec this
- rw [sum_insert hi_notin_s]
- refine' indep_fun.integrable_exp_mul_add _ (h_int i (mem_insert_self _ _)) h_rec
- exact (h_indep.indep_fun_finset_sum_of_not_mem h_meas hi_notin_s).symm
-#align probability_theory.Indep_fun.integrable_exp_mul_sum ProbabilityTheory.IndepFun.integrable_exp_mul_sum
-
-theorem IndepFun.mgf_sum [ProbabilityMeasure μ] {X : ι → Ω → ℝ}
- (h_indep : IndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
+ induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
+ · simp only [Pi.zero_apply, sum_apply, sum_empty, MulZeroClass.mul_zero, exp_zero]
+ exact integrable_const _
+ · have : ∀ i : ι, i ∈ s → integrable (fun ω : Ω => exp (t * X i ω)) μ := fun i hi =>
+ h_int i (mem_insert_of_mem hi)
+ specialize h_rec this
+ rw [sum_insert hi_notin_s]
+ refine' indep_fun.integrable_exp_mul_add _ (h_int i (mem_insert_self _ _)) h_rec
+ exact (h_indep.indep_fun_finset_sum_of_not_mem h_meas hi_notin_s).symm
+#align probability_theory.Indep_fun.integrable_exp_mul_sum ProbabilityTheory.iIndepFun.integrable_exp_mul_sum
+
+theorem iIndepFun.mgf_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
+ (h_indep : iIndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
(s : Finset ι) : mgf (∑ i in s, X i) μ t = ∏ i in s, mgf (X i) μ t := by
classical
- induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
- · simp only [sum_empty, mgf_zero_fun, measure_univ, ENNReal.one_toReal, prod_empty]
- · have h_int' : ∀ i : ι, ae_strongly_measurable (fun ω : Ω => exp (t * X i ω)) μ := fun i =>
- ((h_meas i).const_mul t).exp.AEStronglyMeasurable
- rw [sum_insert hi_notin_s,
- indep_fun.mgf_add (h_indep.indep_fun_finset_sum_of_not_mem h_meas hi_notin_s).symm
- (h_int' i) (ae_strongly_measurable_exp_mul_sum fun i hi => h_int' i),
- h_rec, prod_insert hi_notin_s]
-#align probability_theory.Indep_fun.mgf_sum ProbabilityTheory.IndepFun.mgf_sum
-
-theorem IndepFun.cgf_sum [ProbabilityMeasure μ] {X : ι → Ω → ℝ}
- (h_indep : IndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
+ induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
+ · simp only [sum_empty, mgf_zero_fun, measure_univ, ENNReal.one_toReal, prod_empty]
+ · have h_int' : ∀ i : ι, ae_strongly_measurable (fun ω : Ω => exp (t * X i ω)) μ := fun i =>
+ ((h_meas i).const_mul t).exp.AEStronglyMeasurable
+ rw [sum_insert hi_notin_s,
+ indep_fun.mgf_add (h_indep.indep_fun_finset_sum_of_not_mem h_meas hi_notin_s).symm (h_int' i)
+ (ae_strongly_measurable_exp_mul_sum fun i hi => h_int' i),
+ h_rec, prod_insert hi_notin_s]
+#align probability_theory.Indep_fun.mgf_sum ProbabilityTheory.iIndepFun.mgf_sum
+
+theorem iIndepFun.cgf_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
+ (h_indep : iIndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
{s : Finset ι} (h_int : ∀ i ∈ s, Integrable (fun ω => exp (t * X i ω)) μ) :
cgf (∑ i in s, X i) μ t = ∑ i in s, cgf (X i) μ t :=
by
@@ -339,12 +338,12 @@ theorem IndepFun.cgf_sum [ProbabilityMeasure μ] {X : ι → Ω → ℝ}
rw [← log_prod _ _ fun j hj => _]
· rw [h_indep.mgf_sum h_meas]
· exact (mgf_pos (h_int j hj)).ne'
-#align probability_theory.Indep_fun.cgf_sum ProbabilityTheory.IndepFun.cgf_sum
+#align probability_theory.Indep_fun.cgf_sum ProbabilityTheory.iIndepFun.cgf_sum
/-- **Chernoff bound** on the upper tail of a real random variable. -/
-theorem measure_ge_le_exp_mul_mgf [FiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
+theorem measure_ge_le_exp_mul_mgf [IsFiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
(h_int : Integrable (fun ω => exp (t * X ω)) μ) :
- (μ { ω | ε ≤ X ω }).toReal ≤ exp (-t * ε) * mgf X μ t :=
+ (μ {ω | ε ≤ X ω}).toReal ≤ exp (-t * ε) * mgf X μ t :=
by
cases' ht.eq_or_lt with ht_zero_eq ht_pos
· rw [ht_zero_eq.symm]
@@ -352,7 +351,7 @@ theorem measure_ge_le_exp_mul_mgf [FiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
rw [ENNReal.toReal_le_toReal (measure_ne_top μ _) (measure_ne_top μ _)]
exact measure_mono (Set.subset_univ _)
calc
- (μ { ω | ε ≤ X ω }).toReal = (μ { ω | exp (t * ε) ≤ exp (t * X ω) }).toReal :=
+ (μ {ω | ε ≤ X ω}).toReal = (μ {ω | exp (t * ε) ≤ exp (t * X ω)}).toReal :=
by
congr with ω
simp only [exp_le_exp, eq_iff_iff]
@@ -361,7 +360,7 @@ theorem measure_ge_le_exp_mul_mgf [FiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
_ ≤ (exp (t * ε))⁻¹ * μ[fun ω => exp (t * X ω)] :=
by
have :
- exp (t * ε) * (μ { ω | exp (t * ε) ≤ exp (t * X ω) }).toReal ≤ μ[fun ω => exp (t * X ω)] :=
+ exp (t * ε) * (μ {ω | exp (t * ε) ≤ exp (t * X ω)}).toReal ≤ μ[fun ω => exp (t * X ω)] :=
mul_meas_ge_le_integral_of_nonneg (fun x => (exp_pos _).le) h_int _
rwa [mul_comm (exp (t * ε))⁻¹, ← div_eq_mul_inv, le_div_iff' (exp_pos _)]
_ = exp (-t * ε) * mgf X μ t := by rw [neg_mul, exp_neg]; rfl
@@ -369,9 +368,9 @@ theorem measure_ge_le_exp_mul_mgf [FiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
#align probability_theory.measure_ge_le_exp_mul_mgf ProbabilityTheory.measure_ge_le_exp_mul_mgf
/-- **Chernoff bound** on the lower tail of a real random variable. -/
-theorem measure_le_le_exp_mul_mgf [FiniteMeasure μ] (ε : ℝ) (ht : t ≤ 0)
+theorem measure_le_le_exp_mul_mgf [IsFiniteMeasure μ] (ε : ℝ) (ht : t ≤ 0)
(h_int : Integrable (fun ω => exp (t * X ω)) μ) :
- (μ { ω | X ω ≤ ε }).toReal ≤ exp (-t * ε) * mgf X μ t :=
+ (μ {ω | X ω ≤ ε}).toReal ≤ exp (-t * ε) * mgf X μ t :=
by
rw [← neg_neg t, ← mgf_neg, neg_neg, ← neg_mul_neg (-t)]
refine' Eq.trans_le _ (measure_ge_le_exp_mul_mgf (-ε) (neg_nonneg.mpr ht) _)
@@ -382,9 +381,9 @@ theorem measure_le_le_exp_mul_mgf [FiniteMeasure μ] (ε : ℝ) (ht : t ≤ 0)
#align probability_theory.measure_le_le_exp_mul_mgf ProbabilityTheory.measure_le_le_exp_mul_mgf
/-- **Chernoff bound** on the upper tail of a real random variable. -/
-theorem measure_ge_le_exp_cgf [FiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
+theorem measure_ge_le_exp_cgf [IsFiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
(h_int : Integrable (fun ω => exp (t * X ω)) μ) :
- (μ { ω | ε ≤ X ω }).toReal ≤ exp (-t * ε + cgf X μ t) :=
+ (μ {ω | ε ≤ X ω}).toReal ≤ exp (-t * ε + cgf X μ t) :=
by
refine' (measure_ge_le_exp_mul_mgf ε ht h_int).trans _
rw [exp_add]
@@ -392,9 +391,9 @@ theorem measure_ge_le_exp_cgf [FiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
#align probability_theory.measure_ge_le_exp_cgf ProbabilityTheory.measure_ge_le_exp_cgf
/-- **Chernoff bound** on the lower tail of a real random variable. -/
-theorem measure_le_le_exp_cgf [FiniteMeasure μ] (ε : ℝ) (ht : t ≤ 0)
+theorem measure_le_le_exp_cgf [IsFiniteMeasure μ] (ε : ℝ) (ht : t ≤ 0)
(h_int : Integrable (fun ω => exp (t * X ω)) μ) :
- (μ { ω | X ω ≤ ε }).toReal ≤ exp (-t * ε + cgf X μ t) :=
+ (μ {ω | X ω ≤ ε}).toReal ≤ exp (-t * ε + cgf X μ t) :=
by
refine' (measure_le_le_exp_mul_mgf ε ht h_int).trans _
rw [exp_add]
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -44,7 +44,7 @@ open MeasureTheory Filter Finset Real
noncomputable section
-open BigOperators MeasureTheory ProbabilityTheory ENNReal NNReal
+open scoped BigOperators MeasureTheory ProbabilityTheory ENNReal NNReal
namespace ProbabilityTheory
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -93,20 +93,14 @@ theorem centralMoment_one [ProbabilityMeasure μ] : centralMoment X 1 μ = 0 :=
have : ¬integrable (fun x => X x - integral μ X) μ :=
by
refine' fun h_sub => h_int _
- have h_add : X = (fun x => X x - integral μ X) + fun x => integral μ X :=
- by
- ext1 x
- simp
+ have h_add : X = (fun x => X x - integral μ X) + fun x => integral μ X := by ext1 x; simp
rw [h_add]
exact h_sub.add (integrable_const _)
rw [integral_undef this]
#align probability_theory.central_moment_one ProbabilityTheory.centralMoment_one
theorem centralMoment_two_eq_variance [FiniteMeasure μ] (hX : Memℒp X 2 μ) :
- centralMoment X 2 μ = variance X μ :=
- by
- rw [hX.variance_eq]
- rfl
+ centralMoment X 2 μ = variance X μ := by rw [hX.variance_eq]; rfl
#align probability_theory.central_moment_two_eq_variance ProbabilityTheory.centralMoment_two_eq_variance
section MomentGeneratingFunction
@@ -370,9 +364,7 @@ theorem measure_ge_le_exp_mul_mgf [FiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
exp (t * ε) * (μ { ω | exp (t * ε) ≤ exp (t * X ω) }).toReal ≤ μ[fun ω => exp (t * X ω)] :=
mul_meas_ge_le_integral_of_nonneg (fun x => (exp_pos _).le) h_int _
rwa [mul_comm (exp (t * ε))⁻¹, ← div_eq_mul_inv, le_div_iff' (exp_pos _)]
- _ = exp (-t * ε) * mgf X μ t := by
- rw [neg_mul, exp_neg]
- rfl
+ _ = exp (-t * ε) * mgf X μ t := by rw [neg_mul, exp_neg]; rfl
#align probability_theory.measure_ge_le_exp_mul_mgf ProbabilityTheory.measure_ge_le_exp_mul_mgf
mathlib commit https://github.com/leanprover-community/mathlib/commit/75e7fca56381d056096ce5d05e938f63a6567828
@@ -244,8 +244,8 @@ theorem IndepFunCat.exp_mul {X Y : Ω → ℝ} (h_indep : IndepFunCat X Y μ) (s
#align probability_theory.indep_fun.exp_mul ProbabilityTheory.IndepFunCat.exp_mul
theorem IndepFunCat.mgf_add {X Y : Ω → ℝ} (h_indep : IndepFunCat X Y μ)
- (hX : AeStronglyMeasurable (fun ω => exp (t * X ω)) μ)
- (hY : AeStronglyMeasurable (fun ω => exp (t * Y ω)) μ) :
+ (hX : AEStronglyMeasurable (fun ω => exp (t * X ω)) μ)
+ (hY : AEStronglyMeasurable (fun ω => exp (t * Y ω)) μ) :
mgf (X + Y) μ t = mgf X μ t * mgf Y μ t :=
by
simp_rw [mgf, Pi.add_apply, mul_add, exp_add]
@@ -253,7 +253,7 @@ theorem IndepFunCat.mgf_add {X Y : Ω → ℝ} (h_indep : IndepFunCat X Y μ)
#align probability_theory.indep_fun.mgf_add ProbabilityTheory.IndepFunCat.mgf_add
theorem IndepFunCat.mgf_add' {X Y : Ω → ℝ} (h_indep : IndepFunCat X Y μ)
- (hX : AeStronglyMeasurable X μ) (hY : AeStronglyMeasurable Y μ) :
+ (hX : AEStronglyMeasurable X μ) (hY : AEStronglyMeasurable Y μ) :
mgf (X + Y) μ t = mgf X μ t * mgf Y μ t :=
by
have A : Continuous fun x : ℝ => exp (t * x) := by continuity
@@ -274,18 +274,18 @@ theorem IndepFunCat.cgf_add {X Y : Ω → ℝ} (h_indep : IndepFunCat X Y μ)
exact log_mul (mgf_pos' hμ h_int_X).ne' (mgf_pos' hμ h_int_Y).ne'
#align probability_theory.indep_fun.cgf_add ProbabilityTheory.IndepFunCat.cgf_add
-theorem aeStronglyMeasurable_exp_mul_add {X Y : Ω → ℝ}
- (h_int_X : AeStronglyMeasurable (fun ω => exp (t * X ω)) μ)
- (h_int_Y : AeStronglyMeasurable (fun ω => exp (t * Y ω)) μ) :
- AeStronglyMeasurable (fun ω => exp (t * (X + Y) ω)) μ :=
+theorem aEStronglyMeasurable_exp_mul_add {X Y : Ω → ℝ}
+ (h_int_X : AEStronglyMeasurable (fun ω => exp (t * X ω)) μ)
+ (h_int_Y : AEStronglyMeasurable (fun ω => exp (t * Y ω)) μ) :
+ AEStronglyMeasurable (fun ω => exp (t * (X + Y) ω)) μ :=
by
simp_rw [Pi.add_apply, mul_add, exp_add]
exact ae_strongly_measurable.mul h_int_X h_int_Y
-#align probability_theory.ae_strongly_measurable_exp_mul_add ProbabilityTheory.aeStronglyMeasurable_exp_mul_add
+#align probability_theory.ae_strongly_measurable_exp_mul_add ProbabilityTheory.aEStronglyMeasurable_exp_mul_add
-theorem aeStronglyMeasurable_exp_mul_sum {X : ι → Ω → ℝ} {s : Finset ι}
- (h_int : ∀ i ∈ s, AeStronglyMeasurable (fun ω => exp (t * X i ω)) μ) :
- AeStronglyMeasurable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by
+theorem aEStronglyMeasurable_exp_mul_sum {X : ι → Ω → ℝ} {s : Finset ι}
+ (h_int : ∀ i ∈ s, AEStronglyMeasurable (fun ω => exp (t * X i ω)) μ) :
+ AEStronglyMeasurable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by
classical
induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
· simp only [Pi.zero_apply, sum_apply, sum_empty, MulZeroClass.mul_zero, exp_zero]
@@ -295,7 +295,7 @@ theorem aeStronglyMeasurable_exp_mul_sum {X : ι → Ω → ℝ} {s : Finset ι}
specialize h_rec this
rw [sum_insert hi_notin_s]
apply ae_strongly_measurable_exp_mul_add (h_int i (mem_insert_self _ _)) h_rec
-#align probability_theory.ae_strongly_measurable_exp_mul_sum ProbabilityTheory.aeStronglyMeasurable_exp_mul_sum
+#align probability_theory.ae_strongly_measurable_exp_mul_sum ProbabilityTheory.aEStronglyMeasurable_exp_mul_sum
theorem IndepFunCat.integrable_exp_mul_add {X Y : Ω → ℝ} (h_indep : IndepFunCat X Y μ)
(h_int_X : Integrable (fun ω => exp (t * X ω)) μ)
@@ -329,7 +329,7 @@ theorem IndepFun.mgf_sum [ProbabilityMeasure μ] {X : ι → Ω → ℝ}
induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
· simp only [sum_empty, mgf_zero_fun, measure_univ, ENNReal.one_toReal, prod_empty]
· have h_int' : ∀ i : ι, ae_strongly_measurable (fun ω : Ω => exp (t * X i ω)) μ := fun i =>
- ((h_meas i).const_mul t).exp.AeStronglyMeasurable
+ ((h_meas i).const_mul t).exp.AEStronglyMeasurable
rw [sum_insert hi_notin_s,
indep_fun.mgf_add (h_indep.indep_fun_finset_sum_of_not_mem h_meas hi_notin_s).symm
(h_int' i) (ae_strongly_measurable_exp_mul_sum fun i hi => h_int' i),
mathlib commit https://github.com/leanprover-community/mathlib/commit/d4437c68c8d350fc9d4e95e1e174409db35e30d7
@@ -75,7 +75,7 @@ theorem centralMoment_zero (hp : p ≠ 0) : centralMoment 0 p μ = 0 := by
not_false_iff]
#align probability_theory.central_moment_zero ProbabilityTheory.centralMoment_zero
-theorem centralMoment_one' [IsFiniteMeasure μ] (h_int : Integrable X μ) :
+theorem centralMoment_one' [FiniteMeasure μ] (h_int : Integrable X μ) :
centralMoment X 1 μ = (1 - (μ Set.univ).toReal) * μ[X] :=
by
simp only [central_moment, Pi.sub_apply, pow_one]
@@ -84,7 +84,7 @@ theorem centralMoment_one' [IsFiniteMeasure μ] (h_int : Integrable X μ) :
#align probability_theory.central_moment_one' ProbabilityTheory.centralMoment_one'
@[simp]
-theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 :=
+theorem centralMoment_one [ProbabilityMeasure μ] : centralMoment X 1 μ = 0 :=
by
by_cases h_int : integrable X μ
· rw [central_moment_one' h_int]
@@ -102,7 +102,7 @@ theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 :
rw [integral_undef this]
#align probability_theory.central_moment_one ProbabilityTheory.centralMoment_one
-theorem centralMoment_two_eq_variance [IsFiniteMeasure μ] (hX : Memℒp X 2 μ) :
+theorem centralMoment_two_eq_variance [FiniteMeasure μ] (hX : Memℒp X 2 μ) :
centralMoment X 2 μ = variance X μ :=
by
rw [hX.variance_eq]
@@ -148,12 +148,12 @@ theorem mgf_const' (c : ℝ) : mgf (fun _ => c) μ t = (μ Set.univ).toReal * ex
#align probability_theory.mgf_const' ProbabilityTheory.mgf_const'
@[simp]
-theorem mgf_const (c : ℝ) [IsProbabilityMeasure μ] : mgf (fun _ => c) μ t = exp (t * c) := by
+theorem mgf_const (c : ℝ) [ProbabilityMeasure μ] : mgf (fun _ => c) μ t = exp (t * c) := by
simp only [mgf_const', measure_univ, ENNReal.one_toReal, one_mul]
#align probability_theory.mgf_const ProbabilityTheory.mgf_const
@[simp]
-theorem cgf_const' [IsFiniteMeasure μ] (hμ : μ ≠ 0) (c : ℝ) :
+theorem cgf_const' [FiniteMeasure μ] (hμ : μ ≠ 0) (c : ℝ) :
cgf (fun _ => c) μ t = log (μ Set.univ).toReal + t * c :=
by
simp only [cgf, mgf_const']
@@ -164,7 +164,7 @@ theorem cgf_const' [IsFiniteMeasure μ] (hμ : μ ≠ 0) (c : ℝ) :
#align probability_theory.cgf_const' ProbabilityTheory.cgf_const'
@[simp]
-theorem cgf_const [IsProbabilityMeasure μ] (c : ℝ) : cgf (fun _ => c) μ t = t * c := by
+theorem cgf_const [ProbabilityMeasure μ] (c : ℝ) : cgf (fun _ => c) μ t = t * c := by
simp only [cgf, mgf_const, log_exp]
#align probability_theory.cgf_const ProbabilityTheory.cgf_const
@@ -174,7 +174,7 @@ theorem mgf_zero' : mgf X μ 0 = (μ Set.univ).toReal := by
#align probability_theory.mgf_zero' ProbabilityTheory.mgf_zero'
@[simp]
-theorem mgf_zero [IsProbabilityMeasure μ] : mgf X μ 0 = 1 := by
+theorem mgf_zero [ProbabilityMeasure μ] : mgf X μ 0 = 1 := by
simp only [mgf_zero', measure_univ, ENNReal.one_toReal]
#align probability_theory.mgf_zero ProbabilityTheory.mgf_zero
@@ -183,7 +183,7 @@ theorem cgf_zero' : cgf X μ 0 = log (μ Set.univ).toReal := by simp only [cgf,
#align probability_theory.cgf_zero' ProbabilityTheory.cgf_zero'
@[simp]
-theorem cgf_zero [IsProbabilityMeasure μ] : cgf X μ 0 = 0 := by
+theorem cgf_zero [ProbabilityMeasure μ] : cgf X μ 0 = 0 := by
simp only [cgf_zero', measure_univ, ENNReal.one_toReal, log_one]
#align probability_theory.cgf_zero ProbabilityTheory.cgf_zero
@@ -223,9 +223,9 @@ theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω
· rwa [integrable_on_univ]
#align probability_theory.mgf_pos' ProbabilityTheory.mgf_pos'
-theorem mgf_pos [IsProbabilityMeasure μ] (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) :
+theorem mgf_pos [ProbabilityMeasure μ] (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) :
0 < mgf X μ t :=
- mgf_pos' (IsProbabilityMeasure.ne_zero μ) h_int_X
+ mgf_pos' (ProbabilityMeasure.ne_zero μ) h_int_X
#align probability_theory.mgf_pos ProbabilityTheory.mgf_pos
theorem mgf_neg : mgf (-X) μ t = mgf X μ (-t) := by simp_rw [mgf, Pi.neg_apply, mul_neg, neg_mul]
@@ -306,7 +306,7 @@ theorem IndepFunCat.integrable_exp_mul_add {X Y : Ω → ℝ} (h_indep : IndepFu
exact (h_indep.exp_mul t t).integrable_mul h_int_X h_int_Y
#align probability_theory.indep_fun.integrable_exp_mul_add ProbabilityTheory.IndepFunCat.integrable_exp_mul_add
-theorem IndepFun.integrable_exp_mul_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
+theorem IndepFun.integrable_exp_mul_sum [ProbabilityMeasure μ] {X : ι → Ω → ℝ}
(h_indep : IndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
{s : Finset ι} (h_int : ∀ i ∈ s, Integrable (fun ω => exp (t * X i ω)) μ) :
Integrable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by
@@ -322,7 +322,7 @@ theorem IndepFun.integrable_exp_mul_sum [IsProbabilityMeasure μ] {X : ι → Ω
exact (h_indep.indep_fun_finset_sum_of_not_mem h_meas hi_notin_s).symm
#align probability_theory.Indep_fun.integrable_exp_mul_sum ProbabilityTheory.IndepFun.integrable_exp_mul_sum
-theorem IndepFun.mgf_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
+theorem IndepFun.mgf_sum [ProbabilityMeasure μ] {X : ι → Ω → ℝ}
(h_indep : IndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
(s : Finset ι) : mgf (∑ i in s, X i) μ t = ∏ i in s, mgf (X i) μ t := by
classical
@@ -336,7 +336,7 @@ theorem IndepFun.mgf_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
h_rec, prod_insert hi_notin_s]
#align probability_theory.Indep_fun.mgf_sum ProbabilityTheory.IndepFun.mgf_sum
-theorem IndepFun.cgf_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
+theorem IndepFun.cgf_sum [ProbabilityMeasure μ] {X : ι → Ω → ℝ}
(h_indep : IndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
{s : Finset ι} (h_int : ∀ i ∈ s, Integrable (fun ω => exp (t * X i ω)) μ) :
cgf (∑ i in s, X i) μ t = ∑ i in s, cgf (X i) μ t :=
@@ -348,7 +348,7 @@ theorem IndepFun.cgf_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
#align probability_theory.Indep_fun.cgf_sum ProbabilityTheory.IndepFun.cgf_sum
/-- **Chernoff bound** on the upper tail of a real random variable. -/
-theorem measure_ge_le_exp_mul_mgf [IsFiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
+theorem measure_ge_le_exp_mul_mgf [FiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
(h_int : Integrable (fun ω => exp (t * X ω)) μ) :
(μ { ω | ε ≤ X ω }).toReal ≤ exp (-t * ε) * mgf X μ t :=
by
@@ -377,7 +377,7 @@ theorem measure_ge_le_exp_mul_mgf [IsFiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
#align probability_theory.measure_ge_le_exp_mul_mgf ProbabilityTheory.measure_ge_le_exp_mul_mgf
/-- **Chernoff bound** on the lower tail of a real random variable. -/
-theorem measure_le_le_exp_mul_mgf [IsFiniteMeasure μ] (ε : ℝ) (ht : t ≤ 0)
+theorem measure_le_le_exp_mul_mgf [FiniteMeasure μ] (ε : ℝ) (ht : t ≤ 0)
(h_int : Integrable (fun ω => exp (t * X ω)) μ) :
(μ { ω | X ω ≤ ε }).toReal ≤ exp (-t * ε) * mgf X μ t :=
by
@@ -390,7 +390,7 @@ theorem measure_le_le_exp_mul_mgf [IsFiniteMeasure μ] (ε : ℝ) (ht : t ≤ 0)
#align probability_theory.measure_le_le_exp_mul_mgf ProbabilityTheory.measure_le_le_exp_mul_mgf
/-- **Chernoff bound** on the upper tail of a real random variable. -/
-theorem measure_ge_le_exp_cgf [IsFiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
+theorem measure_ge_le_exp_cgf [FiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
(h_int : Integrable (fun ω => exp (t * X ω)) μ) :
(μ { ω | ε ≤ X ω }).toReal ≤ exp (-t * ε + cgf X μ t) :=
by
@@ -400,7 +400,7 @@ theorem measure_ge_le_exp_cgf [IsFiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
#align probability_theory.measure_ge_le_exp_cgf ProbabilityTheory.measure_ge_le_exp_cgf
/-- **Chernoff bound** on the lower tail of a real random variable. -/
-theorem measure_le_le_exp_cgf [IsFiniteMeasure μ] (ε : ℝ) (ht : t ≤ 0)
+theorem measure_le_le_exp_cgf [FiniteMeasure μ] (ε : ℝ) (ht : t ≤ 0)
(h_int : Integrable (fun ω => exp (t * X ω)) μ) :
(μ { ω | X ω ≤ ε }).toReal ≤ exp (-t * ε + cgf X μ t) :=
by
mathlib commit https://github.com/leanprover-community/mathlib/commit/92c69b77c5a7dc0f7eeddb552508633305157caa
@@ -235,13 +235,13 @@ theorem cgf_neg : cgf (-X) μ t = cgf X μ (-t) := by simp_rw [cgf, mgf_neg]
#align probability_theory.cgf_neg ProbabilityTheory.cgf_neg
/-- This is a trivial application of `indep_fun.comp` but it will come up frequently. -/
-theorem IndepFunCat.expMul {X Y : Ω → ℝ} (h_indep : IndepFunCat X Y μ) (s t : ℝ) :
+theorem IndepFunCat.exp_mul {X Y : Ω → ℝ} (h_indep : IndepFunCat X Y μ) (s t : ℝ) :
IndepFunCat (fun ω => exp (s * X ω)) (fun ω => exp (t * Y ω)) μ :=
by
have h_meas : ∀ t, Measurable fun x => exp (t * x) := fun t => (measurable_id'.const_mul t).exp
change indep_fun ((fun x => exp (s * x)) ∘ X) ((fun x => exp (t * x)) ∘ Y) μ
exact indep_fun.comp h_indep (h_meas s) (h_meas t)
-#align probability_theory.indep_fun.exp_mul ProbabilityTheory.IndepFunCat.expMul
+#align probability_theory.indep_fun.exp_mul ProbabilityTheory.IndepFunCat.exp_mul
theorem IndepFunCat.mgf_add {X Y : Ω → ℝ} (h_indep : IndepFunCat X Y μ)
(hX : AeStronglyMeasurable (fun ω => exp (t * X ω)) μ)
@@ -274,16 +274,16 @@ theorem IndepFunCat.cgf_add {X Y : Ω → ℝ} (h_indep : IndepFunCat X Y μ)
exact log_mul (mgf_pos' hμ h_int_X).ne' (mgf_pos' hμ h_int_Y).ne'
#align probability_theory.indep_fun.cgf_add ProbabilityTheory.IndepFunCat.cgf_add
-theorem aeStronglyMeasurableExpMulAdd {X Y : Ω → ℝ}
+theorem aeStronglyMeasurable_exp_mul_add {X Y : Ω → ℝ}
(h_int_X : AeStronglyMeasurable (fun ω => exp (t * X ω)) μ)
(h_int_Y : AeStronglyMeasurable (fun ω => exp (t * Y ω)) μ) :
AeStronglyMeasurable (fun ω => exp (t * (X + Y) ω)) μ :=
by
simp_rw [Pi.add_apply, mul_add, exp_add]
exact ae_strongly_measurable.mul h_int_X h_int_Y
-#align probability_theory.ae_strongly_measurable_exp_mul_add ProbabilityTheory.aeStronglyMeasurableExpMulAdd
+#align probability_theory.ae_strongly_measurable_exp_mul_add ProbabilityTheory.aeStronglyMeasurable_exp_mul_add
-theorem aeStronglyMeasurableExpMulSum {X : ι → Ω → ℝ} {s : Finset ι}
+theorem aeStronglyMeasurable_exp_mul_sum {X : ι → Ω → ℝ} {s : Finset ι}
(h_int : ∀ i ∈ s, AeStronglyMeasurable (fun ω => exp (t * X i ω)) μ) :
AeStronglyMeasurable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by
classical
@@ -295,18 +295,18 @@ theorem aeStronglyMeasurableExpMulSum {X : ι → Ω → ℝ} {s : Finset ι}
specialize h_rec this
rw [sum_insert hi_notin_s]
apply ae_strongly_measurable_exp_mul_add (h_int i (mem_insert_self _ _)) h_rec
-#align probability_theory.ae_strongly_measurable_exp_mul_sum ProbabilityTheory.aeStronglyMeasurableExpMulSum
+#align probability_theory.ae_strongly_measurable_exp_mul_sum ProbabilityTheory.aeStronglyMeasurable_exp_mul_sum
-theorem IndepFunCat.integrableExpMulAdd {X Y : Ω → ℝ} (h_indep : IndepFunCat X Y μ)
+theorem IndepFunCat.integrable_exp_mul_add {X Y : Ω → ℝ} (h_indep : IndepFunCat X Y μ)
(h_int_X : Integrable (fun ω => exp (t * X ω)) μ)
(h_int_Y : Integrable (fun ω => exp (t * Y ω)) μ) :
Integrable (fun ω => exp (t * (X + Y) ω)) μ :=
by
simp_rw [Pi.add_apply, mul_add, exp_add]
- exact (h_indep.exp_mul t t).integrableMul h_int_X h_int_Y
-#align probability_theory.indep_fun.integrable_exp_mul_add ProbabilityTheory.IndepFunCat.integrableExpMulAdd
+ exact (h_indep.exp_mul t t).integrable_mul h_int_X h_int_Y
+#align probability_theory.indep_fun.integrable_exp_mul_add ProbabilityTheory.IndepFunCat.integrable_exp_mul_add
-theorem IndepFun.integrableExpMulSum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
+theorem IndepFun.integrable_exp_mul_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
(h_indep : IndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
{s : Finset ι} (h_int : ∀ i ∈ s, Integrable (fun ω => exp (t * X i ω)) μ) :
Integrable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by
@@ -320,7 +320,7 @@ theorem IndepFun.integrableExpMulSum [IsProbabilityMeasure μ] {X : ι → Ω
rw [sum_insert hi_notin_s]
refine' indep_fun.integrable_exp_mul_add _ (h_int i (mem_insert_self _ _)) h_rec
exact (h_indep.indep_fun_finset_sum_of_not_mem h_meas hi_notin_s).symm
-#align probability_theory.Indep_fun.integrable_exp_mul_sum ProbabilityTheory.IndepFun.integrableExpMulSum
+#align probability_theory.Indep_fun.integrable_exp_mul_sum ProbabilityTheory.IndepFun.integrable_exp_mul_sum
theorem IndepFun.mgf_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
(h_indep : IndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
mathlib commit https://github.com/leanprover-community/mathlib/commit/3180fab693e2cee3bff62675571264cb8778b212
@@ -65,13 +65,14 @@ def centralMoment (X : Ω → ℝ) (p : ℕ) (μ : Measure Ω) : ℝ :=
@[simp]
theorem moment_zero (hp : p ≠ 0) : moment 0 p μ = 0 := by
simp only [moment, hp, zero_pow', Ne.def, not_false_iff, Pi.zero_apply, integral_const,
- Algebra.id.smul_eq_mul, mul_zero]
+ Algebra.id.smul_eq_mul, MulZeroClass.mul_zero]
#align probability_theory.moment_zero ProbabilityTheory.moment_zero
@[simp]
theorem centralMoment_zero (hp : p ≠ 0) : centralMoment 0 p μ = 0 := by
- simp only [central_moment, hp, Pi.zero_apply, integral_const, Algebra.id.smul_eq_mul, mul_zero,
- zero_sub, Pi.pow_apply, Pi.neg_apply, neg_zero, zero_pow', Ne.def, not_false_iff]
+ simp only [central_moment, hp, Pi.zero_apply, integral_const, Algebra.id.smul_eq_mul,
+ MulZeroClass.mul_zero, zero_sub, Pi.pow_apply, Pi.neg_apply, neg_zero, zero_pow', Ne.def,
+ not_false_iff]
#align probability_theory.central_moment_zero ProbabilityTheory.centralMoment_zero
theorem centralMoment_one' [IsFiniteMeasure μ] (h_int : Integrable X μ) :
@@ -87,7 +88,7 @@ theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 :
by
by_cases h_int : integrable X μ
· rw [central_moment_one' h_int]
- simp only [measure_univ, ENNReal.one_toReal, sub_self, zero_mul]
+ simp only [measure_univ, ENNReal.one_toReal, sub_self, MulZeroClass.zero_mul]
· simp only [central_moment, Pi.sub_apply, pow_one]
have : ¬integrable (fun x => X x - integral μ X) μ :=
by
@@ -124,8 +125,8 @@ def cgf (X : Ω → ℝ) (μ : Measure Ω) (t : ℝ) : ℝ :=
@[simp]
theorem mgf_zero_fun : mgf 0 μ t = (μ Set.univ).toReal := by
- simp only [mgf, Pi.zero_apply, mul_zero, exp_zero, integral_const, Algebra.id.smul_eq_mul,
- mul_one]
+ simp only [mgf, Pi.zero_apply, MulZeroClass.mul_zero, exp_zero, integral_const,
+ Algebra.id.smul_eq_mul, mul_one]
#align probability_theory.mgf_zero_fun ProbabilityTheory.mgf_zero_fun
@[simp]
@@ -169,7 +170,7 @@ theorem cgf_const [IsProbabilityMeasure μ] (c : ℝ) : cgf (fun _ => c) μ t =
@[simp]
theorem mgf_zero' : mgf X μ 0 = (μ Set.univ).toReal := by
- simp only [mgf, zero_mul, exp_zero, integral_const, Algebra.id.smul_eq_mul, mul_one]
+ simp only [mgf, MulZeroClass.zero_mul, exp_zero, integral_const, Algebra.id.smul_eq_mul, mul_one]
#align probability_theory.mgf_zero' ProbabilityTheory.mgf_zero'
@[simp]
@@ -287,7 +288,7 @@ theorem aeStronglyMeasurableExpMulSum {X : ι → Ω → ℝ} {s : Finset ι}
AeStronglyMeasurable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by
classical
induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
- · simp only [Pi.zero_apply, sum_apply, sum_empty, mul_zero, exp_zero]
+ · simp only [Pi.zero_apply, sum_apply, sum_empty, MulZeroClass.mul_zero, exp_zero]
exact ae_strongly_measurable_const
· have : ∀ i : ι, i ∈ s → ae_strongly_measurable (fun ω : Ω => exp (t * X i ω)) μ := fun i hi =>
h_int i (mem_insert_of_mem hi)
@@ -311,7 +312,7 @@ theorem IndepFun.integrableExpMulSum [IsProbabilityMeasure μ] {X : ι → Ω
Integrable (fun ω => exp (t * (∑ i in s, X i) ω)) μ := by
classical
induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
- · simp only [Pi.zero_apply, sum_apply, sum_empty, mul_zero, exp_zero]
+ · simp only [Pi.zero_apply, sum_apply, sum_empty, MulZeroClass.mul_zero, exp_zero]
exact integrable_const _
· have : ∀ i : ι, i ∈ s → integrable (fun ω : Ω => exp (t * X i ω)) μ := fun i hi =>
h_int i (mem_insert_of_mem hi)
@@ -353,7 +354,7 @@ theorem measure_ge_le_exp_mul_mgf [IsFiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
by
cases' ht.eq_or_lt with ht_zero_eq ht_pos
· rw [ht_zero_eq.symm]
- simp only [neg_zero, zero_mul, exp_zero, mgf_zero', one_mul]
+ simp only [neg_zero, MulZeroClass.zero_mul, exp_zero, mgf_zero', one_mul]
rw [ENNReal.toReal_le_toReal (measure_ne_top μ _) (measure_ne_top μ _)]
exact measure_mono (Set.subset_univ _)
calc
mathlib commit https://github.com/leanprover-community/mathlib/commit/eb0cb4511aaef0da2462207b67358a0e1fe1e2ee
@@ -44,7 +44,7 @@ open MeasureTheory Filter Finset Real
noncomputable section
-open BigOperators MeasureTheory ProbabilityTheory Ennreal NNReal
+open BigOperators MeasureTheory ProbabilityTheory ENNReal NNReal
namespace ProbabilityTheory
@@ -87,7 +87,7 @@ theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 :
by
by_cases h_int : integrable X μ
· rw [central_moment_one' h_int]
- simp only [measure_univ, Ennreal.one_toReal, sub_self, zero_mul]
+ simp only [measure_univ, ENNReal.one_toReal, sub_self, zero_mul]
· simp only [central_moment, Pi.sub_apply, pow_one]
have : ¬integrable (fun x => X x - integral μ X) μ :=
by
@@ -148,7 +148,7 @@ theorem mgf_const' (c : ℝ) : mgf (fun _ => c) μ t = (μ Set.univ).toReal * ex
@[simp]
theorem mgf_const (c : ℝ) [IsProbabilityMeasure μ] : mgf (fun _ => c) μ t = exp (t * c) := by
- simp only [mgf_const', measure_univ, Ennreal.one_toReal, one_mul]
+ simp only [mgf_const', measure_univ, ENNReal.one_toReal, one_mul]
#align probability_theory.mgf_const ProbabilityTheory.mgf_const
@[simp]
@@ -158,7 +158,7 @@ theorem cgf_const' [IsFiniteMeasure μ] (hμ : μ ≠ 0) (c : ℝ) :
simp only [cgf, mgf_const']
rw [log_mul _ (exp_pos _).ne']
· rw [log_exp _]
- · rw [Ne.def, Ennreal.toReal_eq_zero_iff, measure.measure_univ_eq_zero]
+ · rw [Ne.def, ENNReal.toReal_eq_zero_iff, measure.measure_univ_eq_zero]
simp only [hμ, measure_ne_top μ Set.univ, or_self_iff, not_false_iff]
#align probability_theory.cgf_const' ProbabilityTheory.cgf_const'
@@ -174,7 +174,7 @@ theorem mgf_zero' : mgf X μ 0 = (μ Set.univ).toReal := by
@[simp]
theorem mgf_zero [IsProbabilityMeasure μ] : mgf X μ 0 = 1 := by
- simp only [mgf_zero', measure_univ, Ennreal.one_toReal]
+ simp only [mgf_zero', measure_univ, ENNReal.one_toReal]
#align probability_theory.mgf_zero ProbabilityTheory.mgf_zero
@[simp]
@@ -183,7 +183,7 @@ theorem cgf_zero' : cgf X μ 0 = log (μ Set.univ).toReal := by simp only [cgf,
@[simp]
theorem cgf_zero [IsProbabilityMeasure μ] : cgf X μ 0 = 0 := by
- simp only [cgf_zero', measure_univ, Ennreal.one_toReal, log_one]
+ simp only [cgf_zero', measure_univ, ENNReal.one_toReal, log_one]
#align probability_theory.cgf_zero ProbabilityTheory.cgf_zero
theorem mgf_undef (hX : ¬Integrable (fun ω => exp (t * X ω)) μ) : mgf X μ t = 0 := by
@@ -215,7 +215,7 @@ theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω
exact (exp_pos _).ne'
rw [h_eq_univ, Set.inter_univ _]
refine' Ne.bot_lt _
- simp only [hμ, Ennreal.bot_eq_zero, Ne.def, measure.measure_univ_eq_zero, not_false_iff]
+ simp only [hμ, ENNReal.bot_eq_zero, Ne.def, measure.measure_univ_eq_zero, not_false_iff]
· refine' eventually_of_forall fun x => _
rw [Pi.zero_apply]
exact (exp_pos _).le
@@ -326,7 +326,7 @@ theorem IndepFun.mgf_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
(s : Finset ι) : mgf (∑ i in s, X i) μ t = ∏ i in s, mgf (X i) μ t := by
classical
induction' s using Finset.induction_on with i s hi_notin_s h_rec h_int
- · simp only [sum_empty, mgf_zero_fun, measure_univ, Ennreal.one_toReal, prod_empty]
+ · simp only [sum_empty, mgf_zero_fun, measure_univ, ENNReal.one_toReal, prod_empty]
· have h_int' : ∀ i : ι, ae_strongly_measurable (fun ω : Ω => exp (t * X i ω)) μ := fun i =>
((h_meas i).const_mul t).exp.AeStronglyMeasurable
rw [sum_insert hi_notin_s,
@@ -354,7 +354,7 @@ theorem measure_ge_le_exp_mul_mgf [IsFiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
cases' ht.eq_or_lt with ht_zero_eq ht_pos
· rw [ht_zero_eq.symm]
simp only [neg_zero, zero_mul, exp_zero, mgf_zero', one_mul]
- rw [Ennreal.toReal_le_toReal (measure_ne_top μ _) (measure_ne_top μ _)]
+ rw [ENNReal.toReal_le_toReal (measure_ne_top μ _) (measure_ne_top μ _)]
exact measure_mono (Set.subset_univ _)
calc
(μ { ω | ε ≤ X ω }).toReal = (μ { ω | exp (t * ε) ≤ exp (t * X ω) }).toReal :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
Pi.mulSingle
(#12317)
Before this PR, the MonoidHom
version of Pi.mulSingle
was called MonoidHom.single
for brevity; but this is confusing when contrasted with MulHom.single
which is about Pi.single
.
After this PR, the name is MonoidHom.mulSingle
.
Also fix the name of Pi.single_div
since it is about Pi.mulSingle
(and we don't have the lemma that would be called Pi.single_div
).
@@ -61,7 +61,7 @@ def centralMoment (X : Ω → ℝ) (p : ℕ) (μ : Measure Ω) : ℝ := by
@[simp]
theorem moment_zero (hp : p ≠ 0) : moment 0 p μ = 0 := by
simp only [moment, hp, zero_pow, Ne, not_false_iff, Pi.zero_apply, integral_const,
- smul_eq_mul, mul_zero]
+ smul_eq_mul, mul_zero, integral_zero]
#align probability_theory.moment_zero ProbabilityTheory.moment_zero
@[simp]
set_integral
with setIntegral
(#12215)
Done with a global search and replace, and then (to fix the #align
lines), replace (#align \S*)setIntegral
with $1set_integral
.
@@ -188,7 +188,7 @@ theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω
simp_rw [mgf]
have : ∫ x : Ω, exp (t * X x) ∂μ = ∫ x : Ω in Set.univ, exp (t * X x) ∂μ := by
simp only [Measure.restrict_univ]
- rw [this, set_integral_pos_iff_support_of_nonneg_ae _ _]
+ rw [this, setIntegral_pos_iff_support_of_nonneg_ae _ _]
· have h_eq_univ : (Function.support fun x : Ω => exp (t * X x)) = Set.univ := by
ext1 x
simp only [Function.mem_support, Set.mem_univ, iff_true_iff]
@@ -60,14 +60,14 @@ def centralMoment (X : Ω → ℝ) (p : ℕ) (μ : Measure Ω) : ℝ := by
@[simp]
theorem moment_zero (hp : p ≠ 0) : moment 0 p μ = 0 := by
- simp only [moment, hp, zero_pow, Ne.def, not_false_iff, Pi.zero_apply, integral_const,
+ simp only [moment, hp, zero_pow, Ne, not_false_iff, Pi.zero_apply, integral_const,
smul_eq_mul, mul_zero]
#align probability_theory.moment_zero ProbabilityTheory.moment_zero
@[simp]
theorem centralMoment_zero (hp : p ≠ 0) : centralMoment 0 p μ = 0 := by
simp only [centralMoment, hp, Pi.zero_apply, integral_const, smul_eq_mul,
- mul_zero, zero_sub, Pi.pow_apply, Pi.neg_apply, neg_zero, zero_pow, Ne.def, not_false_iff]
+ mul_zero, zero_sub, Pi.pow_apply, Pi.neg_apply, neg_zero, zero_pow, Ne, not_false_iff]
#align probability_theory.central_moment_zero ProbabilityTheory.centralMoment_zero
theorem centralMoment_one' [IsFiniteMeasure μ] (h_int : Integrable X μ) :
@@ -143,7 +143,7 @@ theorem cgf_const' [IsFiniteMeasure μ] (hμ : μ ≠ 0) (c : ℝ) :
simp only [cgf, mgf_const']
rw [log_mul _ (exp_pos _).ne']
· rw [log_exp _]
- · rw [Ne.def, ENNReal.toReal_eq_zero_iff, Measure.measure_univ_eq_zero]
+ · rw [Ne, ENNReal.toReal_eq_zero_iff, Measure.measure_univ_eq_zero]
simp only [hμ, measure_ne_top μ Set.univ, or_self_iff, not_false_iff]
#align probability_theory.cgf_const' ProbabilityTheory.cgf_const'
@@ -195,7 +195,7 @@ theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω
exact (exp_pos _).ne'
rw [h_eq_univ, Set.inter_univ _]
refine' Ne.bot_lt _
- simp only [hμ, ENNReal.bot_eq_zero, Ne.def, Measure.measure_univ_eq_zero, not_false_iff]
+ simp only [hμ, ENNReal.bot_eq_zero, Ne, Measure.measure_univ_eq_zero, not_false_iff]
· filter_upwards with x
rw [Pi.zero_apply]
exact (exp_pos _).le
@@ -180,10 +180,7 @@ theorem cgf_undef (hX : ¬Integrable (fun ω => exp (t * X ω)) μ) : cgf X μ t
#align probability_theory.cgf_undef ProbabilityTheory.cgf_undef
theorem mgf_nonneg : 0 ≤ mgf X μ t := by
- refine' integral_nonneg _
- intro ω
- simp only [Pi.zero_apply]
- exact (exp_pos _).le
+ unfold mgf; positivity
#align probability_theory.mgf_nonneg ProbabilityTheory.mgf_nonneg
theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) :
filter_upwards
(#11208)
This is presumably not exhaustive, but covers about a hundred instances.
Style opinions (e.g., why a particular change is great/not a good idea) are very welcome; I'm still forming my own.
@@ -199,7 +199,7 @@ theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω
rw [h_eq_univ, Set.inter_univ _]
refine' Ne.bot_lt _
simp only [hμ, ENNReal.bot_eq_zero, Ne.def, Measure.measure_univ_eq_zero, not_false_iff]
- · refine' eventually_of_forall fun x => _
+ · filter_upwards with x
rw [Pi.zero_apply]
exact (exp_pos _).le
· rwa [integrableOn_univ]
f ^ n
(#9617)
This involves moving lemmas from Algebra.GroupPower.Ring
to Algebra.GroupWithZero.Basic
and changing some 0 < n
assumptions to n ≠ 0
.
From LeanAPAP
@@ -60,14 +60,14 @@ def centralMoment (X : Ω → ℝ) (p : ℕ) (μ : Measure Ω) : ℝ := by
@[simp]
theorem moment_zero (hp : p ≠ 0) : moment 0 p μ = 0 := by
- simp only [moment, hp, zero_pow', Ne.def, not_false_iff, Pi.zero_apply, integral_const,
+ simp only [moment, hp, zero_pow, Ne.def, not_false_iff, Pi.zero_apply, integral_const,
smul_eq_mul, mul_zero]
#align probability_theory.moment_zero ProbabilityTheory.moment_zero
@[simp]
theorem centralMoment_zero (hp : p ≠ 0) : centralMoment 0 p μ = 0 := by
simp only [centralMoment, hp, Pi.zero_apply, integral_const, smul_eq_mul,
- mul_zero, zero_sub, Pi.pow_apply, Pi.neg_apply, neg_zero, zero_pow', Ne.def, not_false_iff]
+ mul_zero, zero_sub, Pi.pow_apply, Pi.neg_apply, neg_zero, zero_pow, Ne.def, not_false_iff]
#align probability_theory.central_moment_zero ProbabilityTheory.centralMoment_zero
theorem centralMoment_one' [IsFiniteMeasure μ] (h_int : Integrable X μ) :
cases'
(#9171)
I literally went through and regex'd some uses of cases'
, replacing them with rcases
; this is meant to be a low effort PR as I hope that tools can do this in the future.
rcases
is an easier replacement than cases
, though with better tools we could in future do a second pass converting simple rcases
added here (and existing ones) to cases
.
@@ -329,7 +329,7 @@ set_option linter.uppercaseLean3 false in
theorem measure_ge_le_exp_mul_mgf [IsFiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
(h_int : Integrable (fun ω => exp (t * X ω)) μ) :
(μ {ω | ε ≤ X ω}).toReal ≤ exp (-t * ε) * mgf X μ t := by
- cases' ht.eq_or_lt with ht_zero_eq ht_pos
+ rcases ht.eq_or_lt with ht_zero_eq | ht_pos
· rw [ht_zero_eq.symm]
simp only [neg_zero, zero_mul, exp_zero, mgf_zero', one_mul]
rw [ENNReal.toReal_le_toReal (measure_ne_top μ _) (measure_ne_top μ _)]
MeasureTheory.mul_meas_ge_le_integral_of_nonneg
.[IsFiniteMeasure μ]
.0 ≤ᵐ[μ] f
instead of 0 ≤ f
.@@ -343,7 +343,7 @@ theorem measure_ge_le_exp_mul_mgf [IsFiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
_ ≤ (exp (t * ε))⁻¹ * μ[fun ω => exp (t * X ω)] := by
have : exp (t * ε) * (μ {ω | exp (t * ε) ≤ exp (t * X ω)}).toReal ≤
μ[fun ω => exp (t * X ω)] :=
- mul_meas_ge_le_integral_of_nonneg (fun x => (exp_pos _).le) h_int _
+ mul_meas_ge_le_integral_of_nonneg (ae_of_all _ fun x => (exp_pos _).le) h_int _
rwa [mul_comm (exp (t * ε))⁻¹, ← div_eq_mul_inv, le_div_iff' (exp_pos _)]
_ = exp (-t * ε) * mgf X μ t := by rw [neg_mul, exp_neg]; rfl
#align probability_theory.measure_ge_le_exp_mul_mgf ProbabilityTheory.measure_ge_le_exp_mul_mgf
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -45,7 +45,7 @@ open scoped BigOperators MeasureTheory ProbabilityTheory ENNReal NNReal
namespace ProbabilityTheory
-variable {Ω ι : Type _} {m : MeasurableSpace Ω} {X : Ω → ℝ} {p : ℕ} {μ : Measure Ω}
+variable {Ω ι : Type*} {m : MeasurableSpace Ω} {X : Ω → ℝ} {p : ℕ} {μ : Measure Ω}
/-- Moment of a real random variable, `μ[X ^ p]`. -/
def moment (X : Ω → ℝ) (p : ℕ) (μ : Measure Ω) : ℝ :=
@@ -2,14 +2,11 @@
Copyright (c) 2022 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-
-! This file was ported from Lean 3 source module probability.moments
-! leanprover-community/mathlib commit 85453a2a14be8da64caf15ca50930cf4c6e5d8de
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Probability.Variance
+#align_import probability.moments from "leanprover-community/mathlib"@"85453a2a14be8da64caf15ca50930cf4c6e5d8de"
+
/-!
# Moments and moment generating function
The unported dependencies are
algebra.order.module
init.core
linear_algebra.free_module.finite.rank
algebra.order.monoid.cancel.defs
algebra.abs
algebra.group_power.lemmas
init.data.list.basic
linear_algebra.free_module.rank
algebra.order.monoid.cancel.basic
init.data.list.default
topology.subset_properties
init.logic
The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file