(kernel) invalid projection when extracting the proposition from an `Exists` statement.
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Check that your issue is not already filed.
- Reduce the issue to a minimal, self-contained, reproducible test case. Avoid dependencies to mathlib4 or std4.
Description
The following code explains the issue:
set_option pp.rawOnError true
/- Error:
(kernel) invalid projection
h.2
-/
example (h : ∃ _ : Nat, P) : P := h.2
/- Works -/
example (h : ∃ _ : Nat, P) : P := by
let ⟨_, P⟩ := h
exact P
Context
The issue is discussed here. It seems that the error makes sense, but Alex suggested me to open an issue since it's a kernel error.
Versions
The error appears since Lean (version 4.0.0, commit ec941735c80d, Release) up til v4.2.0-rc1, on a Mac Intel.
Others
As mentioned above, the error makes sense from a human perspective, so if this kernel error is intended, feel free to close this issue :)
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 by running the minimal reproducer in the issue and comparing the failing h.2 projection with the working pattern-matching example. Investigate the kernel's handling of projections from Exists; done means the behavior is clarified and either corrected or documented as intended.
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
- Needs clarification
- Newbie friendliness
- 35/100