Skip to content

fix: do not bump transparency to instances in eqn LHS whnf#13512

Merged
nomeata merged 1 commit into
masterfrom
joachim/whnfI
Apr 23, 2026
Merged

fix: do not bump transparency to instances in eqn LHS whnf#13512
nomeata merged 1 commit into
masterfrom
joachim/whnfI

Conversation

@nomeata
Copy link
Copy Markdown
Collaborator

@nomeata nomeata commented Apr 23, 2026

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

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>
@nomeata nomeata added the changelog-language Language features and metaprograms label Apr 23, 2026
@github-actions github-actions Bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Apr 23, 2026
@leanprover-bot
Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2026-04-22 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-manual, reference manual CI should run now. You can force reference manual CI using the force-manual-ci label. (2026-04-23 09:41:50)

@github-actions github-actions Bot added the mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN label Apr 23, 2026
@mathlib-lean-pr-testing mathlib-lean-pr-testing Bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Apr 23, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

@nomeata nomeata added this pull request to the merge queue Apr 23, 2026
Merged via the queue into master with commit 1e0ddbb Apr 23, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-mathlib CI has verified that Mathlib builds against this PR changelog-language Language features and metaprograms mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants