I am still learning about mathematical proofs and wanted to ask for some feedback, if possible, of my solution for the following problem.
Let $x,y\in \mathbb{Z}$. Prove that $x-y$ is even if and only if $x$ and $y$ are of the same parity.
To prove this I used a Lemma and the following theorem:
Theorem 16 Let $x,y\in \mathbb{Z}$. Then $x$ and $y$ are of the same parity if and only if $x+y$ is even.
My approach was the following:
Lemma If $n\in \mathbb{Z}$, then $n$ and $-n$ are of the same parity.
To prove this lemma we consider two cases.
Case 1. Assume $n$ is even. Then $n=2k$ for some $k\in \mathbb{Z}$. Therefore, $-n=-(2k)=2(-k)$.
Since $-k$ is an integer, it follows that $n$ is even.
Case 2. Let $n$ be odd. Then $n=2k+1$ for some $k\in \mathbb{Z}$. Thus, $-n=-(2k+1)=-2k-1=-2k-2+1=2(-k-1)+1$. Since $-k-1$ is an integer, $-n$ is odd.
We now proceed to prove the result.
Let $x$ and $y$ be of opposite parity. By lemma, $x+(-y)$ is a sum of two integers of opposite parity. Therefore, by theorem 16, $x-y$ is odd.
For the converse, assume $x$ and $y$ are of the same parity. By lemma, $x+(-y)$ is a sum of two integers of the same parity. Therefore, by theorem 16, $x-y$ is even.
Thank you for your attention :).