If $a^2+b^2=c^2$ then $a$ or $b$ is even. I am having trouble proving this directly. I know that it is easy to prove by contradiction by assuming both $a$ and $b$ to be odd, but how should I start to try to prove this? This is a homework problem and I am just looking for help getting started, not the full answer.
 A: Hint: every odd perfect square is of the form $4m+1$.
A: We will assume two lemmas:


*

*For all integers $d$, $d^2-d$ is even.

*For integers $a,b$, if $ab$ is even, then one of $a,b$ is even.


We can deduce from lemma 1 and that $a^2+b^2=c^2$ that $a+b\equiv c\pmod {2}$. Since $c\equiv -c\pmod{2}$, we have that $a+b\equiv -c\pmod{2}$. This means that $$4\mid (a+b-c)(a+b+c)=(a+b)^2-c^2 = a^2+b^2-c^2 + 2ab=2ab$$
Since $4\mid 2ab$, you have that $2\mid ab$. So one of $a,b$ must be even by Lemma 2.
Lemma 1 can be proven by induction.
I think we are hiding the indirect part of the proof in Lemma 2. It is how the rest of the proof avoids proving an "or" statement, and avoids breaking it up into cases - by treating "$a$ is even or $b$ is even" as implied by "$ab$ is even."
A: It's a bit of a fine line between proving directly and by contradiction. Try breaking it into cases, such as
Suppose $c^2$ is even/odd and WLOG $b$ is odd, then show that $a$ must be even.
Since the conclusion isn't a contradiction, but rather that $a$ is even, this is a direct proof. You should end with something like $a = 2*n$ where $n$ is an integer (definition of even).
It might help if you have a theorem that says that $a$ and $a^2$ have the same parity. Maybe worth a lemma.
A: Unrolling @ajotatxe's one-sentence proof
Auxiliary claim: Every odd perfect square is of the form $4m + 1$.
Proof. $(2k + 1)^2 = 4(k^2 + k) + 1 = 1 (\text{ mod } 4)$. Also note the elementary fact that an integer is odd iff its square is odd. $\quad \quad \quad \Box$
Now, if $c^2 = a^2 + b^2$ with both  $a$ an $b$ odd, then $c^2 = 1 +  1 = 2 (\text{ mod } 4)$, a contradiction, since the only squares modulo $4$ are $0$ and $1$. $\quad \quad \quad \Box$
