Skip to content

[Merged by Bors] - feat: Binary entropy - #9734

Closed
adomasbaliuka wants to merge 145 commits into
masterfrom
adomas_binary_entropy
Closed

adomasbaliuka wants to merge 145 commits into
masterfrom
adomas_binary_entropy

Conversation

@adomasbaliuka

@adomasbaliuka adomasbaliuka commented Jan 14, 2024 •

Copy link
Copy Markdown
Collaborator

Define the (Shannon) binary and q-ary entropy functions.

The binary entropy function is used in information theory; for example, in Shannon's theorems.


The lemmas are mostly "trivial", especially using Mathlib.Analysis.SpecialFunctions.Log.NegMulLog.
This is the kind of application that NegMulLog was made for.

If Mathlib is to include Shannon's theorems in the future (already formalized in Coq), this might hopefully save someone a few minutes.

Open in Gitpod

@adomasbaliuka adomasbaliuka added help-wanted The author needs attention to resolve issues WIP Work in progress new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! labels Jan 14, 2024
@adomasbaliuka
adomasbaliuka marked this pull request as draft January 14, 2024 02:25
@iczelia

iczelia commented Jan 14, 2024

Copy link
Copy Markdown
Contributor

Shouldn't binary entropy be put under InformationTheory? Why not use capital H_2 for the function's name?

@adomasbaliuka

adomasbaliuka commented Jan 14, 2024 •

Copy link
Copy Markdown
Collaborator Author

@kspalaiologos Thanks for the comment! I moved it to InformationTheory. For the name, did you mean to use H₂ or H_2? The danger is that it might be confused with Rényi entropy (collision entropy), which is written H₂.

@adomasbaliuka
adomasbaliuka marked this pull request as ready for review January 23, 2024 00:16
@YaelDillies

Copy link
Copy Markdown
Contributor

@b-mehta and I have material about the binary entropy function. We needed it a year ago in the context of the progress on the Frankl set family conjecture. I suggest we wait for Bhavik to provide the code to compare.

@b-mehta

b-mehta commented Feb 14, 2024

Copy link
Copy Markdown
Contributor

Yes, I developed that further since this function is fundamental to my Ramsey proof. I will make a detailed comparison in the next day or two.

@YaelDillies

Copy link
Copy Markdown
Contributor

There were still too many small things to fix for the review to converge quickly, so I took the freedom to clean things up myself. Your PR now depends on two small prerequisite PRs.

@ghost ghost added blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) and removed blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) labels Aug 15, 2024
@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 15, 2024
@github-actions

This comment was marked as outdated.

@YaelDillies YaelDillies left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now looks good enough to me

maintainer merge

@github-actions

This comment was marked as outdated.

@github-actions

Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by YaelDillies.

@github-actions github-actions Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Aug 15, 2024
@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 15, 2024
@github-actions

Copy link
Copy Markdown

PR summary 1c7ad929c6

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Analysis.SpecialFunctions.BinaryEntropy 1634

Declarations diff

+ Continuous.mul_log
+ binEntropy
+ binEntropy_continuous
+ binEntropy_eq_log_two
+ binEntropy_eq_negMulLog_add_negMulLog_one_sub
+ binEntropy_eq_negMulLog_add_negMulLog_one_sub'
+ binEntropy_eq_zero
+ binEntropy_le_log_two
+ binEntropy_lt_log_two
+ binEntropy_neg_of_neg
+ binEntropy_neg_of_one_lt
+ binEntropy_nonneg
+ binEntropy_nonpos_of_nonpos
+ binEntropy_nonpos_of_one_le
+ binEntropy_one
+ binEntropy_one_sub
+ binEntropy_pos
+ binEntropy_strictAntiOn
+ binEntropy_strictMonoOn
+ binEntropy_two_inv
+ binEntropy_two_inv_add
+ binEntropy_zero
+ deriv2_binEntropy
+ deriv2_qaryEntropy
+ deriv_binEntropy
+ deriv_qaryEntropy
+ differentiableAt_binEntropy
+ differentiableAt_binEntropy_iff_ne_zero_one
+ differentiableAt_qaryEntropy
+ hasDerivAt_binEntropy
+ hasDerivAt_qaryEntropy
+ inv_div_comm
+ not_continuousAt_deriv_qaryEntropy_one
+ not_continuousAt_deriv_qaryEntropy_zero
+ qaryEntropy
+ qaryEntropy_continuous
+ qaryEntropy_neg_of_neg
+ qaryEntropy_nonneg
+ qaryEntropy_nonpos_of_nonpos
+ qaryEntropy_one
+ qaryEntropy_pos
+ qaryEntropy_strictAntiOn
+ qaryEntropy_strictMonoOn
+ qaryEntropy_two
+ qaryEntropy_zero
+ strictConcaveOn_qaryEntropy
+ strictConcave_binEntropy
+ ⟨_,

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

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

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

@github-actions

Copy link
Copy Markdown

PR summary a50c9f14e1

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Analysis.SpecialFunctions.BinaryEntropy 1635

Declarations diff

