Skip to content

[Merged by Bors] - chore(*): reduce defeq abuse around Set - #35752

Closed
urkud wants to merge 4 commits into
leanprover-community:masterfrom
urkud:set-defeq-abuse
Closed

urkud wants to merge 4 commits into
leanprover-community:masterfrom
urkud:set-defeq-abuse

Conversation

@urkud

@urkud urkud commented Feb 25, 2026 •

Copy link
Copy Markdown
Member

Open in Gitpod

Also drop `Membership` instance on `Finset`
in favor of the one coming from `SetLike`.
@github-actions

github-actions Bot commented Feb 25, 2026 •

Copy link
Copy Markdown

PR summary d300915bf1

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ image_diff_subset
+ mem_bijective
+ mem_injective
+ mem_surjective

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


Decrease in tech debt: (relative, absolute) = (1.00, 0.00)
Current number Change Type
11955 -1 backward.isDefEq

Current commit 264fac7e78
Reference commit d300915bf1

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).

Comment on lines -270 to -271
use rename (Set.inclusion s₁.subset_union_left) q₁
use rename (Set.inclusion s₁.subset_union_right) q₂

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is wrong for this one? Isn't Set.inclusion well-typed?

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.

s1 is a Finset, and it looks like after my changes (not sure which one, since I've tried to move Finset changes out of this PR), the unification of (((s : Finset _) : Set _) : Type _) with ((s : Finset _) : Type _) fails.

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.

Also, subset here is about Finsets, not Sets.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess inclusion is reducible anyway so this hardly matters.

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.

On master, simp uses elem_mem here.

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.

@eric-wieser Do you want me to add an #adaptation_note?

@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.

Thanks!

maintainer delegate

Comment thread Mathlib/Data/Set/Function.lean Resolved
@github-actions

Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by YaelDillies.

@mathlib-triage mathlib-triage Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Feb 25, 2026
@eric-wieser

Copy link
Copy Markdown
Member

bors d+

Thanks!

@mathlib-bors

mathlib-bors Bot commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

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

@mathlib-triage mathlib-triage Bot added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Feb 25, 2026
@urkud urkud added the auto-merge-after-CI Please do not add manually. Requests for a bot to merge automatically once CI is done. label Feb 25, 2026
@mathlib-auto-merge

Copy link
Copy Markdown

As this PR is labelled auto-merge-after-CI, we are now sending it to bors:

bors merge

mathlib-bors Bot pushed a commit that referenced this pull request Feb 25, 2026
@mathlib-bors

mathlib-bors Bot commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title chore(*): reduce defeq abuse around Set [Merged by Bors] - chore(*): reduce defeq abuse around Set Feb 25, 2026
@mathlib-bors mathlib-bors Bot closed this Feb 25, 2026
pfaffelh pushed a commit to pfaffelh/mathlib4 that referenced this pull request Mar 2, 2026
@urkud
urkud deleted the set-defeq-abuse branch March 5, 2026 08:15
pevogam pushed a commit to pevogam/mathlib4 that referenced this pull request Mar 19, 2026
mathlib-bors Bot pushed a commit that referenced this pull request May 11, 2026
…in Cantor's theorem (#39147)

#6114 and #35752 removed the defeq abuse in `Function.cantor_surjective`, then #35239 golfed it, reintroducing defeq abuse.
This reverts the golf to avoid defeq abuse, and cleans up a bit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-after-CI Please do not add manually. Requests for a bot to merge automatically once CI is done. delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants