Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Building any shape from simple pieces
With enough small, straight Lego bricks you can build something that looks like a smooth curve. Use more, smaller bricks and the curve gets smoother. A neural network does the same thing with neurons. Each one contributes a simple bend or step, and adding up enough of them can trace out any shape.
That’s the universal approximation theorem: one hidden layer can approximate anything continuous. But “enough neurons” can mean astronomically many, and the theorem doesn’t say how to find the right ones.
Engineers replace expensive physics models (aerodynamic tables, contact dynamics, sensor calibrations) with neural networks. Universality says that’s possible in principle. Approximation rates tell you how big the network must be, and that decides whether it fits on a robot’s onboard computer.
- 1. More, smaller bricks make the curve…
- 2. The universal approximation theorem guarantees…
- 3. Each ReLU neuron adds one…
Level 1: Beginner
★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.A network you can build by hand
A one-hidden-layer network computes . With ReLU , each unit is flat and then a straight ramp, bending at .
- A hat function from three units: rises from 0 to 1 on and falls back to 0 on .
- Any piecewise-linear function with knots is , where are the slopes. That’s one hidden unit per interior knot.
- So a ReLU layer can match the piecewise-linear interpolant of any continuous . That interpolant converges uniformly as the knots get denser (A3.5-2). This is universality in 1-D, proved by construction.
With sigmoids, approaches a step as , and sums of steps make staircases. That’s Cybenko’s original route.
- 1. hat(0.5) with hat = relu(x) − 2relu(x−1) + relu(x−2)?
- 2. A piecewise-linear interpolant with 9 knots needs how many hidden ReLUs?
- 3. A steep sigmoid looks like a…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.The theorems
- Cybenko (1989): sums with a continuous sigmoidal are dense in for compact , in the sup norm.
- Hornik, Stinchcombe and White (1989) extended this to general “squashing” functions and to norms.
- Leshno, Lin, Pinkus and Schocken (1993): a one-hidden-layer network with a continuous activation is universal if and only if the activation is not a polynomial. A polynomial activation of degree can only produce polynomials of degree .
What the theorem doesn’t say
- How many units. The width needed depends on the target’s smoothness and dimension.
- How to find the weights. Training is non-convex optimization.
- Generalization. It’s about representing on all of , not learning it from finite samples (B1, B2).
- Extrapolation. Outside the compact set , nothing is promised.
Rates: smoothness and dimension
In 1-D, the ReLU interpolant with pieces has error . In dimensions, a grid with the same spacing has cells. Reaching error for a target generally needs about parameters for any method that depends continuously on (DeVore, Howard and Micchelli, 1989). That’s the curse of dimensionality. Deep learning works in high dimensions because real targets have extra structure:
- low intrinsic dimension (A3.5-1’s covering numbers);
- compositional structure;
- the Fourier-moment condition that defines Barron spaces.
- 1. Which activation is NOT universal in one hidden layer?
- 2. Halving the knot spacing reduces the interpolation error by…
- 3. The universal approximation theorem says nothing about…
Level 3: Advanced
★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.Why polynomials fail and ReLUs succeed
If is a polynomial of degree , every is a polynomial of degree , and so is any sum of them. They form a finite-dimensional subspace, which is closed and can’t be dense in the infinite-dimensional . For non-polynomial , Leshno et al. show the closure contains all polynomials, which are dense by Weierstrass (A3.5-2).
Proof sketch: 1-D ReLU universality
Let and .
- Pick the spacing. is uniformly continuous, so choose with whenever .
- Interpolate. The piecewise-linear interpolant on a grid of spacing takes values between neighbouring values on each cell, so everywhere.
- Write it as a network. is exactly a one-hidden-layer ReLU network, with one unit per interior knot. ∎
In dimensions a standard route is to approximate by ridge functions . Each 1-D is then approximated by ReLUs as above. Ridge functions are dense by a Fourier/Radon argument (Pinkus, 1999).
Depth separation
Composing the tent map with itself times gives a sawtooth with linear pieces, using only ReLUs. A one-hidden-layer network with units has at most pieces in 1-D. So it needs about units to match, and is otherwise far away in (Telgarsky, 2016). Some functions are exponentially cheaper to represent with depth (Practice Code 5; Eldan and Shamir, 2016).
Exercise 3.1: How many linear pieces can a one-hidden-layer ReLU network with N units have on ℝ?
Each unit adds at most one kink, so there are at most kinks and pieces. Depth multiplies, rather than adds, pieces.
- 1. Polynomial activations fail because the network's outputs lie in…
- 2. The 1-D ReLU proof relies on…
- 3. k composed tent maps (2k ReLUs) give how many pieces?
Level 4: Expert
★★★★★ Expert⏱ 45 minResearchers: original papers and open problems.Beyond existence: rates that beat the curse
Barron (1993): if ’s Fourier transform has a finite first moment, , then a one-hidden-layer sigmoid network with units achieves error . The rate doesn’t depend on the dimension . The proof is probabilistic: sample units at random from an integral representation, and the error averages out like Monte Carlo. Modern refinements define Barron spaces and show they’re the natural function spaces for shallow ReLU networks (E, Ma and Wu, 2022). Training only the output layer of random features gives the related kernel or random-features rates (Rahimi and Recht, 2008), which Exercise 2 explores.
Universality across architectures and applications
- Operators. Chen and Chen (1995) proved universal approximation of operators. That’s the theory behind DeepONet and neural operators for PDE surrogates (A3.4-4, A3.5-6). Kovachki et al. (2023) extended it to neural operators.
- Sequence models and control. RNNs approximate dynamical systems on finite horizons, and transformers are universal approximators of sequence-to-sequence functions (Yun et al., 2020). In control, universal approximation of value functions and policies underlies neural-network MPC and approximate dynamic programming. Lipschitz and stability constraints (A3.5-3) are the price of safety.
- Invariant and equivariant networks. DeepSets are universal for permutation-invariant functions (Zaheer et al., 2017). Equivariant networks are universal within their symmetry class, which matters for point clouds and molecules.
- Honest takeaway. Universality rules out “the architecture can’t represent it” as an excuse. It does not explain why training finds good solutions or why they generalize. Those are optimization (A6) and learning-theory (B1, B2) questions.
References
- G. Cybenko (1989). “Approximation by superpositions of a sigmoidal function.” Mathematics of Control, Signals and Systems, 2.
- K. Hornik, M. Stinchcombe, H. White (1989). “Multilayer feedforward networks are universal approximators.” Neural Networks, 2(5).
- M. Leshno, V. Lin, A. Pinkus, S. Schocken (1993). “Multilayer feedforward networks with a nonpolynomial activation function can approximate any function.” Neural Networks, 6(6).
- A. Pinkus (1999). “Approximation theory of the MLP model in neural networks.” Acta Numerica, 8.
- A. Barron (1993). “Universal approximation bounds for superpositions of a sigmoidal function.” IEEE Transactions on Information Theory, 39(3).
- M. Telgarsky (2016). “Benefits of depth in neural networks.” COLT.
- R. Eldan, O. Shamir (2016). “The power of depth for feedforward neural networks.” COLT.
- R. DeVore, R. Howard, C. Micchelli (1989). “Optimal nonlinear approximation.” Manuscripta Mathematica, 63.
- W. E, C. Ma, L. Wu (2022). “The Barron space and the flow-induced function spaces for neural network models.” Constructive Approximation, 55.
- T. Chen, H. Chen (1995). “Universal approximation to nonlinear operators by neural networks with arbitrary activation functions and its application to dynamical systems.” IEEE Transactions on Neural Networks, 6(4).
- A. Rahimi, B. Recht (2008). “Random features for large-scale kernel machines.” NeurIPS.
- C. Yun et al. (2020). “Are transformers universal approximators of sequence-to-sequence functions?” ICLR.