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: show basic properties of BitVec multiplication #3445

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

alexkeizer
Copy link
Contributor

Show that multiplication of bitvectors is associative and commutative, and show that it has 1#w as identity (both on the left and right).

@alexkeizer
Copy link
Contributor Author

awaiting-review

@github-actions github-actions bot added the awaiting-review Waiting for someone to review the PR label Feb 21, 2024
@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 Feb 21, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

leanprover-community-mathlib4-bot commented Feb 21, 2024

Mathlib CI status (docs):

  • ❗ Std/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 263629d140c42be6d553091a17b584ce766d9645 --onto 8b8e001794e6a8b481d37f24fa77bb07797682a1. (2024-02-21 21:42:02)
  • ❗ Std/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 6e821de11abd3c16dbbeb15cbfe315e2abbef10a --onto 6719af350fde9339354f28d091458df39a4af9d4. (2024-02-21 22:17:51)

@alexkeizer
Copy link
Contributor Author

alexkeizer commented Feb 21, 2024

@joehendrix I'd like your opinion on this PR: we're proving commutativity and associativity of bitvector multiplication by appealing to these properties of Fin multiplication. But, not in a way that relies on the definition of BitVec.mul being Fin.mul. Instead, we use the toFin_mul lemma, so this proof still works after #3430.

Is this an acceptable level of coupling between BitVec and Fin, since it's just an implementation detail of the proof, or would you prefer we stay away from Fin entirely?

@joehendrix
Copy link
Contributor

@alexkeizer Looks good to me. I have no concerns with relying on Fin in lemmas when it is useful.

@joehendrix joehendrix added will-merge-soon …unless someone speaks up and removed awaiting-review Waiting for someone to review the PR labels Feb 21, 2024
@kim-em kim-em added this pull request to the merge queue Feb 22, 2024
Merged via the queue into leanprover:master with commit 4508692 Feb 22, 2024
15 checks passed
leodemoura pushed a commit that referenced this pull request Feb 22, 2024
Show that multiplication of bitvectors is associative and commutative,
and show that it has 1#w as identity (both on the left and right).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN will-merge-soon …unless someone speaks up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants