Grover's AlgorithmResearch Paper
Motivation
Searching an unsorted list of items for a single marked entry takes queries classically — there is no way to do better than checking items one at a time. Grover's algorithm (Grover 1996) shows that a quantum computer solves the same problem in queries, a quadratic speedup that applies to any problem expressible as unstructured search over a black-box oracle (this includes brute-forcing NP-complete problems and inverting one-way functions, which is why post-quantum cryptography doubles key lengths to compensate). Unlike Shor's algorithm, Grover's algorithm is provably optimal: Bennett–Bernstein–Brassard–Vazirani (1997) showed queries are necessary for any quantum algorithm solving unstructured search, so the quadratic speedup is the best any quantum algorithm can achieve on this problem.
Setting
Model an -item database as the standard basis of (EuclideanSpace ℂ (Fin N)),
with inner product . Fix a marked index
. The algorithm starts in the uniform superposition
a unit vector assigning equal amplitude to every item. Two reflections drive the search:
- the oracle , which flips the sign of the amplitude on the marked item and leaves every other basis state fixed;
- the diffusion operator ("inversion about the mean"), the reflection about .
One Grover iterate is . The algorithm applies some number of times to and measures; a measurement outcome equal to counts as success.
Formalization targets
Milestone — the iterate is an isometry
and are each reflections about a unit vector, hence isometries; their composition is therefore norm-preserving on the whole space, not just at — the minimal fact needed for to be a legitimate quantum operation.
Milestone — the rotation formula
The geometric heart of the algorithm (Nielsen & Chuang, Quantum Computation and Quantum Information, Section 6.1.2): restricted to the real two-dimensional subspace spanned by and the component of orthogonal to it, acts as rotation by a fixed angle . Each iterate therefore advances the amplitude on the marked state along , exactly as claimed, with the rotation's initial offset (since at ).
Goal
Some number of iterations drives the probability of measuring the marked item above . The goal is stated existentially, without fixing to a specific rounded formula: the rotation angle can be made to land within of by an appropriate integer , and at that point . Pinning down to an explicit closed form (e.g. the nearest integer to ) is one valid strategy, but is not required by the statement — any correct choice of , and any correct proof it works, closes the goal.
Significance
Grover's algorithm is the second landmark quantum algorithm after Shor's, and the one with the
widest applicability: because it treats the search space as a black box, it accelerates any
brute-force search — SAT solving, collision finding, and generic key search among them — which is
the concrete reason NIST's post-quantum cryptography standards double symmetric key lengths rather
than replacing them outright. The mathematics itself has been fully settled since 1996, including
matching optimality lower bounds; nothing here is open. What this mission adds is a machine-
checked derivation of the amplitude formula and success bound directly from the definitions of
the oracle and diffusion operators as concrete linear operators on EuclideanSpace ℂ (Fin N) —
Mathlib has the finite-dimensional inner product space and rank-one operator machinery this needs
(InnerProductSpace.rankOne, EuclideanSpace.single), but no existing formalization of the
algorithm itself.
Difficulty
The obvious first attempt tries to track the full -dimensional state vector through iterations. This is intractable in general: 's action on an arbitrary basis vector depends on its overlap with both and . The move that makes the problem tractable is recognizing that preserves the two-dimensional real subspace — everything orthogonal to this plane is fixed by both and , and inside the plane is exactly a rotation matrix by angle . Establishing this invariance and then tracking only the rotation angle (rather than the full vector) is the standard reduction, and the one this mission's milestones are built around; skipping it and attempting a direct -dimensional induction does not scale.
Formalization scope
Works over a general together with a marked index — no
assumption that is a power of two, since the rotation argument is agnostic to how the basis
states are physically encoded into qubits (that encoding is a separate, unrelated concern from the
search dynamics proved here). Supplying w0 : Fin N already forces ; no separate
nonemptiness hypothesis is added. The oracle and diffusion operators are built directly from
Mathlib's InnerProductSpace.rankOne rather than an ad-hoc pointwise definition, so their
reflection structure (and hence unitarity) is visible from the definition itself. A trivializing
formalization is ruled out explicitly: the goal is stated as an existential over rather than a
fixed closed-form iteration count, so a correct proof must still exhibit a genuine successful
and establish the bound — it cannot be discharged by an unrelated or degenerate choice. Contributions
extending this to multiple marked items, or proving the matching lower bound
(Bennett–Bernstein–Brassard–Vazirani 1997), are welcome as follow-up missions.
Selected references
- L. K. Grover, A fast quantum mechanical algorithm for database search, STOC 1996. https://arxiv.org/abs/quant-ph/9605043
- M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, Cambridge University Press, 2000, Section 6.1.
- C. H. Bennett, E. Bernstein, G. Brassard, and U. Vazirani, Strengths and Weaknesses of Quantum Computing, SIAM J. Comput. 26 (1997). https://arxiv.org/abs/quant-ph/9701001