Unknown constant error for privately imported unification hint
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
Prerequisites
- 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
If a unification hint is only in the private environment (because of a private import or because the hint itself is private) but the definitional equality check tries to use it in a public context, it fails with an error message "Unknown constant hint".
Context
#14532
Steps to Reproduce
module
public def MyType (_ : Nat) := Nat
local unif_hint where ⊢ MyType 0 =?= Nat
-- Error: Unknown constant `_private...hint✝`
public def test (x : MyType 0) (y : Fin (by with_reducible exact x)) : Nat := 3
Expected behavior:
The definitional equality check simply fails and we get an error message of the shape ... was expected to have type ....
Actual behavior:
We get an error message "Unknown constant _private...hint✝"
Versions
Lean 4.34.0-nightly-2026-08-09
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests. Start by running the self-contained Lean reproduction against the reported nightly version, then trace the definitional equality check and private unification-hint handling; done means the reproduction reports the expected type-mismatch error rather than an unknown private constant.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100