I'm learning mathematical proofs, and here I'm trying to prove that $\sqrt{p}$ is irrational, where $p$ is a prime number.
Usually, the statement is proven by contradiction, assuming $\sqrt{p}$ is rational and there exist $m,n \in N$ without common factors such that $\sqrt{p}=\frac{m}{n}$, then showing that $p$ must divide both numerator and denominator, which contradicts the assumption that $m,n$ have no common factors.
Here, my proof is slightly different:
- Assume $p$ is a prime, $\sqrt{p}$ is rational.
- Then there must be $m,n \in N$ without common factors such that $\sqrt{p}=\frac{m}{n}$.
- Square both sides. $p=\frac{m^2}{n^2}$
- All prime numbers are integers. Therefore, $p$ is an integer.
- If $p$ is an integer and $m,n$ have no common factors, then the denominator ($n^2$) must be equal to $1$.
- If $n^2=1$, then $p=m^2$.
- But that contradicts the assumption that $p$ is a prime number. Therefore, the assumption that $\sqrt{p}$ is rational must be false.
- Hence, $\sqrt{p}$ is irrational.
I'm not sure whether the steps 5-6 are logically correct. Are they? Overall, is the proof valid? If not, why?