Proving by Contrapositive

discrete mathematicslogic

I am given this statement … Use a proof by contrapositive to show that if n is an integer and n^2 is odd, then n
must be odd.

Since its prove by contrapositive I have to to assume the negation. which is Assuming n is an even integer and that n^2 is even as well. By definition n could be represented as 2k (2 for some k). To proof the statement do i just plug in 2k and square it to show that by definition it is even and not odd?

Best Answer

The contrapositive to a statement "$P$ implies $Q$" is "not $Q$ implies not $P$". Symbolically,

$$(P \implies Q) \iff (\neg Q \implies \neg P)$$

That is, you not only assume the negation but you effectively swap around what implies what.

Thus, if you are trying to prove "if $n$ is an integer with $n^2$ odd, then $n$ is odd", then the contrapositive is "if $n$ is an even integer, then $n^2$ is even." This is basically what you said, but notice how it is a little more nuanced than simply negating the statement. (Above, $P$ can be taken as "$n^2$ is odd" and $Q$ as "$n$ is odd.")

To prove this statement, you can thus indeed say $n=2k$ for some integer $k$, and then show $2$ divides $n^2$, making it even. This follows quite easily, as...

$$n^2 = (2k)^2 = 4k^2 = 2(2k^2)$$