Skip to content

feat(Probability/Distance): add total variation distance tvDist#39164

Open
allenhaozhu wants to merge 3 commits into
leanprover-community:masterfrom
allenhaozhu:ltfp-add-tvDist
Open

feat(Probability/Distance): add total variation distance tvDist#39164
allenhaozhu wants to merge 3 commits into
leanprover-community:masterfrom
allenhaozhu:ltfp-add-tvDist

Conversation

@allenhaozhu
Copy link
Copy Markdown

@allenhaozhu allenhaozhu commented May 11, 2026

Add MeasureTheory.tvDist : Measure α → Measure α → ℝ≥0∞, the total variation distance between two measures, defined via the truncated subtraction μ - ν already in Mathlib.MeasureTheory.Measure.Sub. Add four basic lemmas (tvDist_self, tvDist_comm, tvDist_nonneg, tvDist_le_one) and a bridge lemma tvDist_eq_signedMeasure_totalVariation connecting tvDist to the existing MeasureTheory.SignedMeasure.totalVariation for finite measures.


AI-assistance disclosure

Per the Mathlib AI-use policy:

  • Tool. Claude Code (Anthropic) with the Claude Sonnet 4.6 model.
  • Use. I specified the target lemma statements and the proof strategy; the assistant drafted Lean 4 tactic combinations against current Mathlib. I iterated on the proofs, verified each lemma builds under lake build from a clean checkout, and read the final code.
  • Vouching. I have read every declaration in this file and can defend the proofs without further AI assistance. I welcome reviewer feedback on naming, namespace placement, and stylistic alignment with the surrounding Mathlib modules.

@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 May 11, 2026
@github-actions
Copy link
Copy Markdown

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 t-measure-probability Measure theory / Probability theory label May 11, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 11, 2026

PR summary 43a9b846af

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Probability.Distance.TotalVariation (new file) 2325

Declarations diff

+ tvDist
+ tvDist_comm
+ tvDist_eq_signedMeasure_totalVariation
+ tvDist_le_one
+ tvDist_nonneg
+ tvDist_self

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

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

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.


No changes to strong technical debt.
No changes to weak technical debt.

@allenhaozhu allenhaozhu marked this pull request as ready for review May 11, 2026 08:43
@grunweg grunweg added LLM-generated PRs with substantial input from LLMs - review accordingly awaiting-author A reviewer has asked the author a question or requested changes. labels May 11, 2026
@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented May 11, 2026

Hello from the triage team! Can you format your PR description according to mathlib's standards (as described here), please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author A reviewer has asked the author a question or requested changes. LLM-generated PRs with substantial input from LLMs - review accordingly 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.

2 participants