Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Universality of SAS reservoir computers (Thm. 3.12)

Proved
ReservoirSAS.sas_universal

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

machine-learningreservoir-computingstate-affine-systemuniversal-approximation

Let HHH be a functional on scalar input sequences bounded by one, with the fading memory property. The theorem asserts that for every ε∈(0,1)\varepsilon \in (0,1)ε∈(0,1) there exist polynomials ppp, qqq and a readout vector WWW, with both polynomial bounds below 1−ε1-\varepsilon1−ε, such that the associated state-affine system approximates HHH uniformly:

sup⁡z∣H(z)−W⊤x0(z)∣<ε.\sup_z \bigl| H(z) - W^{\top} x_0(z) \bigr| < \varepsilon .zsup​​H(z)−W⊤x0​(z)​<ε.

This is Theorem 3.12 of the source. It is the density result of reservoir computing: the family of state-affine systems with linear readouts is dense in the fading memory category. Every later universality theorem for reservoir families rests on it, including the one for echo state networks, whose proof replaces the target filter by a state-affine system before replacing it by a network.

The proof is not constructive in the naive sense: the target is an arbitrary fading memory filter given by no formula. It proceeds by showing that the SAS functionals form a polynomial algebra separating points and containing the constants, then applying a Stone-Weierstrass argument on a space of inputs made compact by the weighted topology.

Formalization Note A single ε\varepsilonε controls both the approximation accuracy and the polynomial bounds 1−ε1-\varepsilon1−ε, exactly as in the source; it is not an independent tolerance. The state ceiling (1−ε)/ε(1-\varepsilon)/\varepsilon(1−ε)/ε appearing in the conclusion is what the supporting target delivers for those bounds, and it is that target which guarantees such a state sequence exists and is unique, so the approximation clause is not vacuous. The conclusion is stated for every bounded solution rather than for a distinguished one, which is stronger. Inputs are scalar, as in Section 3 of the source. The fading memory property of the target is the one already published on the platform, stated for a functional rather than a filter; the two are in linear bijection.

Preamble
import Mathlib
import Definitions.Def_ReservoirESN
import Definitions.Def_ReservoirSAS

open Matrix Metric ReservoirESN ReservoirSAS
Formal statement
namespace ReservoirSAS

theorem sas_universal
    (ε : ℝ) (hε0 : 0 < ε) (hε1 : ε < 1) (w : ℕ → ℝ) (hw : IsWeighting w)
    (H : (ℕ → ℝ) → ℝ) (hH : FunctionalFMP H 1 w) :
    ∃ (N r s : ℕ) (P : Fin r → Matrix (Fin N) (Fin N) ℝ)
      (Q : Fin s → EuclideanSpace ℝ (Fin N)) (W : EuclideanSpace ℝ (Fin N)),
      MatPolyOpBound P (1 - ε) ∧ VecPolyBound Q (1 - ε) ∧
      ∀ z : ℕ → ℝ, (∀ k, z k ∈ Set.Icc (-1 : ℝ) 1) →
        ∀ x : ℕ → EuclideanSpace ℝ (Fin N), IsSASSolution P Q z x →
          (∀ k, ‖x k‖ ≤ (1 - ε) / ε) →
          |H z - inner ℝ W (x 0)| < ε := by sorry

end ReservoirSAS
Source
L. Grigoryeva, J.-P. Ortega, Universal discrete-time reservoir computers with stochastic inputs and linear readouts using non-homogeneous state-affine systems, Journal of Machine Learning Research 19(24) (2018), 1-40, https://arxiv.org/abs/1712.00754, p. 12, Theorem 3.12: the family of SAS functionals with M_p, M_q < 1 - epsilon is dense in the fading memory category; any such filter is uniformly approximated within epsilon.
Read-back

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

The statement fixes a real number ε\varepsilonε subject to 0<ε0 < \varepsilon0<ε and ε<1\varepsilon < 1ε<1; a sequence w:N→Rw : \mathbb{N} \to \mathbb{R}w:N→R assumed to be a weighting sequence, meaning wk>0w_k > 0wk​>0 and wk≤1w_k \le 1wk​≤1 for every kkk, www is non-increasing, and wk→0w_k \to 0wk​→0 as k→∞k \to \inftyk→∞; and a functional HHH sending a real-valued sequence z:N→Rz : \mathbb{N} \to \mathbb{R}z:N→R to a real number H(z)H(z)H(z). The functional is assumed to have the fading-memory property at input level 111 relative to www, which unfolds to:

∀η>0, ∃δ>0, ∀z,z′:N→R,(∀k, ∣zk∣≤1)∧(∀k, ∣zk′∣≤1)∧(∀k, ∣zk−zk′∣ wk≤δ) ⟹ ∣H(z)−H(z′)∣<η.\forall \eta > 0,\ \exists \delta > 0,\ \forall z, z' : \mathbb{N} \to \mathbb{R},\quad \Big(\forall k,\ |z_k| \le 1\Big) \wedge \Big(\forall k,\ |z'_k| \le 1\Big) \wedge \Big(\forall k,\ |z_k - z'_k|\, w_k \le \delta\Big) \ \Longrightarrow\ |H(z) - H(z')| < \eta .∀η>0, ∃δ>0, ∀z,z′:N→R,(∀k, ∣zk​∣≤1)∧(∀k, ∣zk′​∣≤1)∧(∀k, ∣zk​−zk′​∣wk​≤δ) ⟹ ∣H(z)−H(z′)∣<η.

This says nothing about HHH on sequences that leave [−1,1][-1,1][−1,1], and imposes no bound on the values of HHH.

Under these hypotheses the theorem asserts the existence of three natural numbers N,r,sN, r, sN,r,s, a family of rrr real N×NN \times NN×N matrices P0,…,Pr−1P_0, \dots, P_{r-1}P0​,…,Pr−1​, a family of sss vectors Q0,…,Qs−1Q_0, \dots, Q_{s-1}Q0​,…,Qs−1​ in the Euclidean space RN\mathbb{R}^NRN, and one further vector W∈RNW \in \mathbb{R}^NW∈RN, such that three conditions hold simultaneously. Write

p(z):=∑j=0r−1zjPj∈RN×N,q(z):=∑j=0s−1zjQj∈RN,p(z) := \sum_{j=0}^{r-1} z^{j} P_j \in \mathbb{R}^{N \times N}, \qquad q(z) := \sum_{j=0}^{s-1} z^{j} Q_j \in \mathbb{R}^{N},p(z):=j=0∑r−1​zjPj​∈RN×N,q(z):=j=0∑s−1​zjQj​∈RN,

with ∥⋅∥\|\cdot\|∥⋅∥ the Euclidean norm throughout.

(i) Matrix-polynomial bound. For every real z∈[−1,1]z \in [-1,1]z∈[−1,1] and every vector v∈RNv \in \mathbb{R}^Nv∈RN,  ∥p(z) v∥≤(1−ε) ∥v∥\ \|p(z)\,v\| \le (1-\varepsilon)\,\|v\| ∥p(z)v∥≤(1−ε)∥v∥. (This is stated vector-by-vector, not as a named operator norm.)

(ii) Vector-polynomial bound. For every real z∈[−1,1]z \in [-1,1]z∈[−1,1],  ∥q(z)∥≤1−ε\ \|q(z)\| \le 1-\varepsilon ∥q(z)∥≤1−ε.

(iii) Approximation clause. For every sequence z:N→Rz : \mathbb{N} \to \mathbb{R}z:N→R whose every term lies in [−1,1][-1,1][−1,1], and for every sequence of states x:N→RNx : \mathbb{N} \to \mathbb{R}^Nx:N→RN satisfying both

