Skip to content

perf: simplify cbv ite/dite simprocs by reducing Decidable instance directly#12677

Open
wkrozowski wants to merge 1 commit intoleanprover:masterfrom
wkrozowski:wojciech/cbv-ite-dite-decidable-simproc
Open

perf: simplify cbv ite/dite simprocs by reducing Decidable instance directly#12677
wkrozowski wants to merge 1 commit intoleanprover:masterfrom
wkrozowski:wojciech/cbv-ite-dite-decidable-simproc

Conversation

@wkrozowski
Copy link
Contributor

@wkrozowski wkrozowski commented Feb 24, 2026

This PR changes the approach in simpIteCbv and simpDIteCbv, by replacing call to Decidable.decide
with reducing and direct pattern matching on the Decidable instance for isTrue/isFalse. This produces simpler proof terms.

…ce directly

This PR replaces the `Decidable.decide` + `eq_true_of_decide`/`eq_false_of_decide`
approach in `simpIteCbv` and `simpDIteCbv` with direct pattern matching on the
`Decidable` instance for `isTrue`/`isFalse`. This produces simpler proof terms
and reduces code duplication by extracting shared helpers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wkrozowski
Copy link
Contributor Author

!bench

@leanprover-radar
Copy link

leanprover-radar commented Feb 24, 2026

Benchmark results for 317a97c against f31f508 are in! @wkrozowski

  • build//instructions: -2.1G (-0.02%)

Large changes (2✅)

  • elab/cbv_decide//instructions: -23.8G (-27.27%)
  • elab/cbv_merge_sort//instructions: -13.0G (-37.78%)

Medium changes (1🟥)

  • 🟥 build/module/Lean.Meta.Tactic.Cbv.ControlFlow//bytes .olean.server: +2kiB (+46.69%)

Small changes (2✅, 1🟥)

  • 🟥 build/module/Init.Sym.Lemmas//instructions: +42.2M (+2.21%)
  • build/module/Lean.Meta.Tactic.Cbv.ControlFlow//bytes .olean.private: -50kiB (-10.43%)
  • build/module/Lean.Meta.Tactic.Cbv.ControlFlow//instructions: -2.0G (-32.56%) (reduced significance based on *//lines)

@wkrozowski wkrozowski changed the title refactor: simplify cbv ite/dite simprocs by matching Decidable instance directly perf: simplify cbv ite/dite simprocs by reducing Decidable instance directly Feb 24, 2026
@wkrozowski wkrozowski added the changelog-tactics User facing tactics label Feb 24, 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 Feb 24, 2026
@mathlib-lean-pr-testing
Copy link

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase f31f50836d032d6c237272a3b2e733a92a3ee619 --onto ed0fd1e933239beaa7aaa12598f961c260062ab6. You can force Mathlib CI using the force-mathlib-ci label. (2026-02-24 19:21:40)

@leanprover-bot
Copy link
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 f31f50836d032d6c237272a3b2e733a92a3ee619 --onto 8038a8b8904f89ad9542c8eda11379f8f006eab1. You can force reference manual CI using the force-manual-ci label. (2026-02-24 19:21:42)

@wkrozowski wkrozowski added this pull request to the merge queue Feb 25, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 25, 2026
…stance directly (#12677)

This PR changes the approach in `simpIteCbv` and `simpDIteCbv`, by
replacing call to `Decidable.decide`
with reducing and direct pattern matching on the `Decidable` instance
for `isTrue`/`isFalse`. This produces simpler proof terms.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@wkrozowski wkrozowski removed this pull request from the merge queue due to a manual request Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-tactics User facing tactics 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.

3 participants