# Divisibility lemma: $\exists n_0\mid n,\,\, m_0\mid m,\,(n_0,m_0) = 1,\text{ and }\,[n_0,m_0] = [n,m]$

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.

I don't think your attempt is correct (at least as it is written now) as long as there are primes $p_i$ which can repeat.
Start with $n=p_1^{a_1}\cdots p_r^{a_r}$ and $m=p_1^{b_1}\cdots p_r^{b_r}$ with $(a_i,b_i)\ne(0,0)$ for all $i$. (This means that $p_i$ appears with a positive exponent at least in one of the two numbers.)
Then define $n_0=\prod_{a_i\ge b_i}p_i^{a_i}$, and $m_0=\prod_{b_i>a_i}p_i^{b_i}$ and recall that $[n,m]=\prod_{i=1}^rp_i^{\max(a_i,b_i)}$.