Documentation

CslibFrontier.Computability.QueryComplexity.Simon

Simon's problem: the classical randomized lower bound #

Simon's problem Simon, in the decision form of de Wolf, §3.1, §3.3.2: the input is a function f : {0,1}^n → {0,1}^n with the promise that for some s ∈ {0,1}^n, f(a) = f(b) exactly when b ∈ {a, a ⊕ s} (Cslib.QueryComplexity.SimonPromise f s); the task is to decide whether s ≠ 0. With s = 0 the promise says that f is injective (Cslib.QueryComplexity.simonPromise_zero_iff), and the hidden string is unique (Cslib.QueryComplexity.SimonPromise.eq).

The model. We work with bit queries: the input is the truth table X : Fin N → Bool of the N = n · 2^n output bits of f, with the positions identified with the pairs (a, j) (input a, output bit j) by an equivalence E : Fin N ≃ ({0,1}^n) × Fin n, and Cslib.QueryComplexity.simonFun E X is the function with f(a)_j = X(E⁻¹(a, j)) (de Wolf §3.1 views the problem in the same way, as a function of n 2^n binary variables). The matching quantum upper bound, in the same bit-query model, is in CslibFrontier/Computability/QueryComplexity/Quantum/Simon.lean. Both sides count bit queries, so the comparison is like for like. Simulating a value query f(a) by n bit queries transfers the lower bound below to value queries only up to that factor (q_v ≥ 2^{n/2} / n); the coupling argument, which uses only that q queries touch at most q inputs a, would give 2^n ≤ q_v² directly, but that is not formalized here.

The lower bound. A randomized decision tree that decides whether s ≠ 0 with error ε on every promise input has depth q with 2 (2^n - 1) (1 - 2ε) ≤ (q² - q)(1 - ε) (Cslib.QueryComplexity.simon_randomized_lower_bound); at ε = 1/3 this gives 2^n ≤ q² (Cslib.QueryComplexity.simon_two_pow_le_depth_sq), so q ≥ 2^{n/2}. In terms of the input length N = n 2^n this is q ≥ (N / n)^{1/2} = N^{1/2 - o(1)}.

Search versions. The search problem of de Wolf, §3.1 promises s ≠ 0 and asks for s. A randomized decision tree that finds s with error 1/3 on every promise input with s ≠ 0, with no requirement when s = 0, has depth q with 2^n ≤ (q + 2n)² (Cslib.QueryComplexity.simon_search_ne_zero_two_pow_le_sq): appending to every leaf s' the 2n bit queries of f(0) and f(s') and answering whether s' ≠ 0 and f(0) = f(s') decides Simon's problem with no larger error, since it answers false on every injective input. The variant that also requires the output 0 on injective inputs (s = 0) has the cleaner bound 2^n ≤ q² (Cslib.QueryComplexity.simon_search_two_pow_le_depth_sq), by answering whether the output is nonzero; as a requirement on more inputs, that is a weaker lower bound.

The proof is the birthday argument of de Wolf §3.3.2, arranged as a coupling. The hard inputs are f = π ∘ rep_s for a permutation π of {0,1}^n and rep_s(a) the representative of the pair {a, a ⊕ s} (Cslib.QueryComplexity.simonHard); for s = 0 these are the injective inputs. Fix a deterministic tree t of depth at most q and a nonzero s. If the set A of inputs a that t queries on π ∘ rep_s contains no pair {a, a ⊕ s}, then the involution that swaps a and a ⊕ s exactly when A meets {a, a ⊕ s} in an element other than the representative turns π into a permutation ρ with π ∘ rep_s = ρ on A; so t behaves identically on both inputs, and this is a bijection. Since |A| ≤ q, at most (q² - q)/2 nonzero strings s have a pair in A. Summing over s and π, a tree that answers false on c₀ injective hard inputs answers false (wrongly) on at least (2^n - 1 - (q² - q)/2) c₀ hard inputs with nonzero hidden strings. Averaging over the trees of the randomized tree, the answer false has probability at least 1 - ε on each injective input and at most ε on each input with a nonzero hidden string, which gives the inequality.

Main definitions #

Main results #