+ Continuous.mul_log
+ binEntropy
+ binEntropy_continuous
+ binEntropy_eq_log_two
+ binEntropy_eq_negMulLog_add_negMulLog_one_sub
+ binEntropy_eq_negMulLog_add_negMulLog_one_sub'
+ binEntropy_eq_zero
+ binEntropy_le_log_two
+ binEntropy_lt_log_two
+ binEntropy_neg_of_neg
+ binEntropy_neg_of_one_lt
+ binEntropy_nonneg
+ binEntropy_nonpos_of_nonpos
+ binEntropy_nonpos_of_one_le
+ binEntropy_one
+ binEntropy_one_sub
+ binEntropy_pos
+ binEntropy_strictAntiOn
+ binEntropy_strictMonoOn
+ binEntropy_two_inv
+ binEntropy_two_inv_add
+ binEntropy_zero
+ deriv2_binEntropy
+ deriv2_qaryEntropy
+ deriv_binEntropy
+ deriv_qaryEntropy
+ differentiableAt_binEntropy
+ differentiableAt_binEntropy_iff_ne_zero_one
+ differentiableAt_qaryEntropy
+ hasDerivAt_binEntropy
+ hasDerivAt_qaryEntropy
+ inv_div_comm
+ not_continuousAt_deriv_qaryEntropy_one
+ not_continuousAt_deriv_qaryEntropy_zero
+ qaryEntropy
+ qaryEntropy_continuous
+ qaryEntropy_neg_of_neg
+ qaryEntropy_nonneg
+ qaryEntropy_nonpos_of_nonpos
+ qaryEntropy_one
+ qaryEntropy_pos
+ qaryEntropy_strictAntiOn
+ qaryEntropy_strictMonoOn
+ qaryEntropy_two
+ qaryEntropy_zero
+ strictConcaveOn_qaryEntropy
+ strictConcave_binEntropy
+ ⟨_,

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

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

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

@github-actions

Copy link
Copy Markdown

PR summary ef058a9609

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Analysis.SpecialFunctions.BinaryEntropy 1638

Declarations diff

+ Continuous.mul_log
+ binEntropy
+ binEntropy_continuous
+ binEntropy_eq_log_two
+ binEntropy_eq_negMulLog_add_negMulLog_one_sub
+ binEntropy_eq_negMulLog_add_negMulLog_one_sub'
+ binEntropy_eq_zero
+ binEntropy_le_log_two
+ binEntropy_lt_log_two
+ binEntropy_neg_of_neg
+ binEntropy_neg_of_one_lt
+ binEntropy_nonneg
+ binEntropy_nonpos_of_nonpos
+ binEntropy_nonpos_of_one_le
+ binEntropy_one
+ binEntropy_one_sub
+ binEntropy_pos
+ binEntropy_strictAntiOn
+ binEntropy_strictMonoOn
+ binEntropy_two_inv
+ binEntropy_two_inv_add
+ binEntropy_zero
+ deriv2_binEntropy
+ deriv2_qaryEntropy
+ deriv_binEntropy
+ deriv_qaryEntropy
+ differentiableAt_binEntropy
+ differentiableAt_binEntropy_iff_ne_zero_one
+ differentiableAt_qaryEntropy
+ hasDerivAt_binEntropy
+ hasDerivAt_qaryEntropy
+ inv_div_comm
+ not_continuousAt_deriv_qaryEntropy_one
+ not_continuousAt_deriv_qaryEntropy_zero
+ qaryEntropy
+ qaryEntropy_continuous
+ qaryEntropy_neg_of_neg
+ qaryEntropy_nonneg
+ qaryEntropy_nonpos_of_nonpos
+ qaryEntropy_one
+ qaryEntropy_pos
+ qaryEntropy_strictAntiOn
+ qaryEntropy_strictMonoOn
+ qaryEntropy_two
+ qaryEntropy_zero
+ strictConcaveOn_qaryEntropy
+ strictConcave_binEntropy
+ ⟨_,

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

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

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

@dupuisf

dupuisf commented Aug 18, 2024

Copy link
Copy Markdown
Contributor

Alright, let's get this merged! :-)

bors r+

@github-actions github-actions Bot added the ready-to-merge This PR has been sent to bors. label Aug 18, 2024
mathlib-bors Bot pushed a commit that referenced this pull request Aug 18, 2024
Define the (Shannon) binary and q-ary entropy functions.

The binary entropy function is used in information theory; for example, in Shannon's theorems.



Co-authored-by: Yaël Dillies <[email protected]>
@mathlib-bors

mathlib-bors Bot commented Aug 18, 2024

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title feat: Binary entropy [Merged by Bors] - feat: Binary entropy Aug 18, 2024
@mathlib-bors mathlib-bors Bot closed this Aug 18, 2024
@mathlib-bors
mathlib-bors Bot deleted the adomas_binary_entropy branch August 18, 2024 02:14
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 9, 2024
Define the (Shannon) binary and q-ary entropy functions.

The binary entropy function is used in information theory; for example, in Shannon's theorems.



Co-authored-by: Yaël Dillies <[email protected]>
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 9, 2024
Define the (Shannon) binary and q-ary entropy functions.

The binary entropy function is used in information theory; for example, in Shannon's theorems.



Co-authored-by: Yaël Dillies <[email protected]>
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 12, 2024
Define the (Shannon) binary and q-ary entropy functions.

The binary entropy function is used in information theory; for example, in Shannon's theorems.



Co-authored-by: Yaël Dillies <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! ready-to-merge This PR has been sent to bors. t-analysis Analysis (normed *, calculus)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants