Skip to content
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

fix: make name unresolution consistent and avoid auxiliary names #6938

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jrr6
Copy link
Contributor

@jrr6 jrr6 commented Feb 4, 2025

This PR ensures that names suggested by simp? are not shadowed by auxiliary declarations in the local context.

This PR moves unresolveNameGlobalAvoidingLocals into the Term namespace and restricts it to TermElabM, since it is impossible to correctly resolve some auxiliary declarations (e.g., in a mutual block) without access to the auxDeclToFullName map in the TermElabM context. It also adds auxDeclToFullName to the SavedContext for postponed expressions, which ensures that (un)resolution of auxiliary-declaration names is consistent between terms and tactic blocks (previously, it was not possible to refer to certain auxiliary declarations by suffixes in a tactic block).

Closes #6706.

@jrr6 jrr6 added the changelog-language Language features, tactics, and metaprograms label Feb 4, 2025
@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 Feb 4, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Feb 4, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Feb 4, 2025
@leanprover-community-bot leanprover-community-bot added the breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan label Feb 4, 2025
@leanprover-community-bot
Copy link
Collaborator

Mathlib CI status (docs):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan changelog-language Language features, tactics, and metaprograms 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.

simp? can still incorrectly unresolve a name to the current theorem name
2 participants