1

If we were to assume that primality testing was in NP.

What would the certificate be, so that a polynomial time verifier can check the number X is indeed prime?

WeCanBeFriends
  • 511
  • 4
  • 12
  • 1
    We don't need to assume anything since primality testing is in $\mathsf{P} \subseteq \mathsf{NP}$. – dkaeae Jul 03 '19 at 08:10
  • If we had to assume that primality testing was in NP, that would mean that we didn't know if it was or not. Since knowing a certificate would prove that it's in NP, your question doesn't make much sense: it's essentially, "Assuming we knew how to solve this problem, how would we solve it?" The only reason you have answers is that, fortunately, you chose a problem that we do know how to solve. – David Richerby Jul 03 '19 at 16:29

2 Answers2

4

Before it was proven that primality is in P, it was known that a complete factorisation if n-1 could be used to prove primality of n. Now this also requires a proof that all factors in the claimed factorisation are actually themselves primes; this leads to a O(n^2) size certificate.

Google for “Pratt certificate”.

(When you use a certificate to solve a problem in NP, you cannot just “trust” the certificate. So if I tell you “here is a complete factorisation if n-1”, you can’t just believe that. You’d have to check that the product of the factors is actually n-1, which is easy. But you’d also have to check that each of the numbers that I claim are prime factors are actually prime, so you need a certificate for primality of these smaller numbers as well)..

gnasher729
  • 29,996
  • 34
  • 54
2

The $\mathsf{PRIMES}$ problem is in $\mathsf{P}$, so it can be decided by a TM in polynomial time. This means that any certificate suffices, in particular even the empty string, since the verifier (which is a poly-time TM) can simply ignore the certificate and check membership directly.

dkaeae
  • 4,997
  • 1
  • 15
  • 31