`exact?` fails to close goal

Open
#6,666 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Domain
compilers

Research direction

Start by reproducing the minimal example in live.lean-lang.org with the reported Lean nightly version, comparing exact? and apply? on the LinearO and IsTri variants. Trace the exact? and apply? tactic behavior around matching IsAnti.isSubsingleton h; done means exact? discovers and closes the original goal without an explicit using hypothesis.

Written by the indexing model from the issue text.

Description

bug P-medium
Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

The exact? tactic fails to solve the following goal:

class LinearO (α : Type) (le : α → α → Prop) : Prop where
class IsTri (α : Type) (le : α → α → Prop) : Prop where

instance [LinearO α le] : IsTri α le where

def IsAnti (le : α → α → Prop) (s : α) : Prop := sorry
def IsSubsingleton (s : α) : Prop := sorry

theorem IsAnti.isSubsingleton [IsTri α le] {s : α} (h : IsAnti le s) : IsSubsingleton s := sorry

example [LinearO α le] {s : α} (h : IsAnti le s) : IsSubsingleton s := by
  exact? -- `exact?` could not close the goal. Try `apply?` to see partial suggestions.
Context

Minimized from this Zulip message

Steps to Reproduce
  1. Copy the code above into live.lean-lang.org

Expected behavior: exact? finds the proof exact IsAnti.isSubsingleton h.

Actual behavior: exact? cannot close the goal. apply? finds the lemma but fails to find the matching hypothesis. exact? using h and apply? using h both do not find anything. When changing LinearO to IsTri in the example, exact? succeeds.

Versions

4.16.0-nightly-2025-01-15 on live.lean-lang.org

Impact

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

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

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.

More from leanprover/lean4

All issues in leanprover/lean4

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.