Skip to content

Conversation

@nomeata
Copy link
Collaborator

@nomeata nomeata commented Dec 14, 2025

This PR makes sure that when a matcher is compiled using a sparse cases,
that equation generation also uses sparse cases to split.
This fixes #11665.

This PR adds a realizable `.else_eq` theorems for sparse casesOn
constructions, for rewriting the else case.

This code was complicated by having to work around the kernel reduction
issues in #11181 around `Nat.xor` etc.
This PR makes sure that when a matcher is compiled using a sparse cases,
that equation generation also uses sparse cases to split.
This fixes #11665.
@nomeata nomeata added the changelog-language Language features and metaprograms label Dec 14, 2025
@nomeata nomeata changed the title joachim/issue11665 feat: sparse sparse casesOn splitting in match equations Dec 14, 2025
@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 Dec 14, 2025
@leanprover-bot
Copy link
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2025-12-13 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. (2025-12-14 12:41:53)

leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Dec 14, 2025
@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 Dec 14, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Dec 14, 2025
@nomeata
Copy link
Collaborator Author

nomeata commented Dec 14, 2025

!radar

@leanprover-radar
Copy link

leanprover-radar commented Dec 14, 2025

Benchmark results for 7d4df21 against 9022266 are in! @nomeata

Major changes (1)
  • 🟥 big_match_partial//instructions: +1.1G (+6.6%)
Minor changes (3)
  • 🟥 build//instructions: +18.5G (+0.1%)
  • 🟥 size/all/.olean//bytes: +1MiB (+0.4%)
  • 🟥 size/init/.olean//bytes: +351kiB (+0.4%)

@nomeata
Copy link
Collaborator Author

nomeata commented Dec 14, 2025

!bench mathlib

@leanprover-radar
Copy link

leanprover-radar commented Dec 14, 2025

@leanprover-community-bot leanprover-community-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Dec 14, 2025
@leanprover-community-bot
Copy link
Collaborator

Mathlib CI status (docs):

@nomeata nomeata marked this pull request as ready for review December 14, 2025 14:59
@nomeata nomeata enabled auto-merge December 14, 2025 14:59
@nomeata nomeata added this pull request to the merge queue Dec 14, 2025
Merged via the queue into master with commit 0f2ac0b Dec 14, 2025
23 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.

Failed to generate matcher equation due to not mentioned constructor

5 participants