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(data/finset/basic): disj_Union #16421

Closed
wants to merge 11 commits into from

Conversation

eric-wieser
Copy link
Member

@eric-wieser eric-wieser commented Sep 7, 2022

finset.disj_Union is to finset.bUnion as:

  • finset.disj_union is to finset.union
  • finset.cons is to insert
  • finset.map is to finset.image

Open in Gitpod

@eric-wieser eric-wieser added the WIP Work in progress label Sep 7, 2022
@eric-wieser eric-wieser added awaiting-review The author would like community review of the PR and removed WIP Work in progress labels Sep 7, 2022
src/data/list/nodup.lean Outdated Show resolved Hide resolved
@eric-wieser eric-wieser added awaiting-CI The author would like to see what CI has to say before doing more work. and removed awaiting-CI The author would like to see what CI has to say before doing more work. labels Sep 9, 2022
Copy link
Collaborator

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

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

I fully agree on principle, but I should at least mention the reason I didn't introduce this myself:
finpartition is basically a bundling of this, so I was trying to find ways to make it practical to use without a new definition.

I now doubt this is achievable, so this PR is probably the right way forward.

src/data/finset/basic.lean Outdated Show resolved Hide resolved
src/data/list/basic.lean Outdated Show resolved Hide resolved
It is the same as `s.bUnion f`, but it does not require decidable equality on the type. The
hypothesis ensures that the sets are disjoint. -/
def disj_Union (s : finset α) (t : α → finset β)
(hf : (s : set α).pairwise $ λ a b, ∀ x, x ∈ t a → x ∉ t b) : finset β :=
Copy link
Collaborator

Choose a reason for hiding this comment

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

Once #16434 has gone through, you could use the following, right?

Suggested change
(hf : (s : set α).pairwise $ λ a b, ∀ x, x ∈ t a → x ∉ t b) : finset β :=
(hf : (s : set α).pairwise_disjoint t) : finset β :=

That sounds desirable, so maybe we should make them dependent.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that was one of the motivations for #16434; I think it makes sense for #16434 to depend on this PR, since it will be a much slower PR.

Copy link
Collaborator

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

bors d=@YaelDillies

@bors
Copy link

bors bot commented Oct 6, 2022

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

@leanprover-community-bot-assistant leanprover-community-bot-assistant added delegated The PR author may merge after reviewing final suggestions. and removed awaiting-review The author would like community review of the PR labels Oct 6, 2022
@YaelDillies
Copy link
Collaborator

bors merge

bors bot pushed a commit that referenced this pull request Oct 11, 2022
`finset.disj_Union` is to `finset.bUnion` as:
* `finset.disj_union` is to `finset.union`
* `finset.cons` is to `insert`
* `finset.map` is to `finset.image`



Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
@bors
Copy link

bors bot commented Oct 11, 2022

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

bors bot pushed a commit that referenced this pull request Oct 11, 2022
`finset.disj_Union` is to `finset.bUnion` as:
* `finset.disj_union` is to `finset.union`
* `finset.cons` is to `insert`
* `finset.map` is to `finset.image`



Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
@bors
Copy link

bors bot commented Oct 11, 2022

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request Oct 11, 2022
`finset.disj_Union` is to `finset.bUnion` as:
* `finset.disj_union` is to `finset.union`
* `finset.cons` is to `insert`
* `finset.map` is to `finset.image`



Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
@bors
Copy link

bors bot commented Oct 12, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(data/finset/basic): disj_Union [Merged by Bors] - feat(data/finset/basic): disj_Union Oct 12, 2022
@bors bors bot closed this Oct 12, 2022
@bors bors bot deleted the eric-wieser/disj_Union branch October 12, 2022 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated The PR author may merge after reviewing final suggestions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants