Skip to content

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

Closed
YaelDillies wants to merge 5 commits into
masterfrom
finset_density
Closed

YaelDillies wants to merge 5 commits into
masterfrom
finset_density

Conversation

@YaelDillies

Copy link
Copy Markdown
Contributor

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

Comment thread Mathlib/Data/Finset/Density.lean Resolved
Comment thread Mathlib/Data/Finset/Density.lean Resolved
Comment thread Mathlib/Data/Finset/Density.lean Resolved
Comment thread Mathlib/Data/Finset/Density.lean Resolved
Comment thread Mathlib/Data/Finset/Density.lean Resolved
Comment thread Mathlib/Data/Finset/Density.lean Resolved
Comment thread Mathlib/Data/Finset/Density.lean Resolved
Comment thread Mathlib/Data/Finset/Density.lean Resolved
Comment thread Mathlib/Data/Finset/Density.lean Resolved
Comment thread Mathlib/Data/Finset/Density.lean Resolved
Comment thread Mathlib/Data/Finset/Density.lean Resolved
@urkud

urkud commented May 5, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor 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.

Comment thread Mathlib/Data/Finset/Density.lean Resolved
Comment thread scripts/noshake.json Resolved
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
@github-actions

github-actions Bot commented Jun 9, 2024 •

Copy link
Copy Markdown

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>

@Ruben-VandeVelde Ruben-VandeVelde 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.

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

Comment thread Mathlib/Data/Finset/Density.lean Resolved
@Ruben-VandeVelde Ruben-VandeVelde added awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. and removed awaiting-review labels Jul 5, 2024
@YaelDillies YaelDillies added awaiting-review and removed awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. labels Jul 6, 2024

@jcommelin jcommelin left a comment

Copy link
Copy Markdown
Member

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

mathlib-bors Bot commented Jul 12, 2024

Copy link
Copy Markdown
Contributor

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

mathlib-bors Bot commented Jul 12, 2024

Copy link
Copy Markdown
Contributor

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