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: add Nat.[shiftLeft_or_distrib, shiftLeft_xor_distrib, shiftLeft_and_distrib, testBit_mul_two_pow, bitwise_mul_two_pow, shiftLeft_bitwise_distrib] #6630

Merged
merged 21 commits into from
Jan 16, 2025

Conversation

luisacicolini
Copy link
Contributor

@luisacicolini luisacicolini commented Jan 13, 2025

This PR adds theorems Nat.[shiftLeft_or_distrib, shiftLeft_xor_distrib, shiftLeft_and_distrib, testBit_mul_two_pow, bitwise_mul_two_pow, shiftLeft_bitwise_distrib], to prove Nat.shiftLeft_or_distrib by emulating the proof strategy of shiftRight_and_distrib.

In particular, Nat.shiftLeft_or_distrib is necessary to simplify the proofs in #6476.

@luisacicolini luisacicolini changed the title feat: add Nat.[shiftLeft_or_distrib, testBit_mul_two_pow,bitwise_mul_two_pow, shiftLeft_bitwise_distrib, shiftLeft_prec_inside] feat: add Nat.[shiftLeft_or_distrib, testBit_mul_two_pow,bitwise_mul_two_pow, shiftLeft_bitwise_distrib] Jan 13, 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 Jan 13, 2025
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Jan 13, 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 2421f7f79941853da14346a234aec6df70cf36a1 --onto d2c4471cfa4611977bf4927b5cd849df1a4272b7. (2025-01-13 16:50:47)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 2421f7f79941853da14346a234aec6df70cf36a1 --onto e9bd9807ef7a983365df9ac55d35040d0b2d5ef2. (2025-01-14 16:40:44)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 2421f7f79941853da14346a234aec6df70cf36a1 --onto a955708b6c5f25e7f9c9ae7b951f8f3d5aefe377. (2025-01-16 09:14:21)

@luisacicolini
Copy link
Contributor Author

changelog-library

@github-actions github-actions bot added the changelog-library Library label Jan 13, 2025
@luisacicolini
Copy link
Contributor Author

I am especially skeptical about the testBit_mul_two_pow proof strategy, however, I could not find a better one.

src/Init/Data/Nat/Bitwise/Lemmas.lean Show resolved Hide resolved
src/Init/Data/Nat/Bitwise/Lemmas.lean Outdated Show resolved Hide resolved
src/Init/Data/Nat/Bitwise/Lemmas.lean Outdated Show resolved Hide resolved
@luisacicolini luisacicolini changed the title feat: add Nat.[shiftLeft_or_distrib, testBit_mul_two_pow,bitwise_mul_two_pow, shiftLeft_bitwise_distrib] feat: add Nat.[shiftLeft_or_distrib, shiftLeft_xor_distrib, shiftLeft_and_distrib, testBit_mul_two_pow,bitwise_mul_two_pow, shiftLeft_bitwise_distrib] Jan 13, 2025
@luisacicolini luisacicolini changed the title feat: add Nat.[shiftLeft_or_distrib, shiftLeft_xor_distrib, shiftLeft_and_distrib, testBit_mul_two_pow,bitwise_mul_two_pow, shiftLeft_bitwise_distrib] feat: add Nat.[shiftLeft_or_distrib, shiftLeft_xor_distrib, shiftLeft_and_distrib, testBit_mul_two_pow, testBit_mul_two_pow_gt, testBit_mul_two_pow_le, bitwise_mul_two_pow, shiftLeft_bitwise_distrib] Jan 14, 2025
@luisacicolini luisacicolini marked this pull request as ready for review January 14, 2025 08:50
@luisacicolini luisacicolini requested a review from kim-em as a code owner January 14, 2025 08:50
@luisacicolini
Copy link
Contributor Author

awaiting-review

@github-actions github-actions bot added the awaiting-review Waiting for someone to review the PR label Jan 14, 2025
@leanprover-bot leanprover-bot added the P-medium We may work on this issue if we find the time label Jan 14, 2025
@luisacicolini
Copy link
Contributor Author

Thanks a lot @alexkeizer! I am not super confident with calc and suffices, so I'm not really sure I understand it. I'll give it a try for testBit_mul_two_pow_lt as well and push all the changes!

@kim-em kim-em added awaiting-author Waiting for PR author to address issues and removed awaiting-review Waiting for someone to review the PR labels Jan 15, 2025
@luisacicolini luisacicolini changed the title feat: add Nat.[shiftLeft_or_distrib, shiftLeft_xor_distrib, shiftLeft_and_distrib, testBit_mul_two_pow, testBit_mul_two_pow_gt, testBit_mul_two_pow_le, bitwise_mul_two_pow, shiftLeft_bitwise_distrib] feat: add Nat.[shiftLeft_or_distrib, shiftLeft_xor_distrib, shiftLeft_and_distrib, testBit_mul_two_pow, bitwise_mul_two_pow, shiftLeft_bitwise_distrib] Jan 15, 2025
@luisacicolini
Copy link
Contributor Author

awaiting-review

@github-actions github-actions bot added awaiting-review Waiting for someone to review the PR and removed awaiting-author Waiting for PR author to address issues labels Jan 16, 2025
@kim-em kim-em removed the awaiting-review Waiting for someone to review the PR label Jan 16, 2025
@kim-em kim-em added this pull request to the merge queue Jan 16, 2025
Merged via the queue into leanprover:master with commit 906aa1b Jan 16, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-library Library P-medium We may work on this issue if we find the time 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