Suppose $\mathfrak{g}$ is a sub-Lie algebra of $\mathfrak{gl}_n$. I want to understand why the Lie group $G\le GL_n(\mathbb{R})$ generated by exponentials of $\mathfrak{g}$ has $\mathfrak{g}$ as its Lie algebra. In other words, supposing that $\prod_{i=1}^m{e^{X_i}} = e^Y$ where $X_i \in \mathfrak{g}$ and $Y \in \mathfrak{gl}_n$ is some small element, why is $Y \in \mathfrak{g}$?
It seems like I should use the Baker-Campbell-Hausdorff formula, but that formula only applies if the $X_i$ are small enough. Which means that the statement is true for a fixed $m$ and small enough $X_i$'s. Maybe there is a way to reduce the general statement to this case?
I thought of assuming $Y \notin \mathfrak{g}$ and continuously changing the values of $X_i,Y$ to get to the case where all the vectors are small and $Y \notin \mathfrak{g}$, but there seem to be too many obstacles to this approach.
This is Proposition 8.41 in Fulton and Harris' Representation Theory: A First Course. Their proof uses exactly the Baker-Campbell-Hausdorff formula as you suggest. You only need to consider the case that the $X_i$s are small because every element of $G$ is a product of exponentials where the $X_i$ are small; more formally, $G$ is (connected, hence) generated by an arbitrarily small neighborhood of the identity.