Geometric picture of Grover's algorithm
ProvedGrover.amplitude_rotationLet theta = arcsin(1/sqrt N). Starting from the uniform superposition |s>, the amplitude on the marked basis state |w0> after k applications of the Grover iterate G is exactly sin((2k+1)*theta).
import Mathlib
import Definitions.Def_groverIterate
namespace Grover
/-- **The geometric picture of Grover's algorithm.** Let `θ = arcsin(1/√N)`. Starting from the
uniform superposition `|s⟩`, the amplitude on the marked basis state `|w0⟩` after `k` applications
of the Grover iterate `G` is exactly `sin((2k+1)θ)`: each iterate of `G` rotates the state by a
further angle `2θ` inside the two-dimensional real subspace spanned by `|w0⟩` and its orthogonal
complement within `span{|s⟩, |w0⟩}`. -/
theorem amplitude_rotation {N : ℕ} (w0 : Fin N) (k : ℕ) :
inner (𝕜 := ℂ) (EuclideanSpace.single w0 (1 : ℂ))
((⇑(groverIterate w0))^[k] (uniformSuperposition N)) =
(Real.sin ((2 * k + 1) * Real.arcsin (1 / Real.sqrt N)) : ℂ) := by
sorry
end Grover
Read-back
What the Lean code literally says, in plain math · claude-sonnet-5
This theorem, named amplitude_rotation inside a Grover namespace, has three binders and no additional hypotheses: an implicit natural number , an explicit index ranging over the -element finite type (so implicitly is required for to exist at all — if this finite type is empty, and the universally-quantified claim is vacuously true for that instantiation of ), and an explicit natural number (which may be ). The body asserts a single equation of complex numbers. The left-hand side is the standard Hermitian inner product (conjugate-linear in the first slot, linear in the second) on , evaluated between the standard basis vector (the vector whose -th coordinate is and all other coordinates are ) and the vector obtained by applying, times in succession, a named linear operator (called groverIterate w0, an operator on whose defining formula is not part of this statement) to the fixed vector all of whose coordinates equal (the "uniform superposition"); here "applying times" is literal functional iteration, so means the identity map is used and is not applied at all. Because the first argument has a single nonzero (real) entry, this inner product is, by the stated definition, exactly the -th coordinate of . The right-hand side is the real number , formed with the standard real sine and the standard real arcsine (valued in , genuinely inverse to sine only on inputs in ), and then this real number is embedded into as a complex number with zero imaginary part. For every the quantity lies in , so the arcsine here is always evaluated within its genuine invertibility range and no clamping/junk-value behavior is triggered (the potential edge case , where Lean's conventions would give and , does not need to be considered separately since, as noted, no exists when ). The equality is claimed for all such , , and simultaneously, with the entire proof body consisting of sorry, meaning the statement is currently asserted without proof.
Confirmed by the mission captain (proposal self-audit).