Iteration count:
ProvedGroverWiki.iterationCount_legrover-algorithmquantum-computingquantum-search
Let and . The number of Grover iterations satisfies
Together with the error bound for this choice of (milestone Algebraic proof — stopping at ), this is the source's statement that the correctly chosen number of iterations is at most , i.e. applications of the oracle.
Formalization Note The source does not fix a rounding convention for ""; the mission uses the integer part .
Preamble
import Mathlib import Definitions.Def_GroverWiki_Defs open Matrix
Formal statement
namespace GroverWiki
/-- The number of iterations `r(N) = ⌊π/(4 arcsin(1/√N))⌋` satisfies `r(N) ≤ ⌈(π/4)√N⌉`. -/
theorem iterationCount_le {N : ℕ} (hN : 1 ≤ N) :
⌊Real.pi / (4 * Real.arcsin (1 / Real.sqrt N))⌋₊ ≤ ⌈Real.pi / 4 * Real.sqrt 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 "Algorithm" (PDF p. 4), with from section "Algebraic proof" (PDF p. 6)
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.