-
Notifications
You must be signed in to change notification settings - Fork 257
Upload file Relation.Unary.Enumerable
to stdlib
#2005
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
Conversation
Definition of enumerability in `Relation.Unary.Enumerable`
So I think of Here you've defined a property of sets in general. So, somewhat unfortunately (I continue to find it a very awkward naming convention), I think I am right in saying that such properties belong instead under Can one of the 'true' experts please confirm this? Likewise, I think the preferred naming of the concept would/should be simply |
I don't qualify as a "true" expert if @jamesmckinna doesn't, but I agree: this should go under Also, this seems to be only finitely enumerable. Maybe |
Alternatively/additionally, you might wish to factor out as an |
And as for Suggest instead, somewhat reluctantly given the verboseness: |
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.
Let's minimise the import footprint.
It would also be good to have more properties e.g.
enumerate : IsEnumerable A -> List A
enumerated : (enum : IsEnumerable A) -> (x : A) -> x ∈ enumerate enum
And closure under sum, product
open import Data.Fin using (Fin) | ||
open import Data.Nat using (ℕ) | ||
open import Level using (Level) | ||
open import Function.Bundles using (_↔_) |
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.
open import Data.Fin using (Fin) | |
open import Data.Nat using (ℕ) | |
open import Level using (Level) | |
open import Function.Bundles using (_↔_) | |
open import Data.Fin.Base using (Fin) | |
open import Data.Nat.Base using (ℕ) | |
open import Level using (Level) | |
open import Function.Bundles using (_↔_) |
Just to be clear, I've asked @Sofia-Insa to "port" some things from a library of mine to stdlib. That library was developed with a slightly different context in mind, which is what is creating some of these issues. All of which do need to be fixed. [I'm mostly saying this so that the blame goes to me.] On tightening imports: absolutely. What made it to this PR was already better than the starting point... I completely despise I also agree that I don't like I agree about having more properties (and I already have some of these, so they'd be incoming as well). I think it's better to first settle on the many issues brought up here, then submit a new PR with additional properties. |
I think @gallais 's suggested additions would make this a 'better' PR, and now that you (@Sofia-Insa) have cut your teeth on some smaller PRs, working up to a slightly bigger one seems like a worthwhile progression? Regarding closure properties (but I think there may also be prior work on the
Regarding naming (for all authors/reviewers to consider), some alternative suggestions spring to mind, but these can all (?) be fixed put at the end, once the module contents stabilise:
|
I'd be a lot happier with |
Also: should this be generalised to an arbitrary setoid? |
Also (though this is perhaps marginal?):
|
Can we not prove the no duplication just from the bijection assumption? |
Yes, we should absolutely generalize this to an arbitrary setoid. And indeed, the bijection is enough to prove no duplication. Note that since The discussion does bring to mind a philosophical question of |
I am not sure I agree. It is common to get definitions subtly wrong and E.g. the fact we want a |
That's an excellent point. Ok, I have to agree, as I've witnessed "subtly wrong" sufficiently many times. Sigh. |
I've converted this PR to Draft, so that it can be augmented to be more full-featured regarding (at least) finite enumerability. |
Thanks @JacquesCarette and due apologies to @Sofia-Insa for getting caught up in a longer-running, but important, debate about library design, and with it, the role and size of PRs My own thinking, for what it's worth, is that I (could be persuaded to) prefer 'small' PRs when there is an 'easy'/label:low-hanging-fruit issue at stake. But a lot of label:addition PRs represent ... well, choices where things may, indeed, be "subtly wrong", so I hope that everyone can entertain the debate in a constructive fashion. And that involves both the mathematics, as here, and its implementation in type theory... |
Apologies for not understanding bijections between |
Probably every single one of them using the |
Sorry, I've missed most of this conversation. I agree with all the conclusions, i.e. |
What are the current plans for this PR @Sofia-Insa , @JacquesCarette ? |
Another one that I should take over. I most definitely want to continue pushing on this. |
@JacquesCarette any chance you plan to pick this up in the next couple of weeks? Otherwise, I'll post a link to this discussion in the original issue and then close this as there's not very much code here. |
Next couple of weeks? Unfortunately not so likely, sorry. |
Upload file
Relation.Unary.Enumerable
to stdlibwith one
record IsEnumerable
changes declared in CHANGELOG.md