feat: instances should always be non-recursive#12307
Draft
Kha wants to merge 9 commits intoleanprover:masterfrom
Draft
feat: instances should always be non-recursive#12307Kha wants to merge 9 commits intoleanprover:masterfrom
Kha wants to merge 9 commits intoleanprover:masterfrom
Conversation
Collaborator
|
Reference manual CI status:
|
nomeata
reviewed
Feb 4, 2026
Co-authored-by: Joachim Breitner <mail@joachim-breitner.de>
mathlib-nightly-testing bot
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Feb 5, 2026
mathlib-nightly-testing bot
pushed a commit
to leanprover-community/mathlib4-nightly-testing
that referenced
this pull request
Feb 5, 2026
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 changes the
instancecommands to no longer be accepted inmutualblocks and not to accept recursive uses of the instance name, if any. Such uses were problematic in two ways: first, one could assume that by being able to placeinstanceinmutual, the instances would be able to refer to each either implicitly but this has never been the case;instanceused to behave likedefin there and so it is better to be explicit about that by writing separatedefs. Second, instances have special reducibility,@[instance_reducible]by default. The implementation of an instance, where the recursive use happens, should not have this reducibility, so even for non-structure classes, a separate implementation recursivedef(orwhere) should be used.Breaking changes
instancecommands to no longer are accepted inmutualblocks and do not accept recursive uses of the instance name, if any.