Skip to content

Conversation

@osmanyasar05
Copy link

@osmanyasar05 osmanyasar05 commented Jan 8, 2026

This PR introduces the theorem BitVec.sshiftRight_eq_setWidth_extractLsb_signExtend theorem, proving x.sshiftRight n is equivalent to first sign-extending x, extracting the appropriate least significant bits, and then setting the width back to w.

@osmanyasar05 osmanyasar05 changed the title feat: BitVec.sshiftRight_setWidth_extractLsb_signExtend theorem feat: add BitVec.sshiftRight_setWidth_extractLsb_signExtend theorem Jan 8, 2026
@osmanyasar05 osmanyasar05 changed the title feat: add BitVec.sshiftRight_setWidth_extractLsb_signExtend theorem feat: add BitVec.sshiftRight_eq_setWidth_extractLsb_signExtend theorem Jan 8, 2026
@osmanyasar05 osmanyasar05 changed the title feat: add BitVec.sshiftRight_eq_setWidth_extractLsb_signExtend theorem feat: add BitVec.setWidth_extractLsb_signExtend_eq_sshiftRight theorem Jan 8, 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 Jan 8, 2026
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jan 8, 2026
@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 Jan 8, 2026
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Jan 8, 2026
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Jan 8, 2026
@leanprover-bot leanprover-bot added the builds-manual CI has verified that the Lean Language Reference builds against this PR label Jan 8, 2026
@leanprover-bot
Copy link
Collaborator

leanprover-bot commented Jan 8, 2026

Reference manual CI status:

@osmanyasar05 osmanyasar05 changed the title feat: add BitVec.setWidth_extractLsb_signExtend_eq_sshiftRight theorem feat: add BitVec.signExtend_setWidth_extractLsb_eq_sshiftRight theorem Jan 8, 2026
@osmanyasar05 osmanyasar05 changed the title feat: add BitVec.signExtend_setWidth_extractLsb_eq_sshiftRight theorem feat: add BitVec.signExtend_extractLsb_setWidth_eq_sshiftRight theorem Jan 8, 2026
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jan 8, 2026
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Jan 8, 2026
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Jan 8, 2026
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Jan 8, 2026

Mathlib CI status (docs):

@leanprover-community-bot leanprover-community-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Jan 8, 2026
Co-authored-by: Tobias Grosser <github@grosser.es>
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jan 9, 2026
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Jan 9, 2026
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Jan 9, 2026
@osmanyasar05 osmanyasar05 changed the title feat: add BitVec.signExtend_extractLsb_setWidth_eq_sshiftRight theorem feat: add BitVec.signExtend_extractLsb_setWidth theorem Jan 9, 2026
@osmanyasar05
Copy link
Author

changelog-library

@github-actions github-actions bot added the changelog-library Library label Jan 9, 2026
Copy link
Contributor

@bollu bollu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! It took me a moment's thinking to see why this is true, so a comment would be appreciated :)

@osmanyasar05 osmanyasar05 marked this pull request as ready for review January 9, 2026 15:23
@osmanyasar05 osmanyasar05 requested a review from kim-em as a code owner January 9, 2026 15:23
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jan 9, 2026
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Jan 9, 2026
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-manual CI has verified that the Lean Language Reference builds against this PR builds-mathlib CI has verified that Mathlib builds against this PR changelog-library Library 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.

6 participants