leanprover / leanprover/lean4

`try?` errors because `simp` errors

Open
#13,216 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Prerequisites
Description

In the following a simple grind only would succeed, but nothing is suggested by try? since it errors out
(probably because it tries simp and that errors out).

example (f : Nat → Nat) (x : Nat) (h : x = f x) : x = f (f x) := by
  /-
  Tactic `simp` failed with a nested error:
  maximum recursion depth has been reached
  use `set_option maxRecDepth <num>` to increase limit
  use `set_option diagnostics true` to get diagnostic information
  -/
  try?
Expected Behaviour

I believe that the simp error should be caught and proof search via the other registered tactics should continue.
A warning that simp errored out would be useful, but it shouldn't completely disable the try? tactic.

Context

See also https://leanprover.zulipchat.com/#narrow/channel/270676-lean4/topic/.60try.3F.60.20fails.20if.20.60simp.60.20fails/with/579279034

This more frequently happens with simp_all since this is much more likely to loop accidentally.

Versions

Lean 4.29.0

Additional Information
Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

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 with the minimal reproducer in the issue and inspect the try? proof-search entry point, especially how errors from simp and simp_all are handled. Done means proof search continues with other registered tactics after those errors, with a useful warning if appropriate, and the example succeeds via grind only.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.