This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Pseudodeterministic Constructions in Subexponential Time

Igor C. Oliveira111 This work received support from CNPq grant 200252/2015-1.
Charles University in Prague
   Rahul Santhanam222rahul.santhanam@cs.ox.ac.uk. Supported by the European Research Council under the European Union’s Seventh Framework Programme (FP7/2007-2014)/ERC Grant Agrement no. 615075.
University of Oxford
 
Abstract

We study pseudodeterministic constructions, i.e., randomized algorithms which output the same solution on most computation paths. We establish unconditionally that there is an infinite sequence {pn}n\{p_{n}\}_{n\in\mathbb{N}} of increasing primes and a randomized algorithm AA running in expected sub-exponential time such that for each nn, on input 1|pn|1^{|p_{n}|}, AA outputs pnp_{n} with probability 11. In other words, our result provides a pseudodeterministic construction of primes in sub-exponential time which works infinitely often.

This result follows from a much more general theorem about pseudodeterministic constructions. A property Q{0,1}Q\subseteq\{0,1\}^{*} is γ\gamma-dense if for large enough nn, |Q{0,1}n|γ2n|Q\cap\{0,1\}^{n}|\geq\gamma 2^{n}. We show that for each c>0c>0 at least one of the following holds: (1) There is a pseudodeterministic polynomial time construction of a family {Hn}\{H_{n}\} of sets, Hn{0,1}nH_{n}\subseteq\{0,1\}^{n}, such that for each (1/nc)(1/n^{c})-dense property Q𝖣𝖳𝖨𝖬𝖤(nc)Q\in\mathsf{DTIME}(n^{c}) and every large enough nn, HnQH_{n}\cap Q\neq\emptyset; or (2) There is a deterministic sub-exponential time construction of a family {Hn}\{H^{\prime}_{n}\} of sets, Hn{0,1}nH^{\prime}_{n}\subseteq\{0,1\}^{n}, such that for each (1/nc)(1/n^{c})-dense property Q𝖣𝖳𝖨𝖬𝖤(nc)Q\in\mathsf{DTIME}(n^{c}) and for infinitely many values of nn, HnQH^{\prime}_{n}\cap Q\neq\emptyset.

We provide further algorithmic applications that might be of independent interest. Perhaps intriguingly, while our main results are unconditional, they have a non-constructive element, arising from a sequence of applications of the hardness versus randomness paradigm.

1 Introduction

Number theory tells us that a significant fraction of nn-bit integers are prime, but can we efficiently generate an nn-bit prime deterministically? This is a fundamental question in computational number theory and cryptography. A naive solution is to test the nn-bit numbers for primality in order, starting with 2n1+12^{n-1}+1, using the AKS primality test [2], until we find one that is prime. Known results about the distribution of prime numbers guarantee that this procedure works in time 20.525n+o(n)2^{0.525n+o(n)} [6]. Despite all the progress that has been made in understanding the behaviour of prime numbers, the best known deterministic algorithm for generating nn-bit primes runs in time 2n/2+o(n)2^{n/2+o(n)} [24], which is not significantly better.

If we are allowed randomness in our generating algorithm, the problem becomes almost trivial: we repeatedly guess an nn-bit number at random and test it for primality, halting if a prime is found. Using the Prime Number Theorem, we will succeed with probability 1o(1)1-o(1) after O~(n)\widetilde{O}(n) tests, each of which can be implemented in poly(n)\operatorname{poly}(n) time. Thus the efficient deterministic generation problem reduces to derandomizing this algorithm. Under a strong hardness hypothesis, such as the assumption that linear exponential time requires exponential size circuits almost everywhere, this derandomization can be performed using known results from the theory of hardness-randomness tradeoffs [19]. However, we appear to be very far from proving such strong circuit lower bounds.

A few years ago, the Polymath 4 project considered precisely this question of efficient generation of primes, with the goal of using the state of the art in complexity theory and in number theory to obtain better results. It was observed during the project that several famous number-theoretic conjectures, such as Cramer’s conjecture and Schinzel’s hypothesis H, imply better generation algorithms, as do circuit lower bound assumptions, as described above. All of these conjectures seem far beyond our reach at present. The Polymath 4 project established [28] an improved algorithm for determining the parity of the number of primes in a large interval, but this has not yet yielded an unconditional improvement to the best known deterministic generation algorithm. The project posed the following question of interest to complexity theorists: does 𝖡𝖯𝖯=𝖯\mathsf{BPP}=\mathsf{P} imply more efficient deterministic generation of primes? This is not clear because the randomized generation algorithm for primes is not an algorithm for a decision problem.

Given the difficulty of finding more efficient deterministic generation algorithms, a natural approach is to relax the question. We know that randomized generation is easy, and we do not know of good deterministic generation algorithms. Is there an intermediate notion that could perhaps be useful?

Such a notion of pseudodeterministic algorithms was defined by Goldwasser and Gat [11], motivated by applications in cryptography and distributed computing, and further studied in [13, 12, 16]. A pseudodeterministic algorithm is a randomized algorithm, but the algorithm generates the same output with high probability. Thus, while the algorithm is not deterministic, the output of the algorithm looks deterministic to a computationally bounded observer. In the context of generating primes, pseudodeterministic generation means that the same prime is output on most computation paths. Note that the naive random generation algorithm does not have this property.

Goldwasser and Gat [11] describe the question of pseudodeterministic generation of primes as “perhaps the most compelling challenge for finding a unique output”. To the best of our knowledge, it is not known how to do better for this problem than to use the fastest deterministic algorithm.

1.1 Main Results

The main application of our techniques is that there is unconditionally a subexponential-time pseudodeterministic algorithm for generating infinitely many primes.

Theorem 1.

Let ε>0\varepsilon>0 be any constant. There is an infinite sequence {pn}n\{p_{n}\}_{n\in\mathbb{N}} of increasing primes, and a randomized algorithm AA running in expected time O(2mε)O(2^{m^{\varepsilon}}) on inputs of length mm such that for each nn\in\mathbb{N}, AA on input 1|pn|1^{|p_{n}|} outputs pnp_{n} with probability 11.

Note that the algorithm AA is zero-error: on input 1|pn|1^{|p_{n}|}, it outputs the same prime pnp_{n} on all computation paths. In fact, on any input 1m1^{m}, the algorithm either operates deterministically and halts without output, or else it outputs the same mm-bit prime on all computation paths.

Using the proof idea of Theorem 1, we answer a variant of the question from Polymath 4: under the assumption that 𝖹𝖯𝖯i.o.𝖣𝖳𝖨𝖬𝖤(2nc)\mathsf{ZPP}\subseteq\operatorname{i.o.}\mathsf{DTIME}(2^{n^{c}}) for some fixed c>0c>0 (which is much weaker than 𝖡𝖯𝖯=𝖯\mathsf{BPP}=\mathsf{P}), we show that there is a subexponential-time deterministic algorithm for generating infinitely many primes (see Theorem 9 in Section 3.2).

Theorem 1 has some unusual features: we show that an algorithm exists satisfying the described properties, but we are not able to explicitly give such an algorithm. Similarly, while we show the existence of an infinite sequence of primes {pn}\{p_{n}\}, we are unable to bound |pn+1||p_{n+1}| as a function of |pn||p_{n}|. These non-constructive features, which are surprising in the context of an algorithmic solution to a natural problem, arise because Theorem 1 is proved as a corollary of the following generic result about explicit constructions.

Theorem 2.

Call a property Q{0,1}Q\subseteq\{0,1\}^{*} γ\gamma-dense if for each large enough nn, |Q{0,1}n|/2nγ(n)|Q\,\cap\,\{0,1\}^{n}|/2^{n}\geq\gamma(n). For each c>0c>0 at least one of the following holds:

  1. 1.

    There is a deterministic sub-exponential time construction of a family {Hn}\{H_{n}\} of sets, Hn{0,1}nH_{n}\subseteq\{0,1\}^{n}, such that for each (1/nc)(1/n^{c})-dense property Q𝖣𝖳𝖨𝖬𝖤(nc)Q\in\mathsf{DTIME}(n^{c}) and for infinitely many values of nn, HnQH_{n}\cap Q\neq\emptyset.

  2. 2.

    There is a zero-error pseudodeterministic polynomial time algorithm outputting a family {Hn}\{H^{\prime}_{n}\} of sets, Hn{0,1}nH^{\prime}_{n}\subseteq\{0,1\}^{n}, such that for each (1/nc)(1/n^{c})-dense property Q𝖣𝖳𝖨𝖬𝖤(nc)Q\in\mathsf{DTIME}(n^{c}) and every large enough nn, HnQH^{\prime}_{n}\cap Q\neq\emptyset.

We derive Theorem 1 by taking QQ to be the set of primes in Theorem 2, and observing that the statement of Theorem 1 follows both from the first and second item of Theorem 2. The non-constructivity comes from not knowing which of these two items holds, and we discuss this issue in more detail in Section 1.4.

Consider any property QQ as in the statement of Theorem 2, namely with polynomial density and decidable in deterministic polynomial time. For any such property, there is a randomized generation algorithm in polynomial time analogous to the one we described for Primes: generate strings of length nn at random and test for membership in QQ, halting if a string in QQ is found. What Theorem 2 says is that this randomized generation algorithm can unconditionally be made pseudodeterministic in a generic fashion, albeit at the cost of increasing the running time to subexponential, and only succeeding for infinitely many input lengths nn.

Theorem 2 is a very general result, and the generality of our techniques enables us to apply them to give unconditional pseudodeterministic algorithms in other contexts. Even if Theorem 1 does not give an explicit algorithm for generating primes of every input length, it does provide evidence that such algorithms might not be out of reach of current techniques. More explicit and more efficient algorithms could perhaps be designed by tailoring them more closely to the property at hand.

Nevertheless, we are interested in the question of whether there is a fundamental bottleneck to constructivity in our proof technique for Theorem 2. By refining some aspects of our approach, we are able to get somewhat explicit algorithms for generating primes as follows.

Theorem 3.

For each ε>0\varepsilon>0, there is a constant k>1k>1, an infinite sequence {qn}n\{q_{n}\}_{n\in\mathbb{N}} of increasing primes, and an explicit randomized algorithm AA halting in time O(2mε)O(2^{m^{\varepsilon}}) on inputs of length mm such that for each nn\in\mathbb{N}, A(1|qn|)A(1^{|q_{n}|}) outputs qnq_{n} with probability 1o(1)1-o(1), and moreover |qn+1|<|qn|k|q_{n+1}|<|q_{n}|^{k} for each nn\in\mathbb{N}.

The algorithm in Theorem 3 is explicit, but we still cannot say for sure on which input lengths it will succeed. We do have the guarantee that the gaps between successive input lengths on which the algorithm succeeds are not superpolynomially large. Theorem 3 does not strictly improve on Theorem 1 – it is not necessarily true, for example, that the same prime is output on all computation paths. Namely, we get a bounded-error pseudodeterministic algorithm rather than a zero-error one. However, the issue of non-constructivity is somewhat mitigated in Theorem 3.

Theorem 2 yields subexponential-time pseudodeterministic generation algorithms for properties that are both easy and dense. A more general context is polynomial-time sampling. Here we are given a sampler that either outputs a string (with high probability) or aborts, and we wish to design a new sampler that outputs a fixed string with high probability, with the constraint that this fixed string should belong to the range of the original sampler. We show how to adapt our ideas to give an analogue of Theorem 2 for this problem. We refer to Section 3.3 for more details.

We also study the relationship between pseudodeterminism and derandomization. A natural problem associated with derandomization is the Circuit Acceptance Probability Problem (𝖢𝖠𝖯𝖯\mathsf{CAPP}): given a circuit CC, output a small-error additive approximation to the acceptance probability of CC. There is a simple randomized polynomial-time algorithm for this problem – sample polynomially many inputs of CC at random, and output the fraction of these inputs on which CC accepts. This algorithm outputs different estimations of the acceptance probability of CC on different computation paths. We show how to get a pseudodeterministic algorithm as in Theorem 2 for infinitely many input lengths, but our algorithm is only guaranteed to succeed distributionally rather than in the worst case. (We refer to Section 4 for a precise formulation of the result.)

Theorem 4.

For any ε>0\varepsilon>0 and any polynomial-time samplable sequence 𝔇={𝒟n}\mathfrak{D}=\{\mathcal{D}_{n}\} of distributions over Boolean circuits, 𝖢𝖠𝖯𝖯\mathsf{CAPP} is pseudodeterministically solvable for infinitely many input lengths nn in time 2O(nε)2^{O(n^{\varepsilon})} with high probability over 𝒟n\mathcal{D}_{n}.

One of the main questions in the theory of derandomization concerns the relationship between “white-box” and “black-box” derandomization. Black-box derandomization refers to derandomization using a fixed pseudorandom generator, while in white-box derandomization, we are given a circuit and asked to approximate its acceptance probability deterministically. Black-box derandomization implies white-box derandomization of randomized algorithms, and white-box derandomization implies deterministic simulations of languages in 𝖡𝖯𝖯\mathsf{BPP}. However, it is unknown whether these implications can be reversed in general (cf. [9, 15]), and separations are known in relativized worlds [9].

We prove that these notions are all in fact equivalent in the setting of subexponential-time derandomization that works infinitely often on average over polynomial-time samplable distributions. (While Theorem 4 provides a randomized algorithm, we stress that the algorithms postulated in Theorem 5 below are all deterministic. We refer to Section 4 for definitions.)

Theorem 5.

The following statements are equivalent:

  1. 1.

    For each polynomial-time samplable distribution 𝔇\mathfrak{D} of Boolean circuits and each ε>0\varepsilon>0, there is an i.o.PRG 𝔊\mathfrak{G} on average over 𝔇\mathfrak{D} with seed length nεn^{\varepsilon} that is computable in time 2O(nε)2^{O(n^{\varepsilon})}.

  2. 2.

    For each polynomial-time samplable distribution 𝔇\mathfrak{D} over Boolean circuits and each ε>0\varepsilon>0, 𝖢𝖠𝖯𝖯\mathsf{CAPP} is solvable infinitely often in time 2O(nε)2^{O(n^{\varepsilon})} on average over 𝔇\mathfrak{D}.

  3. 3.

    For each polynomial-time samplable distribution 𝔇\mathfrak{D} over input strings and each ε>0\varepsilon>0, 𝖡𝖯𝖯\mathsf{BPP} is solvable infinitely often in time 2O(nε)2^{O(n^{\varepsilon})} with O(log(n))O(\log(n)) bits of advice on average over 𝔇\mathfrak{D}.

  4. 4.

    For each ε>0\varepsilon>0, 𝖡𝖯𝖯\mathsf{BPP} is solvable infinitely often in time 2O(nε)2^{O(n^{\varepsilon})} on average over UnU_{n}.

Therefore, in order to establish all these items it is necessary and sufficient to turn the (unconditional) pseudodeterministic algorithm from Theorem 4 into a deterministic algorithm.

1.2 Related Work

There has been a lot of work on explicitly constructing combinatorial objects that can be shown to exist by the probabilistic method. Vadhan [31] surveys known unconditional constructions of such objects, and connections to the theory of pseudorandomness. There are important properties, such as the Ramsey property, for which optimal explicit constructions are still not known, though there has been much recent progress (cf. [8, 7]). However, in many cases, such constructions do exist if the notion of explicitness is weakened or if a sufficiently strong derandomization hypothesis is made [29, 26].

The techniques used to show explicit constructions of combinatorial objects do not seem to be directly relevant to constructions of algebraic objects such as irreducible polynomials or number-theoretic objects such as primes. Shoup [27] shows how to deterministically construct an irreducible polynomial of degree nn over the field 𝔽p\mathbb{F}_{p} in time polynomial in nn and pp. This is useful for constructions of irreducible polynomials over fields of small characteristic, but the large-characteristic case is still open – ideally we would like the construction algorithm to operate in time poly(n,log(p))\operatorname{poly}(n,\log(p)).

For primes, known results are even weaker. The fastest known algorithm generates nn-bit primes in time 2(γ+o(1))n2^{(\gamma+o(1))n}, for γ=1/2\gamma=1/2 [24]. There are algorithms that achieve an arbitrarily small constant γ>0\gamma>0, but assume certain number-theoretic conjectures. Faster running times can be obtained under stronger conjectures, and we refer to the introduction of [28] for more information.

Assuming standard (but hard to prove) derandomization hypotheses, stronger explicit constructions are known. It is folklore that the existence of hitting sets against a class \mathfrak{C} of algorithms yields explicit deterministic constructions for every dense property computed by \mathfrak{C}-algorithms. References that discuss this include [29, 26, 15]). As an example, the assumption that 𝖤\mathsf{E} requires exponential-size Boolean circuits implies polynomial-time explicit constructions of irreducible polynomials and of primes. However, in this work, we are interested in unconditional, albeit pseudodeterministic, constructions for properties decidable in polynomial time. (While there are unconditional pseudorandom generators against restricted classes of algorithms such as small-depth polynomial size circuits, it is known that such circuits cannot decide several properties of interest, such as prime numbers [3].)

