8000 feat: BitVec.msb_sdiv by bollu · Pull Request #8178 · leanprover/lean4 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: BitVec.msb_sdiv #8178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Jun 19, 2025
Merged

feat: BitVec.msb_sdiv #8178

merged 31 commits into from
Jun 19, 2025

Conversation

bollu
Copy link
Contributor
@bollu bollu commented Apr 30, 2025

This PR provides a compact formula for the MSB of the sdiv. Most of the work in the PR involves handling the corner cases of division overflowing (e.g. intMin / -1 = intMin)

bollu added 10 commits April 29, 2025 10:10
In this PR, we add lemmas for `msb_sdiv`.
This needs quite a bit of analysis on `Int.tdiv`,
and we develop the theory of `Int.tdiv` to enable proving `msb_sdiv`.
The salient points are as follows:
- First, sdiv equals tdiv.
@bollu bollu changed the title feat: msb_sdiv feat: BitVec.msb_sdiv Apr 30, 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 Apr 30, 2025
@leanprover-community-bot
Copy link
Collaborator
leanprover-community-bot commented Apr 30, 2025

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase b677702b02a3127e5f0d1a25b40fe55ed7b623f5 --onto a1989c2387f90c4cde9f07de6c7cc8f7525cab6f. You can force Mathlib CI using the force-mathlib-ci label. (2025-04-30 14:20:45)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase b677702b02a3127e5f0d1a25b40fe55ed7b623f5 --onto 2b4f372317f214e92988a79fc765586fbfb64e97. You can force Mathlib CI using the force-mathlib-ci label. (2025-05-12 21:09:59)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase b677702b02a3127e5f0d1a25b40fe55ed7b623f5 --onto 9b9dd8546a123d746580649b239f26c26d370d20. You can force Mathlib CI using the force-mathlib-ci label. (2025-06-09 07:34:34)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase b677702b02a3127e5f0d1a25b40fe55ed7b623f5 --onto faffe863343211d03d07d4ef19d90a2aa9d6fc8c. You can force Mathlib CI using the force-mathlib-ci label. (2025-06-13 19:50:00)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase b677702b02a3127e5f0d1a25b40fe55ed7b623f5 --onto 957b904ef9fd11ed9cb49f12fcc9d7b989c01900. You can force Mathlib CI using the force-mathlib-ci label. (2025-06-16 10:02:00)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase b677702b02a3127e5f0d1a25b40fe55ed7b623f5 --onto fdf6d2ea3bdbebb736aa5d05d00b27a5abaa8fb8. You can force Mathlib CI using the force-mathlib-ci label. (2025-06-17 15:24:28)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase b677702b02a3127e5f0d1a25b40fe55ed7b623f5 --onto e83b7681407043c75f5167c2e4da13e25078a0c0. You can force Mathlib CI using the force-mathlib-ci label. (2025-06-18 14:35:42)

bollu and others added 3 commits June 16, 2025 17:19
Co-authored-by: Luisa Cicolini <48860705+luisacicolini@users.noreply.github.com>
Copy link
Contributor
@luisacicolini luisacicolini left a comment

Choose a reason for hiding this comment

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

lgtm!

@bollu bollu marked this pull request as ready for review June 17, 2025 16:35
@bollu bollu requested a review from kim-em as a code owner June 17, 2025 16:35
@tobiasgrosser
Copy link
Contributor

changelog-library

@github-actions github-actions bot added the changelog-library Library label Jun 17, 2025
Copy link
Contributor
@tobiasgrosser tobiasgrosser left a comment

Choose a reason for hiding this comment

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

Thank you @bollu. Modulo the last comments, this looks good to me.

@bollu
Copy link
Contributor Author
bollu commented Jun 18, 2025

changelog-library

@hargoniX hargoniX added changelog-library Library and removed changelog-library Library labels Jun 18, 2025
@bollu
Copy link
Contributor Author
bollu commented Jun 18, 2025

@tobiasgrosser all comments addressed.

@hargoniX hargoniX added this pull request to the merge queue Jun 19, 2025
Merged via the queue into leanprover:master with commit da9a536 Jun 19, 2025
15 checks passed
wkrozowski pushed a commit to wkrozowski/lean4 that referenced this pull request Jun 24, 2025
This PR provides a compact formula for the MSB of the sdiv. Most of the
work in the PR involves handling the corner cases of division
overflowing (e.g. `intMin / -1 = intMin`)

---------

Co-authored-by: Luisa Cicolini <48860705+luisacicolini@users.noreply.github.com>
Co-authored-by: Tobias Grosser <github@grosser.es>
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.

5 participants
0