[proofplan]
We first express the omega-limit set as the intersection of nested compact tail closures of the positive orbit, which gives nonemptiness and compactness. Semigroup continuity gives forward invariance, while compactness of the orbit closure lets us extract limits of predecessor points and obtain the reverse inclusion $S(r)\omega(x) \supset \omega(x)$. The Lyapunov function $\Phi$ has a finite limit along the orbit of $x$, so continuity forces $\Phi$ to be constant on $\omega(x)$ and on every forward image of a point in $\omega(x)$. The dissipation identity then makes the integral of the non-negative function $D(S(\sigma)y)$ vanish on every finite interval, and lower semicontinuity upgrades zero almost everywhere to zero at every time.
[/proofplan]
[step:Represent $\omega(x)$ as an intersection of compact tail closures]
For each $T \geq 0$, define the tail set
\begin{align*}
A_T := \{S(t)x : t \geq T\}
\end{align*}
and its closure
\begin{align*}
K_T := \overline{A_T}.
\end{align*}
Since $A_T \subset K$ and $K$ is compact, each $K_T$ is a nonempty compact subset of $K$. If $0 \leq T_1 \leq T_2$, then $A_{T_2} \subset A_{T_1}$, hence $K_{T_2} \subset K_{T_1}$. Therefore the family $(K_T)_{T \geq 0}$ is nested.
We claim that
\begin{align*}
\omega(x)=\bigcap_{T \geq 0} K_T.
\end{align*}
If $y \in \omega(x)$, choose a sequence $(t_k)_{k=1}^\infty$ in $[0,\infty)$ such that $t_k \to \infty$ and $S(t_k)x \to y$ in $X$. For every fixed $T \geq 0$, all sufficiently large $k$ satisfy $t_k \geq T$, so $y \in K_T$. Hence $y \in \bigcap_{T \geq 0}K_T$.
Conversely, suppose $y \in \bigcap_{T \geq 0}K_T$. For each $k \in \mathbb{N}$, since $y \in K_k=\overline{A_k}$, there exists $t_k \geq k$ such that
\begin{align*}
\|S(t_k)x-y\|_X < \frac{1}{k}.
\end{align*}
Then $t_k \to \infty$ and $S(t_k)x \to y$ in $X$, so $y \in \omega(x)$.
Because the compact sets $K_T$ are nested and nonempty, the finite intersection property gives
\begin{align*}
\bigcap_{T \geq 0}K_T \neq \varnothing.
\end{align*}
Thus $\omega(x)$ is nonempty. Since $\omega(x)$ is an intersection of closed subsets of the compact set $K$, it is compact.
[/step]
[step:Show that $K$ and $\omega(x)$ are positively invariant]
First we show that $K$ is positively invariant. Fix $r \geq 0$ and $z \in K$. Since $K=\overline{\mathcal{O}^+(x)}$, there exists a sequence $(a_k)_{k=1}^\infty$ in $[0,\infty)$ such that $S(a_k)x \to z$ in $X$. By continuity of the map $S(r):X \to X$ and the semigroup identity,
\begin{align*}
S(r)z=\lim_{k\to\infty}S(r)S(a_k)x=\lim_{k\to\infty}S(r+a_k)x.
\end{align*}
Each point $S(r+a_k)x$ lies in $\mathcal{O}^+(x)$, hence $S(r)z \in K$.
Now fix $r \geq 0$ and $y \in \omega(x)$. Choose $(t_k)_{k=1}^\infty$ with $t_k \to \infty$ and $S(t_k)x \to y$ in $X$. Continuity of $S(r):X \to X$ gives
\begin{align*}
S(r)y=\lim_{k\to\infty}S(r)S(t_k)x=\lim_{k\to\infty}S(t_k+r)x.
\end{align*}
Since $t_k+r \to \infty$, this proves $S(r)y \in \omega(x)$. Therefore
\begin{align*}
S(r)\omega(x) \subset \omega(x)
\end{align*}
for every $r \geq 0$.
[guided]
We need two positive-invariance statements, and they serve different purposes. The compact set $K$ must be positively invariant because the dissipation identity is assumed for initial points in $K$; later, when we start a trajectory at a point $y \in \omega(x)$, we must know that $S(t)y$ remains inside the same compact region. The omega-limit set must be positively invariant because invariance of the limiting dynamics is part of the theorem.
Fix $r \geq 0$. To prove $S(r)K \subset K$, take $z \in K$. By definition of $K$ as the closure of the positive orbit, there are times $a_k \geq 0$ such that $S(a_k)x \to z$ in $X$. Since the semigroup is continuous in the state variable at time $r$, applying $S(r)$ preserves the limit:
\begin{align*}
S(r)z=\lim_{k\to\infty}S(r)S(a_k)x.
\end{align*}
The semigroup law changes the right-hand side into orbit points:
\begin{align*}
S(r)S(a_k)x=S(r+a_k)x.
\end{align*}
Each $S(r+a_k)x$ belongs to $\mathcal{O}^+(x)$, so its limit belongs to $\overline{\mathcal{O}^+(x)}=K$. Thus $S(r)z \in K$.
The same argument proves forward invariance of $\omega(x)$, but now we also use that the shifted times still go to infinity. Let $y \in \omega(x)$. Then there are times $t_k \to \infty$ such that $S(t_k)x \to y$. Continuity of $S(r)$ and the semigroup law give
\begin{align*}
S(r)y=\lim_{k\to\infty}S(r)S(t_k)x=\lim_{k\to\infty}S(t_k+r)x.
\end{align*}
Because $t_k+r \to \infty$, this limit is again an omega-[limit point](/page/Limit%20Point). Hence $S(r)y \in \omega(x)$, and so $S(r)\omega(x)\subset\omega(x)$.
[/guided]
[/step]
[step:Extract predecessor limits to prove full invariance of $\omega(x)$]
Fix $r \geq 0$ and $y \in \omega(x)$. Choose $(t_k)_{k=1}^\infty$ with $t_k \to \infty$ and $S(t_k)x \to y$ in $X$. Passing to a tail of the sequence, assume $t_k \geq r$ for every $k$. Define
\begin{align*}
u_k := S(t_k-r)x.
\end{align*}
Each $u_k$ lies in $K$, so compactness of $K$ gives a subsequence $(u_{k_j})_{j=1}^\infty$ and a point $u \in K$ such that $u_{k_j} \to u$ in $X$. Since $t_{k_j}-r \to \infty$, the point $u$ belongs to $\omega(x)$. By continuity of $S(r):X \to X$,
\begin{align*}
S(r)u=\lim_{j\to\infty}S(r)u_{k_j}=\lim_{j\to\infty}S(t_{k_j})x=y.
\end{align*}
Thus $y \in S(r)\omega(x)$. Since $y \in \omega(x)$ was arbitrary,
\begin{align*}
\omega(x)\subset S(r)\omega(x).
\end{align*}
Together with the positive invariance already proved, this gives
\begin{align*}
S(r)\omega(x)=\omega(x)
\end{align*}
for every $r \geq 0$.
[/step]
[step:Show that $\Phi$ is constant on $\omega(x)$]
Define
\begin{align*}
\varphi: [0,\infty) \to \mathbb{R}, \qquad \varphi(t):=\Phi(S(t)x).
\end{align*}
By hypothesis, $\varphi$ is non-increasing. Since $K$ is compact and $\Phi$ is continuous, the restriction $\Phi|_K$ attains a minimum on $K$; denote
\begin{align*}
m := \min_{z\in K}\Phi(z).
\end{align*}
Because $S(t)x \in K$ for every $t \geq 0$, we have $\varphi(t)\geq m$ for all $t \geq 0$. Hence the monotone bounded function $\varphi$ has the finite limit
\begin{align*}
\ell := \lim_{t\to\infty}\Phi(S(t)x)=\inf_{t\geq 0}\Phi(S(t)x).
\end{align*}
Let $y \in \omega(x)$. Choose $t_k \to \infty$ with $S(t_k)x \to y$ in $X$. By continuity of $\Phi$,
\begin{align*}
\Phi(y)=\lim_{k\to\infty}\Phi(S(t_k)x)=\ell.
\end{align*}
Now fix $r \geq 0$. Since $S(r)y \in \omega(x)$ by positive invariance, the same argument gives
\begin{align*}
\Phi(S(r)y)=\ell=\Phi(y).
\end{align*}
Therefore $\Phi$ is constant along the forward trajectory of every point of $\omega(x)$.
[/step]
[step:Use the dissipation identity to force zero dissipation on omega-limit trajectories]
Fix $y \in \omega(x)$ and $r>0$. Since $\omega(x)\subset K$, the point $y$ lies in $K$. Applying the assumed identity with $z=y$, $s=0$, and $t=r$ gives
\begin{align*}
\Phi(S(r)y)-\Phi(y)=-\int_0^r D(S(\sigma)y)\,d\mathcal{L}^1(\sigma).
\end{align*}
The previous step gives $\Phi(S(r)y)=\Phi(y)$, hence
\begin{align*}
\int_0^r D(S(\sigma)y)\,d\mathcal{L}^1(\sigma)=0.
\end{align*}
The integrand is non-negative because $D:X\to[0,\infty)$, so
\begin{align*}
D(S(\sigma)y)=0
\end{align*}
for $\mathcal{L}^1$-almost every $\sigma \in [0,r]$.
We now upgrade this almost-everywhere conclusion to every time. Fix $\tau \in [0,r]$. Since $D(S(\sigma)y)=0$ for almost every $\sigma \in [0,r]$, there exists a sequence $(\sigma_k)_{k=1}^\infty$ in $[0,r]$ such that $\sigma_k \to \tau$ and $D(S(\sigma_k)y)=0$ for every $k$. Joint continuity of the semigroup gives
\begin{align*}
S(\sigma_k)y \to S(\tau)y
\end{align*}
in $X$. Lower semicontinuity of $D$ gives
\begin{align*}
D(S(\tau)y)\leq \liminf_{k\to\infty}D(S(\sigma_k)y)=0.
\end{align*}
Since $D$ is non-negative, $D(S(\tau)y)=0$. Therefore $S(\tau)y \in M$ for every $\tau \in [0,r]$. Because $r>0$ was arbitrary,
\begin{align*}
S(\tau)y \in M
\end{align*}
for every $\tau \geq 0$.
[guided]
The identity says that the drop of $\Phi$ over a time interval is exactly the negative of accumulated dissipation. But we have already proved that $\Phi$ does not drop at all along a trajectory starting from an omega-limit point. Therefore the accumulated dissipation must be zero.
Let $y \in \omega(x)$ and let $r>0$. Since $\omega(x)\subset K$, the dissipation identity is available with initial point $y$. Taking $s=0$ and $t=r$, we get
\begin{align*}
\Phi(S(r)y)-\Phi(y)=-\int_0^r D(S(\sigma)y)\,d\mathcal{L}^1(\sigma).
\end{align*}
The previous step proved $\Phi(S(r)y)=\Phi(y)$, because both $y$ and $S(r)y$ lie in $\omega(x)$ and $\Phi$ has the same limiting value $\ell$ on $\omega(x)$. Hence
\begin{align*}
\int_0^r D(S(\sigma)y)\,d\mathcal{L}^1(\sigma)=0.
\end{align*}
The function under the integral is non-negative: this is exactly the codomain condition $D:X\to[0,\infty)$. A non-negative measurable function with integral zero is zero almost everywhere, so
\begin{align*}
D(S(\sigma)y)=0
\end{align*}
for $\mathcal{L}^1$-almost every $\sigma \in [0,r]$.
The subtle point is that the theorem needs membership in $M$ at every time, not just almost every time. This is where lower semicontinuity is used. Fix any time $\tau \in [0,r]$. The set of times in $[0,r]$ at which $D(S(\sigma)y)=0$ has full [Lebesgue measure](/page/Lebesgue%20Measure), so it is dense in $[0,r]$. Therefore we can choose a sequence $\sigma_k \to \tau$ with
\begin{align*}
D(S(\sigma_k)y)=0
\end{align*}
for every $k$. Continuity of the trajectory map $\sigma \mapsto S(\sigma)y$ gives
\begin{align*}
S(\sigma_k)y \to S(\tau)y
\end{align*}
in $X$. Lower semicontinuity of $D$ then gives
\begin{align*}
D(S(\tau)y)\leq \liminf_{k\to\infty}D(S(\sigma_k)y)=0.
\end{align*}
Since $D$ never takes negative values, this forces $D(S(\tau)y)=0$. Thus $S(\tau)y \in M$ for every $\tau \in [0,r]$. As $r>0$ was arbitrary, the entire forward trajectory of $y$ is contained in $M$.
[/guided]
[/step]
[step:Conclude containment in the largest invariant subset of $M$]
Taking $\tau=0$ in the previous step gives $D(y)=0$ for every $y \in \omega(x)$, hence
\begin{align*}
\omega(x)\subset M.
\end{align*}
We have also proved that $S(r)\omega(x)=\omega(x)$ for every $r \geq 0$. Thus $\omega(x)$ is an invariant subset of $M$.
Let
\begin{align*}
\mathcal{I}_M := \bigcup\{A \subset M : S(r)A=A \text{ for every } r \geq 0\}
\end{align*}
denote the largest invariant subset of $M$. Since $\omega(x)$ is one of the invariant subsets appearing in this union, we have
\begin{align*}
\omega(x)\subset \mathcal{I}_M.
\end{align*}
This proves that $\omega(x)$ is nonempty, compact, invariant, and contained in the largest invariant subset of $M$.
[/step]