# If a and b are relatively prime and ab is a square, then a and b are squares.

If $a$ and $b$ are two relatively prime positive integers such that $ab$ is a square, then $a$ and $b$ are squares.

I need to prove this statement, so I would like someone to critique my proof. Thanks

Since $ab$ is a square, the exponent of every prime in the prime factorization of $ab$ must be even. Since $a$ and $b$ are coprime, they share no prime factors. Therefore, the exponent of every prime in the factorization of $a$ (and $b$) are even, which means $a$ and $b$ are squares.

• What is $m$ and $n$ in the last line of your proof? Please define notation when you use them. – Calvin Lin Jan 23 '13 at 0:35
• besides switching to $m$ and $n$ everything else seems fine. – mathemagician Jan 23 '13 at 0:37
• @Ethan I don't think you should have changed the $m$ and $n$, since it cropped up several times. It is a valid critique of OP's proof, and OP did not explain that it was a mistake. – Calvin Lin Jan 23 '13 at 0:41
• @Ethan, it's considered better to let someone edit his/her own post in response to comments. – Gerry Myerson Jan 23 '13 at 0:50
• @GerryMyerson I didn't know my edit would appear automatically, usually it lets them give permission first – Ethan Jan 23 '13 at 0:51

## 3 Answers

Its clear you understand what's going on, but it might help you communicate it more precisely if you use symbols. For example if $a$ has prime factorization $$a = p_1^{l_1} \cdot p_2^{l_2} \cdot \ldots \cdot p_n^{l_n}$$ and $b$ has prime factorization $$b = q_1^{k_1} \cdot q_2^{k_2} \cdot \ldots \cdot q_m^{k_m}$$ then $ab$ has prime factorization $$ab = p_1^{l_1} \cdot p_2^{l_2} \cdot \ldots \cdot p_n^{l_n} \cdot q_1^{k_1} \cdot q_2^{k_2} \cdot \ldots \cdot q_m^{k_m}.$$ There can be no $p_i = q_j$ because $a$ and $b$ are coprime.

Because $ab$ is square, all of the $l_i$ and $k_i$ are even, completing the proof.

• It's worth explicit emphasis that the above proof depends crucially on uniqueness of prime factorizations (not only existence). Do you see where? In rings without such it may fail spectacularly, e.g. one can even have $\, pq = r^2$ for $p,q$ coprime "primes" (i.e. irreducibles). – Math Gems Jan 23 '13 at 1:23

Yes, it suffices to examine the parity of exponents of primes. Alternatively, and more generally, one can use gcds to explicitly show $\rm\:a,b\:$ are squares. Writing $\,\rm(m,n,\ldots)\:$ for $\rm\: gcd(m,n,\ldots)$ we have:

Theorem $\rm\ \ \color{#C00}{c^2 = ab}\, \Rightarrow\ a = (a,c)^2,\ b = (b,c)^2\:$ if $\rm\ \color{#0A0}{(a,b,c)} = 1\$ and $\rm\:a,b,c\in \mathbb N$

Proof $\rm\ \ \ \ (a,c)^2 =\: (a^2,\color{#C00}{c^2},ac)\: =\: (a^2,\color{#C00}{ab},ac)\: =\: a\,\color{#0A0}{(a,b,c)} = a.\:$ Similarly $\rm \,(b,c)^2 = b.\ \$ QED

Yours is the special case $\rm\:(a,b) = 1\ (\Rightarrow\ (a,b,c) = 1)$. The above proof uses only universal gcd laws (associative, commutative, distributive), so it generalizes to any gcd domain/monoid (where, generally, prime factorizations need not exist, hence the above proof is more general).

The conclusion you drew from $a$ and $b$ being coprime is not true:

"Since a and b are coprime, they share no prime factors. Therefore, the exponent of every prime in the factorization of a (and b) are even"

For example $6$ and $5$ are relatively prime, and none of their exponents are even.

Here is a valid proof using some of your reasoning,

Consider the exponents of the primes in the factorization of both $a$ and $b$, since $a$ and $b$ share no common prime factors, their product will not change the value of their original exponents, therefore the only way for all the exponents to be divisible by 2, is if they were originally divisible by 2, which implies they are both squares.

• My assertion that "the exponent of every prime in the factorization of a (and b) are even" rests on the fact that a, b are coprime and ab is a square. What more justification do I need? – user59298 Jan 23 '13 at 0:57
• The co-primality of $a$ and $b$ doesn't effect the parity of the exponents appearing in the factorization of $a$ and $b$ – Ethan Jan 23 '13 at 1:00
• The co-primality of a and b is part of the reason (along with ab being a square) why the parity of the exponents appearing in the factorization of a and b are even. – user59298 Jan 23 '13 at 1:07
• When I write "therefore", that means what follows is a consequence of everything I know up to that point, not necessarily limited to the preceding sentence. Sorry if I wasn't clear. – user59298 Jan 23 '13 at 1:19