# Proof confirmation: If $\gcd(u,v)=1$ and $uv$ is a square, then $u$ and $v$ are squares.

This is a problem from my workbook(not homework), and I can tell that it is true simply upon observation(They share no factors[other than one] and they, when multiplied have all squares as their unique prime factorization, hence they must have all squares as prime factors, which makes $u,v$ squares.)

I am not completely practiced at proofs, so I just want to check that this is rigorous, an if it isn't please advise me as to how I can make it rigorous, enough of my ramblings:

If $\gcd(u,v)=1$ and $uv$ is a square, then $u$ and $v$ are squares.

Proof

If $\gcd(u,v) = 1$ then $u=p_1^{a_1}p_2^{a_2} \dots p_k^{a_k}$, $v=q_1^{b_1}q_2^{b_2} \dots q_l^{b_l}$ where $\forall p,q \;\;, p \ne q$

$uv =p_1^{a_1}q_1^{b_1}p_2^{a_2}q_2^{b_2} \dots p_k^{a_k}q_l^{b_l}$, but $uv$ is a square, hence $u = p_1^{2c_1}p_2^{2c_2} \dots p_k^{2c_k} \;\; , v=q_1^{2d_1}q_2^{2d_2} \dots q_l^{2d_l}$ and thus $u,v$ are clearly both squares.

Thank you for your time, and please try to understand the pain I endured coding those prime factors in $\LaTeX$ on a tablet pc.

• Your proof is basically correct. I'd stress the fact that since $\;uv\;$ is a square, then all of $\;a_i,b_i\;$ must be even... – DonAntonio May 3 '14 at 12:07
• But $\gcd(-4,-9)=1$ and $(-4)(-9)$ is a square and yet neither $-4$ nor $-9$ are squares. – Hagen von Eitzen May 3 '14 at 12:22
• @Hagen They are squares in $\Bbb Z[i]$ ;-) – ajotatxe May 3 '14 at 12:28
• @HagenvonEitzen, I'm guessing the question was intended in the naturals, not in the integers... – DonAntonio May 3 '14 at 13:09
• @HagenvonEitzen Yes, the naturals, my apologies. – Display Name May 3 '14 at 23:25

Your proof is correct. But perhaps it can be shortened/clarified using a function that comes often in handy in number-theory. For each prime $p$, let be $\nu_p(n)$ the greatest integer $\alpha$ such that $p^\alpha$ divides $n$.
So, we only have to prove that $\nu_p(u)$ is even for each prime $p$ (since if $uv$ and $u$ are perfect squares, clearly so is $v$). So let $p$ be any prime.
$$\nu_p(uv)=\nu_p(u)+\nu_p(v)$$
If $\nu_p(u)=0$, is even. If not, then $\nu_p(v)=0$ since $\gcd(u,v)=1$. Hence, $\nu_p(u)=\nu_p(uv)$, which is also even q. e. d.