Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Echo state networks are universal (Thm. 4.1)

Open
ReservoirESN.esn_universal

by olivier · Sep 11, 2026 · Mathlib 0df444a (Lean v4.33.1)

echo-state-networkmachine-learningreservoir-computinguniversal-approximation

Let HHH be a functional on uniformly bounded input sequences with the fading memory property: it sends an input history to the present value of an output, continuously for the weighted norm. The theorem asserts that for every accuracy ε>0\varepsilon > 0ε>0 there is an echo state network

xk=σ ⁣(Axk+1+Czk+ζ),y=Wx0,x_k = \sigma\!\left(A x_{k+1} + C z_k + \zeta\right), \qquad y = W x_0 ,xk​=σ(Axk+1​+Czk​+ζ),y=Wx0​,

with a squashing function σ\sigmaσ and a reservoir matrix satisfying the contraction condition, whose linear readout approximates HHH uniformly over all admissible inputs:

sup⁡z  ∥H(z)−Wx0(z)∥<ε.\sup_{z} \; \lVert H(z) - W x_0(z) \rVert < \varepsilon .zsup​∥H(z)−Wx0​(z)∥<ε.

In words: any fading memory input/output system in discrete time is realized, to arbitrary accuracy, by a finite-dimensional network whose recurrent part is fixed and whose only trained component is a linear readout. This is the theorem that justifies reservoir computing as a method: it says the architecture is not merely convenient but expressive enough in principle, and that the training problem may legitimately be reduced to a linear regression.

The result is proved in the source. Its proof is not self-contained: the target functional is first approximated by a non-homogeneous state-affine system, using a density theorem established in a companion paper, and only then is that system replaced by an echo state network.

Formalization Note The statement is phrased for the functional rather than the filter. By Proposition 2.12 of the source the two are in linear bijection, with the fading memory property on one side equivalent to it on the other, so nothing is lost; this avoids formalizing causality and time-invariance separately. The approximating network is required to satisfy the contraction condition nALσ<1n_A L_\sigma < 1nA​Lσ​<1, which by the supporting target gives it the echo state property, so the state sequence it is evaluated at is the unique bounded one; the conclusion is stated for any such state sequence rather than presupposing a choice. The bound on the reservoir matrix is an operator inequality with an explicit constant, of which the spectral norm is one admissible value. The supremum over inputs is expressed as a universally quantified strict inequality.

Preamble
import Mathlib
import Definitions.Def_ReservoirESN

open Matrix Metric ReservoirESN
Formal statement
namespace ReservoirESN

theorem esn_universal {n d : ℕ} (hd : 0 < d)
    (M : ℝ) (hM : 0 < M) (w : ℕ → ℝ) (hw : IsWeighting w)
    (H : (ℕ → EuclideanSpace ℝ (Fin n)) → EuclideanSpace ℝ (Fin d))
    (hH : FunctionalFMP H M w) (ε : ℝ) (hε : 0 < ε) :
    ∃ (N : ℕ) (A : Matrix (Fin N) (Fin N) ℝ) (Cin : Matrix (Fin N) (Fin n) ℝ)
      (ζ : EuclideanSpace ℝ (Fin N)) (W : Matrix (Fin d) (Fin N) ℝ)
      (σ : ℝ → ℝ) (Lσ nA : ℝ),
      IsSquashing σ Lσ ∧ 0 ≤ nA ∧
      (∀ v : EuclideanSpace ℝ (Fin N),
        ‖(EuclideanSpace.equiv (Fin N) ℝ).symm (A *ᵥ (EuclideanSpace.equiv (Fin N) ℝ v))‖
          ≤ nA * ‖v‖) ∧
      nA * Lσ < 1 ∧
      ∀ z : ℕ → EuclideanSpace ℝ (Fin n), UnifBdd M z →
        ∀ x : ℕ → EuclideanSpace ℝ (Fin N), IsESNSolution A Cin ζ σ z x →
          (∀ k i, x k i ∈ Set.Icc (-1 : ℝ) 1) →
          ‖H z - (EuclideanSpace.equiv (Fin d) ℝ).symm
              (W *ᵥ (EuclideanSpace.equiv (Fin N) ℝ (x 0)))‖ < ε := by sorry

end ReservoirESN
Source
L. Grigoryeva, J.-P. Ortega, Echo state networks are universal, Neural Networks 108 (2018), 495-508, https://arxiv.org/abs/1806.00797, p. 14, Theorem 4.1: every causal, time-invariant filter with the fading memory property on uniformly bounded inputs is uniformly approximated by an echo state network with a linear readout.
Read-back

What the Lean code literally says, in plain math · claude-opus-5

Read-back — esn_universal

The statement fixes two natural numbers nnn and ddd (implicit arguments, so nnn is unconstrained and may be 000; ddd is assumed to satisfy 0<d0 < d0<d), a real MMM with 0<M0 < M0<M, a sequence w:N→Rw : \mathbb{N} \to \mathbb{R}w:N→R, a map

H:(N→Rn)⟶Rd,H : (\mathbb{N} \to \mathbb{R}^n) \longrightarrow \mathbb{R}^d,H:(N→Rn)⟶Rd,

where Rn\mathbb{R}^nRn and Rd\mathbb{R}^dRd carry the Euclidean (ℓ2\ell^2ℓ2) norm, and a real ε\varepsilonε with 0<ε0 < \varepsilon0<ε.

Three hypotheses are assumed.

  • www is a weighting sequence: wk>0w_k > 0wk​>0 for every kkk, wk≤1w_k \le 1wk​≤1 for every kkk, www is antitone (non-increasing), and wk→0w_k \to 0wk​→0 as k→∞k \to \inftyk→∞.
  • HHH has the functional fading-memory property with radius MMM and weight www: for every ε′>0\varepsilon' > 0ε′>0 there exists δ>0\delta > 0δ>0 such that for all input sequences z,z′:N→Rnz, z' : \mathbb{N} \to \mathbb{R}^nz,z′:N→Rn satisfying ∥zk∥≤M\|z_k\| \le M∥zk​∥≤M and ∥zk′∥≤M\|z'_k\| \le M∥zk′​∥≤M for every kkk, if the pointwise weighted bound ∥zk−zk′∥⋅wk≤δ\|z_k - z'_k\| \cdot w_k \le \delta∥zk​−zk′​∥⋅wk​≤δ holds for every kkk, then ∥H(z)−H(z′)∥<ε′\|H(z) - H(z')\| < \varepsilon'∥H(z)−H(z′)∥<ε′. (The weighted condition is a pointwise bound by δ\deltaδ, non-strict, not a statement about an actual supremum.)
  • 0<d0 < d0<d, 0<M0 < M0<M, 0<ε0 < \varepsilon0<ε.

Under these hypotheses the conclusion asserts the existence of: a natural number NNN; a real matrix A∈RN×NA \in \mathbb{R}^{N \times N}A∈RN×N; a real matrix Cin∈RN×nC_{\mathrm{in}} \in \mathbb{R}^{N \times n}Cin​∈RN×n; a vector ζ∈RN\zeta \in \mathbb{R}^Nζ∈RN; a real matrix W∈Rd×NW \in \mathbb{R}^{d \times N}W∈Rd×N; a function σ:R→R\sigma : \mathbb{R} \to \mathbb{R}σ:R→R; and two reals LσL_\sigmaLσ​ and nAn_AnA​, such that all of the following hold simultaneously.

  1. σ\sigmaσ is a squashing function with Lipschitz constant LσL_\sigmaLσ​: 0≤Lσ0 \le L_\sigma0≤Lσ​; σ(t)∈[−1,1]\sigma(t) \in [-1,1]σ(t)∈[−1,1] for every real ttt; σ\sigmaσ is monotone non-decreasing; σ(t)→−1\sigma(t) \to -1σ(t)→−1 as t→−∞t \to -\inftyt→−∞ and σ(t)→1\sigma(t) \to 1σ(t)→1 as t→+∞t \to +\inftyt→+∞; and ∣σ(s)−σ(t)∣≤Lσ ∣s−t∣|\sigma(s) - \sigma(t)| \le L_\sigma\,|s-t|∣σ(s)−σ(t)∣≤Lσ​∣s−t∣ for all reals s,ts,ts,t.
  2. 0≤nA0 \le n_A0≤nA​.
  3. nAn_AnA​ bounds AAA in ℓ2\ell^2ℓ2 operator norm: for every v∈RNv \in \mathbb{R}^Nv∈RN, ∥Av∥≤nA∥v∥\|Av\| \le n_A \|v\|∥Av∥≤nA​∥v∥, the norms being Euclidean.
  4. nA⋅Lσ<1n_A \cdot L_\sigma < 1nA​⋅Lσ​<1, strictly.
  5. For every input sequence z:N→Rnz : \mathbb{N} \to \mathbb{R}^nz:N→Rn with ∥zk∥≤M\|z_k\| \le M∥zk​∥≤M for every kkk, and for every sequence x:N→RNx : \mathbb{N} \to \mathbb{R}^Nx:N→RN such that
xk(i)  =  σ ⁣((A xk+1+Cin zk)(i)+ζ(i))for all k∈N, i∈{1,…,N},x_k(i) \;=\; \sigma\!\Big( \big(A\,x_{k+1} + C_{\mathrm{in}}\,z_k\big)(i) + \zeta(i) \Big) \quad \text{for all } k \in \mathbb{N},\ i \in \{1,\dots,N\},xk​(i)=σ((Axk+1​+Cin​zk​)(i)+ζ(i))for all k∈N, i∈{1,…,N},

and such that additionally xk(i)∈[−1,1]x_k(i) \in [-1,1]xk​(i)∈[−1,1] for all kkk and iii, one has

∥H(z)  −  W x0∥  <  ε.\big\| H(z) \;-\; W\,x_0 \big\| \;<\; \varepsilon .​H(z)−Wx0​​<ε.

Several features of the quantifier structure are worth stating explicitly. The objects N,A,Cin,ζ,W,σ,Lσ,nAN, A, C_{\mathrm{in}}, \zeta, W, \sigma, L_\sigma, n_AN,A,Cin​,ζ,W,σ,Lσ​,nA​ are chosen before zzz and xxx, hence uniformly over all inputs bounded by MMM and over all state sequences. The indexing convention is that kkk increases into the past: the recursion expresses xkx_kxk​ in terms of xk+1x_{k+1}xk+1​, and the approximation is asserted only at index 000.

The final clause is a conditional statement about state sequences xxx; the statement does not assert that such an xxx exists for a given zzz, nor that it is unique. If for some bounded zzz no sequence satisfies the recursion, the requirement is vacuously met for that zzz. The extra requirement xk(i)∈[−1,1]x_k(i) \in [-1,1]xk​(i)∈[−1,1] is an additional hypothesis narrowing the sequences quantified over (it is already entailed by the recursion together with the range condition on σ\sigmaσ). The readout is purely linear: Wx0W x_0Wx0​, with no bias term. Nothing constrains NNN to be positive, and nnn may be 000. The constant nAn_AnA​ is any number satisfying the operator bound, not necessarily the operator norm itself; likewise LσL_\sigmaLσ​ is any admissible Lipschitz constant. The hypothesis 0<d0 < d0<d and the weighting hypothesis on www enter the statement only as stated assumptions; www itself appears in the conclusion nowhere.

The declaration is stated without a proof (its proof term is a placeholder).

Human review
  • Flagged by Shuze Chen · Sep 11, 2026

    The following problem is reported by Fable 5. It seems this theorem is a stronger version of the one in the original paper. If that's intended, please ignore the report and submit again.

    Theorem 4.1 does not give an approximant with nA * Lσ < 1: its conclusion is about generalized filters and the echo state property is only conditional (the authors confirm this in Gonon and Ortega, "Fading memory echo state networks are universal", Neural Networks 2021, arXiv:2010.12047, whose own construction is a nilpotent shift register with no bound on ‖A‖₂·Lσ). So the goal as stated is not the cited theorem. Either replace nA * Lσ < 1 by "for every admissible input the bounded state sequence exists and is unique" and cite the 2021 paper, or keep it and state in the source field and NL that this strengthening is not proved in either paper.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me