\subsection{Occupation Measures}

% Review occupation measures (initial, occupation). Include marginalization over $w$

% An occupation measure 


A trajectory of the dynamical system $\dot{x}=f(t,x)$ for times $t \in [0, T]$ starting at an initial condition $x_0 \in X_0$ may be denoted as $x(t \mid x_0)$ . Let $\mu_0 \in \Mp{X_0}$ be a measure distributed over initial conditions. The average occupation measure with respect to $\mu_0$ returns the expected amount of time that trajectories spend in a particular time-space region $A \subseteq [0, T], \ B  \subseteq X$ \cite{lewis1980relaxation},
\begin{equation}
    \label{eq:occ_measure}
    \mu(A \times B) = \int_{[0, T] \times X_0} I_{A \times B}((t, x(t \mid x_0))) d \mu_0(x_0) dt.
\end{equation}
The measure $\mu$ satisfies $\mu([0, T] \times X) = T$. The terminal measure $\mu^T$ that follows trajectories until time $T$ is:
\begin{equation}
    \label{eq:occ_terminal}
    \mu^T(B) = \int_{X_0} I_{B}((x(T \mid x_0)) d \mu_0(x_0).
\end{equation}
% Assuming that trajectories spend all time $[0, T]$ in $X$, then $\mu([0, T] \times X) = T$.
% \urg{Is a terminal measure necessary? We can go straight to the peak with liouville}. 
For a test function $v(t, x) \in C^1([0, T], \times X)$, the Lie derivative of $v$ with respect to the vector field $f$ is:
\begin{equation}
    \label{eq:lie_deriavite}
    \Lie_f v(t,x) = \partial_t v(t, x)+ \nabla_x v(t,x) \cdot f(t, x).
\end{equation}
The three measures $\mu_0, \mu_T, \mu$ are related by Liouville's equation for all test functions $v(t, x) \in C^1([0, T], \times X)$:
\begin{align}
\inp{v(T, x)}{\mu_T} &= \inp{v(0, x)}{\mu_0} + \inp{\Lie_f v(t,x)}{\mu}. \label{eq:liou_int}
\end{align}
Equation \eqref{eq:liou_int} may be expressed in a weak sense by,
\begin{align}
\delta_T \otimes \mu_T &= \delta_0 \otimes \mu_0 + \Lie_f^\dagger \mu. \label{eq:liou_mom}
\end{align}
Equation \eqref{eq:liou_mom} is an equivalent statement for Liouville's equation where the adjoint $\inp{\Lie_f v}{\mu} = \inp{v}{\Lie^\dagger_f \mu}$. Moments of $\mu$  can be computed by evaluating $\inp{v(t,x)}{\mu}$ where the test function $v$ is a monomial.  Equation \eqref{eq:liou_mom} is an infinite set of linear constraints in terms of moments of $\mu_0, \mu_T, \mu$.

External controls or disturbances can be added into an occupation measure framework. For an input $w(t) \in W$ and a subset $D \subseteq W$, the disturbance-occupation measure $\mu^w$ is:
\begin{align}
    \label{eq:occ_measure_d}
    &\mu^w(A \times B \times D) = \\
    &\quad \int_{[0, T] \times X_0} I_{A \times B \times D}((t, x(t), w(t)) \mid x_0) d \mu_0(x_0) dt. \nonumber
\end{align}
The disturbance $w(t)$ may be relaxed into a distribution $\xi(w \mid x, t)$ known as a Young Measure \cite{young1942generalized, lewis1980relaxation}.
Liouville's equation with a relaxed disturbance $\xi(w \mid x, t)$ influencing dynamics $f(t, x, w)$ for all $v(t, x) \in C^1([0, T]\times X)$ is,
\begin{align}
\label{eq:liou_d}
\inp{v(T, x)}{\mu_T} &= \inp{v(0, x)}{\mu_0} + \inp{\Lie_f v(t, x)}{\mu^w}. \end{align}
Equivalent expressions are formed by rearranging operators,
\begin{align}
\inp{v}{\delta_T \otimes \mu_T} &= \inp{v}{\delta_0 \otimes \mu_0} + \inp{\Lie_f v}{\mu^w} & \forall v \\
\inp{v}{\delta_T \otimes \mu_T} &= \inp{v}{\delta_0 \otimes \mu_0} + \inp{v}{\Lie_f^\dagger \mu^w} & \forall v \label{eq:weak_before_sum}\\
\inp{v}{\delta_T \otimes \mu_T} &= \inp{v}{\delta_0 \otimes \mu_0 + \pi^{tx}_\#\Lie_f^\dagger \mu^w} & \forall v.\label{eq:weak_after_sum}
\end{align}

The measures of the two summands on the right hand side of \eqref{eq:weak_before_sum} reside in different spaces, as $\delta_0 \otimes \mu_0 \in \Mp{[0, T] \times X}$ while $\Lie_f^\dagger \mu^w \in \Mp{[0, T] \times X \times W}$. The $(t,x)$-marginalization $\pi^{tx}_\# \Lie^\dagger_f \mu^w \in \Mp{[0, T] \times X}$ allows the measures to be added together inside the duality pairing in \eqref{eq:weak_after_sum}. The duality pairings $\inp{v(t,x)}{\Lie^\dagger_f \mu^w}$ and $\inp{v(t,x)}{\pi^{tx}_\#\Lie^\dagger_f \mu^w}$ are equal for all $v \in C^1([0, T] \times X)$
because $v(t,x)$ is not a function of $w$. The weak disturbed Liouville's Equation is derived from \eqref{eq:weak_after_sum}  by treating  $\forall v(t, x) \in C^1([0, T]\times X)$ as implicit,
\begin{equation}
    \delta_T \otimes \mu_T = \delta_0 \otimes \mu_0 + \pi^{tx}_\# \Lie^\dagger_f \mu^w.
\end{equation}



% The Lie term  in \eqref{eq:liou_d} marginalizes out the relaxed disturbance $\xi$, and can be written as $\inp{\Lie_f v(t, x)}{\mu^w} = \inp{v(t, x)}{\pi^{tx}_\# \Lie^\dagger_f \mu^w}$ with projection map $\pi^{t x}: [0, T] \times X \times W \rightarrow [0, T] \times X$.


% The weak formulation of \eqref{eq:liou_d} holding for all test functions $v(t, x) \in C([0, T]\times X)$ is,
% The weak formulation of \eqref{eq:liou_d} may be written by using the pushforward of the projection map $\pi^{t x}: [0, T] \times X \times W \rightarrow [0, T] \times X$ in order to marginalize out the relaxed disturbance,

% \begin{equation}
% \label{eq:liou_d}
% \delta_T \otimes \mu_T = \delta_0 \otimes \mu_0 + \pi^{tx}_\#\Lie_f^\dagger \mu^d
% \end{equation}
% The projection operator $\pi^{tx}_\#$ marginalizes the input $d(t)$ from the distribution $\xi$ of possible disturbances. 
% The measure $\mu^d$ is known  as a Young Measure, and acts as a relaxed disturbance or control  \urg{is this correct?}.

% There exists a $\mu^d$ which solves Equation \eqref{eq:liou_int} such that the support of $\mu^d$ is contained on the graph $(t, x(t), d(t))$ \cite{lasserre2008nonlinear}.

% control-occupation measure $\mu^w$ is supported on the graph

% by introducing a measure $\mu^w$:



% Write about the control-occupation measure.
