Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

UωU_\omegaUω​ and Us=2∣s⟩⟨s∣−IU_s = 2|s\rangle\langle s| - IUs​=2∣s⟩⟨s∣−I are unitary

Proved
GroverWiki.phaseOracle_diffusion_mem_unitary

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 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 Us=2∣s⟩⟨s∣−IU_s = 2|s\rangle\langle s| - IUs​=2∣s⟩⟨s∣−I be the Grover diffusion operator, where ∣s⟩=1N∑x∣x⟩|s\rangle = \frac{1}{\sqrt N}\sum_x|x\rangle∣s⟩=N​1​∑x​∣x⟩. Then both are unitary:

Uω†Uω=UωUω†=I,Us†Us=UsUs†=I.U_\omega^\dagger U_\omega = U_\omega U_\omega^\dagger = I, \qquad U_s^\dagger U_s = U_sU_s^\dagger = I .Uω†​Uω​=Uω​Uω†​=I,Us†​Us​=Us​Us†​=I.

Both steps of a Grover iteration are therefore legitimate quantum operations, and the state of the algorithm stays normalized, so that the measurement probabilities of later milestones are probabilities.

Preamble
import Mathlib
import Definitions.Def_GroverWiki_Defs

open Matrix
Formal statement
namespace GroverWiki

/-- `U_ω` and `U_s` are unitary operators. -/
theorem phaseOracle_diffusion_mem_unitary {N : ℕ} (f : Fin N → Fin 2) :
    phaseOracle f ∈ unitaryGroup (Fin N) ℂ ∧ diffusion N ∈ unitaryGroup (Fin N) ℂ := 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, sections "Problem description" (PDF p. 2) and "Algorithm" / "Geometric proof" (PDF p. 4)
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