feat: characterize when T-division equals zero - #8204
Merged
Conversation
Contributor
Author
|
changelog-library |
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
May 2, 2025
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
May 2, 2025
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
May 2, 2025
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
May 2, 2025
|
Mathlib CI status (docs):
|
luisacicolini
approved these changes
May 12, 2025
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
May 12, 2025
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
May 12, 2025
bollu
marked this pull request as ready for review
May 12, 2025 10:24
alexkeizer
reviewed
May 28, 2025
alexkeizer
reviewed
May 28, 2025
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Jun 6, 2025
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Jun 6, 2025
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Jun 13, 2025
This PR adds the lemma `Int.tdiv_eq_zero_iff_natAbs_lt_or_eq_zero` which shows that T-division equals zero iff the absolute value of the numerator is less than the denominator, or the denominator equals zero. This was used in reasoning about the MSB of `BitVec.sdiv`. The strategy was superced, but this lemma was extracted from the earlier proof.
Co-authored-by: Luisa Cicolini <48860705+luisacicolini@users.noreply.github.com>
Co-authored-by: Alex Keizer <alex@keizer.dev>
Co-authored-by: Alex Keizer <alex@keizer.dev>
tobiasgrosser
approved these changes
Jun 14, 2025
tobiasgrosser
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Thank you, @bollu.
kim-em
enabled auto-merge
August 31, 2026 05:17
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the lemma
Int.tdiv_eq_zero_iff_natAbs_lt_or_eq_zerowhich shows that T-division equals zero iff the absolute value of the numerator is less than the denominator, or the denominator equals zero:This was used in reasoning about the MSB of
BitVec.sdiv. The strategy wassuperced, but this lemma was extracted from the earlier proof.