\documentclass[11pt]{article} \usepackage[margin=1in]{geometry} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{amsmath,amssymb,amsthm,mathtools} \usepackage{enumitem} \usepackage{booktabs} \usepackage[hidelinks,pdfauthor={},pdftitle={Perfect f-routing with polynomial entanglement and communication}]{hyperref} \newtheorem{theorem}{Theorem} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \newtheorem{proposition}[theorem]{Proposition} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \newcommand{\tr}{\operatorname{Tr}} \newcommand{\ket}[1]{\lvert #1\rangle} \newcommand{\bra}[1]{\langle #1\rvert} \newcommand{\proj}[1]{\lvert #1\rangle\!\langle #1\rvert} \newcommand{\id}{\operatorname{id}} \newcommand{\dist}{\operatorname{dist}} \newcommand{\rank}{\operatorname{rank}} \newcommand{\E}{\mathbb{E}} \newcommand{\F}{\mathbb{F}} \newcommand{\Z}{\mathbb{Z}} \newcommand{\one}{I} \newcommand{\cN}{\mathcal{N}} \newcommand{\cD}{\mathcal{D}} \newcommand{\cR}{\mathcal{R}} \newcommand{\cS}{\mathcal{S}} \newcommand{\cH}{\mathcal{H}} % registers \newcommand{\sQ}{\mathsf{Q}} \newcommand{\sS}{\mathsf{S}} \newcommand{\sC}{\mathsf{C}} \newcommand{\sR}{\mathsf{R}} \newcommand{\sM}{\mathsf{M}} \newcommand{\sE}{\mathsf{E}} \newcommand{\sB}{\mathsf{B}} \newcommand{\sF}{\mathsf{F}} % protocols \newcommand{\Pibase}{\Pi_0} \newcommand{\Pirep}{\widetilde{\Pi}} \newcommand{\Picomp}{\Pi_{\mathrm{comp}}} \newcommand{\Piex}{\Pi_{\mathrm{ex}}} \newcommand{\bLam}{\boldsymbol{\Lambda}} % run-in step header inside proofs \newcommand{\step}[1]{\par\medskip\noindent\textbf{#1}\enspace} \title{Perfect $f$-routing with polynomial entanglement and communication} \author{} \date{December 2026} \begin{document} \maketitle \begin{center} \fbox{\parbox{0.9\textwidth}{\small \textbf{Note.} This text was generated by an AI system. The results were obtained in research sessions with AI systems directed by the submitter, and an AI system checked the proofs by independent re-derivation.}} \end{center} \begin{abstract} In $f$-routing, Alice holds $x\in\{0,1\}^n$ and an unknown qubit, Bob holds $y\in\{0,1\}^n$, and after one round of simultaneous communication the qubit must be with Alice if $f(x,y)=0$ and with Bob if $f(x,y)=1$. The perfect protocols known for every function $f$ use a shared state of $2^{O(\sqrt{n\log n})}$ qubits or a message of $2^{n+1}+1$ qubits. A concurrent preprint, hexagon:2612.00223, gives a protocol of polynomial cost for every error $\varepsilon>0$ and leaves the case $\varepsilon=0$ open. We show that every $f$ has a perfect protocol with $O(d^3n^2\log(d+2))\le O(n^5\log n)$ EPR pairs and the same order of classical communication, where $d\le n$ is the smaller of the two one-sided $\F_2$-degrees of $f$. The qubit is recovered with probability one on every input, together with its entanglement with any reference. The proof starts from a code with error below $2^{-n}$, built from signed cycles on random lines, and removes the error in two steps. A repair lemma makes a one-bit disclosure protocol exactly private by mixing in a correction state that Alice prepares for a guess of Bob's input. The guess is right with probability $2^{-n}$, which suffices because the error is smaller still. Complementing the local operations then turns exact privacy into exact correctness. The same construction gives perfect conditional disclosure of secrets with quantum resources at the same cost. \end{abstract} \section{Introduction} Quantum position verification asks a prover to demonstrate its location by answering timed challenges. In a routing scheme~\cite{KMS11,BFSS13}, two verifiers send the prover two $n$-bit strings $x$ and $y$ and an unknown qubit, and the prover must return the qubit to the verifier selected by a Boolean function $f(x,y)$. Two colluding attackers, one on each side of the claimed position, face the following task, called \emph{$f$-routing}~\cite{BFSS13,ABMSV24}. Alice receives $x$ and the qubit, Bob receives $y$, and they share an entangled state prepared in advance. They exchange one round of simultaneous messages, after which Alice must hold the qubit if $f(x,y)=0$ and Bob must hold it if $f(x,y)=1$. Attackers who share enough entanglement break every scheme of this kind~\cite{BCFGGOS14,BK11}. The security of a routing scheme therefore rests on how many resources $f$-routing needs~\cite{BFSS13}. The upper bounds for general $f$ have come down in several steps. The garden-hose strategy of Buhrman, Fehr, Schaffner and Speelman routes every function with exponentially many EPR pairs~\cite{BFSS13}. Allerstorfer, Buhrman, May, Speelman and Verduyn Lunel showed that $f$-routing is equivalent, up to small changes in the resources, to conditional disclosure of quantum secrets (CDQS)~\cite{ABMSV24}. Combined with the classical protocol of Liu, Vaikuntanathan and Wee~\cite{LVW17}, this equivalence gives a perfectly correct protocol for every $f$ whose shared state and messages have $2^{O(\sqrt{n\log n})}$ qubits each~\cite[Corollary~68]{ABMSV24}. In November 2026, Bogner showed that $2n+2$ EPR pairs suffice to route the qubit perfectly for every $f$, at the price of a quantum message of $2^{n+1}+1$ qubits from Alice~\cite{Bog26b}. In December 2026, the preprint~\cite{Hex26} gave a protocol in which both the shared state and the messages are polynomial: it routes with error $\varepsilon>0$ using $O(\log(1/\varepsilon)\,n^4\log n)$ qubits. Lower bounds are far below these upper bounds. For explicit functions they are linear in $n$ when recovery is perfect in one of the two cases~\cite{ACM25,HM26}, and logarithmic when both cases may have error~\cite{AKLMPW25,Bog26a}. None of these protocols is at once perfect and polynomial. The protocol of~\cite{ABMSV24} is perfect, but its cost is $2^{O(\sqrt{n\log n})}$. The protocol of~\cite{Hex26} is polynomial, but its error is not zero. It lowers the error by encoding the secret in a quantum error-correcting code, and the preprint records the limit of this method: ``Amplification gives errors $2^{-\Omega(k)}$ but never zero.'' Bogner's strategy is perfect, but its message is exponentially long, and the paper asks whether the messages can be shorter~\cite{Bog26b}. Why should we care about an error that is exactly zero? First, the linear lower bounds are proved for protocols that are perfect in at least one case~\cite{ACM25,HM26}. Bogner's theorem caps at $2n+2$ every lower bound that counts only the shared state, but it does not limit bounds that also count the messages~\cite{Bog26b}. For those bounds the best cap for perfect protocols was $2^{O(\sqrt{n\log n})}$~\cite{ABMSV24}, and a perfect protocol with polynomial entanglement and communication would lower it to a polynomial. Second, a perfect attack returns exactly what the honest prover would return, so no number of repetitions of a routing scheme detects it. Third, by the equivalence of~\cite{ABMSV24}, perfect routing corresponds to perfect conditional disclosure of secrets (CDS) with quantum resources. For classical CDS the best protocols known for general $f$ cost $2^{O(\sqrt{n\log n})}$~\cite{LVW17}, and perfect classical CDS needs $\Omega(n)$ communication for explicit functions such as inner product~\cite{AHMS20}. These facts lead to the question of this paper. \begin{center} \textit{Does every Boolean function $f$ admit a perfect $f$-routing protocol whose entanglement and communication are both polynomial in $n$?} \end{center} \paragraph{Results.} We answer this question in the affirmative. The cost of our protocol is governed by an algebraic degree of $f$. For a Boolean function $h$ on $\{0,1\}^n$, let $\deg_{\F_2}h$ be the degree of the unique multilinear polynomial over $\F_2$ that represents $h$. The \emph{degree parameter} of $f:\{0,1\}^n\times\{0,1\}^n\to\{0,1\}$ is \begin{equation}\label{eq:degree} d \;:=\; \max\Bigl\{1,\;\min\Bigl(\max_{x\in\{0,1\}^n}\deg_{\F_2}f(x,\cdot),\;\max_{y\in\{0,1\}^n}\deg_{\F_2}f(\cdot,y)\Bigr)\Bigr\}\;\le\; n . \end{equation} \begin{theorem}[Perfect routing with polynomial resources]\label{thm:main} Fix $n\ge1$ and $f:\{0,1\}^n\times\{0,1\}^n\to\{0,1\}$ with degree parameter $d$. There is a perfect $f$-routing protocol (Definition~\ref{def:routing}) in which Alice and Bob share \[ O\bigl(d^3n^2\log(d+2)\bigr)\;\le\;O\bigl(n^5\log(n+2)\bigr) \] EPR pairs and exchange the same order of classical bits in one simultaneous round. On every input pair $(x,y)$ the protocol implements the identity channel on the qubit, at Alice if $f(x,y)=0$ and at Bob if $f(x,y)=1$. In particular, the qubit is recovered with probability one, and its joint state with any reference system is preserved. \end{theorem} Theorem~\ref{thm:main} holds in the information-theoretic model of~\cite{ABMSV24,Bog26b}. The local operations are arbitrary quantum operations that depend on the truth table of $f$, and we do not bound their circuit size. One of the ingredients, a binary matrix, is obtained by a probabilistic argument. We do not optimize the constants hidden in $O(\cdot)$. Each factor in the bound comes from one layer of the construction. The protocol makes $O(d^3n)$ \emph{queries}, each of which hides one bit in a state on a cycle of length $L=\Theta(d)$. The factor $d^3$ arises because a single query separates the two values of $f$ only at order $L^{-3}$. The preprint~\cite{Hex26} proves that $\Omega(L^3)$ uses are necessary for its closely related gadget. The factor $n\log(d+2)$ is the cost of one query, which consumes a uniformly random point of $\F_{2L}^n$. The last factor $n$ is the price of perfection: the first layer must have error below $2^{-n}$, and its cost grows with the logarithm of the inverse error. For functions of bounded degree the bound is $O(n^2)$, and in the worst case $d=n$ it is $O(n^5\log n)$. In particular, a lower bound for perfect $f$-routing that counts the shared state and the messages cannot exceed $O(n^5\log n)$. A small degree does not make a function easy for other reasons: inner product modulo two has $d=1$, so Theorem~\ref{thm:main} gives $O(n^2)$ for it, while linear upper bounds for this function were known before~\cite{BFSS13,ACM25}. The theorem is of interest for functions without such structure. Our second result states the same fact in the language of~\cite{Hex26}. In a CDQS protocol, Alice holds $x$ and a quantum secret, Bob holds $y$, and each sends one message to a referee who knows $x$ and $y$. The protocol is perfect if the referee recovers the secret exactly when $f(x,y)=1$, and receives a state that does not depend on the secret when $f(x,y)=0$ (Definition~\ref{def:cdqs}). The best perfect CDQS protocol known for general $f$ uses $2^{O(\sqrt{n\log n})}$ bits of shared randomness and of communication, and one qubit~\cite[Corollary~67]{ABMSV24}. \begin{corollary}[Perfect CDS and CDQS with quantum resources]\label{cor:cdqs} For every $n\ge1$ and every $f:\{0,1\}^n\times\{0,1\}^n\to\{0,1\}$ with degree parameter $d$, there is a perfect CDQS protocol for $f$ with a one-qubit secret, and a perfect CDS protocol for $f$ with a one-bit secret. Each uses $O(d^3n^2\log(d+2))$ EPR pairs and messages of $O(d^3n^2\log(d+2))$ qubits. A secret of several qubits is handled qubit by qubit, at proportional cost. \end{corollary} \begin{table}[t] \centering \begin{tabular}{@{}llll@{}} \toprule Protocol & Shared state & Messages & Error \\ \midrule \cite[Cor.~68]{ABMSV24} & $2^{O(\sqrt{n\log n})}$ qubits & $2^{O(\sqrt{n\log n})}$ qubits & $0$ \\ \cite[Thm.~1]{Bog26b} & $2n+2$ EPR pairs & $2^{n+1}+1$ qubits, $6n+4$ bits & $0$ \\ \cite[Cor.~2]{Hex26} & $O(\log(1/\varepsilon)\,n^4\log n)$ qubits & $O(\log(1/\varepsilon)\,n^4\log n)$ qubits & $\varepsilon\in(0,\tfrac12]$ \\ \midrule Theorem~\ref{thm:main} & $O(d^3n^2\log(d+2))$ EPR pairs & $O(d^3n^2\log(d+2))$ bits & $0$ \\ \bottomrule \end{tabular} \caption{Cost of $f$-routing of one qubit for an arbitrary $f$ on $n+n$ input bits. The messages are those of Alice and Bob together, and $d\le n$ is the degree parameter~\eqref{eq:degree}. Each row uses the units of its source. The shared state is counted in qubits of an unspecified resource state in~\cite{ABMSV24,Hex26}, and in EPR pairs in~\cite{Bog26b} and in this paper. The messages are quantum in the first three rows, where~\cite{Hex26} counts a classical bit as a qubit, and classical in the last row. Teleportation replaces a message of $q$ qubits by $2q$ classical bits and $q$ additional EPR pairs. This replacement keeps the order of the cost in the first and third rows, and in the second row it would make the shared state exponential. All rows allow arbitrary local operations.} \label{tab:comparison} \end{table} Table~\ref{tab:comparison} compares the protocols. For a concrete instance, take $n=100$ and $d=n$. Bogner's message then has $2^{101}+1\approx2.5\times10^{30}$ qubits. The first layer of our protocol makes about $2.0\times10^{10}$ queries and uses $K\approx1.6\times10^{13}$ EPR pairs, and Theorem~\ref{thm:main} uses a constant multiple of $K$. In the other direction, Bogner's strategy needs $202$ EPR pairs, far fewer than ours. \paragraph{Proof idea: exact privacy from a guessed input.} A protocol with a small error can be amplified, but amplification multiplies the error by a factor and never reaches zero. We use a different mechanism, which we first describe in the simplest case. Suppose that a referee, who knows $x$ and $y$, receives one classical bit whose distribution depends on a secret bit $z$: \[ \rho_z \;=\; \bigl(\tfrac12+(-1)^z\tfrac\delta2\bigr)\proj{0}+\bigl(\tfrac12-(-1)^z\tfrac\delta2\bigr)\proj{1} . \] The two distributions are at distance $\delta$, and we want them to coincide. Suppose that with probability $\lambda$ the referee receives instead the fixed bit $\sigma_z=\proj{1-z}$, and that the referee cannot tell which of the two happened. The referee's state is then $(1-\lambda)\rho_z+\lambda\sigma_z$, and a one-line calculation shows that it equals $\one/2$ for both values of $z$ when $\lambda=\delta/(1+\delta)$. That is, a leak of size $\delta$ is repaired exactly by a correction of weight about $\delta$. In a real protocol the correction $\sigma_z$ depends on the leak, hence on $x$ and $y$, and neither Alice nor Bob knows both. We let Alice prepare the correction for a \emph{guess} $y_*$ of Bob's input, drawn from shared randomness. Bob knows whether the guess is right, and it is right with probability exactly $1/N$, where $N=2^n$. This probability plays the role of the weight $\lambda$, so the repair works when $\delta\le1/(N-1)$. Such an exponentially small error is affordable, because the error of our first layer decays exponentially in its cost. For general quantum messages the correction is built from the Jordan decomposition of $\rho_1-\rho_0$. To keep the referee from learning whether the guess was right, Bob selects between the original message and the correction after both have been masked by random Pauli operators. Lemma~\ref{lem:repair} states the result. \paragraph{Proof idea: exact correctness from exact privacy.} The repair makes privacy exact, but it cannot make a decoder exact. For correctness we use a duality. If the messages of a protocol carry no information at all about a quantum secret, then the systems that Alice and Bob keep allow its exact recovery. We therefore make the protocol exactly private for the negated predicate $1-f$, and then let Alice and Bob send the systems they would have kept. The new protocol is exactly correct for $f$. Its privacy is as good as the correctness of the old protocol, and we arrange that the old decoder is \emph{unambiguous}: it never outputs a wrong bit, and declares an erasure with small probability. The new privacy error is then at most the erasure probability, without the square-root loss of general continuity bounds, and a second repair removes it. Table~\ref{tab:pipeline} lists the four protocols of this pipeline. The last one is turned into a routing protocol by the coherent teleportation key of~\cite{ABMSV24,Bog26b}. \begin{table}[t] \centering \begin{tabular}{@{}llll@{}} \toprule Protocol & Obtained by & Cells with $f(x,y)=0$ & Cells with $f(x,y)=1$ \\ \midrule $\Pibase$ & Lemma~\ref{lem:base} & unambiguous, erasure $\le\theta$ & $\theta$-private \\ $\Pirep$ & Lemma~\ref{lem:repair} & unambiguous, erasure $\le\theta$ & exactly private \\ $\Picomp$ & Lemma~\ref{lem:complement} & $2\theta$-private & exactly correct \\ $\Piex$ & Lemma~\ref{lem:repair} & exactly private & exactly correct \\ \bottomrule \end{tabular} \caption{The four one-bit disclosure protocols in the proof of Theorem~\ref{thm:main}, with $\theta=1/(4N)$ and $N=2^n$. A cell is an input pair $(x,y)$, and the terms are those of Definition~\ref{def:bit}. The first two protocols disclose the bit where $f=0$, and the last two disclose it where $f=1$. Each step multiplies the cost by a constant and adds $O(n)$.} \label{tab:pipeline} \end{table} \paragraph{Related work.} The lookup on a random line in Section~\ref{sec:base} is the instance-hiding idea of Beaver and Feigenbaum~\cite{BF90}. The values of a low-degree polynomial at the points of a random line through $y$ determine its value at $y$, while each point alone is uniformly distributed. The preprint~\cite{Hex26} combines this idea with signed cycles, and our base code uses the same combination. The final note of this paper compares the two. To lower its error, \cite{Hex26} applies the amplification theorem of Asadi et al.~\cite{AKLMPW25}, which encodes a quantum secret in an error-correcting code. Our outer code is classical and acts on the outcomes of the cycle measurements, and Lemma~\ref{lem:repair} removes the remaining error instead of amplifying it. The last step, routing with a key that stays in superposition, follows~\cite{ABMSV24,Bog26b}. \paragraph{Organization of the paper.} Section~\ref{sec:setting} defines routing, one-bit disclosure and CDQS. Section~\ref{sec:base} constructs the base code $\Pibase$ from signed cycles on random lines. Section~\ref{sec:repair} proves the repair lemma. Section~\ref{sec:dual} proves the duality lemma and assembles the perfect one-bit protocol $\Piex$. Section~\ref{sec:routing} proves Theorem~\ref{thm:main} and Corollary~\ref{cor:cdqs}. Section~\ref{sec:discussion} discusses where the cost sits and lists open problems. A final note describes the relation to~\cite{Hex26}. \section{Setting}\label{sec:setting} Throughout, $N=2^n$, $\log$ is the logarithm to base two and $\ln$ is the natural logarithm. The trace distance is $\dist(\rho,\sigma)=\frac12\lVert\rho-\sigma\rVert_1$. We call an input pair $(x,y)\in\{0,1\}^n\times\{0,1\}^n$ a \emph{cell}. A classical bit in a message is counted as a qubit in a computational-basis state. Shared uniform randomness is obtained by measuring EPR pairs, one pair per bit. \begin{definition}[Perfect $f$-routing]\label{def:routing} Alice and Bob share EPR pairs. Alice receives $x\in\{0,1\}^n$ and a qubit $\sQ$, and Bob receives $y\in\{0,1\}^n$. Alice applies a quantum operation that depends on $x$ to $\sQ$ and her halves of the pairs, and Bob applies one that depends on $y$ to his halves. Each party then sends one classical message to the other, and the two messages are sent simultaneously. Finally each party applies a quantum operation to the systems it holds, which may depend on both messages. The protocol is a \emph{perfect $f$-routing protocol} if, for every cell $(x,y)$, the channel from $\sQ$ to a designated qubit of Alice (if $f(x,y)=0$) or of Bob (if $f(x,y)=1$) is the identity channel $\id_\sQ$. Its cost is the number of EPR pairs and the total number of classical bits. \end{definition} The identity channel preserves the joint state of $\sQ$ with every reference system $\sR$, so Definition~\ref{def:routing} includes the requirement of~\cite{Bog26b} for entangled inputs. \begin{definition}[One-bit disclosure]\label{def:bit} In a \emph{bit disclosure protocol}, Alice holds $x$ and a secret bit $z$, Bob holds $y$, and they share EPR pairs. Each applies a local quantum operation and sends one message to a referee who knows $x$ and $y$. The referee has no access to the systems that Alice and Bob keep. Let $\rho_{xy,z}$ be the joint state of the two messages, on $m=m_A+m_B$ qubits. On a cell $(x,y)$, the protocol is \begin{itemize}[nosep] \item \emph{$\theta$-private} if $\dist(\rho_{xy,0},\rho_{xy,1})\le\theta$, and \emph{exactly private} if $\rho_{xy,0}=\rho_{xy,1}$; \item \emph{exactly correct} if $\rho_{xy,0}$ and $\rho_{xy,1}$ have orthogonal supports; \item \emph{unambiguous with erasure $\theta$} if the referee has a measurement with outcomes $0$, $1$ and $\perp$ that, for both values of $z$, never outputs $1-z$ and outputs $\perp$ with probability at most $\theta$. \end{itemize} The protocol is \emph{perfect for $f$} if it is exactly private on every cell with $f(x,y)=0$ and exactly correct on every cell with $f(x,y)=1$. \end{definition} A bit disclosure protocol that is perfect for $f$ is a perfect CDS protocol for $f$ with a one-bit secret and quantum resources. On a cell with $f=1$ the referee reads $z$ by measuring the two orthogonal supports, and on a cell with $f=0$ the referee's state is the same for both secrets. \begin{definition}[Perfect CDQS]\label{def:cdqs} In a CDQS protocol, Alice holds $x$ and a quantum system $\sQ$, Bob holds $y$, they share EPR pairs, and each sends one message to a referee who knows $x$ and $y$. Let $\cN_{xy}$ be the channel from $\sQ$ to the two messages. The protocol is \emph{perfect for $f$} if for every cell with $f(x,y)=1$ there is a channel $\cD_{xy}$ with $\cD_{xy}\circ\cN_{xy}=\id_\sQ$, and for every cell with $f(x,y)=0$ there is a state $\sigma_{xy}$ with $\cN_{xy}(\omega)=\tr(\omega)\,\sigma_{xy}$ for all $\omega$. \end{definition} Definition~\ref{def:cdqs} is the case of zero correctness error and zero privacy error of the definition of CDQS in~\cite{ABMSV24,AKLMPW25}. The $m$-qubit Pauli operators are $P_u=\bigotimes_{\ell=1}^mX^{u_{\ell,1}}Z^{u_{\ell,2}}$ for $u\in(\{0,1\}^2)^m$. They satisfy $P_uP_{u'}=\pm P_{u\oplus u'}$, and the sign cancels whenever a Pauli operator acts by conjugation. \section{The base code: signed cycles on random lines}\label{sec:base} This section constructs the first protocol of Table~\ref{tab:pipeline}. It has a small error of both kinds, and its decoder is unambiguous. \begin{lemma}[Base code]\label{lem:base} Fix $n\ge1$, a predicate $g:\{0,1\}^n\times\{0,1\}^n\to\{0,1\}$ with degree parameter $d$, and $\theta\in(0,\frac14]$. There is a bit disclosure protocol for $g$ that uses $O(d^3n\log(d+2)\log(4/\theta))$ EPR pairs and message qubits and has the following two properties. \begin{enumerate}[nosep,label=(\alph*)] \item On every cell with $g(x,y)=1$ it is unambiguous with erasure $\theta$. \item On every cell with $g(x,y)=0$ it is $\theta$-private. \end{enumerate} For $\theta=1/(4N)$ the cost is $K=O(d^3n^2\log(d+2))$. \end{lemma} The idea is as follows. A low-degree polynomial that represents the row $g(x,\cdot)$ is evaluated at $L$ points of a random line through $y$, and Lagrange interpolation writes $g(x,y)$ as the parity of $L$ bits, each of which Alice can compute from a uniformly random point. These bits become the signs of the edges of an $L$-cycle. The referee sees one edge state, without learning which edge, and what this state reveals depends only on whether the cycle is balanced, that is, on $g(x,y)$. On a balanced cycle one measurement outcome has probability zero unless Alice inserts a ``pulse''. On an unbalanced cycle a pulse changes the outcome statistics only slightly. An outer code then spreads the secret over many rare pulses. \begin{proof} By~\eqref{eq:degree}, at least one of $\max_x\deg_{\F_2}g(x,\cdot)\le d$ and $\max_y\deg_{\F_2}g(\cdot,y)\le d$ holds. We may assume the first. In the other case Alice and Bob share one more uniform bit $u'$, Alice sends $z\oplus u'$ to the referee, and they run the protocol with exchanged roles and with secret $u'$, which Bob knows. The exchange adds one EPR pair and one message bit. It preserves property~(a) because the referee computes $z$ from $u'$, and property~(b) because the two states of the referee for $z=0,1$ are at the same distance as the two states for $u'=0,1$. \step{Step 1: a lookup on a random line.} Let $L$ be the least power of two with $L\ge\max\{4,d+1\}$, so that $L\le\max\{4,2d\}$. Let $\F=\F_{2L}$ be the field with $2L$ elements, which contains $\F_2$, and write $\Z_L=\Z/L\Z$. Fix $L$ distinct nonzero elements $\tau_i\in\F$, indexed by $i\in\Z_L$. For each $x$, let $F_x$ be the multilinear polynomial over $\F_2$ that agrees with $1\oplus g(x,\cdot)$ on $\{0,1\}^n$, regarded as a polynomial over $\F$. Its total degree is at most $d\le L-1$. For $y\in\{0,1\}^n$ and a \emph{slope} $r\in\F^n$, the univariate polynomial $\tau\mapsto F_x(y+\tau r)$ has degree at most $L-1$. Lagrange interpolation at $\tau=0$ from the $L$ nodes $\tau_i$ therefore gives coefficients $\lambda_i\in\F$, which depend only on the nodes, such that $\sum_i\lambda_iF_x(y+\tau_ir)=F_x(y)=1\oplus g(x,y)$. Fix an $\F_2$-linear functional $\phi:\F\to\F_2$ with $\phi(1)=1$ and set $a_i(x,s)=\phi(\lambda_iF_x(s))$ for $s\in\F^n$. Applying $\phi$ to the interpolation identity gives \begin{equation}\label{eq:parity} \bigoplus_{i\in\Z_L}a_i(x,y+\tau_ir)\;=\;1\oplus g(x,y)\;=:\;p . \end{equation} We call $p$ the \emph{parity} of the cell $(x,y)$. \step{Step 2: one query is a classical channel.} A \emph{query} carries one input bit $u\in\{0,1\}$ chosen by Alice. Alice and Bob share a uniformly random label $(i,s)\in\Z_L\times\F^n$, which costs $\log L+n\log(2L)$ EPR pairs. Alice sends the state \[ \frac{1}{\sqrt2}\Bigl(\ket{i}+(-1)^{u+a_i(x,s)}\ket{i+1}\Bigr) \] of $\log L$ qubits, with indices modulo $L$, and Bob sends the slope $r=(s-y)/\tau_i\in\F^n$. For fixed $y$ and each $i$, the map $s\mapsto r$ is a bijection. Hence $r$ is uniform on $\F^n$ and independent of $(i,u)$, and conditional on $r$ the index $i$ is uniform on $\Z_L$ with $s=y+\tau_ir$. Let $S$ be the signed shift $S\ket{i}=(-1)^{a_i(x,y+\tau_ir)}\ket{i+1}$. Averaging Alice's state over $i$ shows that, conditional on $r$, the referee holds \[ \frac1L\Bigl(\one+(-1)^u\,\frac{S+S^\dagger}{2}\Bigr). \] By~\eqref{eq:parity}, $S^L=(-1)^p\one$. A diagonal change of signs turns $S$ into the cyclic shift whose last edge carries the sign $(-1)^p$, so the eigenvalues of $S$ are $e^{\mathrm{i}\pi(2j+p)/L}$ for $j=0,\dots,L-1$, each with multiplicity one. The referee knows $(x,y,r)$ and hence the eigenbasis of $S$, which does not depend on $u$. In this basis the referee's state is diagonal for both values of $u$, with diagonal entries \begin{equation}\label{eq:channel} W_p(j\mid u)\;=\;\frac{1+(-1)^u\cos\bigl((2j+p)\pi/L\bigr)}{L},\qquad j\in\{0,1,\dots,L-1\}. \end{equation} One query is therefore equivalent to one use of the classical channel $W_p$ from $u$ to $j$, together with a uniform slope that is independent of $u$. The channel depends on the cell only through its parity $p$. \step{Step 3: the two-rail code.} Set \[ \beta=\frac{1}{8L^2},\qquad t=\lceil\ln(4/\theta)\rceil,\qquad T=64L^3t . \] Let $G\in\F_2^{5t\times T}$ be a binary matrix with rows $G_\mu$, $\mu\in[5t]$, to be fixed in Step~6. To encode $z$, Alice draws uniform bits $v_2,\dots,v_{5t}$ and forms the codeword $c=zG_1\oplus\bigoplus_{\mu=2}^{5t}v_\mu G_\mu\in\F_2^T$. She sends each coordinate $c_\ell$, for $\ell\in[T]$, through two queries, called \emph{rails} $0$ and $1$. On the \emph{active} rail $c_\ell$ the input is a fresh bit that equals one with probability $\beta$, and on the other rail the input is $0$. The $2T$ queries use independent labels and run in parallel. \step{Step 4: unambiguous decoding when $g(x,y)=1$.} Here $p=0$. Since $L$ is even, \eqref{eq:channel} gives $W_0(L/2\mid0)=0$ and $W_0(L/2\mid1)=2/L$. We say that a rail \emph{clicks} if its outcome is $j=L/2$. A rail with input $0$ never clicks, so a click in coordinate $\ell$ certifies that the clicking rail is the active one, and thereby reveals $c_\ell$. The active rail of each coordinate clicks with probability $\zeta=2\beta/L=1/(4L^3)$, independently over the coordinates and whatever the codeword is. Let $U\subseteq[T]$ be the set of coordinates with a click. Its size has mean $\zeta T=16t$, and the multiplicative Chernoff bound gives $\Pr[\lvert U\rvert<8t]\le e^{-2t}\le(\theta/4)^2<\theta/4$. The referee outputs $z$ if the submatrix $G|_U$ of the columns in $U$ has rank $5t$, in which case $c|_U$ determines $z$ and $v$, and outputs $\perp$ otherwise. The referee never outputs a wrong bit. For a uniformly random $G$ and a fixed $U$ with $\lvert U\rvert\ge8t$, \[ \Pr_G\bigl[\rank(G|_U)<5t\bigr]\;\le\;\sum_{\mu=0}^{5t-1}2^{\,\mu-\lvert U\rvert}\;<\;2^{5t-8t}\;=\;2^{-3t}\;<\;e^{-2t}\;<\;\frac\theta4 . \] Let $\varepsilon_{\mathrm{erase}}(G)$ be the probability that the referee outputs $\perp$. It is the same for both secrets and for all cells of parity $0$, because the law of $U$ is. The two bounds give $\E_G[\varepsilon_{\mathrm{erase}}(G)]<\theta/2$. \step{Step 5: hiding when $g(x,y)=0$.} Here $p=1$. Write $w_u=W_1(\cdot\mid u)$ for $u\in\{0,1\}$ and $w_\beta=(1-\beta)w_0+\beta w_1$ for the output law of an active rail, and put $\alpha_j=(2j+1)\pi/L$. Both $w_0$ and $w_1$ have full support, and \begin{equation}\label{eq:chi} \chi^2(w_1\Vert w_0)\;:=\;\sum_{j}\frac{(w_1(j)-w_0(j))^2}{w_0(j)} \;=\;\frac4L\sum_{j=0}^{L-1}\Bigl(\cos\alpha_j-1+\frac{1}{1+\cos\alpha_j}\Bigr)\;=\;2L-4 . \end{equation} For the last equality, $\sum_j\cos\alpha_j=0$ and $\sum_j(1+\cos\alpha_j)^{-1}=\frac12\sum_j\sec^2(\alpha_j/2)=L^2/2$. The second sum follows from the identity $\sum_{j=0}^{L-1}\csc^2(\vartheta+j\pi/L)=L^2\csc^2(L\vartheta)$ at $\vartheta=\pi/(2L)$, after shifting the index by $L/2$. The identity is obtained by differentiating twice the logarithm of $\sin(L\vartheta)=2^{L-1}\prod_{j=0}^{L-1}\sin(\vartheta+j\pi/L)$. Consider one coordinate, with outcome $o_\ell=(j_{\ell,0},j_{\ell,1})$ on its two rails. Its law is $\Lambda_0=w_\beta\otimes w_0$ if $c_\ell=0$ and $\Lambda_1=w_0\otimes w_\beta$ if $c_\ell=1$. Set $\bar\Lambda=\frac12(\Lambda_0+\Lambda_1)$ and $\eta=(\Lambda_0-\Lambda_1)/(\Lambda_0+\Lambda_1)$, so that the law of coordinate $\ell$ is $\bar\Lambda\,(1+(-1)^{c_\ell}\eta)$, and $\E_{\bar\Lambda}[\eta]=0$. Let $h=(w_1-w_0)/w_0$, which satisfies $\E_{w_0}[h]=0$ and $\E_{w_0}[h^2]=2L-4$ by~\eqref{eq:chi}. Then $\Lambda_0-\Lambda_1=\beta\,(w_0\otimes w_0)\,(h(j_0)-h(j_1))$ and $\Lambda_0+\Lambda_1\ge2(1-\beta)\,w_0\otimes w_0$, hence \begin{equation}\label{eq:gamma} \gamma\;:=\;\E_{\bar\Lambda}[\eta^2]\;\le\;\frac{\beta^2}{4(1-\beta)}\,\E_{w_0\otimes w_0}\bigl[(h(j_0)-h(j_1))^2\bigr]\;=\;\frac{\beta^2(L-2)}{1-\beta}\;<\;\beta^2L\;=\;\frac{1}{64L^3}, \end{equation} where the strict inequality uses $\beta L<2$. Let $\bLam_z$ be the joint law of the outcomes $o=(o_1,\dots,o_T)$ for secret $z$. For $\xi\in\F_2^T$ put $\eta_\xi(o)=\prod_{\ell:\xi_\ell=1}\eta(o_\ell)$. These functions are orthogonal in $L^2(\bar\Lambda^{\otimes T})$, with squared norms $\gamma^{\lvert\xi\rvert}$, where $\lvert\xi\rvert$ is the Hamming weight. Expanding the product over the coordinates gives \[ \bLam_z(o)\;=\;\bar\Lambda^{\otimes T}(o)\sum_{\xi\in\F_2^T}\Bigl(\E_v(-1)^{\langle\xi,c\rangle}\Bigr)\eta_\xi(o), \qquad \E_v(-1)^{\langle\xi,c\rangle}=(-1)^{z\langle\xi,G_1\rangle}\prod_{\mu=2}^{5t}\mathbf{1}\bigl[\langle\xi,G_\mu\rangle=0\bigr]. \] In $\bLam_0-\bLam_1$ a word $\xi$ therefore survives, with coefficient $2$, exactly when it lies in \[ \cS(G)\;:=\;\bigl\{\xi\in\F_2^T:\ \langle\xi,G_1\rangle=1\text{ and }\langle\xi,G_\mu\rangle=0\text{ for }2\le\mu\le5t\bigr\}. \] By the Cauchy--Schwarz inequality and orthogonality, \[ \dist(\bLam_0,\bLam_1)^2\;=\;\Bigl(\E_{\bar\Lambda^{\otimes T}}\Bigl\lvert\sum_{\xi\in\cS(G)}\eta_\xi\Bigr\rvert\Bigr)^2\;\le\;\sum_{\xi\in\cS(G)}\gamma^{\lvert\xi\rvert}. \] For a uniformly random $G$, each nonzero $\xi$ lies in $\cS(G)$ with probability $2^{-5t}$, and $0\notin\cS(G)$. Since $\gamma T2$, \[ \E_G\bigl[\dist(\bLam_0,\bLam_1)^2\bigr]\;\le\;2^{-5t}\bigl((1+\gamma)^T-1\bigr)\;<\;2^{-5t}e^{t}\;=\;\Bigl(\frac{e}{32}\Bigr)^{t}\;<\;e^{-2t}\;\le\;\frac{\theta^2}{16}. \] By Step~2, on a cell of parity $1$ a unitary that depends on $(x,y)$ and on the slopes, but not on $z$, maps the referee's state to the classical state formed by the uniform slopes and an outcome string with law $\bLam_z$. Hence $\dist(\rho_{xy,0},\rho_{xy,1})=\dist(\bLam_0,\bLam_1)$ on every such cell. \step{Step 6: fixing $G$ and counting.} By Markov's inequality, $\Pr_G[\varepsilon_{\mathrm{erase}}(G)\ge\theta]<\frac12$ and $\Pr_G[\dist(\bLam_0,\bLam_1)^2\ge\theta^2]<\frac1{16}$. Some matrix $G$ therefore satisfies $\varepsilon_{\mathrm{erase}}(G)<\theta$ and $\dist(\bLam_0,\bLam_1)<\theta$. Both quantities depend on the cell only through its parity, so this single $G$ gives properties~(a) and~(b) on all cells. The protocol makes $2T=128L^3t$ queries. Each uses $\log L+n\log(2L)$ EPR pairs, $\log L$ qubits from Alice and $n\log(2L)$ bits from Bob. Since $L=O(d)$ and $t=O(\log(4/\theta))$, the total is $O(d^3n\log(d+2)\log(4/\theta))$. \end{proof} \section{Exact privacy repair}\label{sec:repair} The next lemma turns a small privacy error into none, and leaves the referee's states on all other cells unchanged. \begin{lemma}[Exact privacy repair]\label{lem:repair} Let $\Pi$ be a bit disclosure protocol with messages of $m=m_A+m_B$ qubits and referee states $\rho_{xy,z}$. Let $\cH$ be a set of cells on which $\Pi$ is $\frac{1}{N-1}$-private. There is a bit disclosure protocol $\Pi'$ that uses at most $6m+n+1$ EPR pairs more than $\Pi$, has messages of $5m+1$ qubits, and satisfies: \begin{enumerate}[nosep,label=(\roman*)] \item $\Pi'$ is exactly private on every cell in $\cH$; \item on every cell outside $\cH$, a unitary that does not depend on $z$ maps the referee's state to $\rho_{xy,z}$ in tensor product with $4m+1$ uniform bits. \end{enumerate} \end{lemma} By~(ii), every measurement that the referee could make in $\Pi$ on a cell outside $\cH$ is available in $\Pi'$ with the same statistics. In particular, exact correctness and unambiguous decoding survive the repair. \begin{proof} We define replacement states, describe the protocol, and then compute the referee's view. \step{Replacement states.} We define a state $\sigma_{xy,z}$ on $m$ qubits for every cell. Outside $\cH$ set $\sigma_{xy,z}=\rho_{xy,z}$. For a cell in $\cH$ we drop the subscript $xy$ and take the Jordan decomposition $\rho_1-\rho_0=\Delta_+-\Delta_-$, with $\Delta_\pm\ge0$ and $\Delta_+\Delta_-=0$. Since $\tr(\rho_1-\rho_0)=0$, we have $\delta:=\tr\Delta_+=\tr\Delta_-=\dist(\rho_0,\rho_1)\le\frac{1}{N-1}$, and the operator \[ H\;:=\;\rho_0+\Delta_+\;=\;\rho_1+\Delta_- \] is the same for both secrets. Let $\nu=2^{-m}\one$ and set \[ \sigma_0\;=\;(N-1)\,\Delta_++\bigl(1-(N-1)\delta\bigr)\,\nu,\qquad \sigma_1\;=\;(N-1)\,\Delta_-+\bigl(1-(N-1)\delta\bigr)\,\nu . \] Both are positive semidefinite with trace one, and no commutativity of $\rho_0$ and $\rho_1$ is needed. For both values of $z$, \begin{equation}\label{eq:mixture} \frac{N-1}{N}\,\rho_z+\frac1N\,\sigma_z\;=\;\frac{N-1}{N}\,H+\frac{1-(N-1)\delta}{N}\,\nu , \end{equation} and the right-hand side does not depend on $z$. \step{Protocol.} The parties realize the mixture~\eqref{eq:mixture} without revealing which of its two terms occurred. They share uniform strings: a guess $y_*\in\{0,1\}^n$, two Pauli pads $\kappa_0,\kappa_1\in(\{0,1\}^2)^m$ and a swap bit $w\in\{0,1\}$, which take $n+4m+1$ EPR pairs. Bob computes the selector $b=\mathbf{1}[y=y_*]$. The parties prepare two registers of $m$ qubits at Bob, the \emph{banks} $\sB_0$ and $\sB_1$. \begin{itemize}[nosep] \item \emph{Bank $\sB_0$ holds the original message.} Alice and Bob run $\Pi$ on $(x,y,z)$ but do not send their messages. Alice teleports her message to Bob through $m_A$ fresh EPR pairs and obtains a Bell outcome, which we extend by zeros to $e_0\in(\{0,1\}^2)^m$. Together with Bob's own message, $\sB_0$ is in the state $P_{e_0}\rho_{xy,z}P_{e_0}^\dagger$ conditional on $e_0$. This statement holds also when the two messages of $\Pi$ are entangled. \item \emph{Bank $\sB_1$ holds the replacement.} Alice prepares $\sigma_{xy_*,z}$ and teleports it to Bob through $m$ fresh EPR pairs, with Bell outcome $e_1\in(\{0,1\}^2)^m$. Conditional on $e_1$, $\sB_1$ is in the state $P_{e_1}\sigma_{xy_*,z}P_{e_1}^\dagger$. \end{itemize} Alice knows $e_0$ and $e_1$ and sends the referee two strings $c_0,c_1$ of $2m$ bits each, defined by $c_{j\oplus w}=e_j\oplus\kappa_j$ for $j\in\{0,1\}$. Bob applies $P_{\kappa_b}$ to the bank $\sB_b$, sends this bank and the pointer $J=b\oplus w$ to the referee, and keeps the other bank. The referee applies $P_{c_J}^\dagger$ to the received bank. \step{The referee's view.} Write $\omega_0=\rho_{xy,z}$ and $\omega_1=\sigma_{xy_*,z}$. Since $c_J=e_b\oplus\kappa_b$, the operator $P_{c_J}^\dagger P_{\kappa_b}P_{e_b}$ is a multiple of the identity, so after this correction the referee holds $\omega_b$. The classical part of the referee's view is \[ (J,\;c_J,\;c_{1-J})\;=\;(b\oplus w,\;e_b\oplus\kappa_b,\;e_{1-b}\oplus\kappa_{1-b}). \] For fixed $(y_*,e_0,e_1)$, the triple $(w,\kappa_0,\kappa_1)$ is uniform, so this view is uniform on $\{0,1\}^{4m+1}$ and independent of $b$ and of the corrected bank. The guess satisfies $y_*=y$ with probability $1/N$. Averaging over $y_*$, the referee's state is therefore \[ \Bigl(\frac{N-1}{N}\,\rho_{xy,z}+\frac1N\,\sigma_{xy,z}\Bigr)\otimes\bigl(\text{$4m+1$ uniform bits}\bigr). \] On a cell in $\cH$ this state does not depend on $z$ by~\eqref{eq:mixture}, which proves~(i). Outside $\cH$ it equals $\rho_{xy,z}$ with the uniform bits, because $\sigma_{xy,z}=\rho_{xy,z}$ there, which proves~(ii). \step{Cost.} The message consists of $4m$ bits from Alice, and $m$ qubits and one bit from Bob. The additional EPR pairs number $n+4m+1$ for the shared strings and $m_A+m$ for the two teleportations, at most $6m+n+1$ in total. \end{proof} \section{From an unambiguous decoder to a perfect one-bit protocol}\label{sec:dual} Sending the local environments in place of the messages exchanges the privacy and the correctness of a disclosure protocol with a quantum secret. We follow Asadi et al.~\cite{AKLMPW25} in using this complementation. We need it in a form that keeps exactness on one side and loses no square root on the other. \begin{lemma}[Duality for flagged exact recovery]\label{lem:complement} Let $V:\sQ\to\sM\otimes\sE$ be an isometry, with channel $\cN(\omega)=\tr_\sE(V\omega V^\dagger)$ and complementary channel $\cN^c(\omega)=\tr_\sM(V\omega V^\dagger)$. \begin{enumerate}[nosep,label=(\arabic*)] \item If $\cN(\omega)=\tr(\omega)\,\sigma_\sM$ for a fixed state $\sigma_\sM$, there is a channel $\cR$ on $\sE$ with $\cR\circ\cN^c=\id_\sQ$. In particular, $\cN^c$ maps orthogonal pure states to states with orthogonal supports. \item If there is a quantum instrument on $\sM$ whose success branch $\cD_{\mathrm{succ}}$, a completely positive map from $\sM$ to $\sQ$, satisfies $\cD_{\mathrm{succ}}\circ\cN=q\,\id_\sQ$ for some $q\in[0,1]$, then $\dist(\cN^c(\omega_0),\cN^c(\omega_1))\le1-q$ for all states $\omega_0,\omega_1$ on $\sQ$. \end{enumerate} \end{lemma} \begin{proof} (1) Apply $V$ to one half of a maximally entangled state $\ket{\Phi}_{\sQ\sR}$. The reduced state on $\sM\sR$ is $\sigma_\sM\otimes\one_\sR/2$, and $\sE$ purifies it. Another purification of the same state is $\ket{\Phi}_{\sQ'\sR}$ together with a purification of $\sigma_\sM$. Since purifications are unique up to an isometry on the purifying system, some channel $\cR$ on $\sE$ produces $\ket{\Phi}_{\sQ'\sR}$. The Choi state of $\cR\circ\cN^c$ is then that of the identity channel, so $\cR\circ\cN^c=\id_\sQ$. Two states whose supports are not orthogonal cannot be mapped to orthogonal states by a channel, which gives the last claim. (2) Dilate the instrument to an isometry $\Gamma:\sM\to\sQ'\otimes\sE_{\mathrm{rec}}\otimes\sF$, where the qubit $\sF$ carries the success flag. The operator $V_{\mathrm{succ}}:=(\bra{\mathrm{succ}}_\sF\otimes\one)(\Gamma\otimes\one_\sE)V$ satisfies $\tr_{\sE_{\mathrm{rec}}\sE}(V_{\mathrm{succ}}\,\omega\,V_{\mathrm{succ}}^\dagger)=\cD_{\mathrm{succ}}(\cN(\omega))=q\,\omega$. The Choi operator of the map $q\,\id_\sQ$ has rank one, so $V_{\mathrm{succ}}=\sqrt{q}\,\one_{\sQ\to\sQ'}\otimes\ket{\varphi}_{\sE_{\mathrm{rec}}\sE}$ for a fixed unit vector $\ket{\varphi}$. Applying $\Gamma$ to $\sM$ and tracing out its output does not change the state of $\sE$. Splitting according to the flag gives \[ \cN^c(\omega)\;=\;q\,\tr(\omega)\,\tr_{\sE_{\mathrm{rec}}}\proj{\varphi}+\Phi_{\mathrm{fail}}(\omega), \] where $\Phi_{\mathrm{fail}}$ is completely positive with $\tr\Phi_{\mathrm{fail}}(\omega)=(1-q)\tr(\omega)$. The first term is the same for $\omega_0$ and $\omega_1$, and the triangle inequality gives \[ \dist\bigl(\cN^c(\omega_0),\cN^c(\omega_1)\bigr)\;=\;\tfrac12\bigl\lVert\Phi_{\mathrm{fail}}(\omega_0)-\Phi_{\mathrm{fail}}(\omega_1)\bigr\rVert_1\;\le\;1-q. \qedhere \] \end{proof} \begin{proposition}[Perfect one-bit disclosure]\label{prop:exact} Fix $n\ge1$ and $f$ with degree parameter $d$, and let $K=O(d^3n^2\log(d+2))$ be the cost of the base code of Lemma~\ref{lem:base} for $g=1-f$ and $\theta=1/(4N)$. There is a bit disclosure protocol $\Piex$ that is perfect for $f$ and uses $O(K+n)$ EPR pairs and messages of $O(K+n)$ qubits. \end{proposition} \begin{proof} The predicates $f$ and $g=1-f$ have the same degree parameter. We follow Table~\ref{tab:pipeline}. \step{Step 1: base code and first repair.} Let $\Pibase$ be the protocol of Lemma~\ref{lem:base} for $g$ with $\theta=1/(4N)$. It is $\theta$-private on the cells with $f=1$ and unambiguous with erasure $\theta$ on the cells with $f=0$. Since $\theta\le\frac{1}{N-1}$, Lemma~\ref{lem:repair} applies with $\cH$ the set of cells with $f=1$. The resulting protocol $\Pirep$ is exactly private on the cells with $f=1$, and by part~(ii) it is still unambiguous with erasure $\theta$ on the cells with $f=0$. \step{Step 2: a quantum secret.} Alice now holds a qubit $\sQ$. She draws a uniform key $k=(k_1,k_2)\in\{0,1\}^2$, applies the Pauli operator $P_k$ to $\sQ$, and sends the resulting ciphertext qubit $\sC$ to the referee. She and Bob disclose $k_1$ and $k_2$ with two independent copies of $\Pirep$. Let $\cN_{xy}$ be the channel from $\sQ$ to all messages. \begin{itemize}[nosep] \item On a cell with $f=1$, the messages of the two copies do not depend on $k$. Averaging $P_k\,\omega\,P_k^\dagger$ over the key gives $\tr(\omega)\,\one/2$, so $\cN_{xy}$ is a constant channel. \item On a cell with $f=0$, the referee runs the unambiguous decoder on both copies and, if neither outputs $\perp$, applies $P_k^\dagger$ to $\sC$. The decoders are never wrong, so for each fixed $k$ this success branch acts on $\sQ$ as $q_{xy,k}\,\id_\sQ$, where $q_{xy,k}$ is the probability that neither decoder outputs $\perp$. Averaging over $k$, the success branch $\cD_{\mathrm{succ}}$ satisfies $\cD_{\mathrm{succ}}\circ\cN_{xy}=q_{xy}\,\id_\sQ$ with $1-q_{xy}\le2\theta$. \end{itemize} \step{Step 3: complement.} Starting from the shared EPR pairs, we purify the local operations of Alice and Bob in Step~2, including their private randomness, to isometries $V^A_x$ and $V^B_y$. Alice's isometry maps $\sQ$ and her halves of the pairs to her message $\sM_A$ and an environment $\sE_A$, and Bob's maps his halves to $\sM_B$ and $\sE_B$. A channel from $\ell_{\mathrm{in}}$ qubits to $\ell_{\mathrm{out}}$ qubits has a dilation with an environment of $\ell_{\mathrm{in}}+\ell_{\mathrm{out}}$ qubits, because its Choi rank is at most $2^{\ell_{\mathrm{in}}+\ell_{\mathrm{out}}}$. We may therefore take $\sE_A$ and $\sE_B$ to be registers of fixed sizes $\ell^A_{\mathrm{in}}+\ell^A_{\mathrm{out}}$ and $\ell^B_{\mathrm{in}}+\ell^B_{\mathrm{out}}$ qubits that do not depend on the inputs. With $\sM=\sM_A\sM_B$ and $\sE=\sE_A\sE_B$, the two isometries applied to $\sQ$ and the EPR pairs form an isometry from $\sQ$ to $\sM\otimes\sE$ with channel $\cN_{xy}$ and complementary channel $\cN^c_{xy}$. Define the bit disclosure protocol $\Picomp$ for $f$ as follows: Alice puts $\sQ$ in the state $\proj{z}$, and the parties send $\sE_A$ and $\sE_B$ to the referee instead of $\sM_A$ and $\sM_B$. The referee's states are $\cN^c_{xy}(\proj{0})$ and $\cN^c_{xy}(\proj{1})$. By Lemma~\ref{lem:complement}(1), $\Picomp$ is exactly correct on the cells with $f=1$. By Lemma~\ref{lem:complement}(2), it is $2\theta$-private on the cells with $f=0$. \step{Step 4: second repair.} Since $2\theta=\frac{1}{2N}\le\frac{1}{N-1}$, Lemma~\ref{lem:repair} applies to $\Picomp$ with $\cH$ the set of cells with $f=0$. The resulting protocol $\Piex$ is exactly private on these cells. By part~(ii) of the lemma, on a cell with $f=1$ its two states are, up to a common unitary, the two states of $\Picomp$ with uniform bits attached, so their supports are orthogonal. Hence $\Piex$ is perfect for $f$. \step{Cost.} The base code $\Pibase$ uses $K$ EPR pairs and $O(K)$ message qubits. Each use of Lemma~\ref{lem:repair} multiplies both numbers by a constant and adds $O(n)$. Step~2 doubles them and adds one qubit. In Step~3 the inputs of the local isometries are $\sQ$ and the halves of the EPR pairs, so the environments have $O(K+n)$ qubits. All four protocols therefore use $O(K+n)$ EPR pairs and messages of $O(K+n)$ qubits. \end{proof} \section{Perfect routing}\label{sec:routing} We now turn $\Piex$ into a routing protocol with the coherent teleportation key of~\cite{ABMSV24,Bog26b}: Alice performs the unitary part of teleportation, so the two key bits stay in superposition, and each key bit is disclosed to Bob by one copy of $\Piex$. \begin{proof}[Proof of Theorem~\ref{thm:main}] We describe a protocol with quantum messages, prove recovery in the two cases, and then make the messages classical. \step{Protocol.} Alice prepares an EPR pair $\ket{\Phi}_{\sS\sC}$ on two qubits $\sS$ and $\sC$ of her own. Let $U_{\mathrm{Bell}}$ be the unitary on $\sQ\sS$ that maps the Bell basis to the computational basis, with labels and phases chosen such that, for every state $\ket{\psi}$ of $\sQ$, \begin{equation}\label{eq:bell} (U_{\mathrm{Bell}}\otimes\one_\sC)\bigl(\ket{\psi}_\sQ\otimes\ket{\Phi}_{\sS\sC}\bigr)\;=\;\frac12\sum_{k\in\{0,1\}^2}\ket{k_1}_\sQ\ket{k_2}_\sS\otimes P_k\ket{\psi}_\sC . \end{equation} After applying $U_{\mathrm{Bell}}$, the qubits $\sQ$ and $\sS$ hold the two key bits, and $\sC$ holds the ciphertext. Alice and Bob run two independent copies of $\Piex$, indexed by $i\in\{1,2\}$, in purified form as in Step~3 of the proof of Proposition~\ref{prop:exact}. In copy $i$ the secret bit is the $i$-th key qubit: Alice applies her isometry for secret $z$ controlled on the value $z$ of this qubit. Copy $i$ produces messages $\sM_{A,i}$, $\sM_{B,i}$ and environments $\sE_{A,i}$, $\sE_{B,i}$ of fixed sizes. In the exchange, \begin{itemize}[nosep] \item Alice sends $x$, $\sC$, $\sM_{A,1}$ and $\sM_{A,2}$ to Bob and keeps $\sQ$, $\sS$, $\sE_{A,1}$ and $\sE_{A,2}$; \item Bob sends $y$, $\sE_{B,1}$ and $\sE_{B,2}$ to Alice and keeps $\sM_{B,1}$ and $\sM_{B,2}$. \end{itemize} After the exchange Bob holds $\sC$ and the messages $\sM_i=\sM_{A,i}\sM_{B,i}$, Alice holds the key qubits and the environments $\sE_i=\sE_{A,i}\sE_{B,i}$, and both know $(x,y)$. For a key bit with value $z$, let $\ket{\Psi_{xy,z}}_{\sE_i\sM_i}$ be the pure state produced by copy $i$. Its reduced state on $\sM_i$ is the referee state $\rho^{\mathrm{ex}}_{xy,z}$ of $\Piex$. By~\eqref{eq:bell}, the global state after the exchange is \begin{equation}\label{eq:global} \frac12\sum_{k\in\{0,1\}^2}\ket{k_1}_\sQ\ket{k_2}_\sS\otimes P_k\ket{\psi}_\sC\otimes\ket{\Psi_{xy,k_1}}_{\sE_1\sM_1}\otimes\ket{\Psi_{xy,k_2}}_{\sE_2\sM_2}. \end{equation} \step{Recovery at Bob when $f(x,y)=1$.} The states $\rho^{\mathrm{ex}}_{xy,0}$ and $\rho^{\mathrm{ex}}_{xy,1}$ have orthogonal supports. Let $\Theta^{(i)}_z$ be the projector onto the support of $\rho^{\mathrm{ex}}_{xy,z}$ on $\sM_i$, and let $\Theta_k=\Theta^{(1)}_{k_1}\otimes\Theta^{(2)}_{k_2}$. The four projectors $\Theta_k$ are mutually orthogonal, so \[ \sum_{k\in\{0,1\}^2}\Theta_k\otimes P_k^\dagger+\Bigl(\one-\sum_{k\in\{0,1\}^2}\Theta_k\Bigr)\otimes\one_\sC \] is a unitary on $\sM_1\sM_2\sC$, which Bob applies. Since $\Theta^{(i)}_z$ acts as the identity on $\ket{\Psi_{xy,z}}$, this unitary removes $P_k$ in every term of~\eqref{eq:global}. The result is $\ket{\psi}_\sC$ in tensor product with a state that does not depend on $\ket{\psi}$. \step{Recovery at Alice when $f(x,y)=0$.} Here $\rho^{\mathrm{ex}}_{xy,0}=\rho^{\mathrm{ex}}_{xy,1}$, so $\ket{\Psi_{xy,0}}$ and $\ket{\Psi_{xy,1}}$ are two purifications of the same state on $\sM_i$. By Uhlmann's theorem~\cite{Uhl76} there is a unitary $U_{xy,i}$ on $\sE_i$ with $(U_{xy,i}\otimes\one_{\sM_i})\ket{\Psi_{xy,1}}=\ket{\Psi_{xy,0}}$. For $i=1,2$, Alice applies $\proj{0}\otimes\one+\proj{1}\otimes U_{xy,i}$ to the $i$-th key qubit and $\sE_i$. The state~\eqref{eq:global} becomes the right-hand side of~\eqref{eq:bell} in tensor product with $\ket{\Psi_{xy,0}}_{\sE_1\sM_1}\ket{\Psi_{xy,0}}_{\sE_2\sM_2}$. Alice applies $U_{\mathrm{Bell}}^\dagger$ to $\sQ\sS$ and, by~\eqref{eq:bell}, holds $\ket{\psi}_\sQ$. In both cases the final state is $\ket{\psi}$ on the designated qubit in tensor product with a fixed state. By linearity the protocol implements the identity channel from $\sQ$ to that qubit, and Definition~\ref{def:routing} is met except that some messages are quantum. \step{Classical messages and cost.} By Proposition~\ref{prop:exact}, the two copies of $\Piex$ use $O(K+n)$ EPR pairs, and the registers that cross between the parties have $O(K+n)$ qubits. Each party teleports every qubit it sends, using one more EPR pair and two classical bits per qubit, and sends the Bell outcomes together with its input. The outcomes are uniform and independent of the teleported state. The receiver first undoes the corresponding Pauli operators and then proceeds as above. The protocol thus uses $O(K+n)$ EPR pairs and one simultaneous exchange of $O(K+n)$ classical bits, and $K=O(d^3n^2\log(d+2))$ by Lemma~\ref{lem:base}. \end{proof} \begin{proof}[Proof of Corollary~\ref{cor:cdqs}] The protocol $\Piex$ of Proposition~\ref{prop:exact} is the claimed CDS protocol. For CDQS, Alice encrypts the secret qubit with a uniform Pauli key $k$, sends the ciphertext to the referee, and the parties disclose $k_1$ and $k_2$ with two independent copies of $\Piex$. On a cell with $f=1$ the referee reads both key bits by measuring the orthogonal supports, undoes $P_k$, and has applied a channel $\cD_{xy}$ with $\cD_{xy}\circ\cN_{xy}=\id_\sQ$. On a cell with $f=0$ the messages of the two copies do not depend on $k$, so the average over the key makes $\cN_{xy}$ a constant channel. For a secret of several qubits the parties encrypt every qubit with its own key and disclose each key bit with its own copy of $\Piex$. \end{proof} \section{Discussion}\label{sec:discussion} We have shown that every Boolean function admits a perfect $f$-routing protocol with polynomial entanglement and polynomial classical communication. \paragraph{Where the cost sits.} The base code makes $2T=128L^3\lceil\ln(4/\theta)\rceil$ queries with $L=\Theta(d)$. Each query costs $\Theta(n\log(d+2))$ EPR pairs and message bits, almost all of them for the random point of $\F^n$ and for Bob's slope. Alice's quantum message in a query has only $\log L$ qubits. The exactness layers of Sections~\ref{sec:repair}--\ref{sec:routing} multiply the cost by a constant. They are responsible for the choice $\theta=1/(4N)$, and thereby for one factor $n$. \paragraph{Open problems.} \begin{enumerate}[label=(\arabic*)] \item \emph{Linear entanglement.} Can every $f$ be routed with $O(n)$ EPR pairs and $\mathrm{poly}(n)$ communication, perfectly or with small error? Versions of this question are asked in~\cite{Bog26b,Hex26}. Bogner's strategy has $2n+2$ EPR pairs and an exponentially long message~\cite{Bog26b}, and ours has polynomial but superlinear entanglement. In our construction every query consumes a fresh random point of $\F^n$, and the hiding argument of Lemma~\ref{lem:base} uses the independence of the queries. \item \emph{The price of perfection.} For error $\varepsilon>0$ the cost is $O(n^4\log n\cdot\log(1/\varepsilon))$ by~\cite{Hex26}, and Lemma~\ref{lem:base} gives $O(d^3n\log(d+2)\log(1/\theta))$ for one bit. Our perfect protocol pays one more factor $n$, because the correction of Lemma~\ref{lem:repair} is prepared for a guess of all $n$ bits of Bob's input. A repair whose correction depends on fewer bits of $y$ would reduce this factor. \item \emph{Lower bounds.} The best lower bounds for perfect routing are linear in $n$~\cite{ACM25,HM26}. Theorem~\ref{thm:main} gives $O(n^2)$ for functions of bounded degree and $O(n^5\log n)$ in general. We do not know whether perfect routing is more expensive than routing with a small constant error. \item \emph{Explicit and efficient operations.} Theorem~\ref{thm:main} is information-theoretic. The matrix $G$ of Lemma~\ref{lem:base} is found by a probabilistic argument, and the decoders of Sections~\ref{sec:dual} and~\ref{sec:routing} come from the uniqueness of purifications, with no bound on their circuit size. The replacement states of Lemma~\ref{lem:repair} require a Jordan decomposition of operators on $O(K)$ qubits. \end{enumerate} \section*{Note on concurrent work} This work is an AI-assisted extension of Bogner's paper~\cite{Bog26b}. While it was in progress, the preprint~\cite{Hex26} appeared. For every $f$ and every error $\varepsilon>0$, that preprint gives protocols for CDQS and $f$-routing that use $O(\log(1/\varepsilon)\,n^4\log n)$ qubits. Its polynomial bound for $\varepsilon>0$ predates the present paper. Its bit protocol and the base code of Section~\ref{sec:base} rest on the same two ingredients, interpolation along a random line and the spectrum of a signed cycle. The base code was obtained independently of~\cite{Hex26}. For $d=n$, Lemma~\ref{lem:base} gives a cost of the same order. The preprint lists perfect protocols among its open problems. The present paper supplies this exact case, $\varepsilon=0$: Theorem~\ref{thm:main} for $f$-routing, and Corollary~\ref{cor:cdqs} for CDS and CDQS. The new ingredients are the privacy repair of Lemma~\ref{lem:repair} and its combination with complementation in Section~\ref{sec:dual}. The base code also differs from the protocol of~\cite{Hex26} in two respects: its decoder is unambiguous, and its cost depends on the degree parameter $d$ instead of $n$. \begin{thebibliography}{99} \bibitem{ABMSV24} R.~Allerstorfer, H.~Buhrman, A.~May, F.~Speelman, and P.~Verduyn Lunel. \newblock Relating non-local quantum computation to information theoretic cryptography. \newblock \emph{Quantum}, 8:1387, 2024. \newblock \href{https://arxiv.org/abs/2306.16462}{arXiv:2306.16462}. \bibitem{ACM25} V.~R.~Asadi, E.~Culf, and A.~May. \newblock Rank lower bounds on non-local quantum computation. \newblock In \emph{16th Innovations in Theoretical Computer Science Conference (ITCS 2025)}, LIPIcs 325, 11:1--11:18, 2025. \newblock \href{https://arxiv.org/abs/2402.18647}{arXiv:2402.18647}. \bibitem{AHMS20} B.~Applebaum, T.~Holenstein, M.~Mishra, and O.~Shayevitz. \newblock The communication complexity of private simultaneous messages, revisited. \newblock \emph{Journal of Cryptology}, 33, 2020. \bibitem{AKLMPW25} V.~R.~Asadi, K.~Kuroiwa, D.~Leung, A.~May, S.~Pasterski, and C.~Waddell. \newblock Conditional disclosure of secrets with quantum resources. \newblock \emph{Quantum}, 9:1885, 2025. \newblock \href{https://arxiv.org/abs/2404.14491}{arXiv:2404.14491}. \bibitem{BCFGGOS14} H.~Buhrman, N.~Chandran, S.~Fehr, R.~Gelles, V.~Goyal, R.~Ostrovsky, and C.~Schaffner. \newblock Position-based quantum cryptography: impossibility and constructions. \newblock \emph{SIAM Journal on Computing}, 43(1):150--178, 2014. \bibitem{BF90} D.~Beaver and J.~Feigenbaum. \newblock Hiding instances in multioracle queries. \newblock In \emph{STACS 90}, LNCS 415, pages 37--48, 1990. \bibitem{BFSS13} H.~Buhrman, S.~Fehr, C.~Schaffner, and F.~Speelman. \newblock The garden-hose model. \newblock In \emph{4th Innovations in Theoretical Computer Science Conference (ITCS 2013)}, pages 145--158, 2013. \bibitem{BK11} S.~Beigi and R.~K\"onig. \newblock Simplified instantaneous non-local quantum computation with applications to position-based cryptography. \newblock \emph{New Journal of Physics}, 13:093036, 2011. \bibitem{Bog26a} K.~Bogner. \newblock Robust logarithmic entanglement lower bound for $f$-routing. \newblock \href{https://arxiv.org/abs/2608.05775}{arXiv:2608.05775}, 2026. \bibitem{Bog26b} K.~Bogner. \newblock Linear entanglement suffices for $f$-routing. \newblock \href{https://arxiv.org/abs/2611.30947}{arXiv:2611.30947}, 2026. \bibitem{Hex26} Efficient quantum conditional disclosure of secrets for every function. \newblock Hexagon preprint \href{https://hexagonmath.org/2612.00223v1}{hexagon:2612.00223v1}, 2026. \newblock Contributors: Alex May. \bibitem{HM26} A.~Hasegawa and R.~Mataraarachchi. \newblock New lower bounds for CDS and $f$-routing. \newblock \href{https://arxiv.org/abs/2609.24291}{arXiv:2609.24291}, 2026. \bibitem{KMS11} A.~Kent, W.~J.~Munro, and T.~P.~Spiller. \newblock Quantum tagging: authenticating location via quantum information and relativistic signaling constraints. \newblock \emph{Physical Review A}, 84:012326, 2011. \bibitem{LVW17} T.~Liu, V.~Vaikuntanathan, and H.~Wee. \newblock Conditional disclosure of secrets via non-linear reconstruction. \newblock In \emph{CRYPTO 2017}, LNCS 10401, pages 758--790, 2017. \bibitem{Uhl76} A.~Uhlmann. \newblock The ``transition probability'' in the state space of a $*$-algebra. \newblock \emph{Reports on Mathematical Physics}, 9(2):273--279, 1976. \end{thebibliography} \end{document}