Universal approximation: read the conditions
通用逼近定理
State the continuous sigmoidal theorem precisely, then derive and execute a sharp ReLU interpolation bound for a quadratic.
universal-approximationA promise about existence, with conditions
Suppose someone says, “A neural network can approximate any function.” Before using that claim, ask: on which domain, under which error measure, with which activation, and with how many units? Without those details, the sentence can suggest guarantees that the mathematics never supplied.
Universal approximation describes the density of a family of functions: every target in a specified class can be approached arbitrarily closely under a specified notion of error. It does not identify a trained model. Cybenko’s 1989 paper, Theorem 2, printed page 308 gives the continuous sigmoidal case below. Deep Learning, Section 6.4.1 discusses why representability leaves optimization and generalization unresolved.
Start with multilayer perceptrons and norms. We state one precise theorem, sketch why it works, then build a different, explicitly solvable example to make approximation error tangible.
One precise version of the theorem
Let n be a finite positive integer and Iₙ=[0,1]ⁿ. Let f be continuous on Iₙ. Fix a continuous sigmoidal function σ: its limits at positive and negative infinity are 1 and 0. The logistic sigmoid qualifies. Then:
C(Iₙ) is the space of continuous real-valued functions on the cube. The supremum measures the worst absolute error over the whole cube, not just observed samples. N and the weights may depend on f and ε; this statement places no fixed upper bound on their size. The output is an unrestricted linear combination, not necessarily a sigmoid probability output. No training dataset or optimizer appears in the quantifiers.
Continuity of the target matters for this uniform version. A discontinuous step with a unit jump cannot be uniformly approximated to error strictly below 1/2 by continuous functions on an interval containing the jump. Approaching the jump from the left and using continuity forces the approximant’s value there to conflict with the value required on the right. Other approximation measures can permit discontinuous targets; those are different statements.
Why can sigmoid ridges suffice?
A proof sketch uses two advanced facts about continuous functions: Hahn–Banach separation provides a nonzero continuous linear functional if the span of the candidate functions is not dense; the Riesz representation theorem writes that functional as integration against a finite signed measure. In Cybenko’sTheorem 1, density follows if every such measure integrating all sigmoid ridges to zero must itself be zero.
Lemma 1 establishes that property for bounded measurable sigmoidals. Increasing a ridge’s slope makes it approach a half-space indicator, with a separately controlled boundary value. Vanishing integrals then force the half-space and boundary measures to vanish; the paper completes the argument through the Fourier transform. Combining the lemma with continuity gives Theorem 2. This outline identifies the proof’s dependencies; it does not derive those functional-analysis theorems from elementary calculus. See printed pages 305–308.
An explicit construction for one target
For f(x)=x² on[0,1], divide the interval into m equal pieces. Its linear interpolant can be written with ReLU units:
On this domain x=ReLU(x), so m hidden ReLU units and a linear output implement the formula. Each new hinge raises the slope by 2/m; the first slope is 1/m. These are exactly the successive chord slopes of x². This is our explicit construction for one polynomial, not a proof of a universal ReLU theorem and not an example satisfying Cybenko’s sigmoidal activation assumption.
On a cell[a,b] of width 1/m, subtract the quadratic from its chord:
The product is largest at the cell midpoint, where both factors equal 1/(2m). Thus the error bound covers the entire interval and is attained. To get error strictly below ε, choose an integer m greater than 1/(2√ε). This size bound comes from our special target, not from the general existence theorem.
Check the construction and its sharp error
The complete Python 3.12 program evaluates the hinges with exact rational arithmetic. Its audit visits every knot and midpoint. The analytic argument above proves that those midpoints attain the global maximum; sampling alone would not prove that fact.
from fractions import Fraction as F
def interpolate_square(x, intervals):
if type(intervals) is not int or not 1<=intervals<=256:
raise ValueError('one to 256 intervals required')
if type(x) not in (int,F) or not 0<=x<=1:
raise ValueError('rational x in [0,1] required')
x=F(x);m=intervals
return x/m+sum((F(2,m)*max(F(0),x-F(k,m)) for k in range(1,m)),F(0))
def audit(intervals):
interpolate_square(0,intervals)
m=intervals
grid=[F(i,2*m) for i in range(2*m+1)]
error=max(abs(interpolate_square(x,m)-x*x) for x in grid)
return error,F(1,4*m*m)
if __name__=='__main__':
for m in (1,2,4,8):
measured,bound=audit(m)
print('intervals:',m,'grid maximum:',measured,'proved uniform maximum:',bound)
x=F(3,8)
print('m=4 at x=3/8: prediction',interpolate_square(x,4),'truth',x*x,
'error',interpolate_square(x,4)-x*x)
Actual output:
intervals: 1 grid maximum: 1/4 proved uniform maximum: 1/4
intervals: 2 grid maximum: 1/16 proved uniform maximum: 1/16
intervals: 4 grid maximum: 1/64 proved uniform maximum: 1/64
intervals: 8 grid maximum: 1/256 proved uniform maximum: 1/256
m=4 at x=3/8: prediction 5/32 truth 9/64 error 1/64
For m=4 and x=3/8, the interpolant is 5/32, the target is 9/64 and the error is 1/64. Increasing m from 4 to 8 quarters the uniform error. The evaluator costs O(m) arithmetic per point; this 2m+1-point audit costs O(m²). Rational bit costs depend on input denominators. A cell-index implementation could evaluate the same piecewise linear function faster, but the hinge version exposes the network.
Approximation is one source of error
A model family may contain an excellent approximation while the training procedure returns a poor member. Finite noisy data can also favor a model that fits observations and predicts badly elsewhere. Keep approximation error, optimization failure and statistical error separate when diagnosing a system.
The theorem does not guarantee a small width, bounded weights, robustness, calibrated confidence or extrapolation outside the cube. It does not make shallow networks preferable to deep ones. Efficient representation depends on the target class and the resources being counted. Our one-dimensional quadratic should not be used to infer a dimension-independent rate for arbitrary functions.
Finite grid agreement is especially easy to overread. A continuous function can hide a narrow spike between sampled points. A genuine uniform guarantee needs a proof or additional regularity bounds that control what happens between observations.
Read the quantifiers before making a promise
- Does Cybenko’s stated theorem fix one network width that works for every continuous target and every tolerance?
Answer 1: No. The finite width and parameters may depend on the target and the tolerance.
- What is the exact worst error for the quadratic construction with m=4? Where is it attained?
Answer 2: It is 1/64, attained at every cell midpoint.
- What is the smallest integer m giving this construction error strictly below 0.01?
Answer 3: Six. At m=5 the error equals 0.01, which fails the strict inequality.
- Why does the grid audit constitute a uniform check for this example but not for an arbitrary fitted network?
Answer 4: The independently derived cell formula proves all maxima lie at the sampled midpoints. An arbitrary network has no such guarantee from the grid alone.
Several results share the same short name
Cybenko’s paper acknowledges contemporary work, including Hornik, Stinchcombe and White, and Funahashi. Universal approximation is a family of results with different activations, target spaces, error notions and restrictions; it should not be credited as one unqualified claim by a sole inventor. The 1989 journal paper spans printed pages 303–314; its received and revised dates are manuscript-history dates, not a publication day.
This chapter uses the original theorem’s uniform-continuous setting and the textbook’s distinction between representation and learning. The ReLU interpolation, rational program and error calculation are original. Continue to bias and variance and model evaluation to understand evidence that an implemented model works on a task.
Make a prediction, then check
Which m gives error strictly below0.01 in this construction?
Learning objectives
- State domain, activation and norm assumptions.
- Derive a uniform error bound without treating a sampled grid as proof.
Prerequisites & connections
Explore related knowledge →References
- Approximation by Superpositions of a Sigmoidal Function
George Cybenko · 1989 - Deep Learning — Chapter 6: Deep Feedforward Networks
Ian Goodfellow; Yoshua Bengio; Aaron Courville · 2016
Version1 · Editorial status: Recorded technical checks completed
View technical check record (AI)
Codex · 2026-09-06 · Codex single-agent authored technical review: cited primary-source scope, explicit assumptions, original calculations and counterexamples, runnable tests and bilingual review; not independent human or second-agent review.
- Single-agent authored technical review: bounded primary-source locations, assumptions, original derivations, exact/literal references and matching bilingual equations/examples/exercises. Not independent human or second-agent review.
- Four focused CPython3.12.4 tests passed per chapter. Neuron gradients, exact XOR/affine composition, sharp interpolation errors and stable activation/loss derivatives are checked against literal references, analytic identities and finite differences. No external runtime dependencies.
- Promoted the full prose, equations, code and exercises. Tests read formal MDX only; removed temporary fallbacks/draft skips and updated review assertion to checked. Algorithm and independent references are unchanged; final record binds both locale hashes.
- Publication navigation points published topics to complete articles and removes corresponding pending wording, retaining directory entries for unwritten targets. Principles, equations, programs and exercises are unchanged; final article SHA values rebound.
Source locations checked:
- Approximation by Superpositions of a Sigmoidal Function · Printed305–308 (physical3–6): definitions, Theorem1, Lemma1 proof and Theorem2; paper303–314,1989.
- Deep Learning — Chapter 6: Deep Feedforward Networks · Section6.4.1 pp194–195 existence versus learning; textbook broader informal target statements not used as uniform theorem.
Related topics