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

feat(data/set/basic): decidable_mem #9733

Closed
wants to merge 3 commits into from
Closed

Conversation

kmill
Copy link
Collaborator

@kmill kmill commented Oct 15, 2021

decidable_mem s is decidable_pred (∈ s). It can save parentheses, is a bit easier to read, and makes it less tempting to break the set API.


Open in Gitpod

Right now this is just a test to see how it works.

@kmill kmill changed the title feat(data/set/basic): decidable_set feat(data/set/basic): decidable_mem Oct 15, 2021
def decidable_mem {α : Type u} {β : Type v} [has_mem α β] (s : β) :=
decidable_pred (∈ s)

instance decidable_mem_of (p : α → Prop) [H : decidable_pred p] : decidable_mem {a | p a} := H
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
instance decidable_mem_of (p : α → Prop) [H : decidable_pred p] : decidable_mem {a | p a} := H
instance decidable_mem_set_of (p : α → Prop) [H : decidable_pred p] : decidable_mem {a | p a} := H

since {a | p a} is syntax for set_of p

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.

I'm somewhat ambivalent on this. I don't think there's much readability gain, but I also don't think this is likely to cause any problems since the other decidable predicates seem not to have either.

Presumably we should have classical.dec_mem to match classical.dec_pred etc?

@semorrison semorrison added the awaiting-author A reviewer has asked the author a question or requested changes label Oct 25, 2021
@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Nov 23, 2021
@kmill kmill closed this Jan 19, 2022
@kmill kmill deleted the kmill_decidable_set branch July 14, 2023 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-author A reviewer has asked the author a question or requested changes merge-conflict Please `git merge origin/master` then a bot will remove this label.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants