leanprover-community / leanprover-community/mathlib4
`casesm` changed behaviour, does not deconstruct inductive types
Open
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 4.1k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
In lean 3:
inductive two_points
| zero
| one
namespace two_points
theorem mwe : ∀ (x : two_points), x = zero ∨ x = one := λ x, by casesm _; simp -- works
end two_points
In lean 4:
import Mathlib.Tactic.CasesM
inductive twoPoints
| zero
| one
namespace twoPoints
theorem mwe : ∀ (x : twoPoints), x = zero ∨ x = one := fun x ↦ by casesm _ <;> simp -- no match
end twoPoints
Not sure if this was intended behavior, but it was definitely used in mathlib3, e.g. data.sign, so some proofs break now.
Related Zulip thread: here.
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 with the Mathlib.Tactic.CasesM entry point and reproduce the two_points example from the issue. Compare the Lean 4 behavior with the Lean 3 example and check the data.sign reference for affected usage. Done means casesm deconstructs the inductive type as expected and the relevant proof examples work.
Written by the indexing model from the issue text.
Assessment
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100