-
Notifications
You must be signed in to change notification settings - Fork 710
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Prerequisites
Please put an X between the brackets as you perform the following steps:
- Check that your issue is not already filed:
https://github.com/leanprover/lean4/issues - Reduce the issue to a minimal, self-contained, reproducible test case.
Avoid dependencies to Mathlib or Batteries. - Test your test case against the latest nightly release, for example on
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
Description
Private lemmas marked as @[congr] from imported modules are used by simp even though they are not visible, causing unknown constant errors.
Steps to Reproduce
- Check out the Lake project in this branch: https://github.com/datokrat/lean-bug-reproductions/tree/bugs7
- Open
Reproductions/Basic.leanand observe the error.
Reproductions/Dependency.lean:
module
public def f : Nat → Nat := sorry
@[congr]
theorem t (h : m = n) : f m = f n := sorrymodule
import Reproductions.Dependency
/-- error: Unknown constant `_private.Reproductions.Dependency.0.t` -/
#guard_msgs in
theorem u (h : m = n) : f m = f n := by
simp [h]Expected behavior:
simp should only use congr lemmas that are visible. (In the given example, theorem u should succeed because simp actually doesn't need to use a specialized congr lemma.)
Actual behavior:
An unknown constant error is caused by simp.
Versions
Lean 4.27.0-nightly-2025-11-30
Target: arm64-apple-darwin24.6.0 macOS
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working