fix: do not bump transparency to instances in eqn LHS whnf#13512
Merged
Conversation
This PR changes `whnfAux` in the equation-theorem generation machinery to use reducible transparency (`whnfR`) instead of instances transparency (`whnfI`). Previously, the loop in `Eqns.go` would unfold instances on the LHS, which interacts badly with users that mark `dite`/`ite` as `implicit_reducible`: equation generation would reduce past the `dite` and get stuck instead of committing to a branch. The original motivation for `whnfI` (reducing `Nat.rec ... (OfNat.ofNat 0)` residuals from `match` on numeric literals) is already covered by the surrounding `simpMatch?`/`simpIf?`/`simpTargetStar` steps in `Eqns.go`, so the full test suite continues to pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
|
Reference manual CI status:
|
|
Mathlib CI status (docs):
|
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
whnfAuxin the equation-theorem generation machinery to usereducible transparency (
whnfR) instead of instances transparency (whnfI).Previously, the loop in
Eqns.gowould unfold instances on the LHS, whichinteracts badly with users that mark
dite/iteasimplicit_reducible:equation generation would reduce past the
diteand get stuck instead ofcommitting to a branch. The original motivation for
whnfI(reducingNat.rec ... (OfNat.ofNat 0)residuals frommatchon numeric literals) isalready covered by the surrounding
simpMatch?/simpIf?/simpTargetStarsteps in
Eqns.go, so the full test suite continues to pass.Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com