Recently, I discovered that a theorem from my differential geometry lecture is false due to too big generality - it stated that for vector fields $X,Y$ we have the equivalence:
Incorrect! $[X,Y] = 0$ $\iff$ the associated flows $h^X$, $h^Y$ commute.
The version from wikipedia says that the flows commute locally.
Question
I suggested above, I have a counterexample disproving the theorem as it was stated in my lecture. But it is a noncompact example and formally global flow does not exist. I'd like to see a counterexample with a compact manifold or at least with compact supports of both vector fields.
My counterexample (not compact)
Consider the manifold $M$ parametrised by $f: (-\pi,\pi) \times \mathbb R_+ \to \mathbb R^3$: $$f(\phi,r) = (r\cos (2\phi), r\sin (2\phi), \phi).$$
One can easily see, that locally (it is enough to consider an arc (in $(-\pi,\pi) \subseteq S^1$) shorter than half of the circle) this manifold is a graph of some function $g'$ (depending on the local neighbourhood) of the first two coordinates $(x,y)$ of $\mathbb R^3$. Let $g$ be defined as follows: $g(x,y)=(x,y,g'(x,y))$ - it is a local parametrisation of $M$. We can find a cover $\{U^i\}_{i\in \{1,2,3\}}$ of $M$ such that for each $U^i$ there exists a parametrisation $g^i$ as above (for appropriate $\{U^i\}$ domain of $g^i$ may be chosen as $\mathbb R^2 \setminus h^i$, where $h^i$ is a halfline starting at $0$).
Now: let $X_{|U^i} = g^i_*\left(-\frac{\partial}{\partial x}\right)$ and $Y_{|U^i} = g^i_*\left(\frac{\partial}{\partial y}\right)$ for all $i$ - we can easily see that the definition is correct. Moreover - it is clear that locally the associated flows commute (locally we are in $\mathbb R^2$ and the vector fields come from the (standard) coordinate system).
Ok, time for the party. Take point $f(-\frac{\pi}{8},\sqrt 2)=(1,-1,-\frac{\pi}{8})$. Go along the flow of $Y$ for $\Delta t=2$ (you end up at $(1,1,\frac{\pi}{8})$) and then for the same time along the flow of $X$ - you will stop at point $(-1,1,\frac{3\pi}{8})$. On the other hand, if you go first along the flow of $X$ and then $Y$, you will end up at $(-1,1,-\frac{5\pi}{8})$.
Update A funny thing is that manifold $M$ from the above example is diffeomorphic with the plane. It suggests that the theorem for my lecture is very far from being true (it is false even in the domain of one chart!). If we have a method of extending a pair of commuting vector fields from a disc to a whole manifold, we would be done. Maybe that's the right way?
Also note that we don't need $r\in\mathbb R_+$ for the counterexample, a finite interval is sufficient (and similarly for $\phi$), so we can modify $X,Y$ near the borders of our disc.