Prove if $n^2$ is even, then $n^2$ is divisible by 4

I am working on this question

Prove for every integer n if $n^2$ is even, then $n^2$ is divisible by 4.

prove by contradiction

Proof:

Since there exists an integer $n$ such that $n^2$ is even, and $n^2$ is not divisible by 4,

when $n$ is odd integer, we have $n = 2k + 1$ where $k \in \mathbb{Z}$,

then $n^2 = 4k^2 + 4k + 1$, because $n^2$ is odd which is a contradiction;

when $n$ is even integer, we have $n = 2j$ where $j \in\mathbb{Z}$,

then $n^2 = 4j^2 \Rightarrow n^2 | 4$, because $n^2$ is divisible by $4$, this is a contradiction; therefore, for every integer $n$, if $n^2$ is even, then $n^2$ is divisible by $4$.

Is my proof valid or can anyone give me hint or suggestion to write a better proof?

Thanks!


Solution 1:

$$n^2\text{ even }\implies \text{n is even, hence:}$$$$n=2m,m\in\Bbb Z, n^2=4m^2\implies 4|n^2$$

Solution 2:

Proof: Suppose $n,m\in\mathbb{Z}$. Then $$ n^2\neq [4m = 2(2m)].\;\blacksquare\tag{1} $$


There are really three "core methods" of proof one is likely to use in order to prove your statement: direct, contradiction, and contraposition. You will most often see such a proof proceed directly because this is generally the most natural (i.e., "direct") way of going about it, but let's check out the options:

Direct: See the answer provided by @Committingtoachallenge.

Contradiction: See your own answer (it's correct, but it could be written up much more neatly).

Contraposition: See $(1)$. I'm surprised no one gave this answer because I think it is definitely the easiest / most elegant way of proving it. The idea behind a proof by contraposition is to show that if $n^2$ is not divisible by $4$, then $n^2$ is not even (recall that $p\to q\equiv \neg q\to \neg p$; that is, $\neg q\to\neg p$ is the contrapositive of $p\to q$, where these two statements are equivalent. Hence, if we can prove the contrapositive, then we will have proven your original statement.).