ArticleslgStudy

science

Primality certificate

Primality certificate is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Primality certificate rather than just read about it. In short: In mathematics and computer 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. "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…

Key takeaways

  • Primality certificate belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Primality certificate to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Primality certificate from memory before moving on to harder problems.

Reference excerpt

In mathematics and computer 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. "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 b2 bits). Primality certificates lead directly to proofs that problems such as primality testing and the complement of integer factorization lie in NP, the class of problems verifiable in polynomial time given a solution. These problems already trivially lie in co-NP. This was the first strong evidence that these problems are not NP-complete, 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 Fermat primality test, and the Miller–Rabin primality test 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, 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, which is essentially the converse of Fermat's little theorem with an added condition to make it true:

Lucas' theorem: Suppose we have an integer a such that: an − 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 O(log n) multiplications (see big-O notation). Even with grade-school integer multiplication, this is only O((log n)4) time; using the multiplication algorithm 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 {\displaystyle 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 p1, ..., pk. By the inductive hypothesis, the tree rooted at pi contains at most 4 log 2 ⁡ p i − 4 {\displaystyle 4\log _{2}p_{i}-4} values, so the entire tree contains at most

1 + ∑ i = 1 k ( 4 log 2 ⁡ p i − 4 ) = − 4 k + 4 log 2 ⁡ p 1 ⋯ p k ≤ 4 log 2 ⁡ p − 4 , {\displaystyle 1+\sum _{i=1}^{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 p1...pk ≤ 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, but currently much more difficult than simple primality testing for large primes of general form.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Primality certificate

Start with the simplest possible case. Write down what Primality certificate claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Primality certificate before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Primality certificate ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Primality certificate

In research
Primality certificate appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Primality certificate in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Primality certificate is common in secondary-school and first-year university syllabi. It links to neighbouring topics Primality tests, so understanding it makes those chapters shorter.
In everyday life
Look for Primality certificate outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Primality certificate in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Primality certificate means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Primality certificate out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Primality certificate in simple terms?

In mathematics and computer 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. "Succinct" usually means…

Why does Primality certificate matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Primality certificate?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Primality certificate.

Tags

  • Primality tests

Keep exploring