 \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 \cite{lasserre2009moments} by a sequence of LMIs. 
% This subsection reviews topics in real semialgebraic geometry as applied to the Moment-SOS hierarchy.
% \subsubsection{Moments}
The $\alpha$-moment of a measure $\mu$ for 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 functional converting a polynomial $p(x)$ into a linear combination of moments:
\begin{equation}
    p(x) = \sum_{\alpha \in \N} p_\alpha x^\alpha \rightarrow \sum_{\alpha \in \N} p_\alpha y_\alpha
\end{equation}

% There exists a linear functional \urg{finish this}
% The (pseudo)-expectation of a function $p \in C(X)$ with respect to the measure $\mu$ is $\E_\mu[p] = \inp{p}{\mu}$. The operator $\E_\mu$ is an expectation only when $\mu$ is a probability measure with $\inp{1}{\mu} = y_0 = 1$. When $p$ is a polynomial, there exists a linear functional converting the (pseudo)-expectation of $p$ into a linear combination of the moments of $\mu$:
% \begin{equation}
%     \E_\mu[p] = \E_\mu\left[\sum_{\alpha \in \N} p_\alpha x^\alpha\right] = \sum_{\alpha \in \N} p_\alpha \E_\mu\left[x^\alpha\right] = \sum_{\alpha \in \N} p_\alpha y_\alpha 
% \end{equation}

The infinite set of moments $\{\inp{x^\alpha}{\mu}\}_{\alpha \in \N^n} $ uniquely specifies the measure $\mu$. Not every set of numbers $y_\alpha$ is a moment sequence for some measure $\mu$, and the problem of determining if there exists a measure $\mu$ that agrees with a set of moments $y$ such that $\inp{x^\alpha}{\mu} = y_\alpha$ is known as the Generalized Moment Problem (GMP). 
% The GMP includes the case where only a finite number of putative moments $y_\alpha$ are available. 
A measure $\mu$ whose $\alpha$-moments agree with $y_\alpha$ is known as a `representing measure' for the moment sequence $y$.
The infinite moment matrix $\M[y]$ may be defined for a moment-sequence $\{y_\alpha\}_{\alpha \in \N^n}$ as 
\begin{equation}
    \M[y]_{\alpha, \beta} = y_{\alpha+ \beta}.
\end{equation}
$\M[y]$ is a square symmetric matrix of infinite size and is indexed by monomials $(\alpha, \beta)$. If a polynomial $p=\sum_{\alpha}p_\alpha x^\alpha$ is treated as a vector $\mathbf{p}$ with coefficients $p_\alpha$, evaluation of $\inp{p(x)^2}{\mu}$ is equivalent to $\mathbf{p}^T \M[y] \mathbf{p}$. 
Nonnegativity of $\inp{p(x)^2}{\mu}$ for all $p(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\}$ may be the support set for measures $\mu \in \Mp{\K}$. 
Because $\mu$ is supported over the region $\{x \mid g_1(x) \geq 0\}$, the evaluation $\inp{p(x)^2 g_1(x)}{\mu}$ is nonnegative for all polynomials $p(x) \in \R[x]$. For a polynomial $g(x) \in \R[x]$, the positive semidefinite localizing matrix associated with $g(x)$ and the moment sequence $y$ is,
\begin{equation}
    \M[g y]_{\alpha, \beta} = \sum_{\gamma \in \N^n} g_\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}
When $\K$ is compact, it is sufficient for the localizing matrices $\M[g_i y]$ to be PSD $\forall i = 1, \ldots, N$


The moment matrix $\M[y]$ and localizing matrices $\M[g_i y]$ are infinite-dimensional. A degree-$r$ finite truncation of these matrices keeps moments up to order $2r$, which are located in the upper-left corners of the infinite dimensional matrices. The truncated moment matrix $\M_r[y]$ has size $\binom{n+r}{r}$ corresponding to the monomials of $x$ with degree $\leq k$. The localizing matrix $\M_{k - \textrm{deg}(g_i)}[g_i y]$ has size $\binom{n+r - \textrm{deg}(g_i)}{r-\textrm{deg}(g_i)}$, and similarly involves moments up to order $2r$. 


