leanprover-community / leanprover-community/lean

simp sometimes gives an obscure error for nonexistent lemma

Open
#248 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
434
Forks
79
PR merge metrics
No merged PRs in 30d

Description

Prerequisites
  • Put an X between the brackets on this line if you have done all of the following:
    • Checked that your issue isn't already filed.
    • Reduced the issue to a self-contained, reproducible test case.
Description

simp [prod.mk.inj_iff77] gives an obscure error:

invalid simplification lemma 'prod.mk.inj_iff77' (use command 'set_option trace.simp_lemmas true' for more details)
state:
⊢ true

The recommended option has no effect.

For some reason, some other names give a better error, for example, simp [potato] results in unknown identifier 'potato'.

Steps to Reproduce
set_option trace.simp_lemmas true
example : true :=
begin
  simp only [prod.mk.inj_iff77]
end

Expected behavior: Error: unknown identifier 'prod.mk.inj_iff77'

Actual behavior: Error: invalid simplification lemma 'prod.mk.inj_iff77' (use command 'set_option trace.simp_lemmas true' for more details)

Reproduces how often: Always, but unclear under what circumstances (see above).

Versions

Lean (version 3.9.0, commit cb9f9f838475, Release)
Also observed with
Lean (version 3.11.0, commit fb3f3e88be8a, Release)

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 provided simp only [prod.mk.inj_iff77] reproduction and compare it with simp [potato]. Trace the simplifier's handling of unresolved names, including whether set_option trace.simp_lemmas true is honored. Done means the nonexistent lemma reports unknown identifier, with the trace option behaving as documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.