\subsection{Moment-SOS Hierarchy}
\label{sec:moment_sos}
% \urg{more citations and/or reduce content in review}
% The infinite-dimensional linear measure programs \eqref{eq:peak_meas} and \eqref{eq:peak_cont} for peak estimation may be approximated through the Moment-SOS hierarchy  by a sequence of LMIs. 
The $\alpha$-moment of a measure $\mu$ for a multi-index $\alpha \in \N^n$ is $y_\alpha = \inp{x^\alpha}{\mu}$. 
The moment sequence $y$ is the infinite collection of moments $\{y_\alpha\}_{\alpha \in \N^n}$ of the measure $\mu$.
There exists a linear (Riesz) functional $L_y$ converting a polynomial $p(x) \in \R[x]$ into a linear combination of moments in $y$:
\begin{equation}
    L_y(p) = L_y\left(\textstyle \sum_{\alpha \in \N} p_\alpha x^\alpha \right) = \textstyle\sum_{\alpha \in \N} p_\alpha y_\alpha
\end{equation}

The moment matrix $\M[y]$ is a square symmetric matrix of infinite size and is indexed by monomials $(\alpha, \beta)$ as $\M[y]_{\alpha,\beta} = y_{\alpha + \beta}$ \cite{lasserre2009moments}. If a polynomial $p=\sum_{\alpha}p_\alpha x^\alpha$ with coefficients $p_\alpha$ is treated as a vector $\mathbf{p}$, evaluation of $\inp{p(x)^2}{\mu}$ is equivalent to $\mathbf{p}^T \M[y] \mathbf{p}$ by the Riesz functional $L_y$. 
Nonnegativity of $\inp{p(x)^2}{\mu}$ for all $p(x) \in \R[x]$ requires that $\M[y]$ is Positive Semidefinite (PSD). 
% The condition  $\M[y] \succeq 0$ is necessary for the infinite sequence $y$ to represent moments of a nonnegative measure over $\R^n$.

A basic semialgebraic set $\K = \{x \mid g_i(x) \geq 0, \ i = 1, \ldots, N_c\}$ may be the support set for a measure $\mu \in \Mp{\K}$. Because $\mu$ is supported over the region $\{x \mid g_i(x) \geq 0\}$, the evaluation $\inp{p(x)^2 g_i(x)}{\mu}$ is nonnegative for all polynomials $p(x) \in \R[x]$. The PSD localizing matrix associated with $g_i(x) \in \R[x]$ and the moment sequence $y$ is,
\begin{equation}
    \M[g_i y]_{\alpha, \beta} = \textstyle\sum_{\gamma \in \N^n} g_{i\gamma} y_{\alpha+ \beta + \gamma}.
\end{equation}
% The evaluation of $\inp{p(x)^2 g(x)}{\mu}$ is then equal to $\mathbf{p}^T \M[g y] \mathbf{p}$ if $y$ are the moments of a measure supported on $g(x) \geq 0$. 
% When there are multiple constraints $g_i(x) \geq 0$ such as in the definition of $\K$, the following localizing matrices are all positive semidefinite:
% \begin{equation}
%     \forall e \in \{0, 1\}^N: \qquad \M\left[ \left(\textstyle\prod_{i=1}^N g_i^{e_i}\right) y \right] \succeq 0.
% \end{equation}
% Given a sequence of numbers ${y_\alpha}_{\alpha \in I}$
% When $\K$ is compact (Archimedean), 
A necessary condition for a moment sequence $y$ to correspond with moments of a representing measure on $\K$ is that $\M[y]$ and all $\M[g_i y]$ are PSD. This necessary condition is sufficient if $\K$ is Archimedean \cite{putinar1993compact}.
A degree-$d$ finite truncation of these matrices keeps moments up to order $2d$, which are located in the upper-left corners of the infinite dimensional matrices. 
The truncated moment matrix $\M_d[y]$ has size $\binom{n+d}{d}$ corresponding to the monomials of $x$ with degree $\leq d$, and the localizing matrix $\M_{d - \textrm{deg}(g_i)}[g_i y]$ has size $\binom{n+d - \textrm{deg}(g_i)}{d-\textrm{deg}(g_i)}$.
% and similarly involves moments up to order $2r$. 
An infinite dimensional LP in measures may be posed with a polynomial objective $p(x)$ and $m$ polynomial constraint functions $a_j(x) \in \R[x], \ \forall j=1, \ldots, m$ with $b\in\R^{m}$ as,
\begin{subequations}
\label{eq:meas_program}
\begin{align}
    p^* =&  \max_{\mu \in \Mp{X}} \inp{p}{\mu}\\
    &\inp{a_j(x)}{\mu} = b_j  & & \forall j=1,\ldots,m.
\end{align}
\end{subequations}
The degree-$d$ finite truncation of \eqref{eq:meas_program} is an LMI with an $\binom{n+2d}{2d}$-dimensional vector of moments $y$ as a variable,
\begin{subequations}
\begin{align}
\label{eq:mom_program}
    p^*_d &=  \ \max_{y} \textstyle\sum_\alpha p_\alpha y_\alpha \\
    & \M_d(y) \succeq 0, \ \M_{d - d_i}(g_{i} y) \succeq 0  & & \forall i = 1, \ldots, N_c\\
    & \textstyle\sum_\alpha a_{j \alpha} y_\alpha\ = b_j  & & \forall j = 1, \ldots, m.
\end{align}
\end{subequations}
Increasing $d$ results in a decreasing sequence of upper bounds $p_d^* \geq p_{d+1}^* \geq \ldots \geq p^*$, which is convergent if $\K$ is Archimedean. The refinement of upper bounds to \eqref{eq:meas_program} by LMIs of increasing complexity is the moment-SOS hierarchy \cite{lasserre2009moments}. The moment-SOS relaxation to the peak estimation program \eqref{eq:peak_meas} is available in Equation (15) of \cite{miller2020recovery}, which is an LMI in moment sequences $(y_0, y_p, y)$ up to degree $2d$ of the measures $(\mu_0, \mu_p, \mu)$. These moment relaxations are dual to the SOS programs in \cite{fantuzzi2020bounding}. Near-optimal trajectories extremizing $p(x)$ may be recovered from LMI solutions if the moment matrices obey rank conditions \cite{miller2020recovery}. 


% Given a polynomial cost function $p(x)$ and $N_c$ constraints $a_i(x)$


