Primality Certificate
   HOME

TheInfoList



OR:

In
mathematics Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
and
computer science Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
, a primality certificate or primality proof is a succinct, formal proof that a number is prime. Primality certificates allow the primality of a number to be rapidly checked without having to run an expensive or unreliable
primality test A primality test is an algorithm for determining whether an input number is prime. Among other fields of mathematics, it is used for cryptography. Unlike integer factorization, primality tests do not generally give prime factors, only stating wheth ...
. "Succinct" usually means that the proof should be at most polynomially larger than the number of digits in the number itself (for example, if the number has ''b'' bits, the proof might contain roughly ''b''2 bits). Primality certificates lead directly to proofs that problems such as
primality testing A primality test is an algorithm for determining whether an input number is prime. Among other fields of mathematics, it is used for cryptography. Unlike integer factorization, primality tests do not generally give prime factors, only stating wheth ...
and the
complement Complement may refer to: The arts * Complement (music), an interval that, when added to another, spans an octave ** Aggregate complementation, the separation of pitch-class collections into complementary sets * Complementary color, in the visu ...
of
integer factorization In mathematics, integer factorization is the decomposition of a positive integer into a product of integers. Every positive integer greater than 1 is either the product of two or more integer factors greater than 1, in which case it is a comp ...
lie in NP, the class of problems verifiable in polynomial time given a solution. These problems already trivially lie in
co-NP In computational complexity theory, co-NP is a complexity class. A decision problem X is a member of co-NP if and only if its complement is in the complexity class NP. The class can be defined as follows: a decision problem is in co-NP if and o ...
. This was the first strong evidence that these problems are not
NP-complete In computational complexity theory, NP-complete problems are the hardest of the problems to which ''solutions'' can be verified ''quickly''. Somewhat more precisely, a problem is NP-complete when: # It is a decision problem, meaning that for any ...
, since if they were, it would imply that NP is subset of co-NP, a result widely believed to be false; in fact, this was the first demonstration of a problem in NP intersect co-NP not known, at the time, to be in P. Producing certificates for the complement problem, to establish that a number is composite, is straightforward: it suffices to give a nontrivial divisor. Standard probabilistic primality tests such as the
Baillie–PSW primality test The Baillie–PSW primality test is a probabilistic or possibly deterministic primality testing algorithm that determines whether a number is composite or is a probable prime. It is named after Robert Baillie, Carl Pomerance, John Selfridge, ...
, the
Fermat primality test The Fermat primality test is a probabilistic test to determine whether a number is a probable prime. Concept Fermat's little theorem states that if ''p'' is prime and ''a'' is not divisible by ''p'', then :a^ \equiv 1 \pmod. If one wants to tes ...
, and the
Miller–Rabin primality test The Miller–Rabin primality test or Rabin–Miller primality test is a probabilistic primality test: an algorithm which determines whether a given number is likely to be prime, similar to the Fermat primality test and the Solovay–Strassen pr ...
also produce compositeness certificates in the event where the input is composite, but do not produce certificates for prime inputs.


Pratt certificates

