-
Notifications
You must be signed in to change notification settings - Fork 299
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
Conversation
* 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`.
src/data/option/basic.lean
Outdated
/-- `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] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors d+
✌️ urkud can now approve this pull request. To approve and merge a pull request, simply reply with |
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
bors merge |
* 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`.
Pull request successfully merged into master. Build succeeded: |
option.map
is injectiveoption.map
is injective
option.map : (α → β) → (option α → option β)
is injective;iff
version of this lemma;option.map_comp_some
andoption.map_eq_id
;option.map_id'
: it was the same asoption.map_id
.