Skip to content

fix: reuse the instances of a non-exposed definition in inferInstanceAs - #14840

Open
gasparattila wants to merge 2 commits into
leanprover:nightly-with-mathlibfrom
gasparattila:inferInstanceAs-reuse-fix
Open

fix: reuse the instances of a non-exposed definition in inferInstanceAs#14840
gasparattila wants to merge 2 commits into
leanprover:nightly-with-mathlibfrom
gasparattila:inferInstanceAs-reuse-fix

Conversation

@gasparattila

Copy link
Copy Markdown

This PR makes inferInstanceAs reuse the existing instances of a non-exposed definition. This is done by checking the reusability of an instance in the private scope, as neither the auxiliary definitions being generated nor the ones in the existing instance are exposed in this case.

Closes #14470.

@gasparattila
gasparattila changed the base branch from master to nightly-with-mathlib August 19, 2026 10:43
…eAs`

This PR makes `inferInstanceAs` reuse the existing instances of a non-exposed definition. This is done by checking the reusability of an instance in the private scope, as neither the auxiliary definitions being generated nor the ones in the existing instance are exposed in this case.

Closes leanprover#14470.
@gasparattila
gasparattila force-pushed the inferInstanceAs-reuse-fix branch from 49f216b to dcbe419 Compare August 19, 2026 10:45
@gasparattila

Copy link
Copy Markdown
Author

changelog-language

@github-actions github-actions Bot added changelog-language Language features and metaprograms toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN labels Aug 19, 2026
@mathlib-lean-pr-testing

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

Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase b80e8491105a1bcc679136b8b583ee7896b24a78 --onto dec70ee4980b571229f784a33d72b421ede3b1d5. You can force Mathlib CI using the force-mathlib-ci label. (2026-08-19 10:51:57)
  • ✅ Mathlib branch lean-pr-testing-14840 has successfully built against this PR. (2026-08-19 12:22:36) View Log

@leanprover-bot

leanprover-bot commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase b80e8491105a1bcc679136b8b583ee7896b24a78 --onto 3fc29d37a70f8fd904ebab848557c12383543008. You can force reference manual CI using the force-manual-ci label. (2026-08-19 10:51:59)
  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2026-08-18 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-19 11:29:34)

@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 19, 2026
@mathlib-lean-pr-testing mathlib-lean-pr-testing Bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Aug 19, 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.

inferInstanceAs does not reuse existing instances of a non-exposed definition

2 participants