Skip to content
mlmentorship

Universal approximation theorem

Construct a ReLU approximation with a checked uniform error, then separate existence, training, generalization and extrapolation.

Published · 7 min read ·Core ·Foundation

Visual quick review

Interpret universal approximation as an existence claim that some finite network stays within a chosen uniform error tolerance over a compact domain, without inferring guarantees about width, training, generalization, or behavior outside that domain.

The quantifiers are the lesson

An explicit approximation inside the band proves existence here, not trainability or generalization

An explicit approximation stays inside an error ceilingFour straight segments stay close to the curved target throughout this interval. A construction with such a small error demonstrates that a fit exists. It does not establish that training will find it or that it generalizes outside the interval.Four line segments approximate thecurved targetMagnified error: its peak stays below0.02Maximum gap stays below 0.02 in thisinterval.
Read it this way: Four straight segments stay close to the curved target throughout this interval. A construction with such a small error demonstrates that a fit exists. It does not establish that training will find it or that it generalizes outside the interval. Does constructing these four segments prove a training algorithm will find them?
Full explanation 7 min read
Reading depth

Summary

Universal approximation establishes that suitable network parameters exist for a stated target class, domain and error measure. It does not establish that training finds them.

Approximate on using . Can its largest error be below everywhere, not just at chosen sample points?

The quantifiers are the lesson

Separate coarser ReLU construction: inspect the declared uniform-error tolerance

An explicit two-ReLU approximation to x squared on zero to one The solid quadratic x squared is surrounded by a tolerance band of plus or minus 0.07. The dashed ReLU approximation connects its values at zero, one half and one. Its largest vertical error is 0.0625 at one quarter and three quarters. Coordinates use 250 drawing units per input unit and 180 per output unit. The band and both curves represent these numeric values, not schematic deviations. ON COMPACT K: UNIFORM ERROR < ε f(x) = x²: solid g(x): dashed band: f(x) ± 0.07 1 0.25 0 error = 0.0625 0 0.5 1 COMPACT DOMAIN K = [0, 1] PROVIDES: SOME WIDTH AND WEIGHTS Uniform error below ε on the stated compact K. DOES NOT PROVIDE TRAINING SUCCESS No generic width or finite-sample generalization bound No constraint outside K
both curves meet at the three interpolation nodes. Their largest gap occurs between nodes and equals 0.0625, below the 0.07 band. This explicit construction is not a training result.
Check: What does the pictured error band establish on [0,1]? Which claims about training or generalization remain unsupported?
Reference drawing

The quantifiers are the lesson

An explicit approximation inside the band proves existence here, not trainability or generalization

An explicit approximation stays inside an error ceilingFour straight segments stay close to the curved target throughout this interval. A construction with such a small error demonstrates that a fit exists. It does not establish that training will find it or that it generalizes outside the interval.Four line segments approximate thecurved targetMagnified error: its peak stays below0.02Maximum gap stays below 0.02 in thisinterval.
Derivation
An explicit two-ReLU approximation to x squared on zero to one The solid quadratic x squared is surrounded by a tolerance band of plus or minus 0.07. The dashed ReLU approximation connects its values at zero, one half and one. Its largest vertical error is 0.0625 at one quarter and three quarters. Coordinates use 250 drawing units per input unit and 180 per output unit. The band and both curves represent these numeric values, not schematic deviations. ON COMPACT K: UNIFORM ERROR < ε f(x) = x²: solid g(x): dashed band: f(x) ± 0.07 1 0.25 0 error = 0.0625 0 0.5 1 COMPACT DOMAIN K = [0, 1] PROVIDES: SOME WIDTH AND WEIGHTS Uniform error below ε on the stated compact K. DOES NOT PROVIDE TRAINING SUCCESS No generic width or finite-sample generalization bound No constraint outside K
both curves meet at the three interpolation nodes. Their largest gap occurs between nodes and equals 0.0625, below the 0.07 band. This explicit construction is not a training result.
Check: What does the pictured error band establish on [0,1]? Which claims about training or generalization remain unsupported?
Read it this way: Four straight segments stay close to the curved target throughout this interval. A construction with such a small error demonstrates that a fit exists. It does not establish that training will find it or that it generalizes outside the interval. Does constructing these four segments prove a training algorithm will find them?

The theorem's quantifiers follow Cybenko (1989). The plotted ReLU construction and its error are calculated below.

Verify the error between nodes

On , . Its error is , maximized at with value . On , . The error is , with the same maximum at . Therefore .

At , but . Exact agreement at interpolation nodes did not imply zero error between them.

What the theorem says (precisely)

One classical version uses a continuous sigmoidal activation . For every continuous on compact and every , some finite-width network

satisfies . The output combines hidden units linearly. See Cybenko and Hornik. ReLU uses separate generalized results, including Pinkus. An arbitrary nonlinear activation is not sufficient; a fixed-degree polynomial activation does not give this shallow universality.

Change the approximation requirement

1. Require smaller uniform error

New task: approximate the same quadratic with error below .

Picture and change: use four segments of width :

Check: all five grid values match. On each interval, interpolation error is at most .

Use when: the target permits a constructive width-versus-error calculation.

2. Introduce a discontinuity

New task: uniformly approximate a unit step at using continuous network outputs.

Picture and change: compare the value at the jump with its left limit. Continuity forces them to agree, while the target jumps by one.

Check: uniform error below would require the same limiting value below and above . That is impossible.

Use when: checking whether the target-class assumption survives a changed task.

The bound does not extend outside K

At , this gives , while gives . The bound on says nothing about that point.

Try interpreting existence

Does existence of suitable weights prove that SGD finds them from random initialization?

Check your answer

No. Optimization and finite-sample generalization need separate assumptions and evidence. Even a constructive approximation does not establish a generic training procedure.

What the theorem does not say

The existence statement gives no generic small width, successful optimization or statistical generalization bound. Some proofs are constructive; the missing claim is a generally successful learning procedure. Without nonlinear activations, stacking affine layers still gives one affine map and cannot approximate arbitrary continuous targets.

Depth and representation efficiency

Telgarsky and Eldan and Shamir give depth-separation results under particular constructions and error measures. Mhaskar and Poggio study compositional structure. These results are not universal guarantees that deeper models train better or need fewer samples.

  • Barron-type rates: approximation in an appropriate norm requires controlled function-class norms; constants matter.
  • Kolmogorov-Arnold: continuous multivariate functions admit representations through continuous univariate functions. This does not guarantee efficient learned KAN approximations.
  • Bounded-width ReLU: Lu et al. give an universality result for integrable functions with width . Do not replace that norm with uniform error.

What to say in interviews

State target class, domain, activation and error norm. Distinguish some network existing from the chosen architecture, optimizer and sample achieving the desired outcome.

Common pitfalls

Matching finitely many samples does not verify uniform error. Changing the domain, norm or activation requires checking the relevant theorem again.