Skip to content

[Merged by Bors] - feat: more lemmas about List.dedup and other lattice operations - #14282

Closed
eric-wieser wants to merge 16 commits into
masterfrom
eric-wieser/dedup-lemmas
Closed

eric-wieser wants to merge 16 commits into
masterfrom
eric-wieser/dedup-lemmas

Conversation

@eric-wieser

@eric-wieser eric-wieser commented Jun 30, 2024 •

Copy link
Copy Markdown
Member

Also the trivial Multiset wrappers.


Open in Gitpod

@eric-wieser eric-wieser added awaiting-review awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. labels Jun 30, 2024
@github-actions

github-actions Bot commented Jun 30, 2024 •

Copy link
Copy Markdown

PR summary 179ad54926

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Data.List.Dedup 324 325 +1 (+0.31%)
Import changes for all files
Files Import difference
Mathlib.Data.List.Dedup 1

Declarations diff

+ Disjoint.dedup_add
+ Disjoint.dedup_append
+ Disjoint.inter_eq_nil
+ Disjoint.ndinter_eq_zero
+ Disjoint.ndunion_eq
+ Disjoint.union_eq
+ Subset.dedup_add_left
+ Subset.dedup_add_right
+ Subset.dedup_append_right
+ Subset.inter_eq_left
+ Subset.ndinter_eq_left
+ Subset.ndunion_eq_right
+ Subset.union_eq_right
+ _root_.List.Subset.dedup_append_left
+ inter_nil'
++ _
++ dedup_map_of_injective

You can run this locally as follows
## summary with just the declaration names:
./scripts/no_lost_declarations.sh short <optional_commit>

## more verbose report:
./scripts/no_lost_declarations.sh <optional_commit>

@eric-wieser
eric-wieser requested a review from digama0 June 30, 2024 08:32
@github-actions github-actions Bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Jun 30, 2024

theorem dedup_map_of_injective [DecidableEq β] {f : α → β} (hf : Function.Injective f)
(xs : List α) :
(xs.map f).dedup = xs.dedup.map f := by

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Timeroot had this lemma somewhere. Did it ever land? What is the PR?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I assume we don't need to wait for an answer here? Of course, if @Timeroot comes along with a shorter proof after this is merged, we can always make a golf PR.

Comment thread Mathlib/Data/List/Dedup.lean Resolved

alias ⟨_, Disjoint.ndinter_eq_zero⟩ := ndinter_eq_zero_iff_disjoint

theorem Subset.ndinter_eq_left {s t : Multiset α} (h : s ⊆ t) : s.ndinter t = s := by

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same, can we have the right verSion?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't think the right version is meaningfully true? What statement do you want?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah indeed. But then this lemma is something like Multiset.filter_true_of_mem h except that filter_true_of_mem doesn't exist

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It exists for List though; I golfed the proof there

@YaelDillies YaelDillies added awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. and removed awaiting-review labels Jul 9, 2024
@eric-wieser eric-wieser removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jul 9, 2024
Comment thread Mathlib/Data/Multiset/Dedup.lean Resolved
@eric-wieser
eric-wieser requested a review from YaelDillies July 11, 2024 00:54

@YaelDillies YaelDillies left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good now

maintainer merge

@eric-wieser

Copy link
Copy Markdown
Member Author

maintainer merge

The conspiracy for bots to ignore Yael continues

@github-actions

Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by eric-wieser.

@github-actions github-actions Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jul 11, 2024
@mattrobball

Copy link
Copy Markdown
Contributor

!bench

@mattrobball

Copy link
Copy Markdown
Contributor

I would guess the import change and the single simp are good but benched so I don't have to speculate. If it comes back reasonable, please merge. Thanks!

bors delegate+

@mathlib-bors

mathlib-bors Bot commented Jul 11, 2024

Copy link
Copy Markdown
Contributor

✌️ eric-wieser can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@github-actions github-actions Bot added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Jul 11, 2024
@leanprover-bot

Copy link
Copy Markdown

Here are the benchmark results for commit 179ad54.
There were no significant changes against commit c673d9d.

@eric-wieser

Copy link
Copy Markdown
Member Author

bors r+

@github-actions github-actions Bot added the ready-to-merge This PR has been sent to bors. label Jul 11, 2024
mathlib-bors Bot pushed a commit that referenced this pull request Jul 11, 2024
@mathlib-bors

mathlib-bors Bot commented Jul 11, 2024

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title feat: more lemmas about List.dedup and other lattice operations [Merged by Bors] - feat: more lemmas about List.dedup and other lattice operations Jul 11, 2024
@mathlib-bors mathlib-bors Bot closed this Jul 11, 2024
@mathlib-bors
mathlib-bors Bot deleted the eric-wieser/dedup-lemmas branch July 11, 2024 10:12
@adomani adomani mentioned this pull request Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. ready-to-merge This PR has been sent to bors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants