-
Notifications
You must be signed in to change notification settings - Fork 298
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 valued choice operator #7101
Conversation
else | ||
none | ||
|
||
lemma choice_eq {α : Type*} [subsingleton α] (a : α) : choice α = some a := |
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.
Should this be simp
?
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.
Ah, it can't be due to a
. But perhaps unique
is better anyway?
lemma choice_eq {α : Type*} [subsingleton α] (a : α) : choice α = some a := | |
@[simp] | |
lemma choice_eq {α : Type*} [unique α] : choice α = some (default a) := |
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'll add this as a separate lemma, but actually for the sake of dependent types the first one is actually useful: using subsingleton
you can rewrite choice α
as the particular some a
that you want!
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.
Ah, unique
isn't even defined yet here.
LGTM. @eric-wieser , do you have any objections left? |
bors r+ |
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Pull request successfully merged into master. Build succeeded: |
I'm using this in the new development of chain complex / homology.