References #

def Cslib.QueryComplexity.simonFun {N n : ℕ} (E : Fin N ≃ (Fin n → Bool) × Fin n) (X : Fin N → Bool) (a : Fin n → Bool) :
Fin n → Bool

The Simon function whose truth table is X: f(a)_j = X(E⁻¹(a, j)).

def Cslib.QueryComplexity.SimonPromise {n : ℕ} (f : (Fin n → Bool) → Fin n → Bool) (s : Fin n → Bool) :

Simon's promise with hidden string s: f a = f b exactly when b ∈ {a, a + s}, where + is bitwise exclusive or.

def Cslib.QueryComplexity.simonInput {N n : ℕ} (E : Fin N ≃ (Fin n → Bool) × Fin n) (g : (Fin n → Bool) → Fin n → Bool) :
Fin N → Bool

The truth table of g: position i holds the bit g(a)_j for (a, j) = E i.

@[simp]
theorem Cslib.QueryComplexity.simonFun_simonInput {N n : ℕ} (E : Fin N ≃ (Fin n → Bool) × Fin n) (g : (Fin n → Bool) → Fin n → Bool) :

Simon's promise with hidden string 0 says that f is injective.

theorem Cslib.QueryComplexity.SimonPromise.eq {n : ℕ} {f : (Fin n → Bool) → Fin n → Bool} {s s' : Fin n → Bool} (h : SimonPromise f s) (h' : SimonPromise f s') :
s = s'

The hidden string of Simon's promise is unique.

noncomputable def Cslib.QueryComplexity.simonHard {N n : ℕ} (E : Fin N ≃ (Fin n → Bool) × Fin n) (π : Equiv.Perm (Fin n → Bool)) (s : Fin n → Bool) :
Fin N → Bool

The hard input with permutation π and hidden string s: f = π ∘ rep_s.

theorem Cslib.QueryComplexity.simonPromise_simonHard {N n : ℕ} (E : Fin N ≃ (Fin n → Bool) × Fin n) (π : Equiv.Perm (Fin n → Bool)) (s : Fin n → Bool) :
theorem Cslib.QueryComplexity.simon_randomized_lower_bound {N n : ℕ} (E : Fin N ≃ (Fin n → Bool) × Fin n) (μ : RandomizedDecisionTree (Fin N) Bool) (F : (Fin N → Bool) → Bool) {ε : ℝ} (hF : ∀ (X : Fin N → Bool) (s : Fin n → Bool), SimonPromise (simonFun E X) s → F X = decide (s ≠ 0)) (hμ : ∀ (X : Fin N → Bool) (s : Fin n → Bool), SimonPromise (simonFun E X) s → μ.errorProb F X ≤ ε) (hε : ε ≤ 1) :
2 * (2 ^ n - 1) * (1 - 2 * ε) ≤ ↑(μ.depth * μ.depth - μ.depth) * (1 - ε)

The classical randomized lower bound for Simon's problem: a randomized decision tree that decides whether the hidden string is nonzero with error ε on every promise input has depth q with 2 (2^n - 1) (1 - 2ε) ≤ (q² - q)(1 - ε).

theorem Cslib.QueryComplexity.simon_randomized_lower_bound_third {N n : ℕ} (E : Fin N ≃ (Fin n → Bool) × Fin n) (μ : RandomizedDecisionTree (Fin N) Bool) (F : (Fin N → Bool) → Bool) (hF : ∀ (X : Fin N → Bool) (s : Fin n → Bool), SimonPromise (simonFun E X) s → F X = decide (s ≠ 0)) (hμ : ∀ (X : Fin N → Bool) (s : Fin n → Bool), SimonPromise (simonFun E X) s → μ.errorProb F X ≤ 1 / 3) :
2 ^ n - 1 ≤ μ.depth * μ.depth - μ.depth

The classical lower bound at error 1/3: 2^n - 1 ≤ q² - q.

theorem Cslib.QueryComplexity.simon_two_pow_le_depth_sq {N n : ℕ} (E : Fin N ≃ (Fin n → Bool) × Fin n) (μ : RandomizedDecisionTree (Fin N) Bool) (F : (Fin N → Bool) → Bool) (hF : ∀ (X : Fin N → Bool) (s : Fin n → Bool), SimonPromise (simonFun E X) s → F X = decide (s ≠ 0)) (hμ : ∀ (X : Fin N → Bool) (s : Fin n → Bool), SimonPromise (simonFun E X) s → μ.errorProb F X ≤ 1 / 3) (hn : 1 ≤ n) :
2 ^ n ≤ μ.depth ^ 2

Exponential classical lower bound: for n ≥ 1, a randomized decision tree that decides Simon's problem with error 1/3 has depth q with 2^n ≤ q², so q ≥ 2^{n/2}.

theorem Cslib.QueryComplexity.simon_two_pow_le_randomizedComplexity_sq {N n : ℕ} (E : Fin N ≃ (Fin n → Bool) × Fin n) (F : (Fin N → Bool) → Bool) (hF : ∀ (X : Fin N → Bool) (s : Fin n → Bool), SimonPromise (simonFun E X) s → F X = decide (s ≠ 0)) (hn : 1 ≤ n) :
2 ^ n ≤ randomizedComplexity (1 / 3) F ^ 2

Exponential classical lower bound, as a randomized query complexity: for n ≥ 1 and every total function F that answers Simon's problem on the promise inputs, 2^n ≤ R_{1/3}(F)².

theorem Cslib.QueryComplexity.simon_search_two_pow_le_depth_sq {N n : ℕ} (E : Fin N ≃ (Fin n → Bool) × Fin n) (μ : RandomizedDecisionTree (Fin N) (Fin n → Bool)) (S : (Fin N → Bool) → Fin n → Bool) (hS : ∀ (X : Fin N → Bool) (s : Fin n → Bool), SimonPromise (simonFun E X) s → S X = s) (hμ : ∀ (X : Fin N → Bool) (s : Fin n → Bool), SimonPromise (simonFun E X) s → μ.errorProb S X ≤ 1 / 3) (hn : 1 ≤ n) :
2 ^ n ≤ μ.depth ^ 2

Exponential classical lower bound for the search variant including s = 0: for n ≥ 1, a randomized decision tree that finds the hidden string with error 1/3 on every promise input, including the injective inputs, where it must output 0 (as the restriction to the promise inputs of a total function S), has depth q with 2^n ≤ q². Answering whether its output is nonzero decides Simon's problem with no further queries and no larger error (Cslib.RandomizedDecisionTree.errorProb_mapOutput_le). This does not cover trees that only find nonzero hidden strings, as in the search problem of de Wolf, §3.1; for those see Cslib.QueryComplexity.simon_search_ne_zero_two_pow_le_sq.

theorem Cslib.QueryComplexity.simon_search_ne_zero_two_pow_le_sq {N n : ℕ} (E : Fin N ≃ (Fin n → Bool) × Fin n) (μ : RandomizedDecisionTree (Fin N) (Fin n → Bool)) (S : (Fin N → Bool) → Fin n → Bool) (hS : ∀ (X : Fin N → Bool) (s : Fin n → Bool), SimonPromise (simonFun E X) s → s ≠ 0 → S X = s) (hμ : ∀ (X : Fin N → Bool) (s : Fin n → Bool), SimonPromise (simonFun E X) s → s ≠ 0 → μ.errorProb S X ≤ 1 / 3) (hn : 1 ≤ n) :
2 ^ n ≤ (μ.depth + 2 * n) ^ 2

Exponential classical lower bound for the search problem with a nonzero hidden string, as stated by de Wolf, §3.1: for n ≥ 1, a randomized decision tree that finds the hidden string with error 1/3 on every promise input with s ≠ 0 (as the restriction of a total function S) has depth q with 2^n ≤ (q + 2n)², so q ≥ 2^{n/2} - 2n. Nothing is required on the inputs with s = 0. The proof appends to every leaf s' the 2n bit queries of f(0) and f(s') and answers whether s' ≠ 0 and f(0) = f(s') (Cslib.RandomizedDecisionTree.mapTree); this answers false on every injective input and is correct whenever the output s' is, so it decides Simon's problem with error 1/3.