[proofplan]
We encode the coefficients $c_0,\dots,c_N$ in the polynomial $p(t)=\sum_j c_jt^j$ and evaluate it at the self-adjoint element $a$. The Hankel quadratic form is exactly $\varphi(p(a)^*p(a))$. Positivity of the state then gives the desired non-negativity.
[/proofplan]
[step:Build the polynomial element from the coefficients]
Fix an integer $N\geq 0$ and scalars $c_0,\dots,c_N\in\mathbb C$. Define
\begin{align*}
b:=\sum_{j=0}^{N}c_ja^j\in\mathcal A.
\end{align*}
Since $a^*=a$, induction gives $(a^i)^*=a^i$ for every integer $i\geq 0$. Therefore conjugate-linearity of the involution gives
\begin{align*}
b^*=\sum_{i=0}^{N}\overline{c_i}a^i.
\end{align*}
[/step]
[step:Expand $b^*b$ and identify the Hankel form]
Using distributivity and associativity in $\mathcal A$, we have
\begin{align*}
b^*b=\sum_{i=0}^{N}\sum_{j=0}^{N}\overline{c_i}c_ja^ia^j.
\end{align*}
Since powers of the same element multiply by adding exponents, $a^ia^j=a^{i+j}$. Hence
\begin{align*}
b^*b=\sum_{i=0}^{N}\sum_{j=0}^{N}\overline{c_i}c_ja^{i+j}.
\end{align*}
Applying the linear functional $\varphi$ and using $m_{i+j}=\varphi(a^{i+j})$, we obtain
\begin{align*}
\varphi(b^*b)=\sum_{i=0}^{N}\sum_{j=0}^{N}\overline{c_i}c_jm_{i+j}.
\end{align*}
[guided]
The expression in the theorem is a quadratic form in the coefficients $c_0,\dots,c_N$. To connect it to positivity of the state, we must rewrite it as the value of $\varphi$ on a square. The element
\begin{align*}
b=\sum_{j=0}^{N}c_ja^j
\end{align*}
is the natural choice. Because $a$ is self-adjoint, each power $a^i$ is also self-adjoint, so
\begin{align*}
b^*=\sum_{i=0}^{N}\overline{c_i}a^i.
\end{align*}
Multiplying the two finite sums gives
\begin{align*}
b^*b=\sum_{i=0}^{N}\sum_{j=0}^{N}\overline{c_i}c_ja^ia^j.
\end{align*}
The factors are powers of the same algebra element, so $a^ia^j=a^{i+j}$. Therefore
\begin{align*}
b^*b=\sum_{i=0}^{N}\sum_{j=0}^{N}\overline{c_i}c_ja^{i+j}.
\end{align*}
Now apply the linear functional $\varphi:\mathcal A\to\mathbb C$ term by term. Since $m_{i+j}$ was defined to be $\varphi(a^{i+j})$, this gives
\begin{align*}
\varphi(b^*b)=\sum_{i=0}^{N}\sum_{j=0}^{N}\overline{c_i}c_jm_{i+j}.
\end{align*}
Thus the Hankel form is exactly the positive-square value $\varphi(b^*b)$.
[/guided]
[/step]
[step:Apply positivity of the state]
The state $\varphi$ is positive by hypothesis, so $\varphi(x^*x)\geq 0$ for every $x\in\mathcal A$. Applying this with $x=b$ gives
\begin{align*}
\varphi(b^*b)\geq 0.
\end{align*}
Combining this inequality with the identity from the previous step yields
\begin{align*}
\sum_{i=0}^{N}\sum_{j=0}^{N}\overline{c_i}c_jm_{i+j}\geq 0.
\end{align*}
This proves the claimed Hankel positivity.
[/step]