Perhaps the most closely related result is a certain unconditional derandomization of one-sided polynomial time randomized algorithms in subexponential time established in [22]. However, the focus there is on decision problems, and as remarked above, such results do not immediately imply pseudodeterministic constructions. The easy witness method from [22] is an important tool in some of our proofs.

The investigation of the power and limitations of pseudodeterministic algorithms is fairly recent. A sequence of works [11, 13, 12, 16] has started the development of a more general theory of pseudodeterministic computation. These papers give pseudodeterministic algorithms that are faster than their known deterministic counterparts for various concrete search problems of interest, and also give some structural results.

Connections between black-box derandomization, white-box derandomization and deterministic simulation of 𝖡𝖯𝖯\mathsf{BPP} are explored by Fortnow [9], who shows relativized separations between these notions. Goldreich [15] shows an equivalence between white-box derandomization and black-box derandomization in the average-case setting; however he consider pseudo-random generators that work against uniform algorithms, rather than against non-uniform circuits. Implagliazzo, Kabanets and Wigderson [17] give an equivalence between white-box and black-box derandomization in the setting where we allow the derandomization to be done non-deterministically with a small amount of advice, and the derandomization is only required to be correct for infinitely many input lengths.

1.3 Techniques

Suppose we wish to pseudodeterministically generate strings satisfying some property QQ that is dense and is decidable in polynomial time, such as 𝖯𝗋𝗂𝗆𝖾𝗌\mathsf{Primes}.333For concreteness, we let 𝙿𝚛𝚒𝚖𝚎𝚜=def{w{0,1}w=wn1wn2w0,wn1=1,andi=0n12iwiis prime}\mathtt{Primes}\stackrel{{\scriptstyle\rm def}}{{=}}\{w\in\{0,1\}^{*}\mid w=w_{n-1}w_{n-2}\ldots w_{0},~w_{n-1}=1,~\text{and}~\sum_{i=0}^{n-1}2^{i}w_{i}~\text{is prime}\,\}. It is well-known that using standard hardness-randomness tradeoffs, efficient deterministic generation can be done under a strong enough circuit lower bound assumption for 𝖤=def𝖣𝖳𝖨𝖬𝖤(2O(n))\mathsf{E}\stackrel{{\scriptstyle\rm def}}{{=}}\mathsf{DTIME}(2^{O(n)}) (linear exponential time).

Our first observation is that efficient pseudodeterministic generation follows from weaker circuit lower bound assumptions, namely circuit lower bounds for the probabilistic classes 𝖡𝖯𝖤=𝖡𝖯𝖳𝖨𝖬𝖤(2O(n))\mathsf{BPE}=\mathsf{BPTIME}(2^{O(n)}) (bounded-error linear exponential time) and 𝖹𝖯𝖤=𝖹𝖯𝖳𝖨𝖬𝖤(2O(n))\mathsf{ZPE}=\mathsf{ZPTIME}(2^{O(n)}) (zero-error linear exponential time). Pseudodeterministic algorithms come in two flavours: zero-error, where the algorithm outputs a fixed string (with high probability) or else aborts, and bounded-error, where it outputs a fixed string on most computation paths but might output other strings on exceptional computation paths. It turns out that strong enough circuit lower bounds for 𝖡𝖯𝖤\mathsf{BPE} imply efficient bounded-error pseudodeterministic generation, and strong enough circuit lower bounds for 𝖹𝖯𝖤\mathsf{ZPE} imply efficient zero-error pseudodeterministic generation. This is because a hard function in 𝖡𝖯𝖤\mathsf{BPE} (resp. a hard function in 𝖹𝖯𝖤\mathsf{ZPE}) yields a bounded-error (resp. zero-error) pseudodeterministic construction of a discrepancy set (see Section 2). In turn, once such a discrepancy set is obtained, its elements can be checked in some fixed order for membership in QQ, and the first such element belonging to QQ can then be output pseudodeterministically.

Note that circuit lower bounds for 𝖡𝖯𝖤\mathsf{BPE} do not seem useful for decision problems: using a sufficiently hard function in 𝖡𝖯𝖤\mathsf{BPE} in a pseudorandom generator would merely yield the tautologous inclusion 𝖡𝖯𝖯𝖡𝖯𝖯\mathsf{BPP}\subseteq\mathsf{BPP}. However, such circuit lower bounds are useful for pseudo-derandomization of search problems.444It is natural to wonder if there are techniques tailored to 𝖡𝖯𝖤\mathsf{BPE} and 𝖹𝖯𝖤\mathsf{ZPE} lower bounds. We refer the interested reader to the approaches outlined in [25].

To turn our conditional pseudodeterministic generation algorithms into unconditional ones, we use the uniform hardness-randomness tradeoffs of [20, 30] and win-win analysis, showing that both the success and the failure of certain pseudorandom generators can be exploited to give non-trivial pseudodeterministic constructions. The specific win-win analysis we use depends on the intended application. In order to make some constructions zero-error, we further combine the arguments with the easy witness method [22].

We describe next the main conceptual ideas behind the proof of each main result stated in Section 1.1.

Theorem 1 (Non-constructive zero-error pseudo-deterministic algorithm for 𝙿𝚛𝚒𝚖𝚎𝚜\mathtt{Primes}). Recall that Theorem 1 is a straightforward consequence of Theorem 2. In each case, it follows that there is a pseudodeterministic subexponential time algorithm which simply outputs the lexicographic first nn-bit prime in the hitting set. The non-constructive aspect of Theorem 1 arises because we do not know which of items (1) and (2) holds in Theorem 2.

Theorem 2 (Unconditional pseudo-deterministic hitting set generators). Here we use a win-win-win analysis. We try two different candidate hitting set generators 𝖾𝖺𝗌𝗒\mathcal{H}^{\mathsf{easy}} and 𝗁𝖺𝗋𝖽\mathcal{H}^{\mathsf{hard}}, both computable in deterministic subexponential time. The first generator is based on the easy witness method of Kabanets [22], and the second is the generator of Trevisan-Vadhan [30]. If either of the corresponding hitting set families intersects Q{0,1}nQ\cap\{0,1\}^{n} infinitely often, we have that the first item of Theorem 2 holds. If not, then we show that we have the complexity collapse 𝖯𝖲𝖯𝖠𝖢𝖤=𝖹𝖯𝖯\mathsf{PSPACE}=\mathsf{ZPP}. We exploit this collapse to derive strong circuit lower bounds in 𝖹𝖯𝖤\mathsf{ZPE}, and are then able to use our conditional argument for efficient pseudodeterministic generation to conclude the second item.

Theorem 3 (Constructive bounded-error pseudo-deterministic algorithm for 𝙿𝚛𝚒𝚖𝚎𝚜\mathtt{Primes}). The proof for Theorem 2 gives no information on the sparsity of input lengths for which the construction succeeds, nor does it give us an explicit algorithm. An important reason for this is that we prove item (2) to hold in Theorem 2 only if the candidate hitting set generators in item (1) fail almost everywhere. We first show a refinement of the main technical lemma which allows us to derive a consequence for item (2) from a failure of item (1) for all input lengths in a polynomially large range of input lengths. We then crucially use the fact that item (1) gives deterministically generatable hitting sets which can be checked for correctness somewhat efficiently to guarantee that either item (1) or item (2) must hold in every large enough polynomial range of input lengths.555The possible sparsity of the sequence of primes produced by our algorithm is an artifact of our complexity-theoretic techniques. In contrast, constructions using standard number-theoretic techniques typically use analytic methods and succeed for every large enough input length (James Maynard, personal communication). The details are somewhat technical, and we provide a more intuitive explanation in Section 3.4.

Theorem 4 (Pseudodeterministic algorithm for 𝖢𝖠𝖯𝖯\mathsf{CAPP}). We use a win-win analysis once again, relying on the fact that pseudo-random generators can be employed to approximate the acceptance probability of circuits in a deterministic fashion. If the candidate pseudo-random generator we use succeeds infinitely often, we can solve 𝖢𝖠𝖯𝖯\mathsf{CAPP} deterministically infinitely often; if it fails in an average-case sense, we adapt the arguments used in the proof of Theorem 2 to show how to solve 𝖢𝖠𝖯𝖯\mathsf{CAPP} pseudodeterministically in polynomial time.

Theorem 5 (Equivalences for deterministic algorithms in the average-case ). The most interesting implications rely on results from previous works. The simulation in (3) assuming (2) introduces advice, and this advice is eliminated in item (4) as follows. Under assumption (3), it follows by diagonalization that 𝖤𝖷𝖯𝖡𝖯𝖯\mathsf{EXP}\neq\mathsf{BPP}. In turn, [20] showed that this hypothesis provides sub-exponential time simulations of 𝖡𝖯𝖯\mathsf{BPP}, as required in (4). Perhaps a more surprising connection is that (4) implies (1). Our argument is based on another win-win analysis, and relies on results from [5, 20, 30]. Under (4), it can be shown that 𝖤𝖷𝖯𝖡𝖯𝖯\mathsf{EXP}\neq\mathsf{BPP}, and that this implies that either 𝖤𝖷𝖯𝖯/𝗉𝗈𝗅𝗒\mathsf{EXP}\nsubseteq\mathsf{P}/\mathsf{poly}, or 𝖯𝖲𝖯𝖠𝖢𝖤𝖡𝖯𝖯\mathsf{PSPACE}\neq\mathsf{BPP}. In each case, we argue that any samplable distribution admits an average-case pseudo-random generator satisfying the conditions in (1).

1.4 Constructivity: PSEUDO versus SPARSE

Note the quantification in the statement of Theorem 2: there is a pseudodeterministic polynomial time algorithm producing a hitting set family which works for every sufficiently dense easy property, or there is a deterministic subexponential time algorithm producing hitting set families which work infinitely often for every sufficiently dense easy property. Thus we provably live in one of two worlds:666Inspired by the worlds of Impagliazzo [18]. a world PSEUDO where there is a generic hitting set family for sufficiently dense easy properties that is computable in zero-error pseudodeterministic polynomial time, or a world SPARSE where generic hitting set families are computable deterministically but only in subexponential time, and moreover the hitting sets only work infinitely often. These two worlds could co-exist. Indeed many complexity theorists believe that linear exponential time requires exponential size circuits on almost all input lengths, which would imply the co-existence of the two worlds. However, given the available techniques at this point in time, we are only able to establish that we live in one of the two worlds.

The fact that we can show that we live in one of these two worlds, but don’t know which one, leads to a certain non-constructivity in our results, which is ironic given that we are motivated by explicit constructions! We can show that we live in one of the worlds PSEUDO or SPARSE, and in the latter case, our proof provides an explicit algorithm witnessing that we live in that world, namely the algorithm producing the union of the hitting set families 𝖾𝖺𝗌𝗒\mathcal{H}^{\mathsf{easy}} and 𝗁𝖺𝗋𝖽\mathcal{H}^{\mathsf{hard}}. However, in the former case, the proof does not provide an explicit algorithm witnessing that we live in that world. This is because the proof relies on the existence of an easy dense property which acts as distinguisher for the hitting set families, and we do not know a priori which property this is.

A further element of non-constructivity in Theorem 2 is that in case we live in the world SPARSE, we have no information on the set of input lengths for which the hitting set works, except that this set is infinite. This set could be arbitrarily sparse. The reason is that we can only show the second item based on the hitting set families 𝖾𝖺𝗌𝗒\mathcal{H}^{\mathsf{easy}} and 𝗁𝖺𝗋𝖽\mathcal{H}^{\mathsf{hard}} failing to work on all large enough input lengths.

We partially address both issues in Section 3.4, and we refer to that section for further discussions on PSEUDO and SPARSE.

2 Preliminaries

2.1 Basic Definitions and Notation

We refer to algorithms in a sufficiently strong computational model, such as the 2-tape Turing Machine over the alphabet {0,1,}\{0,1,\perp\}. We use standard encodings of objects such as numbers and finite sets by strings. For convenience, we let =def{1,2,}\mathbb{N}\stackrel{{\scriptstyle\rm def}}{{=}}\{1,2,\ldots\}. Given a string u{0,1}nu\in\{0,1\}^{\geq n}, we let 𝗅𝖾𝖿𝗍n(u)\mathsf{left}_{n}(u) denote its leftmost nn bits.

Properties and Density. A property777We use the term “property” rather than “language” or “Boolean function” to highlight that in our setting, we are more interested in the efficient constructibility of positive instances than in efficient recognizability. is an arbitrary set Q{0,1}Q\subseteq\{0,1\}^{*}. Let Qn=defQ{0,1}nQ_{n}\stackrel{{\scriptstyle\rm def}}{{=}}Q\,\cap\,\{0,1\}^{n}, and Qn=defmnQmQ_{\leq n}\stackrel{{\scriptstyle\rm def}}{{=}}\bigcup_{m\leq n}Q_{m}. Given a function γ:\gamma\colon\mathbb{N}\to\mathbb{R}, we say that QQ is γ\gamma-dense if |Qn|/2nγ(n)|Q_{n}|/2^{n}\geq\gamma(n) for every large enough nn. We say that QQ is dense if there is c>0c>0 such that QQ is γ\gamma-dense with γ(n)nc\gamma(n)\geq n^{-c} for every sufficiently large nn. We say that QQ is easy if QQ is decidable in deterministic polynomial time.

Hitting Sets and Discrepancy Sets. Let ={Hn}n\mathcal{H}=\{H_{n}\}_{n\in\mathbb{N}} be a sequence, where Hn{0,1}nH_{n}\subseteq\{0,1\}^{n} for each nn\in\mathbb{N}, and let Q{0,1}Q\subseteq\{0,1\}^{*} be a property. We say that \mathcal{H} is a hitting set for QQ at length nn if HnQnH_{n}\cap Q_{n}\neq\emptyset. Given a set SS\subseteq\mathbb{N} of input lengths, we say that \mathcal{H} is a hitting set family for QQ on SS if it is a hitting set for QQ at length nn for each nSn\in S. We say that \mathcal{H} is a hitting set family for QQ in case it is a hitting set family for QQ on some co-finite set SS, and we say that \mathcal{H} is an i.o. hitting set family for QQ if it is a hitting set for QQ on some infinite set SS.

Let γ:\gamma\colon\mathbb{N}\to\mathbb{R} be an arbitrary function. We say that a sequence \mathcal{H} of (multi-) sets HnH_{n} is a γ\gamma-discrepancy set for QQ at length nn if ||Qn|/2n|HnQn|/|Hn||<γ(n)\left||Q_{n}|/2^{n}-|H_{n}\cap Q_{n}|/|H_{n}|\right|<\gamma(n). The notions of being a γ\gamma-discrepancy set family at a set SS\subseteq\mathbb{N} of input lengths, an i.o. γ\gamma-discrepancy set family and a γ\gamma-discrepancy set family are defined in analogy to the previous paragraph. Note that if QQ is γ\gamma-dense, then a γ\gamma-discrepancy set family \mathcal{H} for QQ is also a hitting set family for QQ.

Pseudodeterministic Algorithms. By default, we consider randomized algorithms whose input and output are both strings. Let pp be a real-valued parameter. A randomized algorithm A()A(\cdot) is said to be a bounded-error pseudodeterministic algorithm with success probability pp if there is a function f:{0,1}{0,1}f\colon\{0,1\}^{*}\to\{0,1\}^{*} such that A(x)=f(x)A(x)=f(x) with probability at least pp over the random choices of AA. We call such a function ff a pp-canonical function for AA, and an output f(x)f(x) of the function a pp-canonical output of A(x)A(x). A randomized algorithm A()A(\cdot) is said to be a zero-error pseudodeterministic algorithm with success probability pp if there is a function f:{0,1}{0,1}f\colon\{0,1\}^{*}\to\{0,1\}^{*} such that on each computation path, A(x)A(x) outputs either f(x)f(x) or \perp, and A(x)=f(x)A(x)=f(x) with probability at least pp over the random choices of AA.

Given a set SS of inputs, we say that an algorithm is pseudodeterministic on SS if the pseudodeterministic promise is only required to hold for inputs in SS. When the algorithm takes a unary input, we sometimes identify subsets of inputs with subsets of \mathbb{N}, in the natural way.

For any bounded-error pseudodeterministic algorithm with success probability >1/2>1/2 or any zero-error pseudodeterministic algorithm with success probability >0>0, there is a unique pp-canonical function, defined in the former case by the unique output produced with probability >1/2>1/2, and in the latter case by the unique non-\perp output. In both cases, we simply call the function and the corresponding output canonical.

Let QQ be a property, pp a real-valued parameter, and T:T\colon\mathbb{N}\rightarrow\mathbb{N} be a time function. We say that there is a bounded-error pseudodeterministic construction with success probability pp for QQ in time TT if there is a bounded-error pseudodeterministic algorithm AA with success probability pp such that for all large enough nn, A(1n)A(1^{n}) halts in time T(n)T(n) and has a pp-canonical output in QnQ_{n}. Similarly, we say that there is a zero-error pseudodeterministic construction with success probability pp for QQ in time TT if there is a zero-error pseudodeterministic algorithm AA with success probability pp, such that for all large enough nn, A(1n)A(1^{n}) halts in time T(n)T(n) and has a pp-canonical output in QnQ_{n}.

As with hitting sets and discrepancy sets, given a set SS\subseteq\mathbb{N}, we can generalize the notion of a pseudodeterministic construction to the notion of a pseudodeterministic construction on SS, which means that A(1n)A(1^{n}) has a pp-canonical output in QnQ_{n} for each nSn\in S. An i.o. pseudodeterministic construction is a pseudodeterministic construction on some infinite set SS.

When the parameter p=p(n)p=p(n) for a pseudodeterministic algorithm is omitted, it is taken by default to be 1o(1)1-o(1). For such a pseudodeterministic algorithm AA on input xx of length nn, for a large enough nn, we will sometimes abuse notation and use A(x)A(x) to refer to the canonical output of AA on xx. Indeed, as observed next, bounded-error pseudodeterministic constructions and zero-error pseudodeterministic constructions are largely robust to variations in the success probability.

Proposition 1.

Let Q{0,1}Q\subseteq\{0,1\}^{*} be a property, and T:T\colon\mathbb{N}\rightarrow\mathbb{N} be a time function.

  • (i)

    There exists a bounded-error pseudodeterministic construction for QQ with success probability 1/2+1/poly(n)\geq 1/2+1/\operatorname{poly}(n) in time Tpoly(n)T\cdot\operatorname{poly}(n) if and only if there is a bounded-error pseudodeterministic construction for QQ with success probability 12n\geq 1-2^{-n} in time Tpoly(n)T\cdot\operatorname{poly}(n).

  • (ii)

    There exists a zero-error pseudodeterministic construction for QQ with success probability 1/poly(n)\geq 1/\operatorname{poly}(n) in time Tpoly(n)T\cdot\operatorname{poly}(n) if and only if there is a zero-error pseudodeterministic construction for QQ with success probability 12n\geq 1-2^{-n} in time Tpoly(n)T\cdot\operatorname{poly}(n).

Proof.

The proof is a simple adaptation of the proof of error amplification for bounded-error and zero-error algorithms which recognize languages. Hence we just give a sketch.

We show the equivalence for bounded-error constructions first. We only need to show the forward implication, as the backward implication is trivial. By assumption, there is a bounded-error pseudodeterministic algorithm AA with success probability 1/2+1/poly(n)1/2+1/\operatorname{poly}(n) such that the canonical output of A(1n)A(1^{n}) belongs to QnQ_{n} for nn large enough. We amplify the success probability of AA by running it poly(n)\operatorname{poly}(n) times independently, and outputting the string that is produced most often as an output among these runs, breaking ties arbitrarily. Using standard concentration bounds, it is easy to show that this new algorithm is bounded-error pseudodeterministic with success probability at least 12n1-2^{-n}, and has the same canonical output as AA.

The proof is similar for zero-error constructions. Given a zero-error pseudodeterministic algorithm AA with success probability 1/poly(n)1/\operatorname{poly}(n), we amplify the success probability by running AA poly(n)\operatorname{poly}(n) times independently where the number of runs is chosen large enough depending on the success probability, outputting the canonical output of AA if it is produced on any of the runs, and \perp otherwise. Simply by independence of the runs, the canonical output of AA is produced by this new algorithm with success probability 12n1-2^{-n}, and the new algorithm is still zero-error pseudodeterministic. ∎

As opposed to Theorem 1, the algorithm from Theorem 3 might generate different primes on inputs 11^{\ell} for which it is not the case that =|qn|\ell=|q_{n}| for some nn. It is not excluded that on some inputs of this form each prime is generated with approximately equal and non-negligible probability. This can be partially addressed using the following simple proposition.

Proposition 2 (Purifying infinitely-often pseudo-deterministic constructors).

Let SS\subseteq\mathbb{N} be arbitrary, and let AA be a bounded-error pseudodeterministic construction for QQ with success probability 2/3\geq 2/3 on every input 1m1^{m} with mSm\in S. Then there is a bounded-error pseudodeterministic construction AA^{\prime} for QQ for which the following holds:

  • (i)

    On every input 1m1^{m} with mSm\in S, AA^{\prime} outputs the same canonical solution A(1m)A(1^{m}) with high probability.

  • (ii)

    On an arbitrary input 1n1^{n} with nn\in\mathbb{N}, there exists a set Vn{0,1}n{}V^{\prime}_{n}\subseteq\{0,1\}^{n}\cup\{\perp\} satisfying |Vn{0,1}n|1|V^{\prime}_{n}\cap\{0,1\}^{n}|\leq 1 such that A(1n)VnA^{\prime}(1^{n})\in V^{\prime}_{n} with high probability.

  • (iii)

    The running time of AA^{\prime} is at most a polynomial factor larger than the running time of AA.

Proof.

On input 1n1^{n}, AA^{\prime} simulates t=n2t=n^{2} executions of AA on input 1n1^{n}. Let a1,,ata_{1},\ldots,a_{t} be random variables supported over {0,1}n{}\{0,1\}^{n}\cup\{\perp\} representing the output of AA on each such computation. AA^{\prime} outputs the lexicographic first string in {0,1}n\{0,1\}^{n} that appears more than 0.6t0.6t times among a1,,ata_{1},\ldots,a_{t}. If no such string exists, AA^{\prime} outputs \perp.

Clearly, AA^{\prime} satisfies (iii). It is easy to see that it also satisfies (i) by a standard concentration bound, since on each such input 1m1^{m} algorithm AA outputs a fixed solution with probability 2/3\geq 2/3. To establish (ii), note that on an arbitrary input 1n1^{n}, there is at most one element b{0,1}n{}b\in\{0,1\}^{n}\cup\{\perp\} such that Pr[A(1n)=b]>1/2\Pr[A(1^{n})=b]>1/2. Take Vn={b,}V^{\prime}_{n}=\{b,\perp\} if such element exists, and set Vn={}V^{\prime}_{n}=\{\perp\} otherwise. In the latter case, the probability that any fixed string in {0,1}n\{0,1\}^{n} appears 0.6t\geq 0.6t times among a1,,ata_{1},\ldots,a_{t} is exponentially small, and by a union bound with high probability AA^{\prime} outputs Vn\perp\,\in V^{\prime}_{n}. Similarly, in the former case no string bbb^{\prime}\neq b that belongs to {0,1}n\{0,1\}^{n} will appear more than 0.6t\geq 0.6t times among a1,,ata_{1},\ldots,a_{t}, except with exponentially small probability. By a union bound, the output of AA^{\prime} must be in VnV^{\prime}_{n} with high probability. ∎

Complexity Classes. We use the standard definitions for classes such as 𝖯\mathsf{P}, 𝖡𝖯𝖯\mathsf{BPP}, 𝖱𝖯\mathsf{RP}, 𝖹𝖯𝖯\mathsf{ZPP}, and 𝖯𝖲𝖯𝖠𝖢𝖤\mathsf{PSPACE}. We will also use 𝖡𝖯𝖤=def𝖡𝖯𝖳𝖨𝖬𝖤(2O(n))\mathsf{BPE}\stackrel{{\scriptstyle\rm def}}{{=}}\mathsf{BPTIME}(2^{O(n)}), 𝖹𝖯𝖤=def𝖹𝖯𝖳𝖨𝖬𝖤(2O(n))\mathsf{ZPE}\stackrel{{\scriptstyle\rm def}}{{=}}\mathsf{ZPTIME}(2^{O(n)}) and 𝖤𝖲𝖯𝖠𝖢𝖤=def𝖣𝖲𝖯𝖠𝖢𝖤(2O(n))\mathsf{ESPACE}\stackrel{{\scriptstyle\rm def}}{{=}}\mathsf{DSPACE}(2^{O(n)}). We refer to standard textbooks such as [1, 14] for more information about complexity theory.

Boolean Circuits and Pseudorandom Generators. We consider Boolean circuits consisting of fan-in two gates over the standard 𝖡2\mathsf{B}_{2} basis, and measure circuit size by the number of wires in the circuit. The precise details will not be important here, and we refer to [21] for more background in circuit complexity. Given a size function s:s\colon\mathbb{N}\rightarrow\mathbb{N}, 𝖲𝖨𝖹𝖤(s)\mathsf{SIZE}(s) is the class of properties QQ such that QnQ_{n} has Boolean circuits of size s(n)s(n), for each nn\in\mathbb{N}.

We say that a function G:{0,1}{0,1}mG\colon\{0,1\}^{\ell}\to\{0,1\}^{m} ε\varepsilon-fools algorithms (circuits) of running time (circuit size) tt if for every such algorithm (circuit) DD,

|Prw{0,1}[D(G(w))=1]Pru{0,1}m[D(u)=1]|<ε.\left|\Pr_{w\sim\{0,1\}^{\ell}}[D(G(w))=1]-\Pr_{u\sim\{0,1\}^{m}}[D(u)=1]\right|<\varepsilon.

Otherwise, we say that DD ε\varepsilon-distinguishes GG (on seed length \ell).

We will consider a sequence {G}\{G_{\ell}\}_{\ell\in\mathbb{N}} of generators G:{0,1}{0,1}m()G_{\ell}\colon\{0,1\}^{\ell}\to\{0,1\}^{m(\ell)}, which we also view as a single function G:{0,1}{0,1}G\colon\{0,1\}^{*}\to\{0,1\}^{*}. The function m()m(\cdot) is the stretch of GG. We say that a generator GG with stretch m()m(\cdot) is quick if on every input w{0,1}w\in\{0,1\}^{\ell}, G(w)G(w) can be computed in time O(m()d)O(m(\ell)^{d}), where dd is a fixed constant independent of the remaining parameters. Finally, we say that an algorithm DD is a t(m)t(m)-distinguisher for GG if DD runs in time at most t(m)t(m), and on every sufficiently large \ell, DD 1/t(m)1/t(m)-distinguishes GG_{\ell}.

2.2 Technical Results

We make use of the following “hardness versus randomness” results.

Theorem 6 (Impagliazzo and Wigderson [19]).

There is a function F:{0,1}×{0,1}{0,1}F\colon\{0,1\}^{*}\times\{0,1\}^{*}\to\{0,1\}^{*}, computable in polynomial time, for which the following holds. For every γ>0\gamma>0, there exist constants a,b1a,b\geq 1 such that for every rr\in\mathbb{N},

F({0,1}ra×{0,1}blogr){0,1}r,F(\{0,1\}^{r^{a}}\times\{0,1\}^{b\log r})\subseteq\{0,1\}^{r},

and if Th{0,1}raT_{h}\in\{0,1\}^{r^{a}} is the truth-table of a function h:{0,1}alogr{0,1}h\colon\{0,1\}^{a\log r}\to\{0,1\} of circuit complexity rγa\geq r^{\gamma a}, then

Gh:{0,1}blogr{0,1}r,given byGh(w)=defF(Th,w),G_{h}\colon\{0,1\}^{b\log r}\to\{0,1\}^{r},\;\;\text{given by}\;\;G_{h}(w)\stackrel{{\scriptstyle\rm def}}{{=}}F(T_{h},w),

is a (quick) pseudorandom generator that (1/r)(1/r)-fools size-rr circuits.

The next generator is based on a downward-self-reducible and self-correctable 𝖯𝖲𝖯𝖠𝖢𝖤\mathsf{PSPACE}-complete language LL^{\star} described in [30], and the corresponding result can be seem as a uniform “low-end” version of Theorem 6. The following formulation is sufficient for our purposes.

Theorem 7 (Impagliazzo and Wigderson [20], Trevisan and Vadhan [30]).

For every integers b,c1b,c\geq 1, there exists an integer d1d\geq 1 and a function G:{0,1}{0,1}G^{\star}\colon\{0,1\}^{*}\to\{0,1\}^{*} with restrictions

G:{0,1}{0,1}m(),wherem()=b,G_{\ell}^{\star}\colon\{0,1\}^{\ell}\to\{0,1\}^{m(\ell)},\quad\text{where}\;\;\;m(\ell)=\ell^{b},

such that GG^{\star} can be computed in time O(m()d)=𝗉𝗈𝗅𝗒()O(m(\ell)^{d})=\mathsf{poly}(\ell) when given oracle access to LL^{\star}_{\leq\ell}, and the following holds. If the output of GG^{\star}_{\ell} can be (1/m()c)(1/m(\ell)^{c})-distinguished from random for every large enough \ell\in\mathbb{N} by an algorithm running in time O(m()c)O(m(\ell)^{c}), then 𝖯𝖲𝖯𝖠𝖢𝖤𝖡𝖯𝖯\mathsf{PSPACE}\subseteq\mathsf{BPP}.

3 Pseudodeterministic Constructions

3.1 Conditional Constructions

Lemma 1.

If there is an ε>0\varepsilon>0 and a Boolean function h𝖡𝖯𝖤h\in\mathsf{BPE} (resp. h𝖹𝖯𝖤h\in\mathsf{ZPE}) that requires circuits of size 2εm2^{\varepsilon m} on all large enough input lengths mm\in\mathbb{N}, then for each constant c>0c>0, there is a bounded-error (resp. zero-error) pseudodeterministic algorithm AA running in polynomial time such that {A(1n)}\{A(1^{n})\} is a (1/nc)(1/n^{c})-discrepancy set family for every property QQ decidable in deterministic time ncn^{c}.

Proof.

We give the proof for the case that h𝖡𝖯𝖤h\in\mathsf{BPE}; the case that h𝖹𝖯𝖤h\in\mathsf{ZPE} is exactly analogous. Assume without loss of generality that the probabilistic exponential-time machine NN computing hh has failure probability <22m<2^{-2m} on any input of length mm.

We define the behaviour of pseudodeterministic algorithm AA on input 1n1^{n} using Theorem 6 as follows. We apply this result with constants aa and bb corresponding to the choice γ=ε\gamma=\varepsilon. Let r=n2cr=n^{2c}. The algorithm AA first computes the truth table ThT_{h} of the function hh on input size alogra\log r by evaluating hh on every input of size alogra\log r using the probabilistic exponential-time machine NN. (We assume here that rr is a power of 22; if not, the same argument works by setting rr to be the smallest power of 22 larger than n2cn^{2c}.) Note that by a union bound, AA computes the entire truth table correctly with probability 1o(1)1-o(1), and runs in time poly(n)\operatorname{poly}(n). AA then computes F(Th,y)F(T_{h},y) for each string y{0,1}blogry\in\{0,1\}^{b\log r}, using the polynomial-time algorithm for FF guaranteed by Theorem 6, and forms a multi-set Hn{0,1}n2cH^{\prime}_{n}\subseteq\{0,1\}^{n^{2c}} composed of the union of these strings. It then forms the (multi-) set Hn=def{𝗅𝖾𝖿𝗍n(u)uHn}H_{n}\stackrel{{\scriptstyle\rm def}}{{=}}\{\mathsf{left}_{n}(u)\mid u\in H^{\prime}_{n}\}, and outputs HnH_{n}.

Note that the same set HnH_{n} is output whenever the correct truth table ThT_{h} is computed, which happens with probability 1o(1)1-o(1) as argued before. Hence AA is a pseudodeterministic algorithm with success probability 1o(1)1-o(1). Let HnH_{n} be the canonical output of A(1n)A(1^{n}).

It remains to argue that HnH_{n} is a 1/nc1/n^{c}-discrepancy set for QnQ_{n} for large enough nn, where QQ is any property decidable in time ncn^{c} for nn large enough. Let MM be a deterministic machine deciding QQ with a running time of this form, and let DnD_{n} be the Boolean circuit of size n2cn^{2c} obtained by translating MM’s computation on inputs of length nn into a circuit, as in the proof of the Cook-Levin theorem. Let CnC_{n} be the circuit of size n2cn^{2c} on input xx of size n2cn^{2c}, which simulates DnD_{n} on 𝗅𝖾𝖿𝗍n(x)\mathsf{left}_{n}(x) and outputs the answer. Finally, let nn be large enough that hh requires circuits of size at least m2acεm^{2ac\varepsilon} on inputs of size 2aclogm2ac\log m for any mnm\geq n that is a power of two. By Theorem 6, Gh:{0,1}blogr{0,1}rG_{h}\colon\{0,1\}^{b\log r}\to\{0,1\}^{r} 1/n2c1/n^{2c}-fools CnC_{n}. It follows that HnH_{n} is a 1/nc1/n^{c}-discrepancy set for QnQ_{n} for nn large enough, using the facts that CnC_{n} accepts a string uu of length n2cn^{2c} if and only if DnD_{n} accepts 𝗅𝖾𝖿𝗍n(u)\mathsf{left}_{n}(u), and that DnD_{n} accepts a string z{0,1}nz\in\{0,1\}^{n} if and only if zQnz\in Q_{n}. ∎

Remark 1.

We note that the conclusion of Lemma 1 holds even for properties decidable by Boolean circuits of size nc\leq n^{c}, since we do not take advantage of uniformity in the argument above.

Corollary 1.

Let QQ be any property that is easy and dense. If there is an ε>0\varepsilon>0 and a Boolean function f𝖡𝖯𝖤f\in\mathsf{BPE} (resp. f𝖹𝖯𝖤f\in\mathsf{ZPE}) that requires circuits of size 2εm2^{\varepsilon m} on all large enough input lengths mm\in\mathbb{N}, then there is a bounded-error (resp. zero-error) pseudodeterministic construction for QQ in polynomial time.

Proof.

Again we give the proof for the case that f𝖡𝖯𝖤f\in\mathsf{BPE}; the case that f𝖹𝖯𝖤f\in\mathsf{ZPE} is exactly analogous. Let QQ be any property that is easy and dense. Let MM be a polynomial-time Turing machine deciding QQ. Let cc be a constant chosen large enough such that QnQ_{n} is 1/nc1/n^{c}-dense and MM runs in time at most ncn^{c} for nn large enough. Using Lemma 1, we have that there is a bounded-error pseudodeterministic algorithm AA running in polynomial time such that the canonical output HnH_{n} of A(1n)A(1^{n}) is a 1/nc1/n^{c}-discrepancy set for QnQ_{n}. Hence, by the density condition on QQ, we have that HnH_{n} is a hitting set for QnQ_{n} for nn large enough.

We define a bounded-error pseudodeterministic algorithm AQA_{Q} running in polynomial time, whose canonical output on input 1n1^{n} belongs to QnQ_{n} for nn large enough. AQ(1n)A_{Q}(1^{n}) first simulates A(1n)A(1^{n}) to obtain a subset SnS_{n} of {0,1}n\{0,1\}^{n}; if the output of A(1n)A(1^{n}) is not such a subset, it outputs an arbitrary string. With probability 1o(1)1-o(1), SnS_{n} is the canonical output of A(1n)A(1^{n}), which is the hitting set Hn{0,1}nH_{n}\subseteq\{0,1\}^{n} of size poly(n)\operatorname{poly}(n). AQA_{Q} then orders the strings in SnS_{n} in lexicographic order to obtain a list y1,y2,,ymy_{1},y_{2},\ldots,y_{m}, where m=poly(n)m=\operatorname{poly}(n), and each yiy_{i}, i=1,,mi=1,\ldots,m, is an nn-bit string. AQA_{Q} simulates MM on each of the yiy_{i}’s, in order, until it finds a yiy_{i} on which MM accepts. If it finds such a yiy_{i}, it outputs yiy_{i}, otherwise it rejects.

For nn large enough, let znz_{n} be the smallest element of HnH_{n} in lexicographic order which belongs to QnQ_{n}. Since HnH_{n} is a hitting set for QnQ_{n} for nn large enough, such a string znz_{n} exists. It is easy to see that AQA_{Q} outputs znz_{n} with probability 1o(1)1-o(1), and hence that znz_{n} is the canonical output of AQ(1n)A_{Q}(1^{n}). This is because Sn=HnS_{n}=H_{n} with probability 1o(1)1-o(1), and whenever Sn=HnS_{n}=H_{n}, the string znz_{n} is output by AQA_{Q}. Clearly AQA_{Q} runs in time poly(n)\operatorname{poly}(n) and is a pseudodeterministic algorithm with success probability 1o(1)1-o(1) whose canonical output is in QnQ_{n} for nn large enough. ∎

The proof of Corollary 1 can easily be adapted to give a bounded-error pseudodeterministic construction in polynomial time even when the condition on easiness of QQ is relaxed to Q𝖡𝖯𝖯Q\in\mathsf{BPP}, and a zero-error pseudodeterministic construction in polynomial time even when the condition on easiness of QQ is relaxed to Q𝖹𝖯𝖯Q\in\mathsf{ZPP}. There is also a natural tradeoff between the hardness assumption and the running time of the corresponding pseudodeterministic construction, which can be obtained by using a generalization of Theorem 6 giving a hardness-randomness tradeoff based on circuit lower bounds varying from superpolynomial to exponential.

Note that the easiness assumption on QQ is used twice to obtain Corollary 1, the first time in the proof of Lemma 1 to obtain pseudodeterministic algorithms outputting discrepancy sets based on the hardness assumption, and the second time in the proof of Corollary 1 to obtain a pseudodeterministic construction for QQ from the discrepancy set. The first use of the assumption can be eliminated by using a stronger hardness assumption with respects to circuits that have oracle access to QQ, but the second use seems essential.

3.2 Unconditional Constructions that Work Infinitely Often

By using in addition uniform hardness-randomness tradeoffs, we obtain unconditionally that there are pseudodeterministic constructions for easy dense sets in polynomial time, or else there are deterministic constructions for easy dense sets in subexponential time which work infinitely often. In fact, we obtain the following stronger result stating that in either case, there is a generic hitting set family that works simultaneously for all easy dense sets where the easiness and density parameters are fixed in advance.

Theorem 8 (Restatement of Theorem 2).

Let c>0c>0 be any constant. At least one of the following is true:

  1. 1.

    There is a pseudodeterministic algorithm AA running in polynomial time such that {A(1n)}\{A(1^{n})\} is a hitting set family for every 1/nc1/n^{c}-dense property QQ decidable in time ncn^{c}.

  2. 2.

    For each ε>0\varepsilon>0, there is a deterministic algorithm BεB_{\varepsilon} running in time O(2nε)O(2^{n^{\varepsilon}}), such that {Bε(1n)}\{B_{\varepsilon}(1^{n})\} is an i.o. hitting set family for every 1/nc1/n^{c}-dense property QQ decidable in time ncn^{c}.

We now give the proof of Theorem 8. Informally, the proof is a “win-win-win” argument using uniform hardness-randomness tradeoffs. We will describe two candidate hitting set families 𝖾𝖺𝗌𝗒\mathcal{H}^{\mathsf{easy}} and 𝗁𝖺𝗋𝖽\mathcal{H}^{\mathsf{hard}} computable in sub-exponential time, the first based on the “easy witness” method of Kabanets [22], and the second based on the uniform hardness-randomness tradeoffs of Impagliazzo-Wigderson and Trevisan-Vadhan [20, 30]. We will show that if there is a sufficiently easy dense property QQ such that 𝖾𝖺𝗌𝗒\mathcal{H}^{\mathsf{easy}} is not an i.o. hitting set family for QQ, then 𝖡𝖯𝖯=𝖹𝖯𝖯\mathsf{BPP}=\mathsf{ZPP}. We will also show that if there is a sufficiently easy dense property QQ such that 𝗁𝖺𝗋𝖽\mathcal{H}^{\mathsf{hard}} is not an i.o. hitting set family for QQ, then 𝖯𝖲𝖯𝖠𝖢𝖤=𝖡𝖯𝖯\mathsf{PSPACE}=\mathsf{BPP}. Thus, in each of these cases, we either “win” for each sufficiently easy dense property QQ by computing an i.o. hitting set family in sub-exponential time, or we have a complexity collapse. Finally, we show how to “win” in the case that both complexity collapses occur, by using Lemma 1. The win in this case is in the form of a polynomial-time pseudodeterministic algorithm which outputs a hitting set family for each sufficiently easy dense property. When either of the first two wins occur, item 2 of Theorem 8 holds, and when the third win occurs, item 1 holds.

Fix a c>0c>0 as in the statement of Theorem 8, and let ε>0\varepsilon>0 be any constant. The candidate hitting set families 𝖾𝖺𝗌𝗒\mathcal{H}^{\mathsf{easy}} and 𝗁𝖺𝗋𝖽\mathcal{H}^{\mathsf{hard}} depend on ε\varepsilon, but we work with a fixed arbitrarily small ε>0\varepsilon>0 through the proof, and therefore do not need to formalize this dependence.

We first define the candidate hitting set family 𝖾𝖺𝗌𝗒\mathcal{H}^{\mathsf{easy}}. Consider the set 𝒞n\mathcal{C}_{n} of all Boolean circuits CC on logn\lceil\log n\rceil input variables and of size at most nδn^{\delta}, where δ=defε/10\delta\stackrel{{\scriptstyle\rm def}}{{=}}\varepsilon/10. Each circuit C𝒞nC\in\mathcal{C}_{n} computes a Boolean function fC:{0,1}log(n){0,1}f_{C}\colon\{0,1\}^{\lceil\log(n)\rceil}\to\{0,1\}, and its truth-table 𝗍𝗍(fC)\mathsf{tt}(f_{C}) is a string of length n\geq n. We consider the following family 𝖾𝖺𝗌𝗒={Hn𝖾𝖺𝗌𝗒}\mathcal{H}^{\mathsf{easy}}=\{H_{n}^{\mathsf{easy}}\} obtained from 𝒞n\mathcal{C}_{n}:

Hn𝖾𝖺𝗌𝗒=def{𝗅𝖾𝖿𝗍n(𝗍𝗍(fC))C𝒞n}{0,1}n.H_{n}^{\mathsf{easy}}\stackrel{{\scriptstyle\rm def}}{{=}}\{\mathsf{left}_{n}(\mathsf{tt}(f_{C}))\mid C\in\mathcal{C}_{n}\}\subseteq\{0,1\}^{n}.

By our choice of δ=ε/10\delta=\varepsilon/10 and a standard upper bound on the number of small circuits (cf. [1]), there are at most O(2n2δ)O(2nε/2)O(2^{n^{2\delta}})\leq O(2^{n^{\varepsilon/2}}) strings in n𝖾𝖺𝗌𝗒\mathcal{H}_{n}^{\mathsf{easy}}. Furthermore, an ordered list containing all such strings can be printed in time O(2nε)O(2^{n^{\varepsilon}}).

The following lemma is key to our analysis of 𝖾𝖺𝗌𝗒\mathcal{H}^{\mathsf{easy}}.

Lemma 2.

If there is a 1/nc1/n^{c}-dense property QQ decidable in deterministic time ncn^{c} such that 𝖾𝖺𝗌𝗒\mathcal{H}^{\mathsf{easy}} is not an i.o. hitting set family for QQ, then 𝖡𝖯𝖯𝖹𝖯𝖯\mathsf{BPP}\subseteq\mathsf{ZPP}.

Proof.

Let L𝖡𝖯𝖯L\in\mathsf{BPP}, and VLV_{L} be a polynomial time verifier that decides LL in time ncL/2n^{c_{L}/2}, where cL1c_{L}\geq 1. In other words, if xLx\in L then Pry[VL(x,y)=1]2/3\Pr_{y}[V_{L}(x,y)=1]\geq 2/3, while if xLx\notin L we have Pry[VL(x,y)=1]1/3\Pr_{y}[V_{L}(x,y)=1]\leq 1/3. By assumption, there is a 1/nc1/n^{c}-dense property QQ decidable in deterministic time ncn^{c} such that Hn𝖾𝖺𝗌𝗒Qn=H_{n}^{\mathsf{easy}}\cap Q_{n}=\emptyset whenever nn0n\geq n_{0}, where n0n_{0} is a fixed constant. Let VV be a deterministic Turing machine running in time ncn^{c} for nn large enough, and deciding QQ.

The following zero-error algorithm B1B_{1} decides LL in polynomial time. Let x{0,1}nx\in\{0,1\}^{n} be the input string of B1B_{1}. If n<n0n<n_{0}, B1B_{1} outputs the correct answer by storing it on its code. Otherwise, consider the Boolean circuit DxD_{x} of size at most ncLn^{c_{L}} obtained from VLV_{L} by fixing its first input to xx. In order to decide LL on xx it is enough to estimate the acceptance probability of DxD_{x} with additive error at most 1/101/10.

Let m=defncLm\stackrel{{\scriptstyle\rm def}}{{=}}n^{c_{L}}, γ=defδ\gamma\stackrel{{\scriptstyle\rm def}}{{=}}\delta, and assume from now on that nn0n\geq n_{0}. Let FF be the polynomial time computable function from Theorem 6, and a,b1a,b\geq 1 be the respective constants for our choice of γ\gamma. Finally, set =defalog(r)=acLlog(n)\ell\stackrel{{\scriptstyle\rm def}}{{=}}a\cdot\log(r)=a\cdot c_{L}\cdot\log(n), and m=def2=nacLpoly(n)m\stackrel{{\scriptstyle\rm def}}{{=}}2^{\ell}=n^{a\cdot c_{L}}\leq\operatorname{poly}(n).

Algorithm B1B_{1} samples k=defm10ck\stackrel{{\scriptstyle\rm def}}{{=}}m^{10c} independent uniformly distributed strings z1,,zk{0,1}mz_{1},\ldots,z_{k}\sim\{0,1\}^{m}. Let ziz_{i} be the first string on this list such that V(zi)=1V(z_{i})=1, if such string exists. Otherwise, B1B_{1} aborts its computation. Using the hypothesis that QQ is ncn^{-c}-dense, we get that whenever nn is sufficiently large, algorithm B1B_{1} succeeds with high probability in finding a string ziz_{i} of this form. By redefining n0n_{0}, we can assume without loss of generality that B1B_{1} succeeds whenever nn0n\geq n_{0}.

Since mnn0m\geq n\geq n_{0} and ziQz_{i}\in Q, it follows from our previous discussion that ziHm𝖾𝖺𝗌𝗒z_{i}\notin H_{m}^{\mathsf{easy}}. In other words, ziz_{i} is not the leftmost segment of the truth-table of a Boolean function f:{0,1}alogr{0,1}f\colon\{0,1\}^{a\cdot\log r}\to\{0,1\} of circuit complexity at most mδ=rγam^{\delta}=r^{\gamma a}.

Let h:{0,1}alogm{0,1}h\colon\{0,1\}^{a\log m}\to\{0,1\} be the Boolean function encoded by the string ziz_{i} completed with zeroes until the next power of two. The previous paragraph implies that hh has circuit complexity greater than rγar^{\gamma a}. It follows from Theorem 6 that Gh:{0,1}blogr{0,1}rG_{h}\colon\{0,1\}^{b\log r}\to\{0,1\}^{r} is a generator that (1/10)(1/10)-fools circuits of size at most r=ncLr=n^{c_{L}}. Since FF and hh are efficiently computable in nn, B1B_{1} can compute Gh(w)=F(zi,w)G_{h}(w)=F(z_{i},w) on every input w{0,1}alogrw\in\{0,1\}^{a\log r} in time 𝗉𝗈𝗅𝗒(n)\mathsf{poly}(n). Moreover, the seed length of GhG_{h} is O(logn)O(\log n). By standard methods, i.e. by trying all possible seeds of GhG_{h} and taking a majority vote using DxD_{x}, it follows that B1B_{1} can efficiently decide whether xx is in LL. In addition, it is clear that B1B_{1} decides LL with zero-error, since it aborts (with a small probability) when a good string ziz_{i} is not found. Consequently, L𝖹𝖯𝖯L\in\mathsf{ZPP}, which completes the proof of Lemma 2. ∎

Next we define the candidate hitting set family 𝗁𝖺𝗋𝖽\mathcal{H}^{\mathsf{hard}}. Assume that the 𝖯𝖲𝖯𝖠𝖢𝖤\mathsf{PSPACE}-complete language LL^{\star} from Theorem 7 can be decided in space O(na)O(n^{a}), where aa\in\mathbb{N}. Let δ=defε/(10a)\delta\stackrel{{\scriptstyle\rm def}}{{=}}\varepsilon/(10a). Consider the function GG^{\star} obtained from an application of Theorem 7 with stretch parameter b=1/δb=1/\delta and the parameter cc set as in the statement of Theorem 2. This gives a sequence {G}\{G^{\star}_{\ell}\}_{\ell\in\mathbb{N}} of functions computable with oracle access to LL^{\star}_{\leq\ell} in time 𝗉𝗈𝗅𝗒()\mathsf{poly}(\ell), where each G:{0,1}{0,1}bG^{\star}_{\ell}\colon\{0,1\}^{\ell}\to\{0,1\}^{\ell^{b}}. Consider a seed function s(n)=defnδs(n)\stackrel{{\scriptstyle\rm def}}{{=}}\lceil n^{\delta}\rceil, and let Gn=defGs(n)G_{n}\stackrel{{\scriptstyle\rm def}}{{=}}G^{\star}_{s(n)}. Since b=1/δb=1/\delta, we have

Gn:{0,1}nδ{0,1}n.G_{n}\colon\{0,1\}^{\lceil n^{\delta}\rceil}\to\{0,1\}^{\geq n}.

In addition, GnG_{n} can be computed in time O(2nε/5)O(2^{n^{\varepsilon/5}}) without access to an oracle. This is because the oracle answers to LnδL_{\leq n^{\delta}} can be computed within this running time due to our choice of parameters and the fact that bounded-space algorithms run in time at most exponential.

Each set Hn𝗁𝖺𝗋𝖽H_{n}^{\mathsf{hard}} is obtained from GnG_{n} as follows:

Hn𝗁𝖺𝗋𝖽=def{𝗅𝖾𝖿𝗍n(Gn(w))w{0,1}s(n)}.H_{n}^{\mathsf{hard}}\stackrel{{\scriptstyle\rm def}}{{=}}\{\mathsf{left}_{n}(G_{n}(w))\mid w\in\{0,1\}^{s(n)}\}.

The following lemma is key to our analysis of 𝗁𝖺𝗋𝖽\mathcal{H}^{\mathsf{hard}}.

Lemma 3.

If there is a 1/nc1/n^{c}-dense property QQ decidable in deterministic time ncn^{c} such that 𝗁𝖺𝗋𝖽\mathcal{H}^{\mathsf{hard}} is not an i.o. hitting set family for QQ, then 𝖯𝖲𝖯𝖠𝖢𝖤𝖡𝖯𝖯\mathsf{PSPACE}\subseteq\mathsf{BPP}.

Proof.

If 𝗁𝖺𝗋𝖽\mathcal{H}^{\mathsf{hard}} is not an i.o. hitting set family for QQ, it must be the case that Hn𝗁𝖺𝗋𝖽Qn=H_{n}^{\mathsf{hard}}\cap Q_{n}=\emptyset for every large enough nn. Equivalently, 𝗅𝖾𝖿𝗍n(Gs(n)({0,1}s(n)))Qn=\mathsf{left}_{n}(G^{\star}_{s(n)}(\{0,1\}^{s(n)}))\,\cap\,Q_{n}=\emptyset, where s(n)=nδs(n)=n^{\delta}. Since s()s(\cdot) is surjective as a function in \mathbb{N}\to\mathbb{N}, for every large enough \ell,

G({0,1})Qb=.G^{\star}_{\ell}(\{0,1\}^{\ell})\,\cap\,Q_{\ell^{b}}=\emptyset.

On the other hand, QQ is a ncn^{-c}-dense property, and for large enough \ell,

Pry{0,1}b[yEb]=Pry{0,1}b[V(y)=1]bc=mc,\Pr_{y\sim\{0,1\}^{\ell^{b}}}[y\in E_{\ell^{b}}]\;=\;\Pr_{y\sim\{0,1\}^{\ell^{b}}}[V(y)=1]\;\geq\;\ell^{-bc}\;=\;m^{-c},

using m=bm=\ell^{b} as in Theorem 7. Furthermore, by assumption there is a deterministic Turing machine VV running in time at most mcm^{c} on inputs of length mm for large enough mm, and deciding QQ. Therefore, it can be used as a distinguisher against GG^{\star}, matching the parameters of Theorem 7. Thus 𝖯𝖲𝖯𝖠𝖢𝖤𝖡𝖯𝖯\mathsf{PSPACE}\subseteq\mathsf{BPP}, completing the proof of Lemma 3. ∎

We complete the proof of Theorem 8 using a third and final application of the hardness versus randomness paradigm. If 𝖾𝖺𝗌𝗒\mathcal{H}^{\mathsf{easy}} is an i.o. hitting set family for every ncn^{-c}-dense property QQ decidable in deterministic time ncn^{c}, the second item of Theorem 8 holds by letting BεB_{\varepsilon} be the deterministic algorithm which, on input 1n1^{n}, outputs Hn𝖾𝖺𝗌𝗒H_{n}^{\mathsf{easy}} in time 2O(nε)2^{O(n^{\varepsilon})}. If not, then we have 𝖡𝖯𝖯=𝖹𝖯𝖯\mathsf{BPP}=\mathsf{ZPP} by Lemma 2. If 𝗁𝖺𝗋𝖽\mathcal{H}^{\mathsf{hard}} is an i.o. hitting set family for every ncn^{-c}-dense property QQ decidable in deterministic time ncn^{c}, then again, the second item of Theorem 8 holds by letting BεB_{\varepsilon} be the deterministic algorithm which, on input 1n1^{n}, outputs Hn𝗁𝖺𝗋𝖽H_{n}^{\mathsf{hard}} in time 2O(nε)2^{O(n^{\varepsilon})}. If not, then we have 𝖯𝖲𝖯𝖠𝖢𝖤=𝖡𝖯𝖯\mathsf{PSPACE}=\mathsf{BPP} by Lemma 3. Thus, if the second item of Theorem 8 fails to hold, we have the complexity collapse 𝖯𝖲𝖯𝖠𝖢𝖤=𝖹𝖯𝖯\mathsf{PSPACE}=\mathsf{ZPP}. This facilitates a zero-error pseudodeterministic construction of an unconditional hitting set in polynomial time as follows.

First, it follows by direct diagonalization that there is a language computed in 𝖣𝖲𝖯𝖠𝖢𝖤(2O(m))\mathsf{DSPACE}(2^{O(m)}) that requires circuits of size 2m/2\geq 2^{m/2} for every large mm. From 𝖯𝖲𝖯𝖠𝖢𝖤𝖹𝖯𝖯\mathsf{PSPACE}\subseteq\mathsf{ZPP}, a standard padding argument implies that this language can be computed in 𝖹𝖯𝖳𝖨𝖬𝖤(2O(m))\mathsf{ZPTIME}(2^{O(m)}). In other words, there is a function h:{0,1}{0,1}h\colon\{0,1\}^{*}\to\{0,1\} in 𝖹𝖯𝖳𝖨𝖬𝖤(2O(m))\mathsf{ZPTIME}(2^{O(m)}) that for every large mm cannot be computed by circuits of size 2m/2\leq 2^{m/2}.

Now, by setting ε=1/2\varepsilon=1/2 in Lemma 1, we have that there is a pseudodeterministic algorithm AA running in polynomial time such that {A(1n)}\{A(1^{n})\} is a 1/nc1/n^{c}-discrepancy set family for every property QQ decidable in deterministic time ncn^{c}, and consequently a hitting set family for every 1/nc1/n^{c}-dense property QQ decidable in deterministic time ncn^{c}. This completes the proof of Theorem 8. ∎

Remark 2.

Observe that the argument presented above provides a stronger discrepancy set in the first case of Theorem 8. While this is not needed in our applications, it might be helpful elsewhere.

The generic Theorem 8 can be used to show unconditionally the existence of certain kinds of explicit constructions for easy dense properties.

Corollary 2.

Let Q{0,1}Q\subseteq\{0,1\}^{*} be any easy dense property. Then for each ε>0\varepsilon>0, there is an i.o. zero-error pseudodeterministic construction for QQ in time O(2nε)O(2^{n^{\varepsilon}}).

To establish Corollary 2, note that if the first item of Theorem 8 holds, a zero-error pseudodeterministic construction for QQ in polynomial time follows exactly as Corollary 1 follows from Lemma 1. On the other hand, if the second item of Theorem 8 holds, for every ε>0\varepsilon>0, there is an i.o. deterministic construction for QQ in time O(2nε)O(2^{n^{\varepsilon}}), just by computing the i.o. hitting sets for QQ and outputting the lexicographically first element of the hitting set in QQ, if such an element exists, and an arbitrary fixed string otherwise. Thus, in either case, for every ε>0\varepsilon>0 there is an i.o. zero-error pseudodeterministic construction for QQ in time O(2nε)O(2^{n^{\varepsilon}}).

We could trade off the parameters of items (1) and (2) of Theorem 8 to obtain a stronger bound on the running time of the construction in Corollary 2 by using a more general version of Theorem 6, but we do not pursue this direction here, as a polynomial-time bound for the construction does not appear to be provable using such an approach.

Corollary 2 also has a non-constructive element. We know that for any easy dense QQ, there is an i.o. zero-error pseudodeterministic construction, but we are unable to say explicitly what this construction is, as we do not which of the worlds PSEUDO or SPARSE we live in. Also, similarly to Theorem 8, we do not have any information on the set of input lengths for which the construction works, except that it is infinite. This can be a somewhat unsatisfactory situation where explicit constructions are concerned, and we show how to address both issues in Section 3.4.

Corollary 3 (Restatement of Theorem 1).

For each ε>0\varepsilon>0, there is an i.o. zero-error pseudodeterministic construction for 𝖯𝗋𝗂𝗆𝖾𝗌\mathsf{Primes} in time O(2nε)O(2^{n^{\varepsilon}}).

Corollary 3 follows from Corollary 2 because 𝖯𝗋𝗂𝗆𝖾𝗌\mathsf{Primes} is 1/poly(n)1/\operatorname{poly}(n)-dense by the Prime Number Theorem, and is in deterministic polynomial time by the Agrawal-Kayal-Saxena algorithm [2].

Using the ideas of the proof of Theorem 8, we can partially answer a question of the Polymath 4 Project on generating primes. The following question was posed there: does 𝖡𝖯𝖯=𝖯\mathsf{BPP}=\mathsf{P} imply a polynomial-time algorithm for generating primes? We consider a much weaker assumption, namely that 𝖹𝖯𝖯i.o.𝖣𝖳𝖨𝖬𝖤(2nc)\mathsf{ZPP}\subseteq\operatorname{i.o.}\mathsf{DTIME}(2^{n^{c}}) for some fixed constant cc. Under this assumption, we show that there is a subexponential-time deterministic algorithm for generating infinitely many primes.

Theorem 9.

If there is a c1c\geq 1 such that 𝖹𝖯𝖯i.o.𝖣𝖳𝖨𝖬𝖤(2nc)\mathsf{ZPP}\subseteq\operatorname{i.o.}\mathsf{DTIME}(2^{n^{c}}), then for each ε>0\varepsilon>0 there is a deterministic algorithm AA running in time O(2nε)O(2^{n^{\varepsilon}}) such that for infinitely many nn, A(1n)A(1^{n}) is an nn-bit prime.

Proof.

We just give a sketch, as the argument largely relies on the proof of Theorem 8. The proof of Theorem 8 establishes that if 𝖯𝖲𝖯𝖠𝖢𝖤𝖹𝖯𝖯\mathsf{PSPACE}\neq\mathsf{ZPP}, there is a subexponential-time algorithm for generating an i.o. hitting set family for sufficiently easy dense properties, and hence an i.o. deterministic construction for primes in subexponential time.

Now consider the case that 𝖯𝖲𝖯𝖠𝖢𝖤=𝖹𝖯𝖯\mathsf{PSPACE}=\mathsf{ZPP}. Either we have that 𝖤𝖷𝖯\mathsf{EXP} admits polynomial-size circuits, or it does not. In the latter case, by using Theorem 6, we again have subexponential-time generatable hitting sets for properties that are easy and dense, and hence an i.o. deterministic construction for primes in subexponential time. In the former case, by standard Karp-Lipton theorems [23], 𝖤𝖷𝖯=𝖯𝖲𝖯𝖠𝖢𝖤\mathsf{EXP}=\mathsf{PSPACE}, and hence 𝖤𝖷𝖯=𝖹𝖯𝖯\mathsf{EXP}=\mathsf{ZPP}. But in this case, the assumption that 𝖹𝖯𝖯i.o.𝖣𝖳𝖨𝖬𝖤(2nc)\mathsf{ZPP}\subseteq\operatorname{i.o.}\mathsf{DTIME}(2^{n^{c}}) gives a contradiction to the almost-everywhere deterministic time hierarchy theorem. This concludes the argument. ∎

As an example of how the generic nature of Theorem 8 is useful, consider the question of generating incompressible strings. Let f:{0,1}{0,1}f\colon\{0,1\}^{*}\to\{0,1\}^{*} be a polynomial time computable function. We say that ff is a compression scheme if ff is an injective function and on every x{0,1}x\in\{0,1\}^{*}, |f(x)||x||f(x)|\leq|x|. We use If=def{x{0,1}:|f(x)||x|1}\mathrm{I}^{f}\stackrel{{\scriptstyle\rm def}}{{=}}\{x\in\{0,1\}^{*}:\,|f(x)|\geq|x|-1\} to denote the set of ff-almost incompressible strings.

Corollary 4.

Let f:{0,1}{0,1}f\colon\{0,1\}^{*}\to\{0,1\}^{*} be an arbitrary polynomial time compression scheme. For every ε>0\varepsilon>0, there is a zero-error pseudodeterministic algorithm AA running in time O(2nε)O(2^{n^{\varepsilon}}) such that on infinitely many values of nn, A(1n)A(1^{n}) outputs an ff-almost incompressible string of length nn.

Proof.

Observe that If\mathrm{I}^{f} can be decided in polynomial time, since ff is a polynomial time computable function. Let Inf=defIf{0,1}n\mathrm{I}^{f}_{n}\stackrel{{\scriptstyle\rm def}}{{=}}\mathrm{I}^{f}\cap\{0,1\}^{n}. By a simple counting argument that uses the injectivity of ff, for every nn\in\mathbb{N} we have |Inf|/2n1/2|\mathrm{I}^{f}_{n}|/2^{n}\geq 1/2. Consequently, If\mathrm{I}^{f} is a dense language. The result now follows immediately from Corollary 2. ∎

3.3 Pseudodeterministically Sampling Distributions

In order to state the main result of this section we will need the following additional definition.

Samplable Distributions. Let 𝔇={𝒟n}n\mathfrak{D}=\{\mathcal{D}_{n}\}_{n\in\mathbb{N}} be an ensemble of probability distributions, where each 𝒟n\mathcal{D}_{n} is supported over {0,1}\{0,1\}^{*}. For a string a{0,1}a\in\{0,1\}^{*}, we let 𝒟n(a)\mathcal{D}_{n}(a) denote the probability of aa under 𝒟n\mathcal{D}_{n}. We say that 𝔇\mathfrak{D} is polynomial time samplable if there exists a polynomial time computable function g:1×{0,1}{0,1}{}g\colon 1^{*}\times\{0,1\}^{*}\to\{0,1\}^{*}\cup\{\diamond\} for which the following holds:

  • There exists an integer c1c\geq 1 such that for every nn, g(1n,{0,1}nc)𝖲𝗎𝗉𝗉𝗈𝗋𝗍(𝒟n){}g(1^{n},\{0,1\}^{n^{c}})\subseteq\mathsf{Support}(\mathcal{D}_{n})\cup\{\diamond\}.

  • There exists k1k\geq 1 such that for every nn, PrwUnc[g(1n,w)=]11/nk\Pr_{w\sim U_{n^{c}}}[g(1^{n},w)=\,\diamond\,]\leq 1-1/n^{k}.

  • For every nn and a{0,1}a\in\{0,1\}^{*}, 𝒟n(a)=PrwUnc[g(1n,w)=ag(1n,w)]\mathcal{D}_{n}(a)=\Pr_{w\sim U_{n^{c}}}[g(1^{n},w)=a\mid g(1^{n},w)\neq\,\diamond\,]. In other words, 𝒟n\mathcal{D}_{n} and g(1n,Unc)g(1^{n},U_{n^{c}}) are equally distributed conditioned on the output of gg being different from the error symbol “\diamond”.

Observe that the support of each 𝒟n\mathcal{D}_{n} is not required to be efficiently computable.

We define the computational problem of generating a canonical sample from 𝔇\mathfrak{D} in the natural way. In other words, given 1n1^{n}, the algorithm must produce a “canonical” string in the support of 𝒟n\mathcal{D}_{n}. Since every dense and easy property is polynomial time samplable, this setting provides a generalization of the explicit construction problem associated with such properties. (Observe that the difficulty of producing a canonical sample comes from the fact that the polynomial time function gg can fail with high probability. Of course, if gg never fails, it is enough to output, say, g(1n,0nc)g(1^{n},0^{n^{c}}).)

Theorem 10 (Pseudodeterministic Samplers in 𝚒.𝚘.\mathtt{i.o.}Subexponential Time).

Let 𝔇\mathfrak{D} be a polynomial time samplable ensemble. Then 𝔇\mathfrak{D} admits subexponential time randomized algorithms that output a canonical sample from 𝒟n\mathcal{D}_{n} for infinitely many values of nn.

(We stress that the pseudodeterministic sampler from Theorem 10 is not zero-error: it will output on every input nn where it succeeds a fixed sample in the support of 𝒟n\mathcal{D}_{n} with very high probability, but it might output a different sample in 𝒟n\mathcal{D}_{n} with negligible probability. On the input lengths where it fails, it will never output a sample.)

Proof.

The argument is a reduction to Theorem 8, or more precisely, to Corollary 2. First, we partition +\mathbb{N}^{+} into infinitely many sets Si=def{ic,,(i+1)c1}S_{i}\stackrel{{\scriptstyle\rm def}}{{=}}\{i^{c},\ldots,(i+1)^{c}-1\}, where cc is the positive integer provided by the definition of the polynomial time samplable ensemble 𝔇\mathfrak{D}, and i+i\in\mathbb{N}^{+}. Let g𝔇g_{\mathfrak{D}} be the polynomial time computable function associated with 𝔇\mathfrak{D}. For convenience, given a string x{0,1}mx\in\{0,1\}^{m} and an interval S[m]S\subseteq[m], we use xSx_{S} to denote the substring of xx with coordinates in SS. Next we define a property Q{0,1}Q\subseteq\{0,1\}^{*} via the following polynomial time algorithm AQA_{Q}. On an input x{0,1}mx\in\{0,1\}^{m}, let ii be the unique positive integer such that mSim\in S_{i}. AQA_{Q} computes αx=g(1i,x[1,ic])\alpha_{x}=g(1^{i},x_{[1,i^{c}]}), and accepts xx if and only if αx\alpha_{x}\neq\diamond.

We claim that QQ is dense and efficiently computable. First, observe that micm\geq i^{c}, since mSim\in S_{i}. Consequently, im1/ci\leq m^{1/c}, and since gg is polynomial time computable, so is AQA_{Q}. Similarly, using that gg has a non-\diamond output with inverse polynomial probability and that ii and mm are polynomially related, it follows that QQ is a dense property.

Using the claim from the previous paragraph and Corollary 2, it follows that for every ε>0\varepsilon>0, QQ admits a zero-error pseudodeterministic constructor BεB_{\varepsilon} running in zero-error time 2mε\leq 2^{m^{\varepsilon}} that succeeds on infinitely many values of mm. We argue next that each BεB_{\varepsilon} can be used to sample a canonical string from 𝒟n\mathcal{D}_{n} for infinitely many values of nn, where nn and mm are polynomially related.

Fix an arbitrary algorithm BεB_{\varepsilon} as above. Since BεB_{\varepsilon} is a zero-error algorithm, we can assume without loss of generality and increase of running time that on every input 1m1^{m} where it succeeds, its output is \perp with probability at most 2m2^{-m}. We define from BεB_{\varepsilon} a randomized algorithm AεA_{\varepsilon} that computes as follows. Given an input of the form 1n1^{n}, we run Bε(1m)B_{\varepsilon}(1^{m}) on every mSnm\in S_{n} using independent random strings of length 2mε\leq 2^{m^{\varepsilon}}. Let mm^{\prime} be the smallest element in SnS_{n} such that Bε(1m)B_{\varepsilon}(1^{m^{\prime}})\neq\,\perp among such executions, if it exists, and let zm{0,1}ncz_{m^{\prime}}\in\{0,1\}^{n^{c}} be the random variable denoting the first ncn^{c} bits of the output of BεB_{\varepsilon} for mm^{\prime}. We set the output of AεA_{\varepsilon} to g(1n,zm)g(1^{n},z_{m^{\prime}}) in this case, and to \perp if no such mm^{\prime} exists. This completes the construction of AεA_{\varepsilon} from BεB_{\varepsilon} and 𝔇\mathfrak{D}.

First, observe that AεA_{\varepsilon} is a randomized algorithm that runs in time 2O(ncε)\leq 2^{O(n^{c\varepsilon})}, since each mSnm\in S_{n} is of size O(nc)O(n^{c}), there are polynomially many simulations of BεB_{\varepsilon} on input 1n1^{n}, each running in time at most 2O(mε)2^{O(m^{\varepsilon})}, and gg is polynomial time computable. In order to argue the correctness of AεA_{\varepsilon}, recall that each BεB_{\varepsilon} succeeds on infinitely many values of mm, and that the sets SiS_{i} form a partition of +\mathbb{N}^{+} into infinitely many classes of finite size. Therefore, for infinitely many values of nn, there will be some mSnm\in S_{n} where BεB_{\varepsilon} succeeds. Furthermore, using that whenever BεB_{\varepsilon} succeeds it does so except with an exponentially small failure probability, we have that with very high probability m(n)m^{\prime}(n) will be the smallest such mm on each interval SnS_{n} where BεB_{\varepsilon} succeeds somewhere. Consequently, AεA_{\varepsilon} either fails with probability 11 on a bad interval SnS_{n} (where BεB_{\varepsilon} fails everywhere), or it outputs with high probability a fixed sample from 𝒟n\mathcal{D}_{n}. The last conclusion relies also on the definition of AεA_{\varepsilon} and on the fact that BεB_{\varepsilon} is a (infinitely often) zero-error pseudodeterministic constructor for QQ. (We observe that AεA_{\varepsilon} is not zero-error because BεB_{\varepsilon} may succeed on more than one input length in SnS_{n}, and it can happen with negligible probability that AεA_{\varepsilon} will use a different substring of length ncn^{c} during its computation.)

Finally, by taking ε>0\varepsilon>0 arbitrarily small and using that cc is constant, it follows that 𝔇\mathfrak{D} admits subexponential time randomized algorithms that output a canonical sample from 𝒟n\mathcal{D}_{n} for infinitely many values of nn. ∎

We describe here an immediate application of Theorem 10 that might be of independent interest in complexity theory, in certain situations where one has to select a hard function among a family of efficiently representable functions.

Suppose there is a polynomial time randomized algorithm that on input 1n1^{n} outputs some Boolean circuit with non-negligible probability, and fails otherwise (the algorithm is allowed to output different circuits among different executions). Let CnC_{n} be the random variable that denotes either “\diamond” or the polynomial size circuit output by this algorithm, and fCnf_{C_{n}} be the corresponding Boolean function whenever CnC_{n}\neq\diamond.

It follows from Theorem 10 that there is a subexponential time randomized algorithm that selects a canonical circuit DnD_{n} for infinitely many values of nn, and that outputs a circuit computing, say, the constant 0 function on the remaining values of nn. In particular, if every circuit EnE_{n} in the support of the original algorithm computes a Boolean function fEnf_{E_{n}} with a certain desired property, there is a fixed Boolean function h:{0,1}{0,1}h\colon\{0,1\}^{*}\to\{0,1\} in 𝖡𝖯𝖲𝖴𝖡𝖤𝖷𝖯\mathsf{BPSUBEXP} that has the same property infinitely often. (Observe though that if on every nn only most functions fCnf_{C_{n}} have some property, but not all of them, we cannot guarantee that hh will share this property on infinitely many input lengths.)

3.4 Unconditional Constructions that are Explicit

In this section, we show how to make our constructions for easy dense properties explicit, in the sense that the algorithm implementing the construction is an explicit algorithm. Consider for instance the problem of pseudodeterministically generating primes. Since Theorem 1 establishes that some algorithm runs in sub-exponential time and outputs a canonical prime infinitely often, a natural approach would be to employ a universal search procedure that runs all algorithms with short descriptions until a prime is produced. Unfortunately, this idea does not seem to work when the algorithms involved are randomized and we would like to maintain pseudodeterminism.

We will employ a different strategy which will actually give us a bit more. In addition to addressing the issue of explicitness, we also control the gaps between input lengths on which the construction succeeds. However, this comes at the cost of tailoring the construction to a specific easy dense property, and the proof becomes more intricate. For simplicity, we will focus on bounded-error pseudodeterministic constructions for 𝖯𝗋𝗂𝗆𝖾𝗌\mathsf{Primes}. This corresponds to a simpler version of Theorem 8, where we not consider the hitting set family 𝖾𝖺𝗌𝗒\mathcal{H}^{\mathsf{easy}} obtained using the easy witness method, and do a win-win analysis based on the hitting set family 𝗁𝖺𝗋𝖽\mathcal{H}^{\mathsf{hard}} rather than a win-win-win analysis. In this variant setting, we will consider bounded-error pseudodeterministic polynomial time constructions for 𝖯𝗋𝗂𝗆𝖾𝗌\mathsf{Primes}, rather than zero-error ones.

Recall that a fundamental issue with obtaining an explicit algorithm using the proof of Theorem 2 is that we do not know which of the worlds PSEUDO and SPARSE we live in (Section 1.4). There is an explicit algorithm corresponding to the world SPARSE, but we only obtain an explicit algorithm corresponding to the world PSEUDO if the algorithm for SPARSE fails on all large enough input lengths, and we do not know a priori if this is the case.

Imagine the following ideal situation: the win-win analysis we carry out works input length by input length. Namely, for each large enough input length nn, a given candidate hitting set HnH_{n} constructible in deterministic subexponential time works, or else a different candidate hitting set HnH^{\prime}_{n} constructible in pseudodeterministic subexponential time works. If we were in this ideal world, we would get an explicit construction for each large enough length as follows. We first test each element in HnH_{n} for primality, in some fixed order. If at least one of the tests succeed, we output the first element satisfying a test. If not, we generate HnH^{\prime}_{n} and again test the elements in some fixed order for primality. Now we are guaranteed to succeed by the assumption that the win-win analysis succeeds on each large enough input length, and as HnH^{\prime}_{n} is generated pseudodeterministically, we will output a fixed prime with high probability.

However, we are quite far from being in this ideal situation. Indeed, our argument that a pseudodeterministic algorithm succeeds relies on the hitting set family failing for all large enough input lengths, rather than on a single input length nn. This enables us to obtain the complexity collapse 𝖯𝖲𝖯𝖠𝖢𝖤=𝖡𝖯𝖯\mathsf{PSPACE}=\mathsf{BPP} and apply Lemma 1.

If we are to have any hope of controlling the set of input lengths on which the construction succeeds using such an argument, we need to mitigate this issue. Note that if we are only interested in a pseudodeterministic construction in subexponential time, the collapse 𝖯𝖲𝖯𝖠𝖢𝖤=𝖡𝖯𝖯\mathsf{PSPACE}=\mathsf{BPP} is overkill; it is enough to have 𝖯𝖲𝖯𝖠𝖢𝖤𝖡𝖯𝖲𝖴𝖡𝖤𝖷𝖯\mathsf{PSPACE}\subseteq\mathsf{BPSUBEXP}.

Consider the 𝖯𝖲𝖯𝖠𝖢𝖤\mathsf{PSPACE}-complete language LL^{\star} in the statement of Theorem 7. The first element of our new argument is a refined version of Theorem 7, which for any δ>0\delta>0, yields a probabilistic algorithm solving LL^{\star} correctly on inputs of length nn in time 2nδ2^{n^{\delta}} assuming that the hitting set family {H}\{H_{\ell}\} fails at all input lengths [n1/D,nD]\ell\in[n^{1/D},n^{D}], where DD is some constant depending on δ\delta. Thus we now only need the failure of the hitting set family on some polynomially bounded range of input lengths to obtain a complexity collapse consequence, albeit a milder one than before.

We also observe that this refined version can be used in an alternative argument for generating primes pseudodeterministically, by reducing the search version of 𝖯𝗋𝗂𝗆𝖾𝗌\mathsf{Primes} on input length nn to the 𝖯𝖲𝖯𝖠𝖢𝖤\mathsf{PSPACE}-complete language LL^{\star} on some polynomially larger input length nkn^{k}. Hence, if we knew that the probabilistic algorithm based on the failure of the hitting set family for a polynomially bounded range of input lengths solved LL^{\star} correctly at some fixed input length nkn^{k}, we would be able to construct primes pseudodeterministically at length nn in subexponential time.

However, we have no easy way of knowing this. The straightforward method would be to explicitly test the success of the hitting set family on the appropriate range of input lengths, but this could take more than exponential time.

Imagine instead the pseudodeterministic algorithm we wish to define being given a single advice bit per input length. If this advice bit is 0 at length nn, it indicates to the algorithm A(1n)A(1^{n}) that the hitting set family does indeed fail on all input lengths in [nk/D,nkD][n^{k/D},n^{kD}]; if the advice bit is 11, it indicates that the hitting set family succeeds somewhere on that range. The point is that the requisite information is just a single bit depending on the input length nn. The advice bit can be thought of as information for the algorithm about whether the world looks locally like PSEUDO or SPARSE, even if we do not know what the global picture is.

If the algorithm somehow had access to this advice bit, it could act as follows: if the advice bit were 0, it would know that the probabilistic algorithm given by the refined version of Theorem 7 solves LL^{\star} correctly at input length nkn^{k}, and by using the reduction from the search version of 𝖯𝗋𝗂𝗆𝖾𝗌\mathsf{Primes} to LL^{\star} and simulating the probabilistic algorithm when needed, it could pseudodeterministically output a prime in subexponential time. If the advice bit were 11, “all bets are off”, and the algorithm simply halts without an output.

For those readers familiar with the work on hierarchies for probabilistic polynomial time with advice [4, 10], the use of a advice bit here might be reminiscent of that work. The similarity is that the advice bit is a way around constructibility issues, but the details are different.

An advantage in our setting is that while the advice bit might be conceptually useful, it is not really needed. The reason is that while the algorithm might not have the time to check if the hitting set family fails on all input lengths in a polynomially large range around nn, it certainly can check if HnH_{n} is a hitting set for 𝖯𝗋𝗂𝗆𝖾𝗌n\mathsf{Primes}_{n} in deterministic subexponential time. If it is, the algorithm outputs the first prime in HnH_{n}, and we are done. If not, then the algorithm behaves as if the advice bit were 0. The algorithm with this behaviour will not always be correct, but it will always succeed on some input length in any polynomially large enough interval of input lengths. Moreover, the algorithm is explicit. We are exploiting here the fact that the world SPARSE is a deterministic world, and that we can check deterministically and not too inefficiently whether a given hitting set works at an input length.

We now give details, but first some extra notation.

Polynomial Gaps. We call a set SS\subseteq\mathbb{N} polynomially gapped if SS is non-empty and there is a constant k>1k>1 such that for any nSn\in S, there is mSm\in S, n<mnkn<m\leq n^{k}.

We require the following refinement of Theorem 7, which holds for the same language LL^{\star} discussed before.

Theorem 11.

For any integers b,c1b,c\geq 1, there exists an integer d1d\geq 1 and a function G:{0,1}{0,1}G^{\star}\colon\{0,1\}^{*}\to\{0,1\}^{*} with restrictions

G:{0,1}{0,1}m(),wherem()=b,G_{\ell}^{\star}\colon\{0,1\}^{\ell}\to\{0,1\}^{m(\ell)},\quad\text{where}\;\;\;m(\ell)=\ell^{b},

such that GG^{\star} can be computed in time O(m()d)=𝗉𝗈𝗅𝗒()O(m(\ell)^{d})=\mathsf{poly}(\ell) when given oracle access to LL^{\star}_{\leq\ell}, and the following holds. For every δ>0\delta>0, there is a δ>0\delta^{\prime}>0 and a probabilistic algorithm BδB_{\delta} such that for any large enough nn\in\mathbb{N} for which the output of GG^{\star}_{\ell} can be (1/m()c)(1/m(\ell)^{c})-distinguished from random for every [nδ,n3]\ell\in[n^{\delta^{\prime}},n^{3}] by an algorithm AA running in time O(m()c)O(m(\ell)^{c}), BδB_{\delta} when given access to 1n1^{n}, x{0,1}nx\in\{0,1\}^{\leq n} and to the description of AA, runs in time O(2nδ)O(2^{n^{\delta}}), and computes L(x)L^{\star}(x) with error at most 1/n21/n^{2} over its internal randomness.

Proof.

We give only a sketch, as the proof refines the proof of Theorem 7. The proof of Theorem 7 proceeds by showing that a distinguisher for the output of GG^{\star}_{\ell} can be used to learn circuits for LL^{\star} on input length n()n(\ell) polynomially related to \ell. By using the random self-reducibility and downward self-reducibility properties of LL^{\star} and hardness amplification, a distinguisher implies a polynomial-time probabilistic oracle algorithm that outputs circuits for Ln()L^{\star}_{n(\ell)}, where the oracle algorithm only makes LL^{*}-queries of length <n()<n(\ell). By using the distinguishing property for each length r[1,]r\in[1,\ell], circuits for LL^{\star} can be learned iteratively in probabilistic polynomial time for input lengths from 11 to n()n(\ell), and thus LL^{\star} can be decided in probabilistic polynomial time on any input of length n()n(\ell).

