Post · 8 min read· pp. 547–550
Scribed by Jonah Sherman
Summary
Today we prove the Goldreich-Levin theorem.
1. Goldreich-Levin Theorem
We use the notation
⟨x,r⟩:=i∑xirimod2 (1)
Theorem 1 (Goldreich and Levin) Let f:{0,1}n→{0,1}n be a permutation computable in time r. Suppose that A is an algorithm of complexity t such that
*
Px,r[A(f(x),r)=⟨x,r⟩]≥21+ϵ (2)
Then there is an algorithm A′ of complexity at most O((t+r)ϵ−2nO(1)) such that
Px[A′(f(x))=x]≥4ϵ *
Last time we proved the following partial result.
Lemma 2 (Goldreich-Levin Algorithm — Weak Version) Suppose we have access to a function H:{0,1}n→{0,1} such that, for some unknown x, we have
*
Pr∈{0,1}n[H(r)=⟨x,r⟩]≥87 (3)
where x∈{0,1}n is an unknown string.*
Then there is an algorithm GLW that runs in time O(n2logn) and makes O(nlogn) oracle queries into H and, with probability at least 1−n1, outputs x.
This gave us a proof of a variant of the Goldreich-Levin Theorem in which the right-hand-side in (2) was 1615. We could tweak the proof Lemma 2 so that the right-hand-side of (4) is 43+ϵ, leading to proving a variant of the Goldreich-Levin Theorem in which the right-hand-side in (2) is also 43+ϵ.
We need, however, the full Goldreich-Levin Theorem in order to construct a pseudorandom generator, and so it seems that we have to prove a strengthening of Lemma 2 in which the right-hand-side in (4) is 21+ϵ.
Unfortunately such a stronger version of Lemma 2 is just false: for any two different x,x′∈{0,1}n we can construct an H such that
Pr∼{0,1}n[H(r)=⟨x,r⟩]=43
and
Pr∼{0,1}n[H(r)=⟨x′,r⟩]=43
so no algorithm can be guaranteed to find x given an arbitrary function H such that P[H(r)=⟨x,r⟩]=43, because x need not be uniquely defined by H.
We can, however, prove the following:
Lemma 3 (Goldreich-Levin Algorithm) Suppose we have access to a function H:{0,1}n→{0,1} such that, for some unknown x, we have
*
Pr∈{0,1}n[H(r)=⟨x,r⟩]≥21+ϵ (4)
where x∈{0,1}n is an unknown string, and ϵ>0 is given.*
Then there is an algorithm GL that runs in time O(n2ϵ−4logn), makes O(nϵ−4logn) oracle queries into H, and outputs a set L⊆{0,1}n such that ∣L∣=O(ϵ−2) and with probability at least 1/2, x∈L.
The Goldreich-Levin algorithm GL has other interpretations (an algorithm that learns the Fourier coefficients of H, an algorithm that decodes the Hadamard code is sub-linear time) and various applications outside cryptography.
The Goldreich-Levin Theorem is an easy consequence of Lemma 3. Let A′ take input y and then run the algorithm of Lemma 3 with H(r)=A(y,r), yielding a list L. A′ then checks if f(x)=y for any x∈L, and outputs it if one is found.
From the assumption that
Px,r[A(f(x),r)=⟨x,r⟩]≥21+ϵ
it follows by Markov’s inequality (See Lemma 9 in the last lecture) that
Px[Pr[A(f(x),r)=⟨x,r⟩]≥21+2ϵ]≥2ϵ
Let us call an x such that Pr[A(f(x),r)=⟨x,r⟩]≥21+2ϵ a good x. If we pick x at random and give f(x) to the above algorithm, there is a probability at least ϵ/2 that x is good and, if so, there is a probability at least 1/2 that x is in the list. Therefore, there is a probability at least ϵ/4 that the algorithm inverts f(), where the probability is over the choices of x and over the internal randomness of the algorithm.
2. The Goldreich-Levin Algorithm
In this section we prove Lemma 3.
We are given an oracle H() such that H(r)=⟨x,r⟩ for an 1/2+ϵ fraction of the r. Our goal will be to use H() to simulate an oracle that has agreement 7/8 with ⟨x,r⟩, so that we can use the algorithm of Lemma 2 the previous section to find x. We perform this “reduction” by “guessing” the value of ⟨x,r⟩ at a few points.
We first choose k random points r1…rk∈{0,1}n where k=O(1/ϵ2). For the moment, let us suppose that we have “magically” obtained the values ⟨x,r1⟩,…,⟨x,rk⟩. Then define H′(r) as the majority value of:
H(r+rj)−⟨x,rj⟩ j=1,2,…,k (5)
For each j, the above expression equals ⟨x,r⟩ with probability at least 21+ϵ (over the choices of rj) and by choosing k=O(1/ϵ2) we can ensure that
Pr,r1,…,rk[H′(r)=⟨x,r⟩]≥3231. (6)
from which it follows that
Pr1,…,rk[Pr[H′(r)=⟨x,r⟩]≥87]≥43. (7)
Consider the following algorithm.
- Algorithm GL-First-Attempt
- pick r1,…,rk∈{0,1}n where k=O(1/ϵ2)
- for all b1,…,bk∈{0,1}
- define Hb1…bk′(r) as majority of: H(r+rj)−bj
- apply Algorithm GLW to Hb1…bt′
- add result to list
- return list
The idea behind this program is that we do not in fact know the values ⟨x,rj⟩, but we can “guess” them by considering all choices for the bits bj. If H(r) agrees with ⟨x,r⟩ for at least a 1/2+ϵ fraction of the rs, then there is a probability at least 3/4 that in one of the iteration we invoke algorithm GLW with a simulated oracle that has agreement 7/8 with ⟨x,r⟩. Therefore, the final list contains x with probability at least 3/4−1/n>1/2.
The obvious problem with this algorithm is that its running time is exponential in k=O(1/ϵ2) and the resulting list may also be exponentially larger than the O(1/ϵ2) bound promised by the Lemma.
To overcome these problems, consider the following similar algorithm.
- Algorithm GL
- pick r1,…,rt∈{0,1}n where k=logO(1/ϵ2)
- define rS:=∑j∈Srj for each non-empty S⊆{1,…,t}
- for all b1,…,bt∈{0,1}
- define bS:=∑j∈Sbj for each non-empty S⊆{1,…,t}
- define Hb1…bk′(r) as majority of: H(r+rS)−bS over non-empty S
- apply Algorithm GLW to Hb1…bt′
- add result to list
- return list
Let us now see why this algorithm works. First we define, for any nonempty S⊆{1,…,t}, rS=∑j∈Srj. Then, since r1,…,rt∈{0,1}n are random, it follows that for any S=T, rS and rT are independent and uniformly distributed. Now consider an x such that ⟨x,r⟩ and H(r) agree on a 21+ϵ fraction of the values of r. Then for the choice of {bj} where bj=⟨x,rj⟩ for all j, we have that
bS=⟨x,rS⟩
for every non-empty S. In such a case, for every S and every r, there is a probability at least 21+ϵ, over the choices of the rj that
H(r+rS)−bS=⟨x,r⟩ ,
and these events are pair-wise independent. Note the following simple lemma.
Lemma 4 Let R1,…,Rk be a set of pairwise independent 0−1 random variables, each of which is 1 with probability at least 21+ϵ. Then P[∑iRi≥k/2]≥1−4ϵ2k1.
Proof: Let R=R1+⋯+Rt. The variance of a 0/1 random variable is at most 1/4, and, because of pairwise independence, Var[R]=Var[R1+…+Rk]=∑iVar[Rk]≤k/4.
We then have
P[R≤k/2]≤P[∣R−E[R]∣≥ϵk]≤ϵ2k2Var[R]≤4ϵ2k1
Lemma 4 allows us to upper-bound the probability that the majority operation used to compute H′ gives the wrong answer. Combining this with our earlier observation that the {rS} are pairwise independent, we see that choosing t=log(128/ϵ2) suffices to ensure that Hb1…bt′(r) and ⟨x,r⟩ have agreement at least 7/8 with probability at least 3/4. Thus we can use Algorithm A87 to obtain x with high probability. Choosing t as above ensures that the list generated is of length at most 2t=128/ϵ2 and the running time is then O(n2ϵ−4logn) with O(nϵ−4logn) oracle accesses, due to the O(1/ϵ2) iterations of Algorithm GLW, that makes O(nlogn) oracle accesses, and to the fact that one evaluation of H′() requires O(1/ϵ2) evaluations of H().