Skip to content

feat(push): @[push] attributes for in Set, Finset and Multiset#30042

Open
JovanGerb wants to merge 6 commits intoleanprover-community:masterfrom
JovanGerb:Jovan-push-mem
Open

feat(push): @[push] attributes for in Set, Finset and Multiset#30042
JovanGerb wants to merge 6 commits intoleanprover-community:masterfrom
JovanGerb:Jovan-push-mem

Conversation

@JovanGerb
Copy link
Copy Markdown
Contributor

This PR adds @[push] annotations for the membership relations, for Set, Finset and Multiset.


Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 28, 2025

PR summary 29d85a079c

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Order.Interval.Set.Defs 64 65 +1 (+1.56%)
Import changes for all files
Files Import difference
Mathlib.Order.Interval.Set.Defs 1

Declarations diff

No declarations were harmed in the making of this PR! 🐙

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 script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@mathlib4-merge-conflict-bot mathlib4-merge-conflict-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Oct 15, 2025
@mathlib4-merge-conflict-bot
Copy link
Copy Markdown
Collaborator

This pull request has conflicts, please merge master and resolve them.

@github-actions github-actions bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Oct 20, 2025
@mathlib4-merge-conflict-bot mathlib4-merge-conflict-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Oct 20, 2025
@mathlib4-merge-conflict-bot
Copy link
Copy Markdown
Collaborator

This pull request has conflicts, please merge master and resolve them.

@github-actions github-actions bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Oct 23, 2025
@EtienneC30 EtienneC30 added the t-meta Tactics, attributes or user commands label Oct 24, 2025
@EtienneC30 EtienneC30 removed their assignment Oct 24, 2025
@mathlib4-merge-conflict-bot
Copy link
Copy Markdown
Collaborator

This pull request has conflicts, please merge master and resolve them.

@mathlib4-merge-conflict-bot mathlib4-merge-conflict-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Oct 24, 2025
@github-actions github-actions bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 5, 2025
@grunweg grunweg self-assigned this Nov 11, 2025
Copy link
Copy Markdown
Contributor

@grunweg grunweg left a comment

Choose a reason for hiding this comment

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

Thanks! I have a few minor comments and a few requests for a few more tests. Getting this used to golf mathlib would be nice - but that can happen in a future PR.

end lambda

section membership

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.

Can you add some tests for intervals also?

@@ -68,7 +69,7 @@ variable {α : Type u} {β : Type v} {γ : Type w}

/-! ### Lemmas about `mem` and `setOf` -/

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.

Can you add a few basic tests for this file? Say, for mem_setOf, mem_univ or mem_range?

alias eq_of_not_mem_of_mem_insert := eq_of_mem_insert_of_notMem

@[simp, grind =]
@[simp, grind =, push]
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.

A test for this or mem_singleton_iff would be nice.

exact ⟨fun i ↦ _, rfl⟩

@[to_additive]
@[to_additive (attr := push)]
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.

This is probably not a good simp lemma, but might be a fine push lemma.

· intro i s _ ih
rw [Finset.sup_insert, sup_eq_union, count_union, Finset.sup_insert, ih]

@[push]
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.

I don't know why this lemma is not simp, but Finset.mem_sup` is. Oh well...

by rw [eq]
neb <| show b₁ = b₂ by rwa [Pi.cons_same, Pi.cons_same] at this)

@[push]
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.

This would be a terrible simp lemma. I'm not sure if it would be a good push lemma - but if this only fires on a hypothesis f \in pi m t, perhaps it's fine?

@grunweg grunweg added the awaiting-author A reviewer has asked the author a question or requested changes. label Nov 11, 2025
@mathlib4-merge-conflict-bot mathlib4-merge-conflict-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Nov 19, 2025
@mathlib4-merge-conflict-bot
Copy link
Copy Markdown
Collaborator

This pull request has conflicts, please merge master and resolve them.

mathlib-bors bot pushed a commit that referenced this pull request Jan 16, 2026
This PR adds `@[push]` tags for set membership. This is a subset of #30042, namely all the `Set` tags.
#30042 also has tags for `Finset` and `Multiset`; as `Set` is the biggest use case of these, we start with just these.
eliasjudin pushed a commit to eliasjudin/mathlib4 that referenced this pull request Jan 18, 2026
This PR adds `@[push]` tags for set membership. This is a subset of leanprover-community#30042, namely all the `Set` tags.
leanprover-community#30042 also has tags for `Finset` and `Multiset`; as `Set` is the biggest use case of these, we start with just these.
bilichboris pushed a commit to bilichboris/mathlib4 that referenced this pull request Jan 18, 2026
This PR adds `@[push]` tags for set membership. This is a subset of leanprover-community#30042, namely all the `Set` tags.
leanprover-community#30042 also has tags for `Finset` and `Multiset`; as `Set` is the biggest use case of these, we start with just these.
goliath-klein pushed a commit to PrParadoxy/mathlib4 that referenced this pull request Jan 24, 2026
This PR adds `@[push]` tags for set membership. This is a subset of leanprover-community#30042, namely all the `Set` tags.
leanprover-community#30042 also has tags for `Finset` and `Multiset`; as `Set` is the biggest use case of these, we start with just these.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author A reviewer has asked the author a question or requested changes. merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants