Prove that $(ab,cd)=(a,c)(b,d)\left(\frac{a}{(a,c)},\frac{d}{(b,d)}\right)\left(\frac{c}{(a,c)},\frac{b}{(b,d)}\right)$

We first prove that if $\alpha,\beta,\gamma,\delta$ are integers such that $$(\alpha,\gamma)=(\alpha,\delta)=(\beta,\gamma)=(\beta,\delta)=1,$$ then $(\alpha\beta,\gamma\delta)=1.$ Indeed, from $(\alpha,\gamma)=1=(\alpha,\delta)$ we deduce that $(\alpha,\gamma\delta)=1.$ Similarly, from $(\beta,\gamma)=1=(\beta,\delta)$ it follows that $(\beta,\gamma\delta)=1.$ Combining the foregoing two results, we then conclude that $(\alpha\beta,\gamma\delta)=1.$

We then show that, if $(a,c)=1$ and $(b,d)=1,$ then $(ab,cd)=(a,d)(b,c).$ Indeed, because $(a,d)\mid a,$ $(b,c)\mid c,$ from $(a,c)=1$ we have $(a/(a,d), c/(b,c))=1.$ Similarly, from $(b,d)=1$ and $(b,d)\mid b, (a,d)\mid d,$ it follows that $(b/(b,c), d/(a,d))=1.$ It is also clear that $(a/(a,d), d/(a,d))=1$ and $(b/(b,c), c/(b,c))=1.$ Thus, by the foregoing paragraph, we have \begin{align*} (ab,cd)=&(a,d)(b,c)\left(\frac{a}{(a,d)}\frac{b}{(b,c)},\frac{d}{(a,d)}\frac{c}{(b,c)}\right)\\ =&(a,d)(b,c)\cdot 1=(a,d)(b,c), \end{align*} provided $(a,c)=1=(b,d).$

Now consider the general case. Because \begin{gather*} \left(\frac{a}{(a,c)},\frac{c}{(a,c)}\right)=1,\qquad \left(\frac{b}{(b,d)},\frac{d}{(b,d)}\right)=1, \end{gather*} we have \begin{align*} (ab,cd)&=\left((a,c)(b,d)\frac{a}{(a,c)}\frac{b}{(b,d)}, (a,c)(b,d)\frac{c}{(a,c)}\frac{d}{(b,d)}\right)\\ &=(a,c)(b,d)\left(\frac{a}{(a,c)}\frac{b}{(b,d)},\frac{c}{(a,c)}\frac{d}{(b,d)}\right)\\ &=(a,c)(b,d)\left(\frac{a}{(a,c)},\frac{d}{(b,d)}\right)\left(\frac{b}{(b,d)},\frac{c}{(a,c)}\right)\\ &=(a,c)(b,d)\left(\frac{a}{(a,c)},\frac{d}{(b,d)}\right)\left(\frac{c}{(a,c)},\frac{b}{(b,d)}\right). \end{align*}


Theorem 1. Let $x$ and $y$ be two integers. Then, there exist integers $p$ and $q$ such that $px+qy=\gcd\left( x,y\right) $.

Theorem 1 is Bezout's theorem, and we assume it to be known. Notice that the integers $x$ and $y$ are allowed to be $0$ (even both of them, in which case we use the convention $\gcd\left( 0,0\right) =0$).

Proposition 2. Let $n$ and $m$ be two nonnegative integers such that $n\mid m$ and $m\mid n$. Then, $m=n$.

Proposition 2 is obvious. Equalities between gcd's are usually proven with the help of Proposition 2.

Lemma 3. Let $x$, $y$, $z$ and $w$ be four integers such that $\gcd\left( x,z\right) =1$ and $\gcd\left( y,w\right) =1$. Then, $\gcd\left( xy,zw\right) =\gcd\left( y,z\right) \cdot\gcd\left( x,w\right) $.

Proof of Lemma 3. Theorem 1 (applied to $w$ instead of $y$) shows that there exist integers $p$ and $q$ such that $px+qw=\gcd\left( x,w\right) $. Let us denote these $p$ and $q$ by $p_{1}$ and $q_{1}$. Thus, $p_{1}$ and $q_{1}$ are integers satisfying $p_{1}x+q_{1}w=\gcd\left( x,w\right) $.

