[Math] Proof: $n^2 – 2$ is not divisible by 4

proof-verification

I tried to prove that $n^2 – 2$ is not divisible by 4 via proof by contradiction. Does this look right?

Suppose $n^2 – 2$ is divisible by $4$. Then:

$n^2 – 2 = 4g$, $g \in \mathbb{Z}$.
$n^2 = 4g + 2$.

Consider the case where $n$ is even.

$(2x)^2 = 4g + 2$, $x \in \mathbb{Z}$.

$4x^2 = 4g + 2$.

$4s = 4g + 2$, $s = x^2, s \in \mathbb{Z}$ as integers are closed under multiplication.

$2s = 2g + 1$

$2s$ is even, and $2g + 1$ is odd (by definition of even/odd numbers). An even number cannot equal an odd number, so we have a contradiction.

Consider the case where $n$ is odd.

$(2x + 1)^2 = 4g + 2$, $x \in \mathbb{Z}$

$4x^2 + 4x + 1 = 4g + 2$

$4x^2 + 4x = 4g + 1$

$4(x^2 + x) = 4g + 1$

$4j = 4g + 1$, $j = x^2 + x, j \in \mathbb{Z}$ as integers are closed under addition

$2d = 2e + 1$, $d = 2j, e = 2g; d, e \in \mathbb{Z}$ as integers are closed under multiplication

$2d$ is even, and $2e + 1$ is odd (by definition of even/odd numbers). An even number cannot equal an odd number, so we have a contradiction.

As both cases have a contradiction, the original supposition is false, and $n^2 – 2$ is not divisible by $4$.

Best Answer

Your proof is perfect.

We can shorten your proof by for example going from $4x^2=4g+2$ (in case 1) to saying "The left-hand side has remainder $0$ after division by $4$, yet the right side has remainder $2$; this is impossible" (basically, looking at the expression $\mod 4$ instead of dividing by $2$ and looking $\mod 2$).

Also, the second case was trivially impossible, since $n^2=4g+2$ has no solutions if $n$ is odd (since then $n^2$ is odd, but $4g+2$ is even).

Depending on the context (what you know, what you can use, etc), steps like $x^2+x=j$ with the remark that integers are closed under addition and multiplication are mostly considered so trivial that it's not worth mentioning. I repeat however that this is completely dependent on context, and if you want to make sure your audience is aware of these facts and/or steps, you should mention them. More detailed explanations with steps rarely hurt the proof.


The proof can be done a lot quicker however (without contradiction) by looking $\mod 4$. It is quite easy to prove that squares are either $0$ or $1\mod 4$, so $n^2-2$ is either $-2$ or $-1\mod 4$, and thus, $n^2-2$ cannot be divisible by $4$.