variable-notation-variable chain breaks hygiene tracking
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
variable (x : Nat)
local notation "Finx" => Fin x
def val (y : Finx) : Nat := y
variable (y : Finx)
-- Declaration uses sorry:
def val' : Nat := y
The issue is here: https://github.com/leanprover/lean4/blob/e9d60e143a8b1ee06be1f201f78068250a2b8949/src/Lean/Elab/Command.lean#L442-L449
We first elaborate all section variables as binders and then register them as such but that is wrong if one section variable references another via a notation, which is where sectionFVars is needed. We should elaborate and add them to sectionFVars one by one.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/Lean/Elab/Command.lean around lines 442-449 and reproduce the notation-based section-variable example from the issue. Trace how section variables are elaborated and registered, focusing on sectionFVars. Done means the variable chain no longer breaks hygiene tracking when one section variable references another through a local notation.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100