fix: export proofs in variable binders of a public section - #15394
Open
marcelolynch wants to merge 1 commit into
Open
marcelolynch wants to merge 1 commit into
marcelolynch wants to merge 1 commit into
Conversation
marcelolynch
force-pushed
the
fix-section-var-aux-names
branch
from
September 29, 2026 03:18
1631711 to
a3e2793
Compare
This PR fixes proofs in `variable` binders inside `public section`. Such a proof became an auxiliary theorem with a private name that was not exported, but the public declarations that include the variable mention it. A `module` file that used these declarations failed with `unknown constant`. These auxiliary theorems now get public names and are exported. Fixes leanprover#15393. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
marcelolynch
force-pushed
the
fix-section-var-aux-names
branch
from
September 29, 2026 03:39
a3e2793 to
57d800e
Compare
marcelolynch
marked this pull request as ready for review
September 29, 2026 03:48
3 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes proofs in
variablebinders insidepublic section, for example proofs from an auto-param. Public declarations that include such a variable referred to an auxiliary theorem that was not exported, so amodulefile that used these declarations failed withunknown constant.Command.runTermElabMelaborates the section variables again for each declaration, before the declaration name sets the prefix for auxiliary names. In an exporting context,mkAuxLemmacaches the abstracted proof as public, but the command-level name generator gives it a private name, soaddDecldoes not export it.runTermElabMnow elaborates the section variables with a public, macro-scoped prefix when the environment is exporting. The macro scope keeps the names unique across modules. The previous generator is restored beforeelabFnruns.This PR does not change the related case where a metaprogram adds a public declaration whose type mentions a private constant (#15401).
Fixes #15393.
🤖 Generated with Claude Code