Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Jordan form of the Grover matrix: UsUω=M diag(e2it,e−2it) M−1U_sU_\omega = M\,\mathrm{diag}(e^{2it}, e^{-2it})\,M^{-1}Us​Uω​=Mdiag(e2it,e−2it)M−1

Proved
GroverWiki.groverMatrix_jordan_form

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

grover-algorithmquantum-computingquantum-search

Let N≥2N \ge 2N≥2, t=arcsin⁡(1/N)t = \arcsin(1/\sqrt N)t=arcsin(1/N​), and let

A=[12/N−2/N1−4/N],M=[−iieite−it]A = \begin{bmatrix}1 & 2/\sqrt N\\ -2/\sqrt N & 1-4/N\end{bmatrix}, \qquad M = \begin{bmatrix}-i & i\\ e^{it} & e^{-it}\end{bmatrix}A=[1−2/N​​2/N​1−4/N​],M=[−ieit​ie−it​]

be the matrix of UsUωU_sU_\omegaUs​Uω​ in the spanning set {∣ω⟩,∣s⟩}\{|\omega\rangle, |s\rangle\}{∣ω⟩,∣s⟩} and the change-of-basis matrix. Then MMM is invertible and

  1. A=M[e2it00e−2it]M−1A = M\begin{bmatrix}e^{2it} & 0\\ 0 & e^{-2it}\end{bmatrix}M^{-1}A=M[e2it0​0e−2it​]M−1;
  2. for every r∈Nr \in \mathbb Nr∈N, Ar=M[e2rit00e−2rit]M−1A^r = M\begin{bmatrix}e^{2rit} & 0\\ 0 & e^{-2rit}\end{bmatrix}M^{-1}Ar=M[e2rit0​0e−2rit​]M−1.

The diagonal form gives a closed formula for the state after any number of Grover iterations.

Formalization Note M⁻¹ is Mathlib's matrix inverse, which is the zero matrix for a singular matrix; for N≥2N \ge 2N≥2 one has t<π/2t < \pi/2t<π/2, so det⁡M=−2icos⁡t≠0\det M = -2i\cos t \ne 0detM=−2icost=0. The hypothesis N≥2N \ge 2N≥2 excludes N=1N = 1N=1, where MMM is singular.

Preamble
import Mathlib
import Definitions.Def_GroverWiki_Defs

open Matrix
Formal statement
namespace GroverWiki

/-- Algebraic proof: Jordan form of the matrix of `U_s U_ω` in the basis `{|ω⟩, |s⟩}`, and of its
`r`-th power. With `t = arcsin(1/√N)` and `M = [[-i, i], [e^{it}, e^{-it}]]`,
`U_s U_ω = M diag(e^{2it}, e^{-2it}) M⁻¹` and `(U_s U_ω)^r = M diag(e^{2rit}, e^{-2rit}) M⁻¹`. -/
theorem groverMatrix_jordan_form {N : ℕ} (hN : 2 ≤ N) :
    let t : ℝ := Real.arcsin (1 / Real.sqrt N)
    let A : Matrix (Fin 2) (Fin 2) ℂ :=
      !![1, 2 / (Real.sqrt N : ℂ); -2 / (Real.sqrt N : ℂ), 1 - 4 / (N : ℂ)]
    let M : Matrix (Fin 2) (Fin 2) ℂ :=
      !![-Complex.I, Complex.I; Complex.exp (t * Complex.I), Complex.exp (-(t * Complex.I))]
    A = M * !![Complex.exp (2 * t * Complex.I), 0; 0, Complex.exp (-(2 * t * Complex.I))] * M⁻¹ ∧
      ∀ r : ℕ, A ^ r =
        M * !![Complex.exp (2 * r * t * Complex.I), 0;
              0, Complex.exp (-(2 * r * t * Complex.I))] * M⁻¹ := 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 "Algebraic proof" (PDF p. 6)
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