# Prove $\gcd(a,m) \mid \gcd(ab,m)$ $\forall a,b,m \in \Bbb Z$

I named $$\gcd(a,m) = d$$ and $$\gcd(ab,m) = d'$$

So I know that $$d\mid a$$, $$d\mid m$$ and $$d'\mid ab$$ , $$d' \mid m$$

But I can't use the transitive property of divisibility here.

How can I prove that $$d \mid d'$$?

• If $g\mid a$ and $g\mid m$, then $g\mid ab$ and $g\mid m$. – Lord Shark the Unknown Jan 27 at 10:37

For each $$x\mid \gcd(a,m)$$, $$x\mid a,m$$ so $$x\mid ab,m$$ and $$x\mid\gcd(ab,m)$$.