Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Alternative oracle: Uf(∣x⟩⊗∣−⟩)=(Uω∣x⟩)⊗∣−⟩U_f(|x\rangle\otimes|-\rangle) = (U_\omega|x\rangle)\otimes|-\rangleUf​(∣x⟩⊗∣−⟩)=(Uω​∣x⟩)⊗∣−⟩

Proved
GroverWiki.standardOracle_tensor_minus

by Lucas · Oct 13, 2026 · Mathlib 0df444a (Lean v4.33.1)

grover-algorithmquantum-computingquantum-search

Let f ⁣:{0,…,N−1}→{0,1}f\colon\{0,\dots,N-1\}\to\{0,1\}f:{0,…,N−1}→{0,1}, let Uf∣x⟩∣y⟩=∣x⟩∣y⊕f(x)⟩U_f|x\rangle|y\rangle = |x\rangle|y\oplus f(x)\rangleUf​∣x⟩∣y⟩=∣x⟩∣y⊕f(x)⟩ be the standard oracle on CN⊗C2\mathbb C^N\otimes\mathbb C^2CN⊗C2, let Uω∣x⟩=(−1)f(x)∣x⟩U_\omega|x\rangle = (-1)^{f(x)}|x\rangleUω​∣x⟩=(−1)f(x)∣x⟩ be the phase oracle, and let ∣−⟩=12(∣0⟩−∣1⟩)|-\rangle = \frac{1}{\sqrt2}(|0\rangle - |1\rangle)∣−⟩=2​1​(∣0⟩−∣1⟩). Then for every basis state ∣x⟩|x\rangle∣x⟩,

Uf(∣x⟩⊗∣−⟩)=(Uω∣x⟩)⊗∣−⟩.U_f\bigl(|x\rangle\otimes|-\rangle\bigr) = \bigl(U_\omega|x\rangle\bigr)\otimes|-\rangle .Uf​(∣x⟩⊗∣−⟩)=(Uω​∣x⟩)⊗∣−⟩.

This shows that Grover's algorithm can be run with either oracle: given UfU_fUf​, one keeps an ancillary qubit in the state ∣−⟩|-\rangle∣−⟩ and applies UfU_fUf​ in place of UωU_\omegaUω​.

Preamble
import Mathlib
import Definitions.Def_GroverWiki_Defs

open Matrix
Formal statement
namespace GroverWiki

/-- Alternative oracle definition: on `|x⟩ ⊗ |−⟩`, the standard oracle `U_f` acts as the phase
oracle `U_ω` on the main register, leaving the ancilla in `|−⟩`. -/
theorem standardOracle_tensor_minus {N : ℕ} (f : Fin N → Fin 2) (x : Fin N) :
    standardOracle f *ᵥ tensorKet (ket x) minusState =
      tensorKet (phaseOracle f *ᵥ ket x) minusState := by sorry

end GroverWiki
Source
Wikipedia, "Grover's algorithm", revision oldid=1373498442, https://en.wikipedia.org/w/index.php?title=Grover%27s_algorithm&oldid=1373498442, section "Alternative oracle definition" (PDF p. 3)
Human review
  • Endorsed by Shuze Chen · Oct 13, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Lucas · Oct 13, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me