-
Notifications
You must be signed in to change notification settings - Fork 293
feat(algebra/parity): Squares and primality #12992
base: master
Are you sure you want to change the base?
Conversation
There is already a concept of `even` and `odd`, but not of `square`. These are some initial lemmas about being a square that I use in the proof of the density of squarefree integers. Note that this also introduces the notation `sqrt0`, which is `0` if its argument is not a square and otherwise is its squareroot. This is in line with `real.sqrt`'s behavior on negative numbers. However, the name perhaps could use some work?
vihdzp
left a comment
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.
tl;dr there's tons of golfing to be done, and also you should look into whether your theorems can be generalized if you don't already plan on doing so.
Co-authored-by: Violeta Hernández <vi.hdz.p@gmail.com>
Co-authored-by: Violeta Hernández <vi.hdz.p@gmail.com>
Co-authored-by: Violeta Hernández <vi.hdz.p@gmail.com>
|
Thanks for the review @vihdzp ! Comments addressed, with a couple questions inline :-) |
|
Thanks again @vihdzp . Responded to your comments and added a long note in the code to address the UFM generalization |
|
I think @adomani was looking into this as well |
|
Yes, I am indeed going to add |
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
|
OK, assuming that this run goes fine, I think it's good to merge modulo one outstanding question from @jcommelin . So just bumping for him. :-) |
|
@jcommelin just bumping vis-a-vis the names! Thanks!! |
|
I just fixed the conflicts. I think that's ready? |
|
Thanks for coming back to this! It looks fine to me at this point, beyond the obvious build issues :-) |
|
Oh, very nice. Not sure how to add a |
|
This PR/issue depends on:
|
|
Build is failing... |
Introduce some decidability predicates for N and Z while also proving that a natural number is a square if and only if every one of its (maximal) prime power divisors is an even power.