I have just begun to touch on elementary number theory and one of the first practice problems we received is the following:
We say that an integer $d$ is a divisor of an integer $a$ if there is an integer $n$ such that $a = dn$; ie. if $a$ is an integer multiple of $d$. Write out a careful and complete proof of the following mathematical statement:
Whenever $d$ is a divisor of both $a$ and $b$ then $d^2$ is a divisor of $ab$.
I have managed to devise up this so far however I am not sure whether this is correct nor sufficient:
If $d \mid a$ and $d \mid b$, then there exists some integers $n$ and $m$ such that $a = dn$ and $b = dm$ respectively. Multiplying $a$ and $b$ we get:
$ab = (dn)(dm) = d^2nm$
meaning that $d^2$ must be a divisor of $ab$
This is my first time doing proofs such as this so I am shaky in this subject to say the least. I am wondering whether the proof above is sufficient, could be improved, or is possibly incorrect altogether. If any of that is the case any explanation as to how to properly formalize this proof would be greatly appreciated.