Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

The initial ket is close to ∣s′⟩|s'\rangle∣s′⟩: ⟨s′∣s⟩=(N−1)/N\langle s'|s\rangle = \sqrt{(N-1)/N}⟨s′∣s⟩=(N−1)/N​

Proved
GroverWiki.perpState_inner_uniformState

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

grover-algorithmquantum-computingquantum-search

Let N≥2N \ge 2N≥2, let ω∈{0,…,N−1}\omega \in \{0,\dots,N-1\}ω∈{0,…,N−1}, let ∣s⟩=1N∑x∣x⟩|s\rangle = \frac{1}{\sqrt N}\sum_x|x\rangle∣s⟩=N​1​∑x​∣x⟩ and ∣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

⟨s′∣s⟩=N−1N.\langle s'|s\rangle = \sqrt{\frac{N-1}{N}} .⟨s′∣s⟩=NN−1​​.

Equivalently, the angle θ/2\theta/2θ/2 between ∣s⟩|s\rangle∣s⟩ and ∣s′⟩|s'\rangle∣s′⟩ satisfies cos⁡θ2=(N−1)/N\cos\frac\theta2 = \sqrt{(N-1)/N}cos2θ​=(N−1)/N​, i.e. sin⁡θ2=1N\sin\frac\theta2 = \frac{1}{\sqrt N}sin2θ​=N​1​: the initial state is close to the state orthogonal to ∣ω⟩|\omega\rangle∣ω⟩.

Preamble
import Mathlib
import Definitions.Def_GroverWiki_Defs

open Matrix
Formal statement
namespace GroverWiki

/-- The initial ket is close to `|s'⟩`: `⟨s'|s⟩ = √((N-1)/N)`. -/
theorem perpState_inner_uniformState {N : ℕ} (hN : 2 ≤ N) (ω : Fin N) :
    star (perpState ω) ⬝ᵥ uniformState N = (Real.sqrt (((N : ℝ) - 1) / 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, 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