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.
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.
- 1. A single ReLU unit adds…
- 2. More hidden units generally give…
- 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 and every ε above 0, there exist N, and such that
(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 is
where are the slopes. That is one ReLU per knot.
- 1. Which activation is NOT universal?
- 2. The ReLU output weight at knot tₖ equals…
- 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 on [0, 1] with N equal intervals of width h = 1/N,
Sigmoid staircase. Steps of height at the midpoints give error about , 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 units. That is exponential in d, the curse of dimensionality.
Barron’s theorem (1993): if is finite, then N units achieve error , independent of d. The catch is that the hidden weights must be learned, not fixed.
- 1. Doubling N for the ReLU interpolant cuts the error by about…
- 2. Barron's rate is…
- 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 is not dense in C(K). By Hahn–Banach and Riesz there is a non-zero signed measure μ with for all w and b. For sigmoids, scaling w and b makes 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 at w = 0 give , so all monomials are in the closure if 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.
- 1. Cybenko's proof uses…
- 2. Steep sigmoids approximate…
- 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.
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
- G. Cybenko (1989). “Approximation by superpositions of a sigmoidal function.” Mathematics of Control, Signals and Systems, 2.
- K. Hornik (1991). “Approximation capabilities of multilayer feedforward networks.” Neural Networks, 4.
- 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.
- A. R. Barron (1993). “Universal approximation bounds for superpositions of a sigmoidal function.” IEEE Transactions on Information Theory, 39.
- A. Pinkus (1999). “Approximation theory of the MLP model in neural networks.” Acta Numerica, 8.