Theorem 1 (applied to $y$ and $z$ instead of $x$ and $y$) shows that there exist integers $p$ and $q$ such that $py+qz=\gcd\left( y,z\right) $. Let us denote these $p$ and $q$ by $p_{2}$ and $q_{2}$. Thus, $p_{2}$ and $q_{2}$ are integers satisfying $p_{2}y+q_{2}z=\gcd\left( y,z\right) $.

Theorem 1 (applied to $z$ instead of $y$) shows that there exist integers $p$ and $q$ such that $px+qz=\gcd\left( x,z\right) $. Let us denote these $p$ and $q$ by $g$ and $h$. Thus, $g$ and $h$ are integers satisfying $gx+hz=\gcd\left( x,z\right) $. Hence, $gx+hz=\gcd\left( x,z\right) =1$.

Theorem 1 (applied to $y$ and $w$ instead of $x$ and $y$) shows that there exist integers $p$ and $q$ such that $py+qw=\gcd\left( y,w\right) $. Let us denote these $p$ and $q$ by $g^{\prime}$ and $h^{\prime}$. Thus, $g^{\prime}$ and $h^{\prime}$ are integers satisfying $g^{\prime}y+h^{\prime}w=\gcd\left( x,z\right) $. Hence, $g^{\prime}y+h^{\prime}w=\gcd\left( x,z\right) =1$.

Now,

$\underbrace{\gcd\left( y,z\right) }_{=p_{2}y+q_{2}z}\cdot\underbrace{\gcd \left( x,w\right) }_{=p_{1}x+q_{1}w}$

$=\left( p_{2}y+q_{2}z\right) \cdot\left( p_{1}x+q_{1}w\right) $

$=p_{1}p_{2}xy+q_{1}p_{2}\underbrace{yw}_{=yw1}+q_{2}p_{1}\underbrace{xz} _{=xz1}+q_{1}q_{2}zw$

$=p_{1}p_{2}xy+q_{1}p_{2}yw\underbrace{1}_{=gx+hz}+q_{2}p_{1}xz\underbrace{1} _{=g^{\prime}y+h^{\prime}w}+q_{1}q_{2}zw$

$=p_{1}p_{2}xy+q_{1}p_{2}yw\left( gx+hz\right) +q_{2}p_{1}xz\left( g^{\prime}y+h^{\prime}w\right) +q_{1}q_{2}zw$

$=p_{1}p_{2}xy+q_{1}p_{2}ywgx+q_{1}p_{2}ywhz+q_{2}p_{1}xzg^{\prime} y+q_{2}p_{1}xzh^{\prime}w+q_{1}q_{2}zw$

$=\left( p_{1}p_{2}+q_{1}p_{2}wg+q_{2}p_{1}zg^{\prime}\right) xy+\left( q_{1}p_{2}yh+q_{2}p_{1}xh^{\prime}+q_{1}q_{2}\right) zw$ (by a straightforward computation)

is a $\mathbb{Z}$-linear combination of $xy$ and $zw$, and therefore divisible by $\gcd\left( xy,zw\right) $ (since both $xy$ and $zw$ are divisible by $\gcd\left( xy,zw\right) $). In other words,

(1) $\gcd\left( xy,zw\right) \mid\gcd\left( y,z\right) \cdot \gcd\left( x,w\right) $.

On the other hand, multiplying the relations $\gcd\left( y,z\right) \mid y$ and $\gcd\left( x,w\right) \mid x$, we obtain $\gcd\left( y,z\right) \cdot\gcd\left( x,w\right) \mid yx=xy$. Also, multiplying the relations $\gcd\left( y,z\right) \mid z$ and $\gcd\left( x,w\right) \mid w$, we obtain $\gcd\left( y,z\right) \cdot \gcd\left( x,w\right) \mid zw$. We thus know that both $xy$ and $zw$ are divisible by $\gcd\left( y,z\right) \cdot\gcd\left( x,w\right) $. Therefore, the greatest common divisor of $xy$ and $zw$ is also divisible by $\gcd\left( y,z\right) \cdot\gcd\left( x,w\right) $. In other words, we have

(2) $\gcd\left( y,z\right) \cdot\gcd\left( x,w\right) \mid\gcd\left( xy,zw\right) $.

Now, we have proven (1) and (2). Thus, we can apply Proposition 2 to $n=\gcd\left( y,z\right) \cdot\gcd\left( x,w\right) $ and $m=\gcd\left( xy,zw\right) $. We thus obtain $\gcd\left( xy,zw\right) =\gcd\left( y,z\right) \cdot\gcd\left( x,w\right) $. This proves Lemma 3.

