8000 feat: improve error message when passing local hypotheses to `grind` by marcusrossel · Pull Request #8891 · leanprover/lean4 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: improve error message when passing local hypotheses to grind #8891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marcusrossel
Copy link
Contributor

This PR improves the error message produced when passing (automatically redundant) local hypotheses to grind.

@marcusrossel
Copy link
Contributor Author

For example, previously, we'd have:

example : 0 = 0 := by
  have h : 1 = 1 := rfl
  grind [h] 
       --^
       -- unknown constant 'h'

And now, we have:

example : 0 = 0 := by
  have h : 1 = 1 := rfl
  grind [h]
       --^
       -- redundant parameter `h`, `grind` uses local hypotheses automatically

@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 Jun 20, 2025
@leanprover-community-bot
Copy link
Collaborator

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 743c60224aae14939a483b307c578f9874dbe999 --onto 0077dd3d5569527f023865099890fa5aa9ffbe77. You can force Mathlib CI using the force-mathlib-ci label. (2025-06-20 05:23:59)


-- example : 0 = 1 := by
-- have h : 0 = 1 := sorry
-- grind [- h]
Copy link
Collaborator
@nomeata nomeata Jun 20, 2025

Choose a reason for hiding this comment

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

Maybe add a test where a local hypothesis shadows a global declaration, just so that a change in behavior in that case will not go unnoticed?

@kim-em kim-em added the awaiting-author Waiting for PR author to address issues label Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-author Waiting for PR author to address issues 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.

4 participants
0