-
Notifications
You must be signed in to change notification settings - Fork 640
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
[stdlib] filter_length #17027
[stdlib] filter_length #17027
Conversation
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.
Thank you for the contribution. I left some suggestions inline.
@coqbot run ci |
Do we also want something like |
I agree that accepting a mere inequality as "the" lemma for length of filter seems dissatisfying in some way, but I don't see where I'd want a lemma where the implied length is expressed in terms of filter itself or using essentially a reimplementation of it such as sum (map Nat.of_bool . ). Thus, I am inclined to stick with the proposed version. |
@coqbot run full ci |
Maybe we rename the lemma |
For this, I would probably go through Lemma partition_filter A f (l : list A) : partition f l = (filter f l, filter (fun x => negb (f x)) l). (then you can use |
@olaure01 Done. I also split up |
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.
Just naming suggestions.
Ok, looks good. Please add a changelog entry. |
…lter_length, filter_length_le, filter_length_le
e4334a8
to
c0e12f7
Compare
@andres-erbsen Ok, changelog entry added and commits squashed. |
@coqbot run full ci I intend to merge if CI passes |
@coqbot merge now |
@andres-erbsen: You cannot merge this PR because:
|
@coqbot merge now |
Adds
filter_length: length (filter l) <= length l
.