Prove if $7\mid a^2+b^2 \longrightarrow 7\mid a$ and $7\mid b$
What I did:
I found the possible remainders for $a^2$ are $0, 1, 2$ and $4$.
I think I should say $r_7(a^2)+r_7(b^2)$ can't equal any multiple of $7$ unless both of them are $0$?
And if both of them are $0$, that implies $r_7(a)=0$ and $r_7(b)=0$
Am I correct? How can I explain this in mathy terms?
The way to express your ideas formally is to use modular arithmetic. To say that the possible remainders for $a^2$ are $0,1,2$, and $4$ is to say that $$ a^2 \equiv 0,1,2,4 \pmod 7. $$ The same is true for $b^2$, and $7|a^2 + b^2$ if and only if $a^2 + b^2 \equiv 0 \pmod 7$. But notice that if $i,j\in \{0,1,2,4\}$, then $i+j \equiv 0 \pmod 7$ if and only if $i=j=0$.