\documentclass[11pt]{article} \usepackage[a4paper,margin=1in]{geometry} \usepackage{amsmath,amssymb,amsthm,mathtools} \usepackage[colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue]{hyperref} \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{corollary}[theorem]{Corollary} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \newcommand{\R}{\mathbb{R}} \newcommand{\Z}{\mathbb{Z}} \newcommand{\Q}{\mathbb{Q}} \newcommand{\norm}[1]{\lVert #1\rVert} \newcommand{\ninf}[1]{\lVert #1\rVert_\infty} \newcommand{\ip}[2]{\langle #1,#2\rangle} \newcommand{\relu}{\operatorname{ReLU}} \newcommand{\row}{\operatorname{row}} \newcommand{\adj}{\operatorname{adj}} \newcommand{\sgn}{\operatorname{sign}} \newcommand{\xc}{\operatorname{xc}} \newcommand{\vxc}{\operatorname{vxc}} \newcommand{\nnc}{\operatorname{nnc}} \newcommand{\poly}{\operatorname{poly}} \newcommand{\OPT}{\mathsf{OPT}} \newcommand{\DIR}{\mathsf{DIR}} \newcommand{\UNI}{\mathsf{UNI}} \newcommand{\fr}{\operatorname{frac}} \title{Exact polynomial-size ReLU networks\\ for maximum-weight matching} \author{Sayed Barez} \date{29 November 2026} \begin{document} \maketitle \begin{abstract} We prove that the value of a maximum-weight perfect matching, as a function of arbitrary real edge weights, is computed exactly by ReLU neural networks of polynomial size. The networks are constructed by a deterministic polynomial-time algorithm, have integer weights of polynomial bit length, use no biases, and are exact at every real input, including all ties. This holds for general graphs, for bipartite graphs (the assignment problem, i.e.\ the tropical permanent), and for maximum-weight matchings that need not be perfect. It answers the question of Black, Hertrich, Kober and Loho whether the support function of the matching polytope, or even of the Birkhoff polytope, has polynomial-size neural networks, and Problem~3 of Section~6.5 of Jukna's book on tropical circuits, which asks for polynomial-size $(\max,+,-)$-circuits for the assignment problem. As a consequence the perfect matching polytope of $K_n$ has polynomial virtual extension complexity, while its extension complexity is $2^{\Omega(n)}$ by Rothvoss's theorem. The matching statement is a special case of a general compiler. Let $F$ be a finite set of integer vectors with entries bounded by $B$ in absolute value. Every Boolean circuit of size $S$ that maximises linear objectives with polynomially many bits over $F$ is converted into a ReLU network of size polynomial in $S$, the dimension and $\log B$ that computes the support function $w\mapsto\max_{x\in F}\ip{w}{x}$ exactly on all of $\R^m$. \end{abstract} \section{Introduction} A ReLU network computes a continuous piecewise linear function, and every continuous piecewise linear function is computed by some ReLU network. The question of \emph{size} is the neural counterpart of circuit complexity: which functions that are easy to evaluate on a Turing machine have small networks? For linear optimisation problems the natural function is the support function \[ h_F(w)=\max_{x\in F}\ip{w}{x},\qquad w\in\R^m, \] of a finite set $F\subseteq\Z^m$ of feasible solutions. A network cannot branch and cannot test whether two real numbers are equal, since it computes a continuous function of its input and of every intermediate value. Classical combinatorial algorithms, such as Edmonds' matching algorithm, compare real numbers and branch on the outcome, so they do not translate into networks. Hertrich and Sering~\cite{HS} obtained polynomial-size networks for maximum flow by a different, branching-free algorithm. For matchings the question remained open. Hertrich and Loho~\cite{HL} related network size to polyhedral geometry. They defined the \emph{virtual extension complexity} $\vxc(P)$ of a polytope $P$ as the minimum of $\xc(Q)+\xc(R)$ over polytopes $Q,R$ with $P+Q=R$, and proved $\vxc(P)\le 4\,\nnc(P)$, where $\nnc(P)$ is the minimum size of a rank-2 maxout network computing the support function of $P$. Black, Hertrich, Kober and Loho~\cite{BHKL} proved that $\vxc$ can be exponentially smaller than $\xc$ and that almost all matroid base polytopes have exponential virtual extension complexity; they state that determining the virtual extension complexity of the matching polytopes is open, and that ``it remains an open question whether the support function of the matching polytope can be represented by polynomial size neural networks. This stronger question is even open for the support function of the Birkhoff polytope''. Hertrich and Stargalla~\cite{HSt} record the same question in circuit language: it is open whether there are $(\max,+,-)$-circuits or ReLU / maxout networks of polynomial size computing the support function of the Birkhoff polytope, which is Problem~3 in Section~6.5 of Jukna's book~\cite{Jukna}. This paper answers these questions in the affirmative. \subsection{Model} \begin{definition}\label{def:circuit} A \emph{ReLU circuit} on inputs $w_1,\dots,w_m$ is a sequence of gates $g_1,\dots,g_N$. Each gate is either a \emph{linear gate} $g=\sum_i c_i f_i$ with integers $c_i$ and each $f_i$ an input or an earlier gate, or a \emph{max gate} $g=\max(f,f')$ with $f,f'$ inputs or earlier gates. The last gate is the output. The \emph{size} of the circuit is the number of gates plus the total bit length of all coefficients $c_i$. \end{definition} Since $\max(f,f')=f+\relu(f'-f)$ and $\relu(f)=\max(f,f-f)$, a ReLU circuit is exactly a ReLU network with skip connections, integer weights and no biases, and its size bounds the number of neurons, the number of connections and the total bit length of the weights. A linear gate with coefficient $c$ can be replaced by $O(\log |c|)$ additions and subtractions by binary doubling, so a ReLU circuit of size $N$ is also a $(\max,+,-)$-circuit with $O(N)$ gates of fan-in two, without constants. Arranging the gates in layers and carrying values forward by units $\max(f,f)$ gives a rank-2 maxout network with at most $N(N+m)$ units. We write $\min(f,f')=f+f'-\max(f,f')$ and $|f|=\max(f,-f)$ freely. \subsection{Results} Throughout, $m\ge 1$ and $B\ge 1$ are integers, and $F\subseteq\Z^m\cap[-B,B]^m$ is finite and nonempty. Put \begin{equation}\label{eq:params} \begin{gathered} M=2mB,\qquad D_0=16(m+M+1),\qquad K=\bigl(2^{m+2}D_0\bigr)^{m+1},\\ P_0=K+1,\qquad \Lambda=2MP_0+1,\qquad \ell^\ast=\bigl\lceil \log_2\bigl(P_0\Lambda^{m}\bigr)\bigr\rceil . \end{gathered} \end{equation} Thus $\ell^\ast=O\bigl(m^3+m^2\log (mB)\bigr)$. \begin{definition} An \emph{optimiser for $F$} is a Boolean circuit $\OPT$ which, given an integer vector $c\in\Z^m$ with $\ninf{c}\le 2^{\ell^\ast}$ in binary, outputs the binary encoding of some $x\in F$ with $\ip{c}{x}=\max_{x'\in F}\ip{c}{x'}$. \end{definition} \begin{theorem}[Compiler]\label{thm:main} Let $F\subseteq\Z^m\cap[-B,B]^m$ be finite and nonempty, and let $\OPT$ be an optimiser for $F$ of size $S$. Then there is a ReLU circuit of size $(S+m+\log B)^{O(1)}$ that computes $h_F(w)$ exactly for every $w\in\R^m$. The circuit is produced from $\OPT$, $m$ and $B$ by a deterministic algorithm running in time polynomial in $S$, $m$ and $\log B$. \end{theorem} \begin{corollary}[Matching]\label{cor:matching} For every $n$ there are ReLU circuits of size $n^{O(1)}$, constructed in deterministic time $n^{O(1)}$, that compute exactly, for all real edge weights, \begin{enumerate} \item the maximum weight of a perfect matching of the complete bipartite graph $K_{n,n}$; \item the maximum weight of a perfect matching of the complete graph $K_{n}$, $n$ even; \item the maximum weight of a matching of $K_n$. \end{enumerate} The same holds for minimum weights, and for every fixed graph on $n$ vertices in place of the complete graph. \end{corollary} \begin{proof} Let $F$ be the set of incidence vectors of the matchings in question, so $B=1$ and $m\le n^2$. Maximum-weight (perfect) matching with integer weights of $\ell^\ast=n^{O(1)}$ bits is solved in polynomial time by the Hungarian method~\cite{Kuhn} in the bipartite case and by Edmonds' algorithm~\cite{Edmonds} in general. A polynomial-time algorithm on inputs of a fixed length is a Boolean circuit of polynomial size, produced in polynomial time. This is an optimiser of size $n^{O(1)}$, and Theorem~\ref{thm:main} applies. For minima use $\min_{x\in F}\ip{w}{x}= -h_F(-w)$. For a fixed graph $G$ take $F$ to be the matchings of $G$. \end{proof} \begin{corollary}[Tropical circuits with subtraction]\label{cor:tropical} The tropical permanent \[ w\ \mapsto\ \max_{\pi\in S_n}\sum_{i=1}^{n}w_{i,\pi(i)} \] is computed by $(\max,+,-)$-circuits of size $n^{O(1)}$ without constants. This solves Problem~3 of Section~6.5 of~\cite{Jukna}. \end{corollary} \begin{proof} Corollary~\ref{cor:matching}(1) and the conversion after Definition~\ref{def:circuit}. \end{proof} By Jerrum and Snir~\cite{JS}, $(\max,+)$-circuits for the tropical permanent need $2^{\Omega(n)}$ gates, and by Hertrich and Stargalla~\cite{HSt} the same holds when multiplication by positive scalars is added. Subtraction therefore reduces the complexity of the assignment problem from exponential to polynomial. \begin{corollary}[Virtual extension complexity]\label{cor:vxc} Let $P_n$ be the perfect matching polytope of $K_n$, $n$ even, and $M_n$ the matching polytope of $K_n$. Then \[ \nnc(P_n),\ \nnc(M_n),\ \vxc(P_n),\ \vxc(M_n)\ \le\ n^{O(1)},\qquad\text{while}\qquad \xc(P_n),\ \xc(M_n)\ \ge\ 2^{\Omega(n)} . \] \end{corollary} \begin{proof} The upper bounds on $\nnc$ follow from Corollary~\ref{cor:matching} and the conversion to rank-2 maxout networks after Definition~\ref{def:circuit}; the bounds on $\vxc$ follow from $\vxc(P)\le 4\nnc(P)$ \cite[Theorem~4.1]{HL}. The lower bounds are Rothvoss's theorem~\cite{Rothvoss}. \end{proof} Theorem~\ref{thm:main} applies far beyond matchings. Every family of $0/1$ or bounded-integer polytopes over which linear optimisation with integer objectives is in polynomial time has support functions with polynomial-size ReLU circuits: matroid intersection, $T$-joins, minimum-cost flows with integral data, and the stable set polytopes of perfect graphs, via the ellipsoid method~\cite{GLS}. In the last case no polynomial extended formulation is known. In the other direction, the theorem turns lower bounds on network size into lower bounds for Boolean circuits that optimise: by~\cite{BHKL}, almost every matroid on $n$ elements has $\nnc\ge 2^{\Omega(n)}$ for its base polytope, so no subexponential Boolean circuit maximises $\ell^\ast$-bit weights over its bases. \subsection{Idea of the proof} The network does not imitate a combinatorial algorithm on real numbers. It reduces the real objective to a short sequence of \emph{integer} objectives and runs the Boolean optimiser on those, inside the network. \emph{Short integer directions.} A real objective $w$ is replaced by an integer vector $p_1$ of polynomially many bits that orders every pair of feasible points the same way as $w$, unless $p_1$ sees a tie. This is simultaneous Diophantine approximation, as in the weight reduction of Frank and Tardos~\cite{FT}. Ties under $p_1$ are resolved by a second direction $p_2$ that approximates the component of $w$ orthogonal to $p_1$, and so on; after at most $m$ directions the lexicographic maximiser of $(\ip{p_1}{x},\ip{p_2}{x},\dots)$ is a maximiser of $\ip{w}{x}$. \emph{Scale.} The component of $w$ orthogonal to $p_1,\dots,p_j$ can be arbitrarily small compared with $w$, and the network cannot divide by its norm. We represent a bit $b$ by the real number $b\cdot s$, where $s$ is the norm of the current residual. Boolean logic on such scaled bits needs only $\min$, $\max$ and subtraction from $s$, and the product of a scaled bit with any real number of size $O(s)$ is one $\min$. Everything is positively homogeneous, so when the residual vanishes all later stages add exactly zero. \emph{Accumulation.} The value $\ip{w}{x^\ast}$ of the optimiser's output cannot be formed directly, because $w$ is not small compared with the current scale. We accumulate it stage by stage in changing unimodular coordinate systems, so that every real number that is ever multiplied by a bit is bounded by the current scale. \emph{Rounding.} Converting a real number to bits is discontinuous, so any continuous rounding gate is wrong near the integers. We run the whole network with $2m^2+1$ different rounding shifts in geometric progression with a very large ratio and output the median. A structural lemma on the values of bounded integer linear forms at a real point shows that, at every input, at most $m^2$ shifts ever come near a rounding boundary. \section{Scaled bits}\label{sec:bits} Let $s\ge 0$ be a real number carried by a wire. A \emph{scaled bit at scale $s$} is a wire whose value is $0$ or $s$; for $s>0$ it encodes the bit $0$ or $1$. A scaled integer is a tuple of scaled bits (a sign and a magnitude in binary). \begin{lemma}[Boolean logic]\label{lem:logic} Let $\Phi$ be a Boolean circuit with $a$ inputs and size $S$. There is a ReLU circuit of size $O(S)$ which, given $s\ge 0$ and scaled bits $\beta_1,\dots,\beta_a$ at scale $s$, outputs scaled bits at scale $s$ which for $s>0$ encode $\Phi$ applied to the encoded input. For $s=0$ all its wires are $0$. \end{lemma} \begin{proof} Replace $\mathrm{AND}$ by $\min$, $\mathrm{OR}$ by $\max$, $\mathrm{NOT}\,\beta$ by $s-\beta$, the constant $1$ by $s$ and the constant $0$ by $s-s$. On values in $\{0,s\}$ these gates return the correct values in $\{0,s\}$. \end{proof} \begin{lemma}[Gated product]\label{lem:gate} For a positive integer $C$ put \[ G_C(y,\beta)=\min\bigl(\max(y,0),\,C\beta\bigr)-\min\bigl(\max(-y,0),\,C\beta\bigr). \] If $s\ge 0$, $\beta\in\{0,s\}$ and $|y|\le Cs$, then $G_C(y,\beta)=y$ when $\beta=s$ and $G_C(y,\beta)=0$ when $\beta=0$. Consequently, if an integer $a$ with $|a|<2^{\ell}$ is given as a scaled integer at scale $s>0$ and $|y|\le Cs$, then $a\cdot y$ is computed by a ReLU circuit of size $O(\ell(\ell+\log C))$; at $s=0$ and $y=0$ this circuit outputs $0$. \end{lemma} \begin{proof} If $\beta=s$ then $\max(\pm y,0)\le Cs=C\beta$, so $G_C(y,\beta)=\max(y,0)-\max(-y,0)=y$. If $\beta=0$ both minima are $0$. For the product let $\alpha_0,\dots,\alpha_{\ell-1}$ be the magnitude bits and $\sigma$ the sign bit of $a$. Then $t=\sum_k 2^k G_C(y,\alpha_k)=|a|\,y$ satisfies $|t|\le 2^\ell Cs$, and $t-2G_{2^\ell C}(t,\sigma)=ay$. \end{proof} \begin{lemma}[Change of scale]\label{lem:rescale} If $0\le s'\le Cs$ and $\beta\in\{0,s\}$, then $\min(s',C\beta)\in\{0,s'\}$ and it equals $s'$ exactly when $\beta=s$ (for $s>0$). \end{lemma} \begin{proof} Immediate. \end{proof} \begin{lemma}[Digit extraction]\label{lem:digits} Let $L\ge 1$ and $Q\ge 1$ be integers, $s\ge 0$, and let $Z$ be a real number. Define, for $h=L,L-1,\dots,0$ in this order, \[ \beta_h=\min\bigl(s,\ \max(0,\ Z-Q2^hs)\bigr),\qquad Z\leftarrow Z-Q2^h\beta_h . \] Suppose $s>0$ and $\rho:=Z/(Qs)$ satisfies $0\le\rho<2^{L+1}$ and $\fr(\rho)\ge 1/Q$, where $\fr$ denotes the fractional part. Then $\beta_L,\dots,\beta_0$ are scaled bits at scale $s$ encoding the binary digits of $\lfloor\rho\rfloor$. If $s=0$ and $Z=0$, all $\beta_h$ are $0$. \end{lemma} \begin{proof} Let $\rho_h$ be the value of $Z/(Qs)$ before step $h$. We show by downward induction that $\rho_h=\rho-\sum_{k>h}2^kb_k$, where $b_k$ are the binary digits of $\lfloor\rho\rfloor$; in particular $0\le\rho_h<2^{h+1}$ and $\fr(\rho_h)=\fr(\rho)$. If $b_h=0$ then $\rho_h<2^h$, so $Z-Q2^hs<0$ and $\beta_h=0$. If $b_h=1$ then $\rho_h-2^h$ is a nonnegative integer plus $\fr(\rho)$, so $\rho_h-2^h\ge 1/Q$, hence $Z-Q2^hs=Qs(\rho_h-2^h)\ge s$ and $\beta_h=s$. In both cases the update gives $\rho_{h-1}=\rho_h-2^hb_h$. \end{proof} \section{Short integer directions}\label{sec:directions} Recall the parameters \eqref{eq:params}, and fix the integer $L=3+\lceil\log_2(KD_0)\rceil$, so that $2^{1-L}\le 1/(4KD_0)$. \begin{lemma}[Direction finding]\label{lem:dir} There is a deterministic polynomial-time algorithm $\DIR$ which, given $v\in[-1,1]^m$ whose coordinates are integer multiples of $2^{1-L}$, returns $p\in\Z^m$ and an integer $q$ with \[ 1\le q\le K\qquad\text{and}\qquad \ninf{qv-p}<\frac{1}{2D_0}. \] Moreover, for every $u\in\R^m$ with $\ninf{u-v}\le 2^{1-L}$ we have $\ninf{qu-p}<1/D_0$, and if $\ninf{u}=1$ then $\ninf{p}\le P_0$. \end{lemma} \begin{proof} Consider the lattice in $\Q^{m+1}$ with basis $b_0=(1/K,v)$ and $b_i=(0,e_i)$, $1\le i\le m$. It has rank $m+1$ and determinant $1/K$, and its vectors are $(q/K,\,qv-p)$ with $q\in\Z$, $p\in\Z^m$. The LLL algorithm~\cite{LLL}, applied after clearing denominators, runs in polynomial time and returns a nonzero lattice vector $b$ with \[ \norm{b}_2\le 2^{m/4}\,(1/K)^{1/(m+1)}=\frac{2^{m/4}}{2^{m+2}D_0}<\frac{1}{2D_0} \] by \cite[Proposition~1.6]{LLL}. Write $b=(q/K,qv-p)$. If $q=0$ then $b=(0,-p)$ with $p\ne 0$ integral, so $\norm{b}_2\ge 1$, a contradiction. Replacing $b$ by $-b$ if necessary, $q\ge 1$, and $q/K\le\norm{b}_2<1$. This gives the first claim. For the second, $\ninf{qu-p}\le\ninf{qv-p}+q2^{1-L}<\frac1{2D_0}+\frac{1}{4D_0}$. Finally $\ninf{p}\le q\ninf{u}+1\le K+1$. \end{proof} \begin{lemma}[What a direction knows]\label{lem:signs} Let $r\in\R^m$ be nonzero, $s=\ninf{r}$, $u=r/s$, and let $p\in\Z^m$ and an integer $q\ge1$ satisfy $\ninf{qu-p}<1/D_0$. Then: \begin{enumerate} \item[\textup{(a)}] for every $h\in\Z^m$ with $\norm{h}_1\le M$ and $\ip{p}{h}\ne0$ we have $\sgn\ip{p}{h}=\sgn\ip{r}{h}$; \item[\textup{(b)}] $\ip{p}{r}>0$. \end{enumerate} \end{lemma} \begin{proof} (a) $|\ip{qu}{h}-\ip{p}{h}|\le\ninf{qu-p}\norm{h}_11-m/D_0>0$. \end{proof} \section{The exact procedure}\label{sec:procedure} In this section we describe a procedure on exact real numbers and prove that it returns $h_F(w)$. It makes choices (the directions); the statement holds for every admissible choice. Section~\ref{sec:network} implements it by a network. For an integer matrix $P\in\Z^{j\times m}$ with independent rows put \[ N(P)=\det(PP^{\mathsf T})\,I-P^{\mathsf T}\adj(PP^{\mathsf T})\,P\ \in\Z^{m\times m}, \] and $N(P)=I$ for $j=0$. Since $\adj(G)=\det(G)G^{-1}$, we have $N(P)=\det(PP^{\mathsf T})\,\pi_P$, where $\pi_P$ is the orthogonal projection of $\R^m$ onto $\row(P)^\perp$, and $\det(PP^{\mathsf T})$ is a positive integer. \begin{definition}[Flag]\label{def:flag} Let $w\in\R^m$. A \emph{flag for $w$} is a sequence $p_1,\dots,p_J\in\Z^m$ together with residuals $r_0,\dots,r_J\in\R^m$ such that $r_0=w$, $r_J=0$, and for $0\le j0$ by (b), so $p_{j+1}\notin\row(P_j)$ and the rows of $P_{j+1}$ are independent. Then $r_{j+1}=\det(P_{j+1}P_{j+1}^{\mathsf T})\,\pi_{P_{j+1}}\tau_j\pi_{P_j}w=\tau_{j+1}\pi_{P_{j+1}}w$ with $\tau_{j+1}=\tau_j\det(P_{j+1}P_{j+1}^{\mathsf T})$, because $\row(P_j)\subseteq\row(P_{j+1})$. Independence gives $J\le m$, and $r_J=0$ means $\pi_{P_J}w=0$. \end{proof} For $0\le j\le J$ let $F_j\subseteq F$ be the set of lexicographic maximisers over $F$ of the score vector $x\mapsto(\ip{p_1}{x},\dots,\ip{p_j}{x})$; thus $F_0=F$ and $F_{j+1}\subseteq F_j$. \begin{lemma}[Lexicographic optimality]\label{lem:lex} In a flag for $w$, every $x^\ast\in F_J$ satisfies $\ip{w}{x^\ast}=h_F(w)$. \end{lemma} \begin{proof} Let $x\in F$ and $h=x^\ast-x$, so $\norm{h}_1\le 2mB=M$. If $P_Jh=0$ then $h\perp\row(P_J)\ni w$, so $\ip{w}{h}=0$. Otherwise let $i$ be the first index with $\ip{p_i}{h}\ne0$; then $\ip{p_i}{h}>0$ because $x^\ast$ is a lexicographic maximiser. Since $P_{i-1}h=0$ we have $\pi_{P_{i-1}}h=h$, hence by Lemma~\ref{lem:flag} and the symmetry of $\pi$, $\ip{r_{i-1}}{h}=\tau_{i-1}\ip{w}{\pi_{P_{i-1}}h}=\tau_{i-1}\ip{w}{h}$. By (a), $\ip{r_{i-1}}{h}>0$, so $\ip{w}{h}>0$. In all cases $\ip{w}{x^\ast}\ge\ip{w}{x}$. \end{proof} \subsection{Accumulating the value} For each $j\le J$ let $U_j\in\Z^{m\times m}$ be a unimodular matrix whose first $j$ rows span $\row(P_j)$ over $\Q$, with $U_0=I$. For a vector $a\in\R^m$ write $a_{\le j}$ and $a_{>j}$ for its first $j$ and last $m-j$ coordinates, and $U_j^{>j}$ for the last $m-j$ rows of $U_j$. Choose any $z_j\in F_j$ for $1\le j\le J$. Define $A_0=0$, $y_0=w$, and for $0\le jj}\bigr)^{\mathsf T}y_j,\qquad A_{j+1}=A_j+\bigl\langle (v_{j+1})_{\le j+1},\,(U_{j+1}z_{j+1})_{\le j+1}\bigr\rangle,\qquad y_{j+1}=(v_{j+1})_{>j+1}. \end{equation} \begin{proposition}[Accounting]\label{prop:acc} In a flag for $w$, for every $j\le J$: \begin{enumerate} \item[\textup{(i)}] $y_j=(U_j^{-\mathsf T}w)_{>j}$; \item[\textup{(ii)}] $\ip{w}{x}=A_j+\ip{y_j}{(U_jx)_{>j}}$ for every $x\in F_j$; \item[\textup{(iii)}] $\ninf{y_j}\le m\,\beta_j\,\ninf{r_j}$, where $\beta_j$ is the largest absolute value of an entry of $U_j^{-1}$. \end{enumerate} In particular $y_J=0$ and $A_J=h_F(w)$. \end{proposition} \begin{proof} (i) and (ii) by induction; for $j=0$ both are trivial. Let $jj})^{\mathsf T}\omega_{>j}=(U_j^{>j})^{\mathsf T}y_j$ by (i). Thus $v_{j+1}=U_{j+1}^{-\mathsf T}w''$. Since $w'\in\row(P_j)\subseteq\row(P_{j+1})$, which is spanned by the first $j+1$ rows of $U_{j+1}$, the vector $U_{j+1}^{-\mathsf T}w'$ vanishes outside its first $j+1$ coordinates. Therefore $y_{j+1}=(v_{j+1})_{>j+1}=(U_{j+1}^{-\mathsf T}w)_{>j+1}$, which is (i). For (ii) let $x\in F_{j+1}\subseteq F_j$. By the inductive hypothesis and the definition of $w''$, $\ip{w}{x}=A_j+\ip{y_j}{U_j^{>j}x}=A_j+\ip{w''}{x}=A_j+\ip{v_{j+1}}{U_{j+1}x}$. The first $j+1$ rows of $U_{j+1}$ are rational combinations of $p_1,\dots,p_{j+1}$, and $x$ and $z_{j+1}$ have the same scores $P_{j+1}x= P_{j+1}z_{j+1}$, both being lexicographic maximisers. Hence $(U_{j+1}x)_{\le j+1}=(U_{j+1}z_{j+1})_{\le j+1}$, and splitting the last inner product into its first $j+1$ and its remaining coordinates gives (ii) for $j+1$. (iii) Let $k>j$ and let $c_k$ be the $k$-th column of $U_j^{-1}$, so the $k$-th coordinate of $U_j^{-\mathsf T}w$ is $\ip{c_k}{w}$. Since $U_jc_k=e_k$, the first $j$ rows of $U_j$ annihilate $c_k$, so $c_k\perp\row(P_j)$ and $\ip{c_k}{w}=\ip{c_k}{\pi_{P_j}w}=\ip{c_k}{r_j}/\tau_j$ by Lemma~\ref{lem:flag}. As $\tau_j\ge1$, $|\ip{c_k}{w}|\le\norm{c_k}_1\ninf{r_j}\le m\beta_j\ninf{r_j}$. Finally $r_J=0$ gives $y_J=0$ by (iii), so (ii) reads $\ip{w}{x}=A_J$ for $x\in F_J$, and Lemma~\ref{lem:lex} gives $A_J=h_F(w)$. \end{proof} \subsection{Integer bookkeeping} \begin{lemma}[Bounds]\label{lem:bounds} Let $P\in\Z^{j\times m}$, $j\le m$, have independent rows and entries of absolute value at most $P_0$. Put $\Gamma=(m^2P_0^2)^m$ and $N_0=(1+m^2P_0^2)\Gamma$. Then every entry of $N(P)$ has absolute value at most $N_0$, and every entry of a product of at most $m$ such matrices has absolute value at most $H_0=(mN_0)^m$. \end{lemma} \begin{proof} The entries of $G=PP^{\mathsf T}$ are at most $mP_0^2$ in absolute value, so every minor of $G$ of order $i\le m$ is at most $i!\,(mP_0^2)^i\le\Gamma$. This bounds $\det G$ and the entries of $\adj G$. An entry of $P^{\mathsf T}\adj(G)P$ is a sum of at most $m^2$ products bounded by $P_0^2\Gamma$. The last claim is the submultiplicativity of the maximum norm up to the factor $m$. \end{proof} \begin{lemma}[Unimodular bases]\label{lem:uni} There is a deterministic polynomial-time algorithm $\UNI$ which, given $P\in\Z^{j\times m}$ with independent rows, returns a unimodular $U\in\Z^{m\times m}$ whose first $j$ rows span $\row(P)$, together with $U^{-1}$. For $j=0$ it returns $U=I$. Consequently there is an integer $\beta=\beta(m,B)$ with $\log\beta=(m+\log B)^{O(1)}$ bounding the absolute values of all entries of $U$ and $U^{-1}$ over all inputs with entries at most $P_0$. \end{lemma} \begin{proof} Extend $P$ to a nonsingular square integer matrix $\hat P$ by appending $m-j$ unit vectors, chosen greedily. The algorithm of Kannan and Bachem~\cite{KB} computes in polynomial time a unimodular $V$ such that $\hat PV$ is lower triangular (the Hermite normal form). Then $PV=[D\ \,0]$ with $D\in\Z^{j\times j}$ nonsingular, so with $U=V^{-1}$ we get $P=[D\ \,0]U$, that is, the rows of $P$ are combinations of the first $j$ rows of $U$, and these span the same $j$-dimensional space. A polynomial-time algorithm has outputs of polynomial bit length. \end{proof} \begin{lemma}[Lexicographic objective]\label{lem:lexobj} Let $p_1,\dots,p_j\in\Z^m$, $j\le m$, with $\ninf{p_i}\le P_0$, and $c=\sum_{i=1}^{j}\Lambda^{j-i}p_i$. Then $\ninf{c}\le 2^{\ell^\ast}$ and every maximiser of $\ip{c}{x}$ over $F$ lies in $F_j$. \end{lemma} \begin{proof} $\ninf{c}\le P_0\sum_{i0$. Then $|\delta_k|\le MP_0=(\Lambda-1)/2$ and \[ \ip{c}{x-x'}\ \ge\ \Lambda^{j-i}-\frac{\Lambda-1}{2}\sum_{k>i}\Lambda^{j-k} \ =\ \Lambda^{j-i}-\frac{\Lambda^{j-i}-1}{2}\ >\ 0 . \] So a maximiser of $c$ is lexicographically maximal. \end{proof} \section{The network for one rounding shift}\label{sec:network} Fix integers $Q\ge 2$ and $1\le aj}\bigr)^{\mathsf T}\in\Z^{m\times(m-j)},\qquad N=N(P_{j+1}), \] the objective $c=\sum_{i\le j+1}\Lambda^{j+1-i}p_i$, the point $z=\OPT(c)$, and the integers $a_i=(U_{j+1}z)_i$ for $i\le j+1$. Its outputs are $p_{j+1}$, $E$, $N$ and $a_1,\dots,a_{j+1}$, in fixed-width sign-magnitude binary. On all other inputs $\Phi_j$ outputs arbitrary bits. All algorithms involved run in polynomial time, so $\Phi_j$ has size $(S+m+\log B)^{O(1)}$; note that $\log K$, $L$ and $\log N_0$ are $(m+\log B)^{O(1)}$. \smallskip\noindent\emph{Step 4 (real updates).} Using the products of Lemma~\ref{lem:gate}: \[ v=E\,y\ \ (\text{with } C=m\beta),\qquad A\leftarrow A+\sum_{i\le j+1}a_i\,v_i\ \ (\text{with } C=m^3\beta^3), \] \[ y\leftarrow v_{>j+1},\qquad r\leftarrow N\,r\ \ (\text{with } C=1),\qquad s_{\mathrm{old}}\leftarrow s . \] The bit lengths of the scaled integers are bounded by $\log_2(m\beta^2)$ for $E$, $\log_2N_0$ for $N$, and $\log_2(m\beta B)$ for the $a_i$, each increased by one. \smallskip The output of $\mathcal N_\theta$ is the wire $A$ after stage $m-1$. The size bound is clear. For correctness let the ideal run of $w$ be clean, with flag $p_1,\dots,p_J$, $r_0,\dots,r_J$, and define $U_j=\UNI(P_j)$, $z_j=\OPT\bigl(\sum_{i\le j}\Lambda^{j-i}p_i\bigr)$, which lies in $F_j$ by Lemma~\ref{lem:lexobj}, and $A_j,y_j$ by~\eqref{eq:acc}. We claim that at the beginning of stage $j\le J$ the wires hold $A=A_j$, $r=r_j$, $y=y_j$ and, if $j\ge1$, correct scaled encodings of $p_1,\dots,p_j$ at scale $s_{j-1}>0$. This is true for $j=0$. Assume it for some $j0$, and $s_j=\ninf{N(P_j)r_{j-1}}\le mN_0s_{j-1}$, so the rescaling is correct. In Step~2, $Z_i/(Qs)=\rho_{j,i}$, which lies in $[0,2^{L+1})$ and has fractional part at least $1/Q$ because the run is clean; by Lemma~\ref{lem:digits} the extracted wires encode $n_{j,i}$. In Step~3 the circuit therefore computes the objects of the ideal run: $p_{j+1}$, $E=U_{j+1}^{-\mathsf T}(U_j^{>j})^{\mathsf T}$, $N=N(P_{j+1})$ and $a_i=(U_{j+1}z_{j+1})_i$, and all of them fit their fixed widths by Lemmas~\ref{lem:idealflag}, \ref{lem:bounds} and~\ref{lem:uni}. In Step~4 the hypotheses of Lemma~\ref{lem:gate} hold: $\ninf{y_j}\le m\beta s_j$ by Proposition~\ref{prop:acc}(iii); the entries of $E$ are at most $m\beta^2$ in absolute value, so $\ninf{v_{j+1}}\le m\cdot m\beta^2\cdot m\beta s_j$; and $\ninf{r_j}=s_j$. Hence the wires after stage $j$ hold $v_{j+1}=Ey_j$, $A_{j+1}$, $y_{j+1}$ and $r_{j+1}$ exactly as in~\eqref{eq:acc} and Definition~\ref{def:flag}. This proves the claim. At stage $J$ (if $J0$. \end{proof} Now fix \begin{equation}\label{eq:shiftparams} H=2^{L}H_0,\qquad D=m(mH)^m,\qquad d=\lceil\log_2(2D^2)\rceil,\qquad T=2m^2+1,\qquad Q=2^{dT+2}, \end{equation} with $H_0$ from Lemma~\ref{lem:bounds}, and the shifts \[ \theta_k=2^{-dk},\qquad k=1,\dots,T . \] Each $\theta_k$ is of the form $a/Q$ with an integer $1\le a\frac34\theta_k/\theta_{k'}\ge\frac34 2^{d}\ge\frac32D^2$. So the assignment is injective and there are at most $m^2$ unclean indices. \end{proof} \begin{proof}[Proof of Theorem~\ref{thm:main}] Build the circuits $\mathcal N_{\theta_1},\dots,\mathcal N_{\theta_T}$ of Proposition~\ref{prop:oneshift} with the common resolution $Q$ of~\eqref{eq:shiftparams}, and let the output be the median of their $T=2m^2+1$ outputs, computed by a sorting network of $O(T^2)$ comparators, each comparator being one $\max$ and one $\min$. For every $w\in\R^m$, at least $m^2+1$ of the $T$ outputs equal $h_F(w)$ by Propositions~\ref{prop:fewbad} and~\ref{prop:oneshift}; so the $(m^2+1)$-st smallest output equals $h_F(w)$. The size is $T\cdot(S+m+\log B+\log Q)^{O(1)}+O(T^2)=(S+m+\log B)^{O(1)}$, and every step of the construction is explicit and runs in polynomial time. \end{proof} \section{Remarks} \begin{remark}[Exactness and ties] No assumption on $w$ is made: the weights may be irrational, of very different magnitudes, and may have any pattern of ties. The network outputs the optimal value; it does not output a maximiser, which is not a continuous function of $w$. \end{remark} \begin{remark}[Depth] The circuit has polynomial depth. The proof makes no attempt to reduce it. \end{remark} \begin{remark}[Weights] All coefficients are integers and there are no biases. The largest coefficients are powers of two of polynomial bit length; replacing them by repeated doubling gives a circuit over $\{\max,+,-\}$ with all coefficients equal to $\pm1$ and the same size up to a constant factor. \end{remark} \begin{remark}[Non-uniform optimisers] Theorem~\ref{thm:main} needs only a Boolean circuit for integer optimisation, not a uniform algorithm. Hence for every family of sets $F_n\subseteq\Z^{m(n)}\cap[-B(n),B(n)]^{m(n)}$ the neural network complexity of the support function and the Boolean circuit complexity of optimising $\ell^\ast$-bit objectives over $F_n$ are polynomially related in one direction: the former is at most a polynomial in the latter, $m$ and $\log B$. \end{remark} \begin{thebibliography}{99} \bibitem{BHKL} A.~E.~Black, C.~Hertrich, S.~Kober, G.~Loho. Two linear programs are better than one. arXiv:2610.15909, 2026. \bibitem{Edmonds} J.~Edmonds. Maximum matching and a polyhedron with $0,1$-vertices. \emph{J.\ Res.\ Nat.\ Bur.\ Standards Sect.~B} 69 (1965), 125--130. \bibitem{FT} A.~Frank, \'E.~Tardos. An application of simultaneous Diophantine approximation in combinatorial optimization. \emph{Combinatorica} 7 (1987), 49--65. \bibitem{GLS} M.~Gr\"otschel, L.~Lov\'asz, A.~Schrijver. \emph{Geometric Algorithms and Combinatorial Optimization}. Springer, 1988. \bibitem{HL} C.~Hertrich, G.~Loho. Neural networks and (virtual) extended formulations. arXiv:2411.03006. \bibitem{HS} C.~Hertrich, L.~Sering. ReLU neural networks of polynomial size for exact maximum flow computation. arXiv:2102.06635. \bibitem{HSt} C.~Hertrich, M.~Stargalla. Tropical circuits with scalar multiplication gates. arXiv:2607.11540, 2026. \bibitem{JS} M.~Jerrum, M.~Snir. Some exact complexity results for straight-line computations over semirings. \emph{J.\ ACM} 29 (1982), 874--897. \bibitem{Jukna} S.~Jukna. \emph{Tropical Circuit Complexity}. Springer, 2023. \bibitem{KB} R.~Kannan, A.~Bachem. Polynomial algorithms for computing the Smith and Hermite normal forms of an integer matrix. \emph{SIAM J.\ Comput.} 8 (1979), 499--507. \bibitem{Kuhn} H.~W.~Kuhn. The Hungarian method for the assignment problem. \emph{Naval Res.\ Logist.\ Quart.} 2 (1955), 83--97. \bibitem{LLL} A.~K.~Lenstra, H.~W.~Lenstra, L.~Lov\'asz. Factoring polynomials with rational coefficients. \emph{Math.\ Ann.} 261 (1982), 515--534. \bibitem{Rothvoss} T.~Rothvoss. The matching polytope has exponential extension complexity. \emph{J.\ ACM} 64 (2017), Art.~41. \end{thebibliography} \end{document}