The concept of primality certificates was historically introduced by the Pratt certificate, conceived in 1975 by
Vaughan Pratt Vaughan Pratt (born April 12, 1944) is a Professor, Professor Emeritus at Stanford University, who was an early pioneer in the field of computer science. Since 1969, Pratt has made several contributions to foundational areas such as search algorit ...
, who described its structure and proved it to have polynomial size and to be verifiable in polynomial time. It is based on the
Lucas primality test In computational number theory, the Lucas test is a primality test for a natural number ''n''; it requires that the prime factors of ''n'' − 1 be already known. It is the basis of the Pratt certificate that gives a concise verification th ...
, which is essentially the converse of
Fermat's little theorem In number theory, Fermat's little theorem states that if is a prime number, then for any integer , the number is an integer multiple of . In the notation of modular arithmetic, this is expressed as a^p \equiv a \pmod p. For example, if and , t ...
with an added condition to make it true: : Lucas' theorem: Suppose we have an integer ''a'' such that: :* ''a''''n'' − 1 ≡ 1 (mod ''n''), :* for every prime factor ''q'' of ''n'' − 1, it is not the case that ''a''(''n'' − 1)/''q'' ≡ 1 (mod ''n''). : Then ''n'' is prime. Given such an ''a'' (called a ''witness'') and the prime factorization of ''n'' − 1, it's simple to verify the above conditions quickly: we only need to do a linear number of modular exponentiations, since every integer has fewer prime factors than bits, and each of these can be done by
exponentiation by squaring In mathematics and computer programming, exponentiating by squaring is a general method for fast computation of large positive integer powers of a number, or more generally of an element of a semigroup, like a polynomial or a square matrix. Some ...
in O(log ''n'') multiplications (see
big-O notation Big ''O'' notation is a mathematical notation that describes the limiting behavior of a function when the argument tends towards a particular value or infinity. Big O is a member of a family of notations invented by German mathematicians Pau ...
). Even with grade-school integer multiplication, this is only O((log ''n'')4) time; using the
multiplication algorithm A multiplication algorithm is an algorithm (or method) to multiplication, multiply two numbers. Depending on the size of the numbers, different algorithms are more efficient than others. Numerous algorithms are known and there has been much resea ...
with best-known asymptotic running time, due to David Harvey and Joris van der Hoeven, we can lower this to O((log ''n'')3(log log ''n'')) time, or using soft-O notation Õ((log ''n'')3). However, it is possible to trick a verifier into accepting a composite number by giving it a "prime factorization" of ''n'' − 1 that includes composite numbers. For example, suppose we claim that ''n'' = 85 is prime, supplying ''a'' = 4 and ''n'' − 1 = 6 × 14 as the "prime factorization". Then (using ''q'' = 6 and ''q'' = 14): * 4 is coprime to 85, * 485−1 ≡ 1 (mod 85), * 4(85−1)/6 ≡ 16 (mod 85), 4(85−1)/14 ≡ 16 (mod 85). We would falsely conclude that 85 is prime. We don't want to just force the verifier to factor the number, so a better way to avoid this issue is to give primality certificates for each of the prime factors of ''n'' − 1 as well, which are just smaller instances of the original problem. We continue recursively in this manner until we reach a number known to be prime, such as 2. We end up with a tree of prime numbers, each associated with a witness ''a''. For example, here is a complete Pratt certificate for the number 229: * 229 (''a'' = 6, 229 − 1 = 22 × 3 × 19), ** 2 (known prime), ** 3 (''a'' = 2, 3 − 1 = 2), *** 2 (known prime), ** 19 (''a'' = 2, 19 − 1 = 2 × 32), *** 2 (known prime), *** 3 (''a'' = 2, 3 − 1 = 2), **** 2 (known prime). This proof tree can be shown to contain at most 4\log_2 n - 4 values other than 2 by a simple inductive proof (based on theorem 2 of Pratt). The result holds for 3; in general, take ''p'' > 3 and let its children in the tree be ''p''1, ..., ''p''''k''. By the inductive hypothesis, the tree rooted at ''p''''i'' contains at most 4\log_2 p_i - 4 values, so the entire tree contains at most : 1 + \sum_^k (4\log_2 p_i - 4) = -4k + 4\log_2 p_1 \cdots p_k \leq 4\log_2 p - 4, since ''k'' ≥ 2, and ''p''1...''p''''k'' = ''p'' − 1. Since each value has at most log ''n'' bits, this also demonstrates that the certificate has a size of O((log ''n'')2) bits. Since there are O(log ''n'') values other than 2, and each requires at most one exponentiation to verify (and exponentiations dominate the running time), the total time is O((log ''n'')3(log log ''n'')(log log log ''n'')), or Õ((log ''n'')3), which is quite feasible for numbers in the range that computational number theorists usually work with. However, while useful in theory and easy to verify, actually generating a Pratt certificate for ''n'' requires factoring ''n'' − 1 and other potentially large numbers. This is simple for some special numbers such as
Fermat primes In mathematics, a Fermat number, named after Pierre de Fermat (1601–1665), the first known to have studied them, is a positive integer of the form:F_ = 2^ + 1, where ''n'' is a non-negative integer. The first few Fermat numbers are: 3, 5, 17 ...
, but currently much more difficult than simple primality testing for large primes of general form.


