Documentation

CslibFrontier.Computability.Circuit.Boolean.HardnessAmplification.GLAmpDecode

Goldreich–Levin decoding of the amplified function #

Let h be a predictor for glAmp f k = (f^k)^GL. For a tuple y of k blocks, the Goldreich–Levin candidate for r ↦ h (y, r), with K fixed masks and a guess of their parities, is a guess for f^k (y) = (f (y i))ᵢ (Cslib.Circuits.Boolean.glAmpCandidate). With the true guess for h = glAmp f k it is exactly f^k (Cslib.Circuits.Boolean.glAmpCandidate_glAmp).

Claim 4.4 in library form (Cslib.Circuits.Boolean.dens_filter_glAmpCandidate_agree). Suppose h agrees with glAmp f k on a 1 / 2 + γ fraction of the inputs, and k ≤ 2 * (γ / 2) ^ 2 * (2 ^ K - 1). Then for at least a γ / 2 ^ (K + 3) fraction of the masks and guesses, the candidate equals f^k on at least a γ / 2 ^ (K + 3) fraction of the tuples [Carmosino, Impagliazzo, Kabanets and Kolokolova, Claim 4.4, pp. 10:15–10:16] [CIKK16]. The proof follows the source: by averaging, a γ / 2 fraction of the tuples have agreement 1 / 2 + γ / 2 over the masks r (Cslib.Crypto.GoldreichLevin.dens_filter_agreement_ge), and Goldreich–Levin decoding is applied to each of them (Cslib.Crypto.GoldreichLevin.dens_filter_candidate_eq_ge).

Two deviations from the source are labelled here:

Each output bit of the candidate, as a function of the flat input x read in blocks (BitString.block x), has a De Morgan circuit with at most (2 ^ K - 1) * (s + 1) + (4 + 2 * (2 ^ K - 1) * (2 ^ K + 1)) gates when h has one with s (Cslib.Circuits.Boolean.complexity_glAmpCandidate_apply_le). The same bound holds when h is computed from q answer bits and its input by a circuit with s gates, and the candidate reads those answer bits as inputs too (Cslib.Circuits.Boolean.complexity_glAmpCandidate_answers_apply_le). Running time is not certified.

Main definitions #

Main results #

References #

def Cslib.Circuits.Boolean.glAmpCandidate {n k K : ℕ} (h : BooleanFunction (k * n + k)) (masks : Fin K → BitString k) (guess : BitString K) (y : Fin k → BitString n) :

The Goldreich–Levin candidate for f^k. At a tuple y of k blocks of n bits, the corrected-majority candidate for the parities predicted by r ↦ h (y, r), with the masks masks and the guess guess of their parities.

theorem Cslib.Circuits.Boolean.glAmpCandidate_apply {n k K : ℕ} (h : BooleanFunction (k * n + k)) (masks : Fin K → BitString k) (guess : BitString K) (y : Fin k → BitString n) :
glAmpCandidate h masks guess y = Crypto.GoldreichLevin.candidate (fun (r : BitString k) => h (Fin.append (BitString.blocksEquiv.symm y) r)) masks guess

Unfolding glAmpCandidate, whose body is not exposed.

theorem Cslib.Circuits.Boolean.glAmpCandidate_glAmp {n k K : ℕ} (f : BooleanFunction n) (hK : 0 < K) (masks : Fin K → BitString k) (y : Fin k → BitString n) :
glAmpCandidate (glAmp f k) masks (fun (j : Fin K) => (fun (i : Fin k) => f (y i)) ⬝ᵥ masks j) y = fun (i : Fin k) => f (y i)

For the exact predictor glAmp f k and the true guess, the candidate is f^k.

theorem Cslib.Circuits.Boolean.dens_filter_glAmpCandidate_agree {n k K : ℕ} (f : BooleanFunction n) (h : BooleanFunction (k * n + k)) {γ : ℝ} (hγ : 0 < γ) (hagree : (1 / 2 + γ) * 2 ^ (k * n + k) ≤ ↑{y : BitString (k * n + k) | h y = glAmp f k y}.card) (hK : 0 < K) (hsize : ↑k ≤ 2 * (γ / 2) ^ 2 * ↑(2 ^ K - 1)) :
γ / 2 ^ (K + 3) ≤ ↑{mg : (Fin K → BitString k) × BitString K | γ / 2 ^ (K + 3) * 2 ^ (k * n) ≤ ↑{y : Fin k → BitString n | ∀ (i : Fin k), glAmpCandidate h mg.1 mg.2 y i = f (y i)}.card}.dens

Claim 4.4 of Carmosino, Impagliazzo, Kabanets and Kolokolova, in library form. If h agrees with glAmp f k on a 1 / 2 + γ fraction of the inputs, K ≥ 1 and k ≤ 2 * (γ / 2) ^ 2 * (2 ^ K - 1), then for at least a γ / 2 ^ (K + 3) fraction of the masks and guesses, the candidate equals f^k on at least a γ / 2 ^ (K + 3) fraction of the tuples. The list has 2 ^ K = O(k / γ²) entries instead of the source's O(1 / γ²), and the statement is per seed rather than for a random list element; see the module docstring.

theorem Cslib.Circuits.Boolean.glAmpCandidate_block {n k K : ℕ} (h : BooleanFunction (k * n + k)) (masks : Fin K → BitString k) (guess : BitString K) (x : BitString (k * n)) :
glAmpCandidate h masks guess (BitString.block x) = Crypto.GoldreichLevin.candidate (fun (r : BitString k) => h (Fin.append x r)) masks guess

The candidate at the blocks of a flat input x is the Goldreich–Levin candidate for r ↦ h (x, r).

theorem Cslib.Circuits.Boolean.complexity_glAmpCandidate_apply_le {n k K : ℕ} {h : BooleanFunction (k * n + k)} {s : ℕ} (hh : complexity interpretation (single h) ≤ s) (masks : Fin K → BitString k) (guess : BitString K) (j : Fin k) :
complexity interpretation (single fun (x : BitString (k * n)) => glAmpCandidate h masks guess (BitString.block x) j) ≤ (2 ^ K - 1) * (s + 1) + (4 + 2 * (2 ^ K - 1) * (2 ^ K + 1))

The circuit complexity of the candidate. If h has a De Morgan circuit with at most s gates, each output bit of the candidate, as a function of the flat input read in blocks, has one with at most (2 ^ K - 1) * (s + 1) + (4 + 2 * (2 ^ K - 1) * (2 ^ K + 1)) gates: two constants, 2 ^ K - 1 copies of h, each with at most one negation, and a strict majority.

theorem Cslib.Circuits.Boolean.complexity_glAmpCandidate_answers_apply_le {n k K q : ℕ} {F : BooleanFunction (q + (k * n + k))} {s : ℕ} (hF : complexity interpretation (single F) ≤ s) (masks : Fin K → BitString k) (guess : BitString K) (j : Fin k) :
complexity interpretation (single fun (wx : BitString (q + k * n)) => glAmpCandidate (fun (y : BitString (k * n + k)) => F (Fin.append (fun (i : Fin q) => wx (Fin.castAdd (k * n) i)) y)) masks guess (BitString.block fun (i : Fin (k * n)) => wx (Fin.natAdd q i)) j) ≤ (2 ^ K - 1) * (s + 1) + (4 + 2 * (2 ^ K - 1) * (2 ^ K + 1))

The candidate with the predictor's answers as inputs. Let the predictor be computed by a De Morgan circuit F from q answer bits w and its input, so that it is y ↦ F (w ++ y). Then each output bit of the candidate, as a function of w and the flat tuple read in blocks, has the bound of complexity_glAmpCandidate_apply_le with s gates for F. Reordering the inputs of F costs no gates.