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(combinatorics/hall): Hall's marriage theorem #5695

Closed
wants to merge 71 commits into from

Conversation

agusakov
Copy link
Collaborator

@agusakov agusakov commented Jan 10, 2021

@agusakov agusakov added help-wanted The author needs attention to resolve issues awaiting-review The author would like community review of the PR labels Jan 10, 2021
@agusakov
Copy link
Collaborator Author

I need some help satisfying the linter - certain arguments go unused but figuring out how to order them is a bit weird.

src/combinatorics/hall.lean Outdated Show resolved Hide resolved
src/combinatorics/hall.lean Outdated Show resolved Hide resolved
src/combinatorics/hall.lean Outdated Show resolved Hide resolved
@agusakov agusakov added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Jan 10, 2021
@agusakov
Copy link
Collaborator Author

agusakov commented Jan 10, 2021

Switching to the awaiting-author label because I realized we can use image from data/rel instead of creating image_rel, and that's gonna take some time to refactor

@kmill
Copy link
Collaborator

kmill commented Jan 11, 2021

@agusakov I added a rel.image version in hall2.lean. I also generalized the original hall to be in terms of indexed families of finite sets, because it was easier to eliminate image_rel that way (the translation was mostly mechanical, and then I started factoring some stuff out and trying to simplify things to some degree). This lets β both be infinite and be removed from the induction hypothesis.

Getting rel.image to work nicely even if β is infinite involves a typeclass that's at the beginning of the file. If [fintype β], then hall_rel is equivalent to

theorem hall_rel {α β : Type*} [fintype α] [decidable_eq β]
  (r : α → β → Prop) [fintype β] :
  (∀ (A : finset α), A.card ≤ fintype.card (rel.image r A))
  ↔ (∃ (f : α → β), function.injective f ∧ ∀ x, r x (f x)) :=

@bryangingechen bryangingechen changed the title feat(combinatorics/hall): statement and proof of hall's marriage theorem feat(combinatorics/hall): Hall's marriage theorem Jan 13, 2021
@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Feb 11, 2021
@kmill kmill added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes labels Feb 11, 2021
@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Feb 11, 2021
@bryangingechen bryangingechen self-assigned this Feb 11, 2021
Copy link
Collaborator

@bryangingechen bryangingechen left a comment

Choose a reason for hiding this comment

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

Thanks! This looks pretty much ready to go to me.
bors d+

src/combinatorics/hall.lean Show resolved Hide resolved
src/combinatorics/hall.lean Outdated Show resolved Hide resolved
src/combinatorics/hall.lean Show resolved Hide resolved
src/combinatorics/hall.lean Outdated Show resolved Hide resolved
src/combinatorics/hall.lean Outdated Show resolved Hide resolved
src/combinatorics/hall.lean Outdated Show resolved Hide resolved
src/combinatorics/hall.lean Outdated Show resolved Hide resolved
src/combinatorics/hall.lean Outdated Show resolved Hide resolved
src/combinatorics/hall.lean Outdated Show resolved Hide resolved
src/combinatorics/hall.lean Outdated Show resolved Hide resolved
@bors
Copy link

bors bot commented Feb 11, 2021

✌️ agusakov can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@bryangingechen bryangingechen added awaiting-author A reviewer has asked the author a question or requested changes delegated The PR author may merge after reviewing final suggestions. and removed awaiting-review The author would like community review of the PR labels Feb 11, 2021
@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Feb 11, 2021
@kmill
Copy link
Collaborator

kmill commented Feb 11, 2021

@bryangingechen Thanks -- I've incorporated your suggestions

@agusakov
Copy link
Collaborator Author

bors r+

bors bot pushed a commit that referenced this pull request Feb 12, 2021
We state and prove Hall's marriage theorem with respect to fintypes and relations. 

Coauthor: @b-mehta @kmill



Co-authored-by: Kyle Miller <kmill31415@gmail.com>
Co-authored-by: agusakov <39916842+agusakov@users.noreply.github.com>
@bors
Copy link

bors bot commented Feb 12, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(combinatorics/hall): Hall's marriage theorem [Merged by Bors] - feat(combinatorics/hall): Hall's marriage theorem Feb 12, 2021
@bors bors bot closed this Feb 12, 2021
Graph Theory and Combinatorics automation moved this from In progress to Done Feb 12, 2021
@bors bors bot deleted the hall2 branch February 12, 2021 05:45
b-mehta pushed a commit that referenced this pull request Apr 2, 2021
…ons on finsets (#5887)

Add lemmas about bUnion and images of functions on finsets. Part of #5695 in order to prove Hall's marriage theorem.

Coauthors: @kmill @b-mehta 



Co-authored-by: agusakov <39916842+agusakov@users.noreply.github.com>
b-mehta pushed a commit that referenced this pull request Apr 2, 2021
…ive functions is injective if images are disjoint (#5866)

Add lemma stating that dite of two injective functions is injective if their images are disjoint. Part of #5695 in order to prove Hall's Marriage Theorem.



Co-authored-by: agusakov <39916842+agusakov@users.noreply.github.com>
b-mehta pushed a commit that referenced this pull request Apr 2, 2021
We state and prove Hall's marriage theorem with respect to fintypes and relations. 

Coauthor: @b-mehta @kmill



Co-authored-by: Kyle Miller <kmill31415@gmail.com>
Co-authored-by: agusakov <39916842+agusakov@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-author A reviewer has asked the author a question or requested changes delegated The PR author may merge after reviewing final suggestions.
Development

Successfully merging this pull request may close these issues.

None yet

4 participants