Block 0 — Transfer operators from scratch
Two operators are attached to any dynamical system: one moves functions (observables) and one moves densities. Everything in the paper's Section 2 is a statement about these two and their relationship.
Problem 0 — Koopman and Perron–Frobenius operators for a deterministic map
Goal: know what the two operators are, why one is linear even for nonlinear $\Phi$, and why they are adjoint.
(a) Define the Koopman operator by $(\K f)(x)=f(\Phi(x))$. Show that $\K$ is linear on the space of observables even when $\Phi$ is nonlinear. What has been traded to obtain linearity?
Solution
$\K(\alpha f+\beta g)(x)=(\alpha f+\beta g)(\Phi(x))=\alpha f(\Phi(x))+\beta g(\Phi(x))=(\alpha\K f+\beta\K g)(x)$. Linearity comes from the evaluation $f\mapsto f(y)$ being linear in $f$ for every fixed $y$; the nonlinearity of $\Phi$ is entirely absorbed in where we evaluate. $\K$ is a composition operator, $\K f=f\circ\Phi$.
The trade: a nonlinear map on a finite-dimensional state space $\X$ has become a linear map on the infinite-dimensional space of functions on $\X$. Nothing has been approximated; the price is dimension. Every "Koopman method" (DMD, EDMD, VAMP, this paper's Galerkin step in Section 4) is a way of choosing a finite-dimensional subspace of observables on which $\K$ acts approximately invariantly.
(b) Define the Perron–Frobenius operator $\P$ by the requirement that it pushes densities forward: for every measurable set $B$, $$\int_B(\P p)(y)\,dy=\int_{\Phi^{-1}(B)}p(x)\,dx .$$ Derive the explicit formula $(\P p)(y)=\sum_{x:\Phi(x)=y}p(x)/|\Phi'(x)|$ from the change-of-variables rule.
Solution
The definition says: the mass that $\P p$ assigns to $B$ equals the mass $p$ assigns to the points that will land in $B$. So $\P p$ is the density of $\Phi(X)$ when $X\sim p$ — the pushforward of $p$ by $\Phi$.
Split $\X$ into intervals on which $\Phi$ is monotone; on each such branch $\Phi_k$ with inverse $\Phi_k^{-1}$, substitute $y=\Phi_k(x)$, $dy=|\Phi_k'(x)|\,dx$: $$\int_{\Phi_k^{-1}(B)}p(x)\,dx=\int_B p\big(\Phi_k^{-1}(y)\big)\,\frac{dy}{|\Phi_k'(\Phi_k^{-1}(y))|}.$$ Summing over branches and reading off the integrand, $$(\P p)(y)=\sum_{x\in\Phi^{-1}(y)}\frac{p(x)}{|\Phi'(x)|}.$$ The Jacobian factor is the same one that appears in the density of a transformed random variable; $\P$ is that rule applied as a linear operator.
(c) Compute $\P p$ for the contraction $\Phi(x)=ax$ with $|a|<1$, and for the doubling map $\Phi(x)=2x \bmod 1$ on $[0,1]$. Observe what the doubling-map formula does to the two preimages.
Solution
Contraction. One preimage $x=y/a$, $|\Phi'|=|a|$: $(\P p)(y)=\dfrac{1}{|a|}\,p\!\left(\dfrac{y}{a}\right)$. Mass is squeezed toward the origin and rescaled to keep $\int\P p=1$. Iterating, $\P^n p\to\delta_0$: the only invariant density is the point mass at the fixed point.
Doubling map. Every $y\in[0,1)$ has two preimages $y/2$ and $(y+1)/2$, each with $\Phi'=2$: $$(\P p)(y)=\tfrac12\Big[p\!\left(\tfrac y2\right)+p\!\left(\tfrac{y+1}2\right)\Big].$$ $\P$ averages $p$ over the two preimages. Any $p$ is smoothed toward the uniform density, which is the invariant density ($\P 1=1$). Expanding maps mix; contracting maps concentrate. The Koopman operator sees the same fact from the other side: $\K f(x)=f(2x\bmod 1)$ makes $f$ oscillate twice as fast, so no smooth non-constant $f$ can be an eigenfunction.
(d) Prove the duality $\int(\K f)\,p\,dx=\int f\,(\P p)\,dx$, i.e. $\K$ and $\P$ are adjoint with respect to the Lebesgue inner product. Interpret.
Solution
For an indicator $f=\mathbf 1_B$: $\int(\K\mathbf 1_B)\,p\,dx=\int\mathbf 1_B(\Phi(x))\,p(x)\,dx=\int_{\Phi^{-1}(B)}p\,dx=\int_B\P p\,dy=\int\mathbf 1_B\,(\P p)\,dy$, by the defining property in (b). Both sides are linear in $f$, indicators span (are dense in) the observables, so the identity holds for all $f$ for which either side is finite.
Interpretation: $\E[f(X_{t+1})]$ for $X_t\sim p$ can be computed two ways — pull $f$ back to time $t$ and average against $p$, or push $p$ forward to time $t+1$ and average $f$ against it. The two operators are the two halves of one expectation. This is exactly the pairing $\ip{f,\K g}_\mu=\ip{\K^\dagger f,g}_\nu$ in the paper's Eq. (5); Block A and Problem 7 show what changes when the inner product is weighted by a stationary density instead of Lebesgue measure.
(e) Koopman eigenfunctions. Show that $\K\varphi=\lambda\varphi$ means $\varphi(x_{t+1})=\lambda\varphi(x_t)$ along every trajectory. For $\Phi(x)=ax$ find all eigenfunctions of the form $x^n$ and their eigenvalues. Show that products of eigenfunctions are eigenfunctions. Which eigenfunctions have $|\lambda|=1$, and why are their level sets invariant sets?
Solution
$\K\varphi=\lambda\varphi$ reads $\varphi(\Phi(x))=\lambda\varphi(x)$ for all $x$; put $x=x_t$ and it says $\varphi(x_{t+1})=\lambda\varphi(x_t)$, so $\varphi(x_t)=\lambda^t\varphi(x_0)$ — an eigenfunction is an observable that evolves linearly (geometrically) under nonlinear dynamics.
For $\Phi(x)=ax$: $\K x^n=(ax)^n=a^n x^n$, so $x^n$ is an eigenfunction with eigenvalue $a^n$, $n=0,1,2,\dots$ The constant function ($n=0$) always has eigenvalue $1$.
Products: for a deterministic map $\K(fg)=(f\circ\Phi)(g\circ\Phi)=(\K f)(\K g)$, so if $\K\varphi_i=\lambda_i\varphi_i$ then $\K(\varphi_1\varphi_2)=\lambda_1\lambda_2\,\varphi_1\varphi_2$. The eigenfunctions form a multiplicative semigroup. This multiplicativity is lost for stochastic dynamics: $\E[fg\mid x]\ne\E[f\mid x]\E[g\mid x]$ in general. (In Problem 11 the OU eigenfunctions are Hermite polynomials rather than monomials for exactly this reason.)
$|\lambda|=1$: for $|a|<1$ only $n=0$, the constant, which carries no information. For $\Phi(x)=-x$ ($a=-1$) every $x^n$ has $|\lambda|=1$. If $\K\varphi=\varphi$ then $x\in\{\varphi=c\}\Rightarrow\varphi(\Phi(x))=\varphi(x)=c\Rightarrow\Phi(x)\in\{\varphi=c\}$: level sets of an eigenvalue-one eigenfunction are invariant sets, i.e. partitions of the state space the dynamics never crosses. If $\lambda=-1$, $\varphi^2$ has eigenvalue $1$ and its level sets $\{\varphi=\pm c\}$ are invariant. This is the deterministic ancestor of the paper's coherent sets: with noise, no non-trivial set is exactly invariant, and "eigenvalue exactly one" is replaced by "singular value closest to one over a finite horizon $\tau$".
Problem 1 — The stochastic versions
Goal: recognise the paper's $\K_\tau$ (Eq. 1) as the stochastic Koopman operator, know its Perron–Frobenius partner, and see why a generator exists.
(a) Define $\K_\tau f(x)=\E[f(X_{t+\tau})\mid X_t=x]=\int f(y)\,p_\tau(y\mid x)\,dy$ and $\P_\tau p(y)=\int p_\tau(y\mid x)\,p(x)\,dx$. Show that both reduce to Problem 0's operators when $p_\tau(y\mid x)=\delta\big(y-\Phi(x)\big)$.
Solution
$\K_\tau f(x)=\int f(y)\,\delta(y-\Phi(x))\,dy=f(\Phi(x))$. For $\P_\tau$ use the composition rule for the delta function, $\delta(g(x))=\sum_{k}\delta(x-x_k)/|g'(x_k)|$ over the roots $x_k$ of $g$, with $g(x)=y-\Phi(x)$: $$\P_\tau p(y)=\int\delta\big(y-\Phi(x)\big)p(x)\,dx=\sum_{x:\Phi(x)=y}\frac{p(x)}{|\Phi'(x)|}.$$ So the stochastic operators are the deterministic ones with the delta kernel replaced by a spread-out kernel; a stochastic system has a whole density of "next states" from each $x$. Note how the noise removes the preimage sum: $p_\tau(y\mid x)$ is simply a function of two variables, and the Jacobian is gone.
(b) Show $\K_\tau\mathbf 1=\mathbf 1$ and $\int\P_\tau p\,dy=\int p\,dx$. State what each conservation law means.
Solution
$\K_\tau\mathbf 1(x)=\int p_\tau(y\mid x)\,dy=1$: from every starting point the process goes somewhere (total probability). $\int\P_\tau p\,dy=\int\!\!\int p_\tau(y\mid x)\,p(x)\,dx\,dy=\int p(x)\,dx$: mass is conserved when densities are pushed forward. In the paper these appear as the trivial singular pair $u_0=v_0=\mathbf 1$ with $\lambda_0=1$ (Section 2), and $\P_\tau\rho_0=\rho_0$ defines the stationary density (Eq. 14).
(c) Prove the duality $\int(\K_\tau f)\,p\,dx=\int f\,(\P_\tau p)\,dy$.
Solution
Both sides equal the double integral $\int\!\!\int f(y)\,p_\tau(y\mid x)\,p(x)\,dx\,dy=\E_{X_t\sim p}\big[f(X_{t+\tau})\big]$; the left integrates over $y$ first, the right over $x$ first (Fubini). As in Problem 0(d): pull the observable back or push the density forward, the expectation is the same. This is the Lebesgue-adjoint relation; Problem 7(c) converts it into the $\rho_0$-weighted adjoint of the paper's Eq. (16).
(d) Show the semigroup property $\K_{\tau_1}\K_{\tau_2}=\K_{\tau_1+\tau_2}$ from the Chapman–Kolmogorov equation, and explain why this means a generator $L^\dagger$ with $\K_\tau=e^{L^\dagger\tau}$ exists (at least formally). Identify the stationary density as an eigenvector of $\P_\tau$.
Solution
Chapman–Kolmogorov for a time-homogeneous Markov process: $p_{\tau_1+\tau_2}(z\mid x)=\int p_{\tau_2}(z\mid y)\,p_{\tau_1}(y\mid x)\,dy$ (go to $y$ first, then to $z$). Then $$\K_{\tau_1}\K_{\tau_2}f(x)=\int p_{\tau_1}(y\mid x)\Big[\int p_{\tau_2}(z\mid y)f(z)\,dz\Big]dy=\int f(z)\Big[\int p_{\tau_2}(z\mid y)p_{\tau_1}(y\mid x)\,dy\Big]dz=\K_{\tau_1+\tau_2}f(x).$$ Together with $\K_0=I$ this makes $\{\K_\tau\}_{\tau\ge0}$ a one-parameter semigroup. For a one-parameter semigroup that is continuous in $\tau$, the derivative at zero, $L^\dagger f=\lim_{\tau\downarrow0}(\K_\tau f-f)/\tau$, exists on a dense domain and $\K_\tau=e^{L^\dagger\tau}$ (Hille–Yosida theorem; Pavliotis 2014, §2.4). Block B computes $L^\dagger$ explicitly for diffusions: it is a second-order differential operator, and the semigroup is a PDE evolution.
Stationarity: a density with $\P_\tau\rho_0=\rho_0$ for all $\tau$ is unchanged by the dynamics; it is the eigenvector of $\P_\tau$ with eigenvalue $1$, dual to $\K_\tau\mathbf 1=\mathbf 1$. At the generator level, $L\rho_0=0$ — the paper's Eq. (14).
Interlude — conditional expectation in three rules
Why this is here. Every operator identity in the set is, underneath, a manipulation of conditional expectations, and the solutions name three rules over and over: taking out what is known, the tower property, and the law of total variance. Each has an equivalent statement about integrals against densities, and the "By direct integration" paragraphs throughout the set are those translations. This interlude states the rules once, in both languages, and identifies the one place where the tower property is routinely misapplied.
Definition. For random variables $X,Y$ with joint density $p(x,y)$, marginal $p_X(x)=\int p(x,y)\,dy$, and conditional density $p(y\mid x)=p(x,y)/p_X(x)$ (the chain rule for densities, read backwards), $$\E[f(Y)\mid X=x]=\int f(y)\,p(y\mid x)\,dy .$$ It is an ordinary integral over the unknown variable with the known one held fixed, so it is a function of $x$. The random variable $\E[f(Y)\mid X]$ is that function evaluated at $X$. The Koopman operator is this definition with $X=X_t$, $Y=X_{t+\tau}$ and $p(y\mid x)=p_\tau(y\mid x)$ (Problem 1(a)). For a finite chain the integral is a sum, $\E[f(X_{t+1})\mid X_t=i]=\sum_jP_{ij}f_j$, and every rule below becomes a statement about matrix products (Block A).
Rule 1: taking out what is known. A function of the conditioning variable is a constant inside the conditional expectation: $$\E[g(X)f(Y)\mid X]=g(X)\,\E[f(Y)\mid X],\qquad\text{i.e.}\qquad\int g(x)f(y)\,p(y\mid x)\,dy=g(x)\int f(y)\,p(y\mid x)\,dy ,$$ because $g(x)$ does not depend on the integration variable $y$.
Rule 2: the tower property. Averaging the conditional expectation over the conditioning variable gives the unconditional expectation: $$\E\big[\E[f(Y)\mid X]\big]=\E[f(Y)],\qquad\text{i.e.}\qquad\int p_X(x)\Big[\int f(y)\,p(y\mid x)\,dy\Big]dx=\iint f(y)\,p(x,y)\,dx\,dy=\int f(y)\,p_Y(y)\,dy .$$ The steps are: $p_X(x)p(y\mid x)=p(x,y)$ (chain rule), swap the order of integration (Fubini), and integrate out $x$ to get the marginal of $y$. The general form keeps some conditioning on the outside: for three variables, $$\E\big[\E[f(Z)\mid X,Y]\,\big|\,X\big]=\E[f(Z)\mid X],$$ which holds because the outer conditioning ($X$) is coarser than the inner one ($X$ and $Y$): everything the outside knows, the inside already knew. In integrals it is $\int p(y\mid x)\int f(z)\,p(z\mid x,y)\,dz\,dy=\int f(z)\,p(z\mid x)\,dz$, by the chain rule $p(y\mid x)p(z\mid x,y)=p(y,z\mid x)$ and marginalising $y$.
The trap. If the outer conditioning is not coarser than the inner one, nothing collapses. In general $$\E\big[\E[f(Z)\mid Y]\,\big|\,X\big]=\int f(z)\Big[\int p(z\mid y)\,p(y\mid x)\,dy\Big]dz ,$$ and the bracket equals $p(z\mid x)$ only when $p(z\mid x,y)=p(z\mid y)$, i.e. when $Z$ is conditionally independent of $X$ given $Y$: the chain $X\to Y\to Z$ must be Markov. Both instances in this set are exactly this criterion. The semigroup law $\K_{\tau_1}\K_{\tau_2}=\K_{\tau_1+\tau_2}$ (Problem 1(d)) is the case $X=X_t$, $Y=X_{t+\tau_1}$, $Z=X_{t+\tau_1+\tau_2}$: a Markov chain in time order, so the bracket is Chapman–Kolmogorov and the tower property applies. The round trip $\K^\dagger\K f(y)=\E[\E[f(X_{t+\tau})\mid X_t]\mid X_{t+\tau}=y]$ (Block B, Q2(vi)) is the case $X=X_{t+\tau}$, $Y=X_t$, $Z=X_{t+\tau}$: here $Z$ is $X$, which is as far from conditionally independent of $X$ as possible, so the bracket $\int p_\tau(z\mid x')\,\tilde p_\tau(x'\mid y)\,dx'$ is not $\delta(z-y)$ but the sibling kernel, and $\K^\dagger\K\neq I$. The legal move there is to replace $Z$ by an independent copy $Z'$ that is conditionally independent of $X$ given $Y$ (Block B, Q2(i)).
Rule 3: the law of total variance. Writing $\operatorname{Var}(f(Y)\mid X)=\E[f(Y)^2\mid X]-\E[f(Y)\mid X]^2$ (the definition of a variance under the conditional density) and applying Rule 2 to both terms, $$\operatorname{Var}f(Y)=\E\big[\operatorname{Var}(f(Y)\mid X)\big]+\operatorname{Var}\big(\E[f(Y)\mid X]\big):$$ total variance is the part the conditioning does not explain plus the variance of the part it does. Applied to $X=X_t$, $Y=X_{t+\tau}$ and mean-zero $f$ this is $\|f\|^2=\E[\operatorname{Var}(f(X_{t+\tau})\mid X_t)]+\|\K_\tau f\|^2$, the identity behind the contraction bound (Problem 7), the "main result in three lines" (Block A), and the residual obstruction (Problem 15(e)).
How the set uses them. The pairing identity $\ip{g,\K_\tau f}_{\rho_0}=\E[g(X_t)f(X_{t+\tau})]$ (Problems 7(d), 13(b); Block D, Q1(i)) is Rule 1 followed by Rule 2. The sibling identities of Block B, Q2 are Rule 2 in its general form after the conditional-independence substitution. Problem 10(c) is Rule 2 for Gaussian kernels, where only means need to be tracked. Whenever a solution says "tower property", the integral version is: write each conditional expectation as an integral against its kernel, multiply the kernels, and swap the order of integration.
Q1(i) Prove Rule 1 and the basic form of Rule 2 from the density definition, naming the rule at each step. Then combine them to show $\E\big[g(X)\,\E[f(Y)\mid X]\big]=\E[g(X)f(Y)]$, and say which operator identity in the set this is.
Answer
Rule 1. By the definition, $\E[g(X)f(Y)\mid X=x]=\int g(x)f(y)\,p(y\mid x)\,dy$. The factor $g(x)$ is constant in the integration variable $y$, so by linearity of the integral it comes outside: $=g(x)\int f(y)\,p(y\mid x)\,dy=g(x)\,\E[f(Y)\mid X=x]$. Evaluating both sides at $X$ gives the random-variable form.
Rule 2. By the definition of expectation of a function of $X$, $\E\big[\E[f(Y)\mid X]\big]=\int p_X(x)\,\E[f(Y)\mid X=x]\,dx=\int p_X(x)\Big[\int f(y)\,p(y\mid x)\,dy\Big]dx$. By the chain rule $p_X(x)p(y\mid x)=p(x,y)$, and since $p_X(x)$ is constant in $y$ it moves inside: $=\iint f(y)\,p(x,y)\,dy\,dx$. By Fubini (the integrand is absolutely integrable when $\E|f(Y)|<\infty$) the $x$-integral may be done first, and $\int p(x,y)\,dx=p_Y(y)$ is the definition of the marginal, so $=\int f(y)\,p_Y(y)\,dy=\E[f(Y)]$.
Combination. By Rule 1, $g(X)\,\E[f(Y)\mid X]=\E[g(X)f(Y)\mid X]$; by Rule 2 applied to the function $g(X)f(Y)$ of the pair, $\E\big[\E[g(X)f(Y)\mid X]\big]=\E[g(X)f(Y)]$. With $X=X_t$, $Y=X_{t+\tau}$ and the stationary inner product, the left side is $\ip{g,\K_\tau f}_{\rho_0}$, so this is the pairing identity $\ip{g,\K_\tau f}_{\rho_0}=\E[g(X_t)f(X_{t+\tau})]$ of Problem 7(d), which is also why the Galerkin matrix of Problem 13(b) is a lagged second moment.
Q1(ii) Prove the general tower property $\E[\E[f(Z)\mid X,Y]\mid X]=\E[f(Z)\mid X]$ from densities. Then show that $\E[\E[f(Z)\mid Y]\mid X]=\E[f(Z)\mid X]$ for all $f$ if and only if $Z$ is conditionally independent of $X$ given $Y$, and identify $(X,Y,Z)$ for the semigroup law of Problem 1(d) and for the round trip $\K^\dagger\K$ of Block B, saying which one passes.
Answer
General tower. Write the inner conditional expectation by the definition, $\E[f(Z)\mid X=x,Y=y]=\int f(z)\,p(z\mid x,y)\,dz$, a function of $(x,y)$. Conditioning it on $X=x$ integrates over the remaining unknown $y$ with density $p(y\mid x)$: $\int p(y\mid x)\Big[\int f(z)\,p(z\mid x,y)\,dz\Big]dy$. By the chain rule for conditional densities, $p(y\mid x)\,p(z\mid x,y)=p(y,z\mid x)$; by Fubini the $y$-integral may be done first; and $\int p(y,z\mid x)\,dy=p(z\mid x)$ is marginalisation. The result is $\int f(z)\,p(z\mid x)\,dz=\E[f(Z)\mid X=x]$.
The criterion. With only $Y$ inside, the same computation gives $\E[\E[f(Z)\mid Y]\mid X=x]=\int p(y\mid x)\Big[\int f(z)\,p(z\mid y)\,dz\Big]dy=\int f(z)\Big[\int p(z\mid y)\,p(y\mid x)\,dy\Big]dz$. This equals $\int f(z)\,p(z\mid x)\,dz$ for every $f$ if and only if the brackets agree as densities in $z$ (two densities that give the same integral against every bounded $f$ are equal), i.e. $\int p(z\mid y)p(y\mid x)\,dy=p(z\mid x)$. Since always $p(z\mid x)=\int p(z\mid x,y)\,p(y\mid x)\,dy$ (chain rule and marginalisation), the condition holds whenever $p(z\mid x,y)=p(z\mid y)$, which is the definition of conditional independence of $Z$ and $X$ given $Y$; conversely, if it holds for all $x$ then the Markov factorisation $p(x,y,z)=p_X(x)p(y\mid x)p(z\mid y)$ reproduces the correct marginals, which is the statement that the chain $X\to Y\to Z$ is Markov. (In the $\sigma$-algebra language, $\sigma(X)\subset\sigma(X,Y)$ makes the general tower automatic, whereas $\sigma(X)\not\subset\sigma(Y)$ is why the criterion is needed.)
Semigroup law. $X=X_t$, $Y=X_{t+\tau_1}$, $Z=X_{t+\tau_1+\tau_2}$. The Markov property of the process says exactly that the future $Z$ is conditionally independent of the past $X$ given the present $Y$, so the criterion holds, the bracket is Chapman–Kolmogorov $\int p_{\tau_2}(z\mid y)p_{\tau_1}(y\mid x)\,dy=p_{\tau_1+\tau_2}(z\mid x)$, and $\K_{\tau_1}\K_{\tau_2}=\K_{\tau_1+\tau_2}$. Passes.
Round trip. $\K^\dagger\K f(y_0)=\E[\E[f(X_{t+\tau})\mid X_t]\mid X_{t+\tau}=y_0]$, so $X=X_{t+\tau}$ (outer), $Y=X_t$ (inner), $Z=X_{t+\tau}$ (the variable inside $f$). $Z$ is the same random variable as $X$, so $p(z\mid x,y)=\delta(z-x)\ne p(z\mid y)=p_\tau(z\mid y)$: conditional independence fails maximally, and the bracket $\int p_\tau(z\mid y)\,\tilde p_\tau(y\mid x)\,dy$ is the sibling kernel $q_\tau(z\mid x)$ of Block B, Q2(v), not $\delta(z-x)$. Fails, which is why $\K^\dagger\K\ne I$ for noisy dynamics. Replacing $Z$ by an independent copy $Z'=X'_{t+\tau}$ driven from the same $Y=X_t$ restores conditional independence of $Z'$ and $X$ given $Y$, and the tower property then evaluates the round trip as $\E[f(X'_{t+\tau})\mid X_{t+\tau}=y_0]$ (Block B, Q2(i)).
Q1(iii) Derive the law of total variance from Rules 1 and 2, and write it in integral form. Apply it to $X=X_t$, $Y=X_{t+\tau}$ under the stationary density to obtain $\|f\|_{\rho_0}^2=\|\K_\tau f\|_{\rho_0}^2+\E[\operatorname{Var}(f(X_{t+\tau})\mid X_t)]$ for mean-zero $f$, and read off that $\K_\tau$ cannot increase norms.
Answer
Derivation. Set $m(X)=\E[f(Y)\mid X]$ and $v(X)=\operatorname{Var}(f(Y)\mid X)=\E[f(Y)^2\mid X]-m(X)^2$ (definition of variance under the conditional density; the square of $m(X)$ is a function of $X$, so Rule 1 is what allows it to be written this way). Apply Rule 2 to $f(Y)^2$: $\E[f(Y)^2]=\E\big[\E[f(Y)^2\mid X]\big]=\E[v(X)]+\E[m(X)^2]$. Apply Rule 2 to $f(Y)$: $\E[f(Y)]=\E[m(X)]$. Subtract the square of the second from the first: $\operatorname{Var}f(Y)=\E[v(X)]+\big(\E[m(X)^2]-\E[m(X)]^2\big)=\E[\operatorname{Var}(f(Y)\mid X)]+\operatorname{Var}(m(X))$.
Integral form. $\int p_Y(y)f(y)^2\,dy-\Big(\int p_Y(y)f(y)\,dy\Big)^2=\int p_X(x)\Big[\int p(y\mid x)f(y)^2\,dy-\Big(\int p(y\mid x)f(y)\,dy\Big)^2\Big]dx+\int p_X(x)\Big(\int p(y\mid x)f(y)\,dy\Big)^2dx-\Big(\int p_X(x)\int p(y\mid x)f(y)\,dy\,dx\Big)^2$. The first terms on each side agree by chain rule plus Fubini (Rule 2 for $f^2$), the last terms agree by the same for $f$, and the middle terms cancel.
Application. Take $X=X_t\sim\rho_0$, $Y=X_{t+\tau}$, so $p(y\mid x)=p_\tau(y\mid x)$, $m=\K_\tau f$, and by stationarity $Y\sim\rho_0$ as well. For mean-zero $f$: $\operatorname{Var}f(Y)=\E[f(X_{t+\tau})^2]=\|f\|_{\rho_0}^2$; and $\E[m(X)]=\E[f(Y)]=0$ by Rule 2, so $\operatorname{Var}(m(X))=\E[(\K_\tau f)(X_t)^2]=\|\K_\tau f\|_{\rho_0}^2$. Hence $\|f\|^2=\|\K_\tau f\|^2+\E[\operatorname{Var}(f(X_{t+\tau})\mid X_t)]$. The last term is an expectation of a variance, hence $\ge0$, so $\|\K_\tau f\|\le\|f\|$: conditional expectation removes exactly the part of $f(X_{t+\tau})$ that $X_t$ cannot predict. Equality for every $f$ means every conditional variance vanishes, i.e. deterministic dynamics. This is the contraction bound of Problem 7 and the mechanism of the "main result in three lines" in Block A.