Suppose that we wish to compute LL^{\star} on inputs of length |x|n|x|\leq n. The main idea in our refinement here is to begin the iteration at input length nδn^{\delta^{\prime}}, where δ\delta^{\prime} is chosen depending on δ\delta, so that a circuit of size 2nδ2^{n^{\delta^{\prime}}} for LL^{\star} at length nδn^{\delta^{\prime}} can be computed in time 2nO(δ)2^{n^{O(\delta)}} using brute-force search and the fact that LL^{\star} is in polynomial space. Now we use the distinguishing property for each length r[nδ,n3]r\in[n^{\delta^{\prime}},n^{3}] to obtain learners for corresponding input lengths for LL, and thus iteratively build circuits for LL^{\star} for all input lengths up to nn. Then it is enough to run the circuit for length |x||x| to evaluate LL^{\star} on any input of that length. The total time taken is O(2nδ)O(2^{n^{\delta}}), if we choose δ\delta^{\prime} sufficiently small as a function of δ\delta. ∎

Theorem 12 (Restatement of Theorem 3).

For every ε>0\varepsilon>0, there is a polynomially gapped set SS and a (bounded-error) pseudodeterministic construction for 𝖯𝗋𝗂𝗆𝖾𝗌\mathsf{Primes} on SS, running in time O(2nε)O(2^{n^{\varepsilon}}).

Proof.

Let ε>0\varepsilon>0 be any constant. We show that there is a polynomially gapped set SS and a pseudodeterministic algorithm AεA_{\varepsilon} on SS such that for each nSn\in S, the canonical output of Aε(1n)A_{\varepsilon}(1^{n}) is an nn-bit prime, and moreover AεA_{\varepsilon} always halts in time O(2nε)O(2^{n^{\varepsilon}}).

Define the language 𝖫𝖾𝗑𝖥𝗂𝗋𝗌𝗍𝖯𝗋𝗂𝗆𝖾\mathsf{LexFirstPrime} to consist of all tuples <1n,i><1^{n},i> such that the ii’th bit of the lexicographical first nn-bit prime is 11, where n2n\geq 2. By Bertrand’s Postulate, 𝖫𝖾𝗑𝖥𝗂𝗋𝗌𝗍𝖯𝗋𝗂𝗆𝖾\mathsf{LexFirstPrime} is well-defined. It is easy to see that this language is decidable in polynomial space, as follows. Enumerate the nn-bit integers in order and check each one for primality until an integer pnp_{n} is found that passes the primality test. Accept on input <1n,i><1^{n},i> iff the ii’th bit of pnp_{n} is 11. Since 𝖫𝖾𝗑𝖥𝗂𝗋𝗌𝗍𝖯𝗋𝗂𝗆𝖾\mathsf{LexFirstPrime} is in 𝖯𝖲𝖯𝖠𝖢𝖤\mathsf{PSPACE} and LL^{\star} is 𝖯𝖲𝖯𝖠𝖢𝖤\mathsf{PSPACE}-complete, there is a constant k1k\geq 1 such that 𝖫𝖾𝗑𝖥𝗂𝗋𝗌𝗍𝖯𝗋𝗂𝗆𝖾\mathsf{LexFirstPrime} reduces to LL^{\star} in deterministic time nkn^{k}.

Let C>0C>0 be an integer to be determined later. We partition \mathbb{N} into intervals IiI_{i}, where Ii=(2Ci1,2Ci]I_{i}=(2^{C^{i-1}},2^{C^{i}}] for i1i\geq 1, and I0=[1,2]I_{0}=[1,2]. We define the algorithm AεA_{\varepsilon} and show that it satisfies the required properties for at least one input length in each IiI_{i}, when ii is large enough. The algorithm operates in two phases, the first of which is deterministic and the second probabilistic.

Let a>0a>0 be a constant such that LL^{\star} is computable in deterministic time 2a2^{\ell^{a}} on inputs of length \ell, and let c>1c>1 be a constant such that the Primality algorithm of [2] runs in deterministic time ncn^{c}. AεA_{\varepsilon} operates as follows on input 1n1^{n}. It first invokes the generator GG^{\star} from Theorem 11 using parameters b=2a/εb=\lceil 2a/\varepsilon\rceil and cc as chosen above, on input length =nε/2a\ell=\lceil n^{\varepsilon/2a}\rceil. It computes Hn={𝗅𝖾𝖿𝗍n(u)uG({0,1})}H_{n}=\{\mathsf{left}_{n}(u)\mid u\in G^{\star}(\{0,1\}^{\ell})\} in time O(2nε)O(2^{n^{\varepsilon}}), exploiting the efficiency guarantee for GG^{\star} from Theorem 11 and the fact that LL^{\star} is computable in deterministic time 2a2^{\ell^{a}}. It checks each element of HnH_{n} in lexicographic order for primality, outputting the first nn-bit prime in HnH_{n} that it finds, if such a prime exists. Given HnH_{n}, the total time required for this testing is O(2𝗉𝗈𝗅𝗒(n))O(2^{\ell}\cdot\mathsf{poly}(n)), which is O(2nε)O(2^{n^{\varepsilon}}).

If no element of HnH_{n} is prime, AεA_{\varepsilon} commences its probabilistic phase. It sets δ=ε/k\delta=\varepsilon/k in the second part of Theorem 11; let δ<δ\delta^{\prime}<\delta be the corresponding constant given by the theorem. AεA_{\varepsilon} attempts to compute an nn-bit prime in probabilistic time O(2nε)O(2^{n^{\varepsilon}}) as follows. It tries to determine for each ii satisfying 1in1\leq i\leq n, whether <1n,i>𝖫𝖾𝗑𝖥𝗂𝗋𝗌𝗍𝖯𝗋𝗂𝗆𝖾<1^{n},i>\;\in\mathsf{LexFirstPrime} by using the reduction from 𝖫𝖾𝗑𝖥𝗂𝗋𝗌𝗍𝖯𝗋𝗂𝗆𝖾\mathsf{LexFirstPrime} to LL^{\star}, which produces instances of length nk\leq n^{k}. It answers each query xx to LL^{\star} by assuming that 𝖯𝗋𝗂𝗆𝖾𝗌\mathsf{Primes} 1/bc1/\ell^{bc}-distinguishes GG^{\star}_{\ell} from random for each [nkδ,n3k]\ell\in[n^{k\delta^{\prime}},n^{3k}], where bb is as defined in the previous para, and running the corresponding algorithm BδB_{\delta} on 1nk1^{n^{k}}, xx, and the code of the AKS primality algorithm. By Theorem 11, if 𝖯𝗋𝗂𝗆𝖾𝗌\mathsf{Primes} does indeed distinguish the output of the generator from random for the given range of input lengths, the algorithm BδB_{\delta} decides L(x)L^{\star}(x) correctly with error at most 1/n2k1/n^{2k}, since x{0,1}nkx\in\{0,1\}^{\leq n^{k}}. Hence, in this case, by a simple union bound, all nn queries of AεA_{\varepsilon} to BδB_{\delta} are answered correctly with probability at least 11/n1-1/n, using the fact that k1k\geq 1, and hence AεA_{\varepsilon} correctly determines all the bits of the lexicographically first nn-bit prime pnp_{n} with error at most 1/n1/n. Thus, in this case, a fixed prime pnp_{n} is output with probability at least 11/n1-1/n, which fulfils the bounded-error pseudodeterministic guarantee for AεA_{\varepsilon}. Using that δ=ε/k\delta=\varepsilon/k and the bound on the running time of BδB_{\delta} given by Theorem 11, it follows that AεA_{\varepsilon} halts in time O(2nε)O(2^{n^{\varepsilon}}).

We argue that for each interval IiI_{i} of input lengths for ii large enough, there is niIin_{i}\in I_{i} such that either one of the elements of HniH_{n_{i}} is prime, or AεA_{\varepsilon} outputs a fixed prime with high probability using the reduction to LL^{\star} as in the previous para. Note that in the first case, the deterministic phase of the algorithm has an output and the algorithm does not enter its probabilistic phase, while in the second case, the probabilistic phase has a fixed output with high probability. In either case, AεA_{\varepsilon} operates pseudodeterministically on input 1ni1^{n_{i}} and outputs a prime.

We set CC to be 3k/δ\lceil 3k/\delta^{\prime}\rceil, where kk and δ\delta^{\prime} are as above. If there is no nin_{i} in IiI_{i} such that at least one of the elements of HniH_{n_{i}} is prime, and if ii is large enough, then it is indeed the case that 𝖯𝗋𝗂𝗆𝖾𝗌\mathsf{Primes} 1/bc1/\ell^{bc}-distinguishes GG^{\star}_{\ell} from random for each [nikδ,ni3k]\ell\in[n_{i}^{k\delta^{\prime}},n_{i}^{3k}], where ni=2Ci/3kn_{i}=2^{C^{i}/3k}, just using the fact that 𝖯𝗋𝗂𝗆𝖾𝗌\mathsf{Primes} is 1/nc1/n^{c}-dense for large enough nn. Hence, in this case, AεA_{\varepsilon} does output the lexicographically first prime on nin_{i} bits with probability 1o(1)1-o(1), which concludes the argument. ∎

To compare Theorem 12 to Corollary 3, the advantages of the former are that the algorithm is explicit, and that the input lengths for which it is guaranteed to produce primes are not too far apart. However, a somewhat subtle advantage of Corollary 2 is that the construction is guaranteed never to output two different primes on any input length – it either outputs a fixed prime with high probability, or does not output a prime at all. With the construction of Theorem 12, this might not be the case. The algorithm has the bounded-error pseudodeterministic guarantee on at least one input length in each large enough interval, but there is no guarantee on the behaviour of the algorithm for other input lengths in the interval. This situation can be improved using Proposition 2.

Finally, we remark that one of the difficulties involved in proving a zero-error version of Theorem 12 is that it seems one would need to convert a sub-exponential time bounded-error randomized computation into a zero-error computation, as opposed to the relevant simulation behind the proofs of Theorem 8 and Corollary 3, which is concerned with polynomial-time computations.

4 Pseudodeterminism and Derandomization

In order to state the results of this section we will need a few additional definitions. Here we work with ensembles 𝔇={𝒟n}\mathfrak{D}=\{\mathcal{D}_{n}\} of distributions, where we assume that each 𝒟n\mathcal{D}_{n} is supported over {0,1}n\{0,1\}^{n}. Moreover, we say that such a sequence of distributions is polynomial-time samplable if there is a randomized polynomial-time algorithm BB (the sampler) such that for each nn\in\mathbb{N} and each y{0,1}ny\in\{0,1\}^{n}, Pr[B(1n)=y]=𝒟n(y)\Pr[B(1^{n})=y]=\mathcal{D}_{n}(y), where 𝒟n(y)=defPr[y𝒟n]\mathcal{D}_{n}(y)\stackrel{{\scriptstyle\rm def}}{{=}}\Pr[y\in\mathcal{D}_{n}]. As usual, we use UnU_{n} to refer to the uniform distribution on nn-bit strings, which is clearly polynomial-time samplable. In some cases we view elements of {0,1}n\{0,1\}^{n} as descriptions of Boolean circuits of size at most nn, under some natural encoding. We may informally refer to 𝔇\mathfrak{D} as a distribution instead of as an ensemble of distributions.

We define various notions of derandomization on average over polynomial-time samplable distributions 𝔇\mathfrak{D}. Our setting closely mirrors that of Impagliazzo-Wigderson [20], and our proofs are inspired by their ideas.

Average-Case Definitions. Let :\ell\colon\mathbb{N}\rightarrow\mathbb{N} be a function. We say that a sequence 𝔊={Gn}\mathfrak{G}=\{G_{n}\}, where each Gn:{0,1}(n){0,1}nG_{n}\colon\{0,1\}^{\ell(n)}\rightarrow\{0,1\}^{n}, is a PRG (resp. i.o.PRG) on average over a distribution 𝔇\mathfrak{D} of Boolean circuits if for each c>0c>0 and for large enough nn (resp. for infinitely many nn), GnG_{n} (1/10)(1/10)-fools CnC_{n} with probability at least 11/nc1-1/n^{c} over Cn𝒟nC_{n}\sim\mathcal{D}_{n}. We call (n)\ell(n) the seed length of the PRG.

Let T:T\colon\mathbb{N}\rightarrow\mathbb{N} be a time bound. We say that the Circuit Acceptance Probability Problem (𝖢𝖠𝖯𝖯\mathsf{CAPP}) is solvable in time TT (resp. solvable infinitely often in time TT) on average over 𝔇\mathfrak{D} if for all c>0c>0 there is a deterministic algorithm AA running in time T(n)T(n) such that for all nn\in\mathbb{N} (resp. for infinitely many nn), PrCn𝒟n[|A(Cn)PrxUn[Cn(x)=1]|<1/10]11/nc\Pr_{C_{n}\sim\mathcal{D}_{n}}[|A(C_{n})-\Pr_{x\sim U_{n}}[C_{n}(x)=1]|<1/10]\geq 1-1/n^{c}.

Let L{0,1}L\subseteq\{0,1\}^{*} a language. We say that LL is solvable in time TT (resp. solvable infinitely often in time TT) on average over 𝔇\mathfrak{D} if for all c>0c>0 there is a deterministic algorithm running in time T(n)T(n) which for all nn (resp. infinitely many nn) solves LnL_{n} with success probability at least 11/nc1-1/n^{c} over DnD_{n}. Given a function a:a\colon\mathbb{N}\rightarrow\mathbb{N}, we also use the notion of being solvable in time TT with a(n)a(n) bits of advice on average over 𝔇\mathfrak{D} – here the algorithm solving LL gets access to an auxiliary advice string of length a(n)a(n) which depends only on the input length.

We say that 𝖢𝖠𝖯𝖯\mathsf{CAPP} is solvable pseudodeterministically in time TT (resp. solvable infinitely often pseudodeterministically in time TT) on average over 𝔇\mathfrak{D} if for all c>0c>0 there is a randomized algorithm AA running in time T(n)T(n) such that for all nn (resp. infinitely many nn), with probability at least 11/nc1-1/n^{c} over CnDnC_{n}\sim D_{n}, A(Cn)A(C_{n}) outputs the same number f(Cn)f(C_{n}) with probability 1o(1)1-o(1) over its internal randomness, and f(Cn)f(C_{n}) is a (1/10)(1/10)-additive approximation to the acceptance probability of CnC_{n}.

The lemma below is implicit in [30], which itself uses a variation of the argument in [20]. We omit the proof because it is almost identical to the proof of Theorem 7.

Lemma 4.

[20, 30] For each ε>0\varepsilon>0 there is a sequence 𝔊={Gn}\mathfrak{G}=\{G_{n}\}, where Gn:{0,1}nε{0,1}nG_{n}\colon\{0,1\}^{n^{\varepsilon}}\rightarrow\{0,1\}^{n} and 𝔊\mathfrak{G} is computable in time 2O(nε)2^{O(n^{\varepsilon})}, such that if there is a polynomial-time samplable distribution 𝔇={𝒟n}\mathfrak{D}=\{\mathcal{D}_{n}\} of Boolean circuits and a constant c>0c>0 for which for all large enough nn, with probability 1/nc\geq 1/n^{c} over Cn𝒟nC_{n}\sim\mathcal{D}_{n}, CnC_{n} is a (1/10)(1/10)-distinguisher for GnG_{n}, then 𝖯𝖲𝖯𝖠𝖢𝖤=𝖡𝖯𝖯\mathsf{PSPACE}=\mathsf{BPP}.

We prove the following unconditional result on the (randomized) pseudodeterministic complexity of 𝖢𝖠𝖯𝖯\mathsf{CAPP}.

Theorem 13 (Restatement of Theorem 4).

For each ε>0\varepsilon>0 and polynomial-time samplable distribution 𝔇\mathfrak{D}, 𝖢𝖠𝖯𝖯\mathsf{CAPP} is solvable infinitely often pseudodeterministically in time 2O(nε)2^{O(n^{\varepsilon})} on average over 𝔇\mathfrak{D}.

Proof.

Let 𝔇\mathfrak{D} be any polynomial-time samplable distribution and ε>0\varepsilon>0 be any constant. We show that at least one of the following holds: (1) 𝖢𝖠𝖯𝖯\mathsf{CAPP} is solvable pseudodeterministically in time poly(n)\operatorname{poly}(n) in the worst case, or (2) 𝖢𝖠𝖯𝖯\mathsf{CAPP} is solvable infinitely often deterministically in time 2O(nε)2^{O(n^{\varepsilon})} on average over 𝔇\mathfrak{D}.

Let 𝔊={Gn}\mathfrak{G}=\{G_{n}\} be the sequence of generators given by Lemma 4, and consider the algorithm AA that works as follows given a input circuit CC represented by a string of length nn. AA counts the fraction of outputs of GnG_{n} accepted by CC, and outputs this fraction. If GnG_{n} is an i.o.PRG on average over 𝔇\mathfrak{D}, the algorithm AA solves 𝖢𝖠𝖯𝖯\mathsf{CAPP} infinitely often on average over 𝔇\mathfrak{D}, since AA does not output a 1/101/10-approximation for CC if and only if CC (1/10)(1/10)-distinguishes the output of GnG_{n} from a random nn-bit string. The algorithm AA can be implemented in time 2O(nε)2^{O(n^{\varepsilon})} using the fact that GnG_{n} is computable in time 2O(nε)2^{O(n^{\varepsilon})}. Thus item (2) holds in this case.

