Question: Let $G$ be a closed and connected subgroup of $\mathrm{U}(n)$. Is $G$ given by polynomial equations in the real and imaginary parts of the matrix entries?
Motivation for the question: Let $G$ be a compact connected Lie group. It is well-known that $G$ has the structure of a real algebraic group, i.e. it is a smooth affine variety in some $\mathbb{R}^n$. Now, if $H$ is a connected closed subgroup of $G$, then it is compact and hence also admits the structure of a real algebraic group. I want to know if $H$ a subvariety of $G$, i.e. if it is a Zariski-closed subset of $G$. Since every compact Lie group can be embedded in $\mathrm{U}(n)$, this question reduces to the former one.
Yes, and we don't need to assume that $G$ is connected.
We have the following known result:
Proof. See Onishchik & Vinberg, Lie Groups and Algebraic Groups, Springer-Verlag 1990 (Proof of Theorem 5 on page 133). $\Box$
Now, if $G$ is a closed subgroup of $\mathrm{U}(n)$ then, using the natural embedding $\mathrm{GL}(n,\mathbb{C})\subseteq \mathrm{GL}(2n,\mathbb{R})$, we see that $G$ is a compact subgroup of $\mathrm{GL}(2n,\mathbb{R})$ and hence is given by real polynomials in the matrix entries.