Skip to content

fix: reduce binder types in reduceAll - #14656

Open
sankalpsthakur wants to merge 1 commit into
leanprover:masterfrom
sankalpsthakur:agent/reduce-binder-types
Open

fix: reduce binder types in reduceAll#14656
sankalpsthakur wants to merge 1 commit into
leanprover:masterfrom
sankalpsthakur:agent/reduce-binder-types

Conversation

@sankalpsthakur

Copy link
Copy Markdown
Contributor

This PR makes reduce visit lambda and forall binder types when type reduction is enabled.

The previous lambda/forall cases opened the original binders and reduced only the body. Consequently, reduceAll could return an expression such as Foo → True even when Foo reduces to True.

Reuse the existing binder traversal helpers, which visit each domain and the body in the correct local context. The existing skipTypes guard preserves the default behavior of reduce.

Closes #6084

Validation

  • Added tests/elab/issue6084.lean
  • Exact PR-history search found no competing implementation
  • Full Lean CI is the authoritative validation

AI assistance

AI tools assisted with issue triage, source inspection, implementation, and regression preparation. I reviewed the binder traversal helpers and final five-line production diff.

@sankalpsthakur
sankalpsthakur marked this pull request as ready for review August 2, 2026 06:58
@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 Aug 2, 2026
@mathlib-lean-pr-testing

mathlib-lean-pr-testing Bot commented Aug 2, 2026

Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 23d17351ab630c393aadb7f8c97ef9b8ee633cdb --onto 5b8d06c1764fa367a1e27b3e89f64667eac425af. You can force Mathlib CI using the force-mathlib-ci label. (2026-08-02 06:58:55)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 945e78b86645b179655123cd2fdba83d89d28d07 --onto 110db9cb751afaee8b2ac344887d6c7e632f77b4. You can force Mathlib CI using the force-mathlib-ci label. (2026-08-04 02:13:10)

@leanprover-bot

leanprover-bot commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 23d17351ab630c393aadb7f8c97ef9b8ee633cdb --onto 23393b959b33e3a8d15796b2397f8a04c315b9f4. You can force reference manual CI using the force-manual-ci label. (2026-08-02 06:58:57)
  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 945e78b86645b179655123cd2fdba83d89d28d07 --onto 23393b959b33e3a8d15796b2397f8a04c315b9f4. You can force reference manual CI using the force-manual-ci label. (2026-08-04 02:13:12)

@sankalpsthakur
sankalpsthakur force-pushed the agent/reduce-binder-types branch from 5f5558c to d321367 Compare August 4, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

reduce does not recurse into binder types

2 participants