Universal Approximation Theorem
Volume II, Chapter 6 — Part II. Why neural networks can approximate any continuous function: Cybenko's theorem, constructive proofs, depth vs. width tradeoffs, and the theoretical limits of expressivity.
Prerequisites
Table of Contents
- Learning Objectives
- Prerequisites
- Notation
- Core Intuition
- Problem Statement
- Cybenko's Theorem (1989)
- Constructive Proof Sketch
- Depth vs. Width
- Activation Function Requirements
- Approximation Rates and Limitations
- From Existence to Learnability
- Worked Examples
- Connection to the Broader Curriculum
- Common Pitfalls and Misconceptions
- Research Perspective
- Summary of Takeaways
- Exercises
Learning Objectives
After reading this chapter, you should be able to:
- State the Universal Approximation Theorem (UAT) for single-hidden-layer feedforward networks.
- Explain the role of the activation function and why nonlinearity is essential.
- Distinguish between approximation existence (UAT) and learnability (optimization, generalization).
- Compare depth vs. width tradeoffs in network expressivity.
- Describe constructive proof strategies (Ridge functions, Fourier sums).
- State the limitations of UAT: no bounds on network size, no guarantee of efficient approximation.
Prerequisites
- Backpropagation — feedforward network architecture
- Matrix Operations & Linear Transformations — linear maps, composition
Notation
- — Nonlinear activation function
- — Continuous functions on compact set
- ** — Supremum (uniform) norm
- — Number of hidden units
- — Approximation tolerance
Core Intuition
Why do neural networks work at all? The Universal Approximation Theorem provides a foundational answer: a feedforward network with a single hidden layer containing sufficiently many neurons can approximate any continuous function on a compact domain to arbitrary accuracy.
This is an existence result — it says the capacity is there. It does not say:
- How many neurons are needed
- How to find the right weights (Backpropagation)
- That the network will generalize to unseen data
Nevertheless, UAT justifies the hypothesis class. Without it, there would be no theoretical guarantee that a neural network could represent the target function, regardless of training.
Series context. Part II of Chapter 6 (Deep Learning Foundations) in Volume II.
Universal Approximation
Problem Statement
Definition 1 (Feedforward Network). A single-hidden-layer network with activation is:
where , , and is the number of hidden units.
Definition 2 (Uniform Approximation). A sequence of functions approximates uniformly on compact if:
Definition 3 (Universal Approximation). An activation function has the universal approximation property if for every continuous and every , there exists and parameters such that .
Cybenko's Theorem (1989)
Theorem 1 (Cybenko, 1989). Let be a continuous, bounded, non-constant function. Let be compact. Then for every continuous and every , there exist , weights , and bias such that
Theorem 2 (Hornik, Stinchcombe, White, 1989). The same conclusion holds if is merely nonpolynomial (not a polynomial on any interval), without requiring boundedness. This covers ReLU: .
Corollary 1. ReLU networks with one hidden layer are universal approximators on compact domains.
Key observation. Only one hidden layer is needed for universality — but the number of hidden units may need to be very large. Depth provides efficiency, not capability (in the limit).
Constructive Proof Sketch
We outline the proof strategy for Theorem 1; full details appear in Cybenko (1989) and Hornik et al. (1989).
Step 1: Ridge Functions. Each hidden unit computes a ridge function — a function constant along directions orthogonal to . The network sums ridge functions with different directions and biases.
Step 2: Density of Ridge Function Sums. The set forms a linear subspace of (continuous functions on ).
Step 3: Hahn-Banach / Riesz Representation. Suppose is not dense. By the Hahn-Banach theorem, there exists a nonzero continuous linear functional on that vanishes on .
Step 4: Fourier Transform Argument. The Riesz representation gives for a signed measure . Setting and using the fact that vanishes on all ridge functions leads to a contradiction unless , via properties of the Fourier transform of .
Step 5: Conclusion. is dense in , so any continuous function can be approximated arbitrarily well.
Alternative Constructive Approach (Siggelkow, 2002). Approximate by a sum of step functions; approximate each step function by a difference of two sigmoids. This gives explicit (though inefficient) constructions.
Depth vs. Width
Theorem 3 (Depth Efficiency, informal). There exist functions that can be represented by a deep network of polynomial size but require an exponential number of neurons in a shallow network.
Example 1 (Parity Function). The parity function on bits requires a single hidden layer of size but can be computed by a network of depth with total neurons.
Proposition 1 (Depth Hierarchy). For ReLU networks, there exist depth- networks that cannot be represented by any depth- network without exponential width increase (Telgarsky, 2016; Eldan & Shamir, 2016).
Interpretation. UAT guarantees that some shallow network suffices, but it may require exponentially many neurons. Deep networks can represent certain functions much more efficiently. This is the primary theoretical motivation for depth.
Activation Function Requirements
Proposition 2 (Linear Activation Fails). If (identity), then is a linear function of regardless of . Non-constant linear functions cannot approximate nonlinear .
Proposition 3 (Polynomial Activation Fails). If is a polynomial of degree , then is a polynomial of bounded degree (independent of on each coordinate). Cannot approximate non-polynomial functions.
Proposition 4 (ReLU Suffices). is nonpolynomial and satisfies Theorem 2. ReLU networks are universal approximators.
Proposition 5 (Sigmoid Suffices). is bounded, continuous, non-constant — satisfies Theorem 1.
The activation must introduce nonlinearity that cannot be reduced to a fixed-degree polynomial.
Approximation Rates and Limitations
Definition 4 (Approximation Rate). The approximation rate asks: how many neurons are needed to achieve error ?
Theorem 4 (Barron, 1993). If has bounded Barron norm (integrability condition on its Fourier transform), then neurons suffice.
Theorem 5 (Curse of Dimensionality). For general continuous functions on , the worst-case approximation rate with smooth activations is . The number of neurons grows exponentially in dimension.
Limitations of UAT:
- No size bounds. UAT says approximation exists but not how large must be.
- No optimization guarantee. Finding the right weights is a separate (hard) problem.
- No generalization guarantee. Approximating training data does not imply test performance.
- Compact domain only. Approximation on all of requires additional growth conditions.
From Existence to Learnability
Definition 5 (Three Levels of Theory).
- Approximation — Can the network represent ? — UAT: yes
- Optimization — Can we find the weights? — Non-convex; no global guarantee (but works in practice)
- Generalization — Does it work on new data? — Requires capacity control, more data
Proposition 6 (NTK Regime). In the infinite-width limit, gradient descent on a neural network is equivalent to kernel regression with the Neural Tangent Kernel (Jacot et al., 2018). This connects approximation, optimization, and generalization in a specific regime.
UAT addresses only the first row. Modern deep learning theory aims to close the gap.
Worked Examples
Example 2: Approximating on
Using ReLU: (approximate integral representation). As , error .
Example 3: Step Function via Sigmoid
as . A sum of shifted sigmoids approximates piecewise constant functions, which approximate continuous functions (Weierstrass approximation).
Example 4: XOR Requires Hidden Layer
XOR is not linearly separable — a linear model (no hidden layer) cannot represent it. A network with one hidden unit of two ReLUs suffices: .
Connection to the Broader Curriculum
- Backpropagation — how we find the approximating weights
- Self-Attention — Transformers also satisfy universal approximation (Yun et al., 2020)
- Universal Approximation for Transformers — depth- Transformer can approximate sequence-to-sequence maps
- Bias–Variance Tradeoff — generalization beyond approximation
Common Pitfalls and Misconceptions
Pitfall 1: "UAT proves deep learning works." UAT proves representational capacity, not that gradient descent finds good weights or that the network generalizes.
Pitfall 2: "One hidden layer is enough, so depth is unnecessary." UAT allows exponentially many neurons in one layer. Depth provides efficiency.
Pitfall 3: "Any activation works." Polynomial activations fail. The activation must be nonpolynomial.
Pitfall 4: "UAT applies to all network architectures." UAT is proven for feedforward networks. CNNs, RNNs, and Transformers have separate (but analogous) results.
Pitfall 5: Confusing approximation on compact sets with global approximation. Functions on all of may require networks that grow with the domain.
Research Perspective
Cybenko (1989) and Hornik, Stinchcombe, and White (1989) established UAT independently, building on earlier work by Kolmogorov (1957) and Arnold (1957) on superposition theorems.
Modern directions:
- Depth separation (Telgarsky, 2016): formal exponential gaps between deep and shallow networks
- Transformer universality (Yun et al., 2020): Transformers are universal approximators for sequence functions
- Neural Tangent Kernel (Jacot et al., 2018): infinite-width limit connects to kernel methods
- Approximation with constraints (sparsity, quantization): how Quantization affects expressivity
UAT remains the starting point for any theoretical discussion of neural network expressivity.
Summary of Takeaways
- UAT — One hidden layer + nonpolynomial suffices for uniform approximation on compact sets
- ReLU — Nonpolynomial → universal
- Depth — Exponential efficiency gains over width for some functions
- Limitations — No size bounds, no optimization/generalization guarantees
- Three levels — Approximation ≠ optimization ≠ generalization
Next article: Batch Normalization →
Exercises
Exercise 1. Prove that a network with linear activation can only represent linear functions, regardless of depth or width.
Exercise 2. Show that XOR requires at least one hidden unit (not linearly separable in input space).
Exercise 3. Construct a ReLU network with 3 hidden units that exactly represents on .
Exercise 4. Explain why the parity function on bits requires hidden units in one layer but neurons with depth.
Exercise 5 (Conceptual). UAT guarantees approximation exists. Why does this not imply that gradient descent will find it?
Exercise 6. State the difference between Cybenko's theorem (bounded ) and Hornik's extension (nonpolynomial ). Which covers ReLU?
Exercise 7. Research question: formulate what a "Universal Approximation Theorem for Transformers" would state.
Exercise 8. Give an example of a continuous function on where a 2-neuron sigmoid network provides a good approximation, and explain the construction.