Foundations to Frontier
Tests
B. Statistical Learning Theory › B4 Theory of deep learning

Universal Approximation Theorems

A neural network with one hidden layer and enough units can approximate any continuous function on a compact set as closely as you like (Cybenko 1989, Hornik 1991, Leshno et al. 1993, for any non-polynomial activation). This topic proves it constructively for ReLU (piecewise-linear interpolation) and sigmoids (staircases), derives approximation rates (1/N² vs 1/N in 1-D), and explains what the theorem does not say: how many units are needed in high dimensions (exponentially many for generic smooth functions; Barron's theorem gives dimension-free rates for a special class) and how to find the weights. The research exercise measures the curse of dimensionality for random-feature networks.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Enough kinks can draw anything

Take a stick of modelling clay and bend it at a few points. With three bends you get a rough zig-zag; with fifty you can trace almost any curve you like. A neural network’s hidden units are those bends: each ReLU unit adds one kink to a straight line. With enough of them, one hidden layer can follow any continuous curve as closely as you want. That’s the universal approximation theorem.

One hidden layer can draw any curve
target: units:
network with 6 hidden ReLU units · max error 0.1340 · bound h²·max|f″|/8 applies to smooth targets
Dashed: the target; orange: the network ĝ(x) = c + Σ vₖ·unitₖ(x); faint: each unit's contribution. Each ReLU adds a kink, so N of them trace the polyline through N + 1 knots, and doubling N cuts the error about 4× on smooth targets. Each steep sigmoid adds a step, which only halves the error. Neither can fix a jump exactly (try "step"), but the error region shrinks. This is the universal approximation theorem made concrete: width buys accuracy, though nothing here says how to find the weights from data, or how many units a high-dimensional target needs.
Why engineers care

The theorem is the licence for using neural networks as general-purpose function approximators: learned dynamics models, controllers, value functions and perception heads. It also comes with fine print: it promises the weights exist, not that you can find them from limited data, or that a reasonable number of units will do in high dimensions.

📝 Quick check (Level 0)
0/3 answered
  1. 1. A single ReLU unit adds…
  2. 2. More hidden units generally give…
  3. 3. The theorem guarantees that good weights…

Level 1: Beginner

★★☆☆☆ Basic⏱ 25 minSecondary-school mathematics: arithmetic and elementary algebra.

Statement

Let σ be continuous and not a polynomial. For every continuous f on a compact K⊂RdK\subset\mathbb R^d and every ε above 0, there exist N, vk,bk∈Rv_k, b_k\in\mathbb R and wk∈Rdw_k\in\mathbb R^d such that

sup⁡x∈K∣f(x)−∑k=1Nvk σ(wk⋅x+bk)∣<ε.\sup_{x\in K}\Big|f(x) - \sum_{k=1}^Nv_k\,\sigma(w_k\cdot x + b_k)\Big|\lt\varepsilon.

(Cybenko for sigmoids; Hornik; Leshno, Lin, Pinkus and Schocken for any non-polynomial σ.) Polynomial activations fail: a degree-p polynomial network is always a polynomial of degree at most p.

ReLU in 1-D: an explicit construction

The piecewise-linear interpolant through knots t0<⋯<tNt_0\lt\dots\lt t_N is

g(x)=f(t0)+∑kvk relu(x−tk),v0=s1, vk=sk+1−sk,g(x) = f(t_0) + \sum_kv_k\,\mathrm{relu}(x - t_k),\quad v_0 = s_1,\ v_k = s_{k+1} - s_k,

where sks_k are the slopes. That is one ReLU per knot.

📝 Quick check (Level 1)
0/3 answered
  1. 1. Which activation is NOT universal?
  2. 2. The ReLU output weight at knot tₖ equals…
  3. 3. Parameters of a 1 → 10 → 1 network with biases:

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.

Rates in one dimension

ReLU (linear interpolation). For f∈C2f\in C^2 on [0, 1] with N equal intervals of width h = 1/N,

∥f−g∥∞≤h28max⁡∣f′′∣=max⁡∣f′′∣8N2.\|f - g\|_\infty\le\frac{h^2}8\max|f''| = \frac{\max|f''|}{8N^2}.

Sigmoid staircase. Steps of height f(tk)−f(tk−1)f(t_k) - f(t_{k-1}) at the midpoints give error about h2max⁡∣f′∣\tfrac h2\max|f'|, of order 1/N. Sigmoids can do better with cleverer constructions, but the staircase is the textbook proof.

Many dimensions: the catch

Approximating a generic function with s bounded derivatives in d dimensions to accuracy ε needs on the order of ε−d/s\varepsilon^{-d/s} units. That is exponential in d, the curse of dimensionality.

Barron’s theorem (1993): if Cf=∫∥ω∥ ∣f^(ω)∣ dωC_f = \int\|\omega\|\,|\hat f(\omega)|\,d\omega is finite, then N units achieve L2L^2 error O(Cf/N)O(C_f/\sqrt N), independent of d. The catch is that the hidden weights must be learned, not fixed.

🐍 Exercise 1: constructive approximation rates
Build the ReLU network that interpolates a smooth function at N + 1 knots and the N-unit sigmoid staircase, measure the sup error as N doubles, and confirm the 1/N² vs 1/N rates and the h²·max|f″|/8 bound.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Doubling N for the ReLU interpolant cuts the error by about…
  2. 2. Barron's rate is…
  3. 3. Generic smooth functions in d dimensions need roughly…

Level 3: Advanced

★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.

Proof sketch (Cybenko style)

Suppose the span S of {σ(w⋅x+b)}\{\sigma(w\cdot x + b)\} is not dense in C(K). By Hahn–Banach and Riesz there is a non-zero signed measure μ with ∫σ(w⋅x+b) dμ=0\int\sigma(w\cdot x + b)\,d\mu = 0 for all w and b. For sigmoids, scaling w and b makes σ(λ(w⋅x+b))\sigma(\lambda(w\cdot x + b)) converge to an indicator of a half-space, so μ annihilates every half-space. Then its Fourier transform vanishes along every line, so μ = 0, a contradiction. ∎

Why polynomials fail and everything else works

Leshno et al. show the span is dense exactly when σ is not a polynomial. The idea: derivatives in w of σ(wx+b)\sigma(wx + b) at w = 0 give xkσ(k)(b)x^k\sigma^{(k)}(b), so all monomials are in the closure if σ(k)(b)≠0\sigma^{(k)}(b)\ne0 for every k, which happens for non-polynomials. Then Weierstrass finishes the proof. The same argument extends to ridge functions in d dimensions.

Two kinds of hidden layer

  • Fixed random features + trained output: a kernel method (B3). These suffer the curse of dimensionality on targets that don’t align with the random directions.
  • Trained hidden layer: can find the few relevant directions (feature learning), which is how Barron-type rates are achieved.
📝 Quick check (Level 3)
0/3 answered
  1. 1. Cybenko's proof uses…
  2. 2. Steep sigmoids approximate…
  3. 3. Random-feature networks are essentially…

Level 4: Expert

★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.

Approximation, measured

Exercise 1 (f = sin 2πx + x/2). The ReLU sup error is 0.0704, 0.0188, 0.0048 and 0.0012 for N = 8, 16, 32 and 64. That is about 4× per doubling, and right at the bound (2π)²/(8·64²) = 0.00120. The sigmoid staircase gives 0.257, 0.128, 0.064 and 0.032, exactly 2× per doubling.

Exercise 2: random ReLU features (only the output layer trained, 1500 samples). Relative test RMSE at widths 10/40/160/400:

d ridge target sin(3 w·x) product target Π sin(2xᵢ)
1 0.079 / 0.004 / 0.001 / 0.000 0.10 / 0.002 / 0.000 / 0.000
2 0.36 / 0.12 / 0.019 / 0.009 0.33 / 0.077 / 0.013 / 0.006
4 0.82 / 0.45 / 0.17 / 0.11 0.96 / 0.76 / 0.34 / 0.18
6 0.82 / 0.80 / 0.48 / 0.35 1.01 / 1.02 / 1.03 / 0.99

The 6-D product isn’t learned at all with 400 random units. Universality holds, but the width needed explodes with dimension when the hidden layer isn’t trained.

🐍 Exercise 2 (research): the curse of dimensionality for random features
Fit only the output layer of a random-ReLU network (least squares) to a ridge function and to a product of sines in d = 1, 2, 4, 6 dimensions. Measure the relative test RMSE as width grows and see how dimension changes the picture.

Universal approximation in AI, robotics and aerospace

  • Learned dynamics and controllers: neural-network models of aerodynamics or contact, and NN policies, rest on universality.
  • Physics-informed networks use universality to approximate PDE solutions (e.g. thermal fields).
  • Verification: ReLU networks are piecewise linear, which enables exact reachability analysis for safety-critical control.
  • Design caution: universality is not sample efficiency. Add structure (symmetry, physics) to beat the curse of dimensionality.

References

  1. G. Cybenko (1989). “Approximation by superpositions of a sigmoidal function.” Mathematics of Control, Signals and Systems, 2.
  2. K. Hornik (1991). “Approximation capabilities of multilayer feedforward networks.” Neural Networks, 4.
  3. M. Leshno, V. Ya. Lin, A. Pinkus, S. Schocken (1993). “Multilayer feedforward networks with a nonpolynomial activation function can approximate any function.” Neural Networks, 6.
  4. A. R. Barron (1993). “Universal approximation bounds for superpositions of a sigmoidal function.” IEEE Transactions on Information Theory, 39.
  5. A. Pinkus (1999). “Approximation theory of the MLP model in neural networks.” Acta Numerica, 8.