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/list/basic): add filter/remove_all length properties #10409

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

rgreenblatt
Copy link
Collaborator


Not sure if these are the right names for these theorem. Also, maybe these proofs could be cleaned up?

Open in Gitpod

@eric-wieser
Copy link
Member

A note for other reviewers: CI is not running correctly here because this is running from a fork. Can someone else advise @rgreenblatt on what to do next?

Comment on lines 3027 to 3032
@[simp] theorem length_filter_lt_of_mem {a : α} (l : list α) :
a ∈ l → ¬p a → (filter p l).length < l.length :=
begin
induction l;
simp,
intros h_in hpa,
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
@[simp] theorem length_filter_lt_of_mem {a : α} (l : list α) :
a ∈ l → ¬p a → (filter p l).length < l.length :=
begin
induction l;
simp,
intros h_in hpa,
@[simp] theorem length_filter_lt_of_mem {a : α} (l : list α) (ha : a ∈ l) (hpa : ¬p a) : (filter p l).length < l.length :=
begin
induction l;
simp,

It's usually better to put hypotheses before the colon when possible.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, done.
I assume that mem_filter_of_mem (and a few other theorems) use implications like this for syntax convenience from pattern matching? Or is there some other reason?

@github-actions github-actions bot added the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Dec 27, 2021
@semorrison semorrison added the too-late This PR was ready too late for inclusion in mathlib3 label Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-conflict Please `git merge origin/master` then a bot will remove this label. too-late This PR was ready too late for inclusion in mathlib3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants