Skip to content
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

feat: BitVec unsigned order theoretic results #5297

Merged
merged 1 commit into from
Sep 10, 2024
Merged

Conversation

hargoniX
Copy link
Contributor

@hargoniX hargoniX commented Sep 10, 2024

Proves that < and <= on BitVec are (strict) (total) partial orders. This is required for the UInt as BitVec refactor.

This does open the question how to state these theorems "correctly" for BitVec, we have both < living in Prop and BitVec.ult living in Bool. We might of course say to always use < but: Once we start adding IntX we need to prove the same results for BitVec.slt to provide an equivalent API. So it would appear that it is unavoidable to have a = true variant of these theorems there?

Question answered: Use < and slt.

@hargoniX hargoniX requested a review from kim-em as a code owner September 10, 2024 09:02
@hargoniX hargoniX added the awaiting-review Waiting for someone to review the PR label Sep 10, 2024
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc September 10, 2024 09:10 Inactive
@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 Sep 10, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 92e1f168b2bcbcb6ae92fa3c1c7a33139c4cac11 --onto c96fbdda44c14c7c256f046fb2b71fae25ea968e. (2024-09-10 09:21:19)

@hargoniX hargoniX added this pull request to the merge queue Sep 10, 2024
Merged via the queue into master with commit f869018 Sep 10, 2024
18 checks passed
tobiasgrosser pushed a commit to opencompl/lean4 that referenced this pull request Sep 16, 2024
Proves that `<` and `<=` on `BitVec` are (strict) (total) partial
orders. This is required for the `UInt` as `BitVec` refactor.

This does open the question how to state these theorems "correctly" for
`BitVec`, we have both `<` living in `Prop` and `BitVec.ult` living in
`Bool`. We might of course say to always use `<` but: Once we start
adding `IntX` we need to prove the same results for `BitVec.slt` to
provide an equivalent API. So it would appear that it is unavoidable to
have a `= true` variant of these theorems there?

Question answered: Use `<` and `slt`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review Waiting for someone to review the PR 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.

2 participants