leanprover / lean4

Lean 4 programming language and theorem prover
https://lean-lang.org
Apache License 2.0
3.82k stars 325 forks source link

wrong `rfl` error message when no goals are left #4063

Closed chrisflav closed 1 week ago

chrisflav commented 2 weeks ago

Prerequisites

Description

The new error message printed by the rfl tactic is also shown when rfl is used with no goals left.

example : 3 = 3 := by
  rfl
  rfl

This prints on the second rfl:

The rfl tactic failed. Possible reasons:

  • The goal is not a reflexive relation (neither = nor a relation with a @[refl] lemma).
  • The arguments of the relation are not equal.

Try using the reflexivitiy lemma for your relation explicitly, e.g. exact Eq.rfl.

but should instead print

no goals to be solved

Steps to Reproduce

  1. Copy the above snippet in https://live.lean-lang.org

Expected behavior: Print "no goals to be solved" error message

Actual behavior: Standard rfl error message is shown.

Versions

4.8.0-rc1 Debian Bookworm / https://live.lean-lang.org

Impact

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