Repository navigation
[Merged by Bors] - feat(Data/Finset): add Finset.filter_notMem_eq_sdiff, Finset.map_sdiff - #27340
staroperator wants to merge 4 commits into
Conversation
PR summary bfeab816b7Import changes for modified filesNo significant changes to the import graph Import changes for all files
Declarations diff
You can run this locally as follows## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>The doc-module for No changes to technical debt.You can run this locally as
|
|
|
||
| theorem filter_union_right (s : Finset α) : s.filter p ∪ s.filter q = s.filter fun x => p x ∨ q x := | ||
| ext fun x => by simp [mem_filter, mem_union, ← and_or_left] | ||
| ext fun _ => by simp only [mem_filter, mem_union, ← and_or_left] |
There was a problem hiding this comment.
Small hint: Terminal simp calls should not be squeezed. This is important for maintainability. (see the style guide: https://leanprover-community.github.io/contribute/style.html#squeezing-simp-calls)
There was a problem hiding this comment.
Thank you very much! I didn't know about this before.
YaelDillies
left a comment
There was a problem hiding this comment.
Thanks for the PR! Unfortunately, your cleanups are polemical and I would rather not merge them. Eg
theorem : returnType := by
ext; simp
is probably preferrable over
theorem : returnType :=
ext fun _ := by simp
Can you please revert everything but the titular addition of filter_notMem_eq_sdiff?
In general, you will notice your PRs will have a much easier time if you stick to a single category of changes among "feat", "chore", "refactor". Here you are mixing feat and chore (and the chore part in this PR isn't a clear win).
| theorem filter_mem_eq_inter {s t : Finset α} [∀ i, Decidable (i ∈ t)] : | ||
| (s.filter fun i => i ∈ t) = s ∩ t := | ||
| ext fun i => by simp [mem_filter, mem_inter] | ||
| theorem filter_mem_eq_inter {s t : Finset α} : (s.filter fun i => i ∈ t) = s ∩ t := | ||
| ext fun _ => by simp [mem_filter, mem_inter] |
There was a problem hiding this comment.
This is a regression. Your new lemma is less general because it talks about a derived ∀ i, Decidable (i ∈ t) rather than a general one
There was a problem hiding this comment.
Interesting. I thought it was unnecessary but it is not.
OK, I have now reverted everything except the newly added lemmas. |
YaelDillies
left a comment
There was a problem hiding this comment.
Thanks! 🚀
maintainer merge
|
🚀 Pull request has been placed on the maintainer queue by YaelDillies. |
…diff` (#27340) `Finset.filter_notMem_eq_sdiff` is the symmetric correspondence of `Finset.filter_mem_eq_inter`.
|
Pull request successfully merged into master. Build succeeded:
|
Finset.filter_notMem_eq_sdiff, Finset.map_sdiffFinset.filter_notMem_eq_sdiff, Finset.map_sdiff
…diff` (leanprover-community#27340) `Finset.filter_notMem_eq_sdiff` is the symmetric correspondence of `Finset.filter_mem_eq_inter`.
…diff` (leanprover-community#27340) `Finset.filter_notMem_eq_sdiff` is the symmetric correspondence of `Finset.filter_mem_eq_inter`.
…diff` (leanprover-community#27340) `Finset.filter_notMem_eq_sdiff` is the symmetric correspondence of `Finset.filter_mem_eq_inter`.
Finset.filter_notMem_eq_sdiffis the symmetric correspondence ofFinset.filter_mem_eq_inter.