Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Worksheet that accompanies the YouTube video https://www.youtube.com/watch?v=HIiotVxxi8c
License: GPL3
Image: ubuntu2204
Problem: | Given a polynomial , determine the -rational roots of . |
Solution: | Rabin's algorithm! |
Theorem: | , in other words, we have |
Proof: | For this follows from Fermat's little theorem. If we identify , we have for , so the elements of are precisely the roots of . For this is true by definition: is the fixed field of the -power Frobenius automorphism of , equivalently, the splitting field of over . |
Corollary: | For any prime power we have and . |
Corollary: | Let be nonzero and let . Then In particular, . |
Key point: | Make sure you exponentiate in the right ring! The first step in computing is to compute (note that may be exponentially large, but certainly won't be). If is the ring homomorphism defined by , then so the order of operations makes no mathematical difference, but the RHS can be computed exponentially faster than either the middle or the LHS! The complexity of computing with Euclidean division is quasi-linear in , The complexity of computing using binary exponentiation is quasi-linear in . |
Okay, we can count (distinct) roots, but what if we actually want to know what they are?
Excellent, we managed to split the roots of by picking out two that are roots of , where (we are assuming is odd).
What are the roots of anyway?
My keen sense of pattern recognition (or a recollection of Euler's criterion) tells me these are the roots of are precisely the squares (quadratic residues) in
But if has multiple roots that are quadratic residues (or maybe none), then what?
Rabin: Instead of , use for a random .
Definition: | Let us say that are of different type if both are nonzero and , in other words, one is a quadratic residue and one is not. |
Theorem: | For every pair of distinct we have |
Proof: | See Section 3.11 in the lecture notes for a short easy proof. |
Corollary: | Let , let , let , and let be a uniformly random element of . If has more than one nonzero root, then |
Theorem: | Let and . The expected running time of is bit operations. |
Here the soft-O notation means up to a poly-logarithmic factors. See the lecture notes for a more precise bound and a proof.
What if we want all the rational roots?
Theorem: | Let and . The expected running time of is bit operations. |
This looks the same as the bound for , but in fact there is an extra factor of hidden in the soft-O notation.
What if we want all the rational roots and their multiplicities?
Yun: Compute the squarefree factorization!
Definition: | The squarefree factorization of a monic is the unique list of monic squarefree polynomials with for which . |
Key fact: | If is the factorization of a monic into irreducibles then for some if and only if . This holds in any perfect field. |
Theorem: | Let and . The running time of is bit operations. |
This is negligible compared to the complexity of , so we might as well call first.
Even if we only want distinct roots, this will actually save time if is not squarefree.
What if we want to factor into irreducibles?
Rabin: You can do that with my root-finding algorithm.
Cantor-Zassenhaus: Yes, but that requires working in extension fields, and with our algorithm there is no need!
The first step is to compute the distinct degree factorization
Definition: | The distinct degree factorization of a monic is the unique list of polynomials with such that each is a (possibly empty) product of distinct monic irreducible polynomials of degree , for . |
Key point: | This can be done deterministically by taking succesive gcds with . |
The key innovation introduced by Cantor-Zassenhaus is that when searching for irreducible factors of of degree , rather than computing using a random and computing the gcd in (which is how one would go about finding a root of using Rabin's algorithm), it is better to compute in using a random coprime to with . This faster because we are working the ring rather than (so the bit-size of each element is smaller by a factor of ), and the probability of success is the same.
Theorem: | Let be the product of distinct monic irreducible polynomials of degree and let be a random polynomial coprime to with . Then |
Proof: | This follows from applying the Chinese Remainder Theorem to . See Section 3.12 of the lecture notes for details. |
Theorem: | Let and . The expected running time of is bit operations. |
There are other factorization methods based on linear algebra and modular composition that improve the dependence on .
Currently the best asymptotic bound is achieved by the Kedlaya-Umans algorithm with an expected running time of .