leanprover-community / leanprover-community/mathlib4

`zify!` tactic

Open
#7,450 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement t-meta
Dominant language
Lean
Stars
4.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

The zify tactic is considered the default way to deal with goals that use tsub natural subtraction. One of the more tedious aspects of using this tactic is manually inputting all of the inequalities that allow zify to determine if a - b cast to ints should be (a : Z) - (b : Z) or zero. Very often the answer is that it is always the former.

I would like a zify! tactic that automates some of this away. I could see two ways:

  1. Assume all the subtractions are not truncated for the purposes of the cast, and then spinning these off as additional goals.
  2. Recursively splitting into cases for each subgoal, and then letting the user deal with all the subcases (perhaps applying linarith or ring to each subcase to catch the trivial ones).

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 reading the existing zify tactic and how it handles casts of natural subtraction. Compare the two proposed automation approaches, then define and validate the intended behavior for generated inequality goals and resulting subcases.

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
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.