Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Uniform superposition

Definition
uniformSuperposition

by Elsie66 · Sep 8, 2026 · Mathlib 0df444a (Lean v4.33.1)

linear-algebraquantum-information

The uniform superposition |s> = (1/sqrt N) * sum_i |i> over N basis states, the starting state of Grover's search algorithm.

Definition code
import Mathlib

namespace Grover

/-- The uniform superposition `|s⟩ = (1/√N) ∑ᵢ |i⟩` over `N` basis states, the starting state of
Grover's search algorithm. -/
noncomputable def uniformSuperposition (N : ℕ) : EuclideanSpace ℂ (Fin N) :=
  WithLp.toLp 2 (fun _ => ((1 / Real.sqrt N : ℝ) : ℂ))

end Grover
Source
L. K. Grover, A fast quantum mechanical algorithm for database search, STOC 1996, https://arxiv.org/abs/quant-ph/9605043; M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, Cambridge University Press, 2000, Section 6.1.
Read-back

What the Lean code literally says, in plain math · claude-sonnet-5

For a natural number NNN (the sole, explicit argument), uniformSuperposition N is defined as the vector in CN\mathbb{C}^NCN (with the standard inner product ⟨x,y⟩=∑i=0N−1xi‾ yi\langle x,y\rangle=\sum_{i=0}^{N-1}\overline{x_i}\,y_i⟨x,y⟩=∑i=0N−1​xi​​yi​) all of whose NNN coordinates take the same value, namely the complex number obtained by casting the real number 1/N1/\sqrt{N}1/N​ into C\mathbb{C}C (i.e. the value 1N+0i\tfrac{1}{\sqrt N}+0iN​1​+0i in every coordinate i=0,…,N−1i=0,\dots,N-1i=0,…,N−1). Here N\sqrt{N}N​ and the reciprocal are the total (junk-valued) real-number operations of the ambient library: at N=0N=0N=0, 0=0\sqrt{0}=00​=0 by convention and 1/0=01/0=01/0=0 by convention, so the formula that would fill each coordinate evaluates to 000 in that degenerate case — though for N=0N=0N=0 the space CN\mathbb{C}^NCN has no coordinates at all, so the vector is vacuously the unique element of C0\mathbb{C}^0C0 regardless of this value. No hypothesis that N>0N>0N>0 (or that NNN is a perfect square, etc.) is imposed anywhere.

Human review
  • Endorsed by Shuze Chen · Sep 9, 2026

  • Endorsed by Elsie66 · Sep 9, 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.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactJoin Slack© 2026 Prove2Me