Complexity theory is a mathematical study of algorithmic problems with regard to how cost-effective solutions they have. Most prominent are the *decision problems*, which are yes-no questions for which answer depends on some further input, for example, “Is a prime number?” is a decision problem depending on the input . I assume that a reader of this post has some familiarity with the basic concepts of this theory, in particular, what PSPACE complexity class is and what does it mean that a problem is PSPACE-complete. A well-known theorem due to Shamir states that the class PSPACE and another class, IP (which I explain below, since I wouldn’t count it as a “basic” concept), are equal. The goal of this post is to prove this theorem. It is not based on a single source, but there is a very detailed exposition due to B.J. Mares, which I shall leave as a reference.

## Interactive proofs

The idea behind a language lying in the IP complexity class is that if we have two parties in a conversation: one of them, the *verifier*, has limited resources, and the other, the *prover*, is all-knowing and not contrained by the resources in any way. In their dialogue, the prover tries to convince the verifier that some string lies in . Afterwards, the verifier declares whether they accept or reject the computation, which means that they did or didn’t get convinced that .

The first idea to define a complexity class out of it is as the class of languages such that some prover is able to convince the verifier iff the string truly is in the language, where we require the verifier to be a polynomial-time machine. However, if the verifier is deterministic, this gives us precisely the class NP: since the prover knows precisely what the verifier is going to do with their responses, they could’ve just as well gave all their responses beforehand, from which we infer this class is contained in NP.

Instead, we let the verifier to be *probabilistic* – in the course of the proof, we allow them to get some perfectly random bits and the course of computation may proceed differently depending on what they are. Also, to account from probabilistic nature, we will allow the verifier to make to make errors, but with small probability. IP is defined as the class of the languages such that, for some (polynomial-time) verifier and any string :

- if , then some prover makes the verifier accept with probability at least , and
- if , then there is no prover which makes the verifier accept with probability higher than .

The exact value of the constants $latex 2/3,1/3$ is not important here, as long as they are, respectively, larger than and smaller than : repeating the calculation a number of times and accepting iff the original verifier would’ve accepted majority of times can put these probabilities at something of order or better, which, in practice, would be negligible.

A famous example of a problem which is not known to be in NP, but known to have an interactive proof protocol, is the *graph nonisomorphism*: given two graphs , decide whether they are *not* isomorphic (note that graph *isomorphism* problem is rather trivially in NP). One way to convince a verifier they are not isomorphic is as follows: first, we ask them to randomly (and secretly – the prover won’t know the result!) choose one of the graphs , randomly permute its vertices getting an isomorphic graph , and then present to the prover to see whether they can figure out what the is. If and are not isomorphic, then is isomorphic to only one of them, so the prover can easily tell which one it’s isomorphic to. On the other hand, if *is* isomorphic to , the best the prover can do is guess whether is a permutation of what the verifier chose, which will be right with only 50% probability, so repeating will make it really unlikely for the prover to be right all the time.

The result which we are going to prove, that IP is the same as PSPACE, is surprising because it shows that in the context of interactive proofs, adding randomness significantly increases the capabilities of a system (since, at least conjecturally, PSPACE is much larger than NP). This is in contrary to the more standard complexity classes, since probabilistic analogue of P, called BPP, is conjectured to be equal to P.

We shall now begin the proof of Shamir’s theorem.

## PSPACE-completeness of TQBF

One of the most important decision problems in PSPACE is the following problem:

**TQBF:** Given a quantified Boolean formula

where is or and is an unquantified Boolean formula, decide whether it’s true.

This is the most well-known example of a PSPACE-complete problem. Verifying that it is contained in PSPACE is routine, and amounts to checking that the obvious “brute-force” algorithm works in space polynomial in the size of the input. Its PSPACE-hardness procees by a standard argument, which we include for completeness (pun not intended).

Suppose M is a Turing machine which works in polynomial space, say in space bounded by , where throughout is the length of the input. Every configuration of the machine can be described using a sequence of bits of polynomial length, for example by using to store the contents of the tape, another to indicate which cell the machine is currently reading, and a constant number of bits to store which state machine is in. Until the end of this section, capital letters apart from M will denote configurations of M, and also strings of bits encoding them. This encoding shows that M has at most configurations for polynomial.

We may redesign M slightly so that, once it accepts, it moves to a state we know in advance, e.g. it clears everything on the tape and enters special state while sitting on the leftmost cell. From this and the above we see there are fixed configurations such that M accepts iff M gets from configuration to in at mosy steps. We shall recursively construct a quantified Boolean formula which is equivalent to “M gets from configuration to configuration in at most steps”.

For , the formula states that or is one computation step ahead of . It is more tedious than enlightening to show that formula stating that can be constructed in polynomial time, so we will skip that. For the recursion step, we note that if we can reach configuration from in at most steps iff we can find a midpoint configuration such that we can get from to in steps, and the same for and . Hence a natural idea is to define

(recall is treated as a sequence of bits, so is actually a sequence of $g(n)$ quantifiers). However, with this idea the length of formulas grows exponentially fast with , which is bad for us. Instead, we use the following construction:

.

It is straightforward this construction can be done in polynomial time. Transforming the formula into PNF (prenex normal form, i.e. all quantifiers come before a formula) is routine. This establishishes PSPACE-completeness.

## Arithmetization

This is the central idea of the proof. We transform the quantified Boolean formula to a polynomial function, which on Boolean inputs () gives us its Boolean truth value. For the innermost, unquantified formula , we first use repeatedly de Morgan rules and other reduction rules, we are left with a formula involving only . Then we note that if formulas give polynomials , then can be represnted by respectively. Applying quantifiers is not difficult either: if corresponds to , for we take $latex f(x_1,\dots,x_{n-1},0)f(x_1,\dots,x_{n-1},1)$, and for , using de Morgan laws, . This process is known as the *arithmetization* of the Boolean formula. After arithmetizing a formula with each variable quantified, we get a constant polynomial, and the formula is true iff this constant value is 1.

Unfortunately, because of the quantifiers, this construction leaves us with a polynomial with degree exponential in length of the formula. To fix this, we can *linearize* the polynomial. The idea is simple: polynomials and takes the same values on Boolean inputs, while the latter polynomial has the degree in every variable at most the same as in the former, and additionaly the degree in is equal to . Thus linearizing in every variable will get all degrees to be . We will denote the operator linearizing in variable by . Denoting also by the operators on polynomials corresponding to applying quantifiers, solving TQBF essentially amounts to finding the value of

,

where is a polynomial corresponding to the unquantified part of the formula. Importantly, as can be seen from the construction, it is very easy to find its values on integer inputs.

We define the following sequence of polynomials:

(the empty brackets by emphasize that it’s a function of zero variables). We want a prover to convince the verifier that , and we can easily compute . Also, note that there is an easy polynomial upper bound on the total degrees of all polynomials, namely the degree of (note that most of them will have degree or in each variable).

## Interactive proof protocol for TQBF

We are now ready to describe the procedure the verifier and prover will execute during the interactive proof. First of all, *all the computations will take place modulo a prime* . This will reduce the size of numbers involved in a computation. will have length polynomial in the length of the input, and we will also require it to be sufficiently large (such primes will necessarily exist, e.g. by Bertrand’s postulate, but more elementary arguments can be given as well). The prover shall start by sending a prime , and they will either provide a primality certificate which the verifier can quickly check, or the verifier will have to check primality of using a primality test.

Recall that the verifier wants to challenge prover’s claim that . We will indicate these sort of claims by (the superscript indicates that this relation is what the prover *claims* is true). The remainder of the protocol proceeds as follows:

- The prover sends a polynomial , which they claim to be equal to .
- The verifier checks that provers two claims are
*consistent*: in this case, since , the verifier ought to check that . If this is the case, then they choose a random number modulo and sends it to the prover. If prover’s claim that was true, then in particular we must have $latex f_1^P(r_1)=f_1(r_1)$. This is a new claim which the verifier is challenging. - The prover now sends a polynomial , which they claim to be .
- The verifier again checks consistency: we should have . They choose a random , send it to the prover and challenge the equality .
- This time the prover sends , claiming it’s .
- They proceed in this manner total of times: depending on the operator at the end of definition of , the prover sends a polynomial with one free variable. The verifier makes a consistency check, chooses a random number and sets this as the free variable in the polynomial, and challenges the prover with the value they get.
- After all these turns, the verifier is now left with prover’s claim that . But at this point the verifier can check this claim by themself: we have earlier noted that the values of can be easily computed. This is one of the two final checks; the other one will be to check that all polynomials given by the prover have degree .
- If all of the consistency checks were successful and the final claim was verified to be true, the verifier accepts. If at any point the check failed or the last claim turned out to be false, they reject.

It is clear that if the formula is true, then the prover can convince the verifier of its truth using this protocol 100% of the time: if they send the true values of as , the verifier will not find any inconsistencies, so will accept. This is refered to as *completeness* of the protocol – that in true cases verifier can be convinced with high probability (in general, not necessarily 100%, but in this case we can do that good). We now must verify its *soundness* – that it is not possible for a prover to fool the verifier into believing a false formula is true.

The fundamental fact of use here is the following fundamental fact about polynomials over fields (integers modulo a prime form a field, so it is applicable):

**Lagrange’s theorem:** If two polynomials defined over a field have degree at most and agree on more than values, then they are equal.

We will upper bound the probability of fooling the verifier. If the deceitful prover wants to have at least some chance, they need to send which is really a prime of desired size and all the polynomials on the way have to have the degree at most .

For the verifier to accept the final check, we need the two polynomials , seen as polynomials in one variable, to agree on the input (recall that the prover sends the polynomials with all but one variable fixed). By Lagrange’s theorem, unless the polynomials are equal, this only can be for at most values of . Since was chosen randomly, if the polynomials are not equal, then the equality holds with probability smaller than .

If the formula is not true, then the prover must have lied in the first step – it cannot be that . We can now proceed inductively to see that most likely the prover will have to continue providing false claims – if they have falsely claimed that (here evaluated at certain values of ), then they must provide a polynomial which isn’t equal to – after all, and involve their evaluations on certain values – so the claim will be true only on places where the two distinct polynomials agree, which happens with probability at most .

Summing up these probabilities, we see that the probability of the prover getting away with their initial lie is at most , where is polynomial in the length of the formula . If we now let be between (invoking Bertrand’s postulate), then the probability of the verifier accepting a false formula will be made exponentially small. It’s easy to convince oneself with some technical calculations that this confirms soundness of the protocol.

Therefore, IP=PSPACE.

I hope to eventually make a blog post describing a proof of a similat, but perhaps even more surprising, result, what MIP, the class of problems with interactive proof protocols involving multiple provers, is equal to the class NEXP, which is *known* to be much larger than NP, thus showing that probability can provably enlarge a complexity class.