Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Main result, §2 p. 4 / §3 pp. 5–7 — MITM-factor decides depth ≤ 2⌈l/2⌉, returns a minimal-depth circuit, cost ≤ 8|V|^⌈l/2⌉ log₂|V|^⌈l/2⌉ (corrected)

Proved
QCircMITM.Search.main_result

by mikedeng1 · Oct 21, 2026 · Mathlib 0df444a (Lean v4.33.1)

circuit-depthmeet-in-the-middlep2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1quantum-circuit-synthesisrunning-time

Let V⊆U(2n)V \subseteq U(2^n)V⊆U(2n) be a finite set of nnn-qubit unitaries, standing for the set Vn,G\mathcal V_{n,\mathcal G}Vn,G​ of depth-one circuits over an instruction set G\mathcal GG, and let SdS_dSd​ be the set of unitaries implementable over VVV in depth ddd. Let U∈U(2n)U \in U(2^n)U∈U(2n), l≥0l \ge 0l≥0, and write h=⌈l/2⌉h = \lceil l/2\rceilh=⌈l/2⌉. Run MITM-factor(G,U,l)(\mathcal G, U, l)(G,U,l).

  1. Decision. It returns nothing if and only if UUU has no circuit over VVV of any depth ddd with 1≤d≤2h1 \le d \le 2h1≤d≤2h:
MITM-factor(G,U,l)=none  ⟺  U∉S1∪S2∪⋯∪S2⌈l/2⌉.\text{MITM-factor}(\mathcal G,U,l) = \text{none} \iff U \notin S_1 \cup S_2 \cup \cdots \cup S_{2\lceil l/2\rceil}.MITM-factor(G,U,l)=none⟺U∈/S1​∪S2​∪⋯∪S2⌈l/2⌉​.
  1. Even lll. In particular, for even lll, it returns nothing if and only if UUU has no circuit of depth ddd with 1≤d≤l1 \le d \le l1≤d≤l.
  2. Minimality. If it returns a circuit ccc, then every layer of ccc lies in VVV, ccc implements UUU, 1≤∣c∣≤2h1 \le |c| \le 2h1≤∣c∣≤2h, and ∣c∣≤∣c′∣|c| \le |c'|∣c∣≤∣c′∣ for every circuit c′c'c′ over VVV of positive depth implementing UUU.
  3. Cost. If ∣V∣≥2|V| \ge 2∣V∣≥2, its counted cost (generation, sorting and searching, summed over the iterations it executes) satisfies
cost(U,l)≤8 ∣V∣⌈l/2⌉log⁡2 ⁣(∣V∣⌈l/2⌉).\mathrm{cost}(U,l) \le 8\,|V|^{\lceil l/2\rceil}\log_2\!\big(|V|^{\lceil l/2\rceil}\big).cost(U,l)≤8∣V∣⌈l/2⌉log2​(∣V∣⌈l/2⌉).

This is the paper's main result: MITM-factor decides whether UUU can be implemented in depth at most lll in time O(∣Vn,G∣⌈l/2⌉log⁡(∣Vn,G∣⌈l/2⌉))O\big(|\mathcal V_{n,\mathcal G}|^{\lceil l/2\rceil}\log(|\mathcal V_{n,\mathcal G}|^{\lceil l/2\rceil})\big)O(∣Vn,G​∣⌈l/2⌉log(∣Vn,G​∣⌈l/2⌉)), and when it can, it returns a circuit of minimal depth. It does so while generating only circuits of depth at most ⌈l/2⌉\lceil l/2\rceil⌈l/2⌉, the square root of the brute-force ∣Vn,G∣l|\mathcal V_{n,\mathcal G}|^l∣Vn,G​∣l.

Formalization Note. The layer set VVV is an arbitrary finite set of unitaries; the paper's argument uses nothing else about Vn,G\mathcal V_{n,\mathcal G}Vn,G​. Three corrections, all forced by the pseudocode on p. 6. (i) For odd lll the last iteration also tests depth l+1l+1l+1, so the decided range is 1≤d≤2⌈l/2⌉1 \le d \le 2\lceil l/2\rceil1≤d≤2⌈l/2⌉; for even lll this is the printed range (clause 2). (ii) Depth 000 is never tested, so minimality is among circuits of positive depth (this matters only for U=IU = IU=I). (iii) The running time is a counted cost: per iteration iii, ∣V∣∣Si−1∣|V||S_{i-1}|∣V∣∣Si−1​∣ for generating SiS_iSi​, ∣Si∣log⁡2∣Si∣|S_i|\log_2|S_i|∣Si​∣log2​∣Si​∣ for sorting it, and (∣Si−1∣+∣Si∣)log⁡2∣Si∣(|S_{i-1}|+|S_i|)\log_2|S_i|(∣Si−1​∣+∣Si​∣)log2​∣Si​∣ for the lookups, built from the sets the run actually generates. The OOO is made explicit with the constant 888: each iteration costs at most 4∣V∣ilog⁡2∣V∣h4|V|^i\log_2|V|^h4∣V∣ilog2​∣V∣h, and ∑i≤h∣V∣i≤2∣V∣h\sum_{i\le h}|V|^i \le 2|V|^h∑i≤h​∣V∣i≤2∣V∣h for ∣V∣≥2|V| \ge 2∣V∣≥2. The hypothesis ∣V∣≥2|V| \ge 2∣V∣≥2 is needed because log⁡21=0\log_2 1 = 0log2​1=0. Logarithms are Real.logb 2, and ⌈l/2⌉\lceil l/2\rceil⌈l/2⌉ is (l + 1) / 2.

Preamble
import Mathlib
import Definitions.Def_QCircMITM_Search_Algorithm
Formal statement
namespace QCircMITM.Search

theorem main_result {n : ℕ} (V : Finset (Unitary n)) (U : Unitary n) (l : ℕ) :
    (mitmFactor V U l = none ↔ ∀ d : ℕ, 1 ≤ d → d ≤ 2 * ((l + 1) / 2) → U ∉ S V d) ∧
    (Even l → (mitmFactor V U l = none ↔ ∀ d : ℕ, 1 ≤ d → d ≤ l → U ∉ S V d)) ∧
    (∀ c, mitmFactor V U l = some c →
        (∀ W ∈ c, W ∈ V) ∧ c.prod = U ∧ 1 ≤ c.length ∧ c.length ≤ 2 * ((l + 1) / 2) ∧
        ∀ c' : List (Unitary n), (∀ W ∈ c', W ∈ V) → c'.prod = U → 1 ≤ c'.length →
          c.length ≤ c'.length) ∧
    (2 ≤ V.card →
      mitmCost V U l ≤
        8 * (V.card : ℝ) ^ ((l + 1) / 2) * Real.logb 2 ((V.card : ℝ) ^ ((l + 1) / 2))) := by sorry

end QCircMITM.Search
Source
Amy, Maslov, Mosca, Roetteler, A meet-in-the-middle algorithm for fast synthesis of depth-optimal quantum circuits, arXiv:1206.0758v3, p. 4 (§2, main result) and pp. 5–7 (§3: Lemma 1, MITM-factor pseudocode and its analysis)
Human review
  • Endorsed by Shuze Chen · Oct 21, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 21, 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