Solution (source code)

= Solution

The <local flow> of $X$ is the smooth map $\Phi:D\to M$, where $D\subset\mathbb R\times M$ is the maximal open domain of initial-point/time pairs, whose curve $t\mapsto\Phi(t,q)=\phi_t(q)$ is the maximal <integral curve of a vector field> through $q$, with $\phi_0(q)=q$. Smooth dependence in the <ordinary differential equation> theorem gives joint smoothness and openness of $D$. Each time slice is a <diffeomorphism> between its domain and image, with inverse $\phi_{-t}$.

Here is the group law, including its domain qualification. Fix $s,q$ where the relevant trajectories exist. Both curves
$$
t\longmapsto\phi_{t+s}(q),
\qquad
t\longmapsto\phi_t(\phi_s(q))
$$
solve the same autonomous <ordinary differential equation> and have value $\phi_s(q)$ at $t=0$. The uniqueness from the first part therefore gives
$$
\boxed{\phi_{t+s}(q)=\phi_t(\phi_s(q))}
$$
on their common interval. These are local identities; neither the <vector field> nor its <local flow> has been assumed complete.

For the commuting <local flows> $\phi_t$ and $\psi_s$, differentiate $\phi_t(\psi_s(q))=\psi_s(\phi_t(q))$ with respect to $s$ at zero. The <chain rule> gives
$$
\boxed{(D_q\phi_t)Y_q=Y_{\phi_t(q)}.}
$$
Thus the <pushforward of a vector field> $Y$ by the $X$ flow equals $Y$. Interchanging the two fields gives the analogous identity for $X$ under $\psi_s$.

Now let $\mathcal D_q=\operatorname{span}(X_q,Y_q)$. Pointwise <linear independence> makes this a rank-two <smooth distribution>. The identity just proved implies $[X,Y]=0$: in coordinates, differentiating $D_q\phi_tY_q=Y_{\phi_t(q)}$ at $t=0$ gives $DX(q)Y_q=DY(q)X_q$, precisely the vanishing <Lie bracket of vector fields>. The bracket of two local sections is also in $\mathcal D$, since
$$
[fX,gY]=fg[X,Y]+fX(g)Y-gY(f)X
$$
and the analogous terms for $[fX,gX]$ and $[fY,gY]$ remain in the same span. Therefore $\mathcal D$ is an <involutive distribution>.

The <Frobenius theorem> says that a smooth constant-rank involutive distribution has local coordinates $(u^1,\ldots,u^n)$ in which it is spanned by $\partial_{u^1},\partial_{u^2}$, and has unique maximal connected <integral manifolds> through its points. These are the <leaves of a regular foliation>. Let $S$ be the maximal leaf through $p$. The <global confinement to an immersed leaf> gives the answer: \b[$S$ is a two-dimensional immersed integral manifold and every smooth $\mathcal D$-tangent curve starting at $p$ stays in $S$.]

For the curve assertion, in each Frobenius chart the transverse coordinate functions $u^3,\ldots,u^n$ have zero derivative along such a curve. Hence its segment in that chart stays in one plaque. On any compact subinterval of the curve's parameter interval, a finite chain of overlapping such segments connects the initial plaque to the last; all belong to the same maximal leaf. Exhausting the parameter interval proves the assertion for every time.

The two commuting <local flows> also give the leaf parametrization directly near $p$:
$$
F(s,t)=\phi_s(\psi_t(p)).
$$
Its partial derivatives are $\partial_sF=X_F$ and $\partial_tF=Y_F$, by the pushforward identity. Its differential has rank two. The <constant rank theorem> makes a sufficiently small image an embedded local plaque with tangent plane $\mathcal D$. This is a concrete local construction of the <integral manifold>.

There is a global distinction in the word “submanifold”. If it is required to mean an <embedded submanifold>, the assertion for all times is not valid in general. On the <three-dimensional torus> $\mathbb R^3/\mathbb Z^3$, take
$$
X=\partial_x+\alpha\partial_z,\qquad Y=\partial_y,\qquad \alpha\notin\mathbb Q.
$$
The fields are independent and commute, and their <dense immersed cylinder in a three-dimensional torus> through zero is
$$
S=\{(s,t,\alpha s)\bmod\mathbb Z^3:s,t\in\mathbb R\}.
$$
It is an injectively immersed cylinder $\mathbb R\times(\mathbb R/\mathbb Z)$ and is dense in the torus. Indeed, fixing $x\bmod1$ and varying $s$ by integers makes $\alpha s\bmod1$ dense by an <irrational rotation of the circle>; $t$ is unrestricted. Every point of this leaf is reached by a tangent curve $r\mapsto(rs,rt,\alpha rs)\bmod\mathbb Z^3$. An embedded surface containing it would, in a submanifold chart near one of its points, be a closed coordinate plane containing a dense subset of the ambient open chart, an impossibility. Thus the global conclusion uses an immersed leaf; the embedded conclusion is local, for curve segments remaining in a suitable chart.