Skip to content

feat: guard against variables in head positions of lhs of simp theorems#13259

Draft
wkrozowski wants to merge 3 commits intoleanprover:masterfrom
wkrozowski:wojciech/simpVarHead
Draft

feat: guard against variables in head positions of lhs of simp theorems#13259
wkrozowski wants to merge 3 commits intoleanprover:masterfrom
wkrozowski:wojciech/simpVarHead

Conversation

@wkrozowski
Copy link
Copy Markdown
Contributor

@wkrozowski wkrozowski commented Apr 2, 2026

This PR adds a check that rejects simp theorems whose left-hand side has a variable as the head symbol (e.g. x = x + 0 or x 0 = x 0 + 0). Such theorems cause the simplifier to loop or match everything, since the head symbol is unconstrained. The check applies to both @[simp] and attribute [simp ←].

@wkrozowski wkrozowski requested a review from leodemoura as a code owner April 2, 2026 14:43
@wkrozowski wkrozowski added the changelog-tactics User facing tactics label Apr 2, 2026
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Apr 2, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase f7ec39d6a164820200fc971fe675eb02e6b30591 --onto fc0cf68539ad3b481a1802414c22c44506519c9d. You can force Mathlib CI using the force-mathlib-ci label. (2026-04-02 15:36:28)

@leanprover-bot
Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase f7ec39d6a164820200fc971fe675eb02e6b30591 --onto 861bc19e0c1c45b5766cc5c9ef0488568368b236. You can force reference manual CI using the force-manual-ci label. (2026-04-02 15:36:30)

@wkrozowski wkrozowski marked this pull request as draft April 2, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-tactics User facing tactics toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants