We show the intuitive fact: “if you can distinguish something from random, you can guess it better than random chance”.

Let b:{±1}n{±1} be some supposedly hard function. If there is an algorithm A that, knowing x, can distinguish b(x) from a random bit with some advantage, then there is some algorithm A that guesses b(x) from x with better than random chance. More precisely, if

|Prx{±1}n[A(x,b(x))=1]Prx{±1}n,b{±1}[A(x,b)=1]|ϵ,

then max(|E[A(x,1)b(x)]|,|E[A(x,1)b(x)]|)2ϵ: that is, either A(x):=A(x,1) or A(x):=A(x,1) has a correlation of at least 2ϵ with b(x).

This trick is useful when proving the existence of pseudorandom generators from hard-core bits: it shows that if some b(x) is hard to guess (in the sense that no fast algorithm correlates with it much), then b(x) must look random to any fast algorithm that knows only x.

Note that depending on the context, we might only want to give A restricted access to x. In this case, we can replace A(x,) by A(f(x),) for some function f, and A becomes either A(f(x),1) or A(f(x),1).

Proof

We will show that, in fact,

Pr[A(x,b(x))=1]Pr[A(x,b)=1]=E[A(x,1)b(x)]E[A(x,1)b(x)]4.

So if the absolute value of the LHS is at least ϵ, then at least one of the terms in the RHS has to have absolute value 2ϵ.

First,

Pr[A(f(x),b(x))=1]Pr[A(f(x),b)=1]=E[A(f(x),b(x))]E[A(f(x),b)]2=E[A(f(x),b(x))]E[A(f(x),b(x))]+E[A(f(x),b(x))]22=E[A(f(x),b(x))]E[A(f(x),b(x))]4.

Then, we can observe that

E[A(f(x),b(x))]E[A(f(x),b(x))]=E[A(f(x),b(x))A(f(x),b(x))]=E[A(f(x),1)b(x)A(f(x),1)b(x)]=E[A(f(x),1)b(x)]E[A(f(x),1)b(x)]

where the second equality holds pointwise (just check both possible values of b(x)).