The universal approximation theorem says a network with one hidden layer can approximate any continuous function. It says nothing about how many units that takes.
We will count linear pieces, compose tents, prove a depth separation, and finish with what it means for real data.
Step 1: Counting linear pieces
A ReLU network computes a piecewise-linear function: on a line of inputs, it is a chain of straight segments joined at kinks. A one-hidden-layer network on a single input is a sum of terms aᵢ·max(0, wᵢx + bᵢ), and each unit contributes exactly one kink, where wᵢx + bᵢ = 0. So with m hidden units the function has at most m kinks, which means at most m + 1 linear pieces.
Turned around: a function with P pieces needs at least P − 1 hidden units in a shallow network. Pieces are a currency for comparing architectures.
Step 2: Composing tents
The tent map t(x) = 2·min(x, 1 − x) rises from 0 to 1 and falls back on [0, 1]: two linear pieces, built from two ReLU units. Composing it with itself, t(t(x)), runs the tent twice across each half, giving four pieces; each further composition doubles the count. After k compositions there are 2k pieces, a sawtooth with 2k − 1 teeth.
A deep network computes this with k layers of 2 units: about 2k units in all. Composition multiplies pieces, while adding units side by side only adds them.
Step 3: Depth separation
Put the two counts together. The k-fold tent has 2k pieces, so a shallow network needs at least 2k − 1 units to reproduce it exactly, while a deep one uses about 2k. Matus Telgarsky (2016) proved more: shallow networks cannot even approximate such sawtooth functions well without exponentially many units. Universal approximation is true, but it can be wildly inefficient.
Depth helps because each layer reuses the previous layer's output: one computation is applied again and again to what came before.
Step 4: What it means for real data
Depth separation shows that some functions are cheap for deep networks and expensive for shallow ones, not that every function is. The argument for depth in practice is that real data often has compositional structure: images are built from edges, then textures, then parts, then objects; sentences from words, phrases and clauses. A function that mirrors such structure is a composition of simpler functions, which is exactly what deep networks compute cheaply.