Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Exact success probability after rrr iterations: sin⁡2((r+12)θ)\sin^2((r+\frac12)\theta)sin2((r+21​)θ)

Proved
GroverWiki.measureProb_groverState

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, and let θ=2arcsin⁡1N\theta = 2\arcsin\frac{1}{\sqrt N}θ=2arcsinN​1​. Starting from ∣s⟩|s\rangle∣s⟩ and applying rrr Grover iterations, the probability that a computational-basis measurement of (UsUω)r∣s⟩(U_sU_\omega)^r|s\rangle(Us​Uω​)r∣s⟩ yields ω\omegaω is exactly

∣⟨ω∣(UsUω)r∣s⟩∣2=sin⁡2 ⁣((r+12)θ).\bigl|\langle\omega|(U_sU_\omega)^r|s\rangle\bigr|^2 = \sin^2\!\Bigl(\bigl(r+\tfrac12\bigr)\theta\Bigr) .​⟨ω∣(Us​Uω​)r∣s⟩​2=sin2((r+21​)θ).

This is the central quantitative statement about Grover's algorithm: the success probability oscillates with the number of iterations and is close to 111 when (r+12)θ≈π/2(r+\frac12)\theta \approx \pi/2(r+21​)θ≈π/2.

Preamble
import Mathlib
import Definitions.Def_GroverWiki_Defs

open Matrix
Formal statement
namespace GroverWiki

/-- Geometric proof: the exact probability of measuring `ω` after `r` Grover iterations is
`sin²((r + 1/2) θ)` with `θ = 2 arcsin(1/√N)`. -/
theorem measureProb_groverState {N : ℕ} (f : Fin N → Fin 2) (ω : Fin N)
    (hω : ∀ x, f x = 1 ↔ x = ω) (r : ℕ) :
    measureProb (groverState f r) ω =
      Real.sin ((r + 1 / 2) * (2 * Real.arcsin (1 / Real.sqrt N))) ^ 2 := 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. 5)
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