Divisors of a product. Is there a proof that if $d \mid mn$, where $m$ and $n$ are coprime, then $d=d_1d_2$ where $d_1 \mid m$ and $d_2 \mid n$, where the  $d_i$ are comprime?
I was working on Project Euler and came across this fact but the link to the proof had expired.
 A: $\color{#c00}{cd = mn}\,\Rightarrow\, (d,m)(d,n) = ((d,m)d,(d,\color{#c00}m)\color{#c00}n) = (d,\color{#0a0}{m,n},\color{#c00}c)\color{#c00}d = d,\,$ by $\color{#0a0}{(m,n)=1}$
Hence $\ d = (d,m)(d,n)\ $ where $\ (d,m)\mid m,\,\ (d,n)\mid n\ \ \ $ QED

Or  $\,\ d\mid mn\iff d\mid dn,mn \color{#c0f}\iff d\mid (dn,mn)\overset{\color{#0a0}{\rm D\,L}} = (d,m)n \iff d/(d,m)\mid n$
Therefore $\ d\, =\, (d,m) \dfrac{d}{(d,m)}  \ $ where $\ (d,m)\mid m\ $ and $\ \dfrac{d}{(d,m)}\mid  n\ \ \ $ QED
Above we used $\, d\mid j,k\color{#c0f}\iff d\mid (j,k),\,$ the universal property of the gcd, and we also used $\,\rm\color{#0a0}{DL} =$ the gcd Distributive Law, both here and in the first proof.
A: The case where $m = n = 1$ is trivial.
Since $d \mid mn,$ we have
$d = p_{1}^{a_{1}}\cdots p_{k}^{a_{k}}$ for some integer $k \geq 1$, some integers $a_{1}, \dots, a_{k} \geq 0,$ and some distinct primes $p_{1}, \dots, p_{k}$ such that $p_{j} \mid m$ or $p_{j} \mid n$ for all $1 \leq j \leq k.$
Suppose that $p_{1}^{a_{1}}, \dots, p_{i}^{a_{i}} \mid m$ and $p_{i+1}^{a_{i+1}}, \dots, p_{k}^{a_{k}} \mid n$ for some $1 \leq i \leq k.$ 
Let
$d_{1} := p_{1}^{a_{1}}\cdots p_{i}^{a_{i}}$ and $d_{2} := p_{i+1}^{a_{i+1}}\cdots p_{k}^{a_{k}}$. Then we see that $(d_{1}, d_{2}) = 1,$ that $d = d_{1}d_{2},$ that $d_{1} \mid m,$ and that $d_{2} \mid n.$
