Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

[Merged by Bors] - feat(data/option/n_ary): Binary map of options#16763

Closed
YaelDillies wants to merge 6 commits intomasterfrom
option_n_ary
Closed

[Merged by Bors] - feat(data/option/n_ary): Binary map of options#16763
YaelDillies wants to merge 6 commits intomasterfrom
option_n_ary

Conversation

@YaelDillies
Copy link
Copy Markdown
Collaborator

Define option.map₂, the binary map of options.


This will be used to turn arithmetic operations on nonempty_interval α into the ones on interval α.

Open in Gitpod

@YaelDillies YaelDillies added the awaiting-review The author would like community review of the PR label Oct 2, 2022
(map₂ f a b).map g = map₂ f' (a.map g₁) (b.map g₂) :=
by cases a; cases b; simp [h_distrib]

/-- Symmetric of `option.map₂_map_left_comm`. -/
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

"Symmetric of" doesn't really make sense in English - I'm not sure what you mean here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Same equality but written the other way around.

If you wonder why we need this, it's because unification has a hard time figuring all the functions if you symmetrize on the spot. This is also how the other n-ary APIs do it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In that case, how about:

Suggested change
/-- Symmetric of `option.map₂_map_left_comm`. -/
/-- Symmetric form of `option.map₂_map_left_comm`. -/

or

Suggested change
/-- Symmetric of `option.map₂_map_left_comm`. -/
/-- Symmetric restatement of `option.map₂_map_left_comm`. -/

(also below)

Copy link
Copy Markdown
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+

(map₂ f a b).map g = map₂ f' (a.map g₁) (b.map g₂) :=
by cases a; cases b; simp [h_distrib]

/-- Symmetric of `option.map₂_map_left_comm`. -/
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In that case, how about:

Suggested change
/-- Symmetric of `option.map₂_map_left_comm`. -/
/-- Symmetric form of `option.map₂_map_left_comm`. -/

or

Suggested change
/-- Symmetric of `option.map₂_map_left_comm`. -/
/-- Symmetric restatement of `option.map₂_map_left_comm`. -/

(also below)

@bors
Copy link
Copy Markdown

bors bot commented Oct 24, 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 24, 2022
@YaelDillies
Copy link
Copy Markdown
Collaborator Author

bors merge

bors bot pushed a commit that referenced this pull request Oct 24, 2022
Define `option.map₂`, the binary map of options.
@bors
Copy link
Copy Markdown

bors bot commented Oct 24, 2022

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request Oct 25, 2022
Define `option.map₂`, the binary map of options.
@bors
Copy link
Copy Markdown

bors bot commented Oct 25, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(data/option/n_ary): Binary map of options [Merged by Bors] - feat(data/option/n_ary): Binary map of options Oct 25, 2022
@bors bors bot closed this Oct 25, 2022
@bors bors bot deleted the option_n_ary branch October 25, 2022 03:33
@eric-wieser eric-wieser added the hacktoberfest-accepted Without this label hacktoberfest is scared off by bors label Oct 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

delegated The PR author may merge after reviewing final suggestions. hacktoberfest-accepted Without this label hacktoberfest is scared off by bors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants