I want to prove that, in a commutative group, there always exists an element whose order is $\mathrm{lcm}$ of the orders of two other elements. The exercise indicates that it follows easily from the divisibility lemma in the title: $$\exists n_0\mid n,\,\, m_0\mid m,\,(n_0,m_0) = 1,\text{ and }\,[n_0,m_0] = [n,m]$$
where $(\cdot,\cdot)$ and $[\cdot,\cdot]$ are $\mathrm{gcd}$ and $\mathrm{lcm}$, respectively.
In effect, the proof of the first statement (in groups) is straightforward once this is assumed. So now I have to prove the lemma itself.
My idea was to factorize into primes: $[n,m] = p_1\cdots p_k$ and then note that: $$\begin{align}&n \ = \ \prod_{i\in I}p_i \\ &m = \ \prod_{j\in J}p_j\end{align}$$ where $I,J\subset K = \{1,\dots,k\}$. Now define $$\begin{align}&n_0 \ = \ \prod_{s\in I\setminus (I\cap J)}p_s \\ &m_0 = \ \prod_{s\in J\setminus (J\cap I)}p_s\end{align}$$ It's obvious that we have the first part taken care of, i.e. $n_0\mid n,\,\, m_0\mid m$, and $(n_0,m_0) = 1$. I'm reluctant to say that the final statement $[n_0,m_0] = [n,m]$ holds, because I haven't really payed much attention to the primes that aren't in $I$ or in $J$. Can someone help me complete the proof?
While the answer I'm looking for is a modification/completion of the proof I started, I'm also interested if anyone has an alternate proof, possibly considering the equivalent statements in terms of ideals.
I've tagged as [principal-ideal-domains] because the lemma doesn't seem to need much else, and I'd like to keep the context as general as possible.