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/option/basic): option.map is injective #16626

Closed
wants to merge 3 commits into from

Conversation

urkud
Copy link
Member

@urkud urkud commented Sep 25, 2022

  • prove that option.map : (α → β) → (option α → option β) is injective;
  • add iff version of this lemma;
  • add option.map_comp_some and option.map_eq_id;
  • drop option.map_id': it was the same as option.map_id.

Open in Gitpod

* prove that `option.map : (α → β) → (option α → option β)` is
  injective;
* add `iff` version of this lemma;
* add `option.map_comp_some` and `option.map_eq_id`;
* drop `option.map_id'`: it was the same as `option.map_id`.
@urkud urkud added awaiting-review The author would like community review of the PR easy < 20s of review time. See the lifecycle page for guidelines. labels Sep 25, 2022
Comment on lines 184 to 186
/-- `option.map` is an injective function. -/
theorem map_injective' : function.injective (@option.map α β) :=
λ f g h, funext $ λ x, some_injective _ $ by simp only [← map_some', h]
Copy link
Member

Choose a reason for hiding this comment

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

How is this different from the unprimed version?

Copy link
Member Author

@urkud urkud Sep 25, 2022

Choose a reason for hiding this comment

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

The unprimed version says that option.map f is injective whenever f is injective. Should I rename it to function.injective.option_map?

Copy link
Member

Choose a reason for hiding this comment

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

I think it's fine as is, I just misread the docstring

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Copy link
Member

@eric-wieser eric-wieser 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+

@bors
Copy link

bors bot commented Sep 25, 2022

✌️ urkud 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 Sep 25, 2022
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@urkud
Copy link
Member Author

urkud commented Sep 26, 2022

bors merge

@github-actions github-actions bot added the ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) label Sep 26, 2022
bors bot pushed a commit that referenced this pull request Sep 26, 2022
* prove that `option.map : (α → β) → (option α → option β)` is injective;
* add `iff` version of this lemma;
* add `option.map_comp_some` and `option.map_eq_id`;
* drop `option.map_id'`: it was the same as `option.map_id`.
@bors
Copy link

bors bot commented Sep 26, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(data/option/basic): option.map is injective [Merged by Bors] - feat(data/option/basic): option.map is injective Sep 26, 2022
@bors bors bot closed this Sep 26, 2022
@bors bors bot deleted the YK-option-map-inj branch September 26, 2022 08:21
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. ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants