Manuscript Offprint
arXiv:2610.26795Two hidden layer suffice: the caterpillar net
TWO HIDDEN LAYERS SUFFICE: THE CATERPILLAR NET
Jakob Paul Zimmermann
FU Berlin, TU Berlin
jakob.paul.zimmermann@campus.tu-berlin.de
https://jakob-paul-zimmermann.com
ABSTRACT
Every continuous piecewise linear (CPWL) function is a finite signed sum of maxima of affine functions, making maximum representation a central problem in the study of the expressiveness of ReLU networks. A now-disproved conjecture predicted logarithmic depth for maxima. Inspired by the proof by Brunck et al. (2026) that two hidden layers suffice for general CPWL functions, we give the Caterpillar Net, a nonrecursive construction for the maximum of inputs with two hidden layers of widths and . The construction has a direct geometric interpretation.
Theorem (Wang and Sun, 2005). Let and let be continuous and affine on each member of a finite polyhedral cover. There are , affine maps and signs
such that
Thus a two-hidden-layer representation of gives one for every CPWL function on : precompose with the affine maps and add the networks in parallel.
Historical conjecture (Hertrich et al., 2023, Conjecture 1.5, now disproved). For every integer , the function cannot be represented by a ReLU network with hidden layers, regardless of their widths.
The case asserts impossibility with two hidden layers. Bakaev et al. (2026) disproved it by constructing a two-hidden-layer representation of the maximum of five inputs.
This reduction made the geometry of the maximum a central approach to the representation problem well before the work of Brunck et al. (2026). Polyhedral approaches to depth include the Newton-polytope framework of Hertrich et al. (2023), the simplex subdivisions of Bakaev et al. (2026), and the depth lower bounds for braid-fan-compatible networks of Grillo et al. (2025). For width, Safran (2026) used extremal graph theory to prove lower bounds for exact maximum representation, while
Our results were obtained through proof search in Lean using Claude Code and Codex. The Lean code is available in the accompanying repository https://github.com/JayPiZimmermann/Max_Caterpillar. Links to the Lean formalization appear in theorem titles and equation numbers; equation numbers are clickable.
Lu (2026) studied first-layer width thresholds for approximation and exact representation. Brunck et al. (2026) then constructed two-hidden-layer ReLU representations for arbitrary CPWL functions in every dimension.
Theorem 1 (Brunck et al., 2026). Every continuous piecewise affine function with finitely many affine pieces can be represented exactly by a ReLU network with two hidden layers.
Our contribution is to specialize their general construction to and simplify it into the Caterpillar Net. Taking as the second-layer width baseline via applying the Brunck et al. (2026) recursive construction, we pursue two aims:
-
Give a nonrecursive construction for with a direct geometric interpretation.
-
Reduce its second hidden-layer width.
Write applied coordinatewise to vectors. A network of widths has parameters
and evaluates as the function
The output is affine, there are no skip connections, and equality is required on all of .
Theorem 2 (Caterpillar Net, Lean_1, Lean_2, proof). For every , define
There is a two-hidden-layer ReLU network computing with widths
In particular, these widths satisfy, as ,
Remark (small arities). The linked theorem also covers and by separate networks of widths and . At , formula (7) gives widths .
2 THE CATERPILLAR NET
Two one-line identities drive the construction. For reals s, t and every linear function on ,
The first suggests computing the maximum along a path with attached leaves. Alternating sums of support functions of caterpillar polytopes give the correct support-function class; support functions of their proper faces, together with linear functions, correct the remaining error to pointwise equality. The second reverses an inner hinge at the cost of a linear term; it merges equal units in Section 4.
Fix and write .
Definition 3 (Labelled caterpillar, Lean_3). A caterpillar description is a permutation-set pair
Position carries the label , for , and the label is the apex. The spine positions are . We also call the cut set: a cut at separates positions and in the ordered list. The last spine position, and the parent of a position , the nearest spine position before it, are
Joining each position to its parent gives a directed tree on the labels , the labelled caterpillar: its spine is the path through the spine positions, and every other label is a leaf attached to the preceding spine vertex (Figure 1). The apex is separate from this tree.
Definition 4 (Caterpillar function and face functions, Lean_4, Lean_5). For labels i, j, for the tree edges, and for the head, put
The edge functions subtract each child's coordinate from its parent's, one for each of the tree edges, and the head function compares the last spine vertex with the apex. For a linear function , a finite set of linear functions, and a state chosen for every , define
Thus each is omitted, kept linearly, or kept as a hinge. Write for the all-hinge state . We call a function description of : it records the linear head and the inner hinges. The caterpillar description specifies the labelled tree from which such functions are generated. The caterpillar function of and its face functions are

Figure 1: A labelled caterpillar with and . The spine has two leaves at each vertex; all arrows point from parent to child. The apex is separate from the tree. The last spine position is , so the head function is .
The term face function comes from the following geometry. Identify linear functions with their coefficient vectors. For a polytope P, its support function, and the polytope whose support function is , are
Indeed, the segment has support function , Minkowski sums add support functions, and adjoining 0 applies the outer ReLU. The head and the edge functions are jointly linearly independent: their label edges form a tree on all labels, since the head connects the apex to the last spine vertex. Thus the base is an -dimensional parallelotope whose affine hull does not contain 0, and is an -dimensional pyramid. A face of containing the apex 0 and another point is the convex hull of 0 and a face of the base. Since the base is a translated sum of segments, the face exposed by a linear functional is obtained by maximizing on each segment separately, which selects the endpoint 0, the endpoint , or the whole segment. These have support functions 0, , and , and the outer ReLU adjoins the apex. Hence the face functions (16) include the support function of every face of through the apex.
Definition 5 (Dictionary, Lean_6). The dictionary D is the finite set of functions consisting of every face function , over all caterpillar descriptions and all states , together with the auxiliary functions
(20)
Heads and edge functions are coordinate differences, so face functions and pair hinges are translation invariant: with ,
Only the coordinate features change under . Theorem 7 below proves ; the following rule then fixes one real coefficient for each dictionary function.
To turn coefficients of distinct functions into literal network data, retain the finite tags used to generate the dictionary. Let , where contains the distinct head–edge-set pairs obtained by collecting each linear state into the head as in (88), and contains the indexed auxiliary features in (20). If is the function represented by a tag, then
Different tags may represent the same function.
An exact coefficient rule (Lean_7) Let
This set is nonempty because the finite spanning set contains a basis. For , form
using the inner product
Every dictionary function is continuous and positively homogeneous. If a linear combination of the basis functions has zero squared integral, continuity makes it zero throughout the cube, and positive rescaling then makes it zero on all of . Linear independence forces every coefficient to vanish, so is positive definite and invertible. Write for its inverse matrix. For each , average over the bases containing :
Lemma 6 (Canonical expansion, Lean_8). Assuming Theorem 7, the coefficients (27) satisfy
Proof of Lemma 6. Fix . By Theorem 7, there is such that
Taking the inner product with each gives
(30)
Interchanging the finite sums in (27) therefore yields
This finishes the proof of Lemma 6.
For each tag, split the coefficient of its represented function equally over its nonempty finite fiber:
While computationally intractable to extract explicit weights for large N, averaging over all bases avoids arbitrary symmetry-breaking and provides a canonical coefficient map ideal for formal verification. Regrouping by the fibers of v gives the literal tagged expansion
Thus duplicate face and auxiliary tags neither duplicate nor lose any coefficient.
3 WHY THE DICTIONARY SPANS THE MAXIMUM
The maximum is the support function of . To work with a full dimensional polytope, let us do the following substitution: for
we observe for an arbitrary input that
To prove that it suffices to show that lies in the span of the restrictions of to . Indeed, lies in the span of the auxiliary functions (20), and by (21) the substitution fixes every dictionary function except the coordinate features , which become ; by (10) these are linear combinations of auxiliary functions. Hence belongs to span for every , and (35) gives the claimed implication.
All polytopes in the geometric argument below lie in the -dimensional space . We restrict heads and edge functions to and identify them with their coefficient vectors there. Let denote the real span of support functions of polytopes in of affine dimension at most . In particular, is the space of linear functions, since the support function of a point is .
For a direction
the exposed face of a polytope with normal is the set of points of maximizing the linear function :
For , it is where the supporting hyperplane with outward normal meets . The opposite face consists of the minimizers; for , both faces are itself. Define the function
Here selects the two faces, while is the input to their support functions. In particular, . Geometrically, acts as a derivative that replaces the support function of a polytope by the difference of the support functions of its opposite exposed faces. If is nonconstant on , these are proper boundary faces of smaller dimension; if it is constant, the two support functions cancel. This removes the full-dimensional contribution and explains the dimension drop in (40). For a simplex and a facet normal , is a facet-isolating operator: it returns that facet's support function minus the linear support function of the opposite vertex. This is the mechanism used in Step 7.2, rather than a local gradient calculation.
For a finite linear combination g of support functions, define its one-sided directional derivative at u by
(39)
Thus the map extends linearly to linear combinations of support functions, independently of their decomposition. If , either is constant on , so , or both selected faces have dimension at most . Consequently,
The signed caterpillar sum. We seek a combination that agrees with up to a function in . Adding makes the caterpillar function the following maximum
Averaging over permutations gives the required symmetry
where the signs are chosen to cancel the extra contributions from support functions of exposed caterpillar faces, modulo . Establishing the required cancellations is a main step of the proof below.
Theorem 7 (Dictionary sufficiency, Lean_9, proof). For every , the dictionary of Definition 5 satisfies
Proof of Theorem 7. Recall from this section’s introduction that it suffices to show that lies in the span of the restrictions of to .
Define the error by
(44)
Step 7.1 reduces dictionary membership to . Step 7.2 shows that it suffices to prove for every direction . Step 7.3 proves these bounds by induction on : dimension bounds and cancellation handle all directions except those with one coordinate different from all the others, which share a common value. In that case, deleting the exceptional coordinate invokes the induction hypothesis.
Step 7.1 (Reduce to a lower-dimensional error). In this step we reduce the problem to proving
Assume this relation temporarily, and write , so that by (19). Since the apex terms in (42) are linear, the assumed relation gives
We will correct this error by differentiating its support-function terms via to lower the residual dimension until the residual is linear. The resulting support functions of proper faces of the already lie in the dictionary span: the support function of the convex hull of the apex with a base face is a face function from Definition 4, given by (16), while the support function of a base face is a linear function plus inner hinges. Coordinate features represent the linear function, and (10) puts either orientation of each hinge in the span of (20). The apex alone has zero support function, and is itself a dictionary function. Differentiating the simplex support-function term also produces support functions of proper simplex faces. Their membership in the dictionary span is supplied by induction on the number of vertices.
Claim (induction on ). For every nonempty , the support function of lies in the dictionary span.
Start . The support function of a singleton is linear and therefore lies in the dictionary span.
Step ( ). Fix and assume that for every nonempty vertex set with , in particular for every nonempty proper subset of . Consider a current vertex set with . To remove , choose a direction whose value at is strictly larger than its common value at all other vertices. The positive exposed face is then the singleton , and the negative exposed face is the simplex on the remaining vertices. Writing , we have
(47)
Choose an ordering of the vertices outside . Denote the error associated with the remaining vertex set by
The operators act from right to left, removing , then , and so on. In (47), the support function of the remaining simplex carries a minus sign, while the removed singleton contributes the linear function . Every subsequent annihilates linear functions. Thus the deletions give
where is linear. The original error contains , so the coefficient of in is . All other terms are linear functions or support functions of faces of the , since each replaces a support function by a difference of support functions of exposed faces. The coefficient of in is , and all other terms already lie in the dictionary span. Thus proving completes the induction step. To prove this membership, we use the additional information , obtained by repeated application of (40). This bound starts the inner induction below: each reduction lowers the dimension bound by one while subtracting a function in the dictionary span, until the remaining error lies in and is therefore linear. For the full vertex set, the operator composition is empty and means the identity, so is exactly the error in (46).
For this fixed T, define the remaining errors as functions recursively by
(50)
Here and . At stage , the finite set of directions is chosen from the current error by the construction below. Thus is the error left after derivative sums have been subtracted from ; the superscript counts stages and is not a power.
Claim (induction on the reduction stage ). The sets can be chosen successively so that, for ,
(51)
Each remaining error is a linear combination of , support functions of proper faces of , support functions of faces of the , and linear functions. The second condition says that the part already removed is represented by the dictionary.
Start . By definition, . Its dimension bound and support-function expression were established above, and the removed part is zero.
Step . Assume the directions for the first stages have been chosen and the claim holds at stage . Put . We require each new direction to be nonorthogonal to the simplex direction space . Its values on are then not all equal, so the maximizing vertices form a nonempty proper subset:
(52)
The last membership uses the outer induction hypothesis, since . An orthogonal direction would leave unchanged and would not allow this use of the hypothesis.
Choose an auxiliary expression for by support functions of polytopes of dimension at most , and collect their distinct -dimensional direction spaces. For each such space , choose not orthogonal to dir or to any other collected space . This is possible because : each of dir and contains a vector outside , whose nonzero projection onto is not orthogonal to that vector. Adding sufficiently small multiples of these projections avoids each orthogonality condition in turn while preserving those already avoided. Choose is a collected direction space}, with if there are none. In the sum of derivatives over , each term coming from a -dimensional polytope is preserved exactly once. Every other derivative of that term is the support function of a proper face, while terms of lower dimension remain in . Subtracting this derivative sum therefore cancels all -dimensional terms. By the recursive definition (50), the resulting error satisfies .
Now compute these same derivatives using the support-function expression in the claim. The derivative of lies in the dictionary span by (52). Differentiating the support function of an already proper simplex face still gives a support function of a proper face of , so the same induction hypothesis applies. Differentiating the support function of a face of gives a support function of a face of the same polytope, covered by the opening dictionary description, and linear functions remain linear. Thus the derivative sum lies in the dictionary span. By (50), is the sum of the previously removed part and this derivative sum, so it also lies in the dictionary span. Subtracting the derivative sum preserves the stated types of support-function terms. This proves the claim at stage .
At stage , the remaining error lies in and is linear. Together with (51), this gives . Its vertex-deletion expression has coefficient on and all other terms in the dictionary span, so . This completes the induction step on . Taking to be the full vertex set proves under the temporary assumption (45). This finishes the proof of Step 7.1.
Step 7.2 (Why the facet bounds imply the class identity). For and , we show that follows from
The idea is to express modulo using support functions of full-dimensional simplices. The facet bounds then force their weighted contributions to cancel modulo .
The base of each is an affine cube. Order its edge vectors by a bijection , add them one at a time, and adjoin the apex:
These simplices form the Kuhn subdivision: in cube coordinates, each occupies one ordering region . For a hyperplane cut , the support-function identity
(55) shows that subdivision changes the sum of support functions only by support functions of the cutting sections. Hence
Substituting (56) into (42) expresses as a finite linear combination of support functions of -dimensional simplices in , plus a remainder in . The simplex contributes its support function with coefficient , and the linear apex terms are included in the remainder.
For a simplex , an outward facet normal exposes the facet on one side and its opposite vertex on the other. Thus
Directions exposing no facet on either side give support functions of faces of dimension at most . Consequently, (53) says that each weighted, signed sum of parallel-facet support functions belongs to .
Our assumption controls the weighted facet contributions, whereas our conclusion concerns . To recover the original sum modulo , we use the same linear operator for every simplex, so cancellations between facet contributions survive reconstruction. Define
The sign in this definition concerns the input . To interpret it geometrically, first suppose that every point satisfies , and write for projection onto . Since , each point dominates its projection when , and its projection dominates when . Consequently,
This convex hull fills the segments joining points of to their projections, so its dimension is at most . For an arbitrary , choose such that lies in . Translation adds to the support function, and , giving
The correction is the support function of the segment . Thus linearity gives
Claim (induction on ). Every -dimensional simplex with exactly facets not parallel to satisfies
Here is an outward normal of . Its sign against records whether the facet bounds lines parallel to from above or below; parallel facets contribute zero. Boundedness ensures both nonzero signs occur, so .
Start . There is one upper facet and one lower facet . Every line parallel to that meets has its two intersection endpoints on these facets. Thus when , and when . When , evaluates at , so subtracting from leaves . When , evaluates both facet support functions at , where they agree because the facets have the same projection. Their difference is therefore zero, again leaving . The reconstruction error is therefore , proving the claim for .
Step . Assume the claim for , and let have facets not parallel to . Two of them have the same nonzero sign. Their intersection is an -dimensional face . Let , and project orthogonally within onto . This is a two-dimensional plane, since and . All points of have the same projection c, because their differences lie in W. There are just two vertices of P outside C, so the projected simplex is a triangle with vertices c and the projections of those two vertices. The chosen facets project to its two sides meeting at c.
The chosen facet normals are orthogonal to W, so their signs against equal their signs against its projection. This projected direction is nonzero, since the chosen facets are not parallel to . If both sides are upper, moving from c opposite to this direction enters the triangle; if both are lower, moving in this direction enters it. Continuing meets the interior of the opposite edge. The inverse image of the line through c in this direction is a hyperplane in containing C and parallel to . It cuts the edge joining the two vertices outside C at an interior point and divides P into two -dimensional simplices. Each keeps one of the two chosen facets and replaces the other by the new facet parallel to . Its other facets retain their normal directions, so each new simplex has exactly facets not parallel to .
Write for the reconstruction error on the left of (62). Let and be the two new simplices, let be their common cutting facet, and write for the chosen facets and for every other facet of . With , applying (55) to and to every split facet gives the exact residual identity
Indeed, the inherited facets retain their signs, while the two copies of are parallel to and therefore have sign zero. By the induction hypothesis, ; moreover, and . Equation (61) therefore puts every term on the right of (63) in . This proves the claim for and completes the induction.
Conclusion for . Apply (62) to every simplex support-function term in the expansion of , keeping its original coefficient. A facet parallel to has , so its term in the reconstruction formula is zero and can be omitted. For each remaining occurrence of a facet, choose outward from its simplex and put
Thus the coordinate with index 1 is normalized to 1; the coordinate with index 0 remains zero because . Oppositely oriented parallel normals give the same . Only the normal is rescaled: the support function and its coefficient are unchanged.
Let be the finite set of vectors obtained this way. For each , define by adding all facet support-function terms with , retaining their signs and weights. An occurrence of as a facet of contributes , while an occurrence as a facet of contributes . These are precisely the terms with the same normalized normal, including all repetitions.
More explicitly, define to be the sum of the linear apex terms and the weighted Kuhn subdivision errors in (56). Then
For a simplex P, collect its facets with normalized normal u as
An empty sum is zero. If , the direction exposes ; if it is negative, exposes . The opposite face is a single vertex, so (57) gives the signed facet term up to a linear function. If neither nor exposes a facet of , both exposed faces have dimension at most . Thus
. Applying this to the full weighted expansion, with the same permutations and nonempty cut sets as in (42), gives
(67)
Together with (53), relation (67) puts every in . By linearity, the sum of the reconstructed facet terms is , which lies in by (61). Its difference from consists of the reconstruction and subdivision remainders, also in . Hence . This finishes the proof of Step 7.2.
Step 7.3 (Prove the class identity by induction).
Claim (induction on N). The class identity (45) holds for every .
Start . Here , so the nonempty cut set must be . The tree has the single edge , with and . Equation (41) gives
(68)
Each term has coefficient . For each apex label there are two orders of the remaining labels, and both give . Grouping the six positive terms by their apex gives
On , and . Hence , proving (45) for .
Step ( ). Assume the class identity for . By Step 7.2, it suffices to prove for every . By (38), applying replaces each support function by : we select the maximizing and minimizing faces in direction and subtract their support functions. The linear apex terms disappear. For , these faces contain exactly the vertices with largest and smallest coordinate values , including . For a caterpillar base, the segment remains free when ; its maximizing endpoint is when and 0 when . The minimizing face uses the opposite choices.
We discard support-function contributions already in and cancel the remaining ones. Induction is needed only when one of differs from the common value of all the others: the exposed simplex facet and the surviving caterpillar sum then give the same problem with inputs.
Discarding contributions in . Fix , since . A face of contained in its base has a support function that is a linear function plus support functions of segments, hence belongs to ; the apex alone contributes zero. If at least two edges join labels with unequal , at most segments remain free, so even adjoining the apex gives dimension at most . Thus we need only faces containing the apex and an exposed base face, with at most one edge joining unequal values.
Removing the unique unequal edge splits the tree into two components on which the are constant. Treat the selected exposed sign as positive, replacing by for the negative face and renaming the levels. The condition that the apex and exposed base tie gives
Indeed, the exposed base value is in the spine case and in the leaf case. With no unequal edge all tree values agree. Consequently, only two distinct coordinate values or the three values with can contribute. This exhausts both exposed signs; all other directions are already handled by the dimension bound.
Cancellation for three distinct values. For , , , ..., , let be the reduced linear map induced by exchanging the two exceptional simplex vertices and subtracting the new value at vertex 0. It is a rank-one reflection: for a linear functional with , and a linear function , permutation symmetry gives
Positive homogeneity then compares the one-sided derivatives explicitly:
Thus
The two exposed simplex faces are vertices, so their support functions are linear as well.
Cancellation for two values, each repeated. After the preceding dimension bound, every term still requiring cancellation has a unique split with . If the apex label has the latter value, toggle membership of in . Otherwise, exchange the equal-valued labels , and toggle membership of . Repetition of both values gives in the first case and in the second, so the operations are defined; the unchanged cut at keeps the cut set nonempty. The transformed term remains in the same case, and repeating the operation returns the original term. If denotes this involution on the active terms and , then
Inactive fixed points of the global transformation are already in by the dimension bound. Summing the active pairs therefore puts in . Each exposed simplex face has at most vertices and hence dimension at most , so without using induction.
One exceptional coordinate: the induction hypothesis. We are still working in , so . It remains to consider two values, one occurring only once. Choose a permutation such that is the exceptional label. Relabeling must be followed by subtracting the new zeroth coordinate to stay in :
Its zeroth coordinate is zero, and its inverse is . It sends to with . This change preserves every and changes only by a linear term, annihilated by ; we transform both the input and the direction. Rescaling the direction, and reversing the sign of if necessary, reduces to within .
This direction exposes the -dimensional facet and the opposite vertex 0. Hence
Here is the exact use of the induction hypothesis. Every caterpillar maximum increases by a common added constant. Averaging over the lower label orders cancels the factorial in the total signed coefficient, giving
(77)
The remaining inputs need not start with zero. Subtracting puts them in the lower-arity slice , exactly the domain of the induction hypothesis. Apply the -input class identity to on the right. Linear precomposition preserves , and the last term is linear. Since , this gives
Thus we must match the exposed caterpillar support functions with the lower-arity sum. We prove
To identify the contributing terms, put . Deleting this position gives an order that maps positions bijectively to labels . Modulo it is enough to retain precisely the cases
The omitted cases have a base-only face, an apex alone, or an apex-base face with too few free segments, and therefore lie individually in . For , let insert a gap at the prospective pendant position . Given a lower cut set , the three active insertion rules are
first end: ,
(81)
pendant i: ,
last end: .
In every row the upper permutation is uniquely obtained by inserting label 0 at position in . Conversely, with restricted to , the deletion rules are for the first end, for pendant , and for the last end. These operations are inverse. Criterion (80) assigns every active index uniquely to the first row, to the pendant row when , or to the last row when and . Thus a nonempty has pendant and two endpoint preimages, whereas has only the two endpoints because upper cut sets are nonempty.
Extend the lower caterpillar notation to by setting its last spine position and every parent equal to 0, so its head begins at the root . For every lower label order put
(82)
For each upper preimage of , the insertion identities and the literal factorial coefficients are
pendant:
endpoint:
Thus every one of the preimages contributes 1/N of the lower summand modulo , and together they recover its coefficient in .
The extra terms are the two endpoint fibres whose deletion leaves , hence a rooted star. By (83), each contributes of the weighted lower summand modulo . For a fixed lower order , the nonroot positions are , including the original apex position 0. For , let exchange positions 0 and , keeping the root at position 1; the exchange at is the identity. Put
The Boolean alternating identity gives
The empty term is a sum of support functions of segments. For , the polytope with support function has one head direction and segment directions, hence dimension at most . Thus the singleton sum lies in ; the sum of the linear apex coordinates lies in . Each fixed-position exchange is a bijection on lower label orders, so
Since , the full empty-cut sum belongs to . The empty-cut coefficient and the factor from the two endpoint fibres are scalars, so the extra star sum lies there as well. This proves (79).
Combining (76), (78), and (79) now gives
(87)
The first bracket belongs to by coordinate deletion, the second by the induction hypothesis. This proves the bound for every direction. Step 7.2 gives , completing the induction, and Step 7.1 gives the dictionary representation. This finishes the proof of Theorem 7.
4 NETWORK SIZE
We prove Theorem 2 directly. First we bound the number of normalized caterpillar face descriptions. Then we construct one shared first layer and account for both widths.
Proof of Theorem 2. Fix . Theorem 7 and Lemma 6, followed by (33), give the exact tagged expansion of .
Step 2.1 (Count the caterpillar face functions). We first rewrite each face function using only its adjusted head and the hinges that remain. This lets us recognize when different face descriptions require the same second-layer neuron. An edge kept linearly is added to the head, an omitted edge disappears, and an edge kept as a hinge stays in the set M. Thus
The resulting function description is in the sense of Definition 4: is the adjusted head, and contains precisely the retained hinges. When two resulting pairs have the same adjusted head and the same hinge set, they can use one second-layer neuron, with their output coefficients added. Distinct pairs may still represent the same function, so counting these pairs gives an upper bound. The shared first layer is constructed in the next step. We next orient the remaining hinges consistently. By (10), applied to each with , the same face function has the normalized description , where
(89)
Every remaining hinge now has orientation with , and the additional linear terms have been absorbed into . No edge function of a caterpillar is the negative of another one, so and have the same size.
For a caterpillar description , the spine endpoints are labelled and , and every label other than and the apex is the child of exactly one edge. Hence the normalized description of is
(90)
It depends only on the undirected tree, the apex, and the unordered pair of spine endpoints, not on the order of the leaves at a spine vertex or on the orientation of the spine. For a spine with vertices, choose its vertex set in ways, its order up to reversal in ways, its apex in ways, and the attachment of each of its leaves in ways. Reversal has no fixed point since . Every caterpillar has such data, so by (6)
Reversing an edge function swaps its omitted and linear states, so normalizing before or after choosing the states gives the same descriptions. Every face tag therefore has a normalized description obtained from by choosing one of three states for each of its edge functions. Let be the set of these normalized descriptions and let be normalization. For , write . With (91), . Only equal normalized descriptions are merged; distinct members of are not identified merely because they represent the same function.
Among them are the pair-hinge descriptions with : for the all-cut path with apex and last spine vertex , omitting every edge function gives
The linear heads are distinct for distinct ordered pairs. Their pair-hinge functions are distinct as well: equality of two such ReLUs makes their positive half-spaces equal, so their heads are positive scalar multiples, and equality on that half-space makes the scalar one. Let be the subset of consisting of every normalized description with empty hinge set and head equal to a coordinate difference; these are exactly the keys eligible for absorption into the first-layer remainder. The descriptions above show that . Aggregate the tagged coefficients only along equal normalized face descriptions:
Discard zero fiber sums, then remove the absorbable keys:
By (10), every unit indexed by lies in the span of the auxiliary functions and needs no second-layer unit. Since ,
This finishes the proof of Step 2.1.
Step 2.2 (Compile the network and establish its widths). The terms not assigned a retained neuron form the explicitly known remainder
By (33) and (93)–(95), . Expand the absorbed pair hinges using (10) to write as a linear combination of the auxiliary functions (20). The first layer outputs the vector
Thus has rows and , then for , then for , using a fixed ordering within each block. Its row count is
By (10), these features recover all coordinates,
For each , substitute (100) into and collect the coefficients of into a row vector . Every hinge in already has the orientation , so its coefficient is added directly to the corresponding feature.
To specify the remaining row, collect the auxiliary coefficients of R as
Each retained unit is translation invariant by (21), so
The coefficient sum follows by setting and . Now choose large enough that every is nonnegative. Substituting the auxiliary expansion into (102) cancels and gives
Substitute (100) into this expression and collect the coefficients of into . Thus both and are specified by finite sums of the previously defined coefficients.
For any fixed ordering of K, the Caterpillar Net has second-layer rows and output weights
The first neurons output , and the last two output and . Thus
By (96), the second-layer width is at most
Zero padding realizes the stated widths exactly.
For the growth rates, count the ordered choices of m spine labels:
Using and in each summand of (6) gives
(108)
Thus no Stirling estimate is needed. Since for , the widths satisfy
Taking logarithms gives (8). This finishes the proof of Theorem 2.
Formalization (Lean_10) Linked definitions, lemmas, and theorems are audited against exact types; only propext, Classical.choice, and Quot.sound are allowed. The repository contains the maximum construction and its proof. The general CPWL results in the introduction are cited background results; the equation links in the Wang–Sun theorem lead to its published source. Claude and Codex assisted with formalization and manuscript preparation.
5 CONCLUSION
The first hidden-layer width is asymptotically sharp. Building on the extremal-graph approach of Safran (2026), our separate Lean development extends the bound of Lu (2026, Theorem 2.13), for , to networks with arbitrary affine skip connections. When every first-layer weight vector is proportional to some , we sharpen it to . We obtain no growing lower bound for ; finding smaller exact maximum representations and establishing such lower bounds remain open.
REFERENCES
Egor Bakaev, Florestan Brunck, Christoph Hertrich, Jack Stade, and Amir Yehudayoff. Better neural network expressivity: Subdividing the simplex. In Proceedings of the 58th Annual ACM Symposium on Theory of Computing, pages 500–507, 2026. doi:10.1145/3798129.3800768.
Florestan Brunck, Jack Stade, and Amir Yehudayoff. Computing in Depth 2—Proof Overview. Unpublished draft supplied to the author, October 2026.
Moritz Grillo, Christoph Hertrich, and Georg Loho. Depth-bounds for neural networks via the braid arrangement. Advances in Neural Information Processing Systems, 38:127800–127818, 2025. doi:10.52202/085713-4257.
Christoph Hertrich, Amitabh Basu, Marco Di Summa, and Martin Skutella. Towards lower bounds on the depth of ReLU neural networks. SIAM Journal on Discrete Mathematics, 37(2):997–1029, 2023. doi:10.1137/22M1489332.
Shunqi Lu. Sharp closure thresholds for two-hidden-layer ReLU networks. Preprint, version 1, September 2026. doi:10.5281/zenodo.22728502. Author's PDF.
Itay Safran. A depth hierarchy for computing the maximum in ReLU networks via extremal graph theory. In Proceedings of the 39th Conference on Learning Theory, volume 336 of Proceedings of Machine Learning Research, pages 5721–5742, 2026. PMLR 336.
Shuning Wang and Xusheng Sun. Generalization of hinging hyperplanes. IEEE Transactions on Information Theory, 51(12):4425–4431, 2005. doi:10.1109/TIT.2005.859246.