suffixes of hygienic goal names
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
Prerequisites
Please put an X between the brackets as you perform the following steps:
- Check that your issue is not already filed:
https://github.com/leanprover/lean4/issues - Reduce the issue to a minimal, self-contained, reproducible test case.
Avoid dependencies to Mathlib or Batteries. - Test your test case against the latest nightly release, for example on
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
Description
some tactics (e.g. apply) introduce hygienized goal names; later on the "case tag" tactic checks if tag is a suffix of the hygienized goal name, failing. This is also very confusing because the hygienic part of the goal name is hidden to the users
Context
[Broader context that the issue occured in. If there was any prior discussion on the Lean Zulip, link it here as well.]
Steps to Reproduce
axiom set: Type
axiom mem: set → set → Prop
infix:50 (priority := high) " ∈ " => mem
axiom ax_extensionality: ∀A, (∀Z, Z ∈ A → Z ∈ A) → A=A
axiom union: set → set → set
infix:70 (priority := high) " ∪ " => union
axiom K1 : Prop
axiom K2 : Prop
axiom ax_union1: ∀A B, ∀Z, (Z ∈ A ∪ B → K1 ∨ K2)
theorem union_symmetric: ∀A: set, A∪A=A∪A := by
intros A
apply ax_extensionality
intro Z
intro U
have H : K1 ∨ K2 := ax_union1 A A Z U
cases H
. case inl => sorry --- error here: inl is not a suffix because the goal name is really a.inl._@.VerboseMatita.Bug._hyg.1269
. sorry
- enter the code above
- the error is in the line with the comment; the comment explains why the error occurs; Sebastian explained on Zulip that the hygienized name is actually due to the only "apply" tactic
Expected behavior: [Clear and concise description of what you expect to happen]
"case inl" should match the goal
Actual behavior: [Clear and concise description of what actually happens]
but it does not
Versions
4.9.0-rc3
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
Reproduce the provided Lean snippet on the latest nightly release and confirm that case inl fails because of the hygienic goal-name suffix. Then inspect the case tag tactic and the goal-name hygiene handling. Done means case inl matches the user-visible goal while preserving hygienic naming behavior.
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
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100