2 The maximum of five numbers with two hidden layers
This chapter contains the paper’s key finite-dimensional identity (Claim 4): an explicit function \(M\), built from nine two-hidden-layer terms, equals \(\mathrm{MAX}_5\). This disproves the depth conjecture of Hertrich, Basu, Di Summa, and Skutella already for five inputs.
Define \(P_1 \colon \mathbb {R}^5 \to \mathbb {R}\) by
Define \(P_2 \colon \mathbb {R}^5 \to \mathbb {R}\) by
Define \(P_3 \colon \mathbb {R}^5 \to \mathbb {R}\) by
Define \(P_4 \colon \mathbb {R}^5 \to \mathbb {R}\) by
Define \(Q \colon \mathbb {R}^5 \to \mathbb {R}\) by
Define \(R_{13} \colon \mathbb {R}^5 \to \mathbb {R}\) by
Define \(R_{14} \colon \mathbb {R}^5 \to \mathbb {R}\) by
Define \(R_{23} \colon \mathbb {R}^5 \to \mathbb {R}\) by
Define \(R_{24} \colon \mathbb {R}^5 \to \mathbb {R}\) by
Define \(M \colon \mathbb {R}^5 \to \mathbb {R}\) by
For all real numbers \(a, b, c, d\),
Each of the four sums on the right is at most the left-hand side, so the right-hand side is at most the left-hand side. Conversely, \(\max (a,b) = a\) or \(b\) and \(\max (c,d) = c\) or \(d\), so the left-hand side equals one of the four sums.
For all \(x \in \mathbb {R}^5\),
By Lemma 28, \(\max (x_1,x_3) + \max (x_1,x_4) = \max (2x_1,\ x_1{+}x_4,\ x_3{+}x_1,\ x_3{+}x_4)\); combining with \(\max (2x_5, x_1{+}x_2)\) under the outer maximum and using associativity of \(\max \) gives the claim.
For all \(x \in \mathbb {R}^5\),
For all \(x \in \mathbb {R}^5\),
For all \(x \in \mathbb {R}^5\),
Let \(d \ge 1\) and let \(g_1, \dots , g_6 \colon \mathbb {R}^d \to \mathbb {R}\) be affine. Then the function
lies in \(\mathrm{ReLU}_{d,2}\).
By Lemma 12 and Lemma 10, each of \(u = \max (g_1, g_2)\), \(\max (g_3, g_4)\) and \(\max (g_5, g_6)\) lies in \(\mathrm{ReLU}_{d,1}\), and by Lemma 9 so does \(v = \max (g_3,g_4) + \max (g_5,g_6)\). Finally \(\max (u, v) = \mathrm{MAX}_2(u, v)\) lies in \(\mathrm{ReLU}_{d,2}\) by Lemma 11 applied with \(\mathrm{MAX}_2 \in \mathrm{ReLU}_{2,1}\).
Let \(d \ge 1\), let \(1 \le r \le 4\) and let \(g_1, \dots , g_r \colon \mathbb {R}^d \to \mathbb {R}\) be affine. Then \(x \mapsto \max (g_1(x), \dots , g_r(x))\) lies in \(\mathrm{ReLU}_{d,2}\).
\(M \in \mathrm{ReLU}_{5,2}\).
Each of \(P_1, P_2, P_3, P_4\) is of the shape of Lemma 33 with affine arguments (\(g_1 = 2x_5\), etc.), hence lies in \(\mathrm{ReLU}_{5,2}\). Each of \(Q, R_{13}, R_{14}, R_{23}, R_{24}\) is a maximum of at most four affine functions, hence lies in \(\mathrm{ReLU}_{5,2}\) by Lemma 34. By Lemma 9 the linear combination \(M\) of these nine functions lies in \(\mathrm{ReLU}_{5,2}\).
For all \(x \in \mathbb {R}^5\), \(M(x_2, x_1, x_3, x_4, x_5) = M(x_1, x_2, x_3, x_4, x_5)\).
Substituting \((x_2, x_1, x_3, x_4, x_5)\) into the defining formulas interchanges \(P_1 \leftrightarrow P_2\), \(R_{13} \leftrightarrow R_{23}\) and \(R_{14} \leftrightarrow R_{24}\), and fixes \(P_3\), \(P_4\) and \(Q\) (their formulas involve \(x_1, x_2\) only through \(x_1 + x_2\) or through \(\max (x_\cdot , x_1) + \max (x_\cdot , x_2)\), both symmetric). The defining combination of \(M\) is invariant under these exchanges.
For all \(x \in \mathbb {R}^5\), \(M(x_1, x_2, x_4, x_3, x_5) = M(x_1, x_2, x_3, x_4, x_5)\).
The substitution interchanges \(P_3 \leftrightarrow P_4\), \(R_{13} \leftrightarrow R_{14}\) and \(R_{23} \leftrightarrow R_{24}\), and fixes \(P_1\), \(P_2\) and \(Q\), exactly as in Lemma 36. The combination defining \(M\) is invariant.
For all \(x \in \mathbb {R}^5\), \(M(x_3, x_4, x_1, x_2, x_5) = M(x_1, x_2, x_3, x_4, x_5)\).
Substituting \((x_3, x_4, x_1, x_2, x_5)\) interchanges \(P_1 \leftrightarrow P_3\), \(P_2 \leftrightarrow P_4\) and \(R_{14} \leftrightarrow R_{23}\), and fixes \(Q\), \(R_{13}\) and \(R_{24}\) (for instance \(R_{13}\) becomes \(\max (2x_5, x_3{+}x_1, x_3{+}x_4, x_1{+}x_2) = R_{13}(x)\)). The combination defining \(M\) is invariant.
Let \(x \in \mathbb {R}^5\) with \(x_5 \ge x_i\) for \(i = 1, \dots , 4\). Then \(M(x) = x_5\).
Every entry of each of the nine flattened maxima is of the form \(x_i + x_j\) with \(i, j \in \{ 1, \dots , 5\} \) (reading \(2x_i\) as \(x_i + x_i\)), hence is at most \(2x_5\); since \(2x_5\) itself appears in each list, all nine terms equal \(2x_5\). Therefore \(M(x) = \tfrac 12\, (5 \cdot 2x_5 - 4 \cdot 2x_5) = x_5\).
Let \(x \in \mathbb {R}^5\) with \(x_1 \ge x_i\) for \(i = 2, \dots , 5\). Then \(M(x) = x_1\).
Since \(x_1\) dominates every coordinate, every entry of the flattened list of \(P_1\) is at most \(2x_1\), and \(2x_1\) occurs in the list, so \(P_1(x) = 2x_1\). In the list for \(P_2\), the entries \(2x_2\) and \(x_2 + x_4\) are dominated by \(x_1 + x_2\); deleting them gives \(P_2(x) = \max (2x_5, x_1{+}x_2, x_2{+}x_3, x_3{+}x_4) = R_{23}(x)\). In the list for \(P_3\), the entries \(2x_3\) and \(x_3 + x_2\) are dominated by \(x_3 + x_1\) and \(x_1 + x_2\) respectively, so \(P_3(x) = \max (2x_5, x_3{+}x_4, x_3{+}x_1, x_1{+}x_2) = R_{13}(x)\). Symmetrically, in the list for \(P_4\) the entries \(2x_4\) and \(x_4 + x_2\) are dominated, so \(P_4(x) = \max (2x_5, x_3{+}x_4, x_4{+}x_1, x_1{+}x_2) = R_{14}(x)\). Finally, in \(R_{24}\) the entry \(x_2 + x_4\) is dominated by \(x_1 + x_2\), so \(R_{24}(x) = \max (2x_5, x_1{+}x_2, x_3{+}x_4) = Q(x)\). Substituting into the definition of \(M\), all terms cancel except \(\tfrac 12 P_1(x)\), so \(M(x) = \tfrac 12 \cdot 2x_1 = x_1\).
For all \(x \in \mathbb {R}^5\) we have \(\mathrm{MAX}_5(x) = M(x)\).
Let \(x \in \mathbb {R}^5\) and distinguish which coordinate attains the maximum. If \(x_5\) is maximal, Lemma 39 gives \(M(x) = x_5 = \mathrm{MAX}_5(x)\). If \(x_1\) is maximal, Lemma 40 applies directly. If \(x_2\) is maximal, apply Lemma 40 to \(y = (x_2, x_1, x_3, x_4, x_5)\) and use Lemma 36: \(M(x) = M(y) = y_1 = x_2\). If \(x_3\) is maximal, apply Lemma 40 to \(y = (x_3, x_4, x_1, x_2, x_5)\) and use Lemma 38. If \(x_4\) is maximal, apply Lemma 40 to \(y = (x_4, x_3, x_1, x_2, x_5)\) and use Lemmas 38 and 36. In every case \(M(x) = \mathrm{MAX}_5(x)\).
\(\mathrm{MAX}_5 \in \mathrm{ReLU}_{5,2}\).
The minimum number of hidden layers needed to compute \(\mathrm{MAX}_5\) is exactly two: \(\mathrm{MAX}_5 \in \mathrm{ReLU}_{5,2}\) and \(\mathrm{MAX}_5 \notin \mathrm{ReLU}_{5,1}\).
For every \(n \ge 1\) we have \(\mathrm{MAX}_n \in \mathrm{ReLU}_{n,\, 2\lceil \log _5 n \rceil }\).
We show \(\mathrm{MAX}_{5^k} \in \mathrm{ReLU}_{5^k, 2k}\) by induction on \(k \ge 0\); the claim follows by Lemma 14 with \(k = \lceil \log _5 n\rceil \). For \(k = 0\) the identity is affine. For the step, split the \(5^k\) inputs into five blocks of size \(5^{k-1}\) and write \(\mathrm{MAX}_{5^k}\) as \(\mathrm{MAX}_5\) applied to the five block maxima. Each block maximum lies in \(\mathrm{ReLU}_{5^k, 2k-2}\) by induction and Lemma 10; composing with \(\mathrm{MAX}_5 \in \mathrm{ReLU}_{5,2}\) (Proposition 42) via Lemma 11 adds two hidden layers.