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/set/lattice): add lemmas set.Union_subtype and set.Union_of_singleton_coe #5691

Closed
wants to merge 7 commits into from

Conversation

adomani
Copy link
Collaborator

@adomani adomani commented Jan 10, 2021

Add one simp lemma, following a suggestion on the Zulip chat:

https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/image_bUnion


@adomani adomani added awaiting-review The author would like community review of the PR easy < 20s of review time. See the lifecycle page for guidelines. labels Jan 10, 2021
@eric-wieser
Copy link
Member

eric-wieser commented Jan 11, 2021

In another zulip thread about this same lemma I suggested that instead we should add:

lemma set.Union_subtype {α β : Type*} (s : set α) (f : α → set β) :
  (⋃ (i : s), f i) = ⋃ (i ∈ s), f i :=
  (set.bUnion_eq_Union s $ λ x _, f x).symm

https://leanprover.zulipchat.com/#narrow/stream/217875-Is-there.20code.20for.20X.3F/topic/name-hunt.3A.20Union_of_singleton.3F

But maybe we should just have both.

@adomani
Copy link
Collaborator Author

adomani commented Jan 11, 2021

Eric, I added the second lemma as well!

Comment on lines 365 to 367
lemma set.Union_subtype {α β : Type*} (s : set α) (f : α → set β) :
(⋃ (i : s), f i) = ⋃ (i ∈ s), f i :=
(set.bUnion_eq_Union s $ λ x _, f x).symm
Copy link
Member

Choose a reason for hiding this comment

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

For other reviewers - is this a good simp lemma? My feeling is yes, because we have a lot of other simp lemmas about things of the form ⋃ (i ∈ s) when s is some compound expression.

@eric-wieser eric-wieser 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 13, 2021
moved lemma bUnion_of_singleton_of_coe
and renamed it to Union_of_singleton_coe
@adomani adomani 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 Jan 14, 2021
@bryangingechen bryangingechen changed the title feat(data/set/lattice) add simp lemma set.bUnion_of_singleton_of_coe feat(data/set/lattice): add simp lemmas set.Union_subtype and set.Union_of_singleton_coe Jan 16, 2021
@bryangingechen bryangingechen changed the title feat(data/set/lattice): add simp lemmas set.Union_subtype and set.Union_of_singleton_coe feat(data/set/lattice): add lemmas set.Union_subtype and set.Union_of_singleton_coe Jan 16, 2021
@bors
Copy link

bors bot commented Jan 17, 2021

✌️ adomani 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 Jan 17, 2021
Co-authored-by: Bryan Gin-ge Chen <bryangingechen@gmail.com>
@adomani
Copy link
Collaborator Author

adomani commented Jan 17, 2021

bors r+

bors bot pushed a commit that referenced this pull request Jan 17, 2021
@bors
Copy link

bors bot commented Jan 17, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(data/set/lattice): add lemmas set.Union_subtype and set.Union_of_singleton_coe [Merged by Bors] - feat(data/set/lattice): add lemmas set.Union_subtype and set.Union_of_singleton_coe Jan 17, 2021
@bors bors bot closed this Jan 17, 2021
@bors bors bot deleted the set.bUnion_of_singleton_of_coe branch January 17, 2021 11:37
@adomani adomani removed the awaiting-author A reviewer has asked the author a question or requested changes label Jun 15, 2021
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. easy < 20s of review time. See the lifecycle page for guidelines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants