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

Nearly-Linear Time Seeded Extractors with Short Seeds

Dean Doron Ben-Gurion University. [email protected]. Part of this work was done while visiting Instituto de Telecomunicações and the Simons Institute for the Theory of Computing.    João Ribeiro Instituto de Telecomunicações and Departamento de Matemática, Instituto Superior Técnico, Universidade de Lisboa. [email protected]. Part of this work was done while at NOVA LINCS and NOVA School of Science and Technology, and while visiting the Simons Institute for the Theory of Computing.
Abstract

Seeded extractors are fundamental objects in pseudorandomness and cryptography, and a deep line of work has designed polynomial-time seeded extractors with nearly-optimal parameters. However, existing constructions of seeded extractors with short seed length and large output length run in time Ω(nlog(1/ε))\Omega(n\log(1/\varepsilon)) and often slower, where nn is the input source length and ε\varepsilon is the error of the extractor. Since cryptographic applications of extractors require ε\varepsilon to be small, the resulting runtime makes these extractors unusable in practice.

Motivated by this, we explore constructions of strong seeded extractors with short seeds computable in nearly-linear time O(nlogcn)O(n\log^{c}n), for any error ε\varepsilon. We show that an appropriate combination of modern condensers and classical approaches for constructing seeded extractors for high min-entropy sources yields strong extractors for nn-bit sources with any min-entropy kk and any target error ε\varepsilon with seed length d=O(log(n/ε))d=O(\log(n/\varepsilon)) and output length m=(1η)km=(1-\eta)k for an arbitrarily small constant η>0\eta>0, running in nearly-linear time, after a reasonable one-time preprocessing step (finding a primitive element of 𝔽q\mathds{F}_{q} with q=poly(n/ε)q=\operatorname{poly}(n/\varepsilon) a power of 22) that is only required when k<2Clognlog2(n/ε)k<2^{C\log^{*}\!n}\cdot\log^{2}(n/\varepsilon), for a constant C>0C>0 and log\log^{*}\! the iterated logarithm, and which can be implemented in time polylog(n/ε)\operatorname{polylog}(n/\varepsilon) under mild conditions on qq. As a second contribution, we give an instantiation of Trevisan’s extractor that can be evaluated in truly linear time in the RAM model, as long as the number of output bits is at most nlog(1/ε)polylog(n)\frac{n}{\log(1/\varepsilon)\operatorname{polylog}(n)}. Previous fast implementations of Trevisan’s extractor ran in O~(n)\widetilde{O}(n) time in this setting. In particular, these extractors directly yield privacy amplification protocols with the same time complexity and output length, and communication complexity equal to their seed length.

1 Introduction

Seeded randomness extractors are central objects in the theory of pseudorandomness. A strong (k,ε)(k,\varepsilon)-seeded extractor is a deterministic function 𝖤𝗑𝗍:{0,1}n×{0,1}d{0,1}m\mathsf{Ext}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}\to\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m} that receives as input an nn-bit source of randomness XX with kk bits of min-entropy111A random variable XX has kk bits of min-entropy if Pr[X=x]2k\Pr[X=x]\leq 2^{-k} for all xx. Min-entropy has been the most common measure for the quality of a weak source of randomness since the work of Chor and Goldreich [CG88]. and a dd-bit independent and uniformly random seed YY, and outputs an mm-bit string 𝖤𝗑𝗍(X,Y)\mathsf{Ext}(X,Y) that is ε\varepsilon-close in statistical distance to the uniform distribution over {0,1}m\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m}, where ε\varepsilon is an error term, even when the seed YY is revealed. Besides their most direct application to the generation of nearly-perfect randomness from imperfect physical sources of randomness (and their inaugural applications to derandomizing space-bounded computation [NZ96] and privacy amplification [BBCM95]), seeded extractors have also found many other surprising applications throughout computer science, particularly in cryptography.

For most applications, it is important to minimize the seed length of the extractor. A standard application of the probabilistic method shows the existence of strong (k,ε)(k,\varepsilon)-seeded extractors with seed length d=log(nk)+2log(1/ε)+O(1)d=\log(n-k)+2\log(1/\varepsilon)+O(1) and output length m=k2log(1/ε)O(1)m=k-2\log(1/\varepsilon)-O(1), and we also know that these parameters are optimal up to the O(1)O(1) terms [RT00]. This motivated a deep line of research devising explicit constructions of seeded extractors with seed length as small as possible spanning more than a decade (e.g., [NZ96, SZ99, NT99, Tre01, TZS06, SU05]) and culminating in extractors with essentially optimal seed length [LRVW03, GUV09]. In particular, the beautiful work of Guruswami, Umans, and Vadhan [GUV09] gives explicit strong extractors with order-optimal seed length d=O(log(n/ε))d=O(\log(n/\varepsilon)) and output length m=(1η)km=(1-\eta)k for any constant δ>0\delta>0, and follow-up work [DKSS13, TU12] further improved the entropy loss k+dmk+d-m. The extractors constructed in these works are explicit, in the sense that there is an algorithm that given xx and yy computes the corresponding output 𝖤𝗑𝗍(x,y)\mathsf{Ext}(x,y) in time polynomial in the input length.

A closer look shows that the short-seed constructions presented in the literature all run in time Ω(nlog(1/ε))\Omega(n\log(1/\varepsilon)), and often significantly slower. In cryptographic applications of extractors we want the error guarantee ε\varepsilon to be small, which means that implementations running in time Ω(nlog(1/ε))\Omega(n\log(1/\varepsilon)) are often impractical. If we insist on nearly-linear runtime for arbitrary error ε\varepsilon, we can use strong seeded extractors based on universal hash functions that can be implemented in O(nlogn)O(n\log n) time (e.g., see [HT16]), have essentially optimal output length, but have the severe drawback of requiring a very large seed length d=Ω(m)d=\Omega(m).

These limitations have been noted in a series of works studying concrete implementations of seeded extractors, with practical applications in quantum cryptography in mind [MPS12, FWE+23, FYEC24]. For example, Foreman, Yeung, Edgington, and Curchod [FYEC24] implement a version of Trevisan’s extractor [Tre01, RRV02] with its standard instantiation of Reed–Solomon codes concatenated with the Hadmadard code, and emphasize its excessive running time as a major reason towards non-adoption.222The reason why these works focus on Trevisan’s extractor is that this is the best seeded extractor (in terms of asymptotic seed length) that is known to be secure against quantum adversaries [DPVR12]. Instead, they have to rely on extractors based on universal hash functions, which, as mentioned above, are fast but require very large seeds.

This state of affairs motivates the following question, which is the main focus of this work:

Can we construct strong (k,ε)(k,\varepsilon)-seeded extractors with seed length d=O(log(n/ε))d=O(\log(n/\varepsilon)) and output length m=(1η)km=(1-\eta)k computable in nearly-linear time, for arbitrary error ε\varepsilon?

Progress on this problem would immediately lead to faster implementations of many cryptographic protocols that use seeded extractors.

1.1 Our Contributions

We make progress on the construction of nearly-linear time extractors.

Seeded extractors with order-optimal seed length and large output length.

We construct nearly-linear time strong seeded extractors with order-optimal seed length and large output length for any kk and ε\varepsilon, with the caveat that they require a one-time preprocessing step whenever k=O(log2(n/ε))k=O(\log^{2}(n/\varepsilon)). This preprocessing step corresponds to finding primitive elements of finite fields 𝔽q\mathds{F}_{q} with q=poly(n/ε)q=\operatorname{poly}(n/\varepsilon), which, as we discuss below, is reasonable in practical applications. More precisely, we have the following result.

Theorem 1.

For any constant η>0\eta>0 there exists a constant C>0C>0 such that the following holds. For any positive integers nn and knk\leq n and any ε>0\varepsilon>0 satisfying kClog(n/ε)k\geq C\log(n/\varepsilon) there exists a strong (k,ε)(k,\varepsilon)-seeded extractor

𝖤𝗑𝗍:{0,1}n×{0,1}d{0,1}m\mathsf{Ext}\colon\{0,1\}^{n}\times\{0,1\}^{d}\to\{0,1\}^{m}

with seed length dClog(n/ε)d\leq C\log(n/\varepsilon) and output length m(1η)km\geq(1-\eta)k. Furthermore,

  • if k2Clognlog2(n/ε)k\geq 2^{C\log^{*}\!n}\cdot\log^{2}(n/\varepsilon), then 𝖤𝗑𝗍\mathsf{Ext} is computable in time O~(n)\widetilde{O}(n), where O~()\widetilde{O}(\cdot) hides polylogarithmic factors in its argument and log\log^{*}\! denotes the iterated logarithm;

  • if k<2Clognlog2(n/ε)k<2^{C\log^{*}\!n}\cdot\log^{2}(n/\varepsilon), then 𝖤𝗑𝗍\mathsf{Ext} is computable in time O~(n)\widetilde{O}(n) after a preprocessing step, corresponding to finding a primitive element of 𝔽q\mathds{F}_{q} with q=poly(n/ε)q=\operatorname{poly}(n/\varepsilon) a power of 22.333In full rigor, the preprocessing step corresponds to finding primitive elements of O(loglogn)O(\log\log n) fields 𝔽q\mathds{F}_{q} with orders qpoly(n/ε)q\leq\operatorname{poly}(n/\varepsilon), each a power of 22. This O(loglogn)O(\log\log n) term has negligible influence on the complexity of this preprocessing step. Note that we can find such a primitive element in time polylog(n/ε)\operatorname{polylog}(n/\varepsilon) if qpoly(n/ε)q\leq\operatorname{poly}(n/\varepsilon) is a power of 22 and we know the factorization of q1q-1, but we do not know how to do that in time O~(logq)\widetilde{O}(\log q). More precisely, given the factorization of q1q-1 we can test whether a given α𝔽q\alpha\in\mathds{F}_{q} is primitive in time polylog(q)\operatorname{polylog}(q) by checking whether αq1p1\alpha^{\frac{q-1}{p}}\neq 1 for all prime factors pp of q1q-1. We can exploit this in various ways. If we are fine with using randomness in the one-time preprocessing stage, then we can sample an element of 𝔽q\mathds{F}_{q} uniformly at random, test whether it is primitive, and repeat if not. If we insist on a deterministic algorithm, then we can combine the testing procedure with algorithms of Shoup [Sho90] or Shparlinski [Shp92] which identify in time polylog(q)\operatorname{polylog}(q) a subset of size polylog(q)\operatorname{polylog}(q) in 𝔽q\mathds{F}_{q} that is guaranteed to contain a primitive element. For an alternative faster randomized algorithm, see [DD06].

1 follows from combining modern condensers with short seeds (namely, the lossless condenser of Kalev and Ta-Shma [KT22] and the lossy Reed-Solomon-based condenser of Guruswami, Umans, and Vadhan [GUV09]) with a careful combination and instantiation of classical recursive approaches developed by Srinivasan and Zuckerman [SZ99] and in [GUV09]. It readily implies, among other things, an O~(n)\widetilde{O}(n)-time privacy amplification protocol where only O(log(n/ε))O(\log(n/\varepsilon)) bits need to be communicated over the one-way authenticated public channel and almost all the min-entropy can be extracted (after a reasonable one-time preprocessing step if the min-entropy bound kk is very small).

A new non-recursive construction.

As a conceptual contribution which may be of independent interest, we present a new “non-recursive” construction of extractors with seed length O(log(n/ε))O(\log(n/\varepsilon)) and output length (1η)k(1-\eta)k that is computable in nearly-linear time when k>polylog(1/ε)k>\operatorname{polylog}(1/\varepsilon) and avoids the complicated recursive procedures from [SZ99, GUV09]. We believe this to be a conceptually better approach towards constructing seeded extractors, and we discuss it in more detail in the technical overview.

Faster instantiations of Trevisan’s extractor.

One of the most widely-used explicit seeded extractors is Trevisan’s extractor [Tre01, RRV02]. While by now we have extractors with better parameters, one of its main advantages is that it is one of the few examples of extractors, and in a sense the best one, which are known to be quantum proof.444An extractor is quantum proof if its output is close to uniform even in the presence of a quantum adversary that has some (bounded) correlation with XX. A bit more formally, 𝖤𝗑𝗍\mathsf{Ext} is quantum-proof if for all classical-quantum state ρXE\rho_{XE} (where EE is a quantum state correlated with XX) with H(X|E)kH_{\infty}(X|E)\geq k, and a uniform seed YY, it holds that ρ𝖤𝗑𝗍(X,Y)YEερUmρYρE\rho_{\mathsf{Ext}(X,Y)YE}\approx_{\varepsilon}\rho_{U_{m}}\otimes\rho_{Y}\otimes\rho_{E}. See [DPVR12] for more details.

Trevisan’s extractor uses two basic primitives: combinatorial designs (when more than one output bit is desired), and binary list-decodable codes. A standard instantiation of such suitable codes goes by concatenating a Reed-Solomon code with a Hadamard code, and this is also what is considered in [FWE+23, FYEC24]. As they also observe, this gives a nearly-linear time construction when the output length m=1m=1. In fact, by leveraging fast multipoint evaluation, one can also get a nearly-linear time construction for any output length mnlog(1/ε)m\leq\frac{n}{\log(1/\varepsilon)}, although this was not noted in previous works.555For a rigorous statement on fast multipoint evaluation, see Lemma 2.1.

Our main contribution in this direction is an alternative instantiation of Trevisan’s extractor that can be computed in truly linear time on a RAM in the logarithmic cost model, for any output length mnlog(1/ε)polylog(n)m\leq\frac{n}{\log(1/\varepsilon)\cdot\operatorname{polylog}(n)}.

Theorem 2.

There exists an instantiation of Trevisan’s extractor, set to extract mm bits with any error ε>0\varepsilon>0, that is computable in:

  1. 1.

    Time O(n)+mlog(1/ε)polylog(n)O(n)+m\log(1/\varepsilon)\cdot\operatorname{polylog}(n) after a preprocessing step running in time O~(mlog(n/ε))\widetilde{O}(m\log(n/\varepsilon)), on a RAM in the logarithmic cost model. In particular, there exists a universal constant cc, such that whenever mnlog(1/ε)logc(n)m\leq\frac{n}{\log(1/\varepsilon)\cdot\log^{c}(n)}, the instantiation runs in time O(n)O(n), without the need for a preprocessing step.

  2. 2.

    Time O~(n+mlog(1/ε))\widetilde{O}(n+m\log(1/\varepsilon)) in the Turing model.

We note that one interesting instantiation of the above theorem is when Trevisan’s extractor is set to output kΩ(1)k^{\Omega(1)} bits for k=nΩ(1)k=n^{\Omega(1)}. In this setting, Trevisan’s extractor requires a seed of length O(log2(n/ε)log(1/ε))O\mathopen{}\mathclose{{}\left(\frac{\log^{2}(n/\varepsilon)}{\log(1/\varepsilon)}}\right), and, as long as ε\varepsilon is not too tiny, we get truly-linear runtime.

1.2 Other Related Work

Besides the long line of work focusing on improved constructions of explicit seeded extractors and mentioned in the introduction above, other works have studied randomness extraction in a variety of restricted computational models. These include extractors computable by streaming algorithms [BRST02], local algorithms [Lu02, Vad04, BG13, CL18], AC0 circuits [GVW15, CL18, CW24], AC0 circuits with a layer of parity gates [HIV22], NC1 circuits [CW24], and low-degree polynomials [ACG+22, AGMR24, GGH+24]. Moreover, implementations in various restricted computational models of other fundamental pseudorandomness primitives such as kk-wise and ε\varepsilon-biased generators, that often play a key role in constructions of various types of extractors, have also been independently studied (see [HV06, Hea08, CRSW13, MRRR14] for a very partial list).

As mentioned briefly above, some works have also focused on constructing seeded extractors computable in time O(nlogn)O(n\log n) motivated by applications in privacy amplification for quantum key distribution. Such constructions are based on hash functions, and are thus far restricted to Ω(m)\Omega(m) seed length. The work of Hayashi and Tsurumaru [HT16] presents an extensive discussion of such efforts. We also mention that nearly-linear time extractors with very short seed, in the regime k=nΩ(1)k=n^{\Omega(1)} and ε=no(1)\varepsilon=n^{-o(1)}, were given in [DMOZ22], with applications in derandomization.

1.3 Technical Overview

In a nutshell, we obtain 1 by following two standard high-level steps:

  1. 1.

    We apply a randomness condenser with small seed length O(log(n/ε))O(\log(n/\varepsilon)) to the original nn-bit weak source XX to obtain an output XX^{\prime} that is ε\varepsilon-close to a high min-entropy source.

  2. 2.

    We apply a seeded extractor tailored to high min-entropy sources with small seed length O(log(n/ε))O(\log(n/\varepsilon)) to XX^{\prime} to obtain a long output that is ε\varepsilon-close to uniform.

To realize this approach, we need to implement each of these steps in nearly-linear time O~(n)\widetilde{O}(n) (possibly after a reasonable one-time preprocessing step). We briefly discuss how we achieve this, and some pitfalls we encounter along the way.

Observations about nearly-linear time condensers.

In order to implement Item 1, we need to use fast condensers with short seeds. Luckily for us, some existing state-of-the-art constructions of condensers already satisfy this property, although, to the best of our knowledge, this has not been observed before. We argue this carefully in Section 3.3.

For example, the “lossy Reed-Solomon condenser” from [GUV09] interprets the source as a polynomial f𝔽q[x]f\in\mathds{F}_{q}[x] of degree dn/logqd\leq n/\log q and the seed yy as an element of 𝔽q\mathds{F}_{q}, and outputs 𝖱𝖲𝖢𝗈𝗇𝖽(f,y)=(f(y),f(ζy),,f(ζmy))\mathsf{RSCond}(f,y)=(f(y),f(\zeta y),\dots,f(\zeta^{m^{\prime}}y)), for an appropriate mm^{\prime} and field size qq, with ζ\zeta a primitive element of 𝔽q\mathds{F}_{q}. Evaluating 𝖱𝖲𝖢𝗈𝗇𝖽(f,y)\mathsf{RSCond}(f,y) corresponds to evaluating the same polynomial ff on multiple points in 𝔽q\mathds{F}_{q}. This is an instance of the classical problem of multipoint evaluation in computational algebra, for which we know fast and practical algorithms (e.g., see [vzGG13, Chapter 10] or Lemma 2.1) running in time O~((d+m)logq)=O~(n)\widetilde{O}((d+m^{\prime})\log q)=\widetilde{O}(n), since dn/logqd\leq n/\log q and if mn/logqm^{\prime}\leq n/\log q.

A downside of this condenser is that it requires knowing a primitive element ζ\zeta of 𝔽q\mathds{F}_{q} with q=poly(n/ε)q=\operatorname{poly}(n/\varepsilon). As discussed above, if we know the factorization of q1q-1 and qq is a power of 22, then we can find such a primitive element in time polylog(q)\operatorname{polylog}(q). Beyond that, having access to such primitive elements, which only need to be computed once independently of the source and seed, is reasonable in practice. Therefore, we may leave this as a one-time preprocessing step.

The lossless “KT condenser” from [KT22] has a similar flavor. It interprets the source as a polynomial f𝔽q[x]f\in\mathds{F}_{q}[x] and the seed yy as an evaluation point, and outputs 𝖪𝖳𝖢𝗈𝗇𝖽(f,y)=(f(y),f(y),,f(m)(y))\mathsf{KTCond}(f,y)=(f(y),f^{\prime}(y),\dots,f^{(m^{\prime})}(y)), for some appropriate mm^{\prime}. The problem of evaluating several derivatives of the same polynomial ff on the same point yy (sometimes referred to as Hermite evaluation) is closely related to the multipoint evaluation problem above, and can also be solved in time O~(n)\widetilde{O}(n).666Interestingly, recent works used other useful computational properties of the KT condenser. Cheng and Wu [CW24] crucially use the fact that the KT condenser can be computed in NC1. Doron and Tell [DT23] use the fact that the KT condenser is logspace computable for applications in space-bounded derandomization. Evaluating the KT condenser does not require preprocessing. On the other hand, it only works when the min-entropy kClog2(n/ε)k\geq C\log^{2}(n/\varepsilon) for a large constant C>0C>0, where nn is the source length and ε\varepsilon the target error of the condenser.

The “ideal” approach to seeded extraction from high min-entropy sources.

We have seen that there are fast condensers with short seeds. It remains to realize Item 2. Because of the initial condensing step, we may essentially assume that our nn-bit weak source XX has min-entropy k(1δ)nk\geq(1-\delta)n, for an arbitrarily small constant δ>0\delta>0. In this case, we would like to realize in time O~(n)\widetilde{O}(n) and with overall seed length O(log(n/ε))O(\log(n/\varepsilon)) what we see as the most natural approach to seeded extraction from high min-entropy sources:

  1. 1.

    Use a fresh short seed to transform XX into a block source Z=Z1Z2ZtZ=Z_{1}\circ Z_{2}\circ\cdots\circ Z_{t} with geometrically decreasing blocks, where \circ denotes string concatenation. A block source has the property that each block ZiZ_{i} has good min-entropy even conditioned on the values of blocks Z1,,Zi1Z_{1},\dots,Z_{i-1}.

  2. 2.

    Perform block source extraction on ZZ using another fresh short seed. Due to its special structure, we can extract a long random string from ZZ using only the (small) seed length associated with extracting randomness from the smallest block ZtZ_{t}, which has length O(log(n/ε))O(\log(n/\varepsilon)).

The classical approach to Item 2 where we iteratively apply extractors based on universal hash functions with increasing output lengths to the blocks of ZZ from right to left is easily seen to run in time O~(n)\widetilde{O}(n) and requires a seed of length O(log(n/ε))O(\log(n/\varepsilon)) if, e.g., we use the practical extractors of [TSSR11, HT16]. Therefore, we only need to worry about realizing Item 1.

A standard approach to Item 1 would be to use an averaging sampler to iteratively sample subsequences of XX as the successive blocks of the block source ZZ, following a classical strategy of Nisan and Zuckerman [NZ96] (improved by [RSW06, Vad04]). We do know averaging samplers running in time O~(n)\widetilde{O}(n) (such as those based on random walks on a carefully chosen expander graph). However, this approach requires a fresh seed of length Θ(log(n/ε))\Theta(\log(n/\varepsilon)) per block of ZZ. Since ZZ will have roughly logn\log n blocks, this leads to an overall seed of length Θ(log2n+log(1/ε))\Theta(\log^{2}n+\log(1/\varepsilon)), which is too much for us.

Instead, we provide a new analysis of a sampler based on bounded independence, that runs in time O~(n)\widetilde{O}(n) and only requires a seed of length O(log(n/ε))O(\log(n/\varepsilon)) to create the entire desired block source. We give the construction, which may be of independent interest, in Section 3.2. The caveat of this “block source creator” is that it only works as desired when the target error ε2kc\varepsilon\geq 2^{-k^{c}} for some small constant c>0c>0. Combining these realizations of Items 1 and 2 yields the desired O~(n)\widetilde{O}(n)-time extractor with order-optimal seed length O(log(n/ε))O(\log(n/\varepsilon)) and output length (1η)n(1-\eta)n for arbitrary constant η>0\eta>0, provided that ε2kc\varepsilon\geq 2^{-k^{c}}. See Theorem 5.1 for the formal statement.

Getting around the limitation of the ideal approach.

We saw above that combining the ideal approach to seeded extraction from high min-entropy sources with the new analysis of the bounded independence sampler yields a conceptually simple construction with the desired properties when the error is not too small (or alternatively, whenever the entropy guarantee is large enough). However, we would like to have O~(n)\widetilde{O}(n)-time seeded extraction with O(log(n/ε))O(\log(n/\varepsilon)) seed length and large output length for all ranges of parameters.

To get around this limitation of our first construction, it is natural to turn to other classical approaches for constructing nearly-optimal extractors for high min-entropy sources, such as those of Srinivasan and Zuckerman [SZ99] or Guruswami, Umans, and Vadhan [GUV09]. These approaches consist of intricate recursive procedures combining a variety of combinatorial objects, and require a careful analysis.777In our view, these approaches are much less conceptually appealing than the “ideal” approach above. We believe that obtaining conceptually simpler constructions of fast nearly-optimal extractors that work for all errors is a worthwhile research direction, even if one does not improve on the best existing parameters. However, we could not find such an approach that works as is, even when instantiated with O~(n)\widetilde{O}(n)-time condensers and O~(n)\widetilde{O}(n)-time hash-based extractors. In particular:

  • The GUV approach [GUV09] gives explicit seeded extractors with large output length and order-optimal seed length for any min-entropy requirement kk and error ε\varepsilon. However, its overall runtime is significantly larger than O~(n)\widetilde{O}(n) whenever ε\varepsilon is not extremely small (for example, ε=2kα\varepsilon=2^{-k^{\alpha}} for some α(0,1/2)\alpha\in(0,1/2) is not small enough).

  • The SZ approach [SZ99] can be made to run in time O~(n)\widetilde{O}(n) and have large output length when instantiated with fast condensers, samplers, and hash-based extractors, but it is constrained to error ε2ck/logn\varepsilon\geq 2^{-ck/\log^{*}\!n}, where log\log^{*} is the iterated logarithm.

Fortunately, the pros and cons of the GUV and SZ approaches complement each other. Therefore, we can obtain our desired result by applying appropriately instantiated versions of the GUV and SZ approaches depending on the regime of ε\varepsilon we are targeting.

1.4 Future Work

We list here some directions for future work:

  • Remove the preprocessing step that our constructions behind 1 require when k<Clog2(n/ε)k<C\log^{2}(n/\varepsilon).

  • On the practical side, develop concrete implementations of seeded extractors with near-optimal seed length and large output length. In particular, we think that our non-recursive construction in Section 5.1 holds promise in this direction.

1.5 Acknowledgements

Part of this research was done while the authors were visiting the Simons Institute for the Theory of Computing, supported by DOE grant # DE-SC0024124. D. Doron’s research was also supported by Instituto de Telecomunicações (ref. UIDB/50008/2020) with the financial support of FCT - Fundação para a Ciência e a Tecnologia and by NSF-BSF grant #2022644. J. Ribeiro’s research was also supported by Instituto de Telecomunicações (ref. UIDB/50008/2020) and NOVA LINCS (ref. UIDB/04516/2020) with the financial support of FCT - Fundação para a Ciência e a Tecnologia.

2 Preliminaries

2.1 Notation

We often use uppercase roman letters to denote sets and random variables – the distinction will be clear from context. We denote the support of a random variable XX by 𝗌𝗎𝗉𝗉(X)\mathsf{supp}(X), and, for a random variable XX and set SS, we also write XSX\sim S to mean that XX is supported on SS. For a random variable XX, we write xXx\sim X to mean that xx is sampled according to the distribution of XX. We use UdU_{d} to denote a random variable that is uniformly distributed over {0,1}d\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}. For two strings xx and yy, we denote their concatenation by xyx\circ y. Given two random variables XX and YY, we denote their product distribution by X×YX\times Y (i.e., Pr[X×Y=xy]=Pr[X=x]Pr[Y=y]\Pr[X\times Y=x\circ y]=\Pr[X=x]\cdot\Pr[Y=y]. Given a positive integer nn, we write [n]={1,,n}[n]=\{1,\dots,n\}. For a prime power qq, we denote the finite field of order qq by 𝔽q\mathds{F}_{q}. We denote the base-22 logarithm by log\log.

2.2 Model of Computation

We work in the standard, multi-tape, Turing machine model with some fixed number of work tapes. In particular, there exists a constant CC such that all our claimed time bounds hold whenever we work with at most CC work tapes. This also implies that our results hold in the RAM model, wherein each machine word can store integers up to some fixed length, and standard word operations take constant time. In Section 4 we will give, in addition to the standard Turing machine model bounds, an improved runtime bound that is dedicated to the logarithmic-cost RAM model.

2.3 Fast Finite Fields Operations

For a prime power q=pq=p^{\ell}, we let Mq(d)M_{q}(d) be the number of field operations required to multiply two univariate polynomials over 𝔽q\mathds{F}_{q} of degree less than dd, and Mq𝖻(d)M_{q}^{\mathsf{b}}(d) be the bit complexity of such a multiplication, so Mq𝖻(d)Mq(d)T(q)M_{q}^{\mathsf{b}}(d)\leq M_{q}(d)\cdot T(q), where we denote by T(q)T(q) an upper bound on the bit complexity of arithmetic operations in 𝔽q\mathds{F}_{q}. When =1\ell=1, Harvey and van der Hoeven [HvdH19, HvdH21] showed that

Mq𝖻(d)=O(dlogqlog(dlogq)4max(0,logdlogq)),M^{\mathsf{b}}_{q}(d)=O(d\log q\cdot\log(d\log q)\cdot 4^{\max(0,\log^{*}\!d-\log^{*}\!q)}),

and in general, Mq(d)=dlogd2O(logn)M_{q}(d)=d\cdot\log d\cdot 2^{O(\log^{\star}n)} [Für09].888If 𝔽q\mathds{F}_{q} contains a dd-th root of unity, one can get Mq(d)=dlogdM_{q}(d)=d\log d from the classic FFT algorithm [CT65]. For a simpler algorithm attaining the bound Mq(d)=dlogdloglogdM_{q}(d)=d\log d\operatorname{loglog}d, see [vzGG13, Sections 8,10]. See also [HvdH22] for a widely-believed conjecture under which Mq(d)=dlogdM_{q}(d)=d\log d always holds. When p=2p=2, we can use Schönhage’s algorithm [Sch77] to get Mq𝖻(d)=O(dlogdloglogdMq(logq)),M_{q}^{\mathsf{b}}(d)=O(d\log d\cdot\operatorname{loglog}d\cdot M_{q}(\log q)), where we relied on the fact that addition and multiplication in 𝔽q\mathds{F}_{q} can be done in time Mq()=O(logloglog)M_{q}(\ell)=O(\ell\cdot\log\ell\cdot\operatorname{loglog}\ell). Overall, when dq2dd\leq q\leq 2^{d}, and qq is either a prime or a power of two, Mq𝖻(d)=dlogdO~(logq)M_{q}^{\mathsf{b}}(d)=d\log d\cdot\widetilde{O}(\log q). We will use fast multi-point evaluation and fast computation of derivatives (together with the preceding bounds on Mq𝖻M_{q}^{\mathsf{b}}).

Lemma 2.1 ([BM74], see also [vzGG13, Chapter 10]).

Let dd\in\mathbb{N}, and let qq be a prime, or a power of 22. Then, given a polynomial f𝔽q[X]f\in\mathds{F}_{q}[X] of degree at most dd, the following holds.

  1. 1.

    Given a set {α1,,αt}𝔽q\mathopen{}\mathclose{{}\left\{{\alpha_{1},\ldots,\alpha_{t}}}\right\}\subseteq\mathds{F}_{q}, where tdt\leq d, one can compute f(α1),,f(αt)f(\alpha_{1}),\ldots,f(\alpha_{t}) in time O(Mq𝖻(d)logd)=dlog2dO~(logq)O(M^{\mathsf{b}}_{q}(d)\cdot\log d)=d\log^{2}d\cdot\widetilde{O}(\log q).

  2. 2.

    For tdt\leq d and α𝔽q\alpha\in\mathds{F}_{q}, one can compute the derivatives f(α),f(α),,f(t)(α)f(\alpha),f^{\prime}(\alpha),\ldots,f^{(t)}(\alpha) in time O(Mq(d)logd)=dlog2dO~(logq)O(M_{q}(d)\cdot\log d)=d\log^{2}d\cdot\widetilde{O}(\log q).

Note that when q2dq\leq 2^{d}, we can bound O(Mq(d)logd)O(M_{q}(d)\cdot\log d) by O~(d)logq\widetilde{O}(d)\cdot\log q.999The looser bound of O~(d)logq\widetilde{O}(d)\cdot\log q, when q2dq\leq 2^{d}, is also a bound for an arbitrary 𝔽q\mathds{F}_{q}, and can be achieved with simpler algorithms than the ones cited.

For a comprehensive discussion of fast polynomial arithmetic, see Von Zur Gathen and Gerhard’s book [vzGG13] (and the more recent important developments [HvdH21]).

2.4 Statistical Distance, Entropy

We present some relevant definitions and lemmas about the statistical distance and min-entropy.

Definition 2.2 (statistical distance).

The statistical distance between two random variables XX and YY supported on 𝒮\mathcal{S}, denoted by Δ(X,Y)\Delta(X,Y), is defined as

Δ(X,Y)=sup𝒯𝒮|Pr[X𝒯]Pr[Y𝒯]|=12x𝒮|Pr[X=x]Pr[Y=x]|.\Delta(X,Y)=\sup_{\mathcal{T}\subseteq\mathcal{S}}|\Pr[X\in\mathcal{T}]-\Pr[Y\in\mathcal{T}]|=\frac{1}{2}\sum_{x\in\mathcal{S}}|\Pr[X=x]-\Pr[Y=x]|.

We say that XX and YY are ε\varepsilon-close, and write XεYX\approx_{\varepsilon}Y, if Δ(X,Y)ε\Delta(X,Y)\leq\varepsilon.

Definition 2.3 (min-entropy).

The min-entropy of a random variable XX supported on 𝒳\mathcal{X}, denoted by 𝐇(X)\mathbf{H}_{\infty}(X), is defined as

𝐇(X)=log(maxx𝒳Pr[X=x]).\mathbf{H}_{\infty}(X)=-\log\mathopen{}\mathclose{{}\left(\max_{x\in\mathcal{X}}\Pr[X=x]}\right).

Above, and throughout the paper, we use base-22 logarithms.

Definition 2.4 (average conditional min-entropy).

Let XX and YY be two random variables supported on 𝒳\mathcal{X} and 𝒴\mathcal{Y}, respectively. The average conditional min-entropy of XX given YY, denoted by 𝐇~(X|Y)\widetilde{\mathbf{H}}_{\infty}(X|Y), is defined as

𝐇~(X|Y)=log(𝔼yY[2𝐇(X|Y=y)]).\widetilde{\mathbf{H}}_{\infty}(X|Y)=-\log\mathopen{}\mathclose{{}\left(\mathds{E}_{y\sim Y}[2^{-\mathbf{H}_{\infty}(X|Y=y)}]}\right).

The following standard lemma gives a chain rule for min-entropy.

Lemma 2.5 (see, e.g., [DORS08]).

Let XX, YY, and ZZ be arbitrary random variables such that |𝗌𝗎𝗉𝗉(Y)|2|\mathsf{supp}(Y)|\leq 2^{\ell}. Then,

𝐇~(X|Y,Z)𝐇~(X|Z).\widetilde{\mathbf{H}}_{\infty}(X|Y,Z)\geq\widetilde{\mathbf{H}}_{\infty}(X|Z)-\ell.

We can turn the chain rule above into a high probability statement.

Lemma 2.6 (see, e.g., [MW97]).

Let XX, YY, and ZZ be random variables such that |𝗌𝗎𝗉𝗉(Y)|2|\mathsf{supp}(Y)|\leq 2^{\ell}. Then,

PryY[𝐇~(X|Y=y,Z)𝐇~(X|Z)log(1/δ)]1δ\Pr_{y\sim Y}[\widetilde{\mathbf{H}}_{\infty}(X|Y=y,Z)\geq\widetilde{\mathbf{H}}_{\infty}(X|Z)-\ell-\log(1/\delta)]\geq 1-\delta

for any δ>0\delta>0.

Definition 2.7 (smooth min-entropy).

We say that a random variable XX has ε\varepsilon-smooth min-entropy at least kk, denoted by 𝐇ε(X)k\mathbf{H}_{\infty}^{\varepsilon}(X)\geq k, if there exists a random variable XX^{\prime} such that XεXX\approx_{\varepsilon}X^{\prime} and 𝐇(X)k\mathbf{H}_{\infty}(X^{\prime})\geq k.

2.5 Extractors and Condensers

Definition 2.8 ((n,k)(n,k)-source).

We say that a random variable XX is an (n,k)(n,k)-source if X{0,1}nX\sim\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n} and 𝐇(X)k\mathbf{H}_{\infty}(X)\geq k.

Definition 2.9 (block source).

A random variable XX is an ((n1,n2,,nt),(k1,,kt))((n_{1},n_{2},\dots,n_{t}),(k_{1},\dots,k_{t}))-block source if we can write X=X1X2XtX=X_{1}\circ X_{2}\circ\cdots\circ X_{t}, each Xi{0,1}niX_{i}\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n_{i}}, where 𝐇~(Xi|X1,,Xi1)ki\widetilde{\mathbf{H}}_{\infty}(X_{i}|X_{1},\ldots,X_{i-1})\geq k_{i} for all i[s]i\in[s]. In the special case where ki=αnik_{i}=\alpha n_{i} for all i[t]i\in[t], we say that XX is an ((n1,n2,,nt),α)((n_{1},n_{2},\dots,n_{t}),\alpha)-block source.

We say that XX is an exact block source if 𝐇(Xi|X1=x1,,Xi1=xi1)ki\mathbf{H}_{\infty}(X_{i}|X_{1}=x_{1},\ldots,X_{i-1}=x_{i-1})\geq k_{i} for any prefix x1,,xi1x_{1},\dots,x_{i-1}. Lemma 2.6 tells us that any ((n1,,nt),α)((n_{1},\ldots,n_{t}),\alpha)-block-source is ε\varepsilon-close to an exact ((n1,,nt),(1ζ)α)((n_{1},\ldots,n_{t}),(1-\zeta)\alpha)-block-source, where ε=i=1t2αζni\varepsilon=\sum_{i=1}^{t}2^{-\alpha\zeta n_{i}}.

Definition 2.10 (seeded extractor).

A function 𝖤𝗑𝗍:{0,1}n×{0,1}d{0,1}m\mathsf{Ext}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}\rightarrow\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m} is a (k,ε)(k,\varepsilon) seeded extractor if the following holds. For every (n,k)(n,k)-source XX,

𝖤𝗑𝗍(X,Y)εUm,\mathsf{Ext}(X,Y)\approx_{\varepsilon}U_{m},

where YY is uniformly distributed over {0,1}d\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d} and is independent of XX and UmU_{m} is uniformly distributed over {0,1}m\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m}. We say that 𝖤𝗑𝗍\mathsf{Ext} is strong if 𝖤𝗑𝗍(X,Y)YεUm+d\mathsf{Ext}(X,Y)\circ Y\approx_{\varepsilon}U_{m+d}.

Furthermore, 𝖤𝗑𝗍\mathsf{Ext} is said to be an average-case (k,ε)(k,\varepsilon) (strong seeded) extractor if for all correlated random variables XX and WW such that XX is supported on {0,1}n\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n} and 𝐇~(X|W)k\widetilde{\mathbf{H}}_{\infty}(X|W)\geq k we have

𝖤𝗑𝗍(X,Y)YWεUm+dW,\mathsf{Ext}(X,Y)\circ Y\circ W\approx_{\varepsilon}U_{m+d}\circ W,

where YY is uniformly distributed over {0,1}d\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d} and is independent of XX and Um+dU_{m+d} is uniformly distributed over {0,1}m+d\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m+d} and independent of WW.

Remark 2.11.

By Lemma 2.6, every strong (k,ε)(k,\varepsilon)-seeded extractor 𝖤𝗑𝗍:{0,1}n×{0,1}d{0,1}m\mathsf{Ext}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}\to\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m} is also an average-case strong (k=k+log(1/ε),ε=2ε)(k^{\prime}=k+\log(1/\varepsilon),\varepsilon^{\prime}=2\varepsilon)-seeded extractor.

Definition 2.12 (condenser).

A function 𝖢𝗈𝗇𝖽:{0,1}n×{0,1}d{0,1}m\mathsf{Cond}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}\rightarrow\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m} is a (k,k,ε)(k,k^{\prime},\varepsilon) (seeded) condenser if the following holds. For every (n,k)(n,k)-source XX, 𝐇ε(𝖢𝗈𝗇𝖽(X,Y))k\mathbf{H}_{\infty}^{\varepsilon}(\mathsf{Cond}(X,Y))\geq k^{\prime}, where YY is uniformly distributed over {0,1}d\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d} and is independent of XX.

We say that 𝖢𝗈𝗇𝖽\mathsf{Cond} is strong if Y𝖢𝗈𝗇𝖽(X,Y)Y\circ\mathsf{Cond}(X,Y) is ε\varepsilon-close to some distribution YDY\circ D with min-entropy kk^{\prime} (and note that here, necessarily, dd bits of entropy come from the seed). Finally, we say that 𝖢𝗈𝗇𝖽\mathsf{Cond} is lossless if k=k+dk^{\prime}=k+d.

We also define extractors tailored to block sources.

Definition 2.13 (block source extractor).

A function 𝖡𝖤𝗑𝗍:{0,1}n1××{0,1}nt×{0,1}d{0,1}m\mathsf{BExt}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n_{1}}\times\cdots\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n_{t}}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}\to\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m} is a (k1,,kt,ε)(k_{1},\dots,k_{t},\varepsilon) strong block-source extractor if for any ((n1,n2,,nt),(k1,,kt))((n_{1},n_{2},\dots,n_{t}),(k_{1},\dots,k_{t}))-block-source XX,

𝖡𝖤𝗑𝗍(X,Y)YεUm+d,\mathsf{BExt}(X,Y)\circ Y\approx_{\varepsilon}U_{m+d},

where YY is uniformly distributed over {0,1}d\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d} and is independent of XX and Um+dU_{m+d} is uniformly distributed over {0,1}m+d\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m+d}.

We will also require the following extractors based on the leftover hash lemma and fast hash functions. We state a result from [TSSR11] which requires seed length d2md\approx 2m, where mm is the output length. It is possible to improve the seed length to dmd\approx m, but this requires the input length nn to be structured [HT16].

Lemma 2.14 (fast hash-based extractors [TSSR11, Theorem 10], adapted. See also [HT16, Table I]).

For any positive integers nn, kk, and mm and any ε>0\varepsilon>0 such that knk\leq n and mk4log(16/ε)m\leq k-4\log(16/\varepsilon) there exists a (k,ε)(k,\varepsilon)-strong seeded extractor 𝖤𝗑𝗍:{0,1}n×{0,1}d{0,1}m\mathsf{Ext}\colon\{0,1\}^{n}\times\{0,1\}^{d}\to\{0,1\}^{m} with seed length d2(m+logn+2log(1/ε)+4)d\leq 2(m+\log n+2\log(1/\varepsilon)+4). Moreover, 𝖤𝗑𝗍\mathsf{Ext} can be computed in time O(nlogn)O(n\log n).

Note that by appending the seed to the output of the extractor, we can get the following: There exists a constant cc such that for any constant θ13\theta\leq\frac{1}{3}, dclog(n/ε)d\geq c\log(n/\varepsilon) and kθd+clog(1/ε)k\geq\theta d+c\log(1/\varepsilon), there exists a strong (k,ε)(k,\varepsilon)-seeded extractor 𝖤𝗑𝗍:{0,1}n×{0,1}d{0,1}(1+θ)d\mathsf{Ext}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}\rightarrow\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{(1+\theta)d}.

2.6 Averaging Samplers

In this section we define averaging samplers and state some useful related results and constructions.

Definition 2.15 (averaging sampler).

We say that 𝖲𝖺𝗆𝗉:{0,1}r[n]m\mathsf{Samp}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{r}\to[n]^{m} is a (γ,θ)(\gamma,\theta)-averaging sampler if

Pr(i1,,im)𝖲𝖺𝗆𝗉(Ur)[|1tj=1mf(ij)𝔼[f]|θ]<γ\Pr_{(i_{1},\dots,i_{m})\sim\mathsf{Samp}(U_{r})}\mathopen{}\mathclose{{}\left[\mathopen{}\mathclose{{}\left|\frac{1}{t}\sum_{j=1}^{m}f(i_{j})-\mathds{E}[f]}\right|\geq\theta}\right]<\gamma

for every function f:[n][0,1]f\colon[n]\to[0,1], where 𝔼[f]=1ni[n]f(i)\mathds{E}[f]=\frac{1}{n}\sum_{i\in[n]}f(i). We say that 𝖲𝖺𝗆𝗉\mathsf{Samp} has distinct samples if 𝖲𝖺𝗆𝗉(x)\mathsf{Samp}(x) outputs mm distinct elements of [n][n] for every input xx. The parameter θ\theta is often referred to as the accuracy of the sampler, and γ\gamma is its confidence parameter. Moreover, we sometimes refer to 𝖲𝖺𝗆𝗉(Ur)[n]m\mathsf{Samp}(U_{r})\sim[n]^{m} as a (γ,θ)(\gamma,\theta) sampling distribution.

The following lemma gives guarantees on sub-sampling from a weak source using an averaging sampler.

Lemma 2.16 ([Vad04, Lemma 6.2]).

Let δ,γ,τ(0,1)\delta,\gamma,\tau\in(0,1) be such that δ3τ\delta\geq 3\tau and let 𝖲𝖺𝗆𝗉:{0,1}r[n]m\mathsf{Samp}\colon\{0,1\}^{r}\to[n]^{m} be a (γ,θ=τ/log(1/τ))(\gamma,\theta=\tau/\log(1/\tau))-averaging sampler with distinct samples. Then, for any (n,k=δn)(n,k=\delta n)-source XX and YY uniformly distributed over {0,1}r\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{r} we have that

YX𝖲𝖺𝗆𝗉(Y)γ+2Ω(τn)YW,Y\circ X_{\mathsf{Samp}(Y)}\approx_{\gamma+2^{-\Omega(\tau n)}}Y\circ W,

where (W|Y=y)(W|Y=y) is an (m,k=(δ3τ)m)(m,k^{\prime}=(\delta-3\tau)m)-source for every yy.

The “expander random walk” sampler.

We will need the following averaging sampler based on random walks on expanders. Let GG be a DD-regular graph with vertex set [n][n]. We assume that the neighborhood of each vertex is ordered in some predetermined way. Then, the associated averaging sampler parses its input xx as (i1,b1,b2,,bt1)(i_{1},b_{1},b_{2},\dots,b_{t-1}), where i1[n]i_{1}\in[n] and b1,,bt1[D]b_{1},\dots,b_{t-1}\in[D], and outputs 𝖲𝖺𝗆𝗉(x)=(i1,,it)\mathsf{Samp}(x)=(i_{1},\dots,i_{t}), where iji_{j} is the bj1b_{j-1}-th neighbor of ij1i_{j-1} when j>1j>1. To ensure distinct samples, we skip repeated vertices.

The performance of 𝖲𝖺𝗆𝗉\mathsf{Samp} as an averaging sampler is determined by the spectral expansion of GG. In fact, if GG has spectral expansion θ/2\theta/2 then a direct application of the expander Chernoff bound [Gil98] gives that 𝖲𝖺𝗆𝗉\mathsf{Samp} is a (γ,θ)(\gamma,\theta)-averaging sampler with t=O(log(1/γ)/θ2)t=O(\log(1/\gamma)/\theta^{2}) and r=logn+O(tlog(1/θ))r=\log n+O(t\log(1/\theta)) [Vad04, Section 8.2]. We instantiate GG with the regular expander graphs from the following result of Alon [Alo21].

Lemma 2.17 ([Alo21, Theorem 1.2], adapted).

Fix any prime pp such that p1mod4p\equiv 1\mod 4. Then, there is a constant CpC_{p} such that for every integer nCpn\geq C_{p} there exists a (D=p+2)(D=p+2)-regular graph GnG_{n} on nn vertices with spectral expansion λ(1+2)d1+o(1)d\lambda\leq\frac{(1+\sqrt{2})\sqrt{d-1}+o(1)}{d}, where the o(1)o(1) tends to 0 as nn\to\infty. Furthermore, the family (Gn)n(G_{n})_{n} is strongly explicit.

In particular, for any θ>0\theta>0 there exist constants Cθ>0C_{\theta}>0 and Dθ=O(θ2)D_{\theta}=O(\theta^{-2}) and a strongly explicit family of DθD_{\theta}-regular graphs (Gn)nCθ(G_{n})_{n\geq C_{\theta}} with spectral expansion λθ\lambda\leq\theta for any nCθn\geq C_{\theta}.

Taking the tt-th power of a λ\lambda-spectral expander improves its expansion to λt\lambda^{t}. This readily gives us the following corollary.

Corollary 2.18.

For every large enough nn, and any λ=λ(n)>0\lambda=\lambda(n)>0, there exists a DD-regular graph G=(V=[n],E)G=(V=[n],E) with spectral expansion λ\lambda, where D=poly(1/λ)D=\operatorname{poly}(1/\lambda), and given x[n]x\in[n] and i[D]i\in[D], the yy-th neighbor of xx can be computed in time log(1/λ)polylog(n)\log(1/\lambda)\cdot\operatorname{polylog}(n).

Combining the discussion above with Lemma 2.17 (or Corollary 2.18) immediately yields the following.

Lemma 2.19 ([Vad04, Lemma 8.2], appropriately instantiated).

For every large enough integer nn and every θ,γ(0,1)\theta,\gamma\in(0,1), there exists a (γ,θ)(\gamma,\theta)-averaging sampler 𝖲𝖺𝗆𝗉:{0,1}r[n]t\mathsf{Samp}\colon\{0,1\}^{r}\to[n]^{t} with distinct samples with t=O(log(1/γ)/θ2)t=O(\log(1/\gamma)/\theta^{2}) and r=logn+O(tlog(1/θ))r=\log n+O(t\log(1/\theta)). Furthermore, 𝖲𝖺𝗆𝗉\mathsf{Samp} is computable in time O(tpolylogn)O(t\cdot\operatorname{polylog}n).

We can extend Lemma 2.19 to output more distinct samples while not increasing rr via the following simple lemma.

Lemma 2.20 ([Vad04, Lemma 8.3]).

Suppose that 𝖲𝖺𝗆𝗉0:{0,1}r[n]t\mathsf{Samp}_{0}\colon\{0,1\}^{r}\to[n]^{t} is a (γ,θ)(\gamma,\theta)-averaging sampler with distinct samples. Then, for every integer m1m\geq 1 there exists a (γ,θ)(\gamma,\theta)-averaging sampler 𝖲𝖺𝗆𝗉:{0,1}r[mn]mt\mathsf{Samp}\colon\{0,1\}^{r}\to[m\cdot n]^{m\cdot t} with distinct samples. Furthermore, if 𝖲𝖺𝗆𝗉0\mathsf{Samp}_{0} is computable in time TT, then 𝖲𝖺𝗆𝗉\mathsf{Samp} is computable in time O(mT)O(mT).

Lemma 2.20 follows easily by parsing [mt]=[m]×[t][m\cdot t]=[m]\times[t] and considering the sampler 𝖲𝖺𝗆𝗉(x)i,j=(i,𝖲𝖺𝗆𝗉0(x)j)\mathsf{Samp}(x)_{i,j}=(i,\mathsf{Samp}_{0}(x)_{j}) for i[m]i\in[m] and j[t]j\in[t]. If we can compute 𝖲𝖺𝗆𝗉0(x)\mathsf{Samp}_{0}(x) in time TT, then we can compute 𝖲𝖺𝗆𝗉(x)\mathsf{Samp}(x) in time O(mT)O(mT), as desired. The following is an easy consequence of Lemmas 2.19 and 2.20.

Lemma 2.21 ([Vad04, Lemma 8.4], with additional complexity claim).

There exists a constant C>0C>0 such that the following holds. For every large enough nn and θ,γ(0,1)\theta,\gamma\in(0,1), there exists a (γ,θ)(\gamma,\theta)-averaging sampler 𝖲𝖺𝗆𝗉:{0,1}r[n]t\mathsf{Samp}\colon\{0,1\}^{r}\to[n]^{t} with distinct samples for any t[t0,n]t\in[t_{0},n] with t0Clog(1/γ)/θ2t_{0}\leq C\log(1/\gamma)/\theta^{2} and r=log(n/t)+log(1/γ)poly(1/θ)r=\log(n/t)+\log(1/\gamma)\cdot\operatorname{poly}(1/\theta). Furthermore, 𝖲𝖺𝗆𝗉\mathsf{Samp} is computable in time tpoly(1/θ,logn)t\cdot\operatorname{poly}(1/\theta,\log n).

In particular, if θ\theta is constant then t0=O(log(1/γ))t_{0}=O(\log(1/\gamma)), r=log(n/t)+O(log(1/γ))r=\log(n/t)+O(\log(1/\gamma)), and 𝖲𝖺𝗆𝗉\mathsf{Samp} is computable in time tpolylognt\cdot\operatorname{polylog}n.

2.7 Standard Composition Techniques for Extractors

We collect some useful classical techniques for composing seeded extractors.

Lemma 2.22 (boosting the output length [WZ99, RRV02]).

Suppose that for i{1,2}i\in\{1,2\} there exist strong (ki,εi)(k_{i},\varepsilon_{i})-seeded extractors 𝖤𝗑𝗍i:{0,1}n×{0,1}di{0,1}mi\mathsf{Ext}_{i}\colon\{0,1\}^{n}\times\{0,1\}^{d_{i}}\to\{0,1\}^{m_{i}} running in time TiT_{i}, with k2k1m1gk_{2}\leq k_{1}-m_{1}-g. Then, 𝖤𝗑𝗍:{0,1}n×{0,1}d1+d2{0,1}m1+m2\mathsf{Ext}\colon\{0,1\}^{n}\times\{0,1\}^{d_{1}+d_{2}}\to\{0,1\}^{m_{1}+m_{2}} given by 𝖤𝗑𝗍(X,(Y1,Y2))=𝖤𝗑𝗍1(X,Y1)𝖤𝗑𝗍(X,Y2)\mathsf{Ext}(X,(Y_{1},Y_{2}))=\mathsf{Ext}_{1}(X,Y_{1})\circ\mathsf{Ext}(X,Y_{2}) is a strong (k1,ε112g+ε2)(k_{1},\frac{\varepsilon_{1}}{1-2^{-g}}+\varepsilon_{2})-seeded extractor running in time O(T1+T2)O(T_{1}+T_{2}).

Lemma 2.23 (block source extraction).

Let X=X1XtX=X_{1}\circ\cdots\circ X_{t} be an ((n1,,nt),(k1,,kt))((n_{1},\dots,n_{t}),(k_{1},\dots,k_{t}))-block-source, and let 𝖤𝗑𝗍i:{0,1}ni×{0,1}di{0,1}mi\mathsf{Ext}_{i}\colon\{0,1\}^{n_{i}}\times\{0,1\}^{d_{i}}\to\{0,1\}^{m_{i}} be average-case strong (ki,εi)(k_{i},\varepsilon_{i})-seeded extractors running in time TiT_{i} with output length midi1dim_{i}\geq d_{i-1}-d_{i} for i2i\geq 2. Then, there exists a strong (k1,,kt,ε=i[t]εi)(k_{1},\dots,k_{t},\varepsilon=\sum_{i\in[t]}\varepsilon_{i})-block-source extractor 𝖡𝖤𝗑𝗍:{0,1}n1××{0,1}nt×{0,1}dt{0,1}m\mathsf{BExt}\colon\{0,1\}^{n_{1}}\times\cdots\times\{0,1\}^{n_{t}}\times\{0,1\}^{d_{t}}\to\{0,1\}^{m} with output length m=m1+i=2t(mi(di1di))m=m_{1}+\sum_{i=2}^{t}(m_{i}-(d_{i-1}-d_{i})) that runs in time O(i[t]Ti)O(\sum_{i\in[t]}T_{i}). If XX is an exact block source, then the 𝖤𝗑𝗍i\mathsf{Ext}_{i}’s do not need to be average-case.

We discuss how the fast hash-based extractor from Lemma 2.14 can be used to construct a fast extractor with seed length any constant factor smaller than its output length for high min-entropy sources. We need the following lemma, which is an easy consequence of the chain rule for min-entropy.

Lemma 2.24 ([GUV09, Corollary 4.16]).

If XX is an (n,k=nΔ)(n,k=n-\Delta)-source and we write X=X1XtX=X_{1}\circ\cdots\circ X_{t} with |Xi|n|X_{i}|\geq n^{\prime} for all i[t]i\in[t], then X1XtX_{1}\circ\cdots\circ X_{t} is tεt\varepsilon-close to an (n1=n,,nt=n,k=nΔlog(1/ε))(n_{1}=n^{\prime},\dots,n_{t}=n^{\prime},k^{\prime}=n^{\prime}-\Delta-\log(1/\varepsilon))-block-source.

The following appears in [GUV09] without the time complexity bound. We appropriately instantiate their approach and analyze the time complexity below.

Lemma 2.25 (fast extractors with seed shorter than output [GUV09, Lemma 4.11]).

For every integer t1t\geq 1 there exists a constant C>0C>0 such that for any positive integer nn and ε>2n50t\varepsilon>2^{-\frac{n}{50t}} there exists a strong (k=(1120t)n,ε)(k=(1-\frac{1}{20t})n,\varepsilon)-seeded extractor 𝖤𝗑𝗍:{0,1}n×{0,1}d{0,1}m\mathsf{Ext}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}\to\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m} with mk/2m\geq k/2 and dk/t+Clog(n/ε)d\leq k/t+C\log(n/\varepsilon) computable in time O(tnlogn)O(tn\log n).

Proof.

