Skip to content

fix: don't error in defeq for missing unification hints - #14733

Open
Rob23oba wants to merge 2 commits into
leanprover:masterfrom
Rob23oba:unif-hint-fix-private
Open

fix: don't error in defeq for missing unification hints#14733
Rob23oba wants to merge 2 commits into
leanprover:masterfrom
Rob23oba:unif-hint-fix-private

Conversation

@Rob23oba

@Rob23oba Rob23oba commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

This PR fixes the handling of unification hints to not fail with an "unknown constant" error if the unification hint is not available in the current environment. This happens mostly when the unification hint is only imported privately but we are in a public context.

Closes #14734

@Rob23oba Rob23oba changed the title fix: don't error defeq for missing unification hints fix: don't error in defeq for missing unification hints Aug 10, 2026
@github-actions github-actions Bot added the changelog-language Language features and metaprograms label Aug 10, 2026
@Rob23oba
Rob23oba marked this pull request as ready for review August 10, 2026 12:27
@github-actions github-actions Bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Aug 10, 2026
@leanprover-bot

Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2026-08-08 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-manual, reference manual CI should run now. You can force reference manual CI using the force-manual-ci label. (2026-08-10 12:42:13)

@github-actions github-actions Bot added the mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN label Aug 10, 2026
@TwoFX

TwoFX commented Aug 10, 2026

Copy link
Copy Markdown
Member

This needs a test :)

@Rob23oba

Copy link
Copy Markdown
Contributor Author

Here you go :-)

@mathlib-lean-pr-testing mathlib-lean-pr-testing Bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Aug 10, 2026
@mathlib-lean-pr-testing

mathlib-lean-pr-testing Bot commented Aug 10, 2026

Copy link
Copy Markdown

Mathlib CI status (docs):

@Rob23oba

Copy link
Copy Markdown
Contributor Author

By the way, I would consider this one low priority, since I'm not blocked by this anymore. But I'd also like to mention that it seems to be a larger issue that also affects e.g. simp:

public def abc := 3

@[local simp]
theorem abc_eq : abc = 3 := (rfl)

@[expose]
public def hello (x : Fin 3) : Fin abc := by simp -- error: unknown constant `abc_eq`

Maybe you can discuss this in the FRO some time though (i.e. what's the right thing to do for environment extensions like this under the module system?)

mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Aug 10, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-mathlib CI has verified that Mathlib builds against this PR changelog-language Language features and metaprograms mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unknown constant error for privately imported unification hint

3 participants