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 intomasterfrom
eric-wieser/dedup-lemmas
Closed

[Merged by Bors] - feat: more lemmas about List.dedup and other lattice operations#14282
eric-wieser wants to merge 16 commits intomasterfrom
eric-wieser/dedup-lemmas

Conversation

@eric-wieser
Copy link
Copy Markdown
Member

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

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
Copy link
Copy Markdown

github-actions bot commented Jun 30, 2024

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.


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 A reviewer has asked the author a question or requested changes. and removed awaiting-review labels Jul 9, 2024
@eric-wieser eric-wieser removed the awaiting-author A reviewer has asked the author a question or requested changes. label Jul 9, 2024
@eric-wieser eric-wieser requested a review from YaelDillies July 11, 2024 00:54
Copy link
Copy Markdown
Contributor

@YaelDillies YaelDillies left a comment

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
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jul 11, 2024

✌️ 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
Collaborator

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
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Jul 11, 2024

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