Skip to content

Conversation

@JovanGerb
Copy link
Collaborator

This PR adds a linter that helps avoid unneccessary uses of to_dual/to_additive. With to_dual self it can sometimes be hard to tell if it's actually doing anything or not, so this will help with that.


Open in Gitpod

@github-actions
Copy link

github-actions bot commented Dec 23, 2025

PR summary bb55063693

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ Filter.Tendsto.enorm
+ Inseparable.enorm_eq_enorm
- not_lt_self

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

@vihdzp
Copy link
Collaborator

vihdzp commented Dec 23, 2025

As always I'd like to give thanks for the useful code, and express my regrets for being unable to review the metaprogramming.

@bryangingechen bryangingechen self-assigned this Dec 23, 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 Dec 29, 2025
@mathlib4-merge-conflict-bot
Copy link
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 Dec 29, 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 Jan 1, 2026
@mathlib4-merge-conflict-bot
Copy link
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 Jan 3, 2026
@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 Jan 7, 2026
@mathlib4-merge-conflict-bot
Copy link
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 Jan 7, 2026
@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 Jan 9, 2026
@mathlib4-merge-conflict-bot
Copy link
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 Jan 11, 2026
@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 Jan 13, 2026
@mathlib4-merge-conflict-bot
Copy link
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 Jan 13, 2026
@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 Jan 14, 2026
@mathlib4-merge-conflict-bot
Copy link
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 Jan 14, 2026

@[to_additive Inseparable.enorm_eq_enorm]
theorem Inseparable.enorm_eq_enorm' {E : Type*} [TopologicalSpace E] [ContinuousENorm E]
theorem Inseparable.enorm_eq_enorm {E : Type*} [TopologicalSpace E] [ContinuousENorm E]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The primed version and unprimed version were literally the same thing. This was caught by the linter.

Copy link
Contributor

@bryangingechen bryangingechen left a comment

Choose a reason for hiding this comment

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

Thanks!
bors r+

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the ready-to-merge This PR has been sent to bors. label Jan 14, 2026
mathlib-bors bot pushed a commit that referenced this pull request Jan 14, 2026
…33239)

This PR adds a linter that helps avoid unneccessary uses of `to_dual`/`to_additive`. With `to_dual self` it can sometimes be hard to tell if it's actually doing anything or not, so this will help with that.
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Jan 14, 2026

Build failed:

@bryangingechen
Copy link
Contributor

bors d+

@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Jan 14, 2026

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

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Jan 14, 2026
@JovanGerb
Copy link
Collaborator Author

bors r+

mathlib-bors bot pushed a commit that referenced this pull request Jan 14, 2026
…33239)

This PR adds a linter that helps avoid unneccessary uses of `to_dual`/`to_additive`. With `to_dual self` it can sometimes be hard to tell if it's actually doing anything or not, so this will help with that.
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Jan 14, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(to_dual): linter for redundant uses of to_dual/to_additive [Merged by Bors] - feat(to_dual): linter for redundant uses of to_dual/to_additive Jan 14, 2026
@mathlib-bors mathlib-bors bot closed this Jan 14, 2026
@adomani adomani mentioned this pull request Jan 16, 2026
eliasjudin pushed a commit to eliasjudin/mathlib4 that referenced this pull request Jan 18, 2026
…eanprover-community#33239)

This PR adds a linter that helps avoid unneccessary uses of `to_dual`/`to_additive`. With `to_dual self` it can sometimes be hard to tell if it's actually doing anything or not, so this will help with that.
goliath-klein pushed a commit to PrParadoxy/mathlib4 that referenced this pull request Jan 24, 2026
…eanprover-community#33239)

This PR adds a linter that helps avoid unneccessary uses of `to_dual`/`to_additive`. With `to_dual self` it can sometimes be hard to tell if it's actually doing anything or not, so this will help with that.
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). ready-to-merge This PR has been sent to bors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants