Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

UωU_\omegaUω​ acts on the plane span{∣s′⟩,∣ω⟩}\mathrm{span}\{|s'\rangle, |\omega\rangle\}span{∣s′⟩,∣ω⟩} as the reflection across ∣s′⟩|s'\rangle∣s′⟩

Proved
GroverWiki.phaseOracle_reflection_perp

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} have exactly one index ω\omegaω with f(ω)=1f(\omega) = 1f(ω)=1, let Uω∣x⟩=(−1)f(x)∣x⟩U_\omega|x\rangle = (-1)^{f(x)}|x\rangleUω​∣x⟩=(−1)f(x)∣x⟩, and let ∣s′⟩=1N−1∑x≠ω∣x⟩|s'\rangle = \frac{1}{\sqrt{N-1}}\sum_{x\ne\omega}|x\rangle∣s′⟩=N−1​1​∑x=ω​∣x⟩. Then for all a,b∈Ca, b \in \mathbb Ca,b∈C,

Uω(a∣ω⟩+b∣s′⟩)=−a∣ω⟩+b∣s′⟩.U_\omega\bigl(a|\omega\rangle + b|s'\rangle\bigr) = -a|\omega\rangle + b|s'\rangle .Uω​(a∣ω⟩+b∣s′⟩)=−a∣ω⟩+b∣s′⟩.

That is, on the plane spanned by ∣s′⟩|s'\rangle∣s′⟩ and ∣ω⟩|\omega\rangle∣ω⟩ the oracle is the reflection across ∣s′⟩|s'\rangle∣s′⟩ (the reflection at the hyperplane orthogonal to ∣ω⟩|\omega\rangle∣ω⟩); in particular it maps the plane to itself.

Formalization Note For N=1N = 1N=1 the sum defining ∣s′⟩|s'\rangle∣s′⟩ is empty and ∣s′⟩=0|s'\rangle = 0∣s′⟩=0; the statement then only concerns multiples of ∣ω⟩|\omega\rangle∣ω⟩.

Preamble
import Mathlib
import Definitions.Def_GroverWiki_Defs

open Matrix
Formal statement
namespace GroverWiki

/-- In the plane spanned by `|s'⟩` and `|ω⟩`, `U_ω` acts as the reflection across `|s'⟩`. -/
theorem phaseOracle_reflection_perp {N : ℕ} (f : Fin N → Fin 2) (ω : Fin N)
    (hω : ∀ x, f x = 1 ↔ x = ω) (a b : ℂ) :
    phaseOracle f *ᵥ (a • ket ω + b • perpState ω) = (-a) • ket ω + b • perpState ω := 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 "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