Arbitrary-Accuracy Neural Approximation with Optimal Neuron Count and Near-Optimal Bit Complexity
Zilan Cheng, Li-Lian Wang, Zhongjian Wang
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.
We study the minimum number of hidden neurons required for arbitrary-accuracy approximation of multivariate Hölder-continuous functions on [0,1]d and the associated encoding complexity. For d≥2, we construct a fixed, explicitly defined activation function for which a closed-form network with two hidden layers of widths d and 1 achieves arbitrary accuracy in the uniform norm. We prove that d+1 is the exact minimum total number of hidden neurons among standard feedforward networks with locally integrable activations and affine outputs. We further give a simpler construction using a single elementary activation that combines the floor and exponential functions. This construction requires three hidden layers of widths d, 1, and 2, only two neurons above the minimum. If a skip connection is allowed, widths d, 1, and 1 suffice. These constructions use explicit grid addressing and integer encoding of quantized function values. For a bounded α-Hölder class, they require O(ε−d/αlog(1/ε)) bits, matching the metric-entropy lower bound up to a logarithmic factor.
1 Introduction
Universal approximation theorems [1, 5, 4, 9] state that feedforward networks with suitable nonpolynomial activations are dense in C([0,1]d). In all classical statements, and in the quantitative theory that followed for ReLU networks [16, 17, 12, 15], the number of neurons grows without an explicit bound as the prescribed accuracy ε tends to zero. A different regime was opened by [11]: there is an analytic sigmoidal activation for which a two-hidden-layer network with widths 3d and 6d+3 approximates every f∈C([0,1]d) to arbitrary accuracy, with the architecture fixed and only the parameters depending on f and ε. Such fixed-size universal approximators have since been constructed with progressively fewer neurons and progressively more explicit activations [6, 3, 18, 14, 19]. In what follows, we list two questions that are left open by this line of work and will be answered here.
How few neurons suffice? The smallest known count is 3d+2 hidden neurons, in two hidden layers of widths d and 2d+2, obtained by [6], whose activation is a specially constructed C∞ sigmoidal function whose existence is proved theoretically; [3] attain the same count and give an algorithmically computable construction. If different activations and skip connections are allowed, [18] obtained a smaller construction with d+2 hidden neurons. No lower bound on the total number of hidden neurons was known beyond the trivial observation that the first layer must see the whole input. We construct and prove that the exact answer is d+1: a
*Division of Mathematical Sciences, School of Physical and Mathematical Sciences, Nanyang Technological University, 637371, Singapore. Email: zilan001@e.ntu.edu.sg.
†Division of Mathematical Sciences, School of Physical and Mathematical Sciences, Nanyang Technological University, 637371, Singapore. Email: lilian@ntu.edu.sg.
‡Corresponding author. Division of Mathematical Sciences, School of Physical and Mathematical Sciences, Nanyang Technological University, 637371, Singapore. Email: zhongjian.wang@ntu.edu.sg.
Table 1: Comparison of fixed-size universal approximators on [0,1]d. Unless “two” is indicated, a single activation is used. *Optimal among all locally integrable activations for d≥2 (Theorem 3.4).
Reference
Neurons
Depth
Activation
Parameters
[11]
9d+3
2
analytic sigmoidal
existence
[6]
3d+2
2
C∞ sigmoidal
existence
[3]
3d+2
2
computable C∞ sigmoidal
existence
[18]
d+2 (skip)
3
two: floor and analytic, elementary
existence
O(d2)
O(1)
two: sin and arcsin, elementary
existence
O(d2)
O(1)
C1 sigmoidal, elementary
existence
[19]
≤396d(2d+1)
11
C0 triangular wave-softsign, elementary
existence
Theorem 3.1
d+1 (optimal*)
2
explicit piecewise constant
closed-form
Theorem 4.1
d+3
3
floor-exponential, elementary
closed-form
Theorem 4.1
d+2 (skip)
3
floor-exponential, elementary
closed-form
two-hidden-layer network of widths (d,1) with a single explicit piecewise-constant activation and without any skip connection approximates every function in the Hölder class Hλ,Rα([0,1]d) (see (2)) to arbitrary L∞ accuracy (Theorem 3.1), and no feedforward network with at most d hidden neurons can do so, whatever its depth and whatever locally integrable activation it uses (Theorem 3.4). The lower bound combines a rank argument for the first hidden layer with the fact, going back to [10, 11, 13], that sums of a fixed number of ridge functions are not dense; we give a direct proof valid for arbitrary locally integrable activations.
What does a small network cost? Fixed-size constructions pay for accuracy with the magnitude and precision of their parameters, a phenomenon [19] call the curse of memory but do not quantify. We therefore define the bit complexity of a network as the total binary length of its (rational) parameters and show that our constructions have worst-case bit complexity Θ(ε−d/αlog(1/ε)) over the Hölder class (Theorem 5.1). On the other hand, the classical Kolmogorov–Tikhomirov ε-entropy estimate [8] implies that, for any fixed architecture and activation, any family of rational-parameter networks approximating the entire class to accuracy ε must have worst-case bit complexity Ω(ε−d/α) (Proposition 5.2). Thus, our constructions are information-theoretically near-optimal, up to a logarithmic factor. For fixed-size networks, bit complexity therefore provides a natural measure of representational cost.
Elementary activations The activation attaining d+1 neurons is explicit but intricate: it is a piecewise-constant function that lists, block by block, the digits of every integer in every base (see (10)). We therefore also consider a floor-exponential activation
σ(t)={2t−1,⌊t⌋,t<0,t≥0.(1)
We call an activation elementary if it is given by a finite formula in finitely many standard functions; σ is elementary in this sense. Using σ as the single shared activation, we give an explicit three-hidden-layer network of widths (d,1,2), hence d+3 hidden neurons, and a variant of widths (d,1,1) with one skip connection, hence d+2 hidden neurons (Theorem 4.1). All parameters of both networks are rational and given in closed form, which allows exact-arithmetic verification (Section 6); to our knowledge, no earlier fixed-size construction has this property. Elementary activations have appeared in fixed-size constructions recently [18, 19], but there the function-dependent weights are obtained from the density of an irrational winding on the torus and are not given in closed form; [18] notes that computing the weight is practically infeasible even for small problems. Moreover, those earlier constructions need O(d2) neurons when a single elementary activation is used. Table 1 summarizes the results.
We summarize our main contributions as follows.
Optimal neuron count. We construct a network of widths (d,1) with a single explicit activation ϱ in (10) and rational, closed-form parameters that approximates every f∈Hλ,Rα([0,1]d) to arbitrary L∞ accuracy (Theorem 3.1), and we verify it in exact arithmetic (Section 6). We prove that d+1 is the exact minimum neuron count, at any depth and for any locally integrable activation (Theorem 3.4). We further show that, at least for d=2, no continuous activation attains this count in L∞ (Proposition E.1), whereas under the weaker Lp criterion, 1≤p<∞, a continuous modification of ϱ that we construct attains it for every d≥2 (Theorem E.3).
Elementary activation. For the single elementary activation in (1), we give an explicit construction with d+3 hidden neurons and no skip connections, together with a d+2-neuron variant using one skip connection (Theorem 4.1). All parameters are rational and given in closed form, again permitting exact-arithmetic evaluation.
Near-optimal storage complexity. We develop the bit complexity, defined as the total binary length of the rational network parameters, to quantify the information stored in a fixed-size network. Our constructions have worst-case bit complexity Θ(ε−d/αlog(1/ε)) (Theorem 5.1), which is information-theoretically optimal up to a logarithmic factor.
The rest of the paper is organized as follows: Section 2 introduces the main concepts and notation. Section 3 establishes the optimal hidden-neuron count by proving both sufficiency and necessity. Section 4 presents the constructions based on the elementary floor-exponential activation. Section 5 analyzes the bit complexity of the proposed networks. Section 6 provides exact-arithmetic numerical verification, and Section 7 discusses limitations and open problems. Additional proofs, extensions, numerical results, and figures are provided in the appendices.
2 Setting
To formulate precisely the minimum-neuron problem and quantify the associated encoding cost, we first introduce the function class, network setting, and bit complexity, followed by the grid-quantization scheme underlying all our constructions.
Hölder class. Throughout, d∈N+, α∈(0,1] and λ,R>0. Consider
Since Hλ,Rα([0,1]d)⊆Hλ,⌈R⌉α([0,1]d), we assume without loss of generality that R∈N+ whenever we need to make certain neural network parameters integers.
Networks. An activation is a function ϕ:R→R, applied componentwise to vectors. For the number of hidden layers L∈N+ and widths n=(n1,…,nL)∈N+, a feedforward network with input dimension d, activation ϕ and architecture n is a function Φ:[0,1]d→R of the form
with Wk∈Rnk×nk−1 ( n0=d), bk∈Rnk, a∈RnL, c∈R. We denote the set of all such networks by N(n;ϕ). We also consider the larger class Nskip(n;ϕ) in which the output layer is affine in all hidden layers, Φ(x)=∑k=1Lak⊤hk(x)+c; the input still enters only through the first hidden layer. The number of hidden neurons is ∣n∣:=n1+⋯+nL, the depth is L, and the width is maxknk.
Definition 2.1 (Arbitrary-accuracy approximation and minimal neuron count). The network class N(n;ϕ) approximates Hλ,Rα([0,1]d) to arbitrary accuracy if, for every f∈Hλ,Rα([0,1]d) and every ε>0, there exists Φ∈N(n;ϕ) such that ∥f−Φ∥L∞([0,1]d)≤ε; the same definition applies to Nskip(n;ϕ). The minimal neuron count of Hλ,Rα([0,1]d) is
Only the architecture and the activation are fixed in Definition 2.1; the weights and biases may depend on f and ε. All activations used in our constructions are locally bounded and hence locally integrable.
Bit complexity. For a nonnegative integer k let bit(k):=⌈log2(k+1)⌉ be its binary length; and for a rational number θ=a/b in lowest terms (a∈Z,b∈N+), let bit(θ):=1+bit(∣a∣)+bit(b), the additional bit recording the sign. If all weights and biases of a network Φ are rational, define its bit complexity by
bit(Φ):=θ∈P(Φ)∑bit(θ),(4)
where P(Φ) denotes the set of nonzero weights and biases of Φ.
Grid quantization (for all constructions). Fix M∈N+ and set K:=(M+1)d. For x∈[0,1]d let mj(xj):=⌊Mxj⌋∈{0,…,M} and define the cell address
r(x):=j=1∑d(M+1)j−1mj(xj)∈{0,…,K−1}.
The address is the base- (M+1) integer whose digits are the coordinates mj(xj). For ℓ∈{0,…,K−1}, the cell Qℓ:={x∈[0,1]d:r(x)=ℓ} is a half-open box (degenerate on xj=1) and can be represented by the grid point x(ℓ):=(m1(ℓ)/M,…,md(ℓ)/M) whose coordinates mj(ℓ)=⌊ℓ/(M+1)j−1⌋mod(M+1) are the digits of ℓ. See Figure 1 and Table 2 in Appendix F for an example of M=3. Then ∥x−x(ℓ)∥∞≤1/M for all x∈Qℓ. Given ε>0, we always choose
so that λM−α≤ε/2, δ is dyadic and B is a power of two. For f∈Hλ,Rα([0,1]d), we define the quantization indices qℓ and the corresponding quantized approximations fℓ of f(x(ℓ)) by
The construction below is a network that outputs fr(x), or equivalently fℓ when x∈Qℓ. Moreover,
M=Θ(ε−1/α),K=Θ(ε−d/α),B=Θ(ε−1)asε→0.(8)
(a) mj(xj)=⌊Mxj⌋ maps [Mi,Mi+1) to i and 1 to M.
(b) r(x) for d=2: each cell Qℓ is mapped to ℓ; crosses mark the representatives x(ℓ).
Figure 1: Position encoding with M = 3.
3 Optimal neuron count: d+1 hidden neurons
3.1 Sufficiency: an explicit (d,1) network
Our goal is to realize the piecewise-constant approximation fr(x)=−R+δqr(x). Our strategy is first to determine the cell containing x through its address r(x), and then to pack q0,…,qK−1 into a single integer as digits in a suitable base, so that qr(x) can be recovered by extracting the digit indexed by r(x). This motivates an activation ϱ whose negative branch provides the floor operation needed for addressing and whose nonnegative branch performs digit extraction.
Figure 2: ϱ in [−2,S3), or equivalently, [−2,0)⋃(⋃n=12⋃j=0(n+1)n−1⋃r=0n−1In,j,r).
The digit-extraction activation. For n∈N+, let S1:=0 and Sn:=∑k=1n−1k(k+1)k, so that Sn+1−Sn=n(n+1)n and Sn→∞. The half-line [0,∞) is the disjoint union of the blocks [Sn,Sn+1), n∈N+, and the n-th block is the disjoint union of the unit intervals
Write j=∑s=0n−1bs(j)(n+1)n−1−s with digits bs(j)∈{0,…,n}. Define
ϱ(t):={⌊t⌋,br(j),t<0,t∈In,j,r.(10)
Equivalently, on In,j,r the value br(j) is ⌊j/(n+1)n−1−r⌋−(n+1)⌊j/(n+1)n−r⌋. As shown in Figure 2, the function ϱ is piecewise constant on countably many intervals, satisfies 0≤ϱ(t)≤n on [Sn,Sn+1), and is therefore locally bounded and locally integrable. Its defining property is the digit-extraction identity
Figure 3: Architecture of the network Φf,εϱ in Theorem 3.1. The d neurons in the first hidden layer quantize the input coordinates, whose weighted combination forms the cell address r(x); the neuron in the second hidden layer decodes the corresponding quantized value from the stored integer Nf. The network has d+1 hidden neurons in total.
The network. Let f∈Hλ,Rα([0,1]d),ε>0, and let M,δ,B,qℓ be as in (5)–(6). Set
Since qℓ≤B−1≤n, the base- (n+1) digits of Jf are bℓ(Jf)=qℓ for ℓ<K and 0 for K≤ℓ<n; in particular 0≤Jf<(n+1)n, and (11) gives ϱ(Nf+ℓ)=qℓ for 0≤ℓ<K.
As illustrated in Figure 3, the outputs of the hidden layers and the affine output layer are defined as:
In (13) the argument of ϱ is at most −1, so the negative branch (the floor) applies; in (14) the argument is Nf+r(x)∈[Sn,Sn+1) and the digit-extraction branch applies. Since the pointwise estimate (7) holds on every Qℓ and ⋃ℓ=0K−1Qℓ=[0,1]d, taking the supremum over x∈[0,1]d yields:
Theorem 3.1 (Two hidden layers: d+1 neurons). Let d∈N+, α∈(0,1], λ,R>0. For every f∈Hλ,Rα([0,1]d) and every ε>0 the network Φf,εϱ∈N((d,1);ϱ) defined by (13)–(15) satisfies
∥f−Φf,εϱ∥L∞([0,1]d)≤ε.
In particular ν(Hλ,Rα([0,1]d))≤d+1.
All parameters (see details in Appendix A) are integers except the dyadic output weight δ and the output bias −R; the latter is also an integer if, without loss of generality, we take R∈N+. The only function-dependent quantity among the parameters is Nf, which enters the second-layer bias and encodes the quantized values of f required for accuracy ε. For fixed d, the architecture is independent of f and ε, while the activation ϱ is independent of all problem parameters.
3.2 Necessity: no network with d hidden neurons is universal
In this section, we prove that at least d+1 hidden neurons are necessary to approximate Hλ,Rα([0,1]d) to arbitrary accuracy in the uniform norm when d≥2. The proof relies on two activation-independent results: Proposition 3.2 shows that the first hidden layer must contain at least d neurons, and Proposition 3.3 shows that a single-hidden-layer network of fixed width is insufficient.
Proposition 3.2 (First-layer width obstruction). Let d≥2, α∈(0,1], λ,R>0, and let ϕ:R→R be arbitrary. For every architecture n=(n1,…,nL) with n1<d, there exist a function f0∈Hλ,Rα([0,1]d) and a constant ε0>0, depending only on α,λ, and R, such that
Φ∈Nskip(n;ϕ)inf∥f0−Φ∥L∞([0,1]d)≥ε0.
See the proof in Appendix B.1.
Proposition 3.3 (Fixed-width single-hidden-layer obstruction). Let d≥2, α∈(0,1], λ,R>0, and n1∈N+, and let ϕ∈Lloc1(R). There exists a function fh∈Hλ,Rα([0,1]d) and a constant ε1>0, depending only on d,λ,R, and n1, such that
Φ∈N((n1);ϕ)inf∥fh−Φ∥L∞([0,1]d)≥ε1.
In particular, no single-hidden-layer network of fixed width can approximate Hλ,Rα([0,1]d) to arbitrary accuracy.
See the proof in Appendix B.2. In fact, that fixed-width single-hidden-layer networks are never dense in C([0,1]d), d≥2, is classical for continuous activations: it follows from the non-density of sums of m ridge functions [10, 11, 13]. We still include a direct proof because it is valid for arbitrary locally integrable ϕ.
Combining the results of the above two propositions, we obtain the following theorem:
Theorem 3.4 (Lower bound of neurons). Let d≥2, α∈(0,1], and λ,R>0. Let L∈N+, n∈N+, and ϕ∈Lloc1(R). If Nskip(n;ϕ) approximates Hλ,Rα([0,1]d) to arbitrary accuracy in the sense of Definition 2.1, then ∣n∣≥d+1. Consequently, together with Theorem 3.1,
ν(Hλ,Rα([0,1]d))=d+1foreveryd≥2,α∈(0,1],λ,R>0.
See the proof in Appendix B.3. The hypotheses ϕ∈Lloc1(R) and d≥2 are essential; see the two remarks below.
Remark 3.5 (The case d=1). The above results (Propositions 3.2–3.3 and Theorem 3.4) need d≥2. For d=1, [2] construct an activation for which a single hidden neuron approximates every f∈C([0,1]) to arbitrary accuracy, so ν=1 when d=1.
Remark 3.6 (Continuous activations and Lp approximation). The discontinuity of the activation cannot be dispensed with for uniform approximation with the optimal neuron count d+1 established in Theorems 3.1 and 3.4, at least when d=2: Proposition E.1 shows that no network with three hidden neurons, a continuous activation, and no skip connections can achieve arbitrary accuracy in L∞([0,1]2). If the error criterion is weakened to Lp([0,1]d), 1≤p<∞, however, a (d,1) architecture with a continuous activation can achieve arbitrary accuracy (see Theorem E.3).
4 Elementary activation: d+3 neurons (or d+2 with a skip)
The activation ϱ in Theorem 3.1 performs digit extraction in a single step by encoding every possible digit table in its graph. We now replace this lookup mechanism with elementary radix arithmetic. Store the quantized values as the base-B integer Af=∑ℓqℓBℓ. Its ℓ-th digit can be recovered by qℓ=⌊Af/Bℓ⌋−B⌊Af/Bℓ+1⌋. Consequently, retrieving the digit indexed by r(x) requires computing B−r(x) and applying the floor function twice. This motivates an elementary activation that combines exponential and floor operations as in (1). Let f∈Hλ,Rα([0,1]d), ε>0, M,K,δ,B,qℓ as in (5)–(6), and
so that T0(x)−BT1(x)=qr(x) (all base-B digits at positions greater than r(x) cancel). Therefore, we define the outputs of the hidden layers and the affine output layer of the elementary activation neural network with c:=(1,M+1,…,(M+1)d−1)⊤,
u(x):=σ(Mx)=(⌊Mx1⌋,…,⌊Mxd⌋)⊤,
(1st hidden layer) (17)
v(x):=σ(−1−log2(B)c⊤u(x))=21B−r(x)−1,
(2nd hidden layer)(18)
w(x):=σ([2Af2Af/B](v(x)+1))=[T0(x)T1(x)],
(3rd hidden layer)(19)
Φf,εσ(x):=−R+δ[1,−B]w(x)=−R+δqr(x)=fr(x).
(output layer)
(20)
Here Mxj≥0 in (17) selects the floor branch of σ(t); the pre-activation part in (18) is ≤−1 and selects the exponential branch, and log2B∈N because B is a power of two; the pre-activations in (19) are nonnegative and select the floor branch. The network has widths (d,1,2) (see Figure 6).
Saving one neuron with a skip connection. The first neuron at the third hidden layer (19) can be dispensed with if the output layer may read the second hidden layer directly, because Af/Br(x) itself differs from ⌊Af/Br(x)⌋ by the fractional part ηr(x):=AfB−r(x)−⌊AfB−r(x)⌋∈[0,1), whose contribution δηr(x) to the output is below the quantization step. Thus, keeping (17)–(18) and setting
one obtains Φf,εσ,skip(x)=−R+δ(AfB−r(x)−BT1(x))=fr(x)+δηr(x), a network in Nskip((d,1,1);σ) with d+2 hidden neurons (see Figure 7).
These two networks also provide uniform approximation of Hλ,Rα([0,1]d):
Theorem 4.1 (Elementary activation: d+3 neurons, or d+2 with a skip connection). Let d∈N+, α∈(0,1], λ, R>0. For every f∈Hλ,Rα([0,1]d) and every ε>0, the networks Φf,εσ∈N((d,1,2);σ) and Φf,εσ,skip∈Nskip((d,1,1);σ), defined respectively by (17)–(20) and (17), (18), (21) satisfy
See the proof in Appendix C. Compared with the first construction of [18], which also uses d+2 neurons and a skip connection, Φf,εσ,skip requires only a single shared activation, and all of its parameters are rational and given in closed form (see Table 3).
5 Bit Complexity of Fixed-Size Approximators
In each of the three constructions, the target function is encoded by a single integer, namely, Nf in (12) or Af in (16). Although the number of neurons is fixed, the size of this integer increases as the prescribed accuracy improves. A natural measure of storage and computational cost is therefore the bit complexity defined in (4). This complexity is readily computed because all our network parameters are rational: δ is dyadic, B is a power of two, and the remaining quantities are integers for R∈N+. The preceding discussion leads to the following theorem:
Theorem 5.1 (Bit complexity of the constructions). Let d≥2, α∈(0,1], λ>0, and R∈N+. For the networks Φf,εϱ, Φf,εσ, and Φf,εσ,skip in Theorems 3.1 and 4.1, as ε→0, supf∈Hλ,Rα([0,1]d)bit(Φf,εϱ)=Θ(ε−d/αlogε1), supf∈Hλ,Rα([0,1]d)bit(Φf,εσ)=Θ(ε−d/αlogε1), and supf∈Hλ,Rα([0,1]d)bit(Φf,εσ,skip)=Θ(ε−d/αlogε1).
The proof is given in Appendix D.
We next compare this complexity with the information-theoretic lower bound. The classical Kolmogorov–Tikhomirov entropy estimate [8, Theorem XIV, equation (68)] states that the ε-entropy of Hλ,Rα([0,1]d) in the uniform norm, defined as the base-2 logarithm of the minimum cardinality of an ε-cover of Hλ,Rα([0,1]d), is Θ(ε−d/α). Equivalently, the minimum cardinality of such a cover is 2Θ(ε−d/α). For a fixed architecture, any collection of N distinct rational-parameter networks has worst-case bit complexity Ω(log2N). Consequently, any family of networks approximating the entire class to accuracy ε must have worst-case bit complexity Ω(ε−d/α). This yields the following result:
Proposition 5.2 (Bit complexity lower bound). Let d∈N+, α∈(0,1], λ,R>0. Fix any L∈N+, n∈N+, and activation ϕ:R→R. For each ε>0 and f∈Hλ,Rα([0,1]d), let Φf,εϕ∈Nskip(n;ϕ) be any network with rational parameters satisfying ∥f−Φf,εϕ∥L∞([0,1]d)≤ε. Then supf∈Hλ,Rα([0,1]d)bit(Φf,εϕ)=Ω(ε−d/α) as ε→0.
Combining Proposition 5.2 with Theorem 5.1, our constructions are optimal up to a logarithmic factor. In particular, the polynomial storage requirement ε−d/α is unavoidable for any finite-bit implementation of a fixed-size universal approximator. The “curse of memory” identified by [19] is therefore not a defect of a particular construction but an information-theoretic necessity.
The inadequacy of neuron count alone is also reflected in VC dimension. Indeed, consider N((d,1);ϱ) and any finite set of distinct points x1,…,xN∈[0,1]d with arbitrary labels y1,…,yN∈{−1,1}. There exists a bounded Lipschitz function f such that f(xi)=yi for every i. By Theorem 3.1, there is a network Φ∈N((d,1);ϱ) satisfying ∥f−Φ∥L∞([0,1]d)≤1/2, and hence yiΦ(xi)>0, i=1,…,N. Thus, the classifier sign Φ realizes the prescribed labels. Since the points and labels were arbitrary, N((d,1);ϱ) has infinite VC dimension. The same argument applies to the network classes in Theorem 4.1. Hence, for these superexpressive activations, the number of neurons or parameters alone does not control statistical complexity.
6 Numerical verification in exact arithmetic
The explicit construction of Φf,εϱ in Theorem 3.1 permits exact-arithmetic evaluation. We carry this out for d=2,3 to provide a computational check of the construction.
We consider four functions f1,…,f4 on [0,1]2 and two functions f5,f6 on [0,1]3, with certified Hölder parameters (α,λ,R) in the ℓ∞ norm:
For f3, p:=x1x2. For f4, Γ denotes the boundary of the level-3 Koch snowflake obtained by applying three iterations of the classical outward Koch construction [7] to an upward-pointing equilateral triangle centered at (21,21) with circumradius 0.36, and define dist(x,Γ):=miny∈Γ∥x−y∥2. We perform the verification over a sequence of dyadic accuracies starting
Target f4
Φf4,εϱ,ε=2−1
Φf4,εϱ,ε=2−2
Φf4,εϱ,ε=2−3
Error below ε
∣f4−Φf4,εϱ∣,ε=2−1
∣f4−Φf4,εϱ∣,ε=2−2
∣f4−Φf4,εϱ∣,ε=2−3
value
ε
x1
x1
x1
absolute error
Figure 4: Numerical verification of Theorem 3.1 for the approximation of f4 by Φf4,εϱ. Top: The target function f4 and the network outputs for ε=2−1,2−2,2−3 ( M=74,147,293). Bottom: The sup-norm error over the 3,004 test points versus ε, and the absolute errors ∣f4−Φf4,εϱ∣ on a 1612 grid. The error plot additionally includes ε=2−4,2−5.
from ε=2−1, with the finest tested accuracy chosen so that bit(Nf) is on the order of 107 bits. Table 3 in Appendix F reports the parameters δ,M,K=(M+1)d, B from (5), the bit length bit(Nf) from (12), and the maximal error max∣fi−Φfi,εϱ∣ over 3,004 exactly represented test points for d=2 and 3,008 for d=3, comprising 2,000 random dyadic points, 1,000 boundary points, and the 2d corners. Figure 4 shows the target f4, the network outputs Φf4,εϱ, and the pointwise errors on a 1612 display grid at the three common accuracy levels ε=2−1,2−2,2−3, together with the maximal errors over the full sequence of tested accuracies. The visualizations for f1,f2,f3,f5, and f6 are provided in Appendix F (Figures 8–13). For the two-dimensional targets f1,…,f4, the maximal-error plots are included in their respective visualization figures; for the three-dimensional targets f5 and f6, they are presented separately in Figure 13, together with those for Φf,εσ and Φf,εσ,skip in Theorem 4.1. All observed errors are below ε as guaranteed, and both bit(Nf)/(nlog2(n+1)) (for Φf,εϱ) and bit(Af)/(Klog2B) (for Φf,εσ and Φf,εσ,skip) approach 1 as ε decreases in every case, consistently with Theorem 5.1.
Implementation. The dyadic quantities and nonintegral rational parameters are stored exactly as Fraction objects; R,M,B,K,n and the integer parameters as Python integers; (qℓ)ℓ=0K−1 as a temporary int64 array; and the large integers Sn, Jf, Nf as arbitrary-precision mpz objects. Arbitrary-precision arithmetic is necessary because bit( Nf) reaches the order of 107, far beyond the precision of double precision.
Now we discuss how to deal with the bulky lookup table definition of ϱ in the verification. As shown in (13), the first hidden layer uses only the negative branch, which is evaluated directly using the floor function. In the second hidden layer (14), since t=Nf+ℓ=Sn+nJf+ℓ, dividing t−Sn by n yields quotient Jf and remainder ℓ. The activation ϱ then extracts the corresponding base-(n+1) digit of Jf: ϱ(t)=⌊(n+1)n−1−ℓJf⌋−(n+1)⌊(n+1)n−ℓJf⌋=qℓ. Although constructing Nf requires the values (qℓ)ℓ=0K−1, once Nf has been formed, pointwise network evaluation recovers each required qℓ directly from Nf, without repeatedly accessing a lookup table.
7 Discussion
Limitations. Our results concern representational capacity rather than practical training. The encoding integers Nf and Af may require Θ(ε−d/αlog(1/ε)) bits, far exceeding standard fixed-precision floating-point arithmetic in the gradient descent-based training in actual function fitting. Moreover, in the (d,1) construction, ϱ is a lookup function rather than a practical nonlinearity, and its evaluation can be computationally expensive.
Open problems. (i) Can the optimal count d+1 be attained with an elementary discontinuous activation, or can d+2 neurons suffice without a skip connection? (ii) What is the minimal neuron count for uniform approximation with a continuous activation since d+1 neurons do not suffice when d=2? (iii) Can a fixed architecture exploit the bounded differences between neighboring quantized values to attain bit complexity Θ(ε−d/α), removing the logarithmic factor in our constructions?
References
[1] George Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of Control, Signals and Systems, 2(4):303–314, 1989.
[2] Namig J Guliyev and Vugar E Ismailov. A single hidden layer feedforward network with only one neuron in the hidden layer can approximate any univariate function. Neural computation, 28(7):1289–1304, 2016.
[3] Namig J Guliyev and Vugar E Ismailov. Approximation capability of two hidden layer feedforward neural networks with fixed weights. Neurocomputing, 316:262–269, 2018.
[4] Kurt Hornik. Approximation capabilities of multilayer feedforward networks. Neural Networks, 4(2):251–257, 1991.
[5] Kurt Hornik, Maxwell Stinchcombe, and Halbert White. Multilayer feedforward networks are universal approximators. Neural Networks, 2(5):359–366, 1989.
[6] Vugar E Ismailov. On the approximation by neural networks with bounded number of neurons in hidden layers. Journal of Mathematical Analysis and Applications, 417(2):963–969, 2014.
[7] HV Koch. Sur une courbe continue sans tangente, obtenue par une construction géométrique élémentaire. Arkiv for Matematik, Astronomi och Fysik, 1:681–704, 1904.
[8] Andrei Nikolaevich Kolmogorov and Vladimir Mikhailovich Tikhomirov. ε-entropy and ε-capacity of sets in function spaces. Uspekhi Matematicheskikh Nauk, 14(2):3–86, 1959.
[9] Moshe Leshno, Vladimir Ya Lin, Allan Pinkus, and Shimon Schocken. Multilayer feedforward networks with a nonpolynomial activation function can approximate any function. Neural Networks, 6(6):861–867, 1993.
[10] Vladimir Ya Lin and Allan Pinkus. Fundamentality of ridge functions. Journal of Approximation Theory, 75(3):295–311, 1993.
[11] Vitaly Maiorov and Allan Pinkus. Lower bounds for approximation by MLP neural networks. Neurocomputing, 25(1-3):81–91, 1999.
[12] Philipp Petersen and Felix Voigtlaender. Optimal approximation of piecewise smooth functions using deep ReLU neural networks. Neural Networks, 108:296–330, 2018.
[13] Allan Pinkus. Approximation theory of the MLP model in neural networks. Acta Numerica, 8:143–195, 1999.
[14] Zuowei Shen, Haizhao Yang, and Shijun Zhang. Neural network approximation: Three hidden layers are enough. Neural Networks, 141:160–173, 2021.
[15] Zuowei Shen, Haizhao Yang, and Shijun Zhang. Optimal approximation rate of ReLU networks in terms of width and depth. Journal de Mathématiques Pures et Appliquées, 157:101–135, 2022.
[16] Dmitry Yarotsky. Error bounds for approximations with deep ReLU networks. Neural Networks, 94:103–114, 2017.
[17] Dmitry Yarotsky. Optimal approximation of continuous functions by very deep ReLU networks. In Conference on Learning Theory, pages 639–649. PMLR, 2018.
[18] Dmitry Yarotsky. Elementary superexpressive activations. In International Conference on Machine Learning, pages 11932–11940. PMLR, 2021.
[19] Shijun Zhang, Zuowei Shen, and Haizhao Yang. Deep network approximation: Achieving arbitrary accuracy with fixed number of neurons. Journal of Machine Learning Research, 23(276):1–60, 2022.
Appendix
A Details of Section 3.1
The activation ϱ is well defined. Fix n∈N+. The unit intervals In,j,r of (9), indexed by integers j and r such that 0≤j<(n+1)n and 0≤r<n, form a partition of [Sn,Sn+1). Indeed, let k=nj+r ranging over {0,…,n(n+1)n−1},
Since S1=0 and Sn→∞, it follows that ⋃n=1∞⋃j=0(n+1)n−1⋃r=0n−1In,j,r=[0,∞). Therefore, ϱ in (10) is well defined on R. It is constant on each unit interval, takes values in {0,…,n} on [Sn,Sn+1), and every compact set meets finitely many blocks; hence ϱ is locally bounded and Borel measurable, so ϱ∈Lloc1(R).
Digit extraction identity of the activation ϱ. Write j∈{0,…,(n+1)n−1} with base-(n+1) expansion j=∑s=0n−1bs(n+1)n−1−s, bs∈{0,…,n}. For r∈{0,…,n−1},
Subtracting n+1 times the second from the first leaves br, i.e. ⌊j/(n+1)n−1−r⌋−(n+1)⌊j/(n+1)n−r⌋=br. Since Sn+nj+r∈In,j,r as defined in (9), this proves (11).
Parameters of the network Φf,εϱ. For the record, the parameters of Φf,εϱ are: W1=MIdd, b1=−(M+1)1; W2=(1,M+1,…,(M+1)d−1), b2=Nf+(M+1)∑j=1d(M+1)j−1=Nf+(M+1)M(M+1)d−1; a=δ, c=−R. All are integers except δ (dyadic) and −R (an integer once R∈N+).
B Proofs of Section 3.2
B.1 Proof of Proposition 3.2
Define f0:[0,1]d→R by f0(x):=ζ∥x−x0∥∞α, x0:=(21,…,21), ζ:=min{λ,2αR}.
Step 1: Verification that f0∈Hλ,Rα([0,1]d). Since maxx∈[0,1]d∥x−x0∥∞=21, we have ∥f0∥L∞([0,1]d)=ζ2−α≤R. For a,b≥0 and α∈(0,1], one has ∣aα−bα∣≤∣a−b∣α by the subadditivity of t↦tα. Hence, by the reverse triangle inequality,
Step 2: Error lower bound from the kernel of the first layer. The input enters Φ only through W1x+b1 with W1∈Rn1×d. Since n1<d, there exists z∈kerW1 with ∥z∥∞=1; put x1:=x0+21z∈[0,1]d. Then W1x1+b1=W1x0+b1, hence Φ(x1)=Φ(x0), whereas f0(x0)=0 and f0(x1)=ζ2−α. Therefore
Therefore, by definition of ζ, ∥f0−Φ∥L∞([0,1]d)≥21ζ2−α=21min{λ2−α,R}=:ε0>0.
B.2 Proof of Proposition 3.3
Let Ω:=(0,1)d and define h:Rd→R, h(x):=exp(∥x∥22). We write (Cc∞(Ω))′ for the continuous dual of Cc∞(Ω).
Step 1: a suitable directional derivative of Φ vanishes. Let Φ(x)=c+∑i=1n1aiϕ(wi⋅x+bi)∈N((n1);ϕ). Since ϕ∈Lloc1(R), each function aiϕ(wi⋅x+bi) is locally integrable on Rd and can therefore be viewed as a regular distribution on Ω.
Denote Sd−1:={x∈Rd:∥x∥2=1}. For each i=1,…,n1, choose a unit vector vi∈Sd−1 satisfying vi⋅wi=0. Such a vector exists because d≥2; if wi=0, we may choose any unit vector. Write Dv:=v⋅∇ for the distributional directional derivative.
For every test function ψ∈Cc∞(Ω), extended by zero to Rd, we have ⟨Dvi[aiϕ(wi⋅x+bi)],ψ⟩=−∫Rdaiϕ(wi⋅x+bi)Dviψ(x)dx. Using the orthogonal decomposition x=y+svi, y∈vi⊥, whose Jacobian is one, and the identity wi⋅(y+svi)=wi⋅y gives
The inner integral vanishes because ψ has compact support. Therefore,
Dvi[aiϕ(wi⋅x+bi)]=0in(Cc∞(Ω))′.(22)
Now define Lv:=Dv1Dv2⋯Dvn1,v:=(v1,…,vn1)∈(Sd−1)n1. Constant-coefficient directional derivatives commute. For each i, the operator Lv contains the factor Dvi, which makes the ith ridge term vanish by (22). It also makes the constant term vanish. Hence LvΦ=0 in (Cc∞(Ω))′.
Step 2: the same directional derivative of h does not vanish. For every u∈Rd, Duh(x)=2(u⋅x)h(x). Repeated application of the product rule gives Lvh=Pvh, where Pv is a polynomial of degree n1 whose homogeneous part of degree n1 is 2n1∏i=1n1(vi⋅x). Since each vi is a unit vector, vi⋅x is a nonzero linear polynomial. Therefore, ∏i=1n1(vi⋅x) is a nonzero polynomial. It follows that Pv=0, and hence
Lvh=Pvh≡0(23)
for every v∈(Sd−1)n1.
Step 3: derive a uniform lower bound for the approximation error. Choose χ∈Cc∞(Ω) such that χ≥0 and χ>0 on a nonempty open subset of Ω, and define An1(v):=∫Ωχ(x)∣Lvh(x)∣2dx. The function Lvh is real analytic and, by (23), is not identically zero. It therefore cannot vanish on the open set where χ>0, and hence An1(v)>0. Moreover, v↦An1(v) is continuous. Since (Sd−1)n1 is compact,
an1:=v∈(Sd−1)n1minAn1(v)>0.(24)
For the directions v1,…,vn1 selected in Step 1, define ψv:=χLvh∈Cc∞(Ω). Since LvΦ=0 in (Cc∞(Ω))′, we obtain An1(v)=⟨Lvh,ψv⟩=⟨Lv(h−Φ),ψv⟩=(−1)n1∫Ω(h−Φ)Lvψvdx. Therefore,
An1(v)≤∥h−Φ∥L∞(Ω)∥Lvψv∥L1(Ω).(25)
By the Leibniz rule, Lvψv=∑S⊆{1,…,n1}(∏i∈SDvi)χ⋅(∏i∈/SDvi)Lvh involves derivatives of the fixed smooth functions χ and h of order at most 2n1 with coefficients depending polynomially in v. Hence (x,v)↦Lvψv(x) is continuous on the compact set suppχ×(Sd−1)n1. It follows that 0<bn1:=supv∈(Sd−1)n1∥Lvψv∥L1(Ω)<∞. Combining (25) with (24) gives
Step 4: rescale h into the Hölder class. On [0,1]d, ∥h∥∞=ed and ∥∇h(x)∥1=2e∥x∥22∑j=1dxj≤2ded. Therefore, by the mean value theorem, ∣h(x)−h(y)∣≤2ded∥x−y∥∞≤2ded∥x−y∥∞α, where the last inequality follows from ∥x−y∥∞≤1 and α≤1.
Set γ:=min{Re−d,2dedλ}, fh:=γh. Then fh∈Hλ,Rα([0,1]d). Since N((n1);ϕ) is invariant under multiplication by the positive constant γ, it follows from (26) that
Suppose, to the contrary, that ∣n∣≤d. If L≥2, then n1≤∣n∣−n2≤d−1<d, so Proposition 3.2 exhibits an f0∈Hλ,Rα([0,1]d) that cannot be approximated by any Φ∈Nskip(n;ϕ) with error smaller than ε0. If L=1, then Nskip(n;ϕ)=N((n1);ϕ), and Proposition 3.3 exhibits an fh∈Hλ,Rα([0,1]d) that cannot be approximated by any such network with error smaller than ε1. Both cases contradict arbitrary-accuracy approximation. Therefore, ∣n∣≥d+1.
Together with the upper bound provided by Theorem 3.1, this yields ν(Hλ,Rα([0,1]d))=d+1.
C Details and Proofs of Section 4
Parameters of the networks Φf,εσ and Φf,εσ,skip. Φf,εσ: W1=MIdd, b1=0; W2=−log2(B)c⊤, b2=−1; W3=(2Af,2Af/B)⊤, b3=(2Af,2Af/B)⊤; a=(δ,−δB), c=−R.
Φf,εσ,skip: the same first two layers; W3=b3=2Af/B; output weights 2δAf on v and −δB on wskip, bias −R+2δAf. All parameters are integers or dyadic rationals.
C.1 Proof of Theorem 4.1
Proof. For Φf,εσ, (20) and (7) give ∣f(x)−Φf,εσ(x)∣<ε on every cell.
For Φf,εσ,skip, on Qℓ we have Φf,εσ,skip=fℓ+δηℓ with 0≤δηℓ<δ and 0≤f(x(ℓ))−fℓ<δ by (6), so ∣f(x(ℓ))−Φf,εσ,skip(x)∣=∣(f(x(ℓ))−fℓ)−δηℓ∣<δ and the triangle inequality with ∣f(x)−f(x(ℓ))∣≤λM−α≤ε/2 gives the claim.
D Proof of Theorem 5.1
Throughout the proof, we consider d≥2, α∈(0,1], λ>0, R∈N+ are fixed and ε→0; by (8), M=Θ(ε−1/α), K=Θ(ε−d/α), B=Θ(ε−1), and log2B=Θ(log(1/ε)).
D.1 Bit complexity of Af
Upper bound. Since 0≤qℓ≤B−1, 0≤Af=∑ℓ=0K−1qℓBℓ≤(B−1)∑ℓ=0K−1Bℓ=BK−1, hence bit(Af)≤⌈log2BK⌉=Klog2B (an integer, as B is a power of two). Thus supf∈Hλ,Rα([0,1]d)bit(Af)=O(ε−d/αlog(1/ε)).
Lower bound. Let fR≡R. By (5), B/2<⌊2R/δ⌋+1≤B as soon as ⌊2R/δ⌋+1≥2, i.e. for small ε; since B/2 and ⌊2R/δ⌋ are integers, B/2≤⌊2R/δ⌋≤B−1. For fR every digit equals qℓ=⌊2R/δ⌋≥B/2, so
Using the parameter lists in Appendix C: the first hidden layer has d nonzero weights equal to M, contributing d bit(M) = O(dlog(1/ε)). The second hidden layer has weights log2(B)(M+
j−1, j=1,…,d, and bias -1, with bit(log2(B)(M+1)j−1)=O(jlog(1/ε)), contributing O(d2log(1/ε)) in total. The third hidden layer contains 2Af and 2Af/B (each at most twice); since 2Af/B in lowest terms has numerator at most 2Af and denominator at most B, bit(2Af/B)≤bit(Af)+bit(B)+O(1), so this layer contributes O(bit(Af)+log(1/ε)). The output layer has parameters δ, δB, R (and 2δAf, −R+2δAf in the skip variant), contributing O(bit(Af)+log(1/ε)). Altogether, since d2log(1/ε)=o(ε−d/αlog(1/ε)) as ε→0, supf∈Hλ,Rα([0,1]d)bit(Φf,εσ)=Θ(supf∈Hλ,Rα([0,1]d)bit(Af)) and supf∈Hλ,Rα([0,1]d)bit(Φf,εσ,skip)=Θ(supf∈Hλ,Rα([0,1]d)bit(Af)). Thus,
By the parameter list at Appendix A, all parameters other than the bias b2=Nf+(M+1)((M+1)d−1)/M contribute O(d2log(1/ε)) bits, and bit(b2)=bit(Nf)+O(dlog(1/ε)). Since n=max{K,B−1} and K=Θ(ε−d/α) dominates B=Θ(ε−1) (as d/α≥2), we have n=K=Θ(ε−d/α) for small ε. From Sn≤Nf<Sn+1 and
we get (n−1)log2n≤log2Nf≤(n+2)log2(n+1), i.e. bit(Nf)=Θ(nlogn)=Θ(ε−d/αlog(1/ε)) for every f∈Hλ,Rα([0,1]d). Hence supfbit(Φf,εϱ)=Θ(ε−d/αlog(1/ε)).
E Continuous activations: uniform obstruction and Lp construction
The activation ϱ of Theorem 3.1 is discontinuous, while Theorem 3.4 allows arbitrary locally integrable activations. Appendix E.1 shows that the discontinuity is not incidental: with a continuous activation, d+1 hidden neurons do not suffice for uniform approximation, already for d=2. Appendix E.2 shows that the obstruction is specific to the uniform norm: a single continuous activation ϱc, independent of f, ε, p and d, gives the (d,1) architecture an Lp guarantee for every p∈[1,∞).
E.1 A uniform-approximation obstruction for (2,1) networks
Proposition E.1 (Three-neuron obstruction for continuous activations). Let d=2, α∈(0,1], λ,R>0, and let ϕ:R→R be continuous. For every L∈N+ and every architecture n=(n1,…,nL)∈N+ with ∣n∣=3, there exist a function f∈Hλ,Rα([0,1]d) and a constant ε2>0, depending only on α,λ,R, such that infΦ∈N(n;ϕ)∥f−Φ∥L∞([0,1]d)≥ε2. Consequently, no fixed architecture with three hidden neurons and a continuous activation can approximate Hλ,Rα([0,1]d) to arbitrary accuracy.
Proof. For ∣n∣=3, the only possible architectures are (3), (1,2), (2,1), (1,1,1). The architecture (3) is excluded by Proposition 3.3, while (1,2) and (1,1,1) are excluded by Proposition 3.2. It therefore remains to only consider n=(2,1).
Step 0: growth of the function and the collision condition. Let x0:=(21,21). For x∈[0,1]2, write y:=x−x0=(y1,y2), and define
fc(x):=∥y∥2+101κ(y),κ(y):=y13+2y23.(27)
Since y∈[−21,21]2, we have ∣κ(y)∣≤∣y1∣3+2∣y2∣3≤43∥y∥2. Thus, with θ:=3/40,
(1−θ)∥x−x0∥2≤fc(x)≤(1+θ)∥x−x0∥2.(28)
In particular, fc(x0)=0.
Let Φ∈N((2,1);ϕ). In the notation of (3), write η⊤,ξ⊤∈R2 for the rows of W1, b1=(b1,1,b1,2), W2=(w1,w2), b2=b2, and a=a. Then Φ=g∘h with h(x)=ψ1(η⊤x)+ψ2(ξ⊤x), where ψi(t):=wiϕ(t+b1,i) and g(t):=aϕ(t+b2)+c; thus g,ψ1,ψ2:R→R are continuous.
Suppose that ∥fc−Φ∥L∞([0,1]2)≤ε. Whenever h(x)=h(x′), we have Φ(x)=g(h(x))=g(h(x′))=Φ(x′), and hence, for x,x′∈[0,1]2, the collision condition,
Steps 1–4 then show that (29) forces ε≥ε∗ for an absolute constant ε∗>0 defined in Step 4.
Step 1: a direct error bound for the degenerate case η∥ξ. Suppose that η and ξ are linearly dependent. There is then a unit vector v orthogonal to both of them, so that h(x0+tv)=h(x0) whenever x0+tv∈[0,1]2. This line segment reaches the boundary of the square and therefore contains a point p∈∂[0,1]2 satisfying ∥p−x0∥2≥21. By (29) and (28), 2ε≥∣fc(p)−fc(x0)∣=fc(p)≥(1−θ)∥p−x0∥2≥21−θ. Thus ε≥41−θ.
We may henceforth assume that η and ξ are linearly independent.
Step 2: coordinates adapted to the two directions. Absorbing ∥η∥2 and ∥ξ∥2 into ψ1 and ψ2, we may assume ∥η∥2=∥ξ∥2=1. Put Δ:=∣det(η,ξ)∣∈(0,1] and let e be the unit vector orthogonal to ξ with η⊤e=Δ, and e′ the unit vector orthogonal to η with ξ⊤e′=Δ. For x∈R2 define u(x):=Δη⊤(x−x0), v(x):=Δξ⊤(x−x0). Then x=x0+u(x)e+v(x)e′: applying η⊤ and ξ⊤ to both sides gives the same values, and η,ξ span R2. In these coordinates h(x)=ψ1(η⊤x0+Δu(x))+ψ2(ξ⊤x0+Δv(x)); absorbing the affine changes of variables into ψ1,ψ2 we may write
h(x)=ψ1(u(x))+ψ2(v(x)).(30)
Step 3: constructing pairs with the same h-value. Let L0:={x∈[0,1]2:h(x)=h(x0)}. If L0 contains a point p with ∥p−x0∥2≥41, then (29) and (28) give 2ε≥fc(p)≥41−θ, i.e. ε≥81−θ.
It remains to consider the case L0⊂B(x0,41), where B(x0,ρ):={x∈R2:∥x−x0∥2<ρ} denotes the open Euclidean ball. Then the continuous function h(x)−h(x0) does not vanish on [0,1]2∖B(x0,41), which is connected, and hence has constant sign there. Replacing (ψ1,ψ2,g) by (−ψ1,−ψ2,g(−⋅)) if necessary, which leaves Φ unchanged, we may assume
h(x)>h(x0)forallx∈[0,1]2∖B(x0,41).(31)
The points x0±41e have adapted coordinates (±41,0) and lie on ∂B(x0,41), hence in [0,1]2∖B(x0,41). By (31) and (30), ψ1(±41)+ψ2(0)>ψ1(0)+ψ2(0), i.e. ψ1(−41)>ψ1(0), ψ1(41)>ψ1(0). Replacing (η,e,ψ1) by (−η,−e,ψ1(−⋅)) if necessary, which leaves h, Δ and (30) unchanged, we may assume ψ1(−41)≤ψ1(41). Since ψ1(0)<ψ1(−41)≤ψ1(41), the intermediate value theorem on [0,41] yields r∈(0,41] with
ψ1(r)=ψ1(−41).(32)
For ∣t∣≤41 define x1(t):=x0−41e+te′ and x2(t):=x0+re+te′, with adapted coordinates (−41,t) and (r,t). Both lie in the closed ball of radius 41+∣t∣≤21 about x0, hence in [0,1]2, and by (30) and (32), h(x1(t))=ψ1(−41)+ψ2(t)=ψ1(r)+ψ2(t)=h(x2(t)). Consequently (29) gives
∣fc(x1(t))−fc(x2(t))∣≤2ε,∣t∣≤41.
At t=0, (28) gives fc(x1(0))≥41−θ and fc(x2(0))≤(1+θ)r, so 41−θ−2ε≤(1+θ)r. With θ=403 this yields r≥81 whenever ε≤501; in that case r∈[81,41].
Step 4: a uniform gap between their fc-values. Let S1:={x∈R2:∥x∥2=1} and, on the compact set K:=S1×S1×[81,41], define
Note here we include parallel pairs of unit vectors in K (not only those produced by Step 2) so that the parameter set is compact and yields a uniform lower bound.
Case e′=±e. Choose t=±41 accordingly, so that x0−41e+te′=x0, while x0+re+te′=x0+(r+41)e. The first value of fc is 0, the second is at least (1−θ)(r+41)>0 by (28).
Case e′∥e. Put μ:=e⊤e′∈(−1,1) and assume, for contradiction, that
Both ∥x1(t)−x0∥22=161−2tμ+t2≥161(1−μ2) and ∥x2(t)−x0∥22=r2+2rtμ+t2≥r2(1−μ2), are bounded below by positive constants on R, so both norms are real-analytic functions of t on R; the κ-terms are polynomials in t. By the identity theorem for real-analytic functions, (34) holds for every t∈R.
Write e=(e1,e2) and e′=(e1′,e2′). Expanding the cubes (the t3-terms cancel),
By the reverse triangle inequality, D(t):=∥41e+te′∥2−∥re+te′∥2≤∥41e−re∥2=41+r is bounded on R. A polynomial that is bounded on R is constant, so the quadratic coefficient in (35) vanishes; since 41+r>0,
(e1′)2e1+2(e2′)2e2=0.(37)
Moreover, (36) now shows that D(t) is constant in t. Rationalizing,
D(t)=−41e+te′2+re+te′2161−r2−2t(41+r)μ,
whose limits as t→+∞ and t→−∞ are −(41+r)μ and (41+r)μ, respectively. Since D is constant, these limits agree, so μ=0: e⊥e′. Then D(t)=161+t2−r2+t2 tends to 0 as ∣t∣→∞, hence D≡0, and t=0 gives r=41. The right-hand side of (36) is now identically zero, so the polynomial (35) vanishes identically; its constant term with r=41 gives −321(e13+2e23)=0, i.e.
e13+2e23=0.(38)
Since e⊥e′ are unit vectors, e′=±(−e2,e1), and (37) becomes e22e1+2e12e2=e1e2(e2+2e1)=0. If e1=0 then e2=±1 and e13+2e23=±2; if e2=0 then e1=±1 and e13+2e23=±1; if e2=−2e1 then e1=0 and e13+2e23=−15e13=0. All three cases contradict (38). Hence (34) is impossible, which proves (33).
Conclusion. Since K is compact and M is continuous, define s:=minKM>0. Hence every Φ∈N((2,1);ϕ) satisfies ∥fc−Φ∥L∞([0,1]d)≥ε∗, where ε∗:=min{81−θ,501,2s}>0.
Step 5: rescale fc into the Hölder class. The map y↦∥y∥2 is 2-Lipschitz with respect to ∥⋅∥∞. Moreover, ∥∇κ(y)∥1=3y12+6y22≤49 for y∈[−21,21]2. Thus fc is Lipschitz with respect to ∥⋅∥∞, with constant 2+409<2. Also, (28) gives ∥fc∥L∞([0,1]2)≤21+θ<1. Set γ′:=min{2λ,R}, fc:=γ′fc. Then ∥fc∥L∞([0,1]2)≤R. Furthermore, since ∥x−x′∥∞≤1 on [0,1]2, ∣fc(x)−fc(x′)∣≤2γ′∥x−x′∥∞≤λ∥x−x′∥∞≤λ∥x−x′∥∞α. Therefore fc∈Hλ,Rα([0,1]2). Finally, N((2,1);ϕ) is invariant under multiplication of the output layer by the positive constant γ′. Hence
In this appendix, we construct a continuous activation with which a network of hidden-layer widths (d,1) approximates every f∈Hλ,Rα([0,1]d) to accuracy ε in Lp([0,1]d). The idea of the continuous activation is to smooth the jumps of ϱ over transition intervals whose lengths decay geometrically along the negative axis, and to shift the arguments of the first hidden layer so far into the negative axis that the transition intervals there have negligible total length.
Continuous activation. The activation ϱ in (10) is constant on each interval [k,k+1), k∈Z, and hence can only jump at integers. For k∈Z, let wk:=2min{k,0}−1∈(0,21], i.e. wk=21 for k≥0 and wk=2k−1 for k<0, and define
see Figure 5. Here ϱc∈C(R), ϱc(k)=ϱ(k) for every k∈Z, and on each [k−1,k] the values of ϱc lie between ϱ(k−1) and ϱ(k). In particular, ϱc is locally bounded, [t]≤ϱc(t)≤[t]+1 for t<0, and 0≤ϱc(t)≤n on [Sn,Sn+1]. Only the negative axis is reached by the first hidden layer below, and there the total length of the transition intervals (k−wk,k) with k≤−N is ∑k≥N2−k−1=2−N for every N∈N0. The ramp lengths on the positive axis are immaterial, because the second hidden layer will be evaluated at integers outside a small exceptional set.
Figure 5: ϱc in [−2,S3), to be compared with ϱ in Figure 2. Each jump of ϱ at an integer k is replaced by a linear ramp on (k−wk,k), of length 21 for k≥0 and of geometrically shrinking length 2k−1 for k<0.
Network. Let p∈[1,∞), f∈Hλ,Rα([0,1]d) and ε>0. Let δ,M,B,K,n,qℓ,Jf,Nf be defined by (5), (6) and (12) with ε replaced by ε/2, so that λM−α+δ≤ε/2, and put
N0:=max{0,⌈log2d+plog2ε2(2R+δn)⌉}∈N0,
(39) so that d2−N0(2R+δn)p≤(ε/2)p. The network Φf,ε,pϱc∈N((d,1);ϱc) is defined by
uj(x):=ϱc(Mxj−(M+1)−N0),j=1,…,d,
(1st hidden layer) (40)
z(x):=ϱc(Nf+j=1∑d(M+1)j−1(uj(x)+M+1+N0)),
(2nd hidden layer) (41)
Φf,ε,pϱc(x):=−R+δz(x).
(output layer)
(42)
Compared with (13)–(15), the only changes are the activation and the shift N0, which is compensated in the second-layer bias; now the second-layer bias is the integer Nf+(M+1+N0)∑j=1d(M+1)j−1=Nf+(M+1+N0)(K−1)/M.
Transition region. For x∈[0,1]d, the arguments tj(x):=Mxj−(M+1)−N0 in (40) lie in [−(M+1)−N0,−1−N0], so the transition intervals that can be met are (k−wk,k) with k∈{−M−N0,…,−1−N0}, each of length wk≤2−N0−2 in tj, i.e. wk/M in xj. Define Λ:={x∈[0,1]d:tj(x)∈⋃k∈Z(k−wk,k) for some j}, whose Lebesgue measure satisfies
∣Λ∣≤dk≤−1−N0∑Mwk=Md2−N0−1≤d2−N0.(43)
Lemma E.2. For x∈[0,1]d∖Λ, uj(x)=⌊Mxj⌋−(M+1)−N0 for all j and z(x)=qr(x); hence Φf,ε,pϱc(x)=fr(x) and ∣f(x)−Φf,ε,pϱc(x)∣<ε/2. For all x∈[0,1]d, 0≤z(x)≤n and ∣f(x)−Φf,ε,pϱc(x)∣≤2R+δn.
Proof. If x∈/Λ, each tj(x) is negative and outside every transition interval, so ϱc(tj(x))=ϱ(tj(x))=⌊tj(x)⌋=⌊Mxj⌋−(M+1)−N0. The argument of ϱc in (41) is then the integer Nf+r(x), at which ϱc agrees with ϱ, and ϱ(Nf+r(x))=qr(x) by (11); the error bound is (7) with ε/2.
For arbitrary x, since tj(x)∈[−(M+1)−N0,−1−N0] and ϱc lies between the neighboring values of ⌊⋅⌋ on this range, uj(x)+M+1+N0∈[0,M]. Hence the preactivation part in (41) lies in [Nf,Nf+M∑j=1d(M+1)j−1]=[Nf,Nf+K−1]⊂[Sn,Sn+1−1], because K≤n and Nf+n−1≤Sn+n(n+1)n−1=Sn+1−1. On [Sn,Sn+1] we have 0≤ϱc≤n, so 0≤z(x)≤n, Φf,ε,pϱc(x)∈[−R,−R+δn], and since f(x)∈[−R,R] the last claim follows.
Theorem E.3 (Fixed continuous activation, (d,1) architecture, Lp guarantee). Let d∈N+, α∈(0,1], λ>0, R∈N+ and p∈[1,∞). For every f∈Hλ,Rα([0,1]d) and every ε>0, the network Φf,ε,pϱc∈N((d,1);ϱc) defined by (40)-(42) satisfies
f−Φf,ε,pϱcLp([0,1]d)≤ε.
The activation ϱc is continuous and does not depend on f, ε, p or d.
Proof. Splitting [0,1]d into Λ and its complement and using (43) and Lemma E.2,
Remark E.4 (Parameters and bit complexity of Φf,ε,pϱc). For R∈N+, all parameters of Φf,ε,pϱc are integers except the dyadic output weight δ, and ϱc takes rational values at rational arguments, so the network can be evaluated in exact arithmetic as in Section 6.
Compared with Φf,ε/2ϱ, only two parameters change: the first-layer biases decrease by N0 and the second-layer bias increases by the integer N0(K−1)/M. Since δn≤δK+δ(B−1) with δK=Θ(ε1−d/α) and δ(B−1)≤4R+2δ by (5), (39) gives N0=O(pαdlogε1), so these changes cost O(logε1) bits for fixed d,α,λ,R,p, while the dominant term bit(Nf)=Θ(ε−d/αlogε1) from the proof of Theorem 5.1 is unchanged. Hence, for d≥2, supf∈Hλ,Rα([0,1]d)bit(Φf,ε,pϱc)=Θ(ε−d/αlogε1): the continuous Lp construction has the same asymptotic bit complexity as the discontinuous L∞ construction.
F Additional Figures and Tables
In this appendix, we present additional figures and tables that help to understand our construction or numerical results.
Table 2: Position encoding example for d=2 and M=3, where I1=[0,31), I2=[31,32), I3=[32,1), and I4={1}.
Qℓ
x(ℓ)
ℓ
Qℓ
x(ℓ)
ℓ
Qℓ
x(ℓ)
ℓ
Qℓ
x(ℓ)
ℓ
I1×I1
(0,0)
(0)4
I2×I1
(31,0)
(1)4
I3×I1
(32,0)
(2)4
I4×I1
(1,0)
(3)4
I1×I2
(0,31)
(10)4
I2×I2
(31,31)
(11)4
I3×I2
(32,31)
(12)4
I4×I2
(1,31)
(13)4
I1×I3
(0,32)
(20)4
I2×I3
(31,32)
(21)4
I3×I3
(32,32)
(22)4
I4×I3
(1,32)
(23)4
I1×I4
(0,1)
(30)4
I2×I4
(31,1)
(31)4
I3×I4
(32,1)
(32)4
I4×I4
(1,1)
(33)4
Figure 6: Architecture of the elementary network Φf,εσ in Theorem 4.1. It has hidden-layer widths (d,1,2) and d+3 hidden neurons in total.
Figure 7: Architecture of the elementary network with a skip connection, Φf,εσ,skip, in Theorem 4.1. It has hidden-layer widths (d,1,1) and d+2 hidden neurons in total.
Table 3: Parameters, encoding bit lengths, and empirical errors for the three network constructions on f1,…,f6. The test set Xtest contains 3,004 points for f1,…,f4 and 3,008 points for f5,f6. The empirical errors are Eϱ:=maxx∈Xtest∣f(x)−Φf,εϱ(x)∣, Eσ:=maxx∈Xtest∣f(x)−Φf,εσ(x)∣, and Eσ,skip:=maxx∈Xtest∣f(x)−Φf,εσ,skip(x)∣.
f
ε
δ
M
K
B
bit(Af)
bit(Nf)
bit(Af)/Klog2B
bit(Nf)/n log2(n+1)
Eθ
Eσ
Eσ,skip
f1
2-1
2-2
13
196
16
782
1 497
0.9974
1.0021
0.3275
0.3275
0.2611
f1
2-2
2-3
26
729
32
3 643
6 938
0.9995
1.0006
0.1760
0.1760
0.1438
f1
2-3
2-4
51
2 704
64
16 222
30 834
0.9999
1.0001
0.0912
0.0912
0.0762
f1
2-4
2-5
101
10 404
128
72 826
138 847
1.0000
1.0000
0.0416
0.0416
0.0335
f1
2-5
2-6
202
41 209
256
329 670
631 770
1.0000
1.0000
0.0223
0.0223
0.0186
f1
2-6
2-7
403
163 216
512
1 468 942
2 826 326
1.0000
1.0000
0.0116
0.0116
0.0097
f1
2-7
2-8
805
649 636
1 024
6 496 358
12 544 008
1.0000
1.0000
0.0056
0.0056
0.0045
f2
2-1
2-2
49
2 500
32
12 499
28 225
0.9999
1.0002
0.2978
0.2978
0.2785
f2
2-2
2-3
196
38 809
64
232 853
591 615
1.0000
1.0000
0.1772
0.1772
0.1435
f2
2-3
2-4
784
616 225
128
4 313 574
11 851 923
1.0000
1.0000
0.0911
0.0911
0.0734
f3
2-1
2-2
76
5 929
16
23 715
74 316
1.0000
1.0000
0.4500
0.4500
0.4167
f3
2-2
2-3
152
23 409
32
117 044
339 781
1.0000
1.0000
0.2370
0.2370
0.2169
f3
2-3
2-4
304
93 025
64
558 149
1 535 414
1.0000
1.0000
0.1189
0.1189
0.1110
f3
2-4
2-5
608
370 881
128
2 596 166
6 861 527
1.0000
1.0000
0.0584
0.0584
0.0535
f3
2-5
2-6
1 216
1 481 089
256
11 848 711
30 359 706
1.0000
1.0000
0.0301
0.0301
0.0276
f4
2-1
2-2
74
5 625
16
22 498
70 078
0.9999
1.0000
0.4219
0.4219
0.3552
f4
2-2
2-3
147
21 904
32
109 518
315 837
1.0000
1.0000
0.2027
0.2027
0.1654
f4
2-3
2-4
293
86 436
64
518 614
1 417 500
1.0000
1.0000
0.0993
0.0993
0.0805
f4
2-4
2-5
586
344 569
128
2 411 981
6 338 158
1.0000
1.0000
0.0465
0.0465
0.0393
f4
2-5
2-6
1 172
1 375 929
256
11 007 430
28 057 917
1.0000
1.0000
0.0268
0.0268
0.0209
f5
2-1
2-2
16
4 913
16
19 650
60 249
0.9999
1.0000
0.3384
0.3384
0.2839
f5
2-2
2-3
32
35 937
32
179 683
543 846
1.0000
1.0000
0.1620
0.1620
0.1399
f5
2-3
2-4
63
262 144
64
1 572 862
4 718 598
1.0000
1.0000
0.0864
0.0864
0.0755
f5
2-4
2-5
125
2 000 376
128
14 002 630
41 871 557
1.0000
1.0000
0.0476
0.0476
0.0412
f6
2-1
2-2
11
1 728
16
6 910
18 588
0.9997
1.0001
0.4025
0.4025
0.3612
f6
2-2
2-3
22
12 167
32
60 833
165 119
1.0000
1.0000
0.1959
0.1959
0.1717
f6
2-3
2-4
44
91 125
64
546 748
1 501 341
1.0000
1.0000
0.1092
0.1092
0.0924
f6
2-4
2-5
88
704 969
128
4 934 781
13 695 580
1.0000
1.0000
0.0517
0.0517
0.0453
Figure 8: Numerical verification of Theorem 3.1 for the approximation of the 2D function f1 by the three-neuron network Φf1,εθ. The panels are arranged as in Figure 4, with ε=2−1,2−2,2−3 ( M=13,26,51); the error plot additionally includes finer networks down to ε=2−7.
Figure 9: Numerical verification of Theorem 3.1 for the approximation of the 2D function f2 by the three-neuron network Φf2,εθ. The panels are arranged as in Figure 4, with ε=2−1,2−2,2−3 ( M=49,196,784).
Figure 10: Numerical verification of Theorem 3.1 for the approximation of the 2D function f3 by the three-neuron network Φf3,εθ. The panels are arranged as in Figure 4, with ε=2−1,2−2,2−3 ( M=76,152,304); the error plot additionally includes finer accuracy down to ε=2−5.
Figure 11: Numerical verification of Theorem 3.1 for the approximation of the 3D function f5 by the four-neuron network Φf5,εo. From top to bottom, the panels show the x1x2, x2x3, and x1x3 sections, with the remaining coordinate fixed at 1/4. Within each panel, the top row contains the target and the network outputs for ε=2−1, 2−2, 2−3 ( M=16,32,63), and the bottom row contains the corresponding absolute errors.
Figure 12: Numerical verification of Theorem 3.1 for the approximation of the 3D function f6 by the four-neuron network Φf6,ερ. The sections and panels are arranged as in Figure 11, with ε=2−1,2−2,2−3 and M=11,22,44.
(a) Target function f1.
(b) Target function f2.
(c) Target function f3.
(d) Target function f4.
(e) Target function f5.
(f) Target function f6.
Figure 13: Sup-norm errors for the three network constructions applied to f1,…,f6, evaluated in exact arithmetic over 3,004 test points for f1,…,f4 ( d=2) and 3,008 test points for f5 and f6 ( d=3). Each test set consists of 2,000 random points, 1,000 boundary points, and the 2d corners. The exact and elementary networks attain identical maximal errors and are therefore represented by a single curve, while the skip-connection network is shown separately. All errors remain below the prescribed accuracy ε.