leanprover / leanprover/lean4

`ungrind` mode error message refers to non-existent `show_patterns` tactic

Open
#11,996 0 comments 0 reactions 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

When grind tactic mode fails to instantiate new facts, it prints an error message suggesting to take a look at the theorems' patterns via a show_patterns tactic. However, such a tactic does not exist.

Steps to Reproduce

Take a look at the test grind_preinstance_set_bug.lean:

opaque f : Nat → Nat
opaque g : Nat → Nat
theorem fax : f (x + 1) = g (f x) := sorry

/--
error: `instantiate` tactic failed to instantiate new facts, use `show_patterns` to see active theorems and their patterns.
-/
#guard_msgs in
example : f (x + 5) = a := by
  grind =>
    use [fax]; use [fax]; use [fax]; use [fax]; use [fax];
    use [fax] -- Should fail - no new facts
    -- try writing `show_patterns` here; tactic does not exist

Expected behavior: [Clear and concise description of what you expect to happen]

If a tactic (or command?) is mentioned, it should exist. Therefore, I would expect a show_patterns tactic to exist alongside show_local_thms etc.

Actual behavior: [Clear and concise description of what actually happens]

show_patterns does not exist. The other tactics I know of, such as show_local_thms, do not actually show the e-matching patterns of the local theorems.

Versions
Lean 4.28.0-nightly-2026-01-12
Target: x86_64-unknown-linux-gnu
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 grind_preinstance_set_bug.lean reproduction and the failing instantiate diagnostic. Trace how grind reports the missing show_patterns tactic and inspect the existing show_local_thms behavior. Done means the reported guidance names an available way to inspect theorem patterns, with the regression test passing.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.