Incorrect logic in popular proof of the irrationality of $\sqrt2$?

That $a$ and $b$ are coprime is not an assumption, it is simply the fact that any rational number can be written in a way so that the numerator and denominator are coprime. The only assumption being made is that $\sqrt 2$ is rational.


You don't need to assume that $a$ and $b$ are coprime.

If $\sqrt 2= a/b$ with $a,b\in \mathbb Z$, then $2b^2=a^2$. Now count the number of factors of $2$ on each side: on the left, you get an odd number of factors of $2$, while on the right you get an even number of factors.


If you like, you an proceed as follows: suppose that $\sqrt{2}$ is rational. Then it may be expressed in the form $\sqrt{2} = \frac{a}{b}$ for positive integers $a$ and $b.$ Choose such a representation with $a$ as small as possible: then $a$ and $b$ can have no common factor greater than $1$, for if $a = ec$ and $b = ed$ for positive integers $c,d,e$ with $e > 1,$ then $\sqrt{2} = \frac{c}{d},$ which is a contradiction since $0 < c < a$.