Let XX be an (n,k=(1120t)n)(n,k=(1-\frac{1}{20t})n)-source and ε=ε2t\varepsilon^{\prime}=\frac{\varepsilon}{2t}. Write XX as X=X1XtX=X_{1}\circ\cdots\circ X_{t} with |Xi|=n/t=n|X_{i}|=\lfloor n/t\rfloor=n^{\prime} for all ii. Then, Lemma 2.24 guarantees that X1XtX_{1}\circ\cdots\circ X_{t} is (tε)(t\varepsilon^{\prime})-close to an (n1=n,,nt=n,k=nn20tlog(1/ε))(n_{1}=n^{\prime},\dots,n_{t}=n^{\prime},k^{\prime}=n^{\prime}-\frac{n}{20t}-\log(1/\varepsilon^{\prime}))-block-source XX^{\prime}. Note that

k=nn20tlog(1/ε)19n20t1log(1/ε)0.9n,k^{\prime}=n^{\prime}-\frac{n}{20t}-\log(1/\varepsilon^{\prime})\geq\frac{19n}{20t}-1-\log(1/\varepsilon^{\prime})\geq 0.9n^{\prime},

since we have assumed that ε>2n50t\varepsilon>2^{-\frac{n}{50t}}. Now, let 𝖤𝗑𝗍:{0,1}n×{0,1}d{0,1}m\mathsf{Ext}^{\prime}\colon\{0,1\}^{n^{\prime}}\times\{0,1\}^{d}\to\{0,1\}^{m} be the strong (k,ε)(k^{\prime},\varepsilon^{\prime})-seeded extractor from Lemma 2.14 with output length m=k2tk4log(16/ε)m=\mathopen{}\mathclose{{}\left\lceil\frac{k}{2t}}\right\rceil\leq k-4\log(16/\varepsilon^{\prime}) and corresponding seed length dk/t+4log(n/ε)+9k/t+Clog(n/ε)d\leq k/t+4\log(n/\varepsilon^{\prime})+9\leq k/t+C\log(n/\varepsilon) for a large enough constant C>0C>0 depending only on tt. Then, we apply block source extraction (Lemma 2.23) to XX^{\prime} with 𝖤𝗑𝗍1==𝖤𝗑𝗍t=𝖤𝗑𝗍\mathsf{Ext}_{1}=\cdots=\mathsf{Ext}_{t}=\mathsf{Ext}^{\prime} to get the desired strong (k,2tε=ε)(k,2t\varepsilon^{\prime}=\varepsilon)-extractor 𝖤𝗑𝗍\mathsf{Ext} with output length tmk/2t\cdot m\geq k/2 and seed length dd. Since 𝖤𝗑𝗍\mathsf{Ext}^{\prime} is computable in time O(nlogn)O(n\log n), then 𝖤𝗑𝗍\mathsf{Ext} is computable in time O(tnlogn)O(tn\log n). ∎

In addition to Lemma 2.22, one can potentially boost the output length of a high min-entropy extractor by first treating the source as a block sources and then performing a simple block source extraction. The following corollary follows easily from Lemmas 2.23 and 2.24 (and can also be found in [Vad04, Section 6]).

Lemma 2.26.

Let 𝖤𝗑𝗍𝗂𝗇:{0,1}n/2×{0,1}{0,1}d\mathsf{Ext}_{\mathsf{in}}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n/2}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{\ell}\rightarrow\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d} and 𝖤𝗑𝗍𝗈𝗎𝗍:{0,1}n/2×{0,1}d{0,1}m\mathsf{Ext}_{\mathsf{out}}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n/2}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}\rightarrow\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m} be (k,ε)(k^{\prime},\varepsilon)-extractors. Then, for any (n,k=δn)(n,k=\delta n)-source X1X2X_{1}\circ X_{2}, each Xi{0,1}n/2X_{i}\sim\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n/2}, and an independent uniform Y{0,1}Y\sim\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{\ell}, we have that

𝖤𝗑𝗍((X1,X2),Y)=𝖤𝗑𝗍𝗈𝗎𝗍(X1,𝖤𝗑𝗍𝗂𝗇(X2,Y))\mathsf{Ext}((X_{1},X_{2}),Y)=\mathsf{Ext}_{\mathsf{out}}(X_{1},\mathsf{Ext}_{\mathsf{in}}(X_{2},Y))

is 4ε4\varepsilon-close to uniform, assuming that k(δ34)nk^{\prime}\geq(\delta-\frac{3}{4})n and ε2n/4\varepsilon\geq 2^{-n/4}. In other words, 𝖤𝗑𝗍\mathsf{Ext} is a (k,4ε)(k,4\varepsilon)-extractor. Moreover, if 𝖤𝗑𝗍𝗂𝗇\mathsf{Ext}_{\mathsf{in}} is strong then 𝖤𝗑𝗍\mathsf{Ext} is also strong, and if 𝖤𝗑𝗍𝗂𝗇\mathsf{Ext}_{\mathsf{in}} and 𝖤𝗑𝗍𝗈𝗎𝗍\mathsf{Ext}_{\mathsf{out}} run in time T1T_{1} and T2T_{2}, respectively, then 𝖤𝗑𝗍\mathsf{Ext} runs in time O(T1+T2)O(T_{1}+T_{2}).

3 Additional Building Blocks

3.1 Fast Generation of Small-Bias Sets

A set S{0,1}nS\subseteq\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n} is ε\varepsilon-biased if the uniform distribution over its elements is indistinguishable from uniform by every linear test. Namely, if for every nonempty T[n]T\subseteq[n] it holds that PrsS[iTsi][1ε2,1+ε2n]\Pr_{s\sim S}[\bigoplus_{i\in T}s_{i}]\in[\frac{1-\varepsilon}{2},\frac{1+\varepsilon}{2}n]. We say that a linear code 𝒞{0,1}n\mathcal{C}\subseteq\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n} is ε\varepsilon-balanced if the Hamming weight of each nonzero codeword lies in [1ε2n,1+ε2][\frac{1-\varepsilon}{2}n,\frac{1+\varepsilon}{2}]. It is known that these two objects are essentially the same: SS is ε\varepsilon-biased if and only if the |S|×n|S|\times n matrix whose rows are the elements of SS is a generator matrix of an ε\varepsilon-balanced code.

One prominent way of constructing ε\varepsilon-balanced codes is via distance amplification, namely, starting with a code of some bias ε0ε\varepsilon_{0}\gg\varepsilon and, using a parity sampler, amplify its bias. We will use a specific, simple, instantiation of a parity sampler – the random walk sampler.

Lemma 3.1 (RWs amplify bias [Ta-17]101010The argument for t=2t=2 was suggested already by Rozenman and Wigderson (see [Bog12]).).

Let 𝒞0{0,1}n\mathcal{C}_{0}\subseteq\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n} be an ε0\varepsilon_{0}-balanced code, and let G=(V=[n],E)G=(V=[n],E) be a DD-regular λ\lambda-spectral expander, and for an even tt\in\mathbb{N}, let 𝒲t={w1,,wn¯}[n]t\mathcal{W}_{t}=\mathopen{}\mathclose{{}\left\{{w_{1},\ldots,w_{\bar{n}}}}\right\}\subseteq[n]^{t} be the set of walks of length tt on GG, noting that n¯=nDt\bar{n}=n\cdot D^{t}. Define 𝒞{0,1}n¯\mathcal{C}\subseteq\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{\bar{n}} such that

𝒞={dsum𝒲t(c0):c0𝒞0},\mathcal{C}=\mathopen{}\mathclose{{}\left\{{\mathrm{dsum}_{\mathcal{W}_{t}}(c_{0}):c_{0}\in\mathcal{C}_{0}}}\right\},

where y=dsum𝒲t(x)y=\mathrm{dsum}_{\mathcal{W}_{t}}(x) at location i[n¯]i\in[\bar{n}] is given by jwixj\bigoplus_{j\in w_{i}}x_{j}.

Then, 𝒞\mathcal{C} is ε\varepsilon-balanced, for

ε=(ε0+2λ)t/2.\varepsilon=\mathopen{}\mathclose{{}\left(\varepsilon_{0}+2\lambda}\right)^{t/2}.

For 𝒞0\mathcal{C}_{0}, we will use the Justesen code.

Lemma 3.2 ([Jus72]).

There exist constants R(0,1)R\in(0,1) and ε0(0,1)\varepsilon_{0}\in(0,1) such that there exists an explicit family of codes {Jusn}\mathopen{}\mathclose{{}\left\{{\mathrm{Jus}_{n}}}\right\}, each of which has block length nn, rate RR, and is ε0\varepsilon_{0}-balanced. Moreover, given x{0,1}k=Rnx\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{k=Rn}, Jusn(x)\mathrm{Jus}_{n}(x) can be computed in O~(n)\widetilde{O}(n).

Proof.

The parameters of the codes follow from the original construction (and specifically, the lemma holds, say, with R=18R=\frac{1}{8} and ε0=3740\varepsilon_{0}=\frac{37}{40}), so we will just show that the code is efficiently computable. Given a message xx, we first encode it with a full Reed–Solomon code of constant relative distance over a field 𝔽q\mathds{F}_{q} of characteristic 22, where qlogq=O(n)q\log q=O(n). By Lemma 2.1, this can be done in time O~(q)=O~(n)\widetilde{O}(q)=\widetilde{O}(n). Then, we encode with polynomial evaluation px(α)p_{x}(\alpha), for α𝔽q\alpha\in\mathds{F}_{q}, with the binary representation of (p(α),αp(α))(p(\alpha),\alpha\cdot p(\alpha)). This takes O~(q)\widetilde{O}(q) time as well. ∎

Corollary 3.3.

There exist a constant c>1c>1, and an explicit family of balanced codes, such that for every n¯\bar{n}\in\mathbb{N} and any ε>0\varepsilon>0, 𝒞𝔽2n¯\mathcal{C}\subseteq\mathds{F}_{2}^{\bar{n}} is ε\varepsilon-balanced of rate R=εcR=\varepsilon^{c}, and given x𝔽2k=Rn¯x\in\mathds{F}_{2}^{k=R\bar{n}}, any mm bits of 𝒞(x)\mathcal{C}(x) can be computed in time O~(n)+O(mlog(1/ε)lognloglogn)\widetilde{O}(n)+O(m\log(1/\varepsilon)\log n\operatorname{loglog}n).

Moreover, for every kk\in\mathbb{N} and any ε>0\varepsilon>0 there exists an explicit ε\varepsilon-biased set over 𝔽2k\mathds{F}_{2}^{k} generated by a function 𝖲𝗆𝖺𝗅𝗅𝖡𝗂𝖺𝗌:[n¯]{0,1}k\mathsf{SmallBias}\colon[\bar{n}]\rightarrow\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{k} computable in time (k+log(1/ε))O~(logk)(k+\log(1/\varepsilon))\cdot\widetilde{O}(\log k).

Proof.

Let 𝒞0:𝔽2k=Θ(n)𝔽2n\mathcal{C}_{0}\colon\mathds{F}_{2}^{k=\Theta(n)}\rightarrow\mathds{F}_{2}^{n} be the ε0\varepsilon_{0}-balanced code guaranteed to us by Lemma 3.2, and let G=(V=[n],E)G=(V=[n],E) be the DD-regular λ\lambda-spectral expander of Corollary 2.18, instantiated with λ=1ε04\lambda=\frac{1-\varepsilon_{0}}{4} (so D=D(ε0)D=D(\varepsilon_{0})). Letting 𝒞:𝔽2k𝔽2n¯\mathcal{C}\colon\mathds{F}_{2}^{k}\rightarrow\mathds{F}_{2}^{\bar{n}} be the amplified code of Lemma 3.1 set with

t=2log(1/ε)log(1+ε02)=O(log(1/ε)),t=\frac{2\log(1/\varepsilon)}{\log\mathopen{}\mathclose{{}\left(\frac{1+\varepsilon_{0}}{2}}\right)}=O(\log(1/\varepsilon)),

the lemma tells us that it is (ε0+2λ)t/2ε(\varepsilon_{0}+2\lambda)^{t/2}\leq\varepsilon balanced. Given x𝔽2nx\in\mathds{F}_{2}^{n} and i[n¯]i\in[\bar{n}], computing 𝒞(x)i\mathcal{C}(x)_{i} amounts to XORing tt coordinates of 𝒞0(x)\mathcal{C}_{0}(x) determined by i=(v,i1,,it)i=(v,i_{1},\ldots,i_{t}), which indexes a random walk over GG. Computing 𝒞0(x)\mathcal{C}_{0}(x) takes O~(n)\widetilde{O}(n) time, and computing a length-tt walk over GG takes tO(log(1/λ)lognloglogn)t\cdot O(\log(1/\lambda)\cdot\log n\cdot\operatorname{loglog}n) time. The corollary then follows, observing that n¯=nDt=npoly(1/ε)\bar{n}=n\cdot D^{t}=n\cdot\operatorname{poly}(1/\varepsilon), and that

O~(n)+mtO(lognloglogn)=O~(n)+mlog(1/ε).\widetilde{O}(n)+m\cdot t\cdot O(\log n\cdot\operatorname{loglog}n)=\widetilde{O}(n)+m\cdot\log(1/\varepsilon).

For the “Moreover” part, recall that we can take the rows of the generator matrix of 𝒞\mathcal{C} as our ε\varepsilon-biased set SS. Thus, for any i[n¯]i\in[\bar{n}], we can compute 𝖲𝗆𝖺𝗅𝗅𝖡𝗂𝖺𝗌(i)\mathsf{SmallBias}(i) as follows: Compute the corresponding random walk on GG, and then, for any j[k]j\in[k], 𝖲𝗆𝖺𝗅𝗅𝖡𝗂𝖺𝗌(i)j\mathsf{SmallBias}(i)_{j} is obtained by XORing the bits of 𝒞0(ej)\mathcal{C}_{0}(e_{j}) indexed by the ii-th random walk. Observing that each bit of 𝒞0(ej)\mathcal{C}_{0}(e_{j}) can be computed in time O~(logn)\widetilde{O}(\log n),111111Indeed, each coordinate of 𝒞0(ej)\mathcal{C}_{0}(e_{j}) is a bit in the encoding of (αj,αj+1)(\alpha^{j},\alpha^{j+1}) for some α𝔽q\alpha\in\mathds{F}_{q}, where qlogq=O(n)q\log q=O(n). the runtime of 𝖲𝗆𝖺𝗅𝗅𝖡𝗂𝖺𝗌\mathsf{SmallBias} is

tO(log(1/λ)lognloglogn)+kO~(logn)=(k+log(1/ε))O~(logk).t\cdot O(\log(1/\lambda)\cdot\log n\cdot\operatorname{loglog}n)+k\cdot\widetilde{O}(\log n)=(k+\log(1/\varepsilon))\cdot\widetilde{O}(\log k).\qed
Remark 3.4.

Instead of using Justesen’s code from Lemma 3.2 as our inner code 𝒞0\mathcal{C}_{0}, we can instead use the linear-time encodable code of Spielman [Spi96]. While not stated as balanced codes, but rather as constant relative distance codes, one can verify that the distance can also be bounded by above. The construction is more involved than Justesen’s one. However, in the logarithmic-cost RAM model, in which basic register operations over O(logn)O(\log n) bit registers count as a single time step, Spielman’s code can be implemented in O(n)O(n) time.

3.2 A Sampler from Bounded Independence

Recall that X1,,XnΣnX_{1},\ldots,X_{n}\sim\Sigma^{n} is a (b,ε)(b,\varepsilon)-wise independent distribution, if for every distinct i1,,ib[n]i_{1},\ldots,i_{b}\in[n] it holds that (Xi1,,Xib)(X_{i_{1}},\ldots,X_{i_{b}}) is ε\varepsilon-close to the uniform distribution over Σb\Sigma^{b}. Given our efficiently generated small biased spaces, we can efficiently generate almost bb-wise independent sample spaces as well.

Lemma 3.5.

For any positive integers nn, mnm\leq n, and bmb\leq m, and any ε>0\varepsilon>0, there exists an explicit (b,ε)(b,\varepsilon)-wise independent generator 𝖡𝖨b,ε:{0,1}d[n]m\mathsf{BI}_{b,\varepsilon}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}\rightarrow[n]^{m} with d=O(blogn+log(1/ε))d=O(b\log n+\log(1/\varepsilon)). That is, the distribution formed by picking zUdz\sim U_{d} and outputting 𝖡𝖨b,ε(z)\mathsf{BI}_{b,\varepsilon}(z) is (b,ε)(b,\varepsilon)-wise independent over [n]m[n]^{m}. Moreover,

  1. 1.

    Given z{0,1}dz\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}, 𝖡𝖨b,ε(z)\mathsf{BI}_{b,\varepsilon}(z) is computable in time O~(n)\widetilde{O}(n).

  2. 2.

    Assume that θ(0,1/4)\theta\in(0,1/4) is such that εθnb/2\varepsilon\leq\theta\cdot n^{-b/2}. Then, with probability at least 12Ω(θb)1-2^{-\Omega(\theta b)} over zUdz\sim U_{d}, 𝖡𝖨b,ε(z)\mathsf{BI}_{b,\varepsilon}(z) has at least m(1+4θ)m2nm-(1+4\theta)\frac{m^{2}}{n} distinct elements.

Proof.

Let q=2lognq=2^{\lceil\log n\rceil}, and set γ=ε2blogq2\gamma=\varepsilon\cdot 2^{-\frac{b\log q}{2}} and n𝖻=nlogqn_{\mathsf{b}}=n\log q. Let S𝖻{0,1}n𝖻S_{\mathsf{b}}\subseteq\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n_{\mathsf{b}}} denote the γ\gamma-biased set that is guaranteed to us by Corollary 3.3 and let S[q]nS\subseteq[q]^{n} be the set that corresponds to treating each consecutive logq\log q bits as an element of [q][q].121212Since we won’t care about optimizing the dependence on nn, we do not pre-encode using a bounded-independence generator (as in, say, [NN90, AGHP92]). By the XOR lemma, SS is (b,ε)(b,\varepsilon)-biased over [q]n[q]^{n}. Moreover, log|S|=O(log(1/ε)+klogq+logn)=O(log(1/ε)+blogn)\log|S|=O(\log(1/\varepsilon)+k\log q+\log n)=O(\log(1/\varepsilon)+b\log n), and each element of SS can be generated in time

(n𝖻+log(1/γ))O~(logn𝖻)=O~(n)+(b+log(1/ε))O~(logn)=O~(n),\mathopen{}\mathclose{{}\left(n_{\mathsf{b}}+\log(1/\gamma)}\right)\cdot\widetilde{O}(\log n_{\mathsf{b}})=\widetilde{O}(n)+\mathopen{}\mathclose{{}\left(b+\log(1/\varepsilon)}\right)\cdot\widetilde{O}(\log n)=\widetilde{O}(n),

where the last equality follows since we can always assume that εmn\varepsilon\geq m^{-n}. Notice that ignoring the last nmn-m symbols of each element of SS still preserves the above properties, which indeed gives rise to an efficiently samplable (b,ε)(b,\varepsilon)-wise independent sample space over [q]m[q]^{m}.

Next, we argue that most samples contain mostly distinct elements. Towards this end, let X1,,XmX_{1},\ldots,X_{m} be our (b,ε)(b,\varepsilon)-wise independent distribution 𝖡𝖨b,ε(Ud)\mathsf{BI}_{b,\varepsilon}(U_{d}), and let ZiZ_{i} denote the indicator random variable that is 11 if and only if XiX_{i} is a duplicate element (namely, there exists j<ij<i such that Xi=XjX_{i}=X_{j}). We are looking to bound i[m]Zi\sum_{i\in[m]}Z_{i} with high probability.

Claim 3.6.

Assume that tb/2t\leq b/2 and εθqt\varepsilon\leq\theta q^{-t} for some θ>0\theta>0. Then, for any distinct i1,,it[m]i_{1},\ldots,i_{t}\in[m], it holds that Pr[Zi1==Zit=1](1+θ)(m/q)t\Pr[Z_{i_{1}}=\ldots=Z_{i_{t}}=1]\leq(1+\theta)(m/q)^{t}.

Proof.

Fix indices j1,,jtj_{1},\ldots,j_{t}, where each j<ij_{\ell}<i_{\ell}. The probability that Xi=XjX_{i_{\ell}}=X_{j_{\ell}} for all [t]\ell\in[t] is at most qt+ε(1+θ)qtq^{-t}+\varepsilon\leq(1+\theta)q^{-t}, since this event depends on at most 2tb2t\leq b random variables. Union-bounding over all choices of jj-s incurs a multiplicative factor of [t](i1)mt,\prod_{\ell\in[t]}(i_{\ell}-1)\leq m^{t}, so overall, Pr[Zi1==Zit=1](1+θ)(m/q)t\Pr[Z_{i_{1}}=\ldots=Z_{i_{t}}=1]\leq(1+\theta)(m/q)^{t}. ∎

Now, 3.6 is sufficient to give us good tail bounds (see, e.g., [HH15, Section 3]). In particular, denoting μ=(1+θ)mq\mu=(1+\theta)\frac{m}{q} there exists a universal constant c>0c>0 such that

Pr[i[m]Zi(1+θ)μm]2cθb,\Pr\mathopen{}\mathclose{{}\left[\sum_{i\in[m]}Z_{i}\geq(1+\theta)\mu m}\right]\leq 2^{-c\theta b},

which implies Item 2 when n=qn=q. Finally, we need to argue that we can also handle the case where nn is not a power of 22 (and so q>nq>n). In this case, we can take our γ\gamma-biased set to be over n𝖻=ε1lognnn_{\mathsf{b}}=\lceil\varepsilon^{-1}\log n\rceil n bits, and each consecutive ε1logn\lceil\varepsilon^{-1}\log n\rceil bits are mapped to [n][n] by simply taking the corresponding integer modulo nn. The correctness can be found, e.g., in [Rao07]. ∎

Towards introducing our sampler, we will need the following tail bound for (b,ε)(b,\varepsilon)-wise independent random variables.

Lemma 3.7 ([XZ24]).

Let XΣmX\sim\Sigma^{m} be a (b,γ)(b,\gamma)-wise independent distribution, and fix some ε>0\varepsilon>0. Then, XX is also a (δ,ε)(\delta,\varepsilon) sampling distribution, where

δ=(5bεm)b+γεb.\delta=\mathopen{}\mathclose{{}\left(\frac{5\sqrt{b}}{\varepsilon\sqrt{m}}}\right)^{b}+\frac{\gamma}{\varepsilon^{b}}.

While the error in Item 2 above is small, it is not small enough for us to simply combine Lemmas 3.7 and 3.5, and we will need to do a mild error reduction. We do this via random walks on expanders and discarding repeating symbols, as was also done in [Vad04]. This gives us the following bounded-independence based sampler.

Lemma 3.8.

For any positive integers mnm\leq n, any δΓ(0,1)\delta_{\Gamma}\in(0,1), and any constant η(0,1)\eta\in(0,1) such that mη8nm\leq\frac{\eta}{8}n, there exists an explicit (δΓ,εΓ=2η)(\delta_{\Gamma},\varepsilon_{\Gamma}=2\eta) sampler Γ:{0,1}d[n]m\Gamma\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}\rightarrow[n]^{m} with d=O(lognlogmlog1δΓ)d=O\mathopen{}\mathclose{{}\left(\frac{\log n}{\log m}\cdot\log\frac{1}{\delta_{\Gamma}}}\right), that satisfies the following additional properties.

  1. 1.

    Every output of Γ\Gamma contains distinct symbols of [n][n], and,

  2. 2.

    Given y{0,1}dy\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}, Γ(y)\Gamma(y) is computable in time O~(n+log21δΓlognlogm)\widetilde{O}(n+\log^{2}\frac{1}{\delta_{\Gamma}}\cdot\frac{\log n}{\log m}).

Proof.

Set bb to be the smallest integer such that blogηm5blog8δΓb\log\frac{\eta\sqrt{m}}{5\sqrt{b}}\geq\log\frac{8}{\delta_{\Gamma}}, set m=(1+η)mm^{\prime}=(1+\eta)m, θ=η/4\theta=\eta/4, and γ=min{18ηbδΓ,θnb/2}\gamma=\min\mathopen{}\mathclose{{}\left\{{\frac{1}{8}\eta^{b}\cdot\delta_{\Gamma},\theta\cdot n^{-b/2}}}\right\}. Notice that b=O(log(1/δΓ)logm)b=O\mathopen{}\mathclose{{}\left(\frac{\log(1/\delta_{\Gamma})}{\log m}}\right) and log1γ=O(lognlogmlog1δΓ)\log\frac{1}{\gamma}=O\mathopen{}\mathclose{{}\left(\frac{\log n}{\log m}\cdot\log\frac{1}{\delta_{\Gamma}}}\right). Let

𝖡𝖨b,γ:{0,1}d[n]m\mathsf{BI}_{b,\gamma}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d^{\prime}}\rightarrow[n]^{m^{\prime}}

be the (b,γ)(b,\gamma)-wise independent generator guaranteed to us by Lemma 3.5, with d=O(blogn+log(1/γ))=O(log(1/γ))d^{\prime}=O(b\log n+\log(1/\gamma))=O(\log(1/\gamma)). By Lemma 3.7, X=𝖡𝖨b,ε(Ud)X=\mathsf{BI}_{b,\varepsilon}(U_{d^{\prime}}) is a (δ𝖻,η)(\delta_{\mathsf{b}},\eta) sampling distribution, where

δ𝖻=(5bηm)b+γηbδΓ8+δΓ8δΓ4.\delta_{\mathsf{b}}=\mathopen{}\mathclose{{}\left(\frac{5\sqrt{b}}{\eta\sqrt{m^{\prime}}}}\right)^{b}+\frac{\gamma}{\eta^{b}}\leq\frac{\delta_{\Gamma}}{8}+\frac{\delta_{\Gamma}}{8}\leq\frac{\delta_{\Gamma}}{4}.

Also, we know from Lemma 3.5 that with probability at least 12Ω(θb)1p1-2^{-\Omega(\theta b)}\triangleq 1-p, each sample from XX has at least m(1+4θ)m2nmm^{\prime}-(1+4\theta)\frac{m^{\prime 2}}{n}\geq m distinct symbols, using the fact that nm(1+η)3η\frac{n}{m}\geq\frac{(1+\eta)^{3}}{\eta}. Conditioned on seeing at least mm distinct symbols, XX as a sampling distribution, when we remove the non-distinct elements, has confidence δΓ/41pδΓ2\frac{\delta_{\Gamma}/4}{1-p}\leq\frac{\delta_{\Gamma}}{2} and accuracy 2η2\eta (where the second η\eta comes from the fact that ηm\eta m symbols were removed).

Next, in order to improve the probability of sampling a good sequence, let G=(V={0,1}d,E)G=(V=\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d^{\prime}},E) be the DD-regular λ\lambda-spectral expander of Corollary 2.18, instantiated with λ=p\lambda=p, so DpcD\leq p^{-c} for some universal constant cc. Write d=d+d=d^{\prime}+\ell^{\prime} for =logD\ell^{\prime}=\ell\cdot\log D, where =clog(1/δΓ)b\ell=c_{\ell}\cdot\frac{\log(1/\delta_{\Gamma})}{b} for some constant cc_{\ell} soon to be determined. Given y=(z,w){0,1}d×[D]y=(z,w)\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d^{\prime}}\times[D]^{\ell}, let z=v0,v2,,vz=v_{0},v_{2},\ldots,v_{\ell} denote the corresponding random walk over GG. Our sampler Γ\Gamma, on input yy, computes 𝖡𝖨b,γ(vi)\mathsf{BI}_{b,\gamma}(v_{i}) and outputs the first sequence with at least mm distinct symbols. If no such sequence was found, Γ\Gamma simply outputs (1,,m)(1,\ldots,m) (in which case we say it failed). By the expander hitting property (see, e.g., [Vad12, Section 4]), Γ\Gamma fails with probability at most

(p+λ)=(2p)δΓ2(p+\lambda)^{\ell}=(2p)^{\ell}\leq\frac{\delta_{\Gamma}}{2}

over yUdy\sim U_{d}, upon choosing the appropriate constant c=c(η)c_{\ell}=c_{\ell}(\eta). We then have that Γ(Ud)\Gamma(U_{d}) is indeed a (δΓ,2η)(\delta_{\Gamma},2\eta) sampling distribution, that can be generated using a seed of length d+=O(log(1/γ))d^{\prime}+\ell^{\prime}=O(\log(1/\gamma)). In terms of runtime, computing v1,,vv_{1},\ldots,v_{\ell} can be done in time

