Repository navigation
fix: do not export realizations triggered only from proofs - #16623
Merged
Merged
Conversation
This PR stops a `module` from exporting constants such as `foo.eq_1` when they were realized only inside a proof, so that such proofs no longer trigger downstream rebuilds. Importing modules realize these constants again on demand. Previously, such a constant reached the exported `.olean` through the `allRealizations` fallback of `Environment.find?`, which returns the private constant info, so the theorem was exported together with its proof. `mkModuleData` and the exported-level filters of attributes, instances, matcher info, `MapDeclarationExtension`s, and the axiom extension now consider only constants known on the main environment branch. --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Kha
marked this pull request as ready for review
November 20, 2026 09:15
|
The adaptation PR for this PR is leanprover/downstream-lean4#266. |
Kha
added a commit
that referenced
this pull request
Nov 21, 2026
This reverts "fix: export theorems realized inside proofs as axioms" and its test. Since #16623, a constant realized only inside a proof is not exported at all, which covers the same case. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Open
3 of 4 tasks
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 stops a
modulefrom exporting constants such asfoo.eq_1when they were realized only inside a proof, so that such proofs no longer trigger downstream rebuilds. Importing modules realize these constants again on demand.Previously, such a constant reached the exported
.oleanthrough theallRealizationsfallback ofEnvironment.find?, which returns the private constant info, so the theorem was exported together with its proof.mkModuleDataand the exported-level filters of attributes, instances, matcher info,MapDeclarationExtensions, and the axiom extension now consider only constants known on the main environment branch.This re-applies #15559, which was reverted in #15655 because
unfoldon non-recursive definitions depended on the visibility ofeq_def.