Skip to content

feat(Combinatorics): Set-Valued Pigeonhole Principle #37190

Open
cjrl wants to merge 23 commits intoleanprover-community:masterfrom
cjrl:count-lemmas
Open

feat(Combinatorics): Set-Valued Pigeonhole Principle #37190
cjrl wants to merge 23 commits intoleanprover-community:masterfrom
cjrl:count-lemmas

Conversation

@cjrl
Copy link
Copy Markdown

@cjrl cjrl commented Mar 26, 2026

This PR contributes two theorems to combinatorics:

  • exists_lt_card_cover_of_card_biUnion_lt_card is a set-valued version of the pigeonhole principle.

  • sum_card_eq_sum_card_cover_biUnion is a set theoretic corollary of a double counting result proved for bipartite graphs (Finset.sum_card_bipartiteAbove_eq_sum_card_bipartiteBelow). This was needed to prove the above pigeonhole principle.

The motivation for these results is our Latin Square PR #36698. These results were proved in less general terms in that PR, but are independent of Latin Square considerations and so we have generalized and moved them into more relevant files.


Open in Gitpod

cjrl and others added 8 commits March 18, 2026 21:10
Co-authored-by: Christopher J. R. Lloyd <cjl8zf@virginia.edu>
Co-authored-by: George H. Seelinger <ghseeli@gmail.com>
Co-authored-by: Christopher J. R. Lloyd <cjl8zf@virginia.edu>
Co-authored-by: George H. Seelinger <ghseeli@gmail.com>
Co-authored-by: Christopher J. R. Lloyd <cjl8zf@virginia.edu>
Co-authored-by: George H. Seelinger <ghseeli@gmail.com>
Co-authored-by: Christopher J. R. Lloyd <cjl8zf@virginia.edu>
Co-authored-by: George H. Seelinger <ghseeli@gmail.com>
@github-actions github-actions bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Mar 26, 2026
@github-actions
Copy link
Copy Markdown

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 awaiting-author tag, or another reason described in the Lifecycle of a PR. The review dashboard has a dedicated webpage which shows whether your PR is on the review queue, and (if not), why.

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.

@github-actions github-actions bot added the large-import Automatically added label for PRs with a significant increase in transitive imports label Mar 26, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 26, 2026

PR summary 322515540d

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Combinatorics.Pigeonhole 776 777 +1 (+0.13%)
Import changes for all files
Files Import difference
13 files Mathlib.Combinatorics.Additive.AP.Three.Behrend Mathlib.Combinatorics.Pigeonhole Mathlib.Dynamics.Ergodic.Conservative Mathlib.NumberTheory.ClassNumber.AdmissibleAbs Mathlib.NumberTheory.ClassNumber.AdmissibleAbsoluteValue Mathlib.NumberTheory.ClassNumber.AdmissibleCardPowDegree Mathlib.NumberTheory.ClassNumber.Finite Mathlib.NumberTheory.ClassNumber.FunctionField Mathlib.NumberTheory.FLT.Three Mathlib.NumberTheory.NumberField.ClassNumber Mathlib.NumberTheory.NumberField.Cyclotomic.PID Mathlib.NumberTheory.NumberField.DedekindZeta Mathlib.NumberTheory.NumberField.Ideal.Asymptotics
1

Declarations diff

+ exists_mem_biUnion_inf'_card_lt
+ sum_card_eq_sum_biUnion_card

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

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

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


No changes to technical debt.

You can run this locally as

./scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

Co-authored-by: Christopher J. R. Lloyd <cjl8zf@virginia.edu>
Co-authored-by: George H. Seelinger <ghseeli@gmail.com>
@cjrl cjrl marked this pull request as ready for review March 26, 2026 01:48
@github-actions github-actions bot removed the large-import Automatically added label for PRs with a significant increase in transitive imports label Mar 26, 2026
@cjrl
Copy link
Copy Markdown
Author

cjrl commented Mar 27, 2026

+t-combinatorics

@github-actions github-actions bot added the t-combinatorics Combinatorics label Mar 27, 2026
@j-loreaux j-loreaux added the awaiting-author A reviewer has asked the author a question or requested changes. label Apr 1, 2026
cjrl and others added 5 commits April 1, 2026 08:23
Co-authored-by: Jireh Loreaux <loreaujy@gmail.com>
Co-authored-by: Jireh Loreaux <loreaujy@gmail.com>
Co-authored-by: Jireh Loreaux <loreaujy@gmail.com>
Co-authored-by: Jireh Loreaux <loreaujy@gmail.com>
@cjrl
Copy link
Copy Markdown
Author

cjrl commented Apr 3, 2026

-awaiting-author

@github-actions github-actions bot removed the awaiting-author A reviewer has asked the author a question or requested changes. label Apr 3, 2026
cjrl added a commit to cjrl/mathlib4 that referenced this pull request Apr 4, 2026
Copy link
Copy Markdown
Collaborator

@vlad902 vlad902 left a comment

Choose a reason for hiding this comment

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

LGTM otherwise

cjrl and others added 4 commits April 12, 2026 12:28
Co-authored-by: Vlad Tsyrklevich <vlad902@gmail.com>
Co-authored-by: Vlad Tsyrklevich <vlad902@gmail.com>
Co-authored-by: Vlad Tsyrklevich <vlad902@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-combinatorics Combinatorics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants