%=====================================================================
% En02-B
% Resource-Limited Holographic Reconstruction
% Boundary Access, Decoder Memory, and Certified Operational Recovery
%
% Compile:
%   pdflatex En02-B.tex
%   pdflatex En02-B.tex
%
% This is one self-contained LaTeX source.
% The Python appendix is not a compilation dependency.
% No local LaTeX compilation, Python execution, or formal proof-checker
% execution is asserted.
%=====================================================================

\documentclass[11pt]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[margin=1.02in]{geometry}
\usepackage{microtype}
\usepackage{amsmath,amssymb,amsthm,mathtools}
\usepackage{array,booktabs,longtable}
\usepackage{enumitem}
\usepackage{xcolor}
\usepackage{fvextra}
\usepackage[hidelinks]{hyperref}

\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{2}
\numberwithin{equation}{section}
\allowdisplaybreaks
\setlength{\emergencystretch}{2em}

%---------------------------------------------------------------------
% Theorem environments
%---------------------------------------------------------------------

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{assumption}[theorem]{Assumption}
\newtheorem{example}[theorem]{Example}
\newtheorem{openproblem}[theorem]{Open Problem}

\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{convention}[theorem]{Convention}

%---------------------------------------------------------------------
% Code environments
%---------------------------------------------------------------------

\DefineVerbatimEnvironment{CodeBlock}{Verbatim}{
  fontsize=\scriptsize,
  breaklines=true,
  breakanywhere=true,
  frame=single,
  framesep=3mm,
  numbers=left,
  numbersep=6pt,
  tabsize=4
}

\DefineVerbatimEnvironment{ShellBlock}{Verbatim}{
  fontsize=\small,
  breaklines=true,
  breakanywhere=true,
  frame=single,
  framesep=3mm
}

%---------------------------------------------------------------------
% Notation
%---------------------------------------------------------------------

\newcommand{\ket}[1]{\lvert #1\rangle}
\newcommand{\bra}[1]{\langle #1\rvert}
\newcommand{\ketbra}[2]{\lvert #1\rangle\!\langle #2\rvert}
\newcommand{\norm}[1]{\left\lVert #1\right\rVert}
\newcommand{\abs}[1]{\left\lvert #1\right\rvert}
\newcommand{\set}[1]{\left\{#1\right\}}
\newcommand{\ceil}[1]{\left\lceil #1\right\rceil}
\newcommand{\code}[1]{\texttt{\detokenize{#1}}}
\newcommand{\id}{\mathrm{id}}
\newcommand{\BB}{\mathcal B}
\newcommand{\HH}{\mathcal H}
\newcommand{\Qpeak}{Q_{\mathrm{peak}}}
\newcommand{\Wrec}{\mathcal W}
\newcommand{\Lib}{\mathfrak L}
\newcommand{\Enter}{\mathsf{Enter}}
\newcommand{\New}{\mathsf{New}}
\newcommand{\Return}{\mathsf{Return}}
\newcommand{\CX}[2]{\mathrm{CX}_{#1\to #2}}
\newcommand{\CZ}[2]{\mathrm{CZ}_{#1,#2}}
\newcommand{\Eact}{E_{\mathrm{act}}}
\newcommand{\Llat}{L_{\mathrm{lat}}}

\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\Tr}{Tr}
\DeclareMathOperator{\rank}{rank}
\DeclareMathOperator{\Choi}{Choi}
\DeclareMathOperator{\Ad}{Ad}
\DeclareMathOperator{\spanop}{span}
\DeclareMathOperator{\supp}{supp}

\title{\textbf{En02-B}\\[2mm]
\textbf{Resource-Limited Holographic Reconstruction}\\[2mm]
\large Boundary Access, Decoder Memory, and Certified Operational Recovery}

\author{Ngo Cheung\\
Independent Researcher\\
Hong Kong SAR, China\\
\texttt{info@cheungngomedical.com}}

\date{7 October 2026}

\begin{document}

\maketitle

\begin{abstract}
Algebraic reconstruction from a boundary region does not specify the
resources needed to execute a recovery. We formulate observable
readout, subsystem recovery, and instrument recovery as distinct
finite-dimensional channel tasks, with correctness including arbitrary
external references. Under specified Born semantics, we construct
explicit decoders for the five-qubit perfect-code building block used
in holographic tensor networks. For the accessible triple
\(\{1,2,3\}\), a nine-gate Clifford decoder uses three batch input
qubits and no additional workspace. A streaming decoder uses two live
qubits, two classical record bits, and no ancillary quantum register.
An intrinsic uniqueness argument identifies the recovery channel on
its entire three-qubit input space. Its Choi operator has a negative
partial transpose across the first input, proving that one-live-qubit
streaming recovery is impossible even with unrestricted classical
memory. Thus the streaming optimum is exactly two, whereas batch
access forces three. The same recovery channel has coherent
environment dimension four; this is compatible with, but does not
bound, instantaneous adaptive memory. For a rooted perfect-code tree,
we prove batch peak \(3^h\) and a streaming bound \(h+1\), the latter
optimal within a declared serial decoder-module class. A finite
schedule recurrence prices that class without claiming unrestricted
decoder optimality. We also prove a two-bit lower bound for a specified
one-way distributed implementation and give a matching decoder.
Half-diamond error budgets compose at the channel level. Exact
Gaussian-integer checks and a finite schedule explorer are supplied
as independently inspectable artefacts, not universal proof
certificates. The results concern finite perfect-tensor code models,
not an entanglement-wedge identification, spacetime emergence, or a
gravitational memory bound.
\end{abstract}

\tableofcontents

%=====================================================================
\section{Introduction and scope}
\label{sec:intro}
%=====================================================================

The quantum-error-correction formulation of holographic subregion
reconstruction is established, rather than introduced here.
Almheiri, Dong, and Harlow connected bulk locality with quantum error
correction; perfect-tensor networks subsequently supplied explicit
finite encoders and reconstruction examples
\cite{ADH,HaPPY}.
Operator-algebra quantum error correction separates correctable
observables and subsystems \cite{BKK}.
Approximate reconstruction can be studied using approximate-correction
and universal-recovery methods \cite{BenyApprox,Cotler}.
These results concern correctability or recovery maps. They do not,
by themselves, specify the live-register ledger of an executable
decoder.

The question addressed here is:
\begin{quote}
When a logical subsystem is reconstructible from an accessible boundary
region, what quantum storage, records, scheduling, and communication
are required to execute a declared recovery task?
\end{quote}

Our contribution is a resource-certified finite construction. We give
the code, gates, measurement branches, output conventions, and lower
bounds together. We make no claim that the underlying five-qubit code,
perfect tensor, or quantum-error-correction interpretation is new.

\subsection{Relationship to En02-A}

En02-A supplies a finite-resource accounting vocabulary and separates
specified Born semantics from conditional characterization of an
unknown measurement strategy \cite{En02A}.
Here the primary decoder theorems use ordinary quantum channels and
specified destructive Born readout from the outset.

The encoding, access sets, recovery channels, and decoder schedules
below are new mathematical data of this paper. They are not furnished
by En02-A, manuscript I, or X-Enter.
The finite-program path-map convention agrees with the specified
Born interface described in I and X-Enter \cite{I,XEnter};
its completeness is proved again in
Theorem~\ref{thm:B1}.

Our laboratory count excludes inaccessible boundary systems and
external references, while retaining them in the correctness
specification. It is therefore not automatically En02-A's global
capacity convention.

The identifier \emph{En02-B} is distinct from \emph{Em02-B}.
No field-theoretic, characteristic-map, gravitational-insertion,
or microsphere-readout result is used as a holographic-code premise.
In particular, our instruments do not instantiate the separately
represented scalar-field Models 1, 2, or 3 of manuscript IV.

\subsection{What is completed}

The principal results are:
\begin{enumerate}[label=\textup{(\roman*)},leftmargin=*]
\item an explicit batch decoder and a reference-preserving channel
certificate;
\item an exact streaming decoder and a nontrivial one-qubit-memory
obstruction;
\item an intrinsic recovery-channel ledger, avoiding arbitrary
off-code lower bounds;
\item a proved decoder-module scheduling bound for a finite
perfect-code tree;
\item a matching upper and lower bound for a declared one-way
distributed implementation;
\item channel-level implementation-error budgets.
\end{enumerate}

The tree model is a rooted concatenation of the perfect-code
isometry. It is not asserted to be a hyperbolic tessellation,
a continuum holographic dual, or a model of gravitational dynamics.

%=====================================================================
\section{Encoding, access, and three recovery tasks}
\label{sec:tasks}
%=====================================================================

All Hilbert spaces are finite dimensional.
Channels act linearly on operator spaces and are completely positive
and trace preserving, abbreviated CPTP.

Fix an isometry
\[
V:\HH_a\otimes\HH_b
\longrightarrow
\HH_A\otimes\HH_{\bar A}.
\]
The accessible-boundary channel is
\begin{equation}
\mathcal N_A(\rho)
=
\Tr_{\bar A}(V\rho V^\dagger).
\label{eq:access}
\end{equation}
An external reference \(R\) is arbitrary and may be entangled with
\(ab\).

\begin{definition}[Recovery tasks]
\label{def:tasks}
The following tasks have different output specifications.

\paragraph{Observable readout.}
For a specified logical POVM \(\{F_y\}\) on \(a\), a boundary
measurement must implement the quantum-to-classical channel
\[
\mathcal M_F(\rho_a)
=
\sum_y\tr(F_y\rho_a)\ketbra y y.
\]
Its output is classical. No quantum preservation of \(a\) is required.

\paragraph{Subsystem recovery.}
A channel \(\mathcal D_A:\BB(\HH_A)\to\BB(\HH_a)\) must satisfy
\begin{equation}
\mathcal D_A\mathcal N_A=\Tr_b.
\label{eq:recovery}
\end{equation}

\paragraph{Instrument recovery.}
For specified completely positive maps
\(\{\mathcal I_y:\BB(\HH_a)\to\BB(\HH_{a'})\}\), whose sum is
trace preserving, the required output channel is
\[
\widehat{\mathcal I}(\rho_a)
=
\sum_y\ketbra y y\otimes\mathcal I_y(\rho_a).
\]
A boundary programme must implement
\(\widehat{\mathcal I}\Tr_b\), including its conditional quantum
outputs, not only its outcome probabilities.
\end{definition}

Equation~\eqref{eq:recovery} is an equality of linear maps.
Consequently,
\[
(\mathcal D_A\mathcal N_A\otimes\id_R)(\rho_{abR})
=
\Tr_b\rho_{abR}
\]
for every reference and every input.

For approximate recovery we use
\begin{equation}
d_\diamond(\Phi,\Psi)
=
\frac12\norm{\Phi-\Psi}_\diamond,
\qquad
d_\diamond(\mathcal D_A\mathcal N_A,\Tr_b)\le\varepsilon.
\label{eq:diamond}
\end{equation}
The diamond norm is the completely bounded trace norm.
For channel differences, it controls every input entangled with a
reference; standard finite-dimensional channel conventions are those
of \cite[Chapters 2--3]{Watrous}.

\begin{remark}[A selected state is not a channel certificate]
Agreement on \(\ket0\) and \(\ket1\) does not determine the action on
\(\ketbra0 1\).
An exact certificate must determine all matrix units, or equivalently
the Choi operator. Numerical fidelity on selected states is not a
diamond-norm certificate.
\end{remark}

%=====================================================================
\section{Laboratory resources and implementation libraries}
\label{sec:resources}
%=====================================================================

\begin{definition}[Peak laboratory occupancy]
\label{def:peak}
For a finite decoder programme \(\pi\),
\[
\Qpeak(\pi)
=
\max_{t,h}
\#\{\text{live laboratory qubits at time \(t\) on history \(h\)}\}.
\]
The count includes:
\begin{itemize}[nosep]
\item accessible input qubits already delivered;
\item working ancillas;
\item recovered output until its final return;
\item retained syndrome and quantum-record registers.
\end{itemize}
Inaccessible boundary systems, undelivered streaming inputs, and
external references are outside laboratory occupancy.
They remain inside the channel specification.
\end{definition}

Every laboratory qubit is either destructively measured or returned.
There is no silent quantum deletion or uncounted external quantum
scratch space. Classical records may be forgotten explicitly.

\begin{definition}[Resource vector]
We record
\[
\mathbf C(\pi)
=
(\Qpeak,G,D,C_{\mathrm{cl}},C_{\mathrm{comm}},\varepsilon).
\]
Here \(G\) is the worst-history number of elementary unitary gates.
The depth \(D\) counts rounds of gates and destructive readouts;
operations on disjoint qubits may share a round.
Waiting for a streaming delivery is not a gate round.
\(C_{\mathrm{cl}}\) counts retained outcome bits, not the fixed
programme description.
Communication is zero in the local model and specified separately
in the distributed model.
\end{definition}

Classical storage is initially unrestricted. Its reported upper bounds
are nevertheless part of each programme's ledger.

\subsection{Batch and streaming interfaces}

\begin{definition}[Batch access]
All qubits of \(A\) are present in the laboratory at the initial time.
Thus
\[
\Qpeak(\pi)\ge \abs A.
\]
Ignoring or measuring a supplied qubit does not erase this initial
occupancy cost.
\end{definition}

\begin{definition}[Ordered streaming access]
\label{def:stream}
The accessible input is an arbitrary joint state on an ordered list
of carriers \(q_1,\ldots,q_n\). A passive supplier retains the
undelivered carriers and transfers them, one at a time, on request
in that order.

The supplier performs no decoding, measurement, or state-dependent
selection. The laboratory may pause delivery but may not return
intermediate quantum data to the supplier, use another quantum
buffer, or export a quantum output before completion.
The target quantum output is returned only at the end.
\end{definition}

This convention changes the storage interface; it does not compress
the total quantum state of the supplier and laboratory.

\subsection{Fixed gate library}

For the explicit benchmarks, \(\Lib_{\mathrm{Cl}}\) contains:
\[
H,\quad S,\quad S^\dagger,\quad X,\quad Y,\quad Z,
\quad \CX{i}{j},\quad \CZ{i}{j},
\]
zero-state allocation, destructive computational readout, finite
classical control, and quantum return.
Any pair of laboratory qubits may interact.
All these gates are exact.

The matrices are
\[
H=\frac1{\sqrt2}
\begin{pmatrix}1&1\\1&-1\end{pmatrix},
\qquad
S=\begin{pmatrix}1&0\\0&i\end{pmatrix},
\]
with the usual Pauli, CNOT, and controlled-\(Z\) conventions.
A controlled Pauli chosen from \(I,X,Y,Z\) costs at most one
elementary gate. Global phases are irrelevant.

No gate-count optimality or geometric locality follows from this
all-to-all library.

%=====================================================================
\section{Programme soundness and elementary monotonicities}
\label{sec:soundness}
%=====================================================================

\subsection{Finite certificates}

For a linear map \(\Phi:\BB(\HH_{\mathrm{in}})\to
\BB(\HH_{\mathrm{out}})\), use the unnormalized Choi operator
\[
J(\Phi)
=
\sum_{i,j}\ketbra i j\otimes
\Phi(\ketbra i j).
\]
Its blocks determine \(\Phi\) on every matrix unit.

\begin{definition}[Resource-certified programme]
A certificate for \(\pi\) comprises:
\begin{enumerate}[label=\textup{(\roman*)}]
\item its finite instruction tree and its input/output names;
\item the branch path maps \(K_h\);
\item the complete selective channel
\[
\Phi_y^\pi(\rho)
=
\sum_{h:\operatorname{out}(h)=y}K_h\rho K_h^\dagger;
\]
\item an equality of the task channel composed with
\(\mathcal N_A\), certified on all matrix units;
\item a live-name ledger at every instruction and branch.
\end{enumerate}
All outcomes are retained in the branch sum. A successful branch
alone is not a deterministic recovery.
\end{definition}

\begin{theorem}[B1: resource-certified decoder soundness]
\label{thm:B1}
Under specified Born semantics, a finite legal programme with the
above certificate implements its declared channel on arbitrary
reference-entangled inputs and obeys its declared peak bound.
\end{theorem}

\begin{proof}
Along a history, compose allocation isometries, gates, and destructive
measurement bras. The resulting linear map is \(K_h\).
Branch normalizations cancel against the product of branch
probabilities, leaving the unnormalized output
\(K_h\rho K_h^\dagger\).

Completeness follows by backward induction on the finite instruction
tree. Gates and allocations are isometric. At a readout,
\(\sum_\kappa M_\kappa^\dagger M_\kappa=I\).
Every subsequent branch is complete by induction, so
\[
\sum_hK_h^\dagger K_h=I.
\]
The programme therefore defines a CPTP output channel, or a complete
instrument if outcomes are reported.

Equality of Choi blocks is equality on all matrix units and hence
equality of the linear maps. Tensoring this equality with
\(\id_R\) proves correctness with every reference.

Finally, the live-name ledger counts every allocated, surviving,
and returned quantum factor on each branch.
Its maximum is the claimed bound by
Definition~\ref{def:peak}. Consumption and return ensure there is
no unpriced quantum output.
\end{proof}

\subsection{Cost functions}

For a fixed task, access interface, and implementation library,
define
\[
Q^*_{\Lib}(A,a,\varepsilon)
=
\inf_{\pi}
\Qpeak(\pi),
\]
over legal programmes satisfying the subsystem recovery requirement
within \(\varepsilon\). The value is \(+\infty\) if none exists.
Because finite peaks are integers, a finite infimum is attained as
a minimum of the achievable peak values.

\begin{proposition}[B2: cost and feasibility monotonicities]
\label{prop:B2}
With the task and access convention fixed:
\begin{enumerate}[label=\textup{(\roman*)}]
\item increasing \(\varepsilon\) cannot increase \(Q^*_{\Lib}\);
\item enlarging \(\Lib\) cannot increase \(Q^*_{\Lib}\);
\item increasing a laboratory capacity cannot destroy feasibility.
\end{enumerate}
\end{proposition}

\begin{proof}
Each change enlarges the relevant feasible set or leaves an already
legal programme legal. Taking infima gives the first two statements.
\end{proof}

There is no analogous general decrease in \emph{total batch peak}
when the accessible region grows: its enlarged input already occupies
more qubits.

%=====================================================================
\section{The exact five-qubit perfect-code building block}
\label{sec:code}
%=====================================================================

The five-qubit code is a standard quantum-error-correction benchmark
\cite{Laflamme}.
We use the stabilizer convention in the perfect-tensor construction
\cite[Appendix A.1]{HaPPY} and give the finite algebra needed here.

Let
\begin{align}
g_1&=XZZXI,&
g_2&=IXZZX,&
g_3&=XIXZZ,&
g_4&=ZXIXZ.
\label{eq:stabilizers}
\end{align}
Tensor positions are \(1,\ldots,5\).
Define
\[
P=\frac1{16}\prod_{j=1}^4(I+g_j),
\qquad
\overline X=XXXXX,
\qquad
\overline Z=ZZZZZ.
\]
The generators commute. The following table gives every nonidentity
stabilizer product, with its overall sign omitted only because this
table is used to inspect support.

\begin{center}
\small
\begin{tabular}{@{}clclcl@{}}
\toprule
Product & Unsigned word & Product & Unsigned word
& Product & Unsigned word\\
\midrule
\(1\)&\(XZZXI\)&\(2\)&\(IXZZX\)&\(3\)&\(XIXZZ\)\\
\(4\)&\(ZXIXZ\)&\(12\)&\(XYIYX\)&\(13\)&\(IZYYZ\)\\
\(14\)&\(YYZIZ\)&\(23\)&\(XXYIY\)&\(24\)&\(ZIZYY\)\\
\(34\)&\(YXXYI\)&\(123\)&\(IYXXY\)&\(124\)&\(YZIZY\)\\
\(134\)&\(ZYYZI\)&\(234\)&\(YIYXX\)&\(1234\)&\(ZZXIX\)\\
\bottomrule
\end{tabular}
\end{center}

All fifteen words have weight four.
Their distinct supports and words also show that the sixteen
stabilizer products are distinct and that \(-I\) is absent.
Thus \(P\) is an orthogonal projector of trace \(32/16=2\).

No nonidentity stabilizer product is diagonal in the computational
basis. Hence
\(\bra{00000}P\ket{00000}=1/16\).
Fix the encoding explicitly by
\begin{equation}
\ket{0_L}=4P\ket{00000},
\qquad
\ket{1_L}=\overline X\ket{0_L},
\qquad
V=\ket{0_L}\bra0+\ket{1_L}\bra1.
\label{eq:encoding}
\end{equation}
These vectors are normalized, have opposite \(\overline Z\)
eigenvalues, and obey
\[
\overline XV=VX,\qquad \overline ZV=VZ.
\]
In this benchmark \(b\) is trivial.

\subsection{Access classification}

For a Pauli error, its syndrome is the four-bit vector recording
anticommutation with \(g_1,\ldots,g_4\).
The single-qubit syndromes are:
\begin{center}
\begin{tabular}{@{}c|ccc@{}}
\toprule
Position & \(X\) & \(Z\) & \(Y\)\\
\midrule
1&0001&1010&1011\\
2&1000&0101&1101\\
3&1100&0010&1110\\
4&0110&1001&1111\\
5&0011&0100&0111\\
\bottomrule
\end{tabular}
\end{center}

They are precisely the fifteen distinct nonzero four-bit vectors.
Every nonidentity Pauli of weight one or two therefore has nonzero
syndrome. For weight two, this follows because its syndrome is the
sum of two distinct single-site syndromes.

\begin{lemma}[Two-qubit privacy and erasure certificate]
\label{lem:privacy}
For \(C\subseteq\{1,\ldots,5\}\) with \(\abs C\le2\),
\begin{equation}
\Tr_{\bar C}(V\rho V^\dagger)
=
\tr(\rho)\frac{I_C}{2^{\abs C}}.
\label{eq:privacy}
\end{equation}
If \(A=\bar C\), and
\(E_e=(I_A\otimes\bra e_C)V\), then
\begin{equation}
E_e^\dagger E_f
=
\frac{\delta_{ef}}{2^{\abs C}}I_2.
\label{eq:KL}
\end{equation}
\end{lemma}

\begin{proof}
A nonzero syndrome supplies a stabilizer \(g_j\) anticommuting with
the Pauli \(Q\). Since \(g_jV=V\),
\[
V^\dagger QV
=
V^\dagger g_jQg_jV
=
-V^\dagger QV,
\]
so it vanishes.
Expanding operators on \(C\) in the Pauli basis gives
\eqref{eq:privacy}, including off-diagonal logical matrix units.
Equation~\eqref{eq:KL} follows by applying the same identity to
\(I_A\otimes\ketbra e f_C\).
\end{proof}

Equation~\eqref{eq:KL} is the erasure form of a
Knill--Laflamme certificate \cite{KL}; here it has been evaluated
explicitly rather than inferred from a distance label.

\begin{proposition}[Authorized and unauthorized access]
\label{prop:access}
Every boundary set of at least three qubits can recover the logical
qubit algebraically. Every set of at most two qubits is independent
of the logical input and cannot recover it exactly.

For an unauthorized set, the optimal subsystem recovery error,
over arbitrary channels, is
\[
\inf_{\mathcal D}
d_\diamond(\mathcal D\mathcal N_C,\id_2)=\frac34.
\]
\end{proposition}

\begin{proof}
For an accessible triple, \(\abs C=2\).
The eight vectors
\[
2E_e\ket i,\qquad i\in\{0,1\},\quad e\in\{0,1\}^2,
\]
are orthonormal by \eqref{eq:KL}.
They form a basis of \(\HH_A\).
The unitary sending them to \(\ket i\ket e\), followed by tracing
the last two factors, is an exact decoder. For a larger accessible
set, select a triple and explicitly consume the other accessible
qubits by unreported destructive measurement.

For an unauthorized set, \eqref{eq:privacy} makes every decoded
channel a constant preparation channel.
On a logical Bell state with a reference, its output has the form
\(\sigma\otimes I_R/2\), whose Bell overlap is \(1/4\).
The Bell-projector test gives trace distance at least \(3/4\).

This bound is achieved by the completely depolarizing logical output
\(\mathcal T\).
Indeed,
\[
\mathcal T
=
\frac14(\id+\Ad_X+\Ad_Y+\Ad_Z),
\]
so
\[
\norm{\id-\mathcal T}_\diamond
\le
\frac34+\frac14+\frac14+\frac14
=
\frac32.
\]
The Bell-state lower bound supplies equality.
\end{proof}

The proposition classifies algebraic access.
The explicit gate and memory theorems below concern the particular
authorized triple \(A=\{1,2,3\}\).

\subsection{Why this is a perfect-tensor building block}

\begin{proposition}[The associated six-leg perfect state]
\label{prop:perfect}
The normalized state
\[
\ket T
=
\frac{\ket0_R\ket{0_L}+\ket1_R\ket{1_L}}{\sqrt2}
\]
has maximally mixed reduction on every set of three of its six
qubits. Its tensor therefore gives, up to normalization, an isometry
across every bipartition with at most three input legs.
\end{proposition}

\begin{proof}
For three physical qubits, their reduction is the reduction of
\(P/2\).
The stabilizer expansion contains no nonidentity term supported on
three qubits, so the reduction is \(I_8/8\).

For \(R\) and two physical qubits, apply
\eqref{eq:privacy} to the logical half of the Bell state:
the reduction is \(I_R/2\otimes I_4/4\).
These are all kinds of three-qubit subsets.
Smaller subsets follow by tracing.
The Schmidt coefficients across each three-versus-three cut are
equal, which is precisely the stated isometry property.
\end{proof}

%=====================================================================
\section{An explicit batch subsystem decoder}
\label{sec:batch}
%=====================================================================

Set \(A=\{1,2,3\}\) and \(E=\{4,5\}\).
Multiplication by stabilizers gives supported logical representatives
\begin{equation}
X_A=-Z_1X_2Z_3,\qquad
Z_A=-Y_1Z_2Y_3,\qquad
Y_A=-X_1Y_2X_3.
\label{eq:reps}
\end{equation}
For example,
\[
\overline Xg_2g_3g_4=-Z_1X_2Z_3,
\qquad
\overline Zg_3=-Y_1Z_2Y_3.
\]
Thus \(X_AV=VX\) and \(Z_AV=VZ\).

Define the following unitary, with the rightmost gate applied first:
\begin{equation}
U
=
Y_2\,\CX{3}{2}\CX{1}{2}
(H_1S_1^\dagger)(H_3S_3^\dagger)
\CZ{1}{2}\CZ{2}{3}.
\label{eq:U}
\end{equation}

Its chronological gate list is:
\begin{center}
\begin{tabular}{@{}cl@{}}
\toprule
Stage & Gates\\
\midrule
1&\(\CZ{1}{2}\)\\
2&\(\CZ{2}{3}\)\\
3&\(S_1^\dagger,S_3^\dagger\), in parallel\\
4&\(H_1,H_3\), in parallel\\
5&\(\CX{1}{2}\)\\
6&\(\CX{3}{2}\)\\
7&\(Y_2\)\\
\bottomrule
\end{tabular}
\end{center}

There are nine elementary gates and seven gate rounds.

\begin{lemma}[Decoder conjugation certificate]
\label{lem:conjugation}
\[
UX_AU^\dagger=X_2,\qquad
UZ_AU^\dagger=Z_2.
\]
\end{lemma}

\begin{proof}
The two controlled-\(Z\) gates map
\(Z_1X_2Z_3\) to \(X_2\) and leave \(Y_1Z_2Y_3\) unchanged.
On positions 1 and 3, \(HS^\dagger\) maps \(Y\) to \(Z\).
The two CNOTs then map \(Z_1Z_2Z_3\) to \(Z_2\), leaving \(X_2\)
unchanged.
The final \(Y_2\) reverses the signs of both \(X_2\) and \(Z_2\).
This cancels the two minus signs in \eqref{eq:reps}.
\end{proof}

Let \(F=\{1,3\}\) denote the two syndrome factors after decoding.

\begin{lemma}[Intertwining factorization]
\label{lem:factor}
For a fixed normalized vector \(\chi\in\HH_F\otimes\HH_E\),
\begin{equation}
(U_A\otimes I_E)V\ket\psi
=
\ket\psi_2\otimes\ket\chi_{FE}
\label{eq:factor}
\end{equation}
for every logical vector \(\psi\).
Moreover,
\[
\Tr_E\ketbra\chi\chi=\frac{I_F}{4}.
\]
\end{lemma}

\begin{proof}
Write \(W=(U_A\otimes I_E)V\).
Lemma~\ref{lem:conjugation} gives
\(X_2W=WX\) and \(Z_2W=WZ\).
The \(Z\) identity makes
\(W\ket0=\ket0\ket{\chi_0}\) and
\(W\ket1=\ket1\ket{\chi_1}\).
The \(X\) identity gives \(\chi_0=\chi_1=\chi\).
Isometry of \(W\) gives normalization.

The encoded maximally mixed logical input is \(P/2\).
Its reduction on \(A\) is \(I_A/8\), by the weight-four stabilizer
table. Equation~\eqref{eq:factor} therefore gives
\[
\frac{I_2}{2}\otimes\Tr_E\ketbra\chi\chi=\frac{I_8}{8},
\]
proving the syndrome statement.
\end{proof}

Consequently,
\begin{equation}
U\mathcal N_A(\rho)U^\dagger
=
\rho_2\otimes\frac{I_F}{4}.
\label{eq:normalform}
\end{equation}

\begin{theorem}[Explicit batch recovery and its ledger]
\label{thm:batch}
The programme
\[
U(A);
\quad
\Enter(q_1,q_3);
\quad
\text{forget the two syndrome bits};
\quad
\Return(q_2)
\]
implements
\begin{equation}
\mathcal D(\sigma)=\Tr_F(U\sigma U^\dagger)
\label{eq:D}
\end{equation}
and satisfies
\(\mathcal D\mathcal N_A=\id_2\), including every reference.

Its resource vector has
\[
\Qpeak=3,\quad G=9,\quad D=8,\quad
C_{\mathrm{cl}}\le2,\quad C_{\mathrm{comm}}=0,\quad
\varepsilon=0.
\]
It allocates no ancilla and is peak-optimal for batch access.
\end{theorem}

\begin{proof}
Destructively measuring \(F\) and summing its outcomes is precisely
the partial trace over \(F\).
Equation~\eqref{eq:normalform} proves recovery.
Alternatively, \eqref{eq:factor} proves it before tracing and
therefore with every reference.

The syndrome outcomes are uniform over four values and independent
of the logical-reference state. Each normalized positive branch
returns the original logical state with its reference correlations.

Three input names are initially live. Gates preserve that count.
The two readout names are then consumed, leaving one returned qubit.
The two readouts share the eighth round.
No quantum record or environment remains unconsumed.
Batch access forces the initial lower bound three.
\end{proof}

%=====================================================================
\section{Intrinsic recovery channel and one-shot accounting}
\label{sec:oneshot}
%=====================================================================

The cost of an arbitrary off-code extension need not be an intrinsic
reconstruction cost. In this benchmark the ambiguity can be removed.

\begin{lemma}[Faithful-syndrome uniqueness]
\label{lem:unique}
Let \(d\ge1\). If a CPTP channel
\(\mathcal R:\BB(\HH_a\otimes\mathbb C^d)\to\BB(\HH_a)\)
satisfies
\[
\mathcal R(\rho\otimes I_d/d)=\rho
\]
for every \(\rho\), then \(\mathcal R=\Tr_{\mathbb C^d}\).
\end{lemma}

\begin{proof}
Take Kraus operators \(K_\ell\) of \(\mathcal R\).
The operators
\[
L_{\ell j}
=
\frac1{\sqrt d}K_\ell(I_a\otimes\ket j)
\]
are a Kraus family for \(\id_a\).
The Choi operator of the identity has rank one.
Since it is a sum of positive rank-one operators, every
\(\operatorname{vec}(L_{\ell j})\) is proportional to
\(\operatorname{vec}(I_a)\).
Thus \(L_{\ell j}=c_{\ell j}I_a\), and
\[
K_\ell=I_a\otimes\bra{w_\ell}
\]
for some vectors \(w_\ell\).
Trace preservation gives
\(\sum_\ell\ketbra{w_\ell}{w_\ell}=I_d\).
Substitution yields the partial trace on every operator.
\end{proof}

\begin{theorem}[B3: intrinsic one-shot ledger for the authorized triple]
\label{thm:B3}
Every CPTP exact recovery channel on \(A=\{1,2,3\}\) equals
\(\mathcal D\) in \eqref{eq:D} on its entire input space.
Its Choi rank is four.

In the pure-environment, one-shot dilation model, its minimum
environment dimension is four. The output-plus-environment peak
is three qubits, with no additional workspace beyond the batch input.
\end{theorem}

\begin{proof}
For another exact decoder \(\mathcal D'\), define
\(\mathcal R=\mathcal D'\Ad_{U^\dagger}\).
Equation~\eqref{eq:normalform} and exact recovery give
\(\mathcal R(\rho\otimes I_4/4)=\rho\).
Lemma~\ref{lem:unique} identifies \(\mathcal R=\Tr_F\), hence
\(\mathcal D'=\mathcal D\).

The four Kraus maps
\[
K_f=(I_2\otimes\bra f_F)U,\qquad f\in\{0,1\}^2,
\]
are Hilbert--Schmidt orthogonal:
\(\tr(K_f^\dagger K_g)=2\delta_{fg}\).
Their Choi vectors are independent, so the Choi rank is four.

For completeness, an environment of dimension \(r\) yields at most
\(r\) Kraus operators by expanding its dilation in a basis.
Conversely, a minimum Kraus family defines the isometry
\(\psi\mapsto\sum_jK_j\psi\otimes\ket j\).
Thus the minimum environment dimension equals Choi rank
\cite[Chapter 2]{Watrous}.
Here the two environment qubits are the original syndrome factors,
and the total output dimension is \(2\cdot4=8\).
\end{proof}

This is an application of the one-shot model also priced in En02-A.
It is not a bound on every adaptive instantaneous memory.

\begin{example}[Why an arbitrary extension is not a lower bound]
\label{ex:offcode}
Consider the restricted encoding
\(\rho\mapsto\rho\otimes\ketbra00\).
Partial trace over the second qubit is a valid decoder of Choi rank
two.

Another valid decoder acts as identity when the second qubit is
zero, and depolarizes the first when it is one:
\[
\mathcal R'(\sigma)
=
\bra0\sigma\ket0
+
\tr(\bra1\sigma\ket1)\frac{I_2}{2}.
\]
It has the five independent Kraus operators
\[
I\otimes\bra0,\qquad
\frac12P\otimes\bra1,\quad P\in\{I,X,Y,Z\}.
\]
Its Choi rank is five, despite identical recovery on the restricted
encoding. Its larger dilation cost is not an intrinsic recovery
lower bound.

Theorem~\ref{thm:B3} avoids this error because the syndrome in
\eqref{eq:normalform} is faithful and forces uniqueness.
\end{example}

%=====================================================================
\section{Streaming recovery: a decoder and a genuine lower bound}
\label{sec:streaming}
%=====================================================================

The delivery order is \(q_1,q_2,q_3\).

\subsection{A two-live-qubit programme}

Define commuting operators on the first two carriers:
\[
P_{12}=Z_1X_2,\qquad Q_{12}=Y_1Z_2.
\]
They are independent and have one-dimensional joint eigenspaces.
Let
\begin{equation}
B_{12}
=
H_1S_1^\dagger\,\CX{1}{2}\,H_2.
\label{eq:B}
\end{equation}
Direct conjugation gives
\[
B_{12}P_{12}B_{12}^\dagger=Z_2,\qquad
B_{12}Q_{12}B_{12}^\dagger=Z_1.
\]
Write the computational readout of positions 1 and 2 after \(B\)
as \((t,s)\), so
\[
q=(-1)^t,\qquad p=(-1)^s
\]
are the eigenvalues of \(Q_{12}\) and \(P_{12}\), respectively.

After the third carrier arrives, put
\[
R_3=H_3S_3^\dagger,\qquad
C_{ts}=X_3^{\,1-t}Z_3^{\,1-s}.
\]
The product \(C_{ts}\) is implemented by one Pauli gate, up to phase.

The programme is:
\begin{enumerate}[label=\textup{(\arabic*)},leftmargin=*]
\item receive \(q_1,q_2\);
\item apply \(H_2,\CX{1}{2},S_1^\dagger,H_1\);
\item destructively read both qubits, retaining bits \(t,s\);
\item receive \(q_3\);
\item apply \(S_3^\dagger,H_3,C_{ts}\);
\item forget \(t,s\), and return \(q_3\).
\end{enumerate}

\begin{theorem}[Streaming decoder correctness]
\label{thm:streamupper}
The programme implements the same channel \(\mathcal D\) as the
batch decoder. On encoded inputs each of its four histories has
probability \(1/4\), independent of the logical-reference input.

Its resources satisfy
\[
\Qpeak=2,\quad G\le7,\quad D\le8,\quad
C_{\mathrm{cl}}=2,\quad C_{\mathrm{comm}}=0,\quad
\varepsilon=0.
\]
\end{theorem}

\begin{proof}
Let \(\bra{\beta_{ts}}=\bra{t,s}B_{12}\).
The branch map on the full encoded state is
\[
W_{ts}
=
(C_{ts}R_3\otimes I_E)
(\bra{\beta_{ts}}\otimes I_{3E})V.
\]
Since
\(X_A=-P_{12}Z_3\) and
\(Z_A=-Q_{12}Y_3\), the eigenvalue equations imply
\[
W_{ts}X=(-p)C_{ts}R_3Z_3R_3^\dagger C_{ts}^\dagger W_{ts}
=X_3W_{ts},
\]
and similarly
\(W_{ts}Z=Z_3W_{ts}\).
Here \(R_3Z_3R_3^\dagger=X_3\),
\(R_3Y_3R_3^\dagger=Z_3\), and the correction supplies the required
signs.

The same intertwining argument as in Lemma~\ref{lem:factor} gives
\[
W_{ts}\ket\psi=\ket\psi_3\otimes\ket{\chi_{ts}}_E
\]
for a fixed branch vector.
The first-two-qubit reduction is \(I_4/4\), so
\(\norm{\chi_{ts}}^2=1/4\).
Thus every branch preserves the logical-reference state, and the
complete channel is exact recovery.
Theorem~\ref{thm:B3} then identifies it with \(\mathcal D\) on the
whole accessible input space.

Before the first readout two qubits are live.
They are both consumed before the third arrives.
Thereafter only one qubit is live.
Four early gates, two late basis-change gates, and at most one
correction give \(G\le7\).
The early readout adds one round to the seven sequential gate rounds.
No ancilla or retained quantum record is used.
\end{proof}

\subsection{The one-live-qubit obstruction}

Let \(\omega_{\mathcal D}\) be the normalized Choi state of
\(\mathcal D\), ordered as output \(0\) and input-reference
positions \(1,2,3\). From \eqref{eq:reps},
\begin{equation}
\omega_{\mathcal D}
=
\frac1{16}
\left(
I-X_0Z_1X_2Z_3
+Y_0X_1Y_2X_3
-Z_0Y_1Z_2Y_3
\right).
\label{eq:choi}
\end{equation}
Set
\[
S_1=-X_0Z_1X_2Z_3,\qquad
S_3=-Z_0Y_1Z_2Y_3.
\]
They commute and
\(S_1S_3=Y_0X_1Y_2X_3\).
Partial transpose on position 1 therefore gives
\[
\omega_{\mathcal D}^{T_1}
=
\frac1{16}(I+S_1+S_1S_3-S_3).
\]
On the simultaneous eigenspace \(S_1=-1,S_3=+1\), its eigenvalue
is \(-1/8\). That eigenspace is nonzero because the two commuting
Paulis are independent.

\begin{theorem}[B5: exact streaming memory optimum]
\label{thm:B5}
Under Definition~\ref{def:stream}, exact subsystem recovery from
the authorized triple requires at least two live laboratory qubits,
even with unrestricted classical storage and arbitrary local
single-qubit operations. Hence
\[
Q^*_{\Lib_{\mathrm{Cl}},\mathrm{stream}}(A,a,0)=2.
\]
\end{theorem}

\begin{proof}
Suppose the peak were one.
Before the second carrier can be delivered, the first carrier must
cease to be a live laboratory qubit.
There is no early quantum output, return to the supplier, or other
quantum storage. Its only possible continuing influence is therefore
a classical record.

The implemented channel consequently has the form
\[
\Lambda(\rho_{123})
=
\sum_h
\Lambda_h\!\left(
\Tr_1[(E_h\otimes I_{23})\rho_{123}]
\right),
\]
with positive effects \(E_h\) on position 1 and subsequent completely
positive maps on positions 2 and 3.
Its Choi operator is a sum of positive products across
input-reference position 1 versus all remaining systems.
It is separable across that cut and has positive partial transpose.

Exact recovery on the code would force
\(\Lambda=\mathcal D\) by Theorem~\ref{thm:B3}.
Equation~\eqref{eq:choi} has a negative partial transpose, a
contradiction.
Theorem~\ref{thm:streamupper} attains peak two.
\end{proof}

\begin{remark}[Adaptive versus retained-coherent execution]
In the restricted streaming model that retains every delivered
carrier coherently until all three have arrived, peak occupancy is
at least three. The batch unitary \(U\), followed by terminal
syndrome readout, attains it.

The adaptive streaming programme and this coherent programme
implement the same complete channel \(\mathcal D\).
Their streaming peaks are two and three.
For batch access both peaks are three, because the input itself
already occupies three qubits.
\end{remark}

\subsection{Observable and instrument tasks have different costs}

\begin{proposition}[One-live-qubit logical readout]
\label{prop:observable}
In the ordered streaming interface, logical \(X\)-readout and
logical \(Z\)-readout each admit peak one.

The rank-one logical \(Z\) L\"uders instrument, with its quantum
post-measurement output, also admits peak one.
None of these programmes is subsystem recovery.
\end{proposition}

\begin{proof}
For \(X\), measure the physical observables \(Z_1,X_2,Z_3\)
sequentially and report the negative of their product.
For \(Z\), measure \(Y_1,Z_2,Y_3\) and report the negative product.
Equation~\eqref{eq:reps} gives the required logical effects.
An \(X\)-measurement uses \(H\) before destructive readout; a
\(Y\)-measurement uses \(HS^\dagger\).
Each carrier is consumed before the next arrives.

For the logical \(Z\) instrument, let the reported logical outcome
be \(\kappa\in\{0,1\}\).
After consuming all boundary carriers, allocate \(\ket0\), apply
\(X^\kappa\), and return it.
The resulting selective map has the correct effect and prepares
the fixed state \(\ket\kappa\).
For a rank-one projector this is exactly
\[
\rho\longmapsto
\ketbra\kappa\kappa\,\rho\,\ketbra\kappa\kappa,
\]
including its action on an external reference.

Forgetting the outcome instead gives logical \(Z\)-dephasing,
not the identity channel. A logical Bell input detects the lost
coherence.
\end{proof}

%=====================================================================
\section{A finite perfect-code tree and decoder schedules}
\label{sec:tree}
%=====================================================================

\subsection{Encoding and accessible leaves}

Define the rooted encoders recursively:
\[
V^{(1)}=V,\qquad
V^{(h)}
=
(V^{(h-1)})^{\otimes5}V.
\]
There are \(5^h\) physical leaves and one root logical qubit.
At every node choose child positions \(1,2,3\) as accessible and
discard positions \(4,5\) into the inaccessible complement.
The accessible set \(A_h\) has
\[
n_h=\abs{A_h}=3^h
\]
leaves.

For \(h=2\), the network has one root tensor and five child tensors,
with twenty-five physical leaves. The accessible nine are
\[
(1,1),(1,2),(1,3),\quad
(2,1),(2,2),(2,3),\quad
(3,1),(3,2),(3,3).
\]
This is the small multi-tensor benchmark.

Streaming deliveries use depth-first order: all accessible leaves
of child 1, then child 2, then child 3, recursively.

\begin{lemma}[Recursive recovery normal form]
\label{lem:treenormal}
There is an ancilla-free unitary \(U_h\) on \(A_h\) such that
\begin{equation}
U_h\mathcal N_{A_h}^{(h)}(\rho)U_h^\dagger
=
\rho\otimes
\frac{I_{2^{n_h-1}}}{2^{n_h-1}}.
\label{eq:treenormal}
\end{equation}
Every exact recovery channel on \(A_h\) is therefore the same channel
\[
\mathcal D_h=\Tr_{\mathrm{syndrome}}\Ad_{U_h},
\]
whose Choi rank is \(2^{n_h-1}\).
\end{lemma}

\begin{proof}
At \(h=1\), use \eqref{eq:normalform}.
For the induction, apply the three child unitaries without yet
measuring their syndrome factors.
Each child outputs its intermediate logical qubit tensored with
a maximally mixed syndrome independent of that qubit and every
reference. The three intermediate qubits have the root accessible
channel \(\mathcal N_A(\rho)\).
Apply \(U\) to them.
The root contributes two further maximally mixed syndrome qubits.
All syndrome factors are independent, giving
\eqref{eq:treenormal}.

The faithful-syndrome lemma proves uniqueness.
Partial trace over \(n_h-1\) qubits has exactly
\(2^{n_h-1}\) independent Kraus maps, and unitary precomposition
does not change this rank.
\end{proof}

This proof also establishes correctness when the intermediate
logical inputs are entangled with other nodes. No product-input
assumption is used.

\subsection{A declared module class}

Let
\[
m_h=\frac{3^h-1}{2}
\]
be the number of decoded nodes in the accessible ternary subtree.

\begin{definition}[Serial decoder-module class]
\label{def:moduleclass}
A node may use the batch programme \(U\), or the streaming programme
of Theorem~\ref{thm:streamupper}.
For an internal node:
\begin{enumerate}[label=\textup{(\roman*)}]
\item child subprogrammes execute serially in order \(1,2,3\);
\item a completed child returns one intermediate quantum qubit
to its parent, retained in the same laboratory;
\item a parent may consume its first two intermediate qubits
using its early two-input streaming stage;
\item the parent performs its final one-input stage only after
child 3 has completed;
\item subprogrammes are not otherwise interleaved, and no
intermediate quantum output is exported.
\end{enumerate}
All child syndrome outcomes may be forgotten after their corrections.
Parent record bits are retained until the parent correction.
\end{definition}

\begin{theorem}[Tree compilation and module-optimal streaming peak]
\label{thm:tree}
For every \(h\ge1\):
\begin{enumerate}[label=\textup{(\roman*)}]
\item batch recovery has optimal peak \(3^h\), with no additional
workspace, and an explicit implementation with
\[
G=9m_h,\qquad D\le8h;
\]
\item the serial streaming module class has optimal peak
\[
Q_{\mathrm{module}}^{(h)}=h+1,
\]
with an implementation satisfying
\[
G\le7m_h,\qquad D\le8m_h,\qquad
C_{\mathrm{cl}}\le2h;
\]
\item both implement the same channel \(\mathcal D_h\).
\end{enumerate}
All programmes consume \(n_h-1\) syndrome qubits and return one
quantum output.
\end{theorem}

\begin{proof}
For batch input, decode all child nodes at one level in parallel,
measure their syndrome factors, and continue upward.
There are \(m_h\) decoded nodes and \(h\) levels.
Every node uses nine gates and at most eight rounds.
Occupancy decreases after each local syndrome readout and never
exceeds the initial \(3^h\).
The initial batch occupancy proves optimality.

For streaming, let \(p_h\) be the peak in the prescribed module
class. The base optimum is \(p_1=2\) by
Theorem~\ref{thm:B5}.
Decode child 1, retaining its output.
Decode child 2 while retaining that one qubit; this costs
at most \(p_{h-1}+1\).
Perform the parent's early two-qubit stage and consume those
two intermediate inputs, retaining only two classical bits.
Decode child 3 with no other parent quantum register live.
Apply the parent's late stage.
Thus
\[
p_h\le p_{h-1}+1=h+1.
\]

For the matching module lower bound, the first child's quantum
output must remain live until the second child has returned its
output: neither allowed parent programme consumes a single first
input alone. The serial second-child subprogramme requires at least
\(p_{h-1}\) live qubits on one of its histories.
The retained first output is an additional qubit.
Therefore \(p_h\ge p_{h-1}+1\).
This is a lower bound within Definition~\ref{def:moduleclass},
not among all possible decoders.

Every decoded node uses at most seven unitary gates and eight
instruction rounds in the serial construction.
At most two record bits per ancestor are retained, giving
\(2h\).
Each local recovery is a channel identity on its logical input,
including all reference systems, so composition proves recovery.
Lemma~\ref{lem:treenormal} identifies both programmes with
\(\mathcal D_h\).
\end{proof}

For the twenty-five-leaf, nine-accessible-leaf patch:
\begin{center}
\begin{tabular}{@{}lrrrr@{}}
\toprule
Programme & Peak & Gate bound & Depth bound & Record-bit bound\\
\midrule
Batch, levelwise & 9 & 36 & 16 & 8\\
Streaming, modular & 3 & 28 & 32 & 4\\
Retained-coherent streaming & 9 & 36 & 16 & 8\\
\bottomrule
\end{tabular}
\end{center}
The batch record bound allows all local syndrome records to be retained;
forgetting them earlier can reduce classical storage.

\begin{corollary}[Same-task coherent/adaptive separation]
\label{cor:separation}
In the streaming model that forbids destruction of any delivered
carrier until all \(n_h\) have arrived, the optimal peak for
\(\mathcal D_h\) is \(n_h=3^h\).
The adaptive module construction implements that same channel
with peak \(h+1\).
\end{corollary}

\begin{proof}
The retained-coherent convention forces all input carriers to remain
live at the last arrival. The unitary \(U_h\) and terminal syndrome
readout attain that peak.
The adaptive bound is Theorem~\ref{thm:tree}.
Channel uniqueness prevents a change of the off-code task.
\end{proof}

The unrestricted adaptive streaming optimum for \(h>1\) is not
determined by the module lower bound.

\subsection{A general finite scheduling recurrence}

\begin{definition}[Decoder decomposition and frontier]
\label{def:frontier}
A declared decomposition is a finite acyclic collection of modules.
Module \(v\) consumes \(i_v\) named input qubits, produces \(o_v\)
named output qubits, and has a certified local peak \(c_v\).
Classical dependencies are specified separately.
There is no quantum fanout.

For a legal completed-module set \(J\) and delivered input prefix
\(k\), let \(F(J,k)\) be the live quantum frontier.
Executing an enabled module has laboratory peak at most
\[
\abs{F(J,k)}-i_v+c_v
\]
and replaces its input names by its output names.
A delivery increases the frontier by one.
\end{definition}

\begin{theorem}[B4: exact optimization of a declared schedule class]
\label{thm:B4}
The least certified frontier bound over all legal schedules of a
finite declared decomposition is obtained by the recurrence
\[
B(J,k)=
\min_{\text{legal next actions }a}
\max\{w(J,k,a),B(J',k')\},
\]
with terminal value \(\abs{F(J,k)}\).
Here \(w\) is the module peak in
Definition~\ref{def:frontier}, or \(\abs F+1\) for a delivery.

The recurrence is a finite search and proves schedule optimality
within that decomposition.
\end{theorem}

\begin{proof}
Each action increases the delivered prefix or completed-module set.
There are finitely many states and no cycle in the recurrence.
For a fixed first action, the overall bound is the maximum of its
local peak and the optimal remaining bound.
Minimizing over all legal first actions exhausts all schedules.
Backward induction proves the formula.
\end{proof}

Memory optimization for multi-step quantum strategies is an established
subject; classical memory and global consistency matter
\cite{Bisio}.
Our frontier recurrence instead optimizes named-register schedules of
a fixed compiled decomposition. It does not identify this restricted
quantity with the unrestricted memory cost of a quantum strategy.

%=====================================================================
\section{Approximate recovery and implementation error}
\label{sec:approx}
%=====================================================================

\begin{theorem}[B6: compatible half-diamond error budgets]
\label{thm:B6}
Suppose an ideal decoder satisfies
\[
d_\diamond(\mathcal D\mathcal N_A,\Tr_b)
\le\varepsilon_{\mathrm{rec}},
\]
and its implementation satisfies
\[
d_\diamond(\widetilde{\mathcal D},\mathcal D)
\le\varepsilon_{\mathrm{impl}}.
\]
Then
\[
d_\diamond(
\widetilde{\mathcal D}\mathcal N_A,\Tr_b)
\le
\varepsilon_{\mathrm{rec}}+\varepsilon_{\mathrm{impl}}.
\]

If a finite implementation is a composition of complete channels
\(\Phi_m\cdots\Phi_1\), with corresponding implementations
\(\widetilde\Phi_j\) and local errors
\(d_\diamond(\widetilde\Phi_j,\Phi_j)\le\delta_j\), then
\[
d_\diamond(
\widetilde\Phi_m\cdots\widetilde\Phi_1,
\Phi_m\cdots\Phi_1)
\le\sum_{j=1}^m\delta_j.
\]
\end{theorem}

\begin{proof}
CPTP pre- and postcomposition contract the diamond distance.
Apply the triangle inequality to
\[
\widetilde{\mathcal D}\mathcal N_A-\Tr_b
=
(\widetilde{\mathcal D}-\mathcal D)\mathcal N_A
+
(\mathcal D\mathcal N_A-\Tr_b).
\]
For the second statement, telescope the channel products, replacing
one factor at a time. Each intervening channel has diamond norm one.
The sum of the resulting bounds is the displayed expression.
\end{proof}

For adaptive programmes, include the classical history register in
each complete channel. A controlled operation is blockwise on that
classical register; a uniform bound over its possible histories
bounds the controlled step. No postselected normalization is used.

If
\[
\min_{\abs z=1}\norm{\widetilde U-zU}_\infty\le\eta,
\]
then
\(d_\diamond(\Ad_{\widetilde U},\Ad_U)\le\eta\).
Indeed, expanding
\(\widetilde U X\widetilde U^\dagger-UXU^\dagger\)
into two terms bounds its trace norm by \(2\eta\norm X_1\),
also after tensoring a reference.

For the streaming tree, a uniform elementary-gate error \(\delta_g\)
and destructive single-qubit-readout error \(\delta_m\) give
\[
\varepsilon_{\mathrm{impl}}
\le
7m_h\delta_g+(3^h-1)\delta_m.
\]
An error in the supplied encoding/access channel can be added in
the same half-diamond metric.

Approximate-QEC and universal-recovery results motivate possible
choices of \(\mathcal D\) \cite{BenyApprox,Cotler}.
No state-specific recovery guarantee is silently promoted here to
a worst-case diamond bound.

%=====================================================================
\section{Resource-constrained reconstruction regions}
\label{sec:region}
%=====================================================================

\begin{definition}[Resource-constrained executability region]
Fix an encoding, a collection of target subsystems, an access
interface, and an implementation library. Define
\[
\Wrec_{N,\Lib}^{\varepsilon}(A)
=
\set{a:Q^*_{\Lib}(A,a,\varepsilon)\le N}.
\]
This is a region of executable recovery tasks under the specified
budget. It is not automatically an entanglement wedge.
\end{definition}

Proposition~\ref{prop:B2} gives monotonicity in budget, error
tolerance, and library inclusion.

For the single-block target and authorized triple:
\[
a\notin
\Wrec_{1,\Lib_{\mathrm{Cl}},\mathrm{stream}}^0(A),
\qquad
a\in
\Wrec_{2,\Lib_{\mathrm{Cl}},\mathrm{stream}}^0(A).
\]
The first statement is a genuine lower bound from
Theorem~\ref{thm:B5}, not the failure of one proposed decoder.

For batch access:
\[
Q^*_{\mathrm{batch}}(\{1,2,3\},a,0)=3,
\qquad
Q^*_{\mathrm{batch}}(\{1,2,3,4\},a,0)=4.
\]
For the second equality, destructively consume qubit 4 without
reporting its outcome, then apply the triple decoder.
The resulting unconditioned channel is the partial trace over 4
followed by \(\mathcal D\).
The initial occupancy proves the lower bound.

The code-theoretic \emph{price} of a logical algebra concerns the
smallest physical support for its representatives
\cite{PastawskiPreskill}.
For this block the full logical-qubit price is three.
Our execution cost additionally specifies delivery, output,
workspace, schedule, and operations.
The streaming optimum two therefore does not change the algebraic
price or contradict its support bound.

%=====================================================================
\section{Distributed reconstruction with a specified link service}
\label{sec:distributed}
%=====================================================================

This section is an extension of, not a premise for, the local results.

Alice holds positions \(1,2\); Bob holds position \(3\), where the
logical output is required.
They may perform arbitrary local operations.
There is no auxiliary shared entanglement, no quantum transfer, and
no Bob-to-Alice message.
Alice consumes her two input qubits and sends one classical message
to Bob. Timing is not a free communication channel.

The streaming programme already gives a distributed decoder:
Alice applies \(B_{12}\), reads \((t,s)\), and sends those two bits.
Bob applies \(R_3,C_{ts}\) and returns position 3.

\begin{theorem}[Exact one-way classical communication cost]
\label{thm:communication}
In the stated one-way implementation model, exact recovery requires
at least four distinguishable messages, hence at least two fixed-length
classical bits. The distributed programme above attains the bound.
\end{theorem}

\begin{proof}
By Theorem~\ref{thm:B3}, any exact code recovery must implement
\(\mathcal D\) on the entire three-qubit input space.
A minimum Kraus family is
\[
K_j=
C_jR_3(\bra{\beta_j}_{12}\otimes I_3),
\qquad j=(t,s).
\]
The four \(\beta_j\) are an orthonormal basis, and the four
\(C_jR_3\) are nonproportional unitaries.

A one-way protocol has a POVM effect \(E_m\) for each message
and a Bob channel with Kraus operators \(B_{m\ell}\).
Diagonalize \(E_m=\sum_r\ketbra{\eta_{mr}}{\eta_{mr}}\).
The full channel has product-form Kraus maps
\[
B_{m\ell}(\bra{\eta_{mr}}\otimes I_3).
\]
Every such Kraus map lies in the span of the four \(K_j\):
the Choi operator is a positive sum of its Kraus-vector projectors,
so no vector can have a component outside its support.

Expand
\(\bra{\eta}=\sum_j a_j\bra{\beta_j}\).
Membership of a nonzero product map \(B\bra\eta\) in that span
requires
\[
a_jB=c_jC_jR_3
\]
for every \(j\). If two coefficients \(a_j\) were nonzero, two
distinct correction unitaries would be proportional, which they
are not. Thus each nonzero \(\eta\) is supported on one basis
vector \(\beta_j\).

For one fixed message, the same nonzero Bob Kraus operator cannot
serve two distinct basis vectors. Hence each nonzero \(E_m\) is
supported on one \(\beta_j\).
POVM completeness requires all four basis directions.
There must therefore be at least four messages.
The two-bit construction is complete and correct by
Theorem~\ref{thm:streamupper}.
\end{proof}

\subsection{What geometric cut counters can now mean}

Suppose an identified link has the following operational service:
after legal activation, it transmits \emph{one classical bit once}
in its prepared orientation and is then deleted.
A latent link activates at most once.
An initially active link also has at most one unspent service.
No such link transfers a qubit or supplies entanglement.

Let \(\sigma_{A\mid B}\) count crossing latent and active identifiers,
as in En02-A.
The number of one-bit services across the cut is at most its initial
value: activation converts one unspent latent service into one active
service; transmission consumes it; no update adds an identifier.

\begin{corollary}[A service-priced cut obstruction]
In the one-way model of Theorem~\ref{thm:communication}, if each
crossing link supplies only the one-bit service above and
\(\sigma_{A\mid B}(g_0)<2\), exact recovery is impossible.
\end{corollary}

\begin{proof}
The grammar permits fewer than two transmitted bits, while
Theorem~\ref{thm:communication} requires at least two.
\end{proof}

An unpriced identified edge would not support this corollary.
The statement depends on the service, orientation, consumption,
and communication conventions. It is not a gravitational causal
or Noether identity.

%=====================================================================
\section{Conditional transfer to an unknown-strategy model}
\label{sec:conditional}
%=====================================================================

The preceding proofs use specified Born readout and its projective
residuals. They do not solve En02-A's unrestricted finite-capacity
measurement-uniqueness problem.

A sufficient conditional transfer can nevertheless be stated.

\begin{proposition}[Conditional semantics transfer]
\label{prop:transfer}
Purify the complete finite decoder experiment, including undelivered
carriers, inaccessible boundary systems, and its reference.
Suppose it is represented inside En02-A's global structural class
at capacity \(N_{\mathrm{glob}}\), with its admissibility requirements
and global diagonal faithfulness.

If every actual readout of \(s\) qubits, on a global configuration
of \(g\) live qubits, satisfies
\[
g+s\le N_{\mathrm{glob}},
\]
then the decoder's histories and quantum outputs agree with the
specified Born programme.
\end{proposition}

\begin{proof}
En02-A's global diagonal-faithfulness theorem identifies all outcome
laws. Its continuation-record corollary identifies positive
projective residual rays whenever the displayed record budget fits.
Apply these statements at each actual readout.
Gates and allocations already have the specified meanings.
Induction over the finite instruction tree gives the same branch
weights and residuals as the Born execution.
Zero branches contribute nothing.
\end{proof}

The count \(N_{\mathrm{glob}}\) is not the local decoder peak.
For example, a Bell-purified single-block input has six global qubits
before decoding: five physical code qubits and one reference.
A two-qubit record comparison can require eight global slots even
when the streaming laboratory peak is two.
Arbitrary larger references require their own global accounting.

%=====================================================================
\section{Certificate boundaries, negative tests, and open problems}
\label{sec:status}
%=====================================================================

\subsection{Four separate artefacts}

\begin{center}
\small
\begin{tabular}{@{}p{0.27\linewidth}p{0.63\linewidth}@{}}
\toprule
Artefact & What it establishes or checks\\
\midrule
Exact code specification
& Stabilizer projector, logical conventions, low-weight privacy,
and the six-leg perfect state\\
Decoder certificate
& Pauli intertwiners and exact branch factorizations, determining
logical-reference recovery\\
Occupancy ledger
& Legal live names, consumed syndrome registers, returned output,
and branchwise peak\\
Schedule explorer
& Minimum frontier bound in the declared finite module decomposition\\
\bottomrule
\end{tabular}
\end{center}

The mathematical proofs are in the main text.
The appendix supplies exact finite checks of selected certificates
and a complete finite search of one specified schedule class.
Neither its success nor its failure certifies statements outside
that scope.

\subsection{Negative tests with analytic reasons}

\begin{enumerate}[label=\textup{(\roman*)},leftmargin=*]
\item \textbf{Unauthorized recovery.}
For two-qubit access, the channel is constant and its best logical
half-diamond error is \(3/4\).

\item \textbf{Uncounted workspace.}
A module's local peak must be added to the unaffected frontier.
Counting only its returned output omits its live input or ancilla.

\item \textbf{Premature destructive readout.}
Measuring \(Z_1\) before applying the batch decoder removes the
logical \(Z\) and \(Y\) components because their representatives
anticommute with \(Z_1\). Logical \(X\) survives.
The induced logical channel is \(X\)-dephasing, not recovery.

\item \textbf{Readout substituted for quantum recovery.}
The programme of Proposition~\ref{prop:observable} correctly realizes
a logical measurement instrument. Its unreported logical output is
dephased and fails the identity task on a Bell input.

\item \textbf{Hidden postselection.}
Keeping one syndrome branch retains probability \(1/4\).
Its selective logical map is \(\rho\mapsto\rho/4\), not a
trace-preserving decoder. Renormalization does not make it
deterministic.

\item \textbf{Off-code rank used as an intrinsic obstruction.}
Example~\ref{ex:offcode} gives correct restricted decoders with
different Choi ranks. Only the faithful-syndrome uniqueness theorem
justifies an intrinsic rank claim in our benchmark.
\end{enumerate}

\subsection{What remains open}

\begin{openproblem}[Unrestricted tree streaming optimum]
For \(h>1\), determine the minimum peak among all exact streaming
programmes for \(\mathcal D_h\), allowing interleavings outside
Definition~\ref{def:moduleclass}.
The module optimum \(h+1\) is an upper bound for this larger class,
not its proved lower bound.
\end{openproblem}

\begin{openproblem}[Locality, precision, and approximate schedules]
For an explicitly embedded multi-tensor network and a local,
precision-limited gate library, determine gate, depth, communication,
and memory trade-offs with a certified diamond-error target.
The all-to-all Clifford results do not solve this problem.
\end{openproblem}

\begin{remark}[Retained physical and evidential boundaries]
This paper does not identify an entanglement wedge, derive spacetime,
model black-hole evaporation, or prove a universal gravitational
memory bound.
No field-theoretic insertion or symmetry status in another manuscript
is changed. In particular, no closing of O.1, restoration of bulk
symmetry, release of a frozen insertion, or opening of XV-B is claimed.

The gate translations here are mathematical programme constructions.
No external package compilation, laboratory implementation, local
LaTeX compilation, or formal proof-checker execution is asserted.
A finite test is evidence for its stated finite assertion, not a
certificate of a larger quantified claim.
\end{remark}

%=====================================================================
\appendix
\section{Exact finite checks and a schedule explorer}
\label{app:checks}
%=====================================================================

Copy the following standard-library Python source to
\code{en02_b_checks.py} and run:
\begin{ShellBlock}
python en02_b_checks.py
\end{ShellBlock}

The code uses Gaussian integers, represented by pairs of integers.
Hadamards are applied without their \(1/\sqrt2\) factors, and those
factors are accounted for explicitly in the checked norms.
There is no floating-point state simulation.

The checks cover the supplied code projector, all physical Pauli
operators of weight at most two, the batch and streaming branch
factorizations, and a finite two-level schedule class.
The tree channel theorem itself follows by composition in the main
text; no dense twenty-five-qubit simulation is needed or claimed.

\begin{CodeBlock}
"""En02-B: exact finite checks, not a universal proof certificate.

Standard library only. Gaussian integers are pairs (real, imag).
No execution log is supplied by the manuscript.
"""

from itertools import combinations, product
from functools import lru_cache
from dataclasses import dataclass


class CheckFailure(Exception):
    pass


def need(condition, message):
    if not condition:
        raise CheckFailure(message)


ZERO = (0, 0)
ONE = (1, 0)
II = (0, 1)


def add(a, b):
    return (a[0] + b[0], a[1] + b[1])


def neg(a):
    return (-a[0], -a[1])


def mul(a, b):
    return (a[0] * b[0] - a[1] * b[1],
            a[0] * b[1] + a[1] * b[0])


def conj(a):
    return (a[0], -a[1])


def norm_sq(a):
    return a[0] * a[0] + a[1] * a[1]


def inner(v, w):
    out = ZERO
    for a, b in zip(v, w):
        out = add(out, mul(conj(a), b))
    return out


def vadd(v, w):
    return [add(a, b) for a, b in zip(v, w)]


def bits(index, n):
    return tuple((index >> (n - 1 - j)) & 1 for j in range(n))


def index_of(bs):
    out = 0
    for b in bs:
        out = 2 * out + b
    return out


def nqubits(v):
    size = len(v)
    need(size >= 1 and (size & (size - 1)) == 0,
         "state size is not a power of two")
    return size.bit_length() - 1


def pauli_action(v, word, phase=0):
    """Apply i**phase times a Pauli word exactly."""
    n = nqubits(v)
    need(len(word) == n, "wrong Pauli arity")
    units = (ONE, II, (-1, 0), (0, -1))
    out = [ZERO] * len(v)
    for k, amp in enumerate(v):
        bs = list(bits(k, n))
        factor = units[phase % 4]
        for j, letter in enumerate(word):
            b = bs[j]
            if letter == "X":
                bs[j] ^= 1
            elif letter == "Z":
                if b:
                    factor = neg(factor)
            elif letter == "Y":
                factor = mul(factor, II if b == 0 else (0, -1))
                bs[j] ^= 1
            elif letter != "I":
                raise CheckFailure("invalid Pauli letter")
        target = index_of(bs)
        out[target] = add(out[target], mul(factor, amp))
    return out


LOCAL_PRODUCT = {
    ("X", "Y"): (1, "Z"), ("Y", "Z"): (1, "X"),
    ("Z", "X"): (1, "Y"), ("Y", "X"): (3, "Z"),
    ("Z", "Y"): (3, "X"), ("X", "Z"): (3, "Y"),
}


def multiply_paulis(a, b):
    pa, wa = a
    pb, wb = b
    need(len(wa) == len(wb), "Pauli lengths differ")
    phase = (pa + pb) % 4
    word = []
    for x, y in zip(wa, wb):
        if x == "I":
            word.append(y)
        elif y == "I":
            word.append(x)
        elif x == y:
            word.append("I")
        else:
            p, z = LOCAL_PRODUCT[x, y]
            phase = (phase + p) % 4
            word.append(z)
    return phase, "".join(word)


GENERATORS = ("XZZXI", "IXZZX", "XIXZZ", "ZXIXZ")


def stabilizer_group():
    out = []
    for selected in product((0, 1), repeat=4):
        p = (0, "IIIII")
        for use, word in zip(selected, GENERATORS):
            if use:
                p = multiply_paulis(p, (0, word))
        out.append(p)
    need(len(set(out)) == 16, "stabilizers are dependent")
    need((2, "IIIII") not in out, "minus identity is a stabilizer")
    for phase, word in out:
        need(phase in (0, 2), "stabilizer is not Hermitian")
        if word != "IIIII":
            need(sum(x != "I" for x in word) == 4,
                 "nonidentity stabilizer is not weight four")
    return tuple(out)


def encoded_integer_vectors():
    """True code vectors are these Gaussian-integer vectors / 4."""
    v = [ZERO] * 32
    v[0] = ONE
    for g in GENERATORS:
        v = vadd(v, pauli_action(v, g))
    w = pauli_action(v, "XXXXX")
    need(inner(v, v) == (16, 0), "wrong code-zero norm")
    need(inner(w, w) == (16, 0), "wrong code-one norm")
    need(inner(v, w) == ZERO, "codewords not orthogonal")
    need(pauli_action(v, "ZZZZZ") == v, "wrong logical Z zero")
    need(pauli_action(w, "ZZZZZ") == [neg(x) for x in w],
         "wrong logical Z one")
    for g in GENERATORS:
        need(pauli_action(v, g) == v, "zero not stabilized")
        need(pauli_action(w, g) == w, "one not stabilized")
    return v, w


def apply_gate(v, gate):
    """H is unnormalized: the omitted factor is 1/sqrt(2)."""
    n = nqubits(v)
    kind = gate[0]
    if kind in ("X", "Y", "Z"):
        q = gate[1]
        word = ["I"] * n
        word[q] = kind
        return pauli_action(v, "".join(word))

    out = [ZERO] * len(v)
    if kind == "H":
        q = gate[1]
        for k, amp in enumerate(v):
            bs = list(bits(k, n))
            old = bs[q]
            for new in (0, 1):
                bs[q] = new
                term = neg(amp) if old == 1 and new == 1 else amp
                target = index_of(bs)
                out[target] = add(out[target], term)
        return out

    if kind == "SD":
        q = gate[1]
        for k, amp in enumerate(v):
            out[k] = mul(amp, (0, -1)) if bits(k, n)[q] else amp
        return out

    if kind in ("CX", "CZ"):
        q, r = gate[1], gate[2]
        for k, amp in enumerate(v):
            bs = list(bits(k, n))
            if kind == "CX":
                if bs[q]:
                    bs[r] ^= 1
                out[index_of(bs)] = amp
            else:
                out[k] = neg(amp) if bs[q] and bs[r] else amp
        return out

    raise CheckFailure("unknown gate")


def apply_circuit(v, gates):
    out = list(v)
    h_count = 0
    for gate in gates:
        out = apply_gate(out, gate)
        h_count += gate[0] == "H"
    return out, h_count


BATCH = (
    ("CZ", 0, 1), ("CZ", 1, 2),
    ("SD", 0), ("SD", 2),
    ("H", 0), ("H", 2),
    ("CX", 0, 1), ("CX", 2, 1),
    ("Y", 1),
)

EARLY = (
    ("H", 1), ("CX", 0, 1), ("SD", 0), ("H", 0),
)


def select_coordinates(v, fixed, survivors):
    """Unnormalized bra projection and factor deletion."""
    n = nqubits(v)
    need(set(fixed).isdisjoint(survivors),
         "fixed and surviving positions overlap")
    need(set(fixed) | set(survivors) == set(range(n)),
         "coordinates are not completely accounted for")
    out = [ZERO] * (1 << len(survivors))
    for k, amp in enumerate(v):
        bs = bits(k, n)
        if all(bs[j] == b for j, b in fixed.items()):
            out[index_of(tuple(bs[j] for j in survivors))] = amp
    return out


def check_low_weight_privacy(code):
    v0, v1 = code
    for weight in (1, 2):
        for sites in combinations(range(5), weight):
            for letters in product("XYZ", repeat=weight):
                word = ["I"] * 5
                for q, letter in zip(sites, letters):
                    word[q] = letter
                images = [pauli_action(v, "".join(word)) for v in code]
                for i in (0, 1):
                    for j in (0, 1):
                        need(inner(code[i], images[j]) == ZERO,
                             "low-weight logical compression is nonzero")


def check_batch_certificate(code):
    decoded = []
    for v in code:
        out, h_count = apply_circuit(v, BATCH)
        need(h_count == 2, "batch Hadamard count changed")
        decoded.append(out)

    chi0 = select_coordinates(decoded[0], {1: 0}, (0, 2, 3, 4))
    chi1 = select_coordinates(decoded[1], {1: 1}, (0, 2, 3, 4))
    wrong0 = select_coordinates(decoded[0], {1: 1}, (0, 2, 3, 4))
    wrong1 = select_coordinates(decoded[1], {1: 0}, (0, 2, 3, 4))

    need(all(x == ZERO for x in wrong0 + wrong1),
         "batch decoder mixes logical basis values")
    need(chi0 == chi1, "batch decoder loses logical coherence")
    # True chi is chi0 / (4 * sqrt(2)**2) = chi0 / 8.
    need(inner(chi0, chi0) == (64, 0), "wrong decoded norm")

    # Syndrome positions are the first two coordinates of chi.
    for f in range(4):
        for g in range(4):
            value = ZERO
            for e in range(4):
                value = add(value,
                            mul(chi0[4 * f + e],
                                conj(chi0[4 * g + e])))
            expected = (16, 0) if f == g else ZERO
            need(value == expected, "syndrome is not I_4/4")

    # A single syndrome branch has probability 16/64 = 1/4.
    need(sum(norm_sq(x) for x in chi0[:4]) == 16,
         "postselection probability certificate failed")


def check_stream_certificate(code):
    early = [apply_circuit(v, EARLY) for v in code]
    need(all(h == 2 for _, h in early), "early H count changed")

    for t, s in product((0, 1), repeat=2):
        branch_vectors = []
        for raw, _ in early:
            # Remaining order: physical 3, physical 4, physical 5.
            branch = select_coordinates(raw, {0: t, 1: s}, (2, 3, 4))
            branch, late_h = apply_circuit(
                branch, (("SD", 0), ("H", 0))
            )
            need(late_h == 1, "late H count changed")
            # Apply Z^(1-s), then X^(1-t).
            # This equals the manuscript's product up to branch phase.
            if 1 - s:
                branch = apply_gate(branch, ("Z", 0))
            if 1 - t:
                branch = apply_gate(branch, ("X", 0))
            branch_vectors.append(branch)

        c0 = select_coordinates(branch_vectors[0], {0: 0}, (1, 2))
        c1 = select_coordinates(branch_vectors[1], {0: 1}, (1, 2))
        w0 = select_coordinates(branch_vectors[0], {0: 1}, (1, 2))
        w1 = select_coordinates(branch_vectors[1], {0: 0}, (1, 2))
        need(all(x == ZERO for x in w0 + w1),
             "streaming branch has wrong logical output")
        need(c0 == c1, "streaming branch loses coherence")

        # True branch vector is raw / (4 * sqrt(2)**3).
        # Squared denominator is 16 * 8 = 128.
        need(inner(c0, c0) == (32, 0),
             "streaming branch probability is not 1/4")


def check_npt_symbolic_certificate():
    # Ordered as output 0, input-reference 1,2,3.
    S1 = (2, "XZXZ")
    S3 = (2, "ZYZY")
    S2 = (0, "YXYX")
    need(multiply_paulis(S1, S3) == S2,
         "Choi stabilizer product is wrong")
    need(multiply_paulis(S3, S1) == S2,
         "Choi stabilizers do not commute")
    need(S1[1][1] == "Z" and S2[1][1] == "X"
         and S3[1][1] == "Y", "partial-transpose signs changed")
    # PT on input-reference position 1 changes only S3's sign.
    numerator = 1 + (-1) + (-1) * (+1) - (+1)
    need(numerator == -2, "negative eigenvalue certificate failed")
    # Eigenvalue = -2/16 = -1/8.


@dataclass(frozen=True)
class Module:
    name: str
    inputs: frozenset
    outputs: frozenset
    depends: frozenset
    peak: int


def optimize_schedule(arrivals, modules, batch=False):
    """Exact frontier optimization in this finite module class."""
    arrivals = tuple(arrivals)
    modules = tuple(modules)
    names = tuple(m.name for m in modules)
    need(len(names) == len(set(names)), "duplicate module name")
    by_name = {m.name: m for m in modules}
    need(all(m.peak >= max(len(m.inputs), len(m.outputs))
             for m in modules), "invalid module peak")

    def frontier(k, done):
        live = set(arrivals[:k])
        produced = set()
        consumed = set()
        for name in done:
            m = by_name[name]
            produced |= set(m.outputs)
            consumed |= set(m.inputs)
        return frozenset((live | produced) - consumed)

    @lru_cache(None)
    def solve(k, done):
        done = frozenset(done)
        live = frontier(k, done)
        if k == len(arrivals) and len(done) == len(modules):
            return len(live), ()

        choices = []
        if k < len(arrivals):
            tail, path = solve(k + 1, tuple(sorted(done)))
            choices.append((max(len(live) + 1, tail),
                            ("receive " + arrivals[k],) + path))

        for name, m in by_name.items():
            if name in done:
                continue
            if not m.depends <= done or not m.inputs <= live:
                continue
            next_done = tuple(sorted(done | {name}))
            tail, path = solve(k, next_done)
            local_peak = len(live) - len(m.inputs) + m.peak
            choices.append((max(local_peak, tail), (name,) + path))

        need(bool(choices), "decomposition is stuck")
        return min(choices, key=lambda x: (x[0], x[1]))

    start = len(arrivals) if batch else 0
    value, path = solve(start, ())
    return max(start, value), path


def stream_modules_one():
    return (
        Module("early", frozenset(("q1", "q2")), frozenset(),
               frozenset(), 2),
        Module("late", frozenset(("q3",)), frozenset(("out",)),
               frozenset(("early",)), 1),
    )


def stream_modules_two():
    modules = []
    arrivals = []
    for j in (1, 2, 3):
        q = tuple(f"q{j}{k}" for k in (1, 2, 3))
        arrivals.extend(q)
        early = f"early{j}"
        late = f"late{j}"
        modules.append(Module(
            early, frozenset(q[:2]), frozenset(), frozenset(), 2
        ))
        modules.append(Module(
            late, frozenset((q[2],)), frozenset((f"t{j}",)),
            frozenset((early,)), 1
        ))
    modules.append(Module(
        "root_early", frozenset(("t1", "t2")), frozenset(),
        frozenset(("late1", "late2")), 2
    ))
    modules.append(Module(
        "root_late", frozenset(("t3",)), frozenset(("out",)),
        frozenset(("root_early", "late3")), 1
    ))
    return tuple(arrivals), tuple(modules)


def batch_modules_two():
    modules = []
    arrivals = []
    for j in (1, 2, 3):
        q = tuple(f"q{j}{k}" for k in (1, 2, 3))
        arrivals.extend(q)
        modules.append(Module(
            f"decode{j}", frozenset(q), frozenset((f"t{j}",)),
            frozenset(), 3
        ))
    modules.append(Module(
        "root", frozenset(("t1", "t2", "t3")),
        frozenset(("out",)),
        frozenset(("decode1", "decode2", "decode3")), 3
    ))
    return tuple(arrivals), tuple(modules)


def check_schedules():
    q1, p1 = optimize_schedule(
        ("q1", "q2", "q3"), stream_modules_one()
    )
    need(q1 == 2, "wrong single-block module optimum")

    arrivals, modules = stream_modules_two()
    q2, p2 = optimize_schedule(arrivals, modules)
    need(q2 == 3, "wrong two-level streaming module optimum")

    arrivals_b, modules_b = batch_modules_two()
    qb, pb = optimize_schedule(arrivals_b, modules_b, batch=True)
    need(qb == 9, "batch input accounting was omitted")

    # Negative accounting check: one declared workspace qubit
    # raises a three-input module's peak from three to four.
    workspace_module = (
        Module("with_workspace", frozenset(("a", "b", "c")),
               frozenset(("out",)), frozenset(), 4),
    )
    qw, _ = optimize_schedule(
        ("a", "b", "c"), workspace_module, batch=True
    )
    need(qw == 4, "workspace was not counted")
    return {"single_stream": (q1, p1),
            "patch_stream": (q2, p2),
            "patch_batch": (qb, pb)}


def main():
    stabilizer_group()
    code = encoded_integer_vectors()
    check_low_weight_privacy(code)
    check_batch_certificate(code)
    check_stream_certificate(code)
    check_npt_symbolic_certificate()
    schedules = check_schedules()
    print("Exact finite code and decoder checks: PASS")
    print("Declared finite schedule-class optima:", schedules)
    print("A pass is not a universal or formal proof certificate.")


if __name__ == "__main__":
    main()
\end{CodeBlock}

\section{Independent certificate checklist}
\label{app:checklist}

A submission or implementation archive should keep the following
objects separate.

\begin{enumerate}[label=\textup{(\arabic*)},leftmargin=*]
\item \textbf{Encoding convention.}
The four generators, logical \(X,Z\), normalized vectors
\eqref{eq:encoding}, and physical factor order are fixed.
Changing a logical phase convention changes the required decoder
correction and must be recorded.

\item \textbf{Access certificate.}
The syndrome table proves all weight-one and weight-two compressions
vanish. The stabilizer support table proves the relevant maximally
mixed three-qubit reduction.

\item \textbf{Batch certificate.}
The gates in \eqref{eq:U} conjugate the supported logical Pauli pair
to the output Pauli pair.
The common environment vector in \eqref{eq:factor} certifies
coherence, not merely computational-basis probabilities.

\item \textbf{Streaming certificate.}
Both classical record bits are priced.
All four branch vectors have squared norm \(1/4\) and preserve the
same logical ray and its external reference.
All branches are summed.

\item \textbf{Lower-bound certificate.}
Faithful-syndrome uniqueness removes the off-code freedom.
The negative partial-transpose eigenvalue is \(-1/8\).
The one-live-qubit interface forces a separable first-input Choi cut.

\item \textbf{Tree certificate.}
Recovery identities are composed as channels with arbitrary
spectators. Local module cost and schedule optimality are distinct
from unrestricted recovery-channel optimality.

\item \textbf{Distributed certificate.}
A message is a classical service of declared capacity.
The four-message lower bound assumes the stated one-way model,
not arbitrary distributed assistance.

\item \textbf{Approximation certificate.}
Local implementation bounds refer to complete channels, including
classical registers, in a compatible half-diamond metric.
Selected-state numerical tests cannot replace those bounds.
\end{enumerate}

%=====================================================================
\section*{Declarations}
%=====================================================================

\paragraph{Competing interests.}
The author declares no competing interests.

\paragraph{Funding.}
No specific grant supported this work.

\paragraph{Author contribution.}
N.C.\ developed the resource model, mathematical constructions,
proofs, and computational specification, and prepared the manuscript.

\paragraph{Data and code availability.}
The exact code data, programmes, proof certificates, and standalone
finite-check source are included in this document.
No external execution log or formal verification certificate is
supplied.

\paragraph{Ethics and clinical studies.}
Not applicable.

%=====================================================================
\begin{thebibliography}{99}

\bibitem{ADH}
A.~Almheiri, X.~Dong, and D.~Harlow,
\emph{Bulk Locality and Quantum Error Correction in AdS/CFT},
Journal of High Energy Physics \textbf{2015}, 163 (2015).
arXiv:1411.7041.
\url{https://arxiv.org/abs/1411.7041}.

\bibitem{HaPPY}
F.~Pastawski, B.~Yoshida, D.~Harlow, and J.~Preskill,
\emph{Holographic quantum error-correcting codes:
Toy models for the bulk/boundary correspondence},
Journal of High Energy Physics \textbf{2015}, 149 (2015).
arXiv:1503.06237.
\url{https://arxiv.org/abs/1503.06237}.

\bibitem{Laflamme}
R.~Laflamme, C.~Miquel, J.~P.~Paz, and W.~H.~Zurek,
\emph{Perfect Quantum Error Correction Code},
Physical Review Letters \textbf{77}, 198--201 (1996).
arXiv:quant-ph/9602019.
\url{https://arxiv.org/abs/quant-ph/9602019}.

\bibitem{KL}
E.~Knill and R.~Laflamme,
\emph{A Theory of Quantum Error-Correcting Codes},
Physical Review A \textbf{55}, 900--911 (1997).
arXiv:quant-ph/9604034.
\url{https://arxiv.org/abs/quant-ph/9604034}.

\bibitem{BKK}
C.~B\'eny, A.~Kempf, and D.~W.~Kribs,
\emph{Quantum Error Correction of Observables},
Physical Review A \textbf{76}, 042303 (2007).
arXiv:0705.1574.
\url{https://arxiv.org/abs/0705.1574}.

\bibitem{BenyApprox}
C.~B\'eny,
\emph{Conditions for the approximate correction of algebras},
arXiv:0907.4207 (2009).
\url{https://arxiv.org/abs/0907.4207}.

\bibitem{Cotler}
J.~Cotler, P.~Hayden, G.~Penington, G.~Salton,
B.~Swingle, and M.~Walter,
\emph{Entanglement Wedge Reconstruction via Universal Recovery Channels},
Physical Review X \textbf{9}, 031011 (2019).
arXiv:1704.05839.
\url{https://arxiv.org/abs/1704.05839}.

\bibitem{Bisio}
A.~Bisio, G.~M.~D'Ariano, P.~Perinotti, and M.~Sedl\'ak,
\emph{Memory cost of quantum protocols},
Physical Review A \textbf{85}, 032333 (2012).
arXiv:1112.3853.
\url{https://arxiv.org/abs/1112.3853}.

\bibitem{PastawskiPreskill}
F.~Pastawski and J.~Preskill,
\emph{Code properties from holographic geometries},
Physical Review X \textbf{7}, 021022 (2017).
arXiv:1612.00017.
\url{https://arxiv.org/abs/1612.00017}.

\bibitem{Watrous}
J.~Watrous,
\emph{The Theory of Quantum Information},
Cambridge University Press, 2018.
Author's text:
\url{https://cs.uwaterloo.ca/~watrous/TQI/}.

\bibitem{En02A}
N.~Cheung,
\emph{En02-A: Finite-Resource Geometry for the Enter Calculus:
Cut Monotones, Certificate Costs, and Conditional Born Rigidity}.
Companion manuscript, \code{En02-A-v1.tex},
7 October 2026.
The capacity convention, conditional rigidity statements, and
one-shot implementation model are distinguished explicitly in the
present paper.

\bibitem{I}
N.~Cheung,
\emph{Born--L\"uders as the unique measurement strategy of a strictly
linear quantum \(\lambda\)-calculus: The Enter Calculus}.
Manuscript I, version 1.
Cited for its specified finite destructive-measurement interface
and the distinction between that semantics and characterization of
an unknown strategy.

\bibitem{XEnter}
N.~Cheung,
\emph{X-Enter}.
Manuscript, version 1.
Complete-history instrument and record-channel conventions:
\code{eq:instrument} and \code{eq:recordchannel}.
Its named four-live-qubit programme restriction is not used as a
decoder bound here.

\end{thebibliography}

\end{document}