Research paperScreenedARR-2026-01XK18W7DJ8AJAWH · v2 · 2026-12-04

End-to-End Lean 4 Mechanization of Optimal CNOT Circuit Synthesis Hardness: From Graph Clique Dominance and Boyar-Matthews-Peralta Gate Elimination to Free-SWAP and Clean-Ancilla Lower Bounds

Lluis Eriksson

Admitted after checks by named AI models and editor approval. Not peer reviewed. Screening record

Abstract

We present a complete, standalone, zero-dependency Lean 4.36.0 mechanization (CnotHardnessV2.lean, 5,095 lines, zero Mathlib imports, compiled with -DwarningAsError=true, zero sorry, zero native_decide, and zero custom axioms) of the full mathematical reduction establishing the NP-hardness of optimal linear-reversible CNOT circuit synthesis over F_2 (Pavlogiannis, 2026, building on Boyar, Matthews, and Peralta, 2013), simultaneously for pure CNOT circuits and for extended circuits equipped with arbitrarily many zero-cost SWAP gates and clean |0> ancilla qubits. This major revision (v2) completely replaces the elementary scalar fragments of v1 with genuine mathematical objects and complete proofs across five pillars: (1) finite simple graphs SimpleGraph n, exact clique dominance tau(G(H)) = 2*tau(H) + 2n (always even for n >= 1), and an explicit alternating Hamiltonian path hamPathLemma2 of length 2|C_H| + 2n inside every lifted cover; (2) F_2^d reversible CNOT semantics, universal involutivity B_G^2 = I_{n+1+m}, zero-cost SWAP elimination via wire relabeling, and constructive free-SWAP plus clean-ancilla translation into straight-line XOR circuits (D_XOR <= D_CNOT^{SWAP,anc}); (3) sound single-gate deletion, descending multi-gate deletion (deleteManyGates), input substitution, and the universal B_G -> F_G XOR lift (D_XOR(B_G) >= m + D_XOR(F_G)); (4) the full Case-(a) vertex-deletion and Case-(b) vertex-merging Boyar-Matthews-Peralta gate-elimination induction plus matching constructive upper bound establishing D_XOR(F_G) = |E(G)| + tau(G); and (5) an executable Hamiltonian-path CNOT synthesizer synthBG proved wire-by-wire equal to B_G in exact gate count 2m + |P| + 1, the matching universal lower bound D_CNOT^{SWAP,anc}(B_G) >= 2m + tau(G), and the end-to-end parity-rounding decision equivalence. Twenty audited primary theorems are verified by AuditAxioms.lean (6 strictly in {propext, Quot.sound}; 14 adding only Classical.choice), paired with an AST-audited zero-float Python certifier (6,460 AST nodes, 0 violations) verified up to GL(176, 2) (327 exact CNOT gates on G(C_5)) and a 6/6 passing adversarial red-team suite.

Readable overview

Structure & key results

Extracted for web & scholarly indexing

Manuscript structure

  1. Introduction, Resolution of v1 Defects, and Epistemic Scope
  2. Pillar 1: Finite Simple Graphs, Vertex Covers, and Lemma 2 Clique Dominance
  3. Pillar 2: F₂^d Linear-Reversible Circuits, Free SWAPs, and Clean Ancillas
  4. Pillars 3–4: Circuit Reductions, the B_G → F_G Lift, and Boyar–Matthews–Peralta Gate Elimination
  5. Pillar 5: Executable Hamiltonian-Path Synthesis and End-to-End CNOT Hardness
  6. Mechanization Audit, Zero-Float Verification, and Red-Team Suite
  7. Licensing, Provenance, and AI Assistance Disclosure

Selected results from the manuscript source

Theorem 1 — Universal Cover Bound and Lifted Cover Parity

Lean 4: min_vertex_cover_le_pred, lemma2_cover_lift_valid_and_even. Let H be a SimpleGraph n. · If n ≥ 1, then S₀(u):= (u ≠ 0) is a vertex cover of H with |S₀| = n - 1; consequently τ(H) ≤ n - 1. · If C is any vertex cover of H, then C = liftCover C is a vertex cover of G(H) of exact even cardinality |C| = 2|C| + 2n.

Theorem 2 — Clique Dominance and Alternating Hamiltonian Path

Lean 4: lemma2_clique_dominance_exact_tau, lemma2_hamiltonian_path_in_cover. Let H be a SimpleGraph n with n ≥ 1, and let C be a minimum vertex cover of H with |C| = τ(H). · Exact clique dominance: C = liftCover C is a minimum vertex cover of G(H) of exact even cardinality τ(G(H)) = 2τ(H) + 2n. · Constructive Hamiltonian path: For any subset C colon Fin n → Bool (not even requiring C to be a cover), let s₁ and s₂ list the vertices of C in H₁ and H₂ respectively (so t:= |s₁ mathbin‖ s₂| = 2|C| ≤ 2n), and let k_2n = [2n, 2n+1, …, 4n-1].

Theorem 3 — Circuit Reversibility and Universal Oracle Involutivity

Lean 4: evalCNOTCircuit_reverse_inverse, evalBG_involutive. · For every pure CNOT circuit C on d wires and every state s ∈ F₂^d, eval(C^(rev), eval(C, s)) = s. · For every n, edge list E of length m, and state s ∈ F₂^(n+1+m), B_G(B_G(s)) = s. In particular, B_G ∈ GL(n+1+m, 2) with B_G⁻¹ = B_G.

Theorem 4 — Zero-Cost SWAP Elimination and Clean-Ancilla Translation

Lean 4: free_swap_zero_cost_elimination, free_swap_clean_ancilla_to_xor_circuit. · Zero-cost SWAP elimination: For every extended circuit C ∈ List(ExtGate d), the executable pass elimSwaps C produces a wire bijection π ∈ S_d (WirePerm d) and a pure CNOT circuit C' such that |C'| = countCNOTs C and eval_Ext(C, s)(i) = eval_CNOT(C', s)(π(i)) for all s ∈ F₂^d and i ∈ Fin d. · Free-SWAP and clean-ancilla to XOR translation: For any d, a ∈ ℕ and any extended circuit C ∈ List(ExtGate (d+a)), the constructive translator translateExtAncillaToXOR d a C produces a wire-reference…

Theorem 5 — Soundness of Gate Deletion and Input Substitution

Lean 4: deleteGate_sound, deleteManyGates, substCircuit_sound. Let C ∈ XORCircuit d be well-formed. · Single-gate deletion: If k < |C| and r₀ is a wire reference with wf(k, r₀) satisfying eval(C, s, gate k) = eval(C, s, r₀) for all s ∈ F₂^d, then C' = deleteGate C k r₀ is well-formed, has length |C|-1, and preserves every wire's Boolean function under the remapping remapRef k r₀. · Multi-gate deletion: If K = [k₁, …, k_r] is a duplicate-free list of gate indices < |C| such that each k ∈ K has an earlier semantically equivalent reference r_k (wf(k, r_k)), then there exist…

Theorem 6 — Universal B_G → F_G XOR Lower-Bound Lift

Lean 4: bg_to_fg_xor_lower_bound. Let n, m ∈ ℕ and let f₀, …, f_(m-1) colon F₂ⁿ⁺¹ → F₂ be any m non-constant Boolean functions (each f_e attains both values on F₂ⁿ⁺¹). Suppose a well-formed circuit C ∈ XORCircuit(n+1+m) computes the m outputs y_e ⊕ f_e(z, x) (e ∈ Fin m) at wire references out_e. Then there exist a well-formed circuit C_fg ∈ XORCircuit(n+1) and wire references out'_e computing all m functions f_e(z, x) such that |C_fg| + m ≤ |C|. In particular, DXOR(B_G) ≥ m + DXOR(F_G).

Key contributions noted in exact-version screening

  • Standalone zero-Mathlib Lean 4 mechanization of the full Boyar-Matthews-Peralta Case-(a)/(b) XOR gate-elimination induction via descending multi-gate deletion.
  • Formal wire-by-wire correctness and exact 2m + k + 1 gate-count proof for the executable Hamiltonian-path CNOT synthesizer synthBG alongside free-SWAP/clean-ancilla lower bounds.
  • Complete, standalone 5,095-line Lean 4.36.0 formalization (zero Mathlib, -DwarningAsError=true, zero sorry, zero native_decide, zero custom axioms) covering all five pillars without gaps or vacuous preconditions.

Excerpted from published exact-version model assessment reports (not peer review). Full reports below →

Preview PDF on this page v2

Uses your browser's PDF viewer. Open the PDF directly if a preview is unavailable.

Full manuscript text in HTML (6,895 words — searchable plain text)

--- Page 1 --- End-to-End Lean 4 Mechanization of Optimal CNOT Circuit Synthesis Hardness: From Graph Clique Dominance and Boyar–Matthews–Peralta Gate Elimination to Free-SWAP and Clean-Ancilla Lower Bounds Major Revision (v2) of ARR-2026-01XK18W7DJ8AJAWH Lluis Eriksson Independent Researcher, Östersund, Sweden editor@airr.science December 4, 2026 Abstract We present a complete, standalone, zero-dependency Lean 4.36.0 mechanization (CnotHardnessV2.lean, 5,095 lines, zero Mathlib imports, compiled with -DwarningAsError=true, zero sorry, zero native_decide, and zero custom axioms) of the full mathematical reduction establishing the NP-hardness of optimal linear-reversible CNOT circuit synthesis over F2 (Pavlogiannis, 2026, building on Boyar, Matthews, and Peralta, 2013), simultaneously for pure CNOT circuits and for extended circuits equipped with arbitrarily many zero-cost SWAP gates and clean |0⟩ancilla qubits. This major revision (v2) completely replaces the elementary scalar fragments of v1 with genuine mathematical objects and complete proofs across five pillars: (1) finite simple graphs SimpleGraph n, exact clique dominance τ(G(H)) = 2τ(H)+2n (always even), and an explicit alternating Hamiltonian path of length 2|CH|+2n inside every lifted cover; (2) Fd 2 reversible CNOT semantics, universal involutivity B2 G = In+1+m, zero-cost SWAP elimination via wire relabeling, and constructive free- SWAP plus clean-ancilla translation into straight-line XOR circuits (DXOR ≤DSWAP,anc CNOT ); (3) sound single-gate deletion, descending multi-gate deletion, input substitution, and the universal BG →FG XOR lift (DXOR(BG) ≥m + DXOR(FG)); (4) the full Case-(a) vertexdeletion and Case-(b) vertex-merging Boyar–Matthews–Peralta gate-elimination induction plus matching constructive upper bound establishing DXOR(FG) = |E(G)|+τ(G); and (5) an executable Hamiltonian-path CNOT synthesizer synthBG proved wire-by-wire equal to BG in exactly 2m + |P| + 1 gates, the matching lower bound DSWAP,anc CNOT (BG) ≥2m + τ(G), and the end-to-end parity-rounding decision equivalence. Twenty audited primary theorems are verified by AuditAxioms.lean (6 strictly in {propext, Quot.sound}; 14 adding only Classical.choice), paired with an AST-audited zero-float Python certifier (6,460 AST nodes, 0 violations) verified up to GL(176, 2) (327 exact CNOT gates on G(C5)) and a 6/6 passing adversarial red-team suite. Subjects: Computer and information sciences; Mathematics. Companion repository (MIT, tagged v1.0.0): https://github.com/lluiseriksson/optimal-cnot-hardness-certificates-v2 1 Introduction, Resolution of v1 Defects, and Epistemic Scope Optimal synthesis of linear-reversible circuits over F2—finding a minimum-size sequence of CNOT gates realizing a given invertible matrix A ∈GL(d, 2)—is a foundational problem 1 AIRR.SCIENCE · ARR-2026-01XK18W7DJ8AJAWH v2 [Computer and inform...] 4 Dec 2026

--- Page 2 --in quantum circuit compilation, fault-tolerant Clifford optimization, and reversible computing. For irreversible straight-line XOR circuits realizing a linear map F : Fk 2 →Fm 2 , Boyar, Matthews, and Peralta [1] proved that minimizing the number of 2-input XOR gates, denoted DXOR(F), is NP-hard by linking the edge-form linear map FG(z, x0, . . . , xn−1)e = z ⊕xu ⊕xv (e = {u, v} ∈E(G)) of a simple graph G to its minimum vertex cover number τ(G) via the exact identity DXOR(FG) = |E(G)| + τ(G). Recently, Pavlogiannis [2] resolved the reversible CNOT complexity problem by embedding FG into the involutive reversible oracle BG ∈GL(n+1+m, 2), constructing a clique-join reduction H 7→G(H) whose minimum vertex cover has guaranteed even cardinality τ(G(H)) = 2τ(H) + 2n and induces a Hamiltonian path, synthesizing BG in 2m + τ(G) + 1 pure CNOT gates, proving the universal lower bound 2m + τ(G) even under arbitrary free SWAP gates and clean |0⟩ancillas, and closing the 1-gate gap between 2m + τ(G) and 2m + τ(G) + 1 via parity rounding K′ = 2⌊K/2⌋. 1.1 Complete Resolution of v1 Structural Defects The previous version (v1) of ARR-2026-01XK18W7DJ8AJAWH was rightly rejected by independent screening because its Lean artifact contained only 18 elementary 1-bit Bool/Nat identities with no formal graphs, vertex covers, Fd 2 linear maps, circuits, gate elimination, or reduction theorems, alongside internal notation bugs (an undefined symbol t in Lemma 2, unbound variables in a summary table, and conflation of DXOR(BG) with DCNOT(BG)). Table 1 documents how every v1 criticism is completely resolved in v2. Table 1: Exact defect-by-defect resolution from v1 to v2 of ARR-2026-01XK18W7DJ8AJAWH. v1 Defect Root Cause in v1 Complete Resolution in v2 Toy scalar Lean theorems Only 18 Bool/Nat scalar lemmas; 0 graphs, 0 matrices, 0 circuits 5,095-line standalone Lean 4.36.0 kernel (CnotHardnessV2.lean), 20 audited end-to-end theorems Undefined t in Lemma 2 Hamiltonian path Prose referenced t without binding t = 2|CH| Explicit constructive hamPathLemma2 interleaving s1 ∥s2 (t = 2|CH|) with K2n (Thm. 2.2) No Fd 2 circuits or zero-cost SWAP elimination Only 1-bit Bool parity toggles Full State d, CNOTGate d, ExtGate d, WirePerm d, elimSwaps, and clean-ancilla XOR translation (Thms. 3.1–3.2) Missing BG →FG lift and Lemma 3 gate elimination Unformalized claims; no Case-(a)/(b) graph induction Complete multi-gate deletion, BG →FG lift, and full Case-(a)/(b) Boyar–Matthews–Peralta induction (Thms. 4.1–4.3) Conflation of DXOR(BG) and DCNOT(BG) Mislabeled 2m + τ(G) vs. [2m + τ(G), 2m + τ(G) + 1] Exact separation: DXOR(FG) = m + τ(G), DSWAP,anc CNOT (BG) ≥2m + τ(G), DCNOT(BG) ≤2m + τ(G) + 1 (Thms. 5.1–5.3) Unbound variables / missing audit trail Unchecked prose formulas 20-theorem AuditAxioms.lean ledger, 6,460-node zero-float AST audit, GL(176, 2) verifier, 6/6 red-team tests 1.2 Explicit Epistemic Scope Boundary To prevent any overstatement of scope, we state explicitly what is and is not mechanized inside Lean 4: 1. 100% machine-checked in Lean 4.36.0 (CnotHardnessV2.lean, zero sorry, zero custom axioms): Every finite graph definition, vertex-cover and minimum-vertex-cover predicate, Lemma 2 graph G(H) and clique-dominance theorem τ(G(H)) = 2τ(H) + 2n, explicit Hamiltonian path in G(H), exact Fd 2 semantics of CNOT, SWAP, clean-ancilla, and straight-line XOR circuits, B2 G = I, zero-cost SWAP elimination, free-SWAP + cleanancilla to XOR translation, gate deletion and input substitution, universal BG →FG lift, 2

--- Page 3 --complete Case-(a)/(b) Boyar–Matthews–Peralta lower bound and constructive upper bound DXOR(FG) = m + τ(G), executable Hamiltonian-path CNOT synthesis synthBG with exact wire-by-wire correctness and gate count 2m + |P| + 1, universal free-SWAP/ancilla lower bound 2m + τ(G), and the end-to-end decision equivalence (Theorem 5.3). 2. External classical complexity-theoretic premise (not formalized as a Turingmachine model in Lean): The fact that Vertex Cover is NP-complete (Karp, 1972) and that the explicit combinatorial maps H 7→G(H) (4n vertices, O(n2) edges) and G 7→BG ∈GL(n + 1 + m, 2) are computable in deterministic polynomial time on a Turing machine are standard classical facts not encoded as a formal Turing-machine complexity class inside Lean 4. Combining that classical premise with Theorem 5.3 yields NP-hardness of optimal CNOT synthesis with or without free SWAPs and clean ancillas. 2 Pillar 1: Finite Simple Graphs, Vertex Covers, and Lemma 2 Clique Dominance We model a finite undirected simple graph on vertex set V = Fin n = {0, . . . , n −1} as a structure SimpleGraph n consisting of a Boolean adjacency predicate adj: Fin n →Fin n →Bool that is symmetric (adj u v = adj v u) and loopless (adj u u = false). A subset S : Fin n →Bool has cardinality |S| = cardFin S := P u∈Fin n 1S(u)=true. It is a vertex cover (IsVertexCover) if adj u v = true =⇒ S(u) = true ∨S(v) = true, and a minimum vertex cover of size τ (IsMinVertexCover H S τ) if S is a vertex cover with |S| = τ and every vertex cover T of H satisfies τ ≤|T|. The edge list graphEdgeList G enumerates all ordered pairs (u, v) with u < v and adj u v = true in lexicographic order without duplicates, with length |E(G)| = graphEdgeCount G. Definition 2.1 (Lemma 2 Graph Construction lemma2Graph). Given H = (Fin n, EH), define G(H) on Fin(4n) partitioned into three blocks: H1 = {0, . . . , n −1}, H2 = {n, . . . , 2n −1}, K2n = {2n, . . . , 4n −1}. Two distinct vertices u, v ∈Fin(4n) are adjacent in G(H) if and only if: 1. u, v ∈H1 and adjH(u, v) = true; 2. u, v ∈H2 and adjH(u −n, v −n) = true; 3. u, v ∈K2n with u̸ = v (so K2n is a clique of size 2n); or 4. exactly one of u, v lies in H1 ∪H2 and the other lies in K2n (complete bipartite join between H1 ∪H2 and K2n). For any C : Fin n →Bool, its lifted cover bC = liftCover C : Fin(4n) →Bool takes value C(u) on u ∈H1, C(u −n) on u ∈H2, and true on all u ∈K2n. Theorem 2.1 (Universal Cover Bound and Lifted Cover Parity). Lean 4: min_vertex_cover_le_pred, lemma2_cover_lift_valid_and_even. Let H be a SimpleGraph n. 1. If n ≥1, then S0(u) := (u̸ = 0) is a vertex cover of H with |S0| = n −1; consequently τ(H) ≤n −1. 2. If C is any vertex cover of H, then bC = liftCover C is a vertex cover of G(H) of exact even cardinality | bC| = 2|C| + 2n. 3

--- Page 4 --- Proof. For (1), because H is loopless, any edge {u, v} has u̸ = v, so at most one endpoint equals 0; hence S0(u) ∨S0(v) = true, and |S0| = n −1. For (2), every edge inside H1 or H2 is covered by the corresponding copy of C, while every edge incident to K2n (both intra-clique edges and join edges to H1 ∪H2) is covered because bC includes all of K2n. Partitioning Fin(4n) into the three disjoint blocks gives | bC| = |C| + |C| + 2n = 2|C| + 2n. Theorem 2.2 (Clique Dominance and Alternating Hamiltonian Path). Lean 4: lemma2_clique_dominance_exact_tau, lemma2_hamiltonian_path_in_cover. Let H be a SimpleGraph n with n ≥1, and let C be a minimum vertex cover of H with |C| = τ(H). 1. Exact clique dominance: bC = liftCover C is a minimum vertex cover of G(H) of exact even cardinality τ(G(H)) = 2τ(H) + 2n. 2. Constructive Hamiltonian path: For any subset C : Fin n →Bool (not even requiring C to be a cover), let s1 and s2 list the vertices of C in H1 and H2 respectively (so t := |s1 ∥s2| = 2|C| ≤2n), and let k2n = [2n, 2n + 1, . . . , 4n −1]. Then the interleaved sequence P = hamPathLemma2 C := interleave (s1 ∥s2) k2n has no duplicate vertices, satisfies |P| = 2|C| + 2n, visits precisely the vertices of bC (v ∈P ⇐⇒ bC(v) = true), and is a valid simple graph path in G(H) (IsGraphPath). Proof. For (1), by Theorem 2.1(2), bC is a valid cover of size 2τ(H) + 2n. Let T be any vertex cover of G(H), and let TH1, TH2, TK be its restrictions to H1, H2, K2n. Case 1 (K2n ⊆T): Because T covers all intra-H1 and intra-H2 edges, TH1 and TH2 induce vertex covers of H, so |TH1| ≥τ(H) and |TH2| ≥τ(H), while |TK| = 2n. Hence |T| ≥2τ(H) + 2n. Case 2 (some w ∈K2n satisfies T(w) = false): Because w is adjacent to every other vertex in K2n and to every vertex in H1 ∪H2, the vertex-cover condition forces T(u) = true for all u̸ = w, giving |T| = 4n −1. By Theorem 2.1(1), τ(H) ≤n −1, so 2τ(H) + 2n ≤4n −2 < 4n −1 = |T|. Thus bC is strictly optimal over Case 2 and optimal over Case 1. For (2), s1∥s2 consists of t = 2|C| ≤2n distinct vertices in H1∪H2, while k2n consists of 2n distinct vertices in K2n, disjoint from H1 ∪H2. Interleaving a0, b0, a1, b1, . . . , at−1, bt−1, bt, . . . , b2n−1 preserves nodup and exact membership in bC, has length t+2n = 2|C|+2n, and every consecutive pair is either in (H1 ∪H2)×K2n (or K2n ×(H1 ∪H2)), which is an edge by the complete bipartite join, or in K2n × K2n with distinct endpoints, which is an edge by the K2n clique. 3 Pillar 2: Fd 2 Linear-Reversible Circuits, Free SWAPs, and Clean Ancillas Let State d := Fin d →Bool denote the vector space Fd 2. A pure CNOT gate CNOTGate d is a pair (c, t) ∈Fin d × Fin d with c̸ = t, acting on s ∈Fd 2 by updating wire t 7→s(t) ⊕s(c) and leaving all other wires unchanged. An extended reversible gate ExtGate d is either cnot(c, t) (c̸ = t, unit cost) or swap(u, v) (zero cost), where swap(u, v) exchanges wire values s(u) and s(v). The CNOT cost of an extended circuit C is countCNOTs C, the number of cnot gates in C. Given a graph G on n vertices with m = |E(G)| edges e0, . . . , em−1 where ek = (ak, bk), the reversible oracle BG : Fn+1+m 2 → Fn+1+m 2 (evalBG) acts on wire layout (z, x0, . . . , xn−1, y0, . . . , ym−1) by preserving z and x0, . . . , xn−1 and mapping each edge wire yk to (BG(s))n+1+k = yk ⊕z ⊕xak ⊕xbk = yk ⊕FG(z, x)ek. Theorem 3.1 (Circuit Reversibility and Universal Oracle Involutivity). Lean 4: evalCNOTCircuit_reverse_inverse, evalBG_involutive. 1. For every pure CNOT circuit C on d wires and every state s ∈Fd 2, eval(Crev, eval(C, s)) = s. 4

--- Page 5 --- 2. For every n, edge list E of length m, and state s ∈Fn+1+m 2 , BG(BG(s)) = s. In particular, BG ∈GL(n + 1 + m, 2) with B−1 G = BG. Proof. For (1), a single CNOT(c, t) with c̸ = t leaves wire c unchanged, so applying it twice replaces s(t) by (s(t)⊕s(c))⊕s(c) = s(t); structural induction on C yields eval(Crev, eval(C, s)) = s. For (2), BG fixes z and all xu, so the second application XORs the identical term z ⊕xak ⊕xbk onto yk a second time, canceling identically. Next, we formalize straight-line irreversible XOR circuits (XORCircuit d): a list of pairs (r1, r2) ∈WireRef d × WireRef d, where a wire reference is either constant zero (0 ∈F2), an input wire inp i (i ∈Fin d), or a previously computed gate gate k (k < j for gate index j; captured by the well-formedness predicate C.wf). For a reversible circuit C on d + a wires where the last a wires are clean |0⟩ancillas, let padZero d a s ∈Fd+a 2 equal s(i) for i < d and false for d ≤i < d + a. Theorem 3.2 (Zero-Cost SWAP Elimination and Clean-Ancilla Translation). Lean 4: free_swap_zero_cost_elimination, free_swap_clean_ancilla_to_xor_circuit. 1. Zero-cost SWAP elimination: For every extended circuit C ∈List(ExtGate d), the executable pass elimSwaps C produces a wire bijection π ∈Sd (WirePerm d) and a pure CNOT circuit C′ such that |C′| = countCNOTs C and evalExt(C, s)(i) = evalCNOT(C′, s)(π(i)) for all s ∈Fd 2 and i ∈Fin d. 2. Free-SWAP and clean-ancilla to XOR translation: For any d, a ∈N and any extended circuit C ∈List(ExtGate (d+a)), the constructive translator translateExtAncillaToXOR d a C produces a wire-reference map ω: Fin(d+a) →WireRef d and a well-formed straight-line XOR circuit Cxor on d primary inputs such that every ω(i) is well-formed for Cxor, evalXOR(Cxor, s, ω(i)) = evalExt(C, padZero d a s)(i) (∀s ∈Fd 2, ∀i ∈Fin(d + a)), and |Cxor| ≤countCNOTs C. Proof. For (1), maintain a current wire permutation π initialized to idd. On encountering swap(u, v), compose π with transposition (u v) and emit no gates. On encountering cnot(c, t) (c̸ = t), emit CNOT(π(c), π(t)) (distinct because π is bijective) and keep π unchanged. Induction over C maintains the wire-value invariant evalExt(C, s)(i) = evalCNOT(C′, s)(π(i)) with exact length countCNOTs C. For (2), maintain a symbolic wire map ω: Fin(d + a) →WireRef d initialized to ω(i) = inp i for i < d and ω(i) = zero for d ≤i < d + a, together with an empty XOR circuit Cxor. Each gate updates (ω, Cxor) as follows: • swap(u, v): swap ω(u) and ω(v); emit 0 XOR gates. • cnot(c, t): if ω(c) = zero, leave ω unchanged (0 gates); if ω(t) = zero, set ω(t) := ω(c) (0 gates); otherwise append one XOR gate (ω(t), ω(c)) at index k = |Cxor| and set ω(t) := gate k (+1 gate). Because every CNOT adds at most 1 XOR gate (and strictly 0 whenever control or target holds zero) while every SWAP adds 0 gates, induction over C yields exact semantic preservation on padZero d a s and |Cxor| ≤countCNOTs C. 4 Pillars 3–4: Circuit Reductions, the BG →FG Lift, and Boyar– Matthews–Peralta Gate Elimination To establish tight circuit lower bounds on BG, we first formalize structural surgery on straightline XOR circuits: deleting redundant gates (individually and in batches) and substituting an input wire with a constant or another input wire. 5

--- Page 6 --- Theorem 4.1 (Soundness of Gate Deletion and Input Substitution). Lean 4: deleteGate_sound, deleteManyGates, substCircuit_sound. Let C ∈XORCircuit d be well-formed. 1. Single-gate deletion: If k < |C| and r0 is a wire reference with wf(k, r0) satisfying eval(C, s, gate k) = eval(C, s, r0) for all s ∈Fd 2, then C′ = deleteGate C k r0 is wellformed, has length |C| −1, and preserves every wire’s Boolean function under the remapping remapRef k r0. 2. Multi-gate deletion: If K = [k1, . . . , kr] is a duplicate-free list of gate indices < |C| such that each k ∈K has an earlier semantically equivalent reference rk (wf(k, rk)), then there exist a well-formed circuit C′ with |C′| + |K| = |C| and a well-formed reference map φ such that eval(C′, s, φ(r)) = eval(C, s, r) for all s and all well-formed r. 3. Input substitution: For any input index j ∈Fin d and any r0 with wf(0, r0) (i.e., zero or an input wire), C′ = substCircuit C j r0 is well-formed, has length |C|, and evaluates every remapped reference on state s identically to evaluating C on the modified state s[j 7→ eval(C, s, r0)]. Proof. For (1), removing gate k, substituting every reference to gate k with r0, and decrementing indices > k by 1 preserves topological acyclicity because wf(k, r0) guarantees r0 strictly precedes k; strong induction on gate index establishes semantic equivalence. For (2), we induct on |K| by deleting the maximum index kmax = max K first. Because every remaining k ∈K \ {kmax} satisfies k < kmax, its index and earlier witness reference rk (having wf(k, rk), hence index < k < kmax) are completely invariant under deleting kmax, allowing the inductive hypothesis to apply cleanly. For (3), replacing every occurrence of inp j with r0 leaves gate indices and lengths unchanged and induces the substitution s[j 7→eval(C, s, r0)] by strong induction on gate index. Theorem 4.2 (Universal BG → FG XOR Lower-Bound Lift). Lean 4: bg_to_fg_xor_lower_bound. Let n, m ∈N and let f0, . . . , fm−1 : Fn+1 2 →F2 be any m non-constant Boolean functions (each fe attains both values on Fn+1 2 ). Suppose a well-formed circuit C ∈XORCircuit(n + 1 + m) computes the m outputs ye ⊕fe(z, x) (e ∈Fin m) at wire references oute. Then there exist a well-formed circuit Cfg ∈XORCircuit(n + 1) and wire references out′ e computing all m functions fe(z, x) such that |Cfg| + m ≤|C|. In particular, DXOR(BG) ≥m + DXOR(FG). Proof. We proceed by induction on k ∈{0, . . . , m}, constructing for each k a well-formed circuit Ck ∈XORCircuit(n+1+m) and output references out(k) e such that |Ck|+k ≤|C| and, for every state s ∈Fn+1+m 2 , eval(Ck, s, out(k) e ) = ( fe(z, x) if e < k, ye ⊕fe(z, x) if e ≥k. The base case k = 0 holds with (C0, out(0)) = (C, out). For the inductive step k →k + 1 (with k < m), consider wire yk = inp(n + 1 + k) in Ck. First, out(k) k cannot be zero or any input wire: flipping yk changes yk ⊕fk(z, x) (ruling out zero and all inputs̸ = yk), while because fk is non-constant, varying (z, x) with yk = 0 changes yk ⊕fk(z, x) (ruling out inp(n +1 + k)). Hence out(k) k = gate g0 is a gate whose Boolean function depends sensitively on yk. By well-ordering of N, let g∗≤g0 be the minimum gate index in Ck whose Boolean function depends sensitively on yk. Inspecting the two operands (a, b) of gate g∗, minimality implies that neither a nor b can be an earlier gate depending on yk; hence at least one operand is literally inp(n + 1 + k). 6

--- Page 7 --- Apply Theorem 4.1(3) to substitute input wire yk ←zero in Ck. In the substituted circuit eCk, wire k now evaluates to 0 ⊕fk(z, x) = fk(z, x), while every output e̸ = k is unaffected (since its target specification does not depend on yk). Moreover, at least one operand of gate g∗is now zero, so gate g∗evaluates identically to its other operand (which has index < g∗). Deleting gate g∗via Theorem 4.1(1) produces a well-formed circuit Ck+1 with |Ck+1| = | eCk| −1 = |Ck| −1, hence |Ck+1| + (k + 1) ≤|C|, preserving all m output specifications. At k = m, the outputs of Cm depend only on (z, x); restricting the input domain from n + 1 + m to n + 1 via padding all y-wires to zero yields the desired circuit Cfg ∈XORCircuit(n + 1) with |Cfg| + m ≤|C|. We now turn to the heart of the lower bound: the exact characterization DXOR(FG) = |E(G)| + τ(G) due to Boyar, Matthews, and Peralta [1] and used as Lemma 3 in [2]. In CnotHardnessV2.lean, a circuit C ∈XORCircuit(n + 1) satisfies ComputesFG G C if C is well-formed and for every edge u < v of G there is a well-formed wire reference computing edgeForm n u v (z, x) := z ⊕xu ⊕xv. Define two graph operations on SimpleGraph n: • delVertex G u: deletes all edges incident to vertex u (isolating u); its edge count drops by degG(u). • mergeVertex G u v (for u̸ = v): deletes the edge {u, v} if present, redirects every remaining neighbor w /∈{u, v} of u to become adjacent to v (without creating parallel edges), and isolates u. Its edge count drops by 1{u,v}∈E(G) + |NG(u) ∩NG(v)|. Theorem 4.3 (Edge-Count Drops and Exact Boyar–Matthews–Peralta Complexity). Lean 4: graphEdgeCount_delVertex, graphEdgeCount_mergeVertex, lemma3_boyar_matthews_peralta_lower_bound, lemma3_fg_xor_upper_bound, lemma3_exact_dxor_fg. Let G be a SimpleGraph n with m = |E(G)| edges and minimum vertex cover number τ(G). 1. Exact edge-count drops: For every u ∈Fin n, |E(G)| = |E(delVertex G u)| + degG(u). For all u̸ = v ∈Fin n, |E(G)| = |E(mergeVertex G u v)| + 1{u,v}∈E(G) + |NG(u) ∩NG(v)|. 2. Lower bound (localized gate elimination): For every straight-line circuit C ∈ XORCircuit(n + 1) with ComputesFG G C, there exists a vertex cover S of G such that |E(G)| + |S| ≤|C|. 3. Constructive upper bound: For every vertex cover S of G, the explicit circuit buildFGUpperCircuit G S computes FG in exact length |E(G)| + |S|. 4. Exact characterization: DXOR(FG) = |E(G)|+τ(G), i.e., there exists C with ComputesFG G C and |C| = m + τ(G), and every C with ComputesFG G C satisfies m + τ(G) ≤|C|. Proof. Part (1) is proved by counting unordered pairs {a, b} (a < b) whose adjacency status changes from true to false under delVertex (precisely the degG(u) edges incident to u) and mergeVertex (precisely the edge {u, v} if present, plus one collapsed parallel edge for each common neighbor w ∈NG(u) ∩NG(v)). For Part (3), buildFGUpperCircuit G S first computes gu = z ⊕xu for every u ∈S (|S| gates), and then for each edge e = {a, b} ∈E(G) picks an endpoint u ∈S ∩{a, b} and emits one gate gu ⊕xv (|E(G)| gates), achieving exact length |E(G)| + |S|. For Part (2), we proceed by strong induction on circuit length L with |C| ≤L. If |E(G)| = 0, the empty cover S = ∅satisfies 0 + 0 ≤|C|. Otherwise G has at least one edge, so |C| ≥1 (since z ⊕xu ⊕xv has weight 3 and cannot be computed by 0 gates or even by gate 0, which has weight ≤2). Inspect gate 0 of C, which computes a⊕b for inputs a, b ∈{zero, inp 0, . . . , inp n}. If a = zero, b = zero, or a = b, gate 0 is trivially redundant (b, a, or zero); deleting it via Theorem 4.1(1) gives |C′| = |C| −1 still computing FG, and induction closes immediately. Otherwise a, b are two distinct input wires, yielding exactly two non-trivial cases: 7

--- Page 8 --- • Case (a): Gate 0 computes z ⊕xu for some vertex u ∈Fin n. Substitute input wire xu ←z (using Theorem 4.1(3)). Gate 0 now evaluates to z ⊕z = 0 (redundant). Moreover, for every neighbor w ∈NG(u), the edge form z ⊕xu ⊕xw becomes z ⊕z ⊕xw = xw, an existing input wire, so the gate gw that computed edge {u, w} becomes redundant! Crucially, because all edge forms z ⊕xu ⊕xw for distinct w ∈NG(u) are pairwise distinct Boolean functions (and none can equal gate 0, which has weight 2), the gates {0} ∪{gw : w ∈NG(u)} are 1 + degG(u) pairwise distinct redundant gates in the substituted circuit! Deleting all 1 + degG(u) of them via deleteManyGates (Theorem 4.1(2)) produces a circuit C′ of length |C′| = |C| −1 −degG(u) that still computes FG′ for G′ = delVertex G u (because no edge of G′ touches u). By induction, G′ has a vertex cover S′ with |E(G′)| + |S′| ≤|C′|. Setting S := S′∪{u} gives a valid vertex cover of G (since u covers all deleted edges), and by Part (1): |E(G)| + |S| ≤

|E(G′)| + degG(u)

+ (|S′| + 1) ≤|C′| + degG(u) + 1 = |C|. • Case (b): Gate 0 computes xu ⊕xv for two distinct vertices u̸ = v ∈Fin n. Substitute input wire xu ←xv (Theorem 4.1(3)). Gate 0 becomes xv ⊕xv = 0 (redundant). If {u, v} ∈ E(G), the gate guv computing z ⊕xu ⊕xv becomes z ⊕xv ⊕xv = z (redundant, and distinct from gate 0). For every common neighbor w ∈NG(u)∩NG(v), the two distinct gates guw and gvw computing z⊕xu⊕xw and z⊕xv⊕xw now compute the same Boolean function z⊕xv⊕xw, so the later gate max(guw, gvw) becomes redundant with the earlier gate min(guw, gvw)! All such later gates (one per w ∈NG(u) ∩NG(v)), together with gate 0 and (if present) guv, are pairwise distinct because the original edge functions z ⊕xa ⊕xb are pairwise distinct over distinct unordered pairs {a, b}. Deleting all 1 + 1{u,v}∈E(G) + |NG(u) ∩NG(v)| redundant gates via deleteManyGates leaves a circuit C′ of length |C′| = |C| −1 −1{u,v}∈E(G) −|NG(u) ∩NG(v)| that computes FG′ for G′ = mergeVertex G u v (any edge {u, w} with w /∈{u, v} turns into z ⊕xv ⊕xw, which is precisely the redirected edge {v, w} in G′!). By induction, G′ has a vertex cover S′ with |E(G′)|+|S′| ≤|C′|. Now construct a cover S of G from S′ as follows: if v ∈S′, set S := S′ ∪{u} (covering {u, v} and every edge {u, w} of G); if v /∈S′, then because S′ covers all edges of G′ incident to v (which include all neighbors w /∈{u, v} of u and of v in G), every edge of G except possibly {u, v} is already covered by S′, so setting S := S′ ∪{u} again yields a valid vertex cover of G with |S| ≤|S′|+1! Combining this with Part (1) yields |E(G)| + |S| ≤

|E(G′)| + 1{u,v}∈E(G) + |NG(u) ∩NG(v)|

+ (|S′| + 1) ≤|C|. Part (4) follows immediately from Parts (2) and (3) applied to a minimum vertex cover of size τ(G). 5 Pillar 5: Executable Hamiltonian-Path Synthesis and End-to- End CNOT Hardness We now combine Pillars 1–4 into the executable upper-bound synthesizer, the matching free- SWAP/clean-ancilla lower bound, and the full end-to-end decision equivalence. Theorem 5.1 (Executable Hamiltonian-Path CNOT Synthesis). Lean 4: lemma4_ham_path_cnot_synth. Let G be a SimpleGraph n with m = |E(G)| edges, and let P = [p0, . . . , pk−1] be any nonempty duplicate-free simple graph path in G (k = |P| ≥1) whose vertex set is a vertex cover of G. Then the executable pure-CNOT synthesizer synthBG (graphEdgeList G) P realizes BG wire-for-wire across all n + 1 + m wires: ∀s ∈Fn+1+m 2 , evalCNOT(synthBG (graphEdgeList G) P, s) = BG(s), 8

--- Page 9 --using exact gate count |synthBG (graphEdgeList G) P| = 2m + k + 1. Proof. Partition E(G) into the k −1 consecutive path edges {pi, pi+1} (0 ≤i < k −1) and the m −(k −1) non-path edges. Because P covers G, every non-path edge e = {a, b} has a unique owner index i = min{j : pj ∈{a, b}} and opposite endpoint w ∈{a, b} \ {pi}. The synthesizer maintains the loop invariant SynthInv: all x-wires remain unchanged, wire z holds z0 ⊕xpi at step i, and every edge wire ye holds y(0) e ⊕FG(s0)e if e has been processed before step i and y(0) e otherwise: 1. Initialize (1 gate): Apply CNOT(xp0, z), setting z ←z0 ⊕xp0. 2. At step i (u = pi): For each non-path edge e = {u, w} owned by step i, apply the 2-gate nonPathEdgeGadget: CNOT(z, ye) then CNOT(xw, ye). This sets ye ←ye ⊕(z0 ⊕xu)⊕xw = ye ⊕FG(s0)e while leaving z = z0 ⊕xu intact. 3. Path transition u = pi →v = pi+1 (3 gates): Because P is a simple graph path, e = {u, v} is a distinct edge of G. Apply the 3-gate pathStepGadget: CNOT(xv, z), CNOT(z, ye), CNOT(xu, z). After the first gate, z holds z0 ⊕xu ⊕xv = FG(s0)e; the second gate XORs this into ye; the third gate cancels xu, leaving z = z0 ⊕xv for step i + 1. 4. Finalize (1 gate): After processing non-path edges owned by pk−1, apply CNOT(xpk−1, z), restoring z = z0. Every edge of G is processed exactly once (each path edge during its unique transition, each non-path edge at its unique owner step), and all x-wires and z return to their initial values, proving wire-for-wire equality with BG(s) (even in the degenerate case m = 0, k = 1, where 2 · 0 + 1 + 1 = 2 toggling gates cancel to I = BG). The exact gate count is 1 + 2

m −(k −1)

+ 3(k −1) + 1 = 2m + k + 1. Theorem 5.2 (Universal Free-SWAP and Clean-Ancilla Lower Bound). Lean 4: lemma4_free_swap_ancilla_lower_bound. Let G be a SimpleGraph n with m = |E(G)| edges and minimum vertex cover number τ(G). Let a ∈N be arbitrary and let C ∈List(ExtGate (n + 1 + m + a)) be any extended circuit (with arbitrary free SWAP gates and a clean |0⟩ancillas) that realizes the m edge output wires of BG on padZero (n + 1 + m) a s: ∀s ∈Fn+1+m 2 , ∀e ∈Fin m, evalExt(C, padZero (n + 1 + m) a s)n+1+e = BG(s)n+1+e. Then countCNOTs C ≥2m + τ(G). Proof. By Theorem 3.2(2), translateExtAncillaToXOR yields a well-formed straight-line XOR circuit Cxor ∈XORCircuit(n + 1 + m) computing all m outputs ye ⊕FG(z, x)e with |Cxor| ≤ countCNOTs C. Because every edge form FG(z, x)e = z ⊕xa ⊕xb is non-constant (flipping z flips its value), Theorem 4.2 extracts a well-formed circuit Cfg ∈XORCircuit(n + 1) computing FG with |Cfg| + m ≤|Cxor|. Finally, Theorem 4.3(4) gives m + τ(G) ≤|Cfg|. Chaining the three inequalities yields 2m + τ(G) = m +

m + τ(G)

≤m + |Cfg| ≤|Cxor| ≤countCNOTs C. 9

Showing searchable text extract (29,469 characters of 6,895 total words). Open or download the canonical PDF above for the complete typeset manuscript and equations.

References (4)

  1. J. Boyar, P. Matthews, and R. Peralta, ``Logic minimization techniques with applications to cryptology,'' Journal of Cryptology, vol. 26, no. 2, pp. 280–312, 2013
  2. A. Pavlogiannis, ``Optimal CNOT circuit synthesis is NP-hard,'' arXiv preprint arXiv:2611.34138v1, 2026 [arXiv:2611.34138v1]
  3. R. M. Karp, ``Reducibility among combinatorial problems,'' in Complexity of Computer Computations, R. E. Miller and J. W. Thatcher, Eds., Plenum Press, pp. 85–103, 1972
  4. L. de Moura and S. Ullrich, ``The Lean 4 theorem prover and programming language,'' in CADE-28, LNCS vol. 12699, Springer, pp. 625–635, 2021
Reference this work

Cite this paper

v2 · 2026-12-04

Lluis Eriksson (2026). End-to-End Lean 4 Mechanization of Optimal CNOT Circuit Synthesis Hardness: From Graph Clique Dominance and Boyar-Matthews-Peralta Gate Elimination to Free-SWAP and Clean-Ancilla Lower Bounds. AIRR.SCIENCE, ARR-2026-01XK18W7DJ8AJAWH, v2. https://airr.science/papers/ARR-2026-01XK18W7DJ8AJAWH/versions/v2/ DOI: 10.5281/zenodo.24651589.

Use the DOI (when listed) or permanent version link to cite the exact manuscript you read. A DOI is a persistent citation identifier, not journal peer review. A Working paper label means the version has not completed AIRR screening. Import BibTeX, RIS or CSL JSON into your reference manager to apply a citation style.

Version history

The paper identifier remains stable. Each version has its own immutable release, timestamp and version identifier.

  • v2 · major revision · source snapshot available · viewing
  • v1 · source snapshot available

Revision statement

Major revision. Major v2 end-to-end 5,095-line standalone Lean 4.36.0 mechanization resolving every v1 screening objection: replaces v1's 18 toy 1-bit Bool/Nat lemmas with 20 audited primary theorems (zero Mathlib, -DwarningAsError=true, 0 sorry, 0 native_decide, 0 custom axioms) covering genuine SimpleGraph n and Lemma 2 clique dominance (tau(G(H)) = 2*tau(H)+2n even, explicit alternating Hamiltonian path hamPathLemma2 with t = 2|C_H|), real F_2^d reversible/extended/XOR circuits, B_G^2 = I, 0-cost SWAP elimination, clean-ancilla XOR translation, descending multi-gate deletion, universal B_G -> F_G lift, complete Case-(a)/(b) Boyar-Matthews-Peralta gate elimination (D_XOR(F_G) = m + tau(G)), executable synthBG (2m+k+1 gates), universal free-SWAP/ancilla lower bound (2m+tau(G)), and Theorem 5 parity-rounding equivalence, backed by a 6,460-node zero-float AST-audited verifier up to GL(176, 2) and 6/6 red-team suites.

Verification record

Frontier-model screening
Pass · 2 models
Source integrity
Pass
Bibliographic integrity
Pass
Reproducibility
Pass
Lean 4
L2

Recorded under ARR-VERIFY-1.0. AIRR verification and screening are not peer review.

Related subject

More in Computer and information sciences

Browse all Computer and information sciences papers →

AI assistance statement

Authored by Lluis Eriksson with AI-assisted Lean 4 proof engineering, zero-float verification scripting, and manuscript preparation (Google Antigravity). Public MIT repository: https://github.com/lluiseriksson/optimal-cnot-hardness-certificates-v2 (v1.0.1). Evaluated by two isolated blind reviewers (Google/helium and Google/hydrogen) under AIRR-FOUNDER-1.0.

Frontier-model screening

Status: pass. Any listed reports correspond to this exact version under ARR-SCREEN-1.0; no absent assessment is represented as a pass.

  • heliumGoogle · pass
  • hydrogenGoogle · pass
Longitudinal frontier-model record

Model assessments and review context

Read the scale and limits
4.90 / 10.00Very good
Distinct models
3
Range
4.10–5.60
Method
bounded capability-weighted mean · exact version only

Limited evidence · 0/3 benchmark matches. This is an evidence description, not a probability of correctness.

Fresh blinded review context not documented for every model; Benchmark match incomplete; Review scores differ by more than one point

Score calculation and evidence

Unweighted mean: 4.90. Policy: AIRR-RATING-1.4. Method and limits.

ModelOriginal scoreWeightBasis
Google · helium5.001.000No evidenced exact benchmark configuration
Google · hydrogen5.601.000No evidenced exact benchmark configuration
Anthropic · claude-opus-5-54.101.000No evidenced exact benchmark configuration

Download the calculation snapshot

Anthropic · claude-opus-5-5 · not involved in manuscript · review context: unknown4.10

Recommendation: Accept · Material objections: 0

The paper presents a standalone Lean 4 mechanization of the reduction showing that optimal CNOT synthesis is NP-hard, following Pavlogiannis (2026) and building on Boyar–Matthews–Peralta. It formalizes six ingredients: (i) the clique-join graph G(H) with tau(G(H)) = 2tau(H)+2n and a Hamiltonian path through the lifted cover; (ii) F_2^d CNOT/SWAP/ancilla semantics, involutivity of B_G, and translation of free-SWAP/clean-ancilla circuits to XOR circuits; (iii) gate deletion and input substitution, and the lift D_XOR(B_G) >= m + D_XOR(F_G); (iv) the exact identity D_XOR(F_G) = |E|+tau via Case-(a)/(b) gate elimination; (v) an executable synthesizer using 2m+k+1 gates; and (vi) a parity-rounded decision equivalence. I checked the prose proofs and found no material gaps: gate distinctness, cover repair in the merge case, minimal-sensitive-gate elimination and gate counts all hold. The worked numerical tables are consistent. The work is a careful formalization and certification of known or recently published mathematics. It does not establish new theorems, and the polynomial-time reduction layer remains informal. Its value lies mainly in rigor and reproducibility rather than mathematical novelty.

Correctness confidence
I checked the main prose arguments and found them sound. These include clique dominance, with Case 2 forcing |T|>=4n-1 > 2tau(H)+2n; the B_G->F_G lift via the minimal y_k-sensitive gate; and the BMP Case-(a)/(b) induction with distinct redundant gates and the cover repair S'∪{u}. Also checked: the synthBG count 1+2(m-k+1)+3(k-1)+1, the parity rounding, and the Table 3 numbers (G(C5): m=155, d=176, 327 gates). I could not inspect the Lean source itself.
Rigor
The paper claims a 5,095-line standalone Lean 4 development with no sorry, no native_decide and no custom axioms, plus an axiom ledger for 20 named theorems. Every definition (vertex cover, XOR circuit well-formedness, ExtGate semantics, padZero) and every lemma statement is precise. Prose proofs give explicit invariants. The polynomial-time computability and NP-completeness premises are honestly left informal.
Novelty
The mathematics is attributed to Boyar–Matthews–Peralta (2013) and Pavlogiannis (2026). The contribution is a mechanization and an executable certification of an existing reduction. The gate-elimination induction phrased through delVertex/mergeVertex and the deleteManyGates bookkeeping are careful engineering, not new theorems.
Significance
A complete machine-checked proof of the combinatorial core of CNOT-synthesis NP-hardness has real value for verified quantum compilation, and it covers the free-SWAP and clean-ancilla variants. However, it adds no new complexity-theoretic result, and its significance is bounded by that of the underlying preprint.
Reproducibility
The paper names a public MIT repository with a tagged release, gives the toolchain version, an axiom audit, an exact-integer Python certifier and a red-team suite. Its numerical tables are internally consistent and independently recomputable (e.g. edge counts of G(H)). The Lean code is not reproduced in the PDF, so verification depends on the external artifact. The core reduction relies on a recent arXiv preprint [2].

Strengths

  • Correct and fully explicit gate-elimination induction for D_XOR(F_G) = |E(G)|+tau(G). The redundant gates (gate 0, g_uv, and max(g_uw, g_vw) for each common neighbour) are pairwise distinct because the edge forms are distinct weight-3 functions. Each has an earlier equivalent reference, so descending multi-deletion is well-founded.
  • Clean lower-bound pipeline for circuits with free SWAPs and clean ancillas. Each CNOT yields at most one XOR gate (symbolic wire map, with zero-control and zero-target shortcuts). The B_G->F_G lift then removes one gate per non-constant output, using a minimal y_k-sensitive gate.
  • The constructive upper bound is precise. Its loop invariant, ownership of non-path edges and gate count 1+2(m-k+1)+3(k-1)+1 = 2m+k+1 are correct, and evenness of tau(G(H)) correctly closes the one-gate gap via K' = 2 floor(K/2).
  • The paper states its epistemic scope explicitly: NP-completeness of Vertex Cover and polynomial-time computability are left as informal premises. It reports an axiom footprint for each theorem, and all its numerical tables are internally consistent (e.g. m_G=155, d=176, 327 gates for G(C5)).

Weaknesses

  • No new mathematical theorems: every main result is a re-proof or mechanization of Boyar–Matthews–Peralta (2013) and Pavlogiannis (2026). The contribution is formalization engineering, which the calibration rubric does not reward in the headline score.
  • The core reduction (clique-join, Hamiltonian synthesis, parity rounding) is attributed to a recent arXiv preprint [2], not yet refereed as far as the manuscript indicates. The significance of the formalized result depends on that source.
  • The Lean source is not reproduced or excerpted in the PDF. Claims of zero sorry, the axiom footprints and alignment between the formal statements and the prose depend on the external repository. The reader cannot check, for example, that ComputesFG or the D_XOR quantifiers match the informal definitions exactly.
  • Polynomial-time computability of H -> G(H) -> B_G and the many-one reduction structure are not formalized. The headline 'end-to-end' NP-hardness is therefore a formal combinatorial equivalence plus informal complexity premises.
  • The computational certification (graphs up to G(C5), GL(176,2)) consists of small sanity instances, and the paper's emphasis on it is somewhat promotional. Calling the 14 theorems that use Classical.choice 'end-to-end audited' adds little beyond the standard kernel guarantee.
  • The prose proof of Theorem 4.3(2) treats z ⊕ x_u ⊕ x_v as having 'weight 3' without defining weight for wire references. It also omits the degenerate case where gate 0's operands are an input and itself after substitution; these are presumably handled in Lean but are not visible.

Potential errors

  • Minor: Table 1 and the abstract mix the notations D_XOR(F_G) = |E(G)|+tau(G) and m+tau(G) without always stating that m = |E(G)| refers to the graph G = G(H), not H. A reader could confuse m_H with m_G.
  • Minor: Theorem 2.2(1) lists n >= 1 as a hypothesis but appeals to Theorem 2.1(1) only in Case 2. The paper should state explicitly that for n = 0 both sides are trivially 0.

Strong novelty candidates

  • To the extent claimed, this is a first complete kernel-checked formalization of the BMP vertex-cover characterization of XOR complexity of F_G via explicit vertex-deletion/vertex-merging gate elimination, combined with a formal free-SWAP/clean-ancilla to XOR-circuit translation for reversible CNOT lower bounds.

Unresolved material objections

None reported.

arr:assessment:e5c481ff-562f-42cf-b60a-1bf506c12534 · prompt ARR-ASSESS-1.0 · response SHA-256 bb4edf6cc003ad4cc49b7067df941a66ad89ff5416b6d3322513d015a6f4ceba · canonical PDF SHA-256 f364730e7dc7fca579c3f4126deb3a62c1316d60b8648f160885797f24f75382

Google · helium · involved in manuscript · review context: unknown5.00

Recommendation: Accept · Material objections: 0

All v1 structural defects and both v2 reporting discrepancies are fully resolved. CnotHardnessV2.lean (5,095 lines, zero Mathlib, -DwarningAsError=true) proves all 20 audited theorems across all five pillars with 0 sorry, 0 native_decide, and 0 custom axioms, paired with an honest Section 1.2 epistemic scope boundary, an AST-audited zero-float F2 certifier up to GL(176,2) matching Tables 2-4 and Figure 1 verbatim, and a 6/6 red-team suite covering both Case-(a)/(b) incomplete-circuit rejection and parsed axiom-set validation.

Correctness confidence
All 20 Lean 4.36.0 theorems compile with -DwarningAsError=true, 0 sorry, 0 native_decide, and 0 custom axioms; the updated Thm 3.2(2) prose proof now matches Lean translateStep and Python translate_ext_ancilla_to_xor verbatim, and all tables and figures match exact F2 data up to GL(176,2).
Rigor
Standalone zero-Mathlib formalization of SimpleGraph, lemma2Graph clique dominance, B_G involutivity, 0-cost SWAP relabeling, clean-ancilla XOR translation, descending batch deletion, BMP Case-(a)/(b) contraction, and synthBG, with an explicit Sec. 1.2 epistemic scope boundary excluding TM polytime computability.
Novelty
The mathematical theorems, clique-dominance reduction, BMP gate elimination, and parity-rounding argument are known results from Boyar-Matthews-Peralta (2013) and Pavlogiannis (2026). Novelty lies solely in producing the first standalone zero-Mathlib Lean 4 mechanization and proof-engineering abstractions.
Significance
Delivers a complete, self-contained, machine-checked verification artifact for optimal CNOT synthesis hardness under free SWAPs and clean ancillas, fully resolving all defects of v1. Significance is bounded because no new complexity bounds are proved and TM complexity remains an external premise.
Reproducibility
Independently reproduced Lean 4.36.0 (-DwarningAsError=true) compilation, regex-parsed AuditAxioms.lean ledger (6 constructive, 14 Classical.choice, 0 custom axioms), the 6,460-node zero-float AST audit (SHA256 match), bit-exact verification_report.json regeneration, and updated red-team tests 1-6.

Strengths

  • Complete 5,095-line standalone Lean 4.36.0 mechanization (zero Mathlib, -DwarningAsError=true, 0 sorry, 0 native_decide, 0 custom axioms) across 20 audited theorems in AuditAxioms.lean (6 in {propext, Quot.sound}, 14 adding Classical.choice).
  • Full resolution of all v1 defects: genuine SimpleGraph n and lemma2Graph clique dominance (tau(G(H))=2*tau(H)+2n even, alternating Hamiltonian path hamPathLemma2 with t=2|C_H|), real F_2^d circuits, universal B_G^2=I, zero-cost SWAP relabeling, clean-ancilla XOR translation, descending batch deletion deleteManyGates, B_G->F_G lift, complete Case-(a)/(b) Boyar-Matthews-Peralta induction, executable synthBG (2m+k+1 gates), and parity-rounding Theorem 5.3.
  • All v2 reporting issues resolved: Theorem 3.2(2) proof matches Lean translateStep and Python translate_ext_ancilla_to_xor verbatim; Section 6.2 documents pre-simplification Table 4(b) counts; test_redteam.py Test 5 verifies both Case-(a) and Case-(b) incomplete-circuit rejection and Test 6 parses all 20 axiom footprints.
  • Independent pure-integer/bitmask certifier (verify_cnot_v2.py, 6,460 AST nodes, 0 float violations, matching SHA256) reproduces verification_report.json identically up to GL(176,2) (327 exact CNOTs on G(C5)).

Weaknesses

  • Polynomial-time Turing-machine computability of H -> G(H) -> B_G and Karp NP-completeness of Vertex Cover remain external classical premises outside Lean 4, as honestly disclosed in Section 1.2.
  • Novelty and mathematical significance are inherently bounded because the paper mechanizes known theorems from Boyar-Matthews-Peralta (2013) and Pavlogiannis (2026) rather than establishing new complexity lower or upper bounds.

Potential errors

None reported.

Strong novelty candidates

  • First standalone zero-Mathlib Lean 4 formalization combining Pavlogiannis (2026) CNOT synthesis hardness (free SWAPs, clean ancillas, Lemma 2 clique dominance, Hamiltonian-path synthBG, parity rounding) with full Case-(a)/(b) Boyar-Matthews-Peralta XOR gate elimination.
  • Constructive descending-index multi-gate deletion kernel (deleteManyGates) preserving DAG well-formedness and earlier witness references across simultaneous redundant-gate removals.

Unresolved material objections

None reported.

arr:assessment:ab9f5bad-4e4a-40b8-a520-0c826aeb694a · prompt ARR-ASSESS-1.0 · response SHA-256 b9a830ead90c7f76b5410fe038292377907b3f386bac00b31d7d0a78bb6a71bd · canonical PDF SHA-256 f364730e7dc7fca579c3f4126deb3a62c1316d60b8648f160885797f24f75382

Google · hydrogen · involved in manuscript · review context: unknown5.60

Recommendation: Accept · Material objections: 0

Major Revision (v2) of ARR-2026-01XK18W7DJ8AJAWH completely resolves every structural defect of v1 and all minor documentation discrepancies identified during review. It provides a self-contained, zero-Mathlib, zero-sorry Lean 4.36.0 mechanization of the Pavlogiannis (2026) and Boyar-Matthews-Peralta (2013) optimal CNOT synthesis hardness reduction, verified against an exact-match zero-float Python certifier and an upgraded 6/6 adversarial red-team suite. Because the paper mechanizes known theorems rather than proving new mathematics, it is calibrated at 5 stars (strong complete self-contained formalization) with acceptance recommended and zero unresolved material objections.

Correctness confidence
All 5,095 lines of CnotHardnessV2.lean compile cleanly under Lean 4.36.0 with -DwarningAsError=true, zero sorry, zero native_decide, and zero custom axioms. AuditAxioms.lean verifies all 20 theorems (6 constructive, 14 adding Classical.choice), and verify_cnot_v2.py matches verification_report.json identically.
Rigor
Replaces v1 scalar fragments with genuine SimpleGraph n, F_2^d reversible circuits, wire-relabeling SWAP elimination, clean-ancilla XOR translation, descending multi-gate deletion, universal B_G->F_G lift, Case-(a)/(b) Boyar-Matthews-Peralta gate elimination, executable synthBG, and parity rounding. Section 1.2 states the TM boundary explicitly.
Novelty
The underlying mathematical results are prior published theorems (Boyar-Matthews-Peralta 2013; Pavlogiannis 2026), not new mathematics. Novelty lies in the standalone, zero-Mathlib Lean 4 mechanization of the full reduction, especially the Case-(a)/(b) graph-contraction induction and wire-level synthBG invariant.
Significance
Delivers a self-contained formal verification artifact for linear-reversible CNOT synthesis hardness (with and without free SWAPs and clean ancillas) and an AST-audited zero-float certifier up to GL(176,2), though it mechanizes an existing result and leaves Turing-machine complexity external.
Reproducibility
Standalone zero-Mathlib Lean 4.36.0 build, 20-theorem axiom ledger, 6,460-node zero-float AST-audited verify_cnot_v2.py, matching verification_report.json, and 6/6 passing red-team tests (Case-(a)/Case-(b) forgery rejection, AST tamper rejection, and strict 6/14 axiom-split checks) are fully reproducible.

Strengths

  • Complete, standalone 5,095-line Lean 4.36.0 formalization (zero Mathlib, -DwarningAsError=true, zero sorry, zero native_decide, zero custom axioms) covering all five pillars without gaps or vacuous preconditions.
  • Genuine mathematical objects and proofs: SimpleGraph n, exact clique dominance tau(G(H)) = 2*tau(H) + 2n (for n >= 1), explicit alternating Hamiltonian path hamPathLemma2 with t = 2|C_H|, universal B_G^2 = I, zero-cost SWAP elimination, and clean-ancilla XOR translation.
  • Full formalization of the Case-(a) vertex-deletion and Case-(b) vertex-merging Boyar-Matthews-Peralta gate-elimination lower bound (with exact edge-count drop identities and descending deleteManyGates) plus matching upper bound D_XOR(F_G) = |E(G)| + tau(G).
  • Executable pure-CNOT synthesizer synthBG proved wire-for-wire equal to B_G on all 2^(n+1+m) states in exact gate count 2m + |P| + 1, paired with the free-SWAP/clean-ancilla lower bound >= 2m + tau(G) and Theorem 5 parity-rounding equivalence.
  • Explicit epistemic scope boundary (Section 1.2) clearly separating machine-checked combinatorial/circuit theorems from the unformalized classical Turing-machine NP-completeness premise.
  • AST-audited zero-float Python certifier (6,460 AST nodes, 0 violations) verified live against verification_report.json up to GL(176, 2) (327 CNOTs on G(C5)) and 6/6 passing red-team tests covering both Case-(a) and Case-(b) incomplete-circuit rejection and strict 6/14 axiom-split validation.

Weaknesses

  • Mathematical novelty is limited to mechanization: all core theorems are formalizations of Pavlogiannis (2026) and Boyar-Matthews-Peralta (2013).
  • Polynomial-time computability of H -> G(H) and G -> B_G and NP-completeness of Vertex Cover are external classical premises rather than formalized in a Turing-machine model.

Potential errors

None reported.

Strong novelty candidates

  • Standalone zero-Mathlib Lean 4 mechanization of the full Boyar-Matthews-Peralta Case-(a)/(b) XOR gate-elimination induction via descending multi-gate deletion.
  • Formal wire-by-wire correctness and exact 2m + k + 1 gate-count proof for the executable Hamiltonian-path CNOT synthesizer synthBG alongside free-SWAP/clean-ancilla lower bounds.

Unresolved material objections

None reported.

arr:assessment:90d41fed-da53-4627-a85b-8ba4fbfd2b3b · prompt ARR-ASSESS-1.0 · response SHA-256 44abd11987434600ae78aa545614c3af87bf3eee9b1fd12f8a915340e89e9d70 · canonical PDF SHA-256 f364730e7dc7fca579c3f4126deb3a62c1316d60b8648f160885797f24f75382

A model assessment is not peer review or a correctness certificate. AIRR preserves disagreement, exact-version provenance and later reassessments.

Editorial disclosure

Accepted as v2 major upgrade under AIRR-FOUNDER-1.0 following unanimous isolated blind dual-model review (Google/helium 5.0/10 accept, Google/hydrogen 5.6/10 accept) with zero potential errors, zero unresolved material objections, and green CI on https://github.com/lluiseriksson/optimal-cnot-hardness-certificates-v2 (v1.0.1).

Record timestamps & download statistics
Deposit recordedFirst repository commit · full Git SHA recorded
PublishedGitHub release · tag ARR-2026-01XK18W7DJ8AJAWH-v2
Canonical PDF downloads0GitHub release downloads only; direct AIRR PDF reads are not included
Page viewsNot availablePage-view counts are not available in this public snapshot. Optional operator statistics are separate.
Definitions and rankings →