leanprover-community / leanprover-community/mathlib4
A `clear_unneeded` tactic
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 4.2k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
Sometimes, in the course of proving, the Infoview becomes cluttered. For this, it is useful to have tactics like clear to remove unnecessary variables and assumptions. But clear requires the user to identify the variables that are unnecessary for the proof.
This issue proposes a tactic that identifies these automatically. There are a few levels of sophistication at which this could work.
- If (a : α) is a hypothesis and α is Nonempty, but a is never used elsewhere, delete a.
- If (h : a = ...) if a hypothesis and a is never used elsewhere, delete h.
- (Advanced) Supply a discharging tactic, and for each hypothesis, attempt to use that tactic to prove that hypothesis from the other hypotheses, removing it if it is provable.
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 linked Zulip discussion and the existing clear tactic. Compare the proposed levels of automation and determine which scope should be implemented first. Done means a clear_unneeded tactic has agreed behavior for removing unused or derivable hypotheses.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100