-
Notifications
You must be signed in to change notification settings - Fork 297
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 by Bors] - feat(number_theory): prove the existence of infinitely many Fermat pseudoprimes to any base #17632
Conversation
… over 100 characters
I'm not sure how important shortening very long proofs is, but some of the proofs are very long and might be a bit difficult to read. I can probably shorten them, but I would like to make sure that my definitions work before I start doing that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've looked at the first 200 or so lines; this is an excellent job for a first PR by the way!
Co-authored-by: Kevin Buzzard <k.buzzard@imperial.ac.uk>
Use the golfed version of coprime_of_probable_prime provided by Kevin Buzzard.
Co-authored-by: Kevin Buzzard <k.buzzard@imperial.ac.uk>
Co-authored-by: Kevin Buzzard <k.buzzard@imperial.ac.uk>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more comments.
Co-authored-by: Kevin Buzzard <k.buzzard@imperial.ac.uk>
Co-authored-by: Kevin Buzzard <k.buzzard@imperial.ac.uk>
Co-authored-by: Kevin Buzzard <k.buzzard@imperial.ac.uk>
Merging the |
I moved a large segment of |
I did a bit more editing than I expected to If there are no more changes that I need to make, I will merge this soon. |
LGTM. Feel free to merge it when CI passes. |
Not quite sure why the CI failed. It seemed to get stuck on a completely unrelated file. I think I'm just going to re-run it. |
bors r+ |
1 similar comment
bors r+ |
Already running a review |
…eudoprimes to any base (#17632) A natural number `n` is a probable prime to base `b` if `n` divides `b ^ (n - 1) - 1`. `n` is a Fermat pseudoprime to base `b` if it is a composite probable prime. This commit defines Fermat pseudoprimes and proves that for any positive base `b`, there exist an infinite number of Fermat pseudoprimes to that base. Co-authored-by: Niels Voss <nvosscode@gmail.com>
Pull request successfully merged into master. Build succeeded: |
A natural number
n
is a probable prime to baseb
ifn
dividesb ^ (n - 1) - 1
.n
is a Fermat pseudoprime to baseb
if it is a composite probable prime. This commit defines Fermat pseudoprimes and proves that for any positive baseb
, there exist an infinite number of Fermat pseudoprimes to that base.An important thing to note about the way I defined Fermat pseudoprimes is that the definition has an edge case where all numbers are Fermat pseudoprimes to base 0 and 1. The case with base 0 is due to the definition involving natural number subtraction. I was told that this definition was not preferable but was otherwise fine, but I can change it if needed.
Since this is my first PR and I am still inexperienced with Lean, a lot of the proofs are very long, but I'm not quite sure about how I would go about shortening them. The lemmas in the
helper_lemmas
section of this file exist to help prove theorems, but are unrelated to Fermat pseudoprimes.Some aspects of this PR were discussed in more detail on Zulip.