not be positive semidefinite. This finishes the proof.

In order to state the Positivstellensatz, we need to recall the notion of [*central polynomials*]{} for $n\times n$ matrices. These are $f\in K{\langle{\overline}X,{\overline}X^*\rangle}$ whose image in $\operatorname{GM}_n(K,\operatorname{J})$ is central. Equivalently, the image of $f$ under a $*$-homomorphism from $K{\langle{\overline}X,{\overline}X^*\rangle}$ to $M_n(K)$ endowed with a type $\operatorname{J}$ involution, is always a scalar matrix. If it is nonzero, we call $f$ [*nonvanishing*]{}. The existence of nonvanishing central polynomials is nontrivial; we refer to [@Row §1; Appendix A] for details.

\[thm:positiv\] Suppose ${\mathbb{K}}\in\{{\mathbb{R}},{\mathbb{C}}\}$ is endowed with the complex conjugate involution ${{\overline}{\phantom{x}}}$. Let $g=g^*\in {\mathbb{K}}{\langle{\overline}X,{\overline}X^*\rangle}$, $n\in {\mathbb{N}}$ and fix a type $\operatorname{J}\in\{$orthogonal, unitary$\}$ according to the type of involution on ${\mathbb{K}}$. Choose $\alpha_1,\ldots,\alpha_m\in {\mathbb{K}}{\langle{\overline}X,{\overline}X^*\rangle}$ whose images in $\operatorname{GM}_n({\mathbb{K}},\operatorname{J})$ form a diagonalisation of the quadratic form $\operatorname{Trd}(x^*x)$ on $\operatorname{UD}_n({\mathbb{K}},\operatorname{J})$. Then the following are equivalent:

1.  for any $s\in M_n({\mathbb{K}})^{\mathbb{N}}$, $g(s,{\overline}{s}^t)$ is positive semidefinite;

2.  there exists a nonvanishing central polynomial $h\in {\mathbb{K}}{\langle{\overline}X,{\overline}X^*\rangle}$ for $n\times n$ matrices and $p_{i,{\varepsilon}}\in {\mathbb{K}}{\langle{\overline}X,{\overline}X^*\rangle}$ with $$h^* g h \equiv
    \sum_{{\varepsilon}\in \{0,1\}^m} \alpha^{\varepsilon}\sum_{i} p_{i,{\varepsilon}}^*
    p_{i,{\varepsilon}}  \pmod {{\mathfrak{a}}_{\operatorname{J}_n}}.$$

Given a congruence as in (ii), it is clear that (i) holds whenever $h(s,{\overline}{s}^t)\neq 0$. As the set of all such $s$ is Zariski dense, (i) 