Numerator and denominator of rational number

proof-writingrational numbersreal-analysis

I have to prove that $\sqrt5$ is irrational.

I prove it by contradiction. I assume that $p$ is an integer and $q$ is a positive integer such that $gcd(p,q)=1$ and $(\frac{p}{q})^2 = 5$. And then proceed with the proof.

But my textbook suggests that, "assume that $p$ and $q$ are positive integers such that…. "

My question is, is it necessary that $p$ is a 'positive' integer, when $\frac{p}{q}$ is a rational number?

These minor details are very important in real analysis. So, please help me clear this doubt. Thanks in advance.

Best Answer

It is not - for example, $\frac{-1}{2}$ is rational number.

However, in this case we can assume $p$ is positive: if $p$ is negative, take $\frac{-p}{q}$ instead, as $\left(\frac{p}{q}\right)^2 = \left(\frac{-p}{q}\right)^2$.