leanprover / leanprover/lean4

Make `rcases` use the `induction`/`cases` framework

Open
#3,901 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement P-medium
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

Currently rcases uses Lean.MVarId.cases, but the cases tactic uses its own system of applying casesOn.

The rcases tactic should use the same system as cases.

Note that #3747 introduced a hack into Lean.MVarId.cases via the useNatCasesAuxOn argument for the "beautiful Nat induction" project. This should be removed, since this has a general solution via @[induction_eliminator] and @[cases_eliminator] in induction/cases. (The Lean.MVarId.cases is a low-level function that should not use user-defined eliminators.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing Lean.MVarId.cases with the cases tactic's casesOn application path, then inspect how induction/cases eliminators are selected. Trace the useNatCasesAuxOn argument introduced by #3747. Done means rcases uses the same cases framework, while the low-level MVarId.cases hack is removed without breaking the intended Nat induction behavior.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.