Skip to content

feat: add simp lemmas for kernel-friendly functions#12950

Merged
TwoFX merged 1 commit intoleanprover:masterfrom
b-mehta:missing-kernel-lemmas
Mar 18, 2026
Merged

feat: add simp lemmas for kernel-friendly functions#12950
TwoFX merged 1 commit intoleanprover:masterfrom
b-mehta:missing-kernel-lemmas

Conversation

@b-mehta
Copy link
Copy Markdown
Contributor

@b-mehta b-mehta commented Mar 17, 2026

This PR adds simp lemmas equating kernel-friendly function names with their operator notation equivalents: Nat.land_eq, Nat.lor_eq, Nat.xor_eq, Nat.shiftLeft_eq', Nat.shiftRight_eq', and Bool.rec_eq. These are useful when proofs involve reflection and need to simplify kernel-reduced terms back to operator notation.

Closes #12716

This PR adds simp lemmas equating kernel-friendly function names with
their operator notation equivalents: `Nat.land_eq`, `Nat.lor_eq`,
`Nat.xor_eq`, `Nat.shiftLeft_eq'`, `Nat.shiftRight_eq'`, and
`Bool.rec_eq`. These are useful when proofs involve reflection and need
to simplify kernel-reduced terms back to operator notation.

Closes leanprover#12716

Co-authored-by: Claude <noreply@anthropic.com>
@b-mehta b-mehta requested a review from kim-em as a code owner March 17, 2026 16:32
@b-mehta
Copy link
Copy Markdown
Contributor Author

b-mehta commented Mar 17, 2026

changelog-library

@github-actions github-actions bot added the changelog-library Library label Mar 17, 2026
@TwoFX TwoFX added changelog-library Library and removed changelog-library Library labels Mar 17, 2026
Copy link
Copy Markdown
Collaborator

@nomeata nomeata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks plausible, but it raises questions about the desired simp normal form, so needs careful review by the stdlib team.

Comment thread src/Init/Data/Nat/Bitwise/Basic.lean
@b-mehta
Copy link
Copy Markdown
Contributor Author

b-mehta commented Mar 17, 2026

Looks plausible, but it raises questions about the desired simp normal form, so needs careful review by the stdlib team.

My understanding is that each of the Nat-specific ones are not meant to be used directly, see eg the docs of Nat.lor (and indeed all of the ones I've now made simp away)

@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 Mar 17, 2026
@mathlib-lean-pr-testing
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 7c011aa5222d338da96fa48f7f601e267700c928 --onto 6714601ee4a123fef0f6ff3e44f01086ba78dfce. You can force Mathlib CI using the force-mathlib-ci label. (2026-03-17 18:16:47)

@leanprover-bot
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 7c011aa5222d338da96fa48f7f601e267700c928 --onto cfa8c5a036d6990635c6ec50b02d0e806995cec3. You can force reference manual CI using the force-manual-ci label. (2026-03-17 18:16:49)

Copy link
Copy Markdown
Member

@TwoFX TwoFX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TwoFX TwoFX added this pull request to the merge queue Mar 18, 2026
Merged via the queue into leanprover:master with commit 0917260 Mar 18, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-library Library 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.

missing lemmas about kernel-friendly functions

4 participants