Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat: Density of a finset #11243

Closed
wants to merge 5 commits into from
Closed

Conversation

YaelDillies
Copy link
Collaborator

The density of a finite set in an ambient group is a quantity of great interest in combinatorics.
This PR defines Finset.dens s for s : Finset α as the size of s divided by the size of α, with value in any semifield.
The API lemmas are copied from Finset.card (but not all Finset.card lemmas are sensible Finset.dens lemmas).

From LeanAPAP


Open in Gitpod

@urkud
Copy link
Member

urkud commented May 5, 2024

See also commProb which you may want to port to the new definition. Also, do you plan to link it to the measure theory probability w.r.t. the uniform distribution?

@YaelDillies
Copy link
Collaborator Author

See also commProb which you may want to port to the new definition.

Nice observation! Will do so in a later PR.

do you plan to link it to the measure theory probability w.r.t. the uniform distribution?

Maybe in a distant future but right now I don't need it.

The density of a finite set in an ambient group is a quantity of great interest in combinatorics.
This PR defines `Finset.dens s` for `s : Finset α` as the size of `s` divided by the size of `α`, with value in any semifield.
The API lemmas are copied from `Finset.card` (but not all `Finset.card` lemmas are sensible `Finset.dens` lemmas).

From LeanAPAP
Copy link

github-actions bot commented Jun 9, 2024

PR summary 8241efc7a4

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Tactic.Positivity.Finset 488 538 +50 (+10.25%)
Import changes for all files
Files Import difference
3 files Mathlib.Combinatorics.SimpleGraph.Triangle.Removal Mathlib.Combinatorics.Additive.Corner.Roth Mathlib.Tactic
1
Mathlib.Combinatorics.SimpleGraph.Triangle.Basic Mathlib.Combinatorics.SimpleGraph.Triangle.Tripartite 6
Mathlib.Tactic.Positivity.Finset 50
Mathlib.Data.Finset.Density 537

Declarations diff

+ dens
+ dens_cons
+ dens_disjUnion
+ dens_empty
+ dens_eq_card_div_card
+ dens_eq_one
+ dens_eq_zero
+ dens_filter_add_dens_filter_not_eq_dens
+ dens_inter_add_dens_sdiff
+ dens_inter_add_dens_union
+ dens_le_dens
+ dens_le_dens_sdiff_add_dens
+ dens_lt_dens
+ dens_map_le
+ dens_mono
+ dens_ne_one
+ dens_ne_zero
+ dens_pos
+ dens_sdiff
+ dens_sdiff_add_dens
+ dens_sdiff_add_dens_eq_dens
+ dens_sdiff_add_dens_inter
+ dens_sdiff_comm
+ dens_singleton
+ dens_strictMono
+ dens_union_add_dens_inter
+ dens_union_le
+ dens_union_of_disjoint
+ dens_univ
+ evalFinsetDens
+ le_dens_sdiff
+ they
++ ⟨_,

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

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

Copy link
Collaborator

@Ruben-VandeVelde Ruben-VandeVelde left a comment

Choose a reason for hiding this comment

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

Feel free to put on the maintainer queue regardless of your response to my comment below, as long as you're convinced.

@Ruben-VandeVelde Ruben-VandeVelde added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review labels Jul 5, 2024
@YaelDillies YaelDillies added awaiting-review and removed awaiting-author A reviewer has asked the author a question or requested changes labels Jul 6, 2024
Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

bors merge

mathlib-bors bot pushed a commit that referenced this pull request Jul 12, 2024
The density of a finite set in an ambient group is a quantity of great interest in combinatorics.
This PR defines `Finset.dens s` for `s : Finset α` as the size of `s` divided by the size of `α`, with value in any semifield.
The API lemmas are copied from `Finset.card` (but not all `Finset.card` lemmas are sensible `Finset.dens` lemmas).

From LeanAPAP
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Jul 12, 2024

This PR was included in a batch that was canceled, it will be automatically retried

mathlib-bors bot pushed a commit that referenced this pull request Jul 12, 2024
The density of a finite set in an ambient group is a quantity of great interest in combinatorics.
This PR defines `Finset.dens s` for `s : Finset α` as the size of `s` divided by the size of `α`, with value in any semifield.
The API lemmas are copied from `Finset.card` (but not all `Finset.card` lemmas are sensible `Finset.dens` lemmas).

From LeanAPAP
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Jul 12, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: Density of a finset [Merged by Bors] - feat: Density of a finset Jul 12, 2024
@mathlib-bors mathlib-bors bot closed this Jul 12, 2024
@mathlib-bors mathlib-bors bot deleted the finset_density branch July 12, 2024 15:30
@adomani adomani mentioned this pull request Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants