Prove identity involving $\operatorname{lcm}(x, y, z)$ I received this problem to prove that:
$$
\operatorname{lcm}(x, y, z) = \frac{xyz}{\operatorname{gcd}(x, y, z)\cdot\operatorname{gcd}(\operatorname{lcm}(x, y), \operatorname{lcm}(x, z), \operatorname{lcm}(y, z))}
$$
Knowing that: $$\operatorname{lcm}(x, y) = \frac{xy}{\operatorname{gcd}(x, y)}$$
I started saying that:
\begin{align*}
\operatorname{lcm}(x, y, z) &= \operatorname{lcm}(\operatorname{lcm}(x, y), z)\\
&= \frac{z\cdot\operatorname{lcm}(x, y)}{\operatorname{gcd}(z, \operatorname{lcm}(x, y))}\\
&=\operatorname{lcm}(x, y, z)\\
&= \frac{z\cdot\operatorname{lcm}(x, y)}{\operatorname{gcd}(z, \operatorname{lcm}(x, y))}\\
&= \frac{xyz}{\operatorname{gcd}(x, y)\cdot\operatorname{gcd}(z,\operatorname{lcm}(x, y))} 
\end{align*}
And I got stuck, how do I prove that it equals:
$$
\frac{xyz}{\operatorname{gcd}(x, y, z)\cdot\operatorname{gcd}(\operatorname{lcm}(x, y), \operatorname{lcm}(x, z), \operatorname{lcm}(y, z))}
$$
 A: Lemma: For any nonnegative integers $a_i, b_i, c_i$, we have
$$\mathrm{min}\{\mathrm{max}\{a_i, b_i\},\mathrm{max\{b_i, c_i}\},\mathrm{max\{c_i, a_i}\}\} + \mathrm{min}\{a_i, b_i, c_i\} +\mathrm{max}\{a_i, b_i, c_i\} = a_i + b_i + c_i.$$
Proof: Without loss of generality, we can impose an arbitrary ordering, say $a_i \leq b_i \leq c_i$. Then $$\mathrm{min}\{\mathrm{max}\{a_i, b_i\},\mathrm{max\{b_i, c_i}\},\mathrm{max\{c_i, a_i}\}\} + \mathrm{min}\{a_i, b_i, c_i\} +\mathrm{max}\{a_i, b_i, c_i\} = \mathrm{min\{b_i, c_i, c_i\} + a_i + c_i = b_i + a_i + c_i = a_i + b_i + c_i}. \square$$
Now, we have
$$\max\{a_i, b_i, c_i\} = a_i + b_i + c_i - \mathrm{min}\{\mathrm{max}\{a_i, b_i\},\mathrm{max\{b_i, c_i}\},\mathrm{max\{c_i, a_i}\}\} - \mathrm{min}\{a_i, b_i, c_i\}$$
so that
\begin{align*}
\mathrm{lcm}(x, y, z) = \prod_{p}p_i^{\max\{a_i, b_i, c_i\}} &= \frac{\prod_p p_i^{a_i 
 + b_i + c_i}}{\prod_p p_i^{\mathrm{min}\{\mathrm{max}\{a_i, b_i\},\mathrm{max\{b_i, c_i}\},\mathrm{max\{c_i, a_i}\}\}} \prod_{p} p_i^{\mathrm{min}\{a_i, b_i, c_i\}}} \\ &= \frac{xyz}{\operatorname{gcd}(x, y, z)\cdot\operatorname{gcd}(\operatorname{lcm}(x, y), \operatorname{lcm}(x, z), \operatorname{lcm}(y, z))}
\end{align*}
as desired. $\blacksquare$
A: It's enough to do it one prime at a time.
Let $p$ be a prime that divides one or more of $x,y$ or $z$, and let $k_x$ be the highest power so that $p^{k_x}|x$ and $k_y$ the highest power so that  $p^{k_y}|y$ and so on (note: some of these may be equal to $0$).
By symmetry we can assume $k_x \le k_y \le k_z$.  If that seems too glib, just relabel that $w = $ the $x,y$ or $z$ where $p$ divides by the lowest power, $u=$ the $x,y$ or $z$ where $p$ divides by the middle power, and $v = x,y$ or $z$ where $P$ divides by the highest.
The highest power of $p$ that divides $lcm(x,y,z)=lcm(w,u,v)$ is $p^{\max(k_x,k_y,k_z)} = p^{k_v}$.
The highest power of  $p$ that divide the RHS of the equation id $p^{(k_x+ k_y + k_z)- [\min(k_x,k_y,k_z) + \min(\max(k_x,k_y),\max(k_x,k_z),\max(k_y,k_z)]}=$
$p^{(k_w+ k_u + k_v)- [\min(k_w,k_u,k_v) + \min(\max(k_w,k_u),\max(k_w,k_v),\max(k_u,k_v)]}=$
$p^{(k_w+ k_u + k_v)- [k_w + \min(k_u,k_v,k_v)]}=$
$p^{(k_w+ k_u + k_v)- [k_w + k_u]}=$
$p^{k_v}=$
$p^{\max(k_x,k_y,k_z)}$.
So for every $p$ that divides any of $x,y,z$ the power of $p$ that divides both sides is exactly the same!
So do that for every prime that divides $x,y,$ or $z$ and the result follows.