log1pO~(d)=O~(log21δΓlognlogm),\ell\cdot\log\frac{1}{p}\cdot\widetilde{O}(d^{\prime})=\widetilde{O}\mathopen{}\mathclose{{}\left(\log^{2}\frac{1}{\delta_{\Gamma}}\cdot\frac{\log n}{\log m}}\right),

and computing the sequences themselves takes O~(n)\ell\cdot\widetilde{O}(n) time. Observing that =O(logm)\ell=O(\log m), the proof is concluded. ∎

We will need to somewhat extend Lemma 3.8 and use the simple, yet crucial, property of our bounded independence sampling: A subset of the coordinates of a (b,ε)(b,\varepsilon)-wise independent distribution with distinct samples is itself a (b,ε)(b,\varepsilon)-wise independent distribution with distinct samples.131313We note that the distinct-samples sampler given in [Vad04] does not seem to enjoy a similar property. Thus, if we wish to sample multiple times, say using m1mt<nm_{1}\leq\ldots\leq m_{t}<n samples, we can use one sample from a sampler that outputs mtm_{t} coordinates, and truncate accordingly to create the other samples. We only need to note that: (1) the sampling parameters are determined by the different mim_{i}-s (and in particular, m1m_{1} should be large enough), and (2) mtm_{t} needs to be small enough compared to nn, so that we can get enough distinct symbols. We summarize this observation in the next lemma.

Lemma 3.9.

For any positive integers nn and m1<<mtnm_{1}<\ldots<m_{t}\leq n, any δ(0,1)\delta\in(0,1) and any constant ε\varepsilon such that mtε16nm_{t}\leq\frac{\varepsilon}{16}n, there exists an explicit function Γ:{0,1}d[n]mt\Gamma\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}\rightarrow[n]^{m_{t}} with d=O(lognlogm1log1δΓ)d=O\mathopen{}\mathclose{{}\left(\frac{\log n}{\log m_{1}}\cdot\log\frac{1}{\delta_{\Gamma}}}\right) that satisfies the following.

  1. 1.

    For any i[t]i\in[t], the function Γi\Gamma_{i}, that on input y{0,1}dy\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d} outputs Γ(y)|[1,mi]\Gamma(y)|_{[1,m_{i}]}, is a (δ,ε)(\delta,\varepsilon) sampler, and each sample contains distinct symbols.

  2. 2.

    On input y{0,1}dy\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}, Γ(y)\Gamma(y) can be computed in time O~(n+log2(1/δ))\widetilde{O}(n+\log^{2}(1/\delta)).

3.3 Nearly-Linear Time Condensers

We first give the condenser based on multiplicity codes, due to Kalev and Ta-Shma [KT22].

Theorem 3.10 (the lossless KT condenser, [KT22]).

For any constant α(0,1)\alpha\in(0,1) the following holds, for every nn\in\mathbb{N}, and any 0<ε1n0<\varepsilon\leq\frac{1}{n} and k256α2log2nεk\geq\frac{256}{\alpha^{2}}\log^{2}\frac{n}{\varepsilon}. There exists an explicit strong (k,k=k+,ε)(k,k^{\prime}=k+\ell,\varepsilon)-condenser

𝖪𝖳𝖢𝗈𝗇𝖽:{0,1}n×{0,1}{0,1}m\mathsf{KTCond}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{\ell}\rightarrow\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m}

where =(1+1α)lognkε=Oα(log1ε)\ell=\mathopen{}\mathclose{{}\left(1+\frac{1}{\alpha}}\right)\log\frac{nk}{\varepsilon}=O_{\alpha}(\log\frac{1}{\varepsilon}) and m=(1+α)km=(1+\alpha)k. Note that the output entropy rate satisfies km1α\frac{k^{\prime}}{m}\geq 1-\alpha. Moreover, given x{0,1}nx\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n} and y{0,1}y\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{\ell}, the output 𝖪𝖳𝖢𝗈𝗇𝖽(x,y)\mathsf{KTCond}(x,y) can be computed in O~(n)\widetilde{O}(n) time.

In particular, if ε=ε\varepsilon^{\prime}=\sqrt{\varepsilon}, then for all (n,k)(n,k)-sources XX and a (1ε)(1-\varepsilon^{\prime})-fraction of seeds yy it holds that 𝖪𝖳𝖢𝗈𝗇𝖽(X,y)εZy\mathsf{KTCond}(X,y)\approx_{\varepsilon^{\prime}}Z_{y}, where ZyZ_{y} is an (m=(1+α)k,k=k(1α)m)(m=(1+\alpha)k,k^{\prime}-\ell=k\geq(1-\alpha)m)-source. Note that the seed length is =Oα(log1ε)\ell=O_{\alpha}(\log\frac{1}{\varepsilon^{\prime}}).

Proof.

For the first part of the theorem statement we only need to establish the construction’s runtime. Given x{0,1}nx\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n} and y{0,1}y\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{\ell}, set a prime p=polyα(nε)p=\operatorname{poly}_{\alpha}(\frac{n}{\varepsilon}),141414More precisely, they set h=(2nk/ε)1/αh=(2nk/\varepsilon)^{1/\alpha}, and take pp to be a prime between 12h1+α\frac{1}{2}h^{1+\alpha} and h1+αh^{1+\alpha}. and interpret xx as a polynomial fx𝔽q[X]f_{x}\in\mathds{F}_{q}[X] of degree at most d1d-1, and yy as an element of 𝔽p\mathds{F}_{p}. Thus, n=dlogqn=d\log q, and we can safely ignore rounding issues, which can easily be addressed. The output 𝖪𝖳𝖢𝗈𝗇𝖽(x,y)\mathsf{KTCond}(x,y) is the sequence of derivatives

(f(y),f(y),,f(m)(y)),\mathopen{}\mathclose{{}\left(f(y),f^{\prime}(y),\ldots,f^{(m^{\prime})}(y)}\right),

where m=mlogqm^{\prime}=\frac{m}{\log q}. By Lemma 2.1, computing the derivatives takes O~(d)logp=O~(n)\widetilde{O}(d)\cdot\log p=\widetilde{O}(n) time. The rest of the auxiliary operations are negligible compared to computing the derivatives.

To see the “In particular” part of the theorem statement, fix an (n,k)(n,k)-source XX and note that Y𝖪𝖳𝖢𝗈𝗇𝖽(X,Y)εYZY\circ\mathsf{KTCond}(X,Y)\approx_{\varepsilon}Y\circ Z for some ZZ such that 𝐇(YZ)k\mathbf{H}_{\infty}(Y\circ Z)\geq k^{\prime}. Let Zy=(Z|Y=y)Z_{y}=(Z|Y=y). Then, an averaging argument gives that for a (1ε)(1-\sqrt{\varepsilon})-fraction of seeds yy we have 𝖱𝖲𝖢𝗈𝗇𝖽(X,y)εZy\mathsf{RSCond}(X,y)\approx_{\sqrt{\varepsilon}}Z_{y}. Since YY is uniformly random over {0,1}\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{\ell}, we get that 𝐇(Zy)k\mathbf{H}_{\infty}(Z_{y})\geq k^{\prime}-\ell, as desired. ∎

The downside of Theorem 3.10 is that it requires the entropy in the source to be Ω(log2(1/ε))\Omega(\log^{2}(1/\varepsilon)), instead of the optimal Ω(log(1/ε))\Omega(\log(1/\varepsilon)). Instead, we can use a lossy condenser151515Our extractor will lose a small constant fraction of the entropy, so losing a small constant fraction of the entropy in the condensing step will not make much difference. based on Reed–Solomon codes. Unfortunately, this comes at the expense of computing a generator of a field of size poly(1/ε)\operatorname{poly}(1/\varepsilon), which we do not know how to do in nearly-linear time for arbitrary ε\varepsilon-s. We consider it a one-time preprocessing step, as it does not depend on the inputs to the condenser.

Theorem 3.11 (the lossy RS condenser, [GUV09]).

For any constant α(0,1)\alpha\in(0,1) the following holds, for every nn\in\mathbb{N}, and any 0<ε1n0<\varepsilon\leq\frac{1}{n} and k(2+α)log(1/ε)k\geq(2+\alpha)\log(1/\varepsilon). There exists an explicit strong (k,k,ε)(k,k^{\prime},\varepsilon)-condenser

𝖱𝖲𝖢𝗈𝗇𝖽:{0,1}n×{0,1}{0,1}m\mathsf{RSCond}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{\ell}\rightarrow\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m}

where =(1+1α)lognkε=Oα(log1ε)\ell=\mathopen{}\mathclose{{}\left(1+\frac{1}{\alpha}}\right)\log\frac{nk}{\varepsilon}=O_{\alpha}(\log\frac{1}{\varepsilon}), m=km=k, and k=klog(1/ε)1+α+(1α)kk^{\prime}=\frac{k-\log(1/\varepsilon)}{1+\alpha}+\ell\geq(1-\alpha)k. Note that the output entropy rate satisfies km12α\frac{k^{\prime}}{m}\geq 1-2\alpha. Moreover, given x{0,1}nx\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}, y{0,1}y\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{\ell}, and a primitive element for 𝔽2\mathds{F}_{2^{\ell}}, the output 𝖱𝖲𝖢𝗈𝗇𝖽(x,y)\mathsf{RSCond}(x,y) can be computed in time O~(n)\widetilde{O}(n).

In particular, if ε=ε\varepsilon^{\prime}=\sqrt{\varepsilon} and klog(1/ε)α(1+2α)k\geq\frac{\log(1/\varepsilon)}{\alpha(1+2\alpha)}, then for all (n,k)(n,k)-sources XX and a (1ε)(1-\varepsilon^{\prime})-fraction of seeds yy it holds that 𝖱𝖲𝖢𝗈𝗇𝖽(X,y)εZy\mathsf{RSCond}(X,y)\approx_{\varepsilon^{\prime}}Z_{y}, where ZyZ_{y} is an (m=k,k(12α)m)(m=k,k^{\prime}-\ell\geq(1-2\alpha)m)-source. Note that the seed length is =Oα(log1ε)\ell=O_{\alpha}(\log\frac{1}{\varepsilon^{\prime}}).

Proof.

We set q=2q=2^{\ell}, and let ζ𝔽q\zeta\in\mathds{F}_{q} be the generator of the multiplicative group 𝔽q\mathds{F}_{q}^{\star} given to us as input.161616Working with fields of characteristic 22 is not necessary, but may help in efficiently computing ζ\zeta. For example, Shoup [Sho90] showed that given an irreducible polynomial f𝔽2[X]f\in\mathds{F}_{2}[X] of degree at most d1d-1, there exists a primitive element h𝔽2[X]/fh\in\mathds{F}_{2}[X]/\langle f\rangle of 𝔽2[X]/f𝔽2d\mathds{F}_{2}[X]/\langle f\rangle\equiv\mathds{F}_{2^{d}} such that hh is a monic polynomial of degree O(logd)O(\log d). Given x{0,1}nx\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n} and y{0,1}y\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{\ell}, similarly to Theorem 3.10, interpret xx as a univariate polynomial fxf_{x} of degree at most d1d-1, and yy as an element of 𝔽q\mathds{F}_{q}. The output 𝖢𝗈𝗇𝖽(x,y)\mathsf{Cond}(x,y) is the sequence of evaluations

(f(y),f(ζy),,f(ζmy)),\mathopen{}\mathclose{{}\left(f(y),f(\zeta y),\ldots,f(\zeta^{m^{\prime}}y)}\right),

where m=mlogqm^{\prime}=\frac{m}{\log q}.

The correctness proof, as well as the exact choice of parameters, are given in [GUV09, Section 6], so we proceed to bounding the runtime. Towards that end, since we rely on a specific primitive element ζ\zeta, we assume that the irreducible polynomial used to construct 𝔽q\mathds{F}_{q} is known, either (and there are several ). Computing the evaluation points y,ζy,,ζmyy,\zeta y,\ldots,\zeta^{m^{\prime}}y can then be done naively in time mMq𝖻()=O~(n)m^{\prime}\cdot M_{q}^{\mathsf{b}}(\ell)=\widetilde{O}(n). Then, using Lemma 2.1, the evaluation can be done in time O~(d)logq=O~(n)\widetilde{O}(d)\cdot\log q=\widetilde{O}(n) as well.

The “In particular” part of the theorem statement follows analogously to that of Theorem 3.10, using also the fact that if klog(1/ε)α(1+2α)k\geq\frac{\log(1/\varepsilon)}{\alpha(1+2\alpha)}, then k=klog(1/ε)1+α(12α)k=(12α)mk^{\prime}-\ell=\frac{k-\log(1/\varepsilon)}{1+\alpha}\geq(1-2\alpha)k=(1-2\alpha)m. ∎

4 A Faster Instantiation of Trevisan’s Extractor

We first recall Trevisan’s extractor [Tre01, RRV02], 𝖳𝗋𝖾:{0,1}n×{0,1}d{0,1}m\mathsf{Tre}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}\rightarrow\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m}, set to some designated error ε>0\varepsilon>0. We will need the notion of weak designs, due to Raz, Reingold, and Vadhan [RRV02].

Definition 4.1 (weak design).

A collection of sets S1,,Sm[d]S_{1},\dots,S_{m}\subseteq[d] is an (,ρ)(\ell,\rho)-weak design if for all i[m]i\in[m] we have |Si|=|S_{i}|=\ell and

j<i2|SiSj|ρ(m1).\sum_{j<i}2^{|S_{i}\cap S_{j}|}\leq\rho(m-1).

We will also need a δ\delta-balanced code 𝒞:{0,1}n{0,1}n¯\mathcal{C}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}\rightarrow\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{\bar{n}}. The parameters of the weak design affect the extractor’s parameters and can be set in a couple of different ways. The parameter \ell is set to be logn¯\log\bar{n}, typically ρ\rho is chosen according to mm, ε\varepsilon, and the desired entropy kk, and then dd is chosen as a function of \ell, mm, and ρ\rho according to the weak design (see [RRV02]). Given x{0,1}nx\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n} and y{0,1}dy\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}, Trevisan’s extractor outputs

𝖳𝗋𝖾(x,y)=x¯|yS1x¯|ySm,\mathsf{Tre}(x,y)=\bar{x}|_{y_{S_{1}}}\circ\ldots\circ\bar{x}|_{y_{S_{m}}}, (1)

where we denote x¯=𝒞(x)\bar{x}=\mathcal{C}(x) and interpret each length-logn¯\log\bar{n} bit-string ySiy_{S_{i}} as a location in [n¯][\bar{n}]. For the runtime analysis, it will be important to recall that δ\delta is set to be εcm\frac{\varepsilon}{cm} for some universal constant cc.

Theorem 4.2.

Trevisan’s extractor of Equation 1, set to extract mm bits with any error ε>0\varepsilon>0, is computable in time O~(n+mlog(1/ε))\widetilde{O}(n+m\log(1/\varepsilon)).

On a RAM in the logarithmic cost model, Trevisan’s extractor is computable in time O(n)+mlog(1/ε)polylog(n)O(n)+m\log(1/\varepsilon)\cdot\operatorname{polylog}(n) with a preprocessing time of O~(mlog(n/ε))\widetilde{O}(m\log(n/\varepsilon)). In particular, there exists a universal constant cc, such that whenever mnlogc(n/ε)m\leq\frac{n}{\log^{c}(n/\varepsilon)}, it runs in time O(n)O(n), without the need for a separate preprocessing step.

Proof.

Looking at Equation 1, note that we only need to compute mm coordinates of 𝒞(x)\mathcal{C}(x). To compute those mm coordinates, yS1,,ySmy_{S_{1}},\ldots,y_{S_{m}}, we first need to compute the weak design itself. Note that this can be seen as a preprocessing step, since it only depends on the parameters of the extractor, and not on xx or yy. We will use the following result.

Claim 4.3 ([FYEC24], Section A.5).

For every ,m\ell,m\in\mathbb{N} and ρ>1\rho>1, there exists an (,ρ)(\ell,\rho)-weak design S1,,Sm[d]S_{1},\ldots,S_{m}\subseteq[d] with d=O(2logρ)d=O(\frac{\ell^{2}}{\log\rho}), computable in time O~(m)\widetilde{O}(m\ell).

Once we have our preprocessing step, we are left with computing the code. By Corollary 3.3, we can choose n¯\bar{n} so that n/n¯=δcn/\bar{n}=\delta^{c} for some universal constant cc, and so n¯=npoly(m,1/ε)\bar{n}=n\cdot\operatorname{poly}(m,1/\varepsilon) and =logn¯=O(log(n/ε))\ell=\log\bar{n}=O(\log(n/\varepsilon)). Generating the design can then be done in time O~(mlog(n/ε))\widetilde{O}(m\log(n/\varepsilon)). Now, Corollary 3.3 tells us that any mm bits of 𝒞(x)\mathcal{C}(x) can be computed in time

O~(n)+O(mlog(1/δ)lognloglogn)=O~(n+mlog(1/ε)).\widetilde{O}(n)+O(m\log(1/\delta)\log n\operatorname{loglog}n)=\widetilde{O}(n+m\log(1/\varepsilon)).

On a RAM in the logarithmic cost model, we can use the variant of 𝒞\mathcal{C} that uses Spielman’s code as a base code (see Remark 3.4) and get a runtime of O(n)+mlog(1/ε)polylog(n)O(n)+m\log(1/\varepsilon)\cdot\operatorname{polylog}(n). This gives a truly linear time construction whenever mm is at most nlog(1/ε)polylog(n)\frac{n}{\log(1/\varepsilon)\operatorname{polylog}(n)}. ∎

We conclude by noting that there is a natural setting of parameters under which Trevisan’s extractor gives logarithmic seed and linear (or near-linear) time. When m=kΩ(1)m=k^{\Omega(1)}, the parameters can be set so that d=O(log2(n/ε)logk)d=O\mathopen{}\mathclose{{}\left(\frac{\log^{2}(n/\varepsilon)}{\log k}}\right). We thus have the following corollary.

Corollary 4.4.

For every nn\in\mathbb{N}, any constant c>1c>1, and any constants α,β(0,1)\alpha,\beta\in(0,1), Trevisan’s extractor 𝖳𝗋𝖾:{0,1}n×{0,1}d{0,1}m\mathsf{Tre}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}\rightarrow\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m} can be instantiated as a (k=nα,ε=nc)(k=n^{\alpha},\varepsilon=n^{-c}) extractor with d=O(logn)d=O(\log n), m=kβm=k^{\beta}, and given x{0,1}nx\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n} and y{0,1}dy\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}, 𝖳𝗋𝖾(x,y)\mathsf{Tre}(x,y) is computable in time O~(n)\widetilde{O}(n) (or O(n)O(n) time, depending on the model).

5 Nearly-Linear Time Extractors with Order-Optimal Seed Length

5.1 A Non-Recursive Construction

In this section, we use the various previously introduced building blocks to construct a seeded extractor with order-optimal seed length O(log(n/ε))O(\log(n/\varepsilon)) computable in time O~(n)\widetilde{O}(n). In a nutshell, our extractor proceeds as follows on input an (n,k)(n,k)-source XX:

  1. 1.

    Using a fresh seed, apply the lossless KT condenser from Theorem 3.10 to XX. This yields an (n,k)(n^{\prime},k)-source XX^{\prime} of length nkn^{\prime}\approx k and constant entropy rate δ\delta which can be arbitrarily close to 11.

  2. 2.

    Using the fact that XX^{\prime} has high min-entropy rate, use the bounded-independence sampler from Lemma 3.9 to sample subsources from XX^{\prime} using a fresh seed. Specific properties of the bounded-independence sampler allow us to obtain a block source Z=Z1Z2ZtZ=Z_{1}\circ Z_{2}\circ\cdots\circ Z_{t} with a seed of length only O(log(1/ε))O(\log(1/\varepsilon)). The number of blocks is t=O(logn)t=O(\log n) and the blocks ZiZ_{i} have geometrically increasing lengths, up to an nαn^{\alpha} length threshold.

  3. 3.

    Now, to prepare for the hash-based iterative extraction, we need to make our blocks decreasing. Again, using a short seed, of length O(log(n/ε))O(\log(n/\varepsilon)), we transform ZZ into S=S1StS=S_{1}\circ\cdots S_{t}, where the blocks are now geometrically decreasing. The blocks lengths will vary from nβ1n^{\beta_{1}} to some nβ2n^{\beta_{2}}, for some constants β1>β2\beta_{1}>\beta_{2}.

  4. 4.

    Using a fresh seed, apply the fast hash-based extractor from Lemma 2.14 to perform block source extraction from SS. Noting that the first block has length nΩ(1)n^{\Omega(1)}, the block source extraction only outputs nΩ(1)n^{\Omega(1)} bits. We are able to use only O(log(n/ε))O(\log(n/\varepsilon)) random bits here, since we do not output nΩ(1)n^{\Omega(1)} bits already at the beginning of the iterative extraction process, but instead output logarithmically many bits, and gradually increasing the output length.

These steps will culminate in the following theorem.

Theorem 5.1 (non-recursive construction).

There exists a constant c(0,1)c\in(0,1) such that for every positive integers nn and knk\leq n, any ε2kc\varepsilon\geq 2^{-k^{c}}, and any constant η(0,1)\eta\in(0,1), there exists a strong (k,ε)(k,\varepsilon) extractor

𝖤𝗑𝗍:{0,1}n×{0,1}d{0,1}m,\mathsf{Ext}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}\rightarrow\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m},

where d=O(log(n/ε))d=O(\log(n/\varepsilon)), and m=(1η)km=(1-\eta)k. Moreover, given inputs x{0,1}nx\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n} and y{0,1}dy\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}, we can compute 𝖤𝗑𝗍(x,y)\mathsf{Ext}(x,y) in time O~(n)\widetilde{O}(n).

5.1.1 Item 2: Generating the block source

Because of the initial condensing step, we will assume from here onwards that our input source XX is an (n,k=δn)(n,k=\delta n)-source with constant δ\delta. In order to generate the desired block source, we first use a fresh seed YY as input to an appropriate instantiation of the bounded-independence sampler Γ\Gamma from Lemma 3.9. This yields a tuple of coordinates Γ(Y)=j1,,jmt\Gamma(Y)=j_{1},\dots,j_{m_{t}} from [n][n], such that Γ(Y)|[1,mi]\Gamma(Y)|_{[1,m_{i}]} is an appropriate averaging sampler for every ii. Then, we use these coordinates to sample subsources from X{0,1}nX\sim\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}, and get a block source with increasing blocks.

Lemma 5.2 (sampling a block source).

There exists a deterministic procedure that given an (n,k)(n,k)-source XX with kδnk\geq\delta n, δ\delta being constant, and:

  • A constant loss parameter ζ(0,1)\zeta\in(0,1),

  • A closeness parameter ε(0,1)\varepsilon\in(0,1) that satisfies ε2cεn\varepsilon\geq 2^{-c_{\varepsilon}n} where cε=cε(ζ,δ)c_{\varepsilon}=c_{\varepsilon}(\zeta,\delta) is constant,

  • Number of desired blocks tt\in\mathbb{N},

  • A final, maximal, block length Δtc𝗍n\Delta_{t}\leq c_{\mathsf{t}}\cdot n where c𝗍=c𝗍(ζ,δ)c_{\mathsf{t}}=c_{\mathsf{t}}(\zeta,\delta) is constant, and,

takes an independent and uniform random seed Y{0,1}d𝗌𝖺𝗆𝗉Y\sim\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d_{\mathsf{samp}}} and outputs a random variable ZZ that is ε\varepsilon-close to a

((Δ1,,Δt),(1ζ)δ)\mathopen{}\mathclose{{}\left((\Delta_{1},\ldots,\Delta_{t}),(1-\zeta)\delta}\right)

block-source, where each Δi1=αΔi\Delta_{i-1}=\alpha\cdot\Delta_{i} for α=ζδ4\alpha=\frac{\zeta\delta}{4}. Moreover, the seed length d=O(lognlogΔ1logtε)d=O\mathopen{}\mathclose{{}\left(\frac{\log n}{\log\Delta_{1}}\cdot\log\frac{t}{\varepsilon}}\right), and the procedure runs in time O~(n+log2(t/ε))\widetilde{O}(n+\log^{2}(t/\varepsilon)).

Note that for any constants 0<θ1<θ2<10<\theta_{1}<\theta_{2}<1, and any ε=Ω(2n)\varepsilon=\Omega(2^{-\sqrt{n}}), we can have Δt=nθ2\Delta_{t}=n^{\theta_{2}} and Δ1=nθ1\Delta_{1}=n^{\theta_{1}} for some t=O(logn)t=O(\log n), with seed length O(log(1/ε))O(\log(1/\varepsilon)) and runtime O~(n)\widetilde{O}(n).

Proof.

Given our Δ1,,Δt\Delta_{1},\ldots,\Delta_{t}, we let mi=j=1iΔjm_{i}=\sum_{j=1}^{i}\Delta_{j} for j[t]j\in[t]. Note that for i[t1]i\in[t-1], each mi=j=1iΔjα1αΔi+1m_{i}=\sum_{j=1}^{i}\Delta_{j}\leq\frac{\alpha}{1-\alpha}\Delta_{i+1}, so in particular

mt=mt1+Δtα1αΔt+Δtn,m_{t}=m_{t-1}+\Delta_{t}\leq\frac{\alpha}{1-\alpha}\Delta_{t}+\Delta_{t}\leq n,

by choosing the constant c𝗍c_{\mathsf{t}} appropriately. Let Γ:{0,1}d𝗌𝖺𝗆𝗉[n]mt\Gamma\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d_{\mathsf{samp}}}\rightarrow[n]^{m_{t}} be the (γ,εΓ)(\gamma,\varepsilon_{\Gamma}) sampler of Lemma 3.9, set with εΓ=1log(6ζδ)ζδ6=O(1)\varepsilon_{\Gamma}=\frac{1}{\log(\frac{6}{\zeta\delta})}\cdot\frac{\zeta\delta}{6}=O(1) and γ=ε2t\gamma=\frac{\varepsilon}{2t}. Note that then,

d𝗌𝖺𝗆𝗉=O(lognlogm1log1γ)=O(lognlogΔ1logtε),d_{\mathsf{samp}}=O\mathopen{}\mathclose{{}\left(\frac{\log n}{\log m_{1}}\cdot\log\frac{1}{\gamma}}\right)=O\mathopen{}\mathclose{{}\left(\frac{\log n}{\log\Delta_{1}}\cdot\log\frac{t}{\varepsilon}}\right),

and indeed mtεΓ16nm_{t}\leq\frac{\varepsilon_{\Gamma}}{16}\cdot n can be met by, again, setting the constant c𝗍c_{\mathsf{t}} appropriately. Moreover, we have that for any i[t]i\in[t],

Wi=Γ(Y)|[1,mi]W_{i}=\Gamma(Y)|_{[1,m_{i}]}

is a (γ,εΓ)(\gamma,\varepsilon_{\Gamma}) sampler, where wWiw\sim W_{i} has distinct symbols. Set β=ζ2\beta=\frac{\zeta}{2}.

Now, Lemma 2.16, instantiated with τ=βδ3\tau=\frac{\beta\delta}{3} (notice that indeed εΓτlog(1/τ)\varepsilon_{\Gamma}\leq\frac{\tau}{\log(1/\tau)}), tells us that for every i[t]i\in[t], denoting Ai=XWiA_{i}=X_{W_{i}}, there exists a set 𝐁i{0,1}d𝗌𝖺𝗆𝗉\mathbf{B}_{i}\subseteq\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d_{\mathsf{samp}}} of bad yy-s of density at most γ+2Ω(τn)\gamma+2^{-\Omega(\tau n)}, such that for any y𝐁iy\notin\mathbf{B}_{i},

Ai|{Y=y}{0,1}miA_{i}|\mathopen{}\mathclose{{}\left\{{Y=y}}\right\}\sim\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m_{i}}

has entropy rate δ3τ(1β)δ\delta-3\tau\geq(1-\beta)\delta for every yy. Letting Z=AtZ=A_{t}, union-bounding over the bad yy-s tells us that ZZ is t(γ+2Ω(n))εt\cdot(\gamma+2^{-\Omega(n)})\leq\varepsilon close to some Z{0,1}mtZ^{\prime}\sim\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m_{t}} such that for any i[t]i\in[t], Zi=Z[1,mi]{0,1}miZ^{\prime}_{i}=Z^{\prime}_{[1,m_{i}]}\sim\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m_{i}} has entropy rate (1β)δ(1-\beta)\delta.

Next, we apply the chain rule for min-entropy to argue that ZZ^{\prime} (and hence ZZ) is close to a block source. To do that, we apply the chain rule for min-entropy t1t-1 times. For simplicity, abbreviate Z(i)=Z[mi1+1,mi]Z^{(i)}=Z^{\prime}_{[m_{i-1}+1,m_{i}]} (so note that ZiZ^{\prime}_{i} is the longer block, Z[1,mi]Z^{\prime}_{[1,m_{i}]}, whereas Z(i)Z^{(i)} is its length-Δi\Delta_{i} suffix), so

Z=(Z(1),Z(2),,Z(t)).Z^{\prime}=\mathopen{}\mathclose{{}\left(Z^{(1)},Z^{(2)},\ldots,Z^{(t)}}\right).

We will argue that ZZ^{\prime} is a block source. Applying Lemma 2.5, we know that for any i[t]i\in[t],

𝐇~(Z(i)Z(1),,Z(i1))𝐇(Z(i))j=1i1Δj=𝐇(Z(i))mi1𝐇(Z(i))α1αΔi.\widetilde{\mathbf{H}}_{\infty}\mathopen{}\mathclose{{}\left(Z^{(i)}\mid Z^{(1)},\ldots,Z^{(i-1)}}\right)\geq\mathbf{H}_{\infty}(Z^{(i)})-\sum_{j=1}^{i-1}\Delta_{j}=\mathbf{H}_{\infty}(Z^{(i)})-m_{i-1}\geq\mathbf{H}_{\infty}(Z^{(i)})-\frac{\alpha}{1-\alpha}\Delta_{i}.

Now, Zi=(Zi1,Z(i))Z^{\prime}_{i}=(Z^{\prime}_{i-1},Z^{(i)}), so 𝐇(Z(i))𝐇(Zi)mi1\mathbf{H}_{\infty}(Z^{(i)})\geq\mathbf{H}_{\infty}(Z^{\prime}_{i})-m_{i-1}, and notice that

(1β)δΔimi1(1β)δΔiα1αΔi(1ζ)δΔi,(1-\beta)\delta\cdot\Delta_{i}-m_{i-1}\geq(1-\beta)\delta\cdot\Delta_{i}-\frac{\alpha}{1-\alpha}\Delta_{i}\geq(1-\zeta)\delta\cdot\Delta_{i},

where we used the fact that α(ζβ)δ1(ζβ)δ\alpha\leq\frac{(\zeta-\beta)\delta}{1-(\zeta-\beta)\delta}.

The bound on the runtime follows easily, recalling that Γ\Gamma runs in time O~(n+log2(1/γ))\widetilde{O}\mathopen{}\mathclose{{}\left(n+\log^{2}(1/\gamma)}\right). ∎

5.1.2 Item 3: Subsampling from the block source

To apply iterative extraction, we will our block source to have decreasing blocks. Here, we will use a sampler to sample from each block, using the same seed accross the blocks.

Lemma 5.3 (subsampling from a block source).

There exists a deterministic procedure that given a

((Δ1,,Δt),δ)\mathopen{}\mathclose{{}\left((\Delta_{1},\ldots,\Delta_{t}),\delta}\right)

block-source Z=(Z1,,Zt)Z=(Z_{1},\ldots,Z_{t}), for every Δ1Δt\Delta_{1}\leq\ldots\leq\Delta_{t} and a constant δ\delta, and:

  • A constant shrinkage parameter α(0,1)\alpha\in(0,1),

  • A constant loss parameter ζ(0,1)\zeta\in(0,1),

  • A closeness parameter ε(0,1)\varepsilon\in(0,1),

  • An initial, maximal, block length 1Δ1\ell_{1}\leq\Delta_{1}, and,

takes an independent and uniform random seed Y{0,1}d𝗌𝖺𝗆𝗉Y\sim\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d_{\mathsf{samp}}} and outputs a random variable SS that is ε\varepsilon-close to a ((1,,t),(1ζ)δ)\mathopen{}\mathclose{{}\left((\ell_{1},\ldots,\ell_{t}),(1-\zeta)\delta}\right) block-source, where each i+1=αi\ell_{i+1}=\alpha\cdot\ell_{i}, and assuming that tc1log(t/ε)\ell_{t}\geq c_{1}\log(t/\varepsilon) where c1=c1(ζ,δ)c_{1}=c_{1}(\zeta,\delta) is a constant. Moreover, the seed length d=logΔt1+O(t+log1ε)d=\log\frac{\Delta_{t}}{\ell_{1}}+O\mathopen{}\mathclose{{}\left(t+\log\frac{1}{\varepsilon}}\right), and the procedure runs in time polylog(Δt)1\operatorname{polylog}(\Delta_{t})\cdot\ell_{1}.

Note that when Δ1=nθ1\Delta_{1}=n^{\theta_{1}} and t=nβ\ell_{t}=n^{\beta} for some constants 0<β<θ1<20<\beta<\theta_{1}<2, d𝗌𝖺𝗆𝗉=O(log(n/ε))d_{\mathsf{samp}}=O(\log(n/\varepsilon)), the procedure runs in time O(n)O(n), and we can take any ε2ct\varepsilon\geq 2^{-c\cdot\ell_{t}} for some constant cc that depends on ζ\zeta and δ\delta.

Proof.

For i[t]i\in[t], let mi=j=1iim_{i}=\sum_{j=1}^{i}\ell_{i}, recalling that i=αi11\ell_{i}=\alpha^{i-1}\ell_{1}. For each i[t]i\in[t], let Γi:{0,1}di[Δi]i\Gamma_{i}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d_{i}}\rightarrow[\Delta_{i}]^{\ell_{i}} be the (γ,εΓ)(\gamma,\varepsilon_{\Gamma}) be the distinct-samplers sampler of Lemma 2.21, where γ=ε2t\gamma=\frac{\varepsilon}{2t} and εΓ=1log(6ζδ)ζδ6=O(1)\varepsilon_{\Gamma}=\frac{1}{\log(\frac{6}{\zeta\delta})}\cdot\frac{\zeta\delta}{6}=O(1). We need to make sure that each iclog(1/γ)εΓ2\ell_{i}\geq c\cdot\frac{\log(1/\gamma)}{\varepsilon^{2}_{\Gamma}} for some universal constant cc, and indeed that is the case, by our constraint on t\ell_{t}. Also, di=log(Δi/i)+O(log1γpoly(1/εΓ))d_{i}=\log(\Delta_{i}/\ell_{i})+O(\log\frac{1}{\gamma}\cdot\operatorname{poly}(1/\varepsilon_{\Gamma})) and we set d𝗌𝖺𝗆𝗉d_{\mathsf{samp}} to be the maximal over the did_{i}-s, so

d𝗌𝖺𝗆𝗉=dt=logΔt1+tlog1α+O(logtε).d_{\mathsf{samp}}=d_{t}=\log\frac{\Delta_{t}}{\ell_{1}}+t\cdot\log\frac{1}{\alpha}+O\mathopen{}\mathclose{{}\left(\log\frac{t}{\varepsilon}}\right).

We denote the corresponding samples by Wi=Γi(Y|[1,di])W_{i}=\Gamma_{i}(Y|_{[1,d_{i}]}), and let Si=Zi|WiS_{i}=Z_{i}|_{W_{i}}. Setting εi=2(ζ/2)δΔi\varepsilon_{i}^{\prime}=2^{-(\zeta/2)\delta\Delta_{i}} and observing that δΔi=(1ζ2)δΔi+log(1/εi)\delta\Delta_{i}=(1-\frac{\zeta}{2})\delta\Delta_{i}+\log(1/\varepsilon^{\prime}_{i}), we get that ZZ is ε=iεi\varepsilon^{\prime}=\sum_{i}\varepsilon^{\prime}_{i} close to some ZZ^{\prime}, an exact ((Δ1,,Δt),(1ζ)δ)((\Delta_{1},\ldots,\Delta_{t}),(1-\zeta)\delta)-source. From here onwards, assume that ZZ is the exact block source, and aggregate the error.

Next, we invoke Lemma 2.16 with τ=ζδ6\tau=\frac{\zeta\delta}{6} (notice that indeed εΓτlog(1/τ)\varepsilon_{\Gamma}\leq\frac{\tau}{\log(1/\tau)}), and get that for every i[t]i\in[t], and z𝗉𝗋𝖾{0,1}Δ1++Δi1z_{\mathsf{pre}}\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{\Delta_{1}+\ldots+\Delta_{i-1}},

Si{(Z1,,Zi1)=z𝗉𝗋𝖾}S_{i}\mid\mathopen{}\mathclose{{}\left\{{(Z_{1},\ldots,Z_{i-1})=z_{\mathsf{pre}}}}\right\}

is εi′′=γ+2Ω(τΔi)\varepsilon^{\prime\prime}_{i}=\gamma+2^{-\Omega(\tau\Delta_{i})}-close to having min-entropy (1ζ2)2δi(1ζ)δi(1-\frac{\zeta}{2})^{2}\delta\cdot\ell_{i}\geq(1-\zeta)\delta\cdot\ell_{i}. Thus, in particular, it holds if we condition on any sample from (S1,,Si1)(S_{1},\ldots,S_{i-1}), and so we have that for every i[t]i\in[t],

(S1,,Si1,Si)εi′′(S1,,Si1,Si),\mathopen{}\mathclose{{}\left(S_{1},\ldots,S_{i-1},S_{i}}\right)\approx_{\varepsilon^{\prime\prime}_{i}}\mathopen{}\mathclose{{}\left(S_{1},\ldots,S_{i-1},S^{\prime}_{i}}\right),

where SiS^{\prime}_{i} has (1ζ)δ(1-\zeta)\delta entropy rate. This means171717In what follows, we use the fact that we can couple any two XεXX\approx_{\varepsilon}X^{\prime} with (X,Y)ε(X,Y)(X,Y)\approx_{\varepsilon}(X^{\prime},Y), for any joint distribution (X,Y)(X,Y). See, e.g., [Li15, Lemma 3.20]. that (S1,,St)(S_{1},\ldots,S_{t}) has distance

ε+i=1tεi′′t(ε1+ε1′′)ε\varepsilon^{\prime}+\sum_{i=1}^{t}\varepsilon_{i}^{\prime\prime}\leq t\cdot(\varepsilon^{\prime}_{1}+\varepsilon^{\prime\prime}_{1})\leq\varepsilon

from an ((1,,t),(1ζ)δ)((\ell_{1},\ldots,\ell_{t}),(1-\zeta)\delta) block source, where we used the fact that the 2Ω(τΔ1)2^{-\Omega(\tau\Delta_{1})} and 2(ζ/2)δΔ12^{-(\zeta/2)\delta\Delta_{1}} terms are at most ε4t\frac{\varepsilon}{4t}, which follows from the fact that c1log(t/ε)Δ1c_{1}\log(t/\varepsilon)\leq\Delta_{1} for a suitable choice of c1c_{1}.

To establish the runtime, note that we simply apply Γi\Gamma_{i} for each i[t]i\in[t], which takes

i=1tipolylog(Δi)=polylog(Δt)1\sum_{i=1}^{t}\ell_{i}\cdot\operatorname{polylog}(\Delta_{i})=\operatorname{polylog}(\Delta_{t})\cdot\ell_{1}

time. This concludes our lemma. ∎

5.1.3 Item 4: Applying a block source extractor

We now wish to extract from our decreasing-blocks block source, and for that we combine Lemmas 5.3 and 5.2 with the block source extraction of Lemma 2.23, which will give us a nearly linear-time logarithmic-seed extractor that outputs nΩ(1)n^{\Omega(1)} bits. For the 𝖤𝗑𝗍i\mathsf{Ext}_{i}-s in Lemma 2.23, we will use the fast hash-based extractors from Lemma 2.14.

Lemma 5.4.

There exists a small constant c>0c>0 such that the following holds. For every large enough nn, any constant δ(0,1)\delta\in(0,1), any kδnk\geq\delta n, and any ε2nc\varepsilon\geq 2^{-n^{c}}, there exists a (k,ε)(k,\varepsilon) extractor

𝖤𝗑𝗍𝗌𝗁𝗈𝗋𝗍:{0,1}n×{0,1}d{0,1}m\mathsf{Ext}_{\mathsf{short}}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}\rightarrow\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m}

where d=O(log(n/ε))d=O(\log(n/\varepsilon)), and m=ncm=n^{c}. Moreover, given inputs x{0,1}nx\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n} and y{0,1}dy\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}, we can compute 𝖤𝗑𝗍𝗌𝗁𝗈𝗋𝗍(x,y)\mathsf{Ext}_{\mathsf{short}}(x,y) in time O~(n)\widetilde{O}(n).

Proof.

Let XX be an (n,k=δn)(n,k=\delta n)-source. Set ε=ε/3\varepsilon^{\prime}=\varepsilon/3, θ1=8/10\theta_{1}=8/10, θ2=9/10\theta_{2}=9/10, and ζ=1/10\zeta=1/10. We first apply Lemma 5.2 with Δt=nθ2\Delta_{t}=n^{\theta_{2}}, Δ1=nθ1\Delta_{1}=n^{\theta_{1}}, and error ε\varepsilon^{\prime}, where t=O(logn)t=O(\log n) is as guaranteed from the lemma’s statement. This requires a seed of length d1=O(log(1/ε))=O(log(1/ε))d_{1}=O(\log(1/\varepsilon^{\prime}))=O(\log(1/\varepsilon)), and in time O~(n)\widetilde{O}(n) we output a random variable Z1Z_{1} which is ε\varepsilon^{\prime}-close to a ((Δ1,,Δt),(1ζ)δ)((\Delta_{1},\ldots,\Delta_{t}),(1-\zeta)\delta) block source. Assume that Z1Z_{1} is exactly a block source, and aggregate the error.

Set β=7/10\beta=7/10, and γ=6/10<β\gamma=6/10<\beta. Set α\alpha to be the constant such that nβαt1=nγn^{\beta}\cdot\alpha^{t-1}=n^{\gamma}. We then apply Lemma 5.3 on Z1Z_{1} with that α\alpha, the same ζ\zeta, closeness ε\varepsilon^{\prime} and an initial block length 1=nβ\ell_{1}=n^{\beta}.This gives us a random variable Z2Z_{2} that is 2ε2\varepsilon^{\prime}-close to a

((1=nβ,,t=nγ),δ(1ζ)2δ)\mathopen{}\mathclose{{}\left((\ell_{1}=n^{\beta},\ldots,\ell_{t}=n^{\gamma}),\delta^{\prime}\triangleq(1-\zeta)^{2}\delta}\right)

block source, requires a seed of length d2=O(log(n/ε))=O(log(n/ε))d_{2}=O(\log(n/\varepsilon^{\prime}))=O(\log(n/\varepsilon)), and runs in time O(n)O(n). Again, assume that Z2Z_{2} is exactly a block source, and aggregate the error.

For our next and final step, set d3=c𝖤log(t/ε𝖤𝗑𝗍)d_{3}=c_{\mathsf{E}}\log(\ell_{t}/\varepsilon_{\mathsf{Ext}}) where c𝖤c_{\mathsf{E}} is the constant guaranteed by Lemma 2.14. Also, let ε𝖤𝗑𝗍=ε6t\varepsilon_{\mathsf{Ext}}=\frac{\varepsilon^{\prime}}{6t}, and θ\theta will be a constant whose value will be later determined. We will use the following extractors:

  • Let 𝖤𝗑𝗍t:{0,1}t×{0,1}d3{0,1}mt=(1+θ)d3\mathsf{Ext}_{t}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{\ell_{t}}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d_{3}}\rightarrow\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m_{t}=(1+\theta)d_{3}} be the (kt=(δ/2)t,ε𝖤𝗑𝗍)(k_{t}=(\delta^{\prime}/2)\ell_{t},\varepsilon_{\mathsf{Ext}}) extractor guaranteed to us by Lemma 2.14. Notice that we need to satisfy ktθd3+c𝖤log(1/ε𝖤𝗑𝗍)k_{t}\geq\theta d_{3}+c_{\mathsf{E}}\log(1/\varepsilon_{\mathsf{Ext}}). Looking forward, we will also need that (δ/2)tδtlog(1/ε𝖤𝗑𝗍)(\delta^{\prime}/2)\ell_{t}\leq\delta^{\prime}\ell_{t}-\log(1/\varepsilon_{\mathsf{Ext}}). Those constraints can be satisfied making sure that ε\varepsilon is at most 2Ω(t)2^{-\Omega(\ell_{t})}, where the hidden constant depends on c𝖤c_{\mathsf{E}}.

  • For each i[t1]i\in[t-1], let

    𝖤𝗑𝗍i:{0,1}i×{0,1}mi+1{0,1}mi\mathsf{Ext}_{i}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{\ell_{i}}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m_{i+1}}\rightarrow\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m_{i}}

    be the (ki=(δ/2)i,ε𝖤𝗑𝗍)(k_{i}=(\delta^{\prime}/2)\ell_{i},\varepsilon_{\mathsf{Ext}}) extractor guaranteed to us by Lemma 2.14, where mi=(1+θ)mi+1m_{i}=(1+\theta)m_{i+1}. We need to make sure that mi+1c𝖤log(i/ε𝖤𝗑𝗍)m_{i+1}\geq c_{\mathsf{E}}\log(\ell_{i}/\varepsilon_{\mathsf{Ext}}) and that kiθmi+1+c𝖤log(1/ε𝖤𝗑𝗍)k_{i}\geq\theta m_{i+1}+c_{\mathsf{E}}\log(1/\varepsilon_{\mathsf{Ext}}). To see that the latter holds, note that ki=(δ/2)1αi1nγ/2k_{i}=(\delta^{\prime}/2)\ell_{1}\cdot\alpha^{i-1}\geq n^{\gamma/2} and that θmi+1+c𝖤log(1/ε𝖤𝗑𝗍)=θ(1+θ)tid3+c𝖤log(1/ε𝖤𝗑𝗍)<nγ/2,\theta m_{i+1}+c_{\mathsf{E}}\log(1/\varepsilon_{\mathsf{Ext}})=\theta(1+\theta)^{t-i}d_{3}+c_{\mathsf{E}}\log(1/\varepsilon_{\mathsf{Ext}})<n^{\gamma/2}, if we choose θ\theta to be a small enough constant (with respect to the constant lognt\frac{\log n}{t}) and ε\varepsilon to be, again, at most 2Ω(t)2^{-\Omega(\ell_{t})}. Also, here too, record that (δ/2)iδilog(1/ε𝖤𝗑𝗍)(\delta^{\prime}/2)\ell_{i}\leq\delta^{\prime}\ell_{i}-\log(1/\varepsilon_{\mathsf{Ext}}), which follows easily, since the i\ell_{i}-s increase.

Everything is in place to apply our block source extraction, Lemma 2.23, on Z2Z_{2} and an independent and uniform seed of length d3d_{3}.181818Note that here, we use Lemma 2.23 with ni=(1+θ)in1n_{i}=(1+\theta)^{-i}n_{1} and kiθnilog(1/εi)k_{i}\geq\theta n_{i}-\log(1/\varepsilon_{i}). The slack in entropy is needed since we work with the notion of block sources that also allows average conditional min-entropy. We can thus use the fact that under such setting of parameters, every extractor is an average case extractor with only a slight loss in parameters (see, e.g., [DORS08]). We omit the easy proof. We get that 𝖡𝖲𝖤𝗑𝗍\mathsf{BSExt} outputs Z3Z_{3} of length m1=nΩ(1)m_{1}=n^{\Omega(1)}, which is 2tε𝖤𝗑𝗍ε2t\varepsilon_{\mathsf{Ext}}\leq\varepsilon^{\prime} close to uniform, and runs in time O(i=1tilogi)=O(n).O\mathopen{}\mathclose{{}\left(\sum_{i=1}^{t}\ell_{i}\log\ell_{i}}\right)=O(n).

To conclude, note that the overall error of our extractor is at most 3ε=ε3\varepsilon^{\prime}=\varepsilon, and the seed length is d1+d2+d3=O(log(n/ε))d_{1}+d_{2}+d_{3}=O(\log(n/\varepsilon)). ∎

5.1.4 Improving the output length

The extractor 𝖤𝗑𝗍𝗌𝗁𝗈𝗋𝗍\mathsf{Ext}_{\mathsf{short}} from Lemma 5.4 only outputs nΩ(1)n^{\Omega(1)} bits. Here, we will use an extractor 𝖤𝗑𝗍𝖺𝗎𝗑\mathsf{Ext}_{\mathsf{aux}} that outputs a linear fraction of the entropy but requires a (relatively) long seed, and use Lemma 2.26 to boost the output length. For 𝖤𝗑𝗍𝖺𝗎𝗑\mathsf{Ext}_{\mathsf{aux}}, we will again use a sample-then-extract extractor, however this time, we can use independent samples to create a block source with exponentially decreasing blocks. This setting is easier, and we can simply use the original [NZ96] construction. Since a similar construction will be analyzed later in the paper (including a time complexity analysis), we choose to employ it instead of revisiting [NZ96].

Corollary 5.5.

There exist constants τ,c(0,1)\tau,c\in(0,1) and C>1C>1, such that for every positive integer nn, and any ε2nc\varepsilon\geq 2^{-n^{c}}, there exists a strong (k=(1τ)n,ε)(k=(1-\tau)n,\varepsilon) extractor

𝖤𝗑𝗍𝗈𝗎𝗍:{0,1}n×{0,1}d{0,1}m\mathsf{Ext}_{\mathsf{out}}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}\rightarrow\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m}

where d=O(lognlog(n/ε))d=O(\log n\cdot\log(n/\varepsilon)), and m=ckClog(1/ε)m=ck-C\log(1/\varepsilon). Moreover, given inputs x{0,1}nx\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n} and y{0,1}dy\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}, we can compute 𝖤𝗑𝗍𝗈𝗎𝗍(x,y)\mathsf{Ext}_{\mathsf{out}}(x,y) in time O~(n)\widetilde{O}(n).

The correctness follows from Lemma 5.9 (without the need for a preliminary condensing step), employed with the hash functions of Lemma 2.14.

Plugging-in 𝖤𝗑𝗍𝗈𝗎𝗍\mathsf{Ext}_{\mathsf{out}} and 𝖤𝗑𝗍𝗌𝗁𝗈𝗋𝗍\mathsf{Ext}_{\mathsf{short}} into Lemma 2.26 readily gives the following result.

Lemma 5.6.

There exist constants τ,c(0,1)\tau,c\in(0,1) such that for every positive integer nn, and any ε2nc\varepsilon\geq 2^{-n^{c}}, there exists a (k=(1τ)n,ε)(k=(1-\tau)n,\varepsilon) extractor 𝖤𝗑𝗍:{0,1}n×{0,1}d{0,1}m\mathsf{Ext}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}\rightarrow\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m} where d=O(log(n/ε))d=O(\log(n/\varepsilon)), and m=ckm=ck. Moreover, given inputs x{0,1}nx\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n} and y{0,1}dy\in\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}, we can compute 𝖤𝗑𝗍(x,y)\mathsf{Ext}(x,y) in time O~(n)\widetilde{O}(n).

To boost the output length from Ω(k)\Omega(k) to (1η)k(1-\eta)k for any constant η>0\eta>0, we apply Lemma 2.22 a constant number of times depending only on η\eta (that is, we simply apply 𝖤𝗑𝗍\mathsf{Ext} with independent seeds and concatenate the outputs). To go from any min-entropy kk to entropy rate 1τ1-\tau, we first apply a condenser, either the one from Theorem 3.10 or the one from Theorem 3.11. Specifically, when kClog2(n/ε)k\geq C\log^{2}(n/\varepsilon), we can use Theorem 3.10 which takes O~(n)\widetilde{O}(n) time. When kk is smaller, we can use Theorem 3.11, but this requires an extra preprocessing time which takes T𝗉𝗋𝖾=polylog(1/ε)T_{\mathsf{pre}}=\operatorname{polylog}(1/\varepsilon) times. Note that the bound on ε\varepsilon from Lemma 5.6 translates to ε2kc\varepsilon\geq 2^{-k^{c}}, so we can (if needed) modify cc so that T𝗉𝗋𝖾=O(n)T_{\mathsf{pre}}=O(n). This finally gives us our main theorem for this section, Theorem 5.1, apart from the strongness property, which we now discuss.

The non-recursive construction is strong.

In what follows, we refer to the itemized list in the beginning of the section. The condensing step, Item 1, is strong, since we use strong condensers. Next, inspecting the proofs of Lemmas 5.2 and 5.3, we see that both samplings procedures yield a good sample with high probability over the fixing of the seed, so Items 2 and 3 hold in a strong manner as well. Item 4 follows by applying a block source extractor, which is strong since the extraction steps output the seed. Thus, the extractor 𝖤𝗑𝗍𝗌𝗁𝗈𝗋𝗍\mathsf{Ext}_{\mathsf{short}} from Lemma 5.4 is in fact strong. For the output-extending phase, Lemma 2.26 readily tells us that the extractor from Lemma 5.6 is strong. Finally, we apply that extractor several times with independent seeds, and the strongness of that procedure is guaranteed from Lemma 2.22.

5.2 A Recursive Construction

In this section, we prove the following.

Theorem 5.7 (recursive construction).

For any constant η>0\eta>0 there exists a constant C>0C>0 such that the following holds. For any positive integers nn, knk\leq n, and any ε>0\varepsilon>0 such that kClog(n/ε)k\geq C\log(n/\varepsilon) there exists a strong (k,ε)(k,\varepsilon)-seeded extractor

𝖤𝗑𝗍:{0,1}n×{0,1}d{0,1}m\mathsf{Ext}\colon\{0,1\}^{n}\times\{0,1\}^{d}\to\{0,1\}^{m}

with seed length dClog(n/ε)d\leq C\log(n/\varepsilon) and output length m(1η)km\geq(1-\eta)k. Furthermore,

  • if k2Clognlog2(n/ε)k\geq 2^{C\log^{*}\!n}\cdot\log^{2}(n/\varepsilon), then 𝖤𝗑𝗍\mathsf{Ext} is computable in time O~(n)\widetilde{O}(n);

  • if k<2Clognlog2(n/ε)k<2^{C\log^{*}\!n}\cdot\log^{2}(n/\varepsilon), then 𝖤𝗑𝗍\mathsf{Ext} is computable in time O~(n)\widetilde{O}(n) after a preprocessing step that corresponds to finding primitive elements of O(loglogn)O(\log\log n) fields 𝔽q\mathds{F}_{q} with orders qpoly(n/ε)q\leq\operatorname{poly}(n/\varepsilon) powers of 22.

In a nutshell, our construction behind Theorem 5.7 works by considering two cases. If ε>Cn32k/logk\varepsilon>Cn^{3}\cdot 2^{-k/\log k}, then we instantiate the recursive approach of Srinivasan and Zuckerman [SZ99] appropriately. Otherwise, we apply the recursive approach of Guruswami, Umans, and Vadhan [GUV09].

5.2.1 The (extremely) low-error case

In this section, we consider the lower error case of Theorem 5.7 where εCn32k/logk\varepsilon\leq Cn^{3}\cdot 2^{-k/\log k}. We instantiate the recursive approach from [GUV09, Section 4.3.3] appropriately, and analyze its time complexity. Crucially, because of our upper bound on ε\varepsilon, we will only need to run O(loglogn)O(\log\log n) levels of their recursive approach.

In order to obtain the statement of Theorem 5.7 for output length m(1η)km\geq(1-\eta)k with η\eta an arbitrarily small constant, it suffices to achieve output length m=Ω(k)m=\Omega(k) and then apply Lemma 2.22 a constant number of times depending only on η\eta. Therefore, we focus on achieving output length m=Ω(k)m=\Omega(k).

Theorem 5.8.

There exist constants c,C>0c,C>0 such that the following holds. For any positive integers nn and knk\leq n and any ε(0,Cn32k/logk]\varepsilon\in(0,Cn^{3}\cdot 2^{-k/\log k}] further satisfying k>Clog(n/ε)k>C\log(n/\varepsilon), there exists a strong (k,ε)(k,\varepsilon)-seeded extractor 𝖤𝗑𝗍:{0,1}n×{0,1}d{0,1}m\mathsf{Ext}\colon\{0,1\}^{n}\times\{0,1\}^{d}\to\{0,1\}^{m} with seed length dClog(n/ε)d\leq C\log(n/\varepsilon) and output length mk/3m\geq k/3.

Furthermore, 𝖤𝗑𝗍\mathsf{Ext} is computable in time O~(n)\widetilde{O}(n) after a preprocessing step that corresponds to finding primitive elements of O(loglogn)O(\log\log n) fields 𝔽q\mathds{F}_{q} with orders qpoly(n/ε)q\leq\operatorname{poly}(n/\varepsilon), each a power of 22.

Proof.

We discuss our instantiation of the recursive approach from [GUV09] in detail, as it will be relevant to the time complexity analysis. Let ε0=ε/logCn\varepsilon_{0}=\varepsilon/\log^{C}n and d=Clog(n/ε0)=O(log(n/ε))d=C\log(n/\varepsilon_{0})=O(\log(n/\varepsilon)) for a large enough constant C>0C>0 to be determined later. For an integer k0k\geq 0, let i(k)=log(k8d)i(k)=\mathopen{}\mathclose{{}\left\lceil\log\mathopen{}\mathclose{{}\left(\frac{k}{8d}}\right)}\right\rceil, which determines the number of levels in our recursion. It will be important for bounding the time complexity of this construction to observe that

i(k)=O(loglogn)i(k)=O(\log\log n) (2)

because εCn32k/logk\varepsilon\leq Cn^{3}\cdot 2^{-k/\log k}. For each kk, we define a family of strong (k,εi(k))(k,\varepsilon_{i(k)})-seeded extractors 𝖤𝗑𝗍i(k):{0,1}n×{0,1}d{0,1}m\mathsf{Ext}_{i(k)}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}\to\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m} with εi(k)9εi(k/3)+63ε0\varepsilon_{i(k)}\leq 9\varepsilon_{i(k/3)}+63\varepsilon_{0} when i(k)>0i(k)>0 by induction on i(k)i(k). Solving this recursion yields εi(k)=2O(i(k))ε0ε\varepsilon_{i(k)}=2^{O(i(k))}\cdot\varepsilon_{0}\leq\varepsilon, provided that ε0=ε/logCn\varepsilon_{0}=\varepsilon/\log^{C}n for a sufficiently large constant C>0C>0.

Base case.

For the base case i(k)=0i(k)=0, which holds when k8dk\leq 8d, we choose 𝖤𝗑𝗍0\mathsf{Ext}_{0} to be the (k,ε0)(k,\varepsilon_{0})-seeded extractor defined as follows. On input an (n,k)(n,k)-source XX,

  1. 1.

    Apply the lossy RS strong condenser 𝖱𝖲𝖢𝗈𝗇𝖽\mathsf{RSCond} (Theorem 3.11) on XX, instantiated with α=1/400\alpha=1/400 and error ε0=ε0/2\varepsilon^{\prime}_{0}=\varepsilon_{0}/2. When CC is large enough we have k(2+α)log(1/ε0)k\geq(2+\alpha)\log(1/\varepsilon^{\prime}_{0}), and require a seed Y1Y_{1} of length d1C0log(n/ε0)d_{1}\leq C_{0}\log(n/\varepsilon^{\prime}_{0}), for some constant C0>0C_{0}>0. The corresponding output XX^{\prime} satisfies Y1Xε0Y1ZY_{1}\circ X^{\prime}\approx_{\varepsilon^{\prime}_{0}}Y_{1}\circ Z, for some (n,k)(n^{\prime},k^{\prime})-source ZZ with k(12α)n=(11/200)nk^{\prime}\geq(1-2\alpha)n^{\prime}=(1-1/200)n^{\prime}.

  2. 2.

    Let 𝖤𝗑𝗍0:{0,1}n×{0,1}d2{0,1}m\mathsf{Ext}^{\prime}_{0}\colon\{0,1\}^{n^{\prime}}\times\{0,1\}^{d_{2}}\to\{0,1\}^{m^{\prime}} be the average-case strong (k,ε0)(k^{\prime},\varepsilon^{\prime}_{0})-seeded extractor from Lemma 2.25 instantiated with t=10t=10, which requires a seed Y2Y_{2} of length d2k/10+C0log(n/ε0)d_{2}\leq k^{\prime}/10+C^{\prime}_{0}\log(n^{\prime}/\varepsilon^{\prime}_{0}) for some constant C0>0C^{\prime}_{0}>0 and has output length mk/2m^{\prime}\geq k^{\prime}/2. The conditions for the invocation of Lemma 2.25 with t=10t=10 are satisfied since k(11/200)n=(1120t)nk^{\prime}\geq(1-1/200)n^{\prime}=(1-\frac{1}{20t})n^{\prime} and

    2n/5002k/500(ε0/n)C/500ε0,2^{-n^{\prime}/500}\leq 2^{-k/500}\leq(\varepsilon_{0}/n)^{C/500}\leq\varepsilon^{\prime}_{0},

    where the second inequality uses the theorem’s hypothesis that kClog(n/ε)k\geq C\log(n/\varepsilon) with C>0C>0 a sufficiently large constant.

We set Y=Y1Y2Y=Y_{1}\circ Y_{2} and define 𝖤𝗑𝗍0(X,Y)=𝖤𝗑𝗍0(𝖱𝖲𝖢𝗈𝗇𝖽(X,Y1),Y2)\mathsf{Ext}_{0}(X,Y)=\mathsf{Ext}^{\prime}_{0}(\mathsf{RSCond}(X,Y_{1}),Y_{2}). From the discussion above, we have

Y𝖤𝗑𝗍0(X,Y)=Y1Y2𝖤𝗑𝗍0(𝖱𝖲𝖢𝗈𝗇𝖽(X,Y1),Y2)ε0Y1Y2𝖤𝗑𝗍0(Z,Y2)ε0Y1Y2Um.Y\circ\mathsf{Ext}_{0}(X,Y)=Y_{1}\circ Y_{2}\circ\mathsf{Ext}^{\prime}_{0}(\mathsf{RSCond}(X,Y_{1}),Y_{2})\approx_{\varepsilon^{\prime}_{0}}Y_{1}\circ Y_{2}\circ\mathsf{Ext}^{\prime}_{0}(Z,Y_{2})\approx_{\varepsilon^{\prime}_{0}}Y_{1}\circ Y_{2}\circ U_{m^{\prime}}.

Therefore, the triangle inequality implies that 𝖤𝗑𝗍0\mathsf{Ext}_{0} is an average-case strong (k,2ε0=ε0)(k,2\varepsilon^{\prime}_{0}=\varepsilon_{0})-seeded extractor. It remains to argue about the seed length, output length, and time complexity of 𝖤𝗑𝗍0\mathsf{Ext}_{0}. The seed length of 𝖤𝗑𝗍0\mathsf{Ext}_{0} is

d1+d2k/10+(C0+C0)log(n/ε0)0.8d+(C0+C0)log(n/ε0)d,d_{1}+d_{2}\leq k^{\prime}/10+(C_{0}+C^{\prime}_{0})\log(n^{\prime}/\varepsilon^{\prime}_{0})\leq 0.8d+(C_{0}+C^{\prime}_{0})\log(n^{\prime}/\varepsilon^{\prime}_{0})\leq d,

provided that d=Clog(n/ε)d=C\log(n/\varepsilon) with CC a sufficiently large constant. The output length of 𝖤𝗑𝗍0\mathsf{Ext}_{0} is mk/2k/3m^{\prime}\geq k^{\prime}/2\geq k/3, since k(11/200)kk^{\prime}\geq(1-1/200)k. Finally, both steps above take time O~(n)\widetilde{O}(n), and so 𝖤𝗑𝗍0\mathsf{Ext}_{0} can be computed in time O~(n)\widetilde{O}(n) after a polylog(1/ε)\operatorname{polylog}(1/\varepsilon) preprocessing step.

Induction step.

When i(k)>0i(k)>0, we assume the existence of the desired average-case strong extractors 𝖤𝗑𝗍i(k)\mathsf{Ext}_{i(k^{\prime})} for all i(k)<i(k)i(k^{\prime})<i(k) as the induction hypothesis. More precisely, we assume that for all kk^{\prime} such that i(k)<i(k)i(k^{\prime})<i(k) there exists a family of average-case strong (k,εi(k))(k^{\prime},\varepsilon_{i(k^{\prime})})-seeded extractors 𝖤𝗑𝗍i(k):{0,1}n×{0,1}d{0,1}k/3\mathsf{Ext}_{i(k^{\prime})}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d}\to\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{k^{\prime}/3} parameterized by nn computable in time O~(n)\widetilde{O}(n) after a one-time preprocessing step. We proceed as follows on input an (n,k)(n,k)-source XX:

  1. 1.

    Apply the lossy RS strong (k,k,ε1=ε02)(k,k^{\prime},\varepsilon_{1}=\varepsilon_{0}^{2})-condenser 𝖱𝖲𝖢𝗈𝗇𝖽\mathsf{RSCond} (Theorem 3.11) on XX with α=1/20\alpha=1/20 and a seed Y𝖱𝖲Y_{\mathsf{RS}} of length d𝖱𝖲C𝖱𝖲log(n/ε0)d_{\mathsf{RS}}\leq C_{\mathsf{RS}}\log(n/\varepsilon_{0}). Since k>8dlog(1/ε1)α(1+2α)k>8d\geq\frac{\log(1/\varepsilon_{1})}{\alpha(1+2\alpha)} if CC is a large enough constant, by the second part of Theorem 3.11 we know that with probability at least 1ε01-\varepsilon_{0} over the choice of Y𝖱𝖲=yY_{\mathsf{RS}}=y it holds that the corresponding condenser output XX^{\prime} is ε0\varepsilon_{0}-close to some (n,k)(n^{\prime},k^{\prime})-source ZZ with k(12α)n=0.9nk^{\prime}\geq(1-2\alpha)n^{\prime}=0.9n^{\prime}. For the sake of exposition, from here onwards we work under such a good choice of the seed Y𝖱𝖲Y_{\mathsf{RS}}, and we will add the ε0\varepsilon_{0} slack term to the final error.

  2. 2.

    Split X=X1X2X^{\prime}=X^{\prime}_{1}\circ X^{\prime}_{2} with |X1|=|X2|=n/2n′′|X^{\prime}_{1}|=|X^{\prime}_{2}|=n^{\prime}/2\triangleq n^{\prime\prime}. By Lemma 2.24 instantiated with nn^{\prime} and Δ=0.1n\Delta=0.1n^{\prime} and the fact that XX^{\prime} is ε0\varepsilon_{0}-close to an (n,k)(n^{\prime},k^{\prime})-source, we get that X1X2X^{\prime}_{1}\circ X^{\prime}_{2} is (ε𝖱𝖲+2ε0=3ε0)(\varepsilon_{\mathsf{RS}}+2\varepsilon_{0}=3\varepsilon_{0})-close to an ((n′′,n′′),k′′/n′′)((n^{\prime\prime},n^{\prime\prime}),k^{\prime\prime}/n^{\prime\prime})-block-source W1W2W_{1}\circ W_{2} with

    k′′k/2Δlog(1/ε0)0.4nlog(1/ε0)k/3,k^{\prime\prime}\geq k^{\prime}/2-\Delta-\log(1/\varepsilon_{0})\geq 0.4n^{\prime}-\log(1/\varepsilon_{0})\geq k/3, (3)

    since nk>d=Clog(n/ε0)n^{\prime}\geq k>d=C\log(n/\varepsilon_{0}) for a sufficiently large constant C>0C>0.

  3. 3.

    Apply the lossy RS strong (k′′,k′′′,ε1=ε02)(k^{\prime\prime},k^{\prime\prime\prime},\varepsilon_{1}=\varepsilon_{0}^{2})-condenser 𝖱𝖲𝖢𝗈𝗇𝖽\mathsf{RSCond}^{\prime} (Theorem 3.11) to X2X^{\prime}_{2} with α=1/800\alpha=1/800 and a seed Y𝖱𝖲Y^{\prime}_{\mathsf{RS}} of length at most d𝖱𝖲=C𝖱𝖲log(n′′/ε1)C𝖱𝖲log(n/ε0)d^{\prime}_{\mathsf{RS}}=C^{\prime}_{\mathsf{RS}}\log(n^{\prime\prime}/\varepsilon_{1})\leq C^{\prime}_{\mathsf{RS}}\log(n/\varepsilon_{0}). From Item 2 and the data-processing inequality, we know that

    Y𝖱𝖲X1X2′′=Y𝖱𝖲X1𝖱𝖲𝖢𝗈𝗇𝖽(X2,Y𝖱𝖲)3ε0Y𝖱𝖲W1𝖱𝖲𝖢𝗈𝗇𝖽(W2,Y𝖱𝖲).Y^{\prime}_{\mathsf{RS}}\circ X^{\prime}_{1}\circ X^{\prime\prime}_{2}=Y^{\prime}_{\mathsf{RS}}\circ X^{\prime}_{1}\circ\mathsf{RSCond}(X^{\prime}_{2},Y^{\prime}_{\mathsf{RS}})\approx_{3\varepsilon_{0}}Y^{\prime}_{\mathsf{RS}}\circ W_{1}\circ\mathsf{RSCond}(W_{2},Y^{\prime}_{\mathsf{RS}}). (4)

    Since (W2|W1=w1)(W_{2}|W_{1}=w_{1}) is a k′′k^{\prime\prime}-source for any w1w_{1} in the support of W1W_{1}, we conclude from Theorem 3.11 and Equation 4 that

    Y𝖱𝖲W1𝖱𝖲𝖢𝗈𝗇𝖽(W2,Y𝖱𝖲)ε1Y𝖱𝖲W1W2~,Y^{\prime}_{\mathsf{RS}}\circ W_{1}\circ\mathsf{RSCond}(W_{2},Y^{\prime}_{\mathsf{RS}})\approx_{\varepsilon_{1}}Y^{\prime}_{\mathsf{RS}}\circ W_{1}\circ\widetilde{W_{2}},

    where W2~{0,1}n′′′\widetilde{W_{2}}\sim\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n^{\prime\prime\prime}} and 𝐇(Y𝖱𝖲W2~|W1=w1)k′′′+d𝖱𝖲\mathbf{H}_{\infty}(Y^{\prime}_{\mathsf{RS}}\circ\widetilde{W_{2}}|W_{1}=w_{1})\geq k^{\prime\prime\prime}+d^{\prime}_{\mathsf{RS}} for all w1w_{1} in the support of W1W_{1}, with n′′′k′′k′′′(11/400)n′′′n^{\prime\prime\prime}\geq k^{\prime\prime}\geq k^{\prime\prime\prime}\geq(1-1/400)n^{\prime\prime\prime}. This is a valid invocation since k′′k/3>8d/3>dlog(1/ε1)α(1+2α)k^{\prime\prime}\geq k/3>8d/3>d\geq\frac{\log(1/\varepsilon_{1})}{\alpha(1+2\alpha)} by Equation 3. Therefore, by the second part of Theorem 3.11, with probability at least 1ε01-\varepsilon_{0} over the choice of of Y𝖱𝖲=yY^{\prime}_{\mathsf{RS}}=y^{\prime} we get that

    (W1W2~|Y𝖱𝖲=y)ε0W1W2,(W_{1}\circ\widetilde{W_{2}}|Y^{\prime}_{\mathsf{RS}}=y^{\prime})\approx_{\varepsilon_{0}}W_{1}\circ W^{\prime}_{2}, (5)

    where W2{0,1}n′′′W^{\prime}_{2}\sim\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n^{\prime\prime\prime}} satisfies 𝐇(W2|W1=w1)k′′′(11/400)n′′′\mathbf{H}_{\infty}(W^{\prime}_{2}|W_{1}=w_{1})\geq k^{\prime\prime\prime}\geq(1-1/400)n^{\prime\prime\prime}. Fix such a good fixing of Y𝖱𝖲Y^{\prime}_{\mathsf{RS}} from now onwards. As before, we will account for the probability ε0\varepsilon_{0} of fixing a bad seed in the final extractor error. Then, by combining Equations 4 and 5 we get that X1X2′′X^{\prime}_{1}\circ X^{\prime\prime}_{2} is (ε𝖡𝖲=4ε0)(\varepsilon_{\mathsf{BS}}=4\varepsilon_{0})-close to an ((n′′,n′′′),k′′,k′′′)((n^{\prime\prime},n^{\prime\prime\prime}),k^{\prime\prime},k^{\prime\prime\prime})-block source.

  4. 4.

    We will now apply block source extraction to X1X2′′X^{\prime}_{1}\circ X^{\prime\prime}_{2}, which we recall is (ε𝖡𝖲=4ε0)(\varepsilon_{\mathsf{BS}}=4\varepsilon_{0})-close to an ((n′′,n′′′),k′′,k′′′)((n^{\prime\prime},n^{\prime\prime\prime}),k^{\prime\prime},k^{\prime\prime\prime})-block source. We instantiate Lemma 2.23 with 𝖤𝗑𝗍2\mathsf{Ext}_{2} being the strong extractor from Lemma 2.25 with source input length n′′′n^{\prime\prime\prime}, min-entropy requirement k′′′k^{\prime\prime\prime}, error ε𝖡𝖤𝗑𝗍=ε0\varepsilon_{\mathsf{BExt}}=\varepsilon_{0}, output length dd, and t=16t=16. This requires a seed of length d𝖡𝖤𝗑𝗍d/16+C0log(n/ε0)d_{\mathsf{BExt}}\leq d/16+C^{\prime}_{0}\log(n/\varepsilon_{0}). This instantiation of Lemma 2.25 is valid since k′′′(11/400)n′′′>(1120t)n′′′k^{\prime\prime\prime}\geq(1-1/400)n^{\prime\prime\prime}>(1-\frac{1}{20t})n^{\prime\prime\prime} and

    k′′′0.95n′′′0.95k′′0.95k3>0.958d3>2d,k^{\prime\prime\prime}\geq 0.95n^{\prime\prime\prime}\geq 0.95k^{\prime\prime}\geq\frac{0.95k}{3}>\frac{0.95\cdot 8d}{3}>2d,

    where we used the fact that i(k)>0i(k)>0, and so k>8dk>8d. For 𝖤𝗑𝗍1\mathsf{Ext}_{1} we choose the average-case strong extractor 𝖤𝗑𝗍i(k/3)\mathsf{Ext}_{i(k/3)} (recall that k′′k/3k^{\prime\prime}\geq k/3 and note that i(k/3)<i(k)i(k/3)<i(k)) with input length n′′n^{\prime\prime}, entropy requirement k/3k/3, error εi(k/3)\varepsilon_{i(k/3)}, output length at least (k/3)/3=k/9(k/3)/3=k/9, and seed length dd guaranteed by the induction hypothesis above.

Items 1, 2, 3 and 4 above yield a strong seeded extractor 𝖤𝗑𝗍i(k):{0,1}n×{0,1}d{0,1}m\mathsf{Ext}^{\prime}_{i(k)}\colon\{0,1\}^{n}\times\{0,1\}^{d^{\prime}}\to\{0,1\}^{m^{\prime}} with min-entropy requirement kk, error ε=εi(k/3)+ε𝖡𝖤𝗑𝗍+ε𝖡𝖲+2ε0=εi(k/3)+7ε0\varepsilon^{\prime}=\varepsilon_{i(k/3)}+\varepsilon_{\mathsf{BExt}}+\varepsilon_{\mathsf{BS}}+2\varepsilon_{0}=\varepsilon_{i(k/3)}+7\varepsilon_{0} (where the 2ε02\varepsilon_{0} term comes from the two fixings of the seeds in the two condensing steps in Items 1 and 3), seed length

d=d𝖡𝖤𝗑𝗍+d𝖱𝖲+d𝖱𝖲d/16+Clog(n/ε0),d^{\prime}=d_{\mathsf{BExt}}+d^{\prime}_{\mathsf{RS}}+d_{\mathsf{RS}}\leq d/16+C^{\prime}\log(n/\varepsilon_{0}),

for some constant C>0C^{\prime}>0, and output length m=k/9m^{\prime}=k/9.

To conclude the definition of 𝖤𝗑𝗍i(k)\mathsf{Ext}_{i(k)}, we need to increase the output length of 𝖤𝗑𝗍i(k)\mathsf{Ext}^{\prime}_{i(k)} from k/9k/9 to k/3k/3. To that end, we use Lemma 2.22. Applying Lemma 2.22 once with 𝖤𝗑𝗍1=𝖤𝗑𝗍i(k1)\mathsf{Ext}_{1}=\mathsf{Ext}^{\prime}_{i(k_{1})} with k1=kk_{1}=k and 𝖤𝗑𝗍2=𝖤𝗑𝗍i(k2)\mathsf{Ext}_{2}=\mathsf{Ext}^{\prime}_{i(k_{2})} with k2=kk/91=8k/91k_{2}=k-k/9-1=8k/9-1 and g=1g=1 yields a strong (k,3ε)(k,3\varepsilon^{\prime})-seeded extractor 𝖤𝗑𝗍i(k)′′\mathsf{Ext}^{\prime\prime}_{i(k)} with output length (k1+k2)/9k(1(8/9)2)1(k_{1}+k_{2})/9\geq k(1-(8/9)^{2})-1 and seed length 2(d/16+Clog(n/ε0))=d/8+2Clog(n/ε0)2(d/16+C^{\prime}\log(n/\varepsilon_{0}))=d/8+2C^{\prime}\log(n/\varepsilon_{0}). Applying Lemma 2.22 again with 𝖤𝗑𝗍1=𝖤𝗑𝗍i(k1)′′\mathsf{Ext}_{1}=\mathsf{Ext}^{\prime\prime}_{i(k_{1})} for k1=kk_{1}=k and 𝖤𝗑𝗍2=𝖤𝗑𝗍i(k2)′′\mathsf{Ext}_{2}=\mathsf{Ext}^{\prime\prime}_{i(k_{2})} for k2=(8/9)2kk_{2}=(8/9)^{2}k and g=1g=1 yields a strong (k,9ε)(k,9\varepsilon^{\prime})-seeded extractor with output length mk(1(8/9)4)1k/3m\geq k(1-(8/9)^{4})-1\geq k/3 and seed length 2(d/8+2Clog(n/ε0))=d/4+4Clog(n/ε0)d2(d/8+2C^{\prime}\log(n/\varepsilon_{0}))=d/4+4C^{\prime}\log(n/\varepsilon_{0})\leq d, which we set as 𝖤𝗑𝗍i(k)\mathsf{Ext}_{i(k)}. This second invocation of Lemma 2.22 is also valid, since k2=(8/9)2k=k(k(1(8/9)2)1)1=k1m1gk_{2}=(8/9)^{2}k=k-(k(1-(8/9)^{2})-1)-1=k_{1}-m_{1}-g. Note that the error εi(k)=9ε=9εi(k/3)+63ε0\varepsilon_{i(k)}=9\varepsilon^{\prime}=9\varepsilon_{i(k/3)}+63\varepsilon_{0}, as desired.

Time complexity and final error.

It remains to analyze the time complexity and the overall error of the recursive procedure above. Evaluating 𝖤𝗑𝗍i(k)\mathsf{Ext}_{i(k)} requires at most eight evaluations of the condenser from Theorem 3.11, four evaluations of the fast hash-based extractor from Lemma 2.25, four evaluations of 𝖤𝗑𝗍i(k′′)\mathsf{Ext}_{i(k^{\prime\prime})} for some i(k′′)<i(k)i(k^{\prime\prime})<i(k), and simple operations that can be done in time O~(n)\widetilde{O}(n). This means that the overall time complexity is 4i(k)O~(n)=O~(n)4^{i(k)}\cdot\widetilde{O}(n)=\widetilde{O}(n) after a one-time preprocessing step independent of the source and seed, since 4i(k)=poly(logn)4^{i(k)}=\operatorname{poly}(\log n) by Equation 2. This preprocessing step corresponds to finding primitive elements for O(loglogn)O(\log\log n) fields 𝔽q\mathds{F}_{q} with orders qpoly(n/ε0)=poly(n/ε)q\leq\operatorname{poly}(n/\varepsilon_{0})=\operatorname{poly}(n/\varepsilon) powers of 22. Furthermore, εi(k)=O(ε0+εi(k/3))\varepsilon_{i(k)}=O(\varepsilon_{0}+\varepsilon_{i(k/3)}) for all kk, and so εi(k)=2O(i(k))ε0=poly(logn)ε0ε\varepsilon_{i(k)}=2^{O(i(k))}\varepsilon_{0}=\operatorname{poly}(\log n)\cdot\varepsilon_{0}\leq\varepsilon provided that ε0ε/logCn\varepsilon_{0}\leq\varepsilon/\log^{C}n for a large enough constant C>0C>0. ∎

5.2.2 The (relatively) high-error case

In this section, we consider the higher error case where εCn32k/logk\varepsilon\geq Cn^{3}\cdot 2^{-k/\log k}. We instantiate the recursive approach of Srinivasan and Zuckerman [SZ99, Section 5.5] appropriately with our building blocks and analyze its complexity.

Lemma 5.9 (analogous to [SZ99, Corollary 5.10], with different instantiation and additional complexity claim).

There exist constants c,C>0c,C>0 such that the following holds. Suppose that for any positive integers n0n_{0}, k0=0.7n0k_{0}=0.7n_{0}, and some ε0=ε0(n0)2ck0\varepsilon_{0}=\varepsilon_{0}(n_{0})\geq 2^{-ck_{0}} and m0=m0(n0)m_{0}=m_{0}(n_{0}) there exists a strong (k0,ε0)(k_{0},\varepsilon_{0})-seeded extractor 𝖤𝗑𝗍0:{0,1}n0×{0,1}d0{0,1}m0\mathsf{Ext}_{0}\colon\{0,1\}^{n_{0}}\times\{0,1\}^{d_{0}}\to\{0,1\}^{m_{0}} with seed length d0ulog(n0/ε0)k0d_{0}\leq u\cdot\log(n_{0}/\varepsilon_{0})\leq k_{0}. Then, for any positive integers nn and knk\leq n there exists a family of strong (k,ε)(k,\varepsilon)-seeded extractors 𝖤𝗑𝗍:{0,1}n×{0,1}d{0,1}m\mathsf{Ext}\colon\{0,1\}^{n}\times\{0,1\}^{d}\to\{0,1\}^{m} with error εCloguε0(ck)\varepsilon\leq C\log u\cdot\varepsilon_{0}(ck), seed length dClogulog(n/ε0(ck))d\leq C\log u\cdot\log(n/\varepsilon_{0}(ck)), and output length mm0(ck)m\geq m_{0}(ck). Furthermore,

  1. 1.

    If 𝖤𝗑𝗍0\mathsf{Ext}_{0} is computable in time O~(n0)\widetilde{O}(n_{0}) and kClog2(n/ε)k\geq C\log^{2}(n/\varepsilon), then 𝖤𝗑𝗍\mathsf{Ext} is computable in time O~(n)\widetilde{O}(n);

  2. 2.

    If 𝖤𝗑𝗍0\mathsf{Ext}_{0} is computable in time O~(n0)\widetilde{O}(n_{0}) after a preprocessing step corresponding to finding primitive elements of jj fields 𝔽q\mathds{F}_{q} of orders qpoly(n/ε0)q\leq\operatorname{poly}(n/\varepsilon_{0}), then 𝖤𝗑𝗍\mathsf{Ext} is computable in time O~(n)\widetilde{O}(n) after a preprocessing step corresponding to finding primitive elements of j+1j+1 fields 𝔽q\mathds{F}_{q} of orders qpoly(n/ε0)q\leq\operatorname{poly}(n/\varepsilon_{0}).

Proof.

We begin by setting up relevant notation:

  • Let C𝖻𝗅𝗈𝖼𝗄𝗌1C_{\mathsf{blocks}}\geq 1 be a constant to be determined. Set 0=k100C𝖻𝗅𝗈𝖼𝗄𝗌\ell_{0}=\frac{k}{100\cdot C_{\mathsf{blocks}}} and k0=0.70k_{0}=0.7\ell_{0}. For ε0=ε0(0)\varepsilon_{0}=\varepsilon_{0}(\ell_{0}) and m0=m0(0)m_{0}=m_{0}(\ell_{0}), we define 1=C𝖻𝗅𝗈𝖼𝗄𝗌ulog(0/ε0)\ell_{1}=C_{\mathsf{blocks}}\cdot u\log(\ell_{0}/\varepsilon_{0}). Then, we define i=0.9i1\ell_{i}=0.9\ell_{i-1} for all i2i\geq 2. The i\ell_{i}’s will be block lengths for a block source ZZ. In particular, when performing block source extraction from ZZ we will instantiate 𝖤𝗑𝗍0\mathsf{Ext}_{0} with input length n0=0n_{0}=\ell_{0}.

  • Define m1=ulog(0/ε0)m_{1}=u\cdot\log(\ell_{0}/\varepsilon_{0}) and mi=0.9mi1m_{i}=0.9m_{i-1} for all i2i\geq 2. The mim_{i}’s will be output lengths for block source extraction from ZZ.

  • Set t=1+log(u/logu)log(1/0.9)t=1+\frac{\log\mathopen{}\mathclose{{}\left(u/\log u}\right)}{\log(1/0.9)}. This will be the number of blocks of ZZ. We have mt=0.9t1m1=logulog(0/ε0)m_{t}=0.9^{t-1}m_{1}=\log u\cdot\log(\ell_{0}/\varepsilon_{0}). Furthermore, since 1=C𝖻𝗅𝗈𝖼𝗄𝗌m1\ell_{1}=C_{\mathsf{blocks}}\cdot m_{1}, we also have that i=C𝖻𝗅𝗈𝖼𝗄𝗌mi\ell_{i}=C_{\mathsf{blocks}}\cdot m_{i} for all i1i\geq 1.

Let XX be an arbitrary (n,k)(n,k)-source. The extractor 𝖤𝗑𝗍:{0,1}n×{0,1}d{0,1}m\mathsf{Ext}\colon\{0,1\}^{n}\times\{0,1\}^{d}\to\{0,1\}^{m} proceeds as follows on input XX:

  1. 1.

    Using a fresh seed Y𝖢𝗈𝗇𝖽Y_{\mathsf{Cond}} of length C𝖢𝗈𝗇𝖽log(n/ε0)C_{\mathsf{Cond}}\log(n/\varepsilon_{0}), apply a strong (k,k,ε02)(k,k^{\prime},\varepsilon_{0}^{2})-condenser 𝖢𝗈𝗇𝖽\mathsf{Cond} to XX. If kClog2(n/ε0)k\geq C\log^{2}(n/\varepsilon_{0}) for an apropriately large constant C>0C>0, then we instantiate 𝖢𝗈𝗇𝖽\mathsf{Cond} with the lossless KT (k,k=k,ε𝖢𝗈𝗇𝖽)(k,k^{\prime}=k,\varepsilon_{\mathsf{Cond}})-condenser (Theorem 3.10). Otherwise, we instantiate 𝖢𝗈𝗇𝖽\mathsf{Cond} with the lossy RS (k,k0.95k,ε𝖢𝗈𝗇𝖽)(k,k^{\prime}\geq 0.95k,\varepsilon_{\mathsf{Cond}})-condenser (Theorem 3.11) instantiated with α=0.05\alpha=0.05. By the second part of either Theorem 3.10 or Theorem 3.11, we get that with probability at least 1ε01-\varepsilon_{0} over the choice of Y𝖢𝗈𝗇𝖽=yY_{\mathsf{Cond}}=y it holds that X=𝖢𝗈𝗇𝖽(X,y)X^{\prime}=\mathsf{Cond}(X,y) is ε0\varepsilon_{0}-close to an (n,k)(n^{\prime},k^{\prime})-source with k0.95nk^{\prime}\geq 0.95n^{\prime}. From here onwards we work under such a good fixing Y𝖢𝗈𝗇𝖽=yY_{\mathsf{Cond}}=y, and will account for the ε0\varepsilon_{0} error term in the final extractor error later on.

  2. 2.

    We use XX^{\prime} and Lemma 2.16 to generate a block source ZZ with geometrically decreasing block lengths 0,1,,t\ell_{0},\ell_{1},\dots,\ell_{t} defined above.

    For each i=0,1,,ti=0,1,\dots,t, let 𝖲𝖺𝗆𝗉i:{0,1}ri[n]i\mathsf{Samp}_{i}\colon\{0,1\}^{r_{i}}\to[n^{\prime}]^{\ell_{i}} be the (θ=1/100,γ=ε0)(\theta=1/100,\gamma=\varepsilon_{0})-averaging sampler from Lemma 2.21 with input length ri=C𝖲𝖺𝗆𝗉log(n/ε0)r_{i}=C_{\mathsf{Samp}}\log(n^{\prime}/\varepsilon_{0}) for some constant C𝖲𝖺𝗆𝗉>0C_{\mathsf{Samp}}>0. We choose the constant C𝖻𝗅𝗈𝖼𝗄𝗌C_{\mathsf{blocks}} above to be large enough so that nitC𝖲𝖺𝗆𝗉log(1/ε0)/θ2n^{\prime}\geq\ell_{i}\geq\ell_{t}\geq C^{\prime}_{\mathsf{Samp}}\log(1/\varepsilon_{0})/\theta^{2} for all i[t]i\in[t], where C𝖲𝖺𝗆𝗉C^{\prime}_{\mathsf{Samp}} is the constant CC from Lemma 2.21. To see that in\ell_{i}\leq n^{\prime} for i=0,,ti=0,\dots,t (and so indeed Lemma 2.21 can be applied to obtain i\ell_{i} samples), note that

    i=0tii=0i=101+0k/9<n.\sum_{i=0}^{t}\ell_{i}\leq\sum_{i=0}^{\infty}\ell_{i}=10\ell_{1}+\ell_{0}\leq k/9<n^{\prime}. (6)

    The second-to-last inequality uses the fact that

    1=C𝖻𝗅𝗈𝖼𝗄𝗌ulog(0/ε0)C𝖻𝗅𝗈𝖼𝗄𝗌k0C𝖻𝗅𝗈𝖼𝗄𝗌0=k/100,\ell_{1}=C_{\mathsf{blocks}}\cdot u\log(\ell_{0}/\varepsilon_{0})\leq C_{\mathsf{blocks}}\cdot k_{0}\leq C_{\mathsf{blocks}}\cdot\ell_{0}=k/100,

    where the first inequality holds since ulog(0/ε0)k0u\log(\ell_{0}/\varepsilon_{0})\leq k_{0} is an hypothesis in the lemma statement. We also assume that ε02ck0\varepsilon_{0}\geq 2^{-ck_{0}} for a constant c>0c>0 small enough so that

    0=k100C𝖻𝗅𝗈𝖼𝗄𝗌C𝖲𝖺𝗆𝗉ck0/θ2C𝖲𝖺𝗆𝗉log(1/ε0)/θ2,\ell_{0}=\frac{k}{100C_{\mathsf{blocks}}}\geq C^{\prime}_{\mathsf{Samp}}\cdot ck_{0}/\theta^{2}\geq C^{\prime}_{\mathsf{Samp}}\log(1/\varepsilon_{0})/\theta^{2},

    where we recall that k0=0.70k_{0}=0.7\ell_{0}, meaning that the conditions of Lemma 2.21 are satisfied for all i=0,,ti=0,\dots,t.

    For each i=0,1,,ti=0,1,\dots,t, let YiY_{i} be a fresh seed of length rir_{i}. We set the ii-th block as Zi=X𝖲𝖺𝗆𝗉(Yi)Z_{i}=X^{\prime}_{\mathsf{Samp}(Y_{i})}. By Lemma 2.16 instantiated with XX^{\prime} and 𝖲𝖺𝗆𝗉0\mathsf{Samp}_{0}, we conclude that

    Y0Z0ε0+2c𝖲𝖺𝗆𝗉kY0Z0,Y_{0}\circ Z_{0}\approx_{\varepsilon_{0}+2^{-c_{\mathsf{Samp}}k^{\prime}}}Y_{0}\circ Z^{\prime}_{0},

    with c𝖲𝖺𝗆𝗉>0c_{\mathsf{Samp}}>0 an absolute constant guaranteed by Lemma 2.16, where (Z0|Y0=y)(Z^{\prime}_{0}|Y_{0}=y) is an (0,0.90)(\ell_{0},0.9\ell_{0})-source for every yy. We now argue how this guarantee extends to more blocks. Consider an arbitrary ii and fixings Y0=y0,,Yi1=yi1Y_{0}=y_{0},\dots,Y_{i-1}=y_{i-1}. Then, Lemma 2.6 with δ=2c𝖲𝖺𝗆𝗉k\delta=2^{-c_{\mathsf{Samp}}k} and =k/9\ell=k/9 (from the upper bound in Equation 6) implies that

    𝐇(X|(Z0|Y0=y0)=z0,,(Zi1|Yi1=yi1)=zi1)0.8n\mathbf{H}_{\infty}(X|(Z^{\prime}_{0}|Y_{0}=y_{0})=z_{0},\dots,(Z^{\prime}_{i-1}|Y_{i-1}=y_{i-1})=z_{i-1})\geq 0.8n^{\prime}

    except with probability at most 2c𝖲𝖺𝗆𝗉k2^{-c_{\mathsf{Samp}}k} over the choice of z0,,zi1z_{0},\dots,z_{i-1}, which we can absorb into the statistical distance, since k0.95n0.95kk^{\prime}\geq 0.95n^{\prime}\geq 0.95k. Consequently, from Lemma 2.16 we get that

    Y0,Z0,,Yi1,Zi1,Yi,Zi=X𝖲𝖺𝗆𝗉(Yi)ε0+22c𝖲𝖺𝗆𝗉kY0,Z0,,Yi1,Zi1,Yi,Zi,Y_{0},Z^{\prime}_{0},\dots,Y_{i-1},Z^{\prime}_{i-1},Y_{i},Z_{i}=X_{\mathsf{Samp}(Y_{i})}\approx_{\varepsilon_{0}+2\cdot 2^{-c_{\mathsf{Samp}}k}}Y_{0},Z^{\prime}_{0},\dots,Y_{i-1},Z^{\prime}_{i-1},Y_{i},Z^{\prime}_{i}, (7)

    where (Zi|Y0=y0,Z0=z0,,Yi1=yi1,Zi1=zi1,Yi=yi)(Z^{\prime}_{i}|Y_{0}=y_{0},Z^{\prime}_{0}=z_{0},\dots,Y_{i-1}=y_{i-1},Z^{\prime}_{i-1}=z_{i-1},Y_{i}=y_{i}) is an (i,0.7i)(\ell_{i},0.7\ell_{i})-source for any choice of y0,z0,,yi1,zi1,yiy_{0},z_{0},\dots,y_{i-1},z_{i-1},y_{i}. Combining Equation 7 with the triangle inequality over all 0it0\leq i\leq t, we conclude that Z=Z0Z1ZtZ=Z_{0}\circ Z_{1}\circ\cdots\circ Z_{t} is ε𝖻𝗅𝗈𝖼𝗄\varepsilon_{\mathsf{block}}-close to an exact (0,,t,0.7)(\ell_{0},\dots,\ell_{t},0.7)-block-source ZZ^{\prime}, where ε𝖻𝗅𝗈𝖼𝗄=(t+1)(ε0+22c𝖲𝖺𝗆𝗉k)\varepsilon_{\mathsf{block}}=(t+1)(\varepsilon_{0}+2\cdot 2^{-c_{\mathsf{Samp}}k}).

  3. 3.

    We apply block source extraction (Lemma 2.23) to Z=Z0Z1ZtZ=Z_{0}\circ Z_{1}\circ\cdots\circ Z_{t}. More precisely, let 𝖡𝖤𝗑𝗍:{0,1}0××{0,1}t×{0,1}dt{0,1}m0\mathsf{BExt}\colon\{0,1\}^{\ell_{0}}\times\cdots\times\{0,1\}^{\ell_{t}}\times\{0,1\}^{d_{t}}\to\{0,1\}^{m_{0}} be the strong (k0,k1,,kt,(t+1)ε0)(k_{0},k_{1},\dots,k_{t},(t+1)\varepsilon_{0})-block-source extractor with ki=0.7ik_{i}=0.7\ell_{i} obtained via Lemma 2.23 as follows. We instantiate 𝖤𝗑𝗍0\mathsf{Ext}_{0} with the strong extractor promised by the lemma statement with seed length d0ulog(0/ε0)=m1d_{0}\leq u\cdot\log(\ell_{0}/\varepsilon_{0})=m_{1}. For i[t]i\in[t], we instantiate 𝖤𝗑𝗍i:{0,1}i×{0,1}di{0,1}mi\mathsf{Ext}_{i}\colon\{0,1\}^{\ell_{i}}\times\{0,1\}^{d_{i}}\to\{0,1\}^{m_{i}} as the strong (ki=0.7i,ε0)(k_{i}=0.7\ell_{i},\varepsilon_{0})-seeded extractor from Lemma 2.14 with seed length di=2mi+4log(i/ε0)+8d_{i}=2m_{i}+4\log(\ell_{i}/\varepsilon_{0})+8. We choose the constant C𝖻𝗅𝗈𝖼𝗄𝗌C_{\mathsf{blocks}} to be large enough so that

    mi=i/C𝖻𝗅𝗈𝖼𝗄𝗌0.7i16log(4/ε0)=ki16log(4/ε0),m_{i}=\ell_{i}/C_{\mathsf{blocks}}\leq 0.7\ell_{i}-16\log(4/\varepsilon_{0})=k_{i}-16\log(4/\varepsilon_{0}),

    as required by Lemma 2.14. This is possible since by choosing C𝖻𝗅𝗈𝖼𝗄𝗌C_{\mathsf{blocks}} large enough we have

    it=C𝖻𝗅𝗈𝖼𝗄𝗌mt=C𝖻𝗅𝗈𝖼𝗄𝗌logulog(0/ε0)100log(4/ε0)\ell_{i}\geq\ell_{t}=C_{\mathsf{blocks}}\cdot m_{t}=C_{\mathsf{blocks}}\log u\cdot\log(\ell_{0}/\varepsilon_{0})\geq 100\log(4/\varepsilon_{0})

    for all i[t]i\in[t], and so 0.7i16log(4/ε0)i/20.7\ell_{i}-16\log(4/\varepsilon_{0})\geq\ell_{i}/2 for all i[t]i\in[t]. Furthermore, for any i2i\geq 2 the output length mim_{i} of 𝖤𝗑𝗍i\mathsf{Ext}_{i} satisfies

    di+mi=3mi+4log(n/ε0)+82mi1+4log(n/ε0)+8di1,d_{i}+m_{i}=3m_{i}+4\log(n/\varepsilon_{0})+8\geq 2m_{i-1}+4\log(n/\varepsilon_{0})+8\geq d_{i-1},

    where we recall that mi=mi1/0.9m_{i}=m_{i-1}/0.9 for i2i\geq 2. Finally, the output length of 𝖤𝗑𝗍1\mathsf{Ext}_{1} satisfies d1+m1m1d0d_{1}+m_{1}\geq m_{1}\geq d_{0}, where we recall that d0d_{0} is the seed length of 𝖤𝗑𝗍0\mathsf{Ext}_{0}.

    Let Y𝖡𝖤𝗑𝗍Y_{\mathsf{BExt}} be a fresh seed of length dtd_{t}. With the desired upper bound on the seed length dd from the lemma’s statement in mind, we note that

    dt2mt+4log(t/ε0)+82logulog(0/ε0)+4log(0/ε0)6logulog(n/ε0),d_{t}\leq 2m_{t}+4\log(\ell_{t}/\varepsilon_{0})+8\leq 2\log u\cdot\log(\ell_{0}/\varepsilon_{0})+4\log(\ell_{0}/\varepsilon_{0})\leq 6\log u\cdot\log(n/\varepsilon_{0}), (8)

    since 0kn\ell_{0}\leq k\leq n. By Lemma 2.23, we get that

    Y𝖡𝖤𝗑𝗍𝖡𝖤𝗑𝗍(Z,Y𝖡𝖤𝗑𝗍)ε𝖻𝗅𝗈𝖼𝗄Y𝖡𝖤𝗑𝗍𝖡𝖤𝗑𝗍(Z,Y𝖡𝖤𝗑𝗍)(t+1)ε0Udt+m0.Y_{\mathsf{BExt}}\circ\mathsf{BExt}(Z,Y_{\mathsf{BExt}})\approx_{\varepsilon_{\mathsf{block}}}Y_{\mathsf{BExt}}\circ\mathsf{BExt}(Z^{\prime},Y_{\mathsf{BExt}})\approx_{(t+1)\varepsilon_{0}}U_{d_{t}+m_{0}}.

    Applying the triangle inequality, we conclude that

    Y𝖡𝖤𝗑𝗍𝖡𝖤𝗑𝗍(Z,Y𝖡𝖤𝗑𝗍)ε𝖻𝗅𝗈𝖼𝗄+(t+1)ε0Udt+m0.Y_{\mathsf{BExt}}\circ\mathsf{BExt}(Z,Y_{\mathsf{BExt}})\approx_{\varepsilon_{\mathsf{block}}+(t+1)\varepsilon_{0}}U_{d_{t}+m_{0}}.

We now define our final strong extractor 𝖤𝗑𝗍:{0,1}n×{0,1}d{0,1}m0\mathsf{Ext}\colon\{0,1\}^{n}\times\{0,1\}^{d}\to\{0,1\}^{m_{0}} (recall that we abbreviate m0=m0(0)m_{0}=m_{0}(\ell_{0})). Choose our overall seed to be Y=Y𝖢𝗈𝗇𝖽Y0YtY𝖡𝖤𝗑𝗍Y=Y_{\mathsf{Cond}}\circ Y_{0}\circ\cdots\circ Y_{t}\circ Y_{\mathsf{BExt}} and set 𝖤𝗑𝗍(X,Y)=𝖡𝖤𝗑𝗍(Z,Y𝖡𝖤𝗑𝗍)\mathsf{Ext}(X,Y)=\mathsf{BExt}(Z,Y_{\mathsf{BExt}}). By the discussion above, 𝖤𝗑𝗍\mathsf{Ext} is a strong (k,ε)(k,\varepsilon)-extractor with error (recall that we abbreviate ε0=ε0(0)\varepsilon_{0}=\varepsilon_{0}(\ell_{0}))

ε=2ε0+ε𝖻𝗅𝗈𝖼𝗄+(t+1)ε0(2t+4)(ε0+22c𝖲𝖺𝗆𝗉k)\varepsilon=2\varepsilon_{0}+\varepsilon_{\mathsf{block}}+(t+1)\varepsilon_{0}\leq(2t+4)(\varepsilon_{0}+2\cdot 2^{-c_{\mathsf{Samp}}k})

for a sufficiently large constant CC since t=O(logu)t=O(\log u) (where one of the ε0\varepsilon_{0} terms comes from fixing the seed in the condensing step of Item 1), and seed length

d=|Y𝖢𝗈𝗇𝖽|+|Y𝖡𝖤𝗑𝗍|+i=0t|Yi|C𝖢𝗈𝗇𝖽log(n/ε0)+dt+(t+1)C𝖲𝖺𝗆𝗉log(n/ε0)Clogulog(n/ε0)d=|Y_{\mathsf{Cond}}|+|Y_{\mathsf{BExt}}|+\sum_{i=0}^{t}|Y_{i}|\leq C_{\mathsf{Cond}}\log(n/\varepsilon_{0})+d_{t}+(t+1)C_{\mathsf{Samp}}\log(n^{\prime}/\varepsilon_{0})\leq C\log u\cdot\log(n/\varepsilon_{0})

provided that CC is large enough (again since t=O(logu)t=O(\log u)), as desired. We used Equation 8 to bound dtd_{t} and obtain the last inequality.

Time complexity.

It remains to analyze the time complexity of 𝖤𝗑𝗍\mathsf{Ext}. If kClog2(n/ε0)k\geq C\log^{2}(n/\varepsilon_{0}) with CC a sufficiently large constant, then Item 1 takes time O~(n)\widetilde{O}(n). Item 2 takes time tO~(n)=O~(n)t\cdot\widetilde{O}(n)=\widetilde{O}(n), since t=O(logu)=O(logn)t=O(\log u)=O(\log n) and each averaging sampler 𝖲𝖺𝗆𝗉i\mathsf{Samp}_{i} is computable in time O~(n)\widetilde{O}(n). Item 3 takes time tO~(n)=O~(n)t\cdot\widetilde{O}(n)=\widetilde{O}(n), since 𝖤𝗑𝗍0\mathsf{Ext}_{0} and each 𝖤𝗑𝗍i\mathsf{Ext}_{i} from Lemma 2.14 are computable in time O~(n)\widetilde{O}(n). Therefore, 𝖤𝗑𝗍\mathsf{Ext} is computable in overall time O~(n)\widetilde{O}(n) in this case.

Otherwise, if k<Clog2(n/ε0)k<C\log^{2}(n/\varepsilon_{0}), then Item 1 takes time O~(n)\widetilde{O}(n) after a preprocessing step corresponding to finding a primitive element of 𝔽q\mathds{F}_{q} with qpoly(n/ε0)q\leq\operatorname{poly}(n/\varepsilon_{0}). As discussed above, Item 2 takes time O~(n)\widetilde{O}(n). Item 3 takes time O~(0)=O~(n)\widetilde{O}(\ell_{0})=\widetilde{O}(n) after a preprocessing step, and so 𝖤𝗑𝗍\mathsf{Ext} is computable in overall time O~(n)\widetilde{O}(n) after a preprocessing step. Moreover, if the preprocessing step for 𝖤𝗑𝗍0\mathsf{Ext}_{0} consists in finding primitive elements of jj fields 𝔽q\mathds{F}_{q} with orders qpoly(n/ε0)q\leq\operatorname{poly}(n/\varepsilon_{0}), then by the above the preprocessing step for 𝖤𝗑𝗍\mathsf{Ext} consists in finding primitive elements of j+1j+1 fields 𝔽q\mathds{F}_{q} with orders qpoly(n/ε0)q\leq\operatorname{poly}(n/\varepsilon_{0}). ∎

Denote by log(i)\log^{(i)} the function that iteratively applies log\log a total of ii times (so log(1)n=logn\log^{(1)}\!n=\log n, log(2)n=loglogn\log^{(2)}\!n=\log\log n, and so on). Denote by log\log^{*} the iterated logarithm. Then, we have the following corollary.

Corollary 5.10.

There exists a constant C>0C>0 such that the following holds. Let nn be any positive integer and ii any positive integer such that log(i)n6C\log^{(i)}\!n\geq 6C. Then, for any knk\leq n and any εn32k/2Ci\varepsilon\geq n^{3}\cdot 2^{-k/2^{C\cdot i}} there exists a strong (k,ε)(k,\varepsilon)-seeded extractor 𝖤𝗑𝗍:{0,1}n×{0,1}d{0,1}m\mathsf{Ext}\colon\{0,1\}^{n}\times\{0,1\}^{d}\to\{0,1\}^{m} with seed length dClog(i)nlog(n/ε)d\leq C\log^{(i)}\!n\cdot\log(n/\varepsilon) and output length mk/2Cim\geq k/2^{C\cdot i}. Furthermore,

  1. 1.

    if k2Cilog2(n/ε)k\geq 2^{C\cdot i}\cdot\log^{2}(n/\varepsilon), then 𝖤𝗑𝗍\mathsf{Ext} is computable in time O~(n)\widetilde{O}(n);

  2. 2.

    if k<2Cilog2(n/ε)k<2^{C\cdot i}\cdot\log^{2}(n/\varepsilon), then 𝖤𝗑𝗍\mathsf{Ext} is computable in time O~(n)\widetilde{O}(n) after a preprocessing step which corresponds to finding primitive elements of ii fields 𝔽q\mathds{F}_{q} of orders qpoly(n/ε)q\leq\operatorname{poly}(n/\varepsilon) powers of 22.

Consequently, if we choose ii to be the largest integer such that log(i)n6C\log^{(i)}\!n\geq 6C (which satisfies ilogni\leq\log^{*}\!n) we get a strong (k,ε)(k,\varepsilon)-seeded extractor 𝖤𝗑𝗍:{0,1}n×{0,1}d{0,1}m\mathsf{Ext}\colon\{0,1\}^{n}\times\{0,1\}^{d}\to\{0,1\}^{m} with seed length d6C2log(n/ε)d\leq 6C^{2}\log(n/\varepsilon) and output length mk/2Clognm\geq k/2^{C\log^{*}\!n} for any error εn32k/2Clogn\varepsilon\geq n^{3}\cdot 2^{-k/2^{C\log^{*}\!n}}. If k2Clognlog2(n/ε)k\geq 2^{C\log^{*}\!n}\cdot\log^{2}(n/\varepsilon), then 𝖤𝗑𝗍\mathsf{Ext} is computable in time O~(n)\widetilde{O}(n). Otherwise, 𝖤𝗑𝗍\mathsf{Ext} is computable in time O~(n)\widetilde{O}(n) after a preprocessing step which corresponds to finding primitive elements of ilogni\leq\log^{*}\!n fields 𝔽q\mathds{F}_{q} of orders qpoly(n/ε)q\leq\operatorname{poly}(n/\varepsilon).

Proof.

We iteratively apply Lemma 5.9 ii times. Let c,C>0c,C>0 be the constants guaranteed by Lemma 5.9. For the first application of the lemma, we take 𝖤𝗑𝗍0:{0,1}n×{0,1}d0{0,1}m0\mathsf{Ext}_{0}\colon\{0,1\}^{n}\times\{0,1\}^{d_{0}}\to\{0,1\}^{m_{0}} to be the strong (k0=0.7n,ε0)(k_{0}=0.7n,\varepsilon_{0}) extractor from Lemma 2.14 with m0=k0/20m_{0}=k_{0}/20 and ε02ck0/100\varepsilon_{0}\geq 2^{-ck_{0}/100} to be defined later. The corresponding seed length is d02m0+4log(n/ε0)+4d_{0}\leq 2m_{0}+4\log(n/\varepsilon_{0})+4, which satisfies d0k0d_{0}\leq k_{0}, and so the initial value of uu is u0=d0/log(n/ε0)k0u_{0}=d_{0}/\log(n/\varepsilon_{0})\leq k_{0}. Denote by 𝖤𝗑𝗍1\mathsf{Ext}_{1} the resulting strong seeded extractor. In the second application of Lemma 5.9, we instantiate 𝖤𝗑𝗍0\mathsf{Ext}_{0} with 𝖤𝗑𝗍1\mathsf{Ext}_{1} instead to obtain a new strong seeded extractor 𝖤𝗑𝗍2\mathsf{Ext}_{2}, and so on. For each j[i]j\in[i], we obtain a family of strong (k,εj)(k,\varepsilon_{j})-seeded extractors 𝖤𝗑𝗍j:{0,1}n×{0,1}dj{0,1}mj\mathsf{Ext}_{j}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d_{j}}\to\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{m_{j}} parameterized by kk with output length mj=mj1(ck)m_{j}=m_{j-1}(ck), error

εj=Cloguj1εj1(ck)\varepsilon_{j}=C\log u_{j-1}\cdot\varepsilon_{j-1}(ck)

and seed length

dj=Cloguj1log(n/εj1(ck))=Cloguj1log(nCloguj1εj),\displaystyle d_{j}=C\log u_{j-1}\cdot\log(n/\varepsilon_{j-1}(ck))=C\log u_{j-1}\cdot\log\mathopen{}\mathclose{{}\left(\frac{n\cdot C\log u_{j-1}}{\varepsilon_{j}}}\right),

where

uj\displaystyle u_{j} =djlog(n/εj)\displaystyle=\frac{d_{j}}{\log(n/\varepsilon_{j})}
=Cloguj1(1+logClog(n/εj)+logloguj1log(n/εj))\displaystyle=C\log u_{j-1}\cdot\mathopen{}\mathclose{{}\left(1+\frac{\log C}{\log(n/\varepsilon_{j})}+\frac{\log\log u_{j-1}}{\log(n/\varepsilon_{j})}}\right)
Cloguj1(1+logClogn+logloguj1logn)\displaystyle\leq C\log u_{j-1}\cdot\mathopen{}\mathclose{{}\left(1+\frac{\log C}{\log n}+\frac{\log\log u_{j-1}}{\log n}}\right)
3Cloguj1.\displaystyle\leq 3C\log u_{j-1}.

The last inequality uses the fact that uj1u0nu_{j-1}\leq u_{0}\leq n for all jj.

Recall that from the corollary statement that ii is such that log(i)n6C\log^{(i)}\!n\geq 6C. We show by induction that uj3Clog(j)n+3Clog(6C)u_{j}\leq 3C\log^{(j)}n+3C\log(6C) for all j=0,,ij=0,\dots,i. This is immediate for the base case j=0j=0, since u0k0nu_{0}\leq k_{0}\leq n. For the induction step, note that

uj+13Cloguj3Clog(3Clog(j)n+3Clog(6C))3Clog(23Clog(j)n)=3Clog(j+1)n+3Clog(6C),u_{j+1}\leq 3C\log u_{j}\leq 3C\log(3C\log^{(j)}n+3C\log(6C))\\ \leq 3C\log(2\cdot 3C\log^{(j)}n)=3C\log^{(j+1)}n+3C\log(6C),

as desired. This implies that

dj=ujlog(n/εj)6Clog(j)nlog(n/εj)d_{j}=u_{j}\cdot\log(n/\varepsilon_{j})\leq 6C\log^{(j)}n\cdot\log(n/\varepsilon_{j})

and

εj=Cloguj1εj1(ck)(6C)j(j=0j1log(j)n)ε0(cjk)\varepsilon_{j}=C\log u_{j-1}\cdot\varepsilon_{j-1}(ck)\leq(6C)^{j}\mathopen{}\mathclose{{}\left(\prod_{j^{\prime}=0}^{j-1}\log^{(j^{\prime})}n}\right)\cdot\varepsilon_{0}(c^{j}k)

for all j[i]j\in[i]. We may assume that CC is large enough that logaa\log a\leq\sqrt{a} for all aCa\geq C, in which case j=0j1log(j)nj=0j1n2jn2\prod_{j^{\prime}=0}^{j-1}\log^{(j^{\prime})}n\leq\prod_{j^{\prime}=0}^{j-1}n^{2^{-j^{\prime}}}\leq n^{2} since log(j)nC\log^{(j^{\prime})}n\geq C for all jij^{\prime}\leq i by hypothesis. Therefore, we obtain final output length

mi=m0(cik)=k/2O(i),m_{i}=m_{0}(c^{i}k)=k/2^{O(i)},

final error εi\varepsilon_{i} satisfying

ε0(ck)εi(6C)in2ε0(cik)n3ε0(cik),\varepsilon_{0}(ck)\leq\varepsilon_{i}\leq(6C)^{i}\cdot n^{2}\cdot\varepsilon_{0}(c^{i}k)\leq n^{3}\cdot\varepsilon_{0}(c^{i}k),

where the last inequality uses that log(i)n6C\log^{(i)}\!n\geq 6C, and final seed length

di6Clog(i)nlog(n/εi).d_{i}\leq 6C\log^{(i)}\!n\cdot\log(n/\varepsilon_{i}).

We now instantiate ε0(cik)=ε/n3\varepsilon_{0}(c^{i}k)=\varepsilon/n^{3}. Note that ε0(cik)20.7ci+1k/100\varepsilon_{0}(c^{i}k)\geq 2^{-0.7c^{i+1}k/100} as required for the choice of 𝖤𝗑𝗍0\mathsf{Ext}_{0} above so long as εn320.7ci+1k\varepsilon\geq n^{3}\cdot 2^{-0.7c^{i+1}k}, which holds by the corollary’s hypothesis if CC is a large enough constant. With this choice of ε0(cik)\varepsilon_{0}(c^{i}k) we get final error εin3ε0(cik)=ε\varepsilon_{i}\leq n^{3}\cdot\varepsilon_{0}(c^{i}k)=\varepsilon. In fact, we can make εi\varepsilon_{i} larger so that εi=ε\varepsilon_{i}=\varepsilon, in which case the final seed length satisfies

di6Clog(i)nlog(n/ε),d_{i}\leq 6C\log^{(i)}\!n\cdot\log(n/\varepsilon),

as desired.

Time complexity.

Finally, we discuss the time complexity of 𝖤𝗑𝗍\mathsf{Ext}. Note that the initial choice for 𝖤𝗑𝗍0\mathsf{Ext}_{0} is computable in time O~(n0)\widetilde{O}(n_{0}). Therefore, if k2Cilog2(n/ε)k\geq 2^{C\cdot i}\log^{2}(n/\varepsilon) for a sufficiently large constant C>0C>0, then the conditions of Item 1 of Lemma 5.9 are satisfied for all ii applications of this lemma, and so 𝖤𝗑𝗍\mathsf{Ext} will be computable in time O~(n)\widetilde{O}(n). Otherwise, the condition in Item 1 holds and so 𝖤𝗑𝗍\mathsf{Ext} is computable in time O~(n)\widetilde{O}(n) after a preprocessing step, since we always have unu\leq n in each application of the lemma. By Lemma 5.9, the preprocessing amounts to finding primitive elements of ii fields 𝔽q\mathds{F}_{q} with orders qpoly(n/ε0)=poly(n/ε)q\leq\operatorname{poly}(n/\varepsilon_{0})=\operatorname{poly}(n/\varepsilon). ∎

To obtain our final theorem, we use block source extraction to increase the output length of the extractor from Corollary 5.10, following a strategy of Zuckerman [Zuc97].

Theorem 5.11.

There exist constants c,C>0c,C>0 such that the following holds. For any integers nn and knk\leq n and any εCn32k/logk\varepsilon\geq Cn^{3}\cdot 2^{-k/\log k} there exists a strong (k,ε)(k,\varepsilon)-seeded extractor 𝖤𝗑𝗍:{0,1}n×{0,1}d{0,1}m\mathsf{Ext}\colon\{0,1\}^{n}\times\{0,1\}^{d}\to\{0,1\}^{m} with seed length dClog(n/ε)d\leq C\log(n/\varepsilon) and output length mckm\geq ck. Furthermore,

  1. 1.

    if k2Clognlog2(n/ε)k\geq 2^{C\log^{*}\!n}\cdot\log^{2}(n/\varepsilon), then 𝖤𝗑𝗍\mathsf{Ext} is computable in time O~(n)\widetilde{O}(n);

  2. 2.

    if k<2Clognlog2(n/ε)k<2^{C\log^{*}\!n}\cdot\log^{2}(n/\varepsilon), then 𝖤𝗑𝗍\mathsf{Ext} is computable in time O~(n)\widetilde{O}(n) after a preprocessing step which corresponds to finding logn\log^{*}n primitive elements of fields 𝔽q\mathds{F}_{q} of orders qpoly(n/ε)q\leq\operatorname{poly}(n/\varepsilon) powers of 22.

Proof.

Define ε=ε/6\varepsilon^{\prime}=\varepsilon/6 and let XX be an arbitrary (n,k)(n,k)-source. The extractor 𝖤𝗑𝗍\mathsf{Ext} behaves as follows on input XX:

  1. 1.

    Apply a strong (k,k,(ε)2)(k,k^{\prime},(\varepsilon^{\prime})^{2})-condenser 𝖢𝗈𝗇𝖽:{0,1}n×{0,1}d𝖢𝗈𝗇𝖽{0,1}n\mathsf{Cond}\colon\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n}\times\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{d_{\mathsf{Cond}}}\to\mathopen{}\mathclose{{}\left\{{0,1}}\right\}^{n^{\prime}} to XX, with output min-entropy rate k0.95nk^{\prime}\geq 0.95n^{\prime} and seed length d𝖢𝗈𝗇𝖽=C𝖢𝗈𝗇𝖽log(n/ε)d_{\mathsf{Cond}}=C_{\mathsf{Cond}}\log(n/\varepsilon^{\prime}). If k2Clognlog2(n/ε)k\geq 2^{C\log^{*}\!n}\cdot\log^{2}(n/\varepsilon), we instantiate 𝖢𝗈𝗇𝖽\mathsf{Cond} with the lossless KT strong (k,k,ε)(k,k^{\prime},\varepsilon^{\prime})-condenser (Theorem 3.10). Otherwise, we instantiate 𝖢𝗈𝗇𝖽\mathsf{Cond} with the lossy RS strong (k,k,ε)(k,k^{\prime},\varepsilon^{\prime})-condenser (Theorem 3.11). By the second part of either Theorem 3.10 or Theorem 3.11, we get that with probability at least 1ε1-\varepsilon^{\prime} over the choice of the seed yy we obtain an output XX^{\prime} that is ε\varepsilon^{\prime}-close to an (n,k)(n^{\prime},k^{\prime})-source with k0.95nk^{\prime}\geq 0.95n^{\prime}. As in previous arguments, we work under such a good fixing of yy from here onwards and account for the probability ε\varepsilon^{\prime} of selecting a bad seed in the final extractor error later on.

  2. 2.

    Write X=X1X2X^{\prime}=X_{1}\circ X_{2} with |X1|=|X2|=n/2|X_{1}|=|X_{2}|=n^{\prime}/2. Choose the constant c>0c>0 in the theorem statement small enough so that log(1/ε)log(1/ε)+3ck+30.05k\log(1/\varepsilon^{\prime})\leq\log(1/\varepsilon)+3\leq ck+3\leq 0.05k, which means that n/20.05klog(1/ε)0.4nn^{\prime}/2-0.05k-\log(1/\varepsilon^{\prime})\geq 0.4n^{\prime}. Then, combining Item 1 with Lemma 2.24, (instantiated with t=2t=2, Δ=0.05k\Delta=0.05k, and ε=ε\varepsilon=\varepsilon^{\prime}) via the triangle inequality, XX^{\prime} is 3ε3\varepsilon^{\prime}-close to an ((n/2,n/2),0.8)((n^{\prime}/2,n^{\prime}/2),0.8)-block source.

  3. 3.

    Apply block source extraction to X1X2X_{1}\circ X_{2}. More precisely, let 𝖤𝗑𝗍1:{0,1}n1×{0,1}d1{0,1}m1\mathsf{Ext}_{1}\colon\{0,1\}^{n_{1}}\times\{0,1\}^{d_{1}}\to\{0,1\}^{m_{1}} be the strong (k1=0.8n1,ε1)(k_{1}=0.8n_{1},\varepsilon_{1})-seeded extractor from Corollary 5.10 instantiated with i=2i=2 and n1=n/2n_{1}=n^{\prime}/2, which yields ε1=εn132c1k1\varepsilon_{1}=\varepsilon\geq n_{1}^{3}\cdot 2^{-c_{1}k_{1}}, d1C1loglogk1log(n/ε)d_{1}\leq C_{1}\log\log k_{1}\cdot\log(n^{\prime}/\varepsilon), and m1c1k1m_{1}\geq c_{1}k_{1}, for constants c1,C1>0c_{1},C_{1}>0 guaranteed by Corollary 5.10. Furthermore, let 𝖤𝗑𝗍2:{0,1}n2×{0,1}d2{0,1}m2\mathsf{Ext}_{2}\colon\{0,1\}^{n_{2}}\times\{0,1\}^{d_{2}}\to\{0,1\}^{m_{2}} be the strong (k2=0.8n2,ε2)(k_{2}=0.8n_{2},\varepsilon_{2})-seeded extractor from the “Consequently” part of Corollary 5.10 and n2=n/2n_{2}=n^{\prime}/2, which yields ε2=n232k2/2C2logk2\varepsilon_{2}=n_{2}^{3}\cdot 2^{-k_{2}/2^{C_{2}\log^{*}\!k_{2}}}, d2C2log(n/ε)d_{2}\leq C_{2}\log(n^{\prime}/\varepsilon), and m2k2/2C2logk2m_{2}\geq k_{2}/2^{C_{2}\log^{*}\!k_{2}}, for a constant C2>0C_{2}>0 guaranteed by Corollary 5.10. This choice of parameters ensures that m2d1m_{2}\geq d_{1}. Indeed, since kk1=k20.4nk\geq k_{1}=k_{2}\geq 0.4n^{\prime}, to see that m2d1m_{2}\geq d_{1} it suffices to check that

    0.4k2C2logkd1=C1loglogklog(n/ε1).\frac{0.4k}{2^{C_{2}\log^{*}\!k}}\geq d_{1}=C_{1}\log\log k\cdot\log(n^{\prime}/\varepsilon_{1}).

    Since ε1=ε=ε/5\varepsilon_{1}=\varepsilon^{\prime}=\varepsilon/5 and log(n/ε1)=O(log(k/ε))=O(logk+k/logk)=O(k/logk)\log(n^{\prime}/\varepsilon_{1})=O(\log(k/\varepsilon^{\prime}))=O(\log k+k/\log k)=O(k/\log k), it is enough that

    kC12C2logkloglogkklogkk\geq C^{\prime}_{1}\cdot 2^{C_{2}\log^{*}\!k}\log\log k\cdot\frac{k}{\log k}

    for a sufficiently large constant C1>0C^{\prime}_{1}>0, which holds whenever kk is larger than some appropriate absolute constant. Instantiating Lemma 2.23 with 𝖤𝗑𝗍1\mathsf{Ext}_{1} and 𝖤𝗑𝗍2\mathsf{Ext}_{2} above yields a strong (k1=0.8n1,k2=0.8n2,ε1+ε2)(k_{1}=0.8n_{1},k_{2}=0.8n_{2},\varepsilon_{1}+\varepsilon_{2})-block-source extractor 𝖡𝖤𝗑𝗍:{0,1}n1×{0,1}n2×{0,1}d2{0,1}m1\mathsf{BExt}\colon\{0,1\}^{n_{1}}\times\{0,1\}^{n_{2}}\times\{0,1\}^{d_{2}}\to\{0,1\}^{m_{1}}.

    Since XX^{\prime} is 3ε3\varepsilon^{\prime}-close to an (n1,n2,0.8)(n_{1},n_{2},0.8)-block source, we conclude that

    Y𝖡𝖤𝗑𝗍𝖡𝖤𝗑𝗍(X,Y𝖡𝖤𝗑𝗍)3ε+ε1+ε2Ud2+m1.Y_{\mathsf{BExt}}\circ\mathsf{BExt}(X^{\prime},Y_{\mathsf{BExt}})\approx_{3\varepsilon^{\prime}+\varepsilon_{1}+\varepsilon_{2}}U_{d_{2}+m_{1}}. (9)

We define the output of our final strong extractor 𝖤𝗑𝗍:{0,1}n×{0,1}d{0,1}m1\mathsf{Ext}\colon\{0,1\}^{n}\times\{0,1\}^{d}\to\{0,1\}^{m_{1}} to be 𝖡𝖤𝗑𝗍(X,Y𝖡𝖤𝗑𝗍)\mathsf{BExt}(X^{\prime},Y_{\mathsf{BExt}}). Since ε1,ε2ε\varepsilon_{1},\varepsilon_{2}\leq\varepsilon^{\prime}, Equation 9 implies that

Y𝖢𝗈𝗇𝖽Y𝖡𝖤𝗑𝗍𝖤𝗑𝗍(X,Y𝖢𝗈𝗇𝖽Y𝖡𝖤𝗑𝗍)5εUd+m1.Y_{\mathsf{Cond}}\circ Y_{\mathsf{BExt}}\circ\mathsf{Ext}(X,Y_{\mathsf{Cond}}\circ Y_{\mathsf{BExt}})\approx_{5\varepsilon^{\prime}}U_{d+m_{1}}.

This means that 𝖤𝗑𝗍\mathsf{Ext} is a strong (k,ε+5ε=ε)(k,\varepsilon^{\prime}+5\varepsilon^{\prime}=\varepsilon)-seeded extractor with seed length d=|Y𝖢𝗈𝗇𝖽|+|Y𝖡𝖤𝗑𝗍|=O(log(n/ε))d=|Y_{\mathsf{Cond}}|+|Y_{\mathsf{BExt}}|=O(\log(n/\varepsilon)) and output length m1c1k1c1km_{1}\geq c_{1}k_{1}\geq c^{\prime}_{1}k for an absolute constant c1>0c^{\prime}_{1}>0, where one of the ε\varepsilon^{\prime} terms in the error comes from fixing the seed in the condensing step of Item 1.

Time complexity.

Finally, we analyze the time complexity of 𝖤𝗑𝗍\mathsf{Ext}. If k2Clognlog2(n/ε)k\geq 2^{C\log^{*}\!n}\cdot\log^{2}(n/\varepsilon), then Item 1 runs in time O~(n)\widetilde{O}(n). In Item 3, 𝖤𝗑𝗍1\mathsf{Ext}_{1} and 𝖤𝗑𝗍2\mathsf{Ext}_{2} are both computable in time O~(n)\widetilde{O}(n) under this lower bound on kk, and thus so is 𝖡𝖤𝗑𝗍\mathsf{BExt}. We conclude that 𝖤𝗑𝗍\mathsf{Ext} runs in time O~(n)\widetilde{O}(n). Otherwise, if k<2Clognlog2(n/ε)k<2^{C\log^{*}\!n}\cdot\log^{2}(n/\varepsilon), then Item 1 runs in time O~(n)\widetilde{O}(n) after a preprocessing step, and 𝖤𝗑𝗍1\mathsf{Ext}_{1} and 𝖤𝗑𝗍2\mathsf{Ext}_{2} in Item 3 run in time O~(n)\widetilde{O}(n) after a preprocessing step. Therefore, overall, 𝖤𝗑𝗍\mathsf{Ext} runs in time O~(n)\widetilde{O}(n) after a preprocessing step. ∎

References

  • [ACG+22] Omar Alrabiah, Eshan Chattopadhyay, Jesse Goodman, Xin Li, and João Ribeiro. Low-degree polynomials extract from local sources. In International Colloquium on Automata, Languages, and Programming (ICALP), pages 10:1–10:20, 2022.
  • [AGHP92] Noga Alon, Oded Goldreich, Johan Håstad, and René Peralta. Simple constructions of almost kk-wise independent random variables. Random Structures & Algorithms, 3(3):289–304, 1992.
  • [AGMR24] Omar Alrabiah, Jesse Goodman, Jonathan Mosheiff, and João Ribeiro. Low-degree polynomials are good extractors. ECCC, 2024. https://eccc.weizmann.ac.il/report/2024/093/ (manuscript).
  • [Alo21] Noga Alon. Explicit expanders of every degree and size. Combinatorica, pages 1–17, 2021.
  • [BBCM95] Charles H. Bennett, Gilles Brassard, Claude Crépeau, and Ueli M. Maurer. Generalized privacy amplification. IEEE Transactions on Information Theory, 41(6):1915–1923, 1995.
  • [BG13] Andrej Bogdanov and Siyao Guo. Sparse extractor families for all the entropy. In Innovations in Theoretical Computer Science (ITCS), pages 553–560. ACM, 2013.
  • [BM74] Allan Borodin and Robert Moenck. Fast modular transforms. Journal of Computer and System Sciences, 8(3):366–386, 1974.
  • [Bog12] Andrej Bogdanov. Topics in (and out) the theory of computing: Lecture notes. https://andrejb.net/csc5060/notes/12L12.pdf, 2012. [Online; accessed October 2024].
  • [BRST02] Ziv Bar-Yossef, Omer Reingold, Ronen Shaltiel, and Luca Trevisan. Streaming computation of combinatorial objects. In Annual Conference on Computational Complexity (CCC), pages 165–174. IEEE, 2002.
  • [CG88] Benny Chor and Oded Goldreich. Unbiased bits from sources of weak randomness and probabilistic communication complexity. SIAM Journal on Computing, 17(2):230–261, 1988.
  • [CL18] Kuan Cheng and Xin Li. Randomness extraction in AC0 and with small locality. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques (APPROX/RANDOM), pages 37:1–37:20. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2018.
  • [CRSW13] L. Elisa Celis, Omer Reingold, Gil Segev, and Udi Wieder. Balls and bins: Smaller hash families and faster evaluation. SIAM Journal on Computing, 42(3):1030–1050, 2013.
  • [CT65] James W. Cooley and John W. Tukey. An algorithm for the machine calculation of complex Fourier series. Mathematics of Computation, 19(90):297–301, 1965.
  • [CW24] Kuan Cheng and Ruiyang Wu. Randomness extractors in AC0 and NC1: Optimal up to constant factors. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques (APPROX/RANDOM), pages 69:1–69:22. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2024.
  • [DD06] Jacques Dubrois and Jean-Guillaume Dumas. Efficient polynomial time algorithms computing industrial-strength primitive roots. Information Processing Letters, 97(2):41–45, 2006.
  • [DKSS13] Zeev Dvir, Swastik Kopparty, Shubhangi Saraf, and Madhu Sudan. Extensions to the method of multiplicities, with applications to Kakeya sets and mergers. SIAM Journal on Computing, 42(6):2305–2328, 2013.
  • [DMOZ22] Dean Doron, Dana Moshkovitz, Justin Oh, and David Zuckerman. Nearly optimal pseudorandomness from hardness. J. ACM, 69(6), November 2022.
  • [DORS08] Yevgeniy Dodis, Rafail Ostrovsky, Leonid Reyzin, and Adam Smith. Fuzzy extractors: How to generate strong keys from biometrics and other noisy data. SIAM Journal on Computing, 38(1):97–139, 2008.
  • [DPVR12] Anindya De, Christopher Portmann, Thomas Vidick, and Renato Renner. Trevisan’s extractor in the presence of quantum side information. SIAM Journal on Computing, 41(4):915–940, 2012.
  • [DT23] Dean Doron and Roei Tell. Derandomization with minimal memory footprint. In Computational Complexity Conference (CCC), pages 11:1–11:15. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2023.
  • [Für09] Martin Fürer. Faster integer multiplication. SIAM Journal on Computing, 39(3):979–1005, 2009.
  • [FWE+23] Cameron Foreman, Sherilyn Wright, Alec Edgington, Mario Berta, and Florian J. Curchod. Practical randomness amplification and privatisation with implementations on quantum computers. Quantum, 7:969, March 2023.
  • [FYEC24] Cameron Foreman, Richie Yeung, Alec Edgington, and Florian J. Curchod. Cryptomite: A versatile and user-friendly library of randomness extractors. arXiv e-prints, February 2024. https://arxiv.org/abs/2402.09481.
  • [GGH+24] Alexander Golovnev, Zeyu Guo, Pooya Hatami, Satyajeet Nagargoje, and Chao Yan. Hilbert functions and low-degree randomness extractors. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques (APPROX/RANDOM), pages 41:1–41:24. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2024.
  • [Gil98] David Gillman. A Chernoff bound for random walks on expander graphs. SIAM Journal on Computing, 27(4):1203–1220, 1998.
  • [GUV09] Venkatesan Guruswami, Christopher Umans, and Salil Vadhan. Unbalanced expanders and randomness extractors from Parvaresh–Vardy codes. J. ACM, 56(4), jul 2009.
  • [GVW15] Oded Goldreich, Emanuele Viola, and Avi Wigderson. On randomness extraction in AC0. In Conference on Computational Complexity (CCC), page 601–668. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2015.
  • [Hea08] Alexander D. Healy. Randomness-efficient sampling within NC1\textnormal{NC}^{1}. Computational Complexity, 17:3–37, 2008.
  • [HH15] Jan Hązła and Thomas Holenstein. Upper tail estimates with combinatorial proofs. In Symposium on Theoretical Aspects of Computer Science (STACS). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, 2015.
  • [HIV22] Xuangui Huang, Peter Ivanov, and Emanuele Viola. Affine extractors and AC0-parity. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques (APPROX/RANDOM), pages 9:1–9:14. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2022.
  • [HT16] Masahito Hayashi and Toyohiro Tsurumaru. More efficient privacy amplification with less random seeds via dual universal hash function. IEEE Transactions on Information Theory, 62(4):2213–2232, 2016.
  • [HV06] Alexander Healy and Emanuele Viola. Constant-depth circuits for arithmetic in finite fields of characteristic two. In Annual Symposium on Theoretical Aspects of Computer Science (STACS), pages 672–683. Springer, 2006.
  • [HvdH19] David Harvey and Joris van der Hoeven. Faster polynomial multiplication over finite fields using cyclotomic coefficient rings. Journal of Complexity, 54:101404, 2019.
  • [HvdH21] David Harvey and Joris van der Hoeven. Integer multiplication in time O(nlogn)O(n\mathrm{log}\,n). Annals of Mathematics, 193(2):563 – 617, 2021.
  • [HvdH22] David Harvey and Joris van der Hoeven. Polynomial multiplication over finite fields in time O(nlogn)O(n\mathrm{log}\,n). J. ACM, 69(2):1–40, 2022.
  • [Jus72] Jørn Justesen. Class of constructive asymptotically good algebraic codes. IEEE Transactions on Information Theory, 18(5):652–656, 1972.
  • [KT22] Itay Kalev and Amnon Ta-Shma. Unbalanced expanders from multiplicity codes. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques (APPROX/RANDOM), pages 12:1–12:14. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2022.
  • [Li15] Xin Li. Non-malleable condensers for arbitrary min-entropy, and almost optimal protocols for privacy amplification. In Theory of Cryptography Conference (TCC), pages 502–531. Springer, 2015.
  • [LRVW03] Chi-Jen Lu, Omer Reingold, Salil Vadhan, and Avi Wigderson. Extractors: Optimal up to constant factors. In Symposium on Theory of Computing (STOC), pages 602–611. ACM, 2003.
  • [Lu02] Chi-Jen Lu. Hyper-encryption against space-bounded adversaries from on-line strong extractors. In Advances in Cryptology — CRYPTO, pages 257–271. Springer, 2002.
  • [MPS12] Wolfgang Mauerer, Christopher Portmann, and Volkher B. Scholz. A modular framework for randomness extraction based on Trevisan’s construction. arXiv e-prints, December 2012. https://arxiv.org/abs/1212.0520.
  • [MRRR14] Raghu Meka, Omer Reingold, Guy N. Rothblum, and Ron D. Rothblum. Fast pseudorandomness for independence and load balancing. In International Colloquium on Automata, Languages, and Programming (ICALP), pages 859–870. Springer, 2014.
  • [MW97] Ueli Maurer and Stefan Wolf. Privacy amplification secure against active adversaries. In Advances in Cryptology — CRYPTO, pages 307–321. Springer, 1997.
  • [NN90] Joseph Naor and Moni Naor. Small-bias probability spaces: Efficient constructions and applications. In Symposium on Theory of Computing (STOC), pages 213–223. ACM, 1990.
  • [NT99] Noam Nisan and Amnon Ta-Shma. Extracting randomness: A survey and new constructions. Journal of Computer and System Sciences, 58(1):148–173, 1999.
  • [NZ96] Noam Nisan and David Zuckerman. Randomness is linear in space. Journal of Computer and System Sciences, 52(1):43–52, 1996.
  • [Rao07] Anup Rao. An exposition of Bourgain’s 2-source extractor. ECCC, 2007. https://eccc.weizmann.ac.il//report/2007/034/ (manuscript).
  • [RRV02] Ran Raz, Omer Reingold, and Salil Vadhan. Extracting all the randomness and reducing the error in Trevisan’s extractors. Journal of Computer and System Sciences, 65(1):97–128, 2002.
  • [RSW06] Omer Reingold, Ronen Shaltiel, and Avi Wigderson. Extracting randomness via repeated condensing. SIAM Journal on Computing, 35(5):1185–1209, 2006.
  • [RT00] Jaikumar Radhakrishnan and Amnon Ta-Shma. Bounds for dispersers, extractors, and depth-two superconcentrators. SIAM Journal on Discrete Mathematics, 13(1):2–24, 2000.
  • [Sch77] Arnold Schönhage. Schnelle multiplikation von polynomen über körpern der charakteristik 2. Acta Informatica, 7(4):395–398, 1977.
  • [Sho90] Victor Shoup. Searching for primitive roots in finite fields. In Symposium on Theory of Computing (STOC), pages 546–554. ACM, 1990.
  • [Shp92] Igor E. Shparlinski. On primitive elements in finite fields and on elliptic curves. Mathematics of the USSR-Sbornik, 71(1):41, feb 1992.
  • [Spi96] Daniel A. Spielman. Linear-time encodable and decodable error-correcting codes. IEEE Transactions on Information Theory, 42(6):1723–1731, 1996.
  • [SU05] Ronen Shaltiel and Christopher Umans. Simple extractors for all min-entropies and a new pseudorandom generator. J. ACM, 52(2):172–216, 2005.
  • [SZ99] Aravind Srinivasan and David Zuckerman. Computing with very weak random sources. SIAM Journal on Computing, 28(4):1433–1459, 1999.
  • [Ta-17] Amnon Ta-Shma. Explicit, almost optimal, epsilon-balanced codes. In Symposium on Theory of Computing (STOC), page 238–251. ACM, 2017.
  • [Tre01] Luca Trevisan. Extractors and pseudorandom generators. J. ACM, 48(4):860–879, jul 2001.
  • [TSSR11] Marco Tomamichel, Christian Schaffner, Adam Smith, and Renato Renner. Leftover hashing against quantum side information. IEEE Transactions on Information Theory, 57(8):5524–5535, 2011.
  • [TU12] Amnon Ta-Shma and Christopher Umans. Better condensers and new extractors from Parvaresh-Vardy codes. In Conference on Computational Complexity (CCC), pages 309–315. IEEE, 2012.
  • [TZS06] Amnon Ta-Shma, David Zuckerman, and Shmuel Safra. Extractors from Reed–Muller codes. Journal of Computer and System Sciences, 72(5):786–812, 2006.
  • [Vad04] Salil Vadhan. Constructing locally computable extractors and cryptosystems in the bounded-storage model. Journal of Cryptology, 17:43–77, 2004.
  • [Vad12] Salil Vadhan. Pseudorandomness. Foundations and Trends in Theoretical Computer Science, 7(1–3):1–336, 2012.
  • [vzGG13] Joachim von zur Gathen and Jürgen Gerhard. Modern Computer Algebra. Cambridge University Press, 2013.
  • [WZ99] Avi Wigderson and David Zuckerman. Expanders that beat the eigenvalue bound: Explicit construction and applications. Combinatorica, 19(1):125–138, 1999.
  • [XZ24] Zhiyang Xun and David Zuckerman. Near-optimal averaging samplers. ECCC, 2024. https://eccc.weizmann.ac.il/report/2024/097/ (manuscript).
  • [Zuc97] David Zuckerman. Randomness-optimal oblivious sampling. Random Structures & Algorithms, 11(4):345–367, 1997.