Skip to content

feat(Probability): add mean and variance of Poisson distribution#37583

Open
huaizhangchu wants to merge 3 commits intoleanprover-community:masterfrom
huaizhangchu:poisson-mean-variance
Open

feat(Probability): add mean and variance of Poisson distribution#37583
huaizhangchu wants to merge 3 commits intoleanprover-community:masterfrom
huaizhangchu:poisson-mean-variance

Conversation

@huaizhangchu
Copy link
Copy Markdown
Contributor

This PR adds the mean and variance of the Poisson distribution over ℕ.

Main results

  • poissonMeasure_mean: the mean of poissonMeasure r equals r
  • poissonMeasure_moment_two: the second moment equals r² + r
  • poissonMeasure_variance: the variance equals r

Implementation notes

The moments are computed via descending factorial moments. We first prove hasSum lemmas for E[X] and E[X(X-1)], then obtain E[X²] = E[X(X-1)] + E[X] = r² + r, from which the variance follows.

Related lemmas

  • hasSum_poissonMeasure_nat: weighted sum for the mean
  • hasSum_poissonMeasure_descFactorial_two: weighted sum for the second descending factorial moment
  • hasSum_poissonMeasure_sq: weighted sum for the second moment
  • memLp_two_nat_poissonMeasure: integrability condition for variance

@github-actions github-actions bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Apr 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

Welcome new contributor!

Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests.

We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the awaiting-author tag, or another reason described in the Lifecycle of a PR. The review dashboard has a dedicated webpage which shows whether your PR is on the review queue, and (if not), why.

If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR.

Thank you again for joining our community.

@github-actions github-actions bot added the large-import Automatically added label for PRs with a significant increase in transitive imports label Apr 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

PR summary 5289bf289a

Import changes exceeding 2%

% File
+4.87% Mathlib.Probability.Distributions.Poisson.Basic

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Probability.Distributions.Poisson.Basic 2298 2410 +112 (+4.87%)
Import changes for all files
Files Import difference
Mathlib.Probability.Distributions.Poisson.PoissonLimitThm 37
Mathlib.Probability.Distributions.Poisson.Basic 112

Declarations diff

+ hasSum_poissonMeasure_descFactorial_two
+ hasSum_poissonMeasure_nat
+ hasSum_poissonMeasure_sq
+ lintegral_sq_nat_poissonMeasure
+ memLp_two_nat_poissonMeasure
+ poissonMeasure_mean
+ poissonMeasure_moment_two
+ poissonMeasure_variance

You can run this locally as follows
## summary with just the declaration names:
./scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions bot added the t-measure-probability Measure theory / Probability theory label Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

large-import Automatically added label for PRs with a significant increase in transitive imports new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-measure-probability Measure theory / Probability theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants