Lower bounds of Nayak and Wu for approximate counting, median, and selection #
This module derives the statistical query lower bounds of Nayak and Wu from the
adversary weight-layer promise bound
Cslib.Quantum.one_sub_mul_add_le_four_mul_mul_abs_sub_of_weight
and the value-query simulation results in
CslibFrontier/Computability/QueryComplexity/Quantum/ValueQuery.lean.
Let T be the query count of a quantum algorithm whose failure probability on every valid input is
at most ε (2 * ε ≤ 1), measured through a multi-outcome classical readout of its final basis
state (measureProb ... (univ.filter ...), connected to Cslib.Quantum.measureOut via
Cslib.Quantum.le_measureProb_of_le_measureOut):
- Approximate counting ([NW99], Theorem 1.11): for a Boolean oracle input
x : BitString nwithtones, outputtingy : ℝwith|y - t| < Δ(1 / 2 ≤ Δ,4 * Δ ≤ n) satisfies(1 - 2√(ε(1-ε))) (√(n / Δ) + √(t (n - t)) / Δ) ≤ 16 T, and at error1 / 3gives√(n / Δ) + √(t (n - t)) / Δ ≤ 288 T(Cslib.Quantum.one_sub_mul_approxCount_le,Cslib.Quantum.approxCount_lower_bound). For0 < Δ ≤ 1 / 2and1 ≤ n, exact-precision counting still requires(1 - 2√(ε(1-ε))) (√n + √(t (n - t))) ≤ 4 T(Cslib.Quantum.one_sub_mul_exactCount_le). - Approximate
k-th smallest element ([NW99], Theorem 1.5): in the value-query model on an ordered sequenceX : ι → αof lengthn = |ι|(1 ≤ k ≤ n,1 ≤ Δ,4 * Δ ≤ n), outputting an elementyofXwhose rank lies strictly in(k - Δ, k + Δ)(or even anyysatisfyingCslib.Quantum.IsApproxKthSmallestRelaxed) requires(1 - 2√(ε(1-ε))) (√(n / Δ) + √(k (n - k)) / Δ) ≤ 32 Tfor general unitary value oracles (≤ 576 Tat error1 / 3), and≤ 16 T(≤ 288 Tat error1 / 3) when the two-value oracle step has an involutive difference such as an XOR oracle (Cslib.Quantum.one_sub_mul_kthSmallest_le,Cslib.Quantum.one_sub_mul_kthSmallest_le_of_involution,Cslib.Quantum.kthSmallest_lower_bound). An algorithm returning only an indexi : ιrather than the valueX isatisfies the same bound onT + 1(Cslib.Quantum.one_sub_mul_kthSmallest_index_le,Cslib.Quantum.kthSmallest_index_lower_bound). - Approximate median ([NW99], Corollary 1.6): for
0 < δ < 1and1 ≤ n, outputting aδ-approximate median (Cslib.Quantum.IsApproxMedian) ofX : ι → αrequires(1 - 2√(ε(1-ε))) min (1 / δ) n ≤ 24 T(≤ 12 Tfor involutive-difference oracles, andmin (1 / δ) n ≤ 432 T, in particular1 / δ ≤ 432 Twhen1 ≤ δ n, at error1 / 3;Cslib.Quantum.one_sub_mul_median_le,Cslib.Quantum.median_lower_bound), with the correspondingT + 1bound for index-returning algorithms.
Notice the T + 1 shift for index-returning algorithms: at n = 3 and δ = 1 / 3, returning a
uniformly random index i : Fin 3 in 0 queries already yields an exact median x_i with
probability at least 2 / 3 on every 0/1 input, whereas outputting the value x_i itself cannot
avoid at least one query.
Main definitions #
Cslib.Quantum.IsApproxMedian:δ-approximate median predicate onι → α.Cslib.Quantum.IsKthSmallest,Cslib.Quantum.IsApproxKthSmallest,Cslib.Quantum.IsApproxKthSmallestRelaxed:j-th smallest andΔ-approximatek-th smallest predicates onι → α.
Main results #
Cslib.Quantum.one_sub_mul_exactCount_le,Cslib.Quantum.one_sub_mul_approxCount_le,Cslib.Quantum.approxCount_lower_bound: Theorem 1.11 of [NW99].Cslib.Quantum.one_sub_mul_kthSmallest_le,Cslib.Quantum.one_sub_mul_kthSmallest_le_of_involution,Cslib.Quantum.kthSmallest_lower_bound,Cslib.Quantum.one_sub_mul_kthSmallest_index_le: Theorem 1.5 of [NW99].Cslib.Quantum.one_sub_mul_median_le,Cslib.Quantum.one_sub_mul_median_le_of_involution,Cslib.Quantum.median_lower_bound,Cslib.Quantum.one_sub_mul_median_index_le: Corollary 1.6 of [NW99].
References #
- A. Nayak, F. Wu, The quantum query complexity of approximating the median and related statistics, Theorem 1.5, Corollary 1.6, Theorem 1.11 (arXiv:quant-ph/9804066v2).
Problem definitions #
y is a δ-approximate median of X : ι → α ([NW99], Problem 1) when fewer
than (1 + δ) |ι| / 2 entries are strictly smaller than y and fewer than (1 + δ) |ι| / 2
entries are strictly larger than y.
Monotonicity of IsApproxMedian in the tolerance δ.
y is a j-th smallest element (1-indexed) of X : ι → α: at most j - 1 entries are
strictly less than y, and at least j entries are at most y.
y is a Δ-approximate k-th smallest element of X : ι → α ([NW99],
Problem 2): y is a j-th smallest element of X for some 1 ≤ j ≤ |ι| with
k - Δ < j < k + Δ.
Relaxed Δ-approximate k-th smallest condition not requiring y to appear in X: y
still lies between the minimum and maximum of X and satisfies the rank bounds implied by
IsApproxKthSmallest.
Every Δ-approximate k-th smallest element satisfies the relaxed rank condition.
Converts an ENNReal lower bound on (measureOut ψ hψ out).toOuterMeasure {b | P b} into a
measureProb lower bound on univ.filter fun y => P (out y).
Algebraic and error-1/3 helpers #
Theorem 1.11: Δ-approximate counting #
Core step of Theorem 1.11 ([NW99]): for 0 < Δ and d = ⌈2Δ⌉₊ with either
t + d ≤ n or d ≤ t, any T-query algorithm approximating weight x within < Δ with error
ε ≤ 1/2 satisfies (1 - 2√(ε(1-ε))) (√(n d) + √(t (n - t))) ≤ 4 T d.
Exact-precision counting (0 < Δ ≤ 1 / 2) ([NW99], Theorem 1.11): for 1 ≤ n
and 0 < Δ ≤ 1 / 2, approximating the Hamming weight within < Δ requires
(1 - 2√(ε(1-ε))) (√n + √(t (n - t))) ≤ 4 T queries.
Theorem 1.11 ([NW99]): any T-query algorithm approximating the Hamming weight of
every x : BitString n within additive error < Δ (1 / 2 ≤ Δ, 4 * Δ ≤ n) with failure
probability at most ε ≤ 1 / 2 satisfies
(1 - 2√(ε(1-ε))) (√(n / Δ) + √(t (n - t)) / Δ) ≤ 16 T on inputs of weight t ≤ n.
Bounded-error (ε = 1 / 3) form of Theorem 1.11 ([NW99]):
√(n / Δ) + √(t (n - t)) / Δ ≤ 288 T.
Shared Boolean-simulation adversary bridge #
Theorem 1.5: Δ-approximate k-th smallest element #
Theorem 1.5 (arbitrary unitary oracle, two-valued domain) ([NW99]): any T-query
value-query algorithm outputting an element satisfying IsApproxKthSmallestRelaxed on all
{a₀, a₁}-valued inputs (a₀ < a₁) with failure probability ε ≤ 1 / 2 satisfies
(1 - 2√(ε(1-ε))) (√(|ι| / Δ) + √(k (|ι| - k)) / Δ) ≤ 32 T.
Theorem 1.5 (arbitrary unitary oracle) ([NW99]): over any nontrivial linear order
α, a T-query value-query algorithm approximating the k-th smallest element within < Δ
(1 ≤ k ≤ |ι|, 1 ≤ Δ, 4 * Δ ≤ |ι|) with failure probability ε ≤ 1 / 2 satisfies
(1 - 2√(ε(1-ε))) (√(|ι| / Δ) + √(k (|ι| - k)) / Δ) ≤ 32 T.
Theorem 1.5 (involutive-difference oracle) ([NW99]): when the relative step
(step a₀).symm.trans (step a₁) is an involution (for instance an XOR oracle), each value query
costs one phase query, tightening the constant from 32 to 16.
Bounded-error (ε = 1 / 3) form of Theorem 1.5 ([NW99]) for IsApproxKthSmallest:
√(|ι| / Δ) + √(k (|ι| - k)) / Δ ≤ 576 T.
Bounded-error (ε = 1 / 3) form of Theorem 1.5 ([NW99]) for involutive-difference
oracles: √(|ι| / Δ) + √(k (|ι| - k)) / Δ ≤ 288 T.
Theorem 1.5 (index-returning value-query algorithm) ([NW99]): a T-query
algorithm returning an index idx p : ι whose value X (idx p) approximates the k-th smallest
element is simulated in T + 1 queries via Cslib.Quantum.exists_sim_index_to_value, giving
(1 - 2√(ε(1-ε))) (√(|ι| / Δ) + √(k (|ι| - k)) / Δ) ≤ 32 (T + 1).
Bounded-error (ε = 1 / 3) form of Theorem 1.5 for index-returning algorithms:
√(|ι| / Δ) + √(k (|ι| - k)) / Δ ≤ 576 (T + 1).
Specialization of one_sub_mul_kthSmallest_index_le to permutation oracles permStep π.
Corollary 1.6: δ-approximate median #
Corollary 1.6 (arbitrary unitary oracle, two-valued domain) ([NW99]): any
T-query value-query algorithm computing a δ-approximate median (0 < δ < 1, 1 ≤ |ι|) on
all {a₀, a₁}-valued inputs (a₀ < a₁) with failure probability ε ≤ 1 / 2 satisfies
(1 - 2√(ε(1-ε))) min (1 / δ) |ι| ≤ 24 T.
Corollary 1.6 (arbitrary unitary oracle) ([NW99]): over any nontrivial linear order
α, a T-query value-query algorithm computing a δ-approximate median (0 < δ < 1, 1 ≤ |ι|)
with failure probability ε ≤ 1 / 2 satisfies (1 - 2√(ε(1-ε))) min (1 / δ) |ι| ≤ 24 T.
Corollary 1.6 (involutive-difference oracle) ([NW99]): when
(step a₀).symm.trans (step a₁) is an involution (for instance an XOR oracle), the constant
tightens from 24 to 12: (1 - 2√(ε(1-ε))) min (1 / δ) |ι| ≤ 12 T.
Bounded-error (ε = 1 / 3) form of Corollary 1.6 ([NW99]):
min (1 / δ) |ι| ≤ 432 T.
When 1 ≤ δ * |ι|, min (1 / δ) |ι| = 1 / δ, so Corollary 1.6 gives 1 / δ ≤ 432 T.
Bounded-error (ε = 1 / 3) form of Corollary 1.6 ([NW99]) for involutive-difference
oracles: min (1 / δ) |ι| ≤ 216 T.
Corollary 1.6 (index-returning value-query algorithm) ([NW99]): a T-query
algorithm returning an index idx p : ι whose value X (idx p) is a δ-approximate median
satisfies (1 - 2√(ε(1-ε))) min (1 / δ) |ι| ≤ 24 (T + 1).
Bounded-error (ε = 1 / 3) form of Corollary 1.6 for index-returning algorithms:
min (1 / δ) |ι| ≤ 432 (T + 1).
Specialization of one_sub_mul_median_index_le to permutation oracles permStep π.