feat(InformationTheory/Coding): add Kraft inequality for prefix-free codes - #42584
feat(InformationTheory/Coding): add Kraft inequality for prefix-free codes#42584elazarg wants to merge 6 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 fd95666751Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
| Current number | Change | Type (weak) |
|---|---|---|
| 5051 | 2 | exposed public sections |
Current commit fd95666751
Reference commit 639923353f
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
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
Co-authored-by: Weiyi Wang <wwylele@gmail.com>
wwylele
left a comment
There was a problem hiding this comment.
Mostly looks good to me
This PR defines prefix-free codes and, over a finite, nonempty alphabet, proves Kraft's inequality for finite and arbitrary prefix-free codes. It is a direct continuation of #34108, which introduced uniquely decodable codes and the Kraft–McMillan inequality.
The results live in the
InformationTheorynamespace underInformationTheory/Coding.Main definitions
InformationTheory.PrefixFree: a set of codewords is prefix-free if two codewords in the set cannot be distinct when one is a prefix of the other.Main results
InformationTheory.PrefixFree.uniquelyDecodable: a prefix-free code not containing the empty word is uniquely decodable.InformationTheory.PrefixFree.uniquelyDecodable_of_nontrivial: every nontrivial prefix-free code is uniquely decodable.InformationTheory.kraft_inequality: the Kraft sum of a finite prefix-free code is at most one.InformationTheory.summable_kraft_sum: the Kraft series of an arbitrary prefix-free code is summable.InformationTheory.kraft_inequality_infinite: the Kraft sum of an arbitrary prefix-free code is at most one.This is another part of https://github.com/elazarg/kraft. Comments about next items are welcome.