This is a question (5. 13) from Brian C.Hall's textbook (GTM 222).
Let $G$ be a matrix Lie group with Lie algebra $\frak{g}$, let $\frak{h}$ be a subalgebra of $\frak{g}$, and let $H$ be the unique connected Lie subgroup of $G$ with Lie algebra $\frak{h}$. Suppose that there exists a simply connected compact matrix Lie group $K$ such that the Lie algebra of $K$ is isomorphic to $\frak{h}$. Show that $H$ is closed. Is $H$ necessarily isomorphic to $K$?
I think I have some rough ideas on how to show $H$ is closed. Since $K$ is simply connected, given the Lie algebra isomorphism from its Lie algebra to $\frak{h}$ (let's call it $\phi$), there is a group homomorphism $\Phi$ such that $\Phi(\exp(X))=\exp(\phi(X))$ for $X$ in the Lie algebra of $K$. Consider a convergent sequence $A_m$ in $H$. Since $H$ is connected, every $A_m$ can be written as product of exponentials
$$A_m=e^{Y_{m,1}}\cdots e^{Y_{m,i_m}}$$
Now I am uncertain how to proceed. For each given $A_m$, the number of exponentials in this product should be a fixed number $i_m$. But as $m\to\infty$, I am not sure whether we know $i_m$ is still finitely many. If it is true and $i_m$ is bounded by some $n$ for all $m$, maybe we can argue $$A_m=e^{Y_{m,1}}\cdots e^{Y_{m,n}}$$ with $Y_{m,k}\to Y_k$ for every $k$. Then using the isomorphism between $\frak{h}$ and the Lie algebra of $K$, we transform the sequence of $Y_{m,k}$ in $\frak{h}$ to the sequence $\phi^{-1}(Y_{m,k})$ in $K$'s Lie algebra. Since $K$ is compact, we know the limit $\phi^{-1}(Y_{k})$ is in its Lie algebra. Finally we apply the homomorphism $\Phi$ to conclude that $e^{Y_k}=\Phi(\exp{\phi^{-1}(Y_k)})$ is indeed in $H$, thus $A_m$ converges to some element in $H$.
Is this a valid approach? And I have no clue how to handle the last question on isomorphism between $H$ and $K$. Any hint is appreciated!
It seems to me that your approach is too complicated. By construction, the homomorphism $\Phi:K\to H$ has bijective derivative. But surjectivity of the derivative and connectedness of $H$ imply that $\Phi$ is surjective. ($\Phi(K)\subset H$ is a subgroup, which contains $e^Y$ for any $Y\in \mathfrak h$, which already shows that $\Phi(K)=H$.) But this implies that $H$ is compact as a continuous image of the compact space $K$ and hence it is closed in $G$. As in the comment of @Apocalypse, you can take $H=SO(3)\subset GL(3,\mathbb R)=G$ and $K=SU(2)$ as an example to show that $H$ need not be isomorphic to $K$.