---
title: Willems' Fundamental Lemma in Data-Driven Control
url: https://www.emergentmind.com/topics/willems-fundamental-lemma-9a97238e-ffc9-4db8-b5ec-06dc6419d230
type: topic
---

# Willems' Fundamental Lemma in Data-Driven Control

Willems’ Fundamental Lemma is a behavioral and data-driven characterization of finite-horizon trajectories of discrete-time linear time-invariant systems. In its standard form, it states that, for a controllable system of state dimension \(n\), a single measured trajectory generated by an input that is persistently exciting of order \(L+n\) suffices to parameterize every length-\(L\) input-output trajectory of the same system through the column space of stacked Hankel matrices built from the measured data [2503.12489]. In this sense, the lemma replaces explicit model identification by a direct trajectory representation from data, and it underlies modern data-driven simulation, subspace identification, and predictive control formulations such as DeePC [2208.00905].

## 1. Formal statement in the behavioral setting

Consider the discrete-time LTI system
\[
x_{k+1} = A x_k + B u_k,\quad y_k = C x_k + D u_k,
\]
with \(x_k \in \mathbb{R}^n\), \(u_k \in \mathbb{R}^m\), and \(y_k \in \mathbb{R}^p\). A behavioral formulation defines the set of all trajectories consistent with the system by
\[
\mathfrak{B}(A,B,C,D) =\bigl\{(u,y): \exists x\text{ s.t. }x_{k+1}=Ax_k+Bu_k,\ y_k=Cx_k+Du_k\ \forall k\bigr\},
\]
and its length-\(L\) restriction by
\[
\mathfrak{B}_L(A,B,C,D) = \left\{ \begin{bmatrix} u_{[0,L-1]} \\ y_{[0,L-1]} \end{bmatrix} : (u,y)\in\mathfrak{B}(A,B,C,D)\right\}.
\]
In this formulation, the key assumption is controllability of \((A,B)\). No observability or minimality assumption is required for the input-output statement in the behavioral/data-driven proofs summarized in the recent literature, even though some classical presentations use minimal realizations [2503.12489].

Given one measured trajectory \(\{u_k,y_k\}_{k=0}^{N-1}\), define the depth-\(L\) Hankel matrices
\[
H_u^{(L)} \;=\; \begin{bmatrix} u_0 & u_1 & \cdots & u_{N-L} \\
u_1 & u_2 & \cdots & u_{N-L+1} \\
\vdots & \vdots & \ddots & \vdots \\
u_{L-1} & u_L & \cdots & u_{N-1} \end{bmatrix}\in \mathbb{R}^{mL \times (N-L+1)},
\]
\[
H_y^{(L)} \;=\; \begin{bmatrix} y_0 & y_1 & \cdots & y_{N-L} \\
y_1 & y_2 & \cdots & y_{N-L+1} \\
\vdots & \vdots & \ddots & \vdots \\
y_{L-1} & y_L & \cdots & y_{N-1} \end{bmatrix}\in \mathbb{R}^{pL \times (N-L+1)}.
\]
Each column of the stacked matrix \(\begin{bmatrix}H_u^{(L)} \\ H_y^{(L)}\end{bmatrix}\) is itself a valid length-\(L\) trajectory segment, so one always has
\[
\operatorname{im}\begin{bmatrix} H_u^{(L)} \\ H_y^{(L)} \end{bmatrix} \subseteq \mathfrak{B}_L(A,B,C,D).
\]
Willems’ Fundamental Lemma states that this inclusion becomes an equality under a richness condition on the input [2503.12489].

A standard discrete-time formulation is
\[
\mathfrak{B}_L(A,B,C,D) \;=\; \operatorname{im}\begin{bmatrix} H_u^{(L)} \\ H_y^{(L)} \end{bmatrix},
\]
provided the measured input is persistently exciting of order \(L+n\). Equivalently, for every \((u',y')\in \mathfrak{B}_L(A,B,C,D)\), there exists a coefficient vector \(g\in\mathbb{R}^{N-L+1}\) such that
\[
\begin{bmatrix} H_u^{(L)} \\ H_y^{(L)} \end{bmatrix} g = \begin{bmatrix} u' \\ y' \end{bmatrix}.
\]
This representation is the central algebraic content of the lemma [2503.12489].

## 2. Persistency of excitation and data length

For an \(m\)-input signal, persistency of excitation of order \(s\) is the rank condition
\[
\operatorname{rank}\bigl(H_u^{(s)}\bigr) = m s.
\]
A necessary condition for this is that the Hankel matrix has at least \(ms\) columns:
\[
N - s + 1 \;\ge\; ms \quad\iff\quad N \;\ge\; (m+1)s - 1.
\]
In the fundamental lemma, the relevant order is \(s=L+n\), so the standard noise-free lower bound is
\[
N \;\ge\; (m+1)(L+n) - 1.
\]
This is the usual sample-length requirement for a single experiment to generate a data matrix rich enough to span all length-\(L\) trajectories [2503.12489].

A closely related state-space rank condition appears in constructive proofs. If the input is persistently exciting of order \(L+n\), then for any consistent state sequence,
\[
\operatorname{rank}\begin{bmatrix} H_u^{(L)} \\ H_x^{(1)} \end{bmatrix} \;=\; n + L m,
\]
where \(H_x^{(1)}\) is the shifted state Hankel. This identity is one of the technical mechanisms behind state-space proofs and constructive variants of the lemma [2503.12489].

Several later works refine the binary rank notion of excitation. A quantitative version introduces matrix-valued or singular-value-based excitation conditions such as
\[
H_L(u)H_L(u)^\top \succeq K,\qquad K\succ 0,
\]
or equivalently \(\sigma_{\min}(H_L(u))\ge \alpha\) for some \(\alpha>0\). This preserves the same structural role as classical PE while making robustness margins explicit through lower bounds on singular values [2208.00905]. A related robust formulation emphasizes that ordinary full-rank tests are fragile under noise and replaces them by lower bounds on the smallest singular value of the relevant data matrices [2205.06636].

This suggests a useful distinction. Classical PE is a feasibility condition for exact trajectory spanning in the noiseless setting, whereas quantitative PE is a conditioning condition for robust trajectory reconstruction, identification, and optimization in the presence of perturbations.

## 3. Universality and the necessity of PE

A recent development reframes the lemma through the notion of a universal input. Fix \(L\) and \(N\). An input \(u_{[0,N-1]}\) is called universal for determining the \(L\)-restricted behavior if, for every controllable \((A,B,C,D)\) and every compatible measured output \(y_{[0,N-1]}\),
\[
\mathfrak{B}_L(A,B,C,D) \;=\; \operatorname{im}\begin{bmatrix} H_u^{(L)} \\ H_y^{(L)} \end{bmatrix}.
\]
In this terminology, Willems’ lemma gives the sufficiency direction: if the input is PE of order \(L+n\), then it is universal [2503.12489].

The main result of "A new perspective on Willems' fundamental lemma: Universality of persistently exciting inputs" [2503.12489] proves the converse:
\[
u_{[0,N-1]}\text{ is universal for length }L
\quad\Longleftrightarrow\quad
u_{[0,N-1]}\text{ is PE of order }L+n.
\]
Thus, persistency of excitation is not merely a sufficient richness requirement; it is exactly the necessary and sufficient condition for an input to work uniformly over the class of controllable systems [2503.12489].

The converse proof proceeds by contradiction. If \(u_{[0,N-1]}\) is not PE of order \(L+n\), then there exists a nonzero vector in \(\ker(H_u^{(L+n)})^\top\), expressing a nontrivial linear dependence among all length-\((L+n)\) sliding windows of the input. From this dependence one constructs a controllable pair \((A,B)\), an initial state, and then an output map \(y_k=w^\top x_k\) with \(D=0\), such that the stacked Hankel \(\begin{bmatrix}H_u^{(L)} \\ H_y^{(L)}\end{bmatrix}\) has a nontrivial left null vector. One can then exhibit a legitimate length-\(L\) trajectory not contained in its image, contradicting universality [2503.12489].