Theorem 4. Let $a$, $b$, $c$ and $d$ be four integers. Let $n=\gcd\left( a,c\right) $ and $m=\gcd\left( b,d\right) $; assume that $n\neq0$ and $m\neq0$. Then,

$\gcd\left( ab,cd\right) =\gcd\left( a,c\right) \cdot\gcd\left( b,d\right) \cdot\gcd\left( \dfrac{a}{n},\dfrac{d}{m}\right) \cdot \gcd\left( \dfrac{c}{n},\dfrac{b}{m}\right) $.

Proof of Theorem 4. Let $x=\dfrac{n}{a}$, $y=\dfrac{m}{b}$, $z=\dfrac{n}{c}$ and $w=\dfrac{n}{d}$. Then, $a=nx$, $b=my$, $c=nz$ and $d=nw$. Also, $x=\dfrac{n}{a}$ is an integer (since $n=\gcd\left( a,c\right) \mid a$), and similarly $y$, $z$ and $w$ are integers.

Now, $n=\gcd\left( \underbrace{a}_{=nx},\underbrace{c}_{=nz}\right) =\gcd\left( nx,nz\right) =n\gcd\left( x,z\right) $. Since $n\neq0$, we can divide this equality by $n$, and obtain $1=\gcd\left( x,z\right) $. The same argument (using $m,b,d,y,w$ instead of $n,a,c,x,z$) shows that $1=\gcd\left( y,w\right) $. Thus, Lemma 3 yields

$\gcd\left( xy,zw\right) =\underbrace{\gcd\left( y,z\right) } _{=\gcd\left( z,y\right) }\cdot\gcd\left( x,w\right) =\gcd\left( z,y\right) \cdot\gcd\left( x,w\right) $

$=\gcd\left( x,w\right) \cdot\gcd\left( z,y\right) $.

But

$\gcd\left( \underbrace{a}_{=nx}\underbrace{b}_{=my},\underbrace{c} _{=nz}\underbrace{d}_{=mw}\right) =\gcd\left( nxmy,nzmw\right) =\gcd\left( nm\cdot xy,nm\cdot zw\right) $

$=nm\cdot\underbrace{\gcd\left( xy,zw\right) }_{=\gcd\left( w,x\right) \cdot\gcd\left( z,y\right) }=\underbrace{n}_{=\gcd\left( a,c\right) }\underbrace{m}_{=\gcd\left( b,d\right) }\cdot\gcd\left( \underbrace{x} _{=\dfrac{a}{n}},\underbrace{w}_{=\dfrac{d}{m}}\right) \cdot\gcd\left( \underbrace{z}_{=\dfrac{c}{n}},\underbrace{y}_{=\dfrac{b}{m}}\right) $

$=\gcd\left( a,c\right) \cdot\gcd\left( b,d\right) \cdot\gcd\left( \dfrac{a}{n},\dfrac{d}{m}\right) \cdot\gcd\left( \dfrac{c}{n},\dfrac{b} {m}\right) $.

Theorem 4 is proven.

This is probably not the simplest or shortest proof, but was the easiest one to write (it took me almost no focus and very little editing, just a lot of copy & paste). The annoying computations in the proof of Lemma 3 could have been simplified using ideal notation, but I don't know if you have this background. There is certainly an alternative proof by comparing exponents of primes, but my kind of argument generalizes better. For example, Lemma 3 above can be straightforwardly generalized to the following result:

Lemma 5. Let $A$ be a commutative ring. Let $X$, $Y$, $Z$ and $W$ be four ideals of $A$ such that $X+Z=A$ and $Y+W=A$. Then, $XY+ZW = \left(Y+Z\right)\left(X+W\right)$.

Lemma 3 can be recovered from Lemma 5 by setting $A = \mathbb Z$, $X = x \mathbb Z$, $Y = y \mathbb Z$, $Z = z \mathbb Z$ and $W = w \mathbb Z$. The proof I gave for Lemma 3 is essentially a proof for Lemma 5, artificially restricted to the case of principal ideals in $\mathbb Z$. Theorem 4 is harder to generalize, since it is not clear what the analogue of (for example) $\dfrac{a}{n}$ is for ideals; but given that it is a corollary of Lemma 3, a point could be made in favor of regarding Lemma 3 as the main theorem.