# Prove that if $a|b$ and $c|d$, then $gcd(a,c)|gcd(b,d)$

So far I have that $a|b$ implies $b=ax$ for some x in the integers and $c|d$ implies that $d=cy$ for some y in the integers. From here I can see that $gcd(a,c)|gcd(b,d)$ is logically equivalent to $gcd(a,c)|gcd(ax,cy)$ but I am not sure where to go from there.

• Well, let $m=\gcd(a,c)$. Then $m$ divides both $b$ and $d$ so... – lulu Mar 23 '18 at 21:24

If $a\mid b$ and $c\mid d$, then, since $\gcd(a,c)\mid a$ and $a\mid b$, $\gcd(a,c)\mid b$. For the same reason, $\gcd(a,c)\mid d$. So, since $\gcd(a,c)$ divides both $b$ and $d$, it divides $\gcd(b,d)$.