Atkin–Goldwasser–Kilian–Morain certificates

To address the problem of efficient certificate generation for larger numbers, in 1986
Shafi Goldwasser Shafrira Goldwasser (; born 1959) is an Israeli-American computer scientist. A winner of the Turing Award in 2012, she is the RSA Professor of Electrical Engineering and Computer Science at the Massachusetts Institute of Technology; a professor o ...
and Joe Kilian described a new type of certificate based on the theory of
elliptic curve In mathematics, an elliptic curve is a smooth, projective, algebraic curve of genus one, on which there is a specified point . An elliptic curve is defined over a field and describes points in , the Cartesian product of with itself. If the ...
s.Goldwasser, S. and Kilian, J. "Almost All Primes Can Be Quickly Certified". Proc. 18th STOC. pp. 316–329, 1986
Full text
This was in turn used by A. O. L. Atkin and François Morain as the basis for Atkin-Goldwasser-Kilian-Morain certificates, which are the type of certificates generated and verified by
elliptic curve primality proving In mathematics, elliptic curve primality testing techniques, or elliptic curve primality proving (ECPP), are among the quickest and most widely used methods in primality proving. It is an idea put forward by Shafi Goldwasser and Joe Kilian in 1986 ...
systems. Just as Pratt certificates are based on Lucas's theorem, Atkin–Goldwasser–Kilian–Morain certificates are based on the following theorem of Goldwasser and Kilian (lemma 2 of "Almost All Primes Can Be Quickly Certified"): : Theorem: Suppose we are given: :* a positive integer ''n'' not divisible by 2 or 3; :* M''x'', M''y'', A, B in \mathbb_n (the integers mod ''n'') satisfying M''y''2 = M''x''3 + AM''x'' + B and with 4A3 + 27B2 coprime to ''n''; :* a prime q > n^ + 1 + 2n^. : Then M = (M''x'', M''y'') is a non-identity point on the elliptic curve ''y''2 = ''x''3 + Ax + B. Let ''k''M be M added to itself ''k'' times using standard elliptic-curve addition. Then, if ''q''M is the identity element I, then ''n'' is prime. Technically, an elliptic curve can only be constructed over a field, and \mathbb_n is only a field if ''n'' is prime, so we seem to be assuming the result we're trying to prove. The difficulty arises in the elliptic-curve addition algorithm, which takes inverses in the field that may not exist in \mathbb_n. However, it can be shown (lemma 1 of "Almost All Primes Can Be Quickly Certified") that if we merely perform computations as though the curve were well-defined and do not at any point attempt to invert an element with no inverse, the result is still valid; if we do encounter an element with no inverse, this establishes that ''n'' is composite. To derive a certificate from this theorem, we first encode M''x'', M''y'', A, B, and ''q'', then recursively encode the proof of primality for ''q'' < ''n'', continuing until we reach a known prime. This certificate has size O((log ''n'')2) and can be verified in O((log ''n'')4) time. Moreover, the algorithm that generates these certificates can be shown to be expected polynomial time for all but a small fraction of primes, and this fraction exponentially decreases with the size of the primes. Consequently, it's well-suited to generating certified large random primes, an application that is important in
cryptography Cryptography, or cryptology (from "hidden, secret"; and ''graphein'', "to write", or ''-logy, -logia'', "study", respectively), is the practice and study of techniques for secure communication in the presence of Adversary (cryptography), ...
applications such as generating provably valid RSA keys.


Pocklington Based Certificates

Provable prime generation based on variants of Pocklington's theorem (see
Pocklington primality test In mathematics, the Pocklington–Lehmer primality test is a primality test devised by Henry Cabourn Pocklington and Derrick Henry Lehmer. The test uses a partial factorization of N - 1 to prove that an integer N is prime. It produces a pri ...
) can be efficient techniques for generating primes (cost is generally less than probabilistic generation) with the added benefit of built in primality certificates. While these may seem to be special primes, notice that every prime integer could be generated with a Pocklington based provable generation algorithm.


Pocklington Primality Tests

Let P=Rh+1 where R=\prod q_j^ where q_j are distinct primes with e_j an integer greater than zero and a witness g such that: Then P is prime if one of the following holds:


Pocklington Primality Certificate

