Open
Conversation
bb8e3ed to
c992f58
Compare
Contributor
Author
|
!bench |
|
Benchmark results for c992f58 against d76e5a1 are in. No significant results found. @sgraf812
Small changes (4✅, 2🟥)
|
Collaborator
|
Reference manual CI status:
|
mathlib-nightly-testing bot
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Apr 13, 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 adds level instantiation and normalization in
getDecLevelandgetDecLevel?before callingdecLevel.getLevelcan return levels with uninstantiated metavariables or un-normalized structure, such asmax ?u ?vwhere the metavariables have already been assigned. After instantiation and normalization (vianormalizeLevel), a level likemax ?u ?v(with?u := 1, ?v := 0) simplifies to1 = succ 0, whichdecLevelcan decrement. Without this step,decLevelseesmax ?u ?v, tries to decrement both arms, fails on a zero-valued arm, and reports "invalid universe level".Concretely, this fixes
forloops withmutvariables of sort-polymorphic type (e.g.PProd Nat True) where the state tuple's universe level ends up as an uninstantiatedmax.The expected-output change in
doNotation1.leanis because theforloop's unit type now resolves toUnitinstead ofPUnitdue to the improved level handling.