If 𝔊\mathfrak{G} is not an i.o.PRG on average over 𝔇\mathfrak{D}, then we can apply Lemma 4 to get 𝖯𝖲𝖯𝖠𝖢𝖤=𝖡𝖯𝖯\mathsf{PSPACE}=\mathsf{BPP}. In this case, by a simple translation argument, we have that 𝖤𝖲𝖯𝖠𝖢𝖤=𝖡𝖯𝖤\mathsf{ESPACE}=\mathsf{BPE}, and since 𝖤𝖲𝖯𝖠𝖢𝖤\mathsf{ESPACE} requires circuits of size 2m/2\geq 2^{m/2} on all large enough mm by direct diagonalization, we have that 𝖡𝖯𝖤\mathsf{BPE} requires circuits of size 2Ω(m)2^{\Omega(m)} on all large enough mm. Now by Lemma 1 and Remark 1, we have a pseudodeterministic polynomial time algorithm which outputs a discrepancy set family which works for any circuit CC of size nn for large enough nn, and hence again by outputting the fraction of elements in the discrepancy set which belong to CC, we get a worst-case pseudodeterministic polynomial time algorithm solving 𝖢𝖠𝖯𝖯\mathsf{CAPP}. ∎

Finally, we establish the following equivalences. Note that all algorithms mentioned below are deterministic.

Theorem 14 (Restatement of Theorem 5).

The following statements are equivalent:

  1. 1.

    For each polynomial-time samplable distribution 𝔇\mathfrak{D} of Boolean circuits and each ε>0\varepsilon>0, there is an i.o.PRG 𝔊\mathfrak{G} on average over 𝔇\mathfrak{D} with seed length nεn^{\varepsilon} that is computable in time 2O(nε)2^{O(n^{\varepsilon})}.

  2. 2.

    For each polynomial-time samplable distribution 𝔇\mathfrak{D} over Boolean circuits and each ε>0\varepsilon>0, 𝖢𝖠𝖯𝖯\mathsf{CAPP} is solvable infinitely often in time 2O(nε)2^{O(n^{\varepsilon})} on average over 𝔇\mathfrak{D}.

  3. 3.

    For each polynomial-time samplable distribution 𝔇\mathfrak{D} over input strings and each ε>0\varepsilon>0, 𝖡𝖯𝖯\mathsf{BPP} is solvable infinitely often in time 2O(nε)2^{O(n^{\varepsilon})} with O(log(n))O(\log(n)) bits of advice on average over 𝔇\mathfrak{D}.

  4. 4.

    For each ε>0\varepsilon>0, 𝖡𝖯𝖯\mathsf{BPP} is solvable infinitely often in time 2O(nε)2^{O(n^{\varepsilon})} on average over UnU_{n}.

Proof.

The equivalence is established by the following chain of implications.

(1)(2)(1)\Rightarrow(2): Fix a distribution 𝔇\mathfrak{D}, and let 𝔊\mathfrak{G} be some PRG for 𝔇\mathfrak{D} that is guaranteed to exist by item (1). The algorithm for 𝖢𝖠𝖯𝖯\mathsf{CAPP} on a circuit CnC_{n} of size nn simply runs GnG_{n} on all seeds of size nεn^{\varepsilon} and counts the fraction of seeds for which CnC_{n} accepts. It outputs this fraction. Clearly, the algorithm can be implemented in time 2O(nε)2^{O(n^{\varepsilon})}, as GnG_{n} is computable in that amount of time. The correctness of the algorithm follows immediately from the guarantee on the PRG 𝔊\mathfrak{G} given by (1).

(2)(3)(2)\Rightarrow(3): Fix a distribution 𝔇\mathfrak{D}, let L𝖡𝖯𝖳𝖨𝖬𝖤(nk)L\in\mathsf{BPTIME}(n^{k}), where k1k\geq 1 is a fixed constant, and let MM be a bounded-error probabilistic Turing machine solving LL in time nkn^{k} with error 1/3\leq 1/3 for nn large enough. To solve LL infinitely often in time 2O(nε)2^{O(n^{\varepsilon})} on average over 𝔇\mathfrak{D}, we invoke the algorithm A=A𝔇,εA=A_{\mathfrak{D}^{\prime},\varepsilon^{\prime}} given by item (2) for the distribution 𝔇\mathfrak{D^{\prime}} specified below, and parameter ε=ε/2k\varepsilon^{\prime}=\varepsilon/2k.

To sample from the distribution 𝔇\mathfrak{D^{\prime}} on nn^{\prime}-bit strings, we first determine n=(n)1/2kn=\lfloor(n^{\prime})^{1/2k}\rfloor. We sample an input xx of length nn from 𝒟n\mathcal{D}_{n}, then compute the randomized circuit Cn2kxC^{x}_{n^{2k}} obtained by applying the standard translation of randomized algorithms to circuits to the computation of MM on xx. We then pad Cn2kxC^{x}_{n^{2k}} in a standard way to an equivalent circuit CnxC^{x}_{n^{\prime}} of size nn^{\prime}. CnxC^{x}_{n^{\prime}} has input of length nn, but we can simply pad the input length to nn^{\prime} using dummy input bits. Clearly 𝔇\mathfrak{D^{\prime}} is polynomial-time samplable, and hence there is an algorithm AA as above solving 𝖢𝖠𝖯𝖯\mathsf{CAPP} infinitely often on average over 𝔇\mathfrak{D^{\prime}} in time 2O((n)ε)2^{O((n^{\prime})^{\varepsilon^{\prime}})}, which is at most 2O(nε)2^{O(n^{\varepsilon})}.

We show how to solve LL infinitely often in time 2O(nε)2^{O(n^{\varepsilon})} with O(log(n))O(\log(n)) bits of advice on average over 𝔇\mathfrak{D}. We define a deterministic machine NN taking O(log(n))O(\log(n)) bits of advice as follows. On input xx of length nn, NN uses its advice to determine a length nn^{\prime} such that n2kn<(n+1)2kn^{2k}\leq n^{\prime}<(n+1)^{2k}. NN finds a randomized circuit Cn2kxC^{x}_{n^{2k}} corresponding to the computation of MM on xx by performing the standard translation, and then pads this circuit in the standard way to a circuit CnxC^{x}_{n^{\prime}} on nn^{\prime} input bits. It applies the algorithm AA to CnxC^{x}_{n^{\prime}}, accepting if and only if AA outputs a number greater than 1/21/2.

We are given that AA solves 𝖢𝖠𝖯𝖯\mathsf{CAPP} infinitely often in subexponential time on average over 𝔇\mathfrak{D^{\prime}}, and we would like to conclude that NN solves LL infinitely often in subexponential time on average over 𝔇\mathfrak{D}. Indeed, let {ni}\{n_{i}\} be an infinite sequence of input lengths on which AA solves 𝖢𝖠𝖯𝖯\mathsf{CAPP} in subexponential time on average over 𝔇\mathfrak{D^{\prime}}. It is not hard to see that {(ni)1/2k}\{\lfloor(n_{i})^{1/2k}\rfloor\} is an infinite sequence of input lengths on which NN solves LL in subexponential time with logarithmic advice on average over 𝔇\mathfrak{D}.

(3)(4)(3)\Rightarrow(4): It follows immediately from item (3) that for each ε>0\varepsilon>0, 𝖡𝖯𝖯\mathsf{BPP} is solvable infinitely often in time 2O(nε)2^{O(n^{\varepsilon})} with O(log(n))O(\log(n)) advice on average over UnU_{n}, simply because UnU_{n} is polynomial-time samplable. Corollary 7 and Corollary 9 of [20] then imply that for each ε>0\varepsilon>0, 𝖡𝖯𝖯\mathsf{BPP} is solvable infinitely often in time 2O(nε)2^{O(n^{\varepsilon})} on average over UnU_{n}.

(4)(1)(4)\Rightarrow(1): Here we use Lemma 4. By diagonalization (cf. Theorem 6 in [20]), we have that (4) implies 𝖤𝖷𝖯𝖡𝖯𝖯\mathsf{EXP}\neq\mathsf{BPP}. Now there are two cases: either 𝖤𝖷𝖯\mathsf{EXP} does not have polynomial-size circuits, or 𝖯𝖲𝖯𝖠𝖢𝖤𝖡𝖯𝖯\mathsf{PSPACE}\neq\mathsf{BPP}. Indeed, if both were false, we would have that 𝖤𝖷𝖯=𝖯𝖲𝖯𝖠𝖢𝖤\mathsf{EXP}=\mathsf{PSPACE} (by the Karp-Lipton theorem for 𝖤𝖷𝖯\mathsf{EXP}) and that 𝖯𝖲𝖯𝖠𝖢𝖤=𝖡𝖯𝖯\mathsf{PSPACE}=\mathsf{BPP}, which would together imply 𝖤𝖷𝖯=𝖡𝖯𝖯\mathsf{EXP}=\mathsf{BPP}, contradicting our assumption.

In the first case, by the hardness-randomness tradeoff of [5], it follows that for each ε>0\varepsilon>0 there is an i.o.PRG with seed length nεn^{\varepsilon}, which is computable in time 2O(nε)2^{O(n^{\varepsilon})}. Note that this i.o.PRG works even in the worst case, without a distributional assumption on circuits it fools. In the second case, we use Lemma 4 to conclude that for each polynomial-time samplable sequence 𝔇\mathfrak{D} of distributions and for each ε>0\varepsilon>0, there is an i.o.PRG with seed length nεn^{\varepsilon} on average against 𝔇\mathfrak{D}, computable in time 2O(nε)2^{O(n^{\varepsilon})}. Hence in either case (1) follows, concluding our proof. ∎

5 Further Directions

We propose some directions for further research:

  1. 1.

    Theorem 1 is proved using general complexity-theoretic considerations, using no information about the set 𝖯𝗋𝗂𝗆𝖾𝗌\mathsf{Primes} apart from its polynomial density and its decidability by a polynomial-time algorithm. The primes have been intensively studied, and a lot is known about their structure. Can this structural information be leveraged to prove stronger results about generating primes? Perhaps the technique of using complexity-theoretic pseudorandomness applied here could be combined with earlier ideas for generating primes deterministically to show stronger results.

  2. 2.

    Can other kinds of probabilistic algorithms be made pseudodeterministic? In very recent work, we use our ideas to give such algorithms unconditionally for various approximate counting problems.

  3. 3.

    Are black-box derandomization, white-box derandomization and 𝖡𝖯𝖯=𝖯\mathsf{BPP}=\mathsf{P} equivalent in the standard setting? Here, by the standard setting, we mean that we are interested in worst-case polynomial-time simulations that work for all large enough input lengths. As a first step toward this goal, it would be interesting to get the equivalence for average-case simulations, where we are even prepared to relax the “works almost everywhere” condition on the simulation to “works infinitely often”.

6 Acknowledgements

We acknowledge useful discussions with Scott Aaronson, Valentine Kabanets, Jan Krajíček, James Maynard, Toni Pitassi and Amnon Ta-Shma. Part of this work was done while the first author was visiting the second, funded by the second author’s ERC Consolidator Grant no. 615075.

References

  • AB [09] Sanjeev Arora and Boaz Barak. Complexity Theory: A Modern Approach. Cambridge University Press, 2009.
  • AKS [02] Manindra Agrawal, Neeraj Kayal, and Nitin Saxena. PRIMES is in P. Ann. of Math., 2:781–793, 2002.
  • ASS [01] Eric Allender, Michael E. Saks, and Igor E. Shparlinski. A lower bound for primality. J. Comput. Syst. Sci., 62(2):356–366, 2001.
  • Bar [02] Boaz Barak. A probabilistic-time hierarchy theorem for ”slightly non-uniform” algorithms. In 6th International Workshop on Randomization and Approximation Techniques, pages 194–208, 2002.
  • BFNW [93] László Babai, Lance Fortnow, Noam Nisan, and Avi Wigderson. BPP has subexponential time simulations unless EXPTIME has publishable proofs. Computational Complexity, 3:307–318, 1993.
  • BHP [01] Roger Baker, Glyn Harman, and Janos Pintz. The difference between conseuctive primes, II. Proceedings of the London Mathematical Society, 83(3):532–562, 2001.
  • Coh [16] Gil Cohen. Two-source dispersers for polylogarithmic entropy and improved Ramsey graphs. In Symposium on Theory of Computing (STOC), pages 278–284, 2016.
  • CZ [16] Eshan Chattopadhyay and David Zuckerman. Explicit two-source extractors and resilient functions. In Symposium on Theory of Computing (STOC), pages 670–683, 2016.
  • For [01] Lance Fortnow. Comparing notions of full derandomization. In Conference on Computational Complexity (CCC), pages 28–34, 2001.
  • FS [05] Lance Fortnow and Rahul Santhanam. Hierarchy theorems for probabilistic polynomial time. In Proceedings of 45th Symposium on Foundations of Computer Science, pages 316–324, 2005.
  • GG [11] Eran Gat and Shafi Goldwasser. Probabilistic search algorithms with unique answers and their cryptographic applications. Electronic Colloquium on Computational Complexity (ECCC), 18:136, 2011.
  • GG [15] Shafi Goldwasser and Ofer Grossman. Perfect bipartite matching in pseudo-deterministic RNC. Electronic Colloquium on Computational Complexity (ECCC), 22:208, 2015.
  • GGR [13] Oded Goldreich, Shafi Goldwasser, and Dana Ron. On the possibilities and limitations of pseudodeterministic algorithms. In Innovations in Theoretical Computer Science (ITCS), pages 127–138, 2013.
  • Gol [08] Oded Goldreich. Computational Complexity - A Conceptual Perspective. Cambridge University Press, 2008.
  • Gol [11] Oded Goldreich. In a world of P = BPP. In Studies in Complexity and Cryptography, pages 191–232. 2011.
  • Gro [15] Ofer Grossman. Finding primitive roots pseudo-deterministically. Electronic Colloquium on Computational Complexity (ECCC), 22:207, 2015.
  • IKW [02] Russell Impagliazzo, Valentine Kabanets, and Avi Wigderson. In search of an easy witness: exponential time vs. probabilistic polynomial time. J. Comput. Syst. Sci., 65(4):672–694, 2002.
  • Imp [95] Russell Impagliazzo. A personal view of average-case complexity. In Structure in Complexity Theory Conference (CCC), pages 134–147, 1995.
  • IW [97] Russell Impagliazzo and Avi Wigderson. P = BPP if E requires exponential circuits: Derandomizing the XOR lemma. In Symposium on Theory of Computing (STOC), pages 220–229, 1997.
  • IW [01] Russell Impagliazzo and Avi Wigderson. Randomness vs time: Derandomization under a uniform assumption. J. Comput. Syst. Sci., 63(4):672–688, 2001.
  • Juk [12] Stasys Jukna. Boolean Function Complexity - Advances and Frontiers. Springer, 2012.
  • Kab [01] Valentine Kabanets. Easiness assumptions and hardness tests: Trading time for zero error. J. Comput. Syst. Sci., 63(2):236–252, 2001.
  • KL [80] Richard M. Karp and Richard J. Lipton. Some connections between nonuniform and uniform complexity classes. In Symposium on Theory of Computing (STOC), pages 302–309, 1980.
  • LO [87] J. C. Lagarias and Andrew M. Odlyzko. Computing pi(x): An analytic method. J. Algorithms, 8(2):173–191, 1987.
  • OS [16] Igor C. Oliveira and Rahul Santhanam. Conspiracies between learning algorithms, circuit lower bounds and pseudorandomness. Available on arXiv:cs.CC/1611.01190, 2016.
  • San [12] Rahul Santhanam. The complexity of explicit constructions. Theory Comput. Syst., 51(3):297–312, 2012.
  • Sho [90] Victor Shoup. New algorithms for finding irreducible polynomials over finite fields. Mathematics of Computation, 54(189):435–447, 1990.
  • TCH [12] Terence Tao, Ernest Croot, III, and Harald Helfgott. Deterministic methods to find primes. Math. Comp., 81(278):1233–1246, 2012.
  • Tre [06] Luca Trevisan. Pseudorandomness and combinatorial constructions. In International Congress of Mathematicians. Vol. III, pages 1111–1136. Eur. Math. Soc., Zürich, 2006.
  • TV [07] Luca Trevisan and Salil P. Vadhan. Pseudorandomness and average-case complexity via uniform reductions. Computational Complexity, 16(4):331–364, 2007.
  • Vad [12] Salil P. Vadhan. Pseudorandomness. Foundations and Trends in Theoretical Computer Science, 7(1–3):1–336, 2012.