Documentation

CslibFrontier.Computability.QueryComplexity.DeutschJozsa

The deterministic query complexity of Deutsch–Jozsa #

The Deutsch–Jozsa problem Deutsch, Jozsa, as stated in de Wolf, §2.4.1: the input x ∈ {0,1}^N is promised to be either constant or balanced, with exactly N/2 true bits (Cslib.BitString.IsBalanced). The goal is to decide which. The library has no promise-problem type for query complexity. As for Bernstein–Vazirani and Simon's problem, the lower bounds therefore take any total function that answers correctly on the promise inputs (Cslib.QueryComplexity.SolvesDeutschJozsa: true on constant inputs, false on balanced ones).

Lower bound. Over N = 2m positions every deterministic decision tree needs depth m + 1 (Cslib.QueryComplexity.depth_ge_of_solvesDeutschJozsa). The adversary answers false to every query. If the tree stops after at most m queries on the all-false input, m unqueried positions remain. The balanced input that is true on exactly those positions agrees with the all-false input on every queried position, so it reaches the same leaf (Cslib.DecisionTree.eval_eq_of_forall_mem_queries). But the two inputs need different answers. de Wolf §2.4.1 states this bound with a one-line argument. Here it is derived for an arbitrary tree, through the queries the tree makes on the all-false input.

Upper bound. Querying m + 1 distinct positions suffices (Cslib.QueryComplexity.deutschJozsaTree_solves). A balanced input cannot be constant on more than m positions, so any m + 1 positions of a balanced input contain both values.

So m + 1 is the least decision-tree complexity of a total function that solves Deutsch–Jozsa (Cslib.QueryComplexity.isLeast_complexity_solvesDeutschJozsa). For N = 2^n positions this is 2^{n-1} + 1, against the single exact quantum query of CslibFrontier/Computability/QueryComplexity/Quantum/DeutschJozsa.lean.

Main definitions #

Main results #

References #

structure Cslib.QueryComplexity.SolvesDeutschJozsa {ι : Type u_1} [Fintype ι] (F : (ι → Bool) → Bool) :

A total function F solves the Deutsch–Jozsa problem when it answers true on every constant input and false on every balanced input. Inputs outside the promise are unconstrained.

theorem Cslib.QueryComplexity.lt_depth_of_eval_ne {ι : Type u_1} [Fintype ι] {β : Type u_2} {m : ℕ} (hι : Fintype.card ι = 2 * m) (t : DecisionTree ι β) (ht : ∀ (x : ι → Bool), BitString.IsBalanced x → t.eval x ≠ t.eval fun (x : ι) => false) :
m < t.depth

The adversary bound. Over 2m positions, a decision tree that gives every balanced input an output other than its output on the all-false input has depth greater than m.

The deterministic lower bound for Deutsch–Jozsa de Wolf, §2.4.1: over 2m positions, every decision tree that solves the Deutsch–Jozsa problem has depth at least m + 1.

theorem Cslib.QueryComplexity.complexity_ge_of_solvesDeutschJozsa {ι : Type u_1} [Fintype ι] {m : ℕ} (hι : Fintype.card ι = 2 * m) {F : (ι → Bool) → Bool} (hF : SolvesDeutschJozsa F) :

The deterministic query complexity of every total function solving Deutsch–Jozsa over 2m positions is at least m + 1.

Query the positions of l and answer whether the bits read are all equal.

theorem Cslib.QueryComplexity.eval_deutschJozsaTree {ι : Type u_1} [Fintype ι] [DecidableEq ι] (l : List ι) (x : ι → Bool) :
(deutschJozsaTree l).eval x = decide (∀ i ∈ l, ∀ j ∈ l, x i = x j)

The tree deutschJozsaTree l answers whether x is constant on l.

theorem Cslib.QueryComplexity.deutschJozsaTree_solves {ι : Type u_1} [Fintype ι] [DecidableEq ι] {m : ℕ} (hι : Fintype.card ι = 2 * m) {l : List ι} (hl : l.Nodup) (hlen : m < l.length) :

m + 1 distinct queries solve Deutsch–Jozsa over 2m positions: a balanced input is constant on at most m positions.

theorem Cslib.QueryComplexity.exists_nodup_length_eq {ι : Type u_1} [Fintype ι] {m : ℕ} (hι : Fintype.card ι = 2 * m) (hm : 0 < m) :
∃ (l : List ι), l.Nodup ∧ l.length = m + 1

m + 1 distinct positions exist among 2m positions when m ≥ 1.

theorem Cslib.QueryComplexity.isLeast_complexity_solvesDeutschJozsa {ι : Type u_1} [Fintype ι] {m : ℕ} (hι : Fintype.card ι = 2 * m) (hm : 0 < m) :
IsLeast {d : ℕ | ∃ (F : (ι → Bool) → Bool), SolvesDeutschJozsa F ∧ DecisionTree.complexity F = d} (m + 1)

The deterministic query complexity of the Deutsch–Jozsa promise problem over 2m ≥ 2 positions is m + 1: it is the least decision-tree complexity of a total function that solves the problem.