TITLE: Is every finite-dimensional Lie algebra the Lie algebra of a closed linear Lie group?
QUESTION [20 upvotes]: This question is closely related to this one.
Ado's theorem states that given a finite-dimensional Lie algebra $\mathfrak g$, there exists a faithful representation $\rho\colon\mathfrak g \to \mathfrak{gl}(V)$, with $V$ a finite-dimensional vector space. In the real or complex case one can take the exponent of the image and obtain a (virtual) Lie subgroup $\exp\rho(\mathfrak g)$ in $GL(V)$ having Lie algebra $\rho(\mathfrak g)$. But nothing guarantees that this subgroup will be closed in $GL(V)$. 
So the question is: is every finite-dimensional Lie algebra the Lie algebra of some closed linear Lie group? I am primarily interested in the real and complex case, but it might be interesting to ask what happens in the ultrametric case as well.

REPLY [3 votes]: The answer is yes. According to Ado's theorem,
every Lie algebra can be realized as subalgebra
of $\mathfrak{gl}(V)$ for some $V$.
According to the subalgebras-subgroups theorem,
every Lie subalgebra of $\mathfrak{gl}(V)$
is the Lie algebra of an immersed Lie subgroup of $\mathrm{GL}(V)$.
Call a Lie group linear if it admits a faithful representation.
We have shown that every Lie algebra is the Lie algebra
of a linear Lie group. It is known that every
linear Lie group $G$ admits a faithful representation
whose image is closed.
Here's a sketch of the proof of the last statement.
Let $r\colon G\rightarrow GL(V)$ be a faithful representation of $G$.
The derived group $r(G^{\prime})$ of $r(G)$ is closed $GL(V)$
and hence in $r(G)$. Hence
$G/G^{\prime}$ is an abelian Lie group. Therefore there exists a
representation $s\colon G\rightarrow GL(W)$ such that $Ker(s)=G^{\prime}$ and
$s(G)$ is closed in $GL(W)$. Consider the representation $G\rightarrow GL(V\oplus
W)$ such $a\in G$ acts on $V$ as $r(a)$ and on $W$ as $s(a)$. This is
faithful, and one can show that its image is closed --- Proposition 5 of
Djokovic, D. Ž. A closure theorem for analytic subgroups of real Lie groups. Canad. Math. Bull. 19 (1976), no. 4, 435--439. MR0442147