Number theory Finite fields and computational number theory Theorem
AKS primality test
Builds on Prime numberMultiplicative orderEuler's totient functionPolynomial ringQuotient ringFermat's little theoremFreshman's dreamMiller–Rabin primality test
Statement
Let be an integer and let be an integer. Assume that has no prime factor . Then , so the multiplicative order of modulo is defined. Assume also that . Let be Euler's totient function and let . Then the following hold.
- The integer is prime if and only if is not a perfect power and for every integer with . Here the congruence is an equality in the quotient ring of the polynomial ring . A perfect power is an integer with integers .
- For every there is an integer with or .
- Hence a deterministic algorithm decides whether is prime with a number of bit operations polynomial in .
Remarks
The algorithm is due to Manindra Agrawal, Neeraj Kayal and Nitin Saxena, in the paper "PRIMES is in P". It starts from a simple fact: for , the integer is prime if and only if in . The direct check of this identity costs about operations, so the test reduces it modulo for a small . If is composite with a prime factor , the congruences for all give a group of polynomials modulo . This group is forced to be both small and large at once, unless is a power of . The algorithm finds the smallest suitable , checks for , tests for perfect powers, and then checks the congruences.
For prime, part 1 holds by Fermat's little theorem and the freshman's dream in characteristic . The test needs no unproved hypothesis and is never wrong, unlike the Miller–Rabin primality test, which is randomised.
Going deeper
For a student
The test turns the binomial identity modulo into a criterion that is cheap to check. The working ring has elements of size about bits, and is polynomial in by part 2. The proof uses only elementary algebra of finite fields and cyclotomic polynomials, together with a bound on the least common multiple of . In practice the test is slower than the Miller–Rabin primality test or elliptic curve methods, so its importance is mainly theoretical. It is a primality test, and it does not find factors; the integer factorization problem is believed to be much harder.
Reading path
To understand this page from the ground up, read these 18 pages in order. The foundations come first.
Show the path as a graph
- no evidence level
- Divisibility definition
- Euler's totient function concept
- Group concept
- Modular exponentiation concept
- Multiplicative order concept
- Polynomial ring concept
- Prime number concept
- Quotient ring concept
- Congruence modulo n definition
- Prime number definition
- Ring definition
- Fermat's little theorem statement
- Primality test concept
- Characteristic of a ring definition
- Commutative ring definition
- Miller–Rabin primality test concept
- Freshman's dream statement
- AKS primality test statement
Where this leads
1 page builds on this one.
Further reading
About this page
| Tag | XMHQCDWZW1 |
|---|---|
| URI | m2://XMHQCDWZW1 |
| Kind | statement, theorem |
| Writing | W0 stub |
| MSC | 11Y11, 11A51, 68Q25 |
| Status | This copy of the site has no build data. Run m2 status XMHQCDWZW1. |
| About | Primality test, Prime number |
| Uses | Prime number, Multiplicative order, Euler's totient function, Polynomial ring, Quotient ring, Fermat's little theorem, Freshman's dream, Miller–Rabin primality test |
| Same as | |
| Changed | 2 November 2026 |
Markdown · JSON · Edit on GitHub
What this page needs for W1
- a source with a locator (0 of 1)
The writing levels say how complete the text of a page is. They do not measure its truth.