For \(m=1\), the paper further proves a stronger genericity statement: if the input is not PE of order \(L+n\), then for almost any controllable system \((A,B)\) one can choose an initial state so that the associated stacked input-state Hankel is rank-deficient. The paper notes that such a generic failure statement need not hold in the same form for MIMO systems, even though the universality–PE equivalence remains valid [2503.12489].

A common misconception is therefore that PE is a conservative artifact of proof technique. The universality result shows that this interpretation is untenable when one asks for a single experiment that must work for all controllable plants of a given order. In that sense, the requirement \(L+n\) is exact rather than merely sufficient.

## 4. Variants and generalizations

A substantial literature extends the lemma beyond its standard deterministic, discrete-time, explicit-state setting.

For descriptor systems, the role of the state dimension is replaced by invariants of the quasi-Weierstraß form. If \(n_J\) is the dimension of the dynamic part and \(\delta\) the structured nilpotency index, then the corresponding PE order becomes \(L+n_J+\delta-1\) rather than \(L+n_x\), and one uses data truncated to \([0:T-\delta]\) in the Hankel matrices [2209.06414]. A related descriptor-system formulation writes the PE order as \(L+q+s-1\), where \(q\) and \(s\) are pencil invariants, and shows that the non-causal algebraic part allows the last \(s\) samples to be omitted from the data Hankel used in the representation [2202.07930].

For stochastic systems, the behavioral idea is lifted from deterministic trajectories to \(L^2\)-random variables and Polynomial Chaos Expansions. The resulting stochastic fundamental lemma characterizes admissible stochastic trajectories either coefficient-wise in the PCE basis or directly as random-variable trajectories parameterized by a random coefficient \(G\), while preserving a Hankel-based structure [2209.06414]. A later variant reduces the disturbance-data requirements by exploiting causality and PCE structure so that past disturbance Hankel blocks are no longer needed in the same way as in earlier formulations [2502.09131].

For continuous-time systems, two complementary directions appear. One line constructs a continuous-time counterpart from regularly sampled data and time-varying Hankel-like objects, together with a differential equation for a time-varying coefficient vector \(\alpha(t)\) that reproduces arbitrary piecewise differentiable trajectories from measured data [2203.03702]. Another line develops an input-output continuous-time version using jets, time shifts, and derivative-shift consistency conditions, thereby eliminating the need for internal state measurements [2405.15482]. A further development combines a continuous-time lemma with polynomial approximation arguments and derives suboptimality bounds for data-driven continuous-time LQ control [2407.12179].

For frequency-domain data, a version of the lemma replaces time-shifted Hankel structure by phase-ramp matrices \(W_L(e^{j\omega})\) and lifted spectral data matrices \(F_L(\cdot)\). In that setting, collective persistency of excitation is formulated on measured frequency-response data and multiple input directions per frequency, enabling frequency-domain-data-driven simulation and a predictive control analogue called FreePC [2311.15284; 2501.19390]. A subsequent extension incorporates non-steady-state frequency-domain data by augmenting the system with a transient channel, allowing finite-record frequency data with transient contributions to be used directly [2504.06403].

For nonlinear systems, one direction studies LPV embeddings and derives an LPV analogue of the lemma in the behavioral Ore-algebra setting [2103.16171]. Another direction assumes the nonlinear system admits a finite-dimensional Koopman linear embedding and shows that sufficiently rich nonlinear trajectories span the trajectory space of the Koopman embedding, yielding a data-driven representation of the nonlinear system without explicitly selecting lifting functions [2409.16389]. The links between such nonlinear extensions and kernel regression have also been formalized: the data equation can be recast in an implicit kernel form equivalent to a particular kernel regression problem, while retaining a PE requirement in the lifted coordinates [2403.05368].

A further recent SISO relaxation replaces the classical PE perspective by input signal generators. In that framework, a generator dimension \(N_g\ge L\) is necessary and sufficient for informativity for almost all systems and initial conditions under generic assumptions, whereas \(N_g\ge L+n\) guarantees informativity for all initial conditions [2604.05964]. This suggests an alternative dynamical-systems interpretation of input richness, rather than a purely rank-based one.

## 5. Applications in data-driven control and identification

The principal application of the lemma is non-parametric trajectory synthesis. DeePC and related data-driven MPC schemes impose linear constraints of the form
\[
\begin{bmatrix} U_p \\ Y_p \\ U_f \\ Y_f \end{bmatrix} g
=
\begin{bmatrix} u_{\text{past}} \\ y_{\text{past}} \\ u_{\text{future}} \\ y_{\text{future}} \end{bmatrix},
\]
with past and future blocks extracted from a Hankel matrix of one measured trajectory. Under PE of the required order and controllability, these feasibility constraints are equivalent to model-based consistency conditions, so that optimization may be carried out directly over trajectories represented by \(g\) [2208.00905].

The same spanning property underlies subspace identification. In that context, sufficiently rich data are needed so that the relevant row and column spaces are spanned by measured Hankel blocks. The universality interpretation sharpens this point: PE is precisely the right richness notion when one wants an input that is informative for all controllable systems of the specified order, rather than only for one fixed plant [2503.12489].

Quantitative and robust versions make this useful in practice. Explicit lower bounds on
\[
[H_1(x)\; H_L(u)] [H_1(x)\; H_L(u)]^\top
\]
can be derived from matrix-valued PE bounds on the input, providing constructive guarantees on \(\sigma_{\min}\) of the data matrix and thus on numerical robustness in least-squares reconstruction, identification, and predictive control [2208.00905]. Robust formulations motivated by this viewpoint compare predictive-control performance under different excitation levels and show that better singular-value conditioning of the data matrix yields improved robustness to noise [2205.06636].

The lemma also supports system analysis tasks beyond time-domain prediction. Frequency-domain versions enable data-driven simulation, transfer-function evaluation at arbitrary frequencies, and predictive control from frequency-response measurements, including data collected in closed loop with a pre-stabilizing controller [2501.19390]. Multiple-dataset variants replace the single long experiment by several shorter experiments that are collectively persistently exciting, which is useful when data are fragmented or when unstable dynamics make long open-loop experiments undesirable [2002.01023]. Large noisy fragmented datasets have also motivated methods that estimate the invariant left-null-space structure associated with the lemma from many short experiments without assuming a known noise distribution [2604.00338].

## 6. Scope, limitations, and recurring misconceptions

The standard exact statement is intrinsically noise-free. Small additive noise can make rank conditions appear satisfied while rendering the corresponding data matrices poorly conditioned, which is why robust formulations replace binary rank tests by singular-value or matrix-inequality bounds [2205.06636]. This does not invalidate the classical lemma; rather, it delineates the boundary between exact behavioral spanning and numerically reliable approximation.

Another recurring misconception is that observability is always required. Several classical state-space statements are written for minimal systems, but the behavioral input-output equality summarized in recent treatments requires controllability of \((A,B)\) and not observability or minimality of \((C,D)\) [2503.12489]. By contrast, observability-type assumptions reappear in specific extensions, such as descriptor-system output-feedback MPC or continuous-time input-output formulations based on jets and lag conditions [2202.07930; 2405.15482].

A further misconception is that one necessarily needs one very long experiment. Single-trajectory statements do require PE of order \(L+n\), but multi-dataset extensions replace this by collective PE across several shorter trajectories, and frequency-domain versions distribute richness across frequencies and input directions [2002.01023; 2311.15284]. This suggests that the essential object is not the chronological length of one record, but the rank content of the aggregated data.

Finally, current extensions remain structured by the same central theme: one seeks a data object whose column space equals a finite-horizon behavior. In discrete-time deterministic LTI systems, that object is the stacked Hankel built from one PE trajectory. In stochastic, descriptor, continuous-time, frequency-domain, LPV, Koopman-embedded, and kernelized settings, the technical details differ, but the governing principle remains the same: sufficiently rich data span the behavior, and trajectory generation becomes a linear-algebraic problem on measured data [2209.06414].

Source: https://www.emergentmind.com/topics/willems-fundamental-lemma-9a97238e-ffc9-4db8-b5ec-06dc6419d230