feat(InformationTheory/KullbackLeibler): finite Kullback-Leibler divergence - #43104
feat(InformationTheory/KullbackLeibler): finite Kullback-Leibler divergence#43104elazarg wants to merge 9 commits into
Conversation
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 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. |
PR summary c258e30e24Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
|
Since the linked GitHub repo mentions significant AI use, you should comment |
I am using LLMs (of course) but I'm signing every term and every word here (and an earlier version has underwent an independent human review). LLMs are a source of discovery/review, not the source of confidence that the definitions are correct. So the question is what does |
|
It means that the code was written with substantial input by an LLM, as indicated under the label. Even long time contributors who carefully reviewed every line of their code written by an LLM tag the PR with the label, this is meant as an information to reviewers as LLMs are more prone to certain errors. In any case, you should always mention LLM involvement in the PR description as per the AI policy. |
|
|
|
I think it would be much better to use InformationTheory.klDiv directly, and adding some API for it and for sums of Dirac measures when needed, maybe introducing a |
c71cc8b to
00e9b47
Compare
|
@EtienneC30 Done. The proofs work and look good to me (and mostly straightforward), and the |
Add finite-sum formulas for
InformationTheory.klDivon finite measurable spaces, including equal-mass and probability-measure specializations and formulas for sums of weighted Dirac measures. Provide bothℝ≥0∞-valued andtoRealversions.Supporting API includes a formula for the Radon–Nikodym derivative at points of nonzero reference-measure mass, a finite-sum formula for the integral of the log-likelihood ratio, and singleton-mass and absolute-continuity lemmas for sums of weighted Dirac measures.
Continuing #42584, another part of https://github.com/elazarg/kraft.
Following review, this uses the existing
klDivinstead of introducingklDivFin. ThetoRealformulas connect it to real-valued sums in downstream code.For measures of unequal mass, the formulas retain the correction term
ν.real univ - μ.real univ.The KL formulas are in
KullbackLeibler/Basic.lean; the supporting lemmas are in the corresponding measure-theory modules.