A Pocklington primality certificate consists of the prime P, a set primes q_j dividing (P-1), each with their own Pocklington prime certificate or small enough to be a known prime, and a witness g. The bits needed for this certificate (and order of computational cost) should range from approximately \log_2\left(1 + \sum_^\frac\right) = 1.5\log_2 for version () to \log_2\left(1 + \sum_^\frac\right) = 2\log_2 for version ()


A Small Example

Let P=1056893. Note that (P-1)=1621\cdot 163\cdot 2^2 and P^=1028.053\ldots, P^=101.86156\ldots. * Using the 'witness' 2, equation is satisfied and using q=163 and q=1621. * For version , the certificate needs only P=1056893,\ q=1621,\ g=2. * for version , the certificate needs only P=1056893,\ q=163,\ g=2, but there's a bit more work to do: ** h = (1056893-1)/163 = 6484 ** a\equiv h\equiv 127\bmod and b=\left(6484-127\right)/163=39 ** Using r=3 fails: \left(127^2-4\cdot 39\right)^\equiv (1^2-0)^1\equiv 1\bmod ** Using r=5 succeeds: \left(127^2-4\cdot 39\right)^\equiv (2^2-1)^2\equiv 2\bmod, and P is prime.


Impact of "PRIMES is in P"

"PRIMES is in P"{{cite journal , first1=Manindra , last1=Agrawal , authorlink1=Manindra Agrawal , first2=Neeraj , last2=Kayal , authorlink2=Neeraj Kayal , first3=Nitin , last3=Saxena , authorlink3=Nitin Saxena , url=http://www.cse.iitk.ac.in/users/manindra/algebra/primality_v6.pdf , title=PRIMES is in P , journal=
Annals of Mathematics The ''Annals of Mathematics'' is a mathematical journal published every two months by Princeton University and the Institute for Advanced Study. History The journal was established as ''The Analyst'' in 1874 and with Joel E. Hendricks as t ...
, volume=160 , date=September 2004 , issue=2 , pages=781–793 , doi=10.4007/annals.2004.160.781 , doi-access=free , jstor=3597229 , mr=2123939
was a breakthrough in theoretical computer science. This article, published by
Manindra Agrawal Manindra Agrawal (born 20 May 1966) is an Indian computer scientist and director of Indian Institute of Technology, Kanpur. He is also a professor at the Department of Computer Science and Engineering at the Indian Institute of Technology, Ka ...
,
Nitin Saxena Nitin Saxena (born 3 May 1981Saxena's CV at University of Bonn
) is ...
, and Neeraj Kayal in August 2002, proves that the famous problem of checking primality of a number can be solved deterministically in polynomial time. The authors received the 2006
Gödel Prize The Gödel Prize is an annual prize for outstanding papers in the area of theoretical computer science, given jointly by the European Association for Theoretical Computer Science (EATCS) and the Association for Computing Machinery Special Inter ...
and 2006
Fulkerson Prize The Fulkerson Prize for outstanding papers in the area of discrete mathematics is sponsored jointly by the Mathematical Optimization Society (MOS) and the American Mathematical Society (AMS). Up to three awards of $1,500 each are presented at e ...
for this work. Because primality testing can now be done deterministically in polynomial time using the
AKS primality test The AKS primality test (also known as Agrawal–Kayal–Saxena primality test and cyclotomic AKS test) is a deterministic primality-proving algorithm created and published by Manindra Agrawal, Neeraj Kayal, and Nitin Saxena, computer scientist ...
, a prime number could itself be considered a certificate of its own primality. This test runs in Õ((log ''n'')6) time. In practice this method of verification is more expensive than the verification of Pratt certificates, but does not require any computation to determine the certificate itself.


References


External links


Mathworld: Primality Certificate





The Prime Glossary: Certificate of Primality
*
Vašek Chvátal Vašek is both a Czech surname and masculine given name (diminutive of Václav Václav () or rarely Vácslav is a Czech name, Czech male given name. It is among the most common Czech names. The Latinized form of the name is Wenceslaus and the Polish ...

Lecture notes on Pratt's Primality Proofs
Department of Computer Science. Rutgers University
PDF version at Concordia University
Primality tests