Skip to content
This repository was archived by the owner on Nov 6, 2026. 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 into
masterfrom
option_n_ary
Closed

YaelDillies wants to merge 6 commits into
masterfrom
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
Comment thread src/data/option/n_ary.lean Resolved
Comment thread src/data/option/n_ary.lean Outdated
(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)

Comment thread src/data/option/n_ary.lean Resolved
Comment thread src/data/option/n_ary.lean Resolved

@Vierkantor Vierkantor left a comment

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.

bors d+

Comment thread src/data/option/n_ary.lean Outdated
(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)

Comment thread src/data/option/n_ary.lean Resolved
@bors

bors Bot commented Oct 24, 2022

Copy link
Copy Markdown

✌️ 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

bors Bot commented Oct 24, 2022

Copy link
Copy Markdown

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

bors Bot commented Oct 25, 2022

Copy link
Copy Markdown

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