xk=p(zk) xk+1+q(zk)for every k∈N,and∥xk∥≤1−εεfor every k∈N,x_k = p(z_k)\, x_{k+1} + q(z_k) \quad \text{for every } k \in \mathbb{N}, \qquad\text{and}\qquad \|x_k\| \le \frac{1-\varepsilon}{\varepsilon} \quad \text{for every } k \in \mathbb{N},xk​=p(zk​)xk+1​+q(zk​)for every k∈N,and∥xk​∥≤ε1−ε​for every k∈N,

one has the strict inequality

∣H(z)−⟨W,x0⟩∣<ε,⟨W,x0⟩=∑i=0N−1Wi (x0)i.\Big| H(z) - \langle W, x_0\rangle \Big| < \varepsilon, \qquad \langle W, x_0\rangle = \sum_{i=0}^{N-1} W_i\, (x_0)_i .​H(z)−⟨W,x0​⟩​<ε,⟨W,x0​⟩=i=0∑N−1​Wi​(x0​)i​.

Several features of the quantification deserve to be made explicit. The index kkk runs over N\mathbb{N}N and the recursion determines xkx_kxk​ from the higher-indexed xk+1x_{k+1}xk+1​; the term evaluated against WWW is x0x_0x0​. The witnesses N,r,s,P,Q,WN, r, s, P, Q, WN,r,s,P,Q,W are chosen before zzz and xxx, so a single system and a single readout vector must work for all admissible inputs; conversely they are chosen after ε\varepsilonε, www and HHH, so they may depend on all three. The sequence www appears nowhere in the conclusion — it enters only through the hypothesis on HHH. No bound whatsoever is placed on ∥W∥\|W\|∥W∥, and no relation is required between NNN, rrr and sss.

The numbers NNN, rrr, sss are unrestricted naturals and may be 000. With r=0r = 0r=0 the sum defining p(z)p(z)p(z) is empty, so p(z)p(z)p(z) is the zero matrix; with s=0s = 0s=0, q(z)q(z)q(z) is the zero vector; with N=0N = 0N=0 the space RN\mathbb{R}^NRN is trivial, every state is 000 and the inner product is 000. In each of those cases conditions (i) and (ii) hold automatically, since 1−ε>01 - \varepsilon > 01−ε>0.

The final clause asserts nothing about existence: it does not claim that an admissible input zzz admits any state sequence satisfying the recursion, nor that a solution of the recursion satisfies the norm bound ∥xk∥≤(1−ε)/ε\|x_k\| \le (1-\varepsilon)/\varepsilon∥xk​∥≤(1−ε)/ε. For any zzz admitting no such bounded solution, the inequality holds vacuously. In the other direction the clause quantifies over all bounded solutions attached to a given zzz, so whenever several exist, each of their readouts ⟨W,x0⟩\langle W, x_0\rangle⟨W,x0​⟩ must lie strictly within ε\varepsilonε of H(z)H(z)H(z).

Finally, the single parameter ε\varepsilonε plays three distinct roles that are tied together: the contraction factor 1−ε1-\varepsilon1−ε in (i), the vector bound 1−ε1-\varepsilon1−ε in (ii) and the state-norm ceiling (1−ε)/ε(1-\varepsilon)/\varepsilon(1−ε)/ε in (iii), and the approximation accuracy ε\varepsilonε itself. Since 0<ε<10 < \varepsilon < 10<ε<1, we have 1−ε∈(0,1)1-\varepsilon \in (0,1)1−ε∈(0,1) and (1−ε)/ε>0(1-\varepsilon)/\varepsilon > 0(1−ε)/ε>0. The accuracy claimed is exactly ε\varepsilonε, strictly, and not an arbitrary independent tolerance. The declaration carries no proof; its body is left unproved.

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

  • Endorsed by olivier · Sep 11, 2026

    Confirmed by the mission captain (proposal self-audit).

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