Skip to content

fix: update defLemma and related linters correctly#1727

Open
thorimur wants to merge 8 commits intoleanprover-community:mainfrom
thorimur:fix-defLemma-isInstance
Open

fix: update defLemma and related linters correctly#1727
thorimur wants to merge 8 commits intoleanprover-community:mainfrom
thorimur:fix-defLemma-isInstance

Conversation

@thorimur
Copy link
Copy Markdown
Contributor

@thorimur thorimur commented Mar 20, 2026

This PR fixes an issue where the defLemma linter wrongly ignored @[implicit_reducible] defs due to an incorrect adaptation when bumping lean versions. Zulip

However, instances created through the delta-deriving handler do not properly get registered as theorems (leanprover/lean4#13295) and are instead always defs. We ignore definitions satisfying both isInstance and isImplicitReducible as a workaround.

We also take this chance to (1) note that leanprover/lean4#2575 has been fixed, allowing us to remove some workarounds in defLemma and other linters (2) clean up the code slightly.

@github-actions github-actions bot added the awaiting-review This PR is ready for review; the author thinks it is ready to be merged. label Mar 20, 2026
mathlib-nightly-testing bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Mar 20, 2026
mathlib-nightly-testing bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Mar 20, 2026
mathlib-nightly-testing bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Mar 20, 2026
mathlib-nightly-testing bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Apr 6, 2026
mathlib-nightly-testing bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Apr 7, 2026
@thorimur
Copy link
Copy Markdown
Contributor Author

thorimur commented Apr 7, 2026

Hmm, this builds mathlib after including a workaround, but maybe we should instead just wait for leanprover/lean4#13304 to land and percolate through, which fixes the issue I'm working around? Not sure how long that would be.

EDIT: Ok, great, Kim has fixed it, so I suppose let's just wait :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review This PR is ready for review; the author thinks it is ready to be merged. breaks-mathlib

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants