Skip to content

feat(MeasureTheory): define Hellinger affinity#41517

Open
sadasant wants to merge 4 commits into
leanprover-community:masterfrom
idolum-ai:hellinger-affinity
Open

feat(MeasureTheory): define Hellinger affinity#41517
sadasant wants to merge 4 commits into
leanprover-community:masterfrom
idolum-ai:hellinger-affinity

Conversation

@sadasant

@sadasant sadasant commented Jul 8, 2026

Copy link
Copy Markdown

Define the Hellinger affinity (Bhattacharyya coefficient) of two measures as an ENNReal-valued lintegral against the canonical dominating measure μ + ν, making the definition total with no absolute-continuity or integrability side conditions. Provide symmetry, invariance under the choice of sigma-finite dominating measure, the self-affinity of a probability measure, the rnDeriv and withDensity computation rules, the bound ≤ 1 for probability measures (via Hölder with p = q = 2), and the characterization that the affinity vanishes iff the measures are mutually singular. Groundwork for a formalization of Kakutani's dichotomy (1948) for infinite products of probability measures.


Design notes.

On the value type ("why not / ℝ≥0 / EReal"): the ℝ≥0∞-valued lintegral against μ + ν makes the affinity total, which is what makes the singular direction of Kakutani's dichotomy (planned follow-up PRs) case-split-free — hellingerAffinity_eq_zero_iff already characterizes mutual singularity with no absolute-continuity hypothesis. InformationTheory.klDiv sets the precedent of an ℝ≥0∞-valued, standalone divergence-like quantity. The invariance lemma hellingerAffinity_eq_lintegral_rnDeriv_mul_rnDeriv recovers the textbook ∫ √(dμ/dρ · dν/dρ) dρ for any σ-finite dominating ρ.

Relation to f-divergences (CC @RemyDegenne for coordination with the planned fDiv upstreaming from TestingLowerBounds): the affinity is the f-integral at f = √·, equivalently 1 − the Hellinger-½ divergence, with H²(μ,ν)/2 = 1 − affinity. Rather than block on an unlanded framework, this PR keeps the affinity standalone (the klDiv pattern); when fDiv lands, a single bridging lemma of the shape fDiv hellingerFun μ ν = 1 - hellingerAffinity μ ν reconciles them, and I am happy to contribute it. Also happy to move the file to Mathlib/InformationTheory/ if reviewers prefer that home over Mathlib/MeasureTheory/Measure/.

Roadmap. This is PR 1 of a planned sequence building toward Kakutani's dichotomy for Measure.infinitePi over an arbitrary index type (stronger than the textbook countable statement): the lintegral product Fubini and Measure.pi_withDensity, the infinite-product/summability bridges, then the singular and absolutely-continuous directions and the packaged dichotomy. Natural follow-up API for this file, available on request: hellingerAffinity_pos_iff, monotonicity in each argument, and the relation to the squared Hellinger distance once a distance exists.

Attribution and AI disclosure. This material was developed in the public riemann-venue repository by Daniel Rodriguez in collaboration with Claude Fable 5 (Anthropic), as part of a machine-checked formalization of Kakutani's dichotomy (1948) for infinite products of probability measures. The definitions, proofs, and the drafting of this description were done with Claude Fable 5 via Claude Code, working from a design and statement plan reviewed by the human author; all proofs are checked by Lean (#print axioms on the main results reports only propext, Classical.choice, Quot.sound), and the human author reviewed the final form, takes responsibility for it, and will answer all review comments personally. I am applying the LLM-generated label per the contribution guidelines.

Define the Hellinger affinity (Bhattacharyya coefficient) of two measures
as an ENNReal-valued lintegral against the canonical dominating measure
mu + nu, making the definition total with no absolute-continuity or
integrability side conditions. Provide symmetry, invariance under the
choice of sigma-finite dominating measure, the self-affinity of a
probability measure, the rnDeriv and withDensity computation rules, the
bound <= 1 for probability measures (via Holder with p = q = 2), and the
characterization that the affinity vanishes iff the measures are mutually
singular. Groundwork for a formalization of Kakutani's dichotomy (1948)
for infinite products of probability measures.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@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 Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

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 Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

PR summary 029c16d920

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.MeasureTheory.Measure.Hellinger (new file) 2353

Declarations diff (regex)

+ hellingerAffinity
+ hellingerAffinity_comm
+ hellingerAffinity_eq_lintegral_rnDeriv
+ hellingerAffinity_eq_lintegral_rnDeriv_mul_rnDeriv
+ hellingerAffinity_eq_zero_iff
+ hellingerAffinity_le_one
+ hellingerAffinity_self
+ hellingerAffinity_withDensity
+ mul_self_rpow_half

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.

Declarations diff (Lean)

Lean-aware diff — post-build, computed from the Lean environment (commit 029c16d).

  • +8 new declarations
  • −0 removed declarations
+MeasureTheory.Measure.hellingerAffinity
+MeasureTheory.Measure.hellingerAffinity_comm
+MeasureTheory.Measure.hellingerAffinity_eq_lintegral_rnDeriv
+MeasureTheory.Measure.hellingerAffinity_eq_lintegral_rnDeriv_mul_rnDeriv
+MeasureTheory.Measure.hellingerAffinity_eq_zero_iff
+MeasureTheory.Measure.hellingerAffinity_le_one
+MeasureTheory.Measure.hellingerAffinity_self
+MeasureTheory.Measure.hellingerAffinity_withDensity

No changes to strong technical debt.

Increase in weak tech debt: (relative, absolute) = (1.00, 0.00)
Current number Change Type (weak)
5008 1 exposed public sections

Current commit 029c16d920
Reference commit d45663d02f

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/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 commented Jul 8, 2026

Copy link
Copy Markdown

✅ PR Title Formatted Correctly

The title of this PR has been updated to match our commit style conventions.
Thank you!

@sadasant

sadasant commented Jul 8, 2026

Copy link
Copy Markdown
Author

LLM-generated

@github-actions github-actions Bot added the LLM-generated PRs with substantial input from LLMs - review accordingly label Jul 8, 2026
@sadasant sadasant changed the title feat(MeasureTheory): Hellinger affinity of a pair of measures feat(MeasureTheory): define Hellinger affinity Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

1 participant