<s>[INST] Proof for $\forall x\in \mathbb{Z}^+, \exists t \in \mathbb{Z}, 5 \nmid x \to ((x^2= 5t + 1) \vee (x^2 = 5t – 1))$ I am trying to write a proof for the following: If $x$ is a positive integer that is not divisible by $5$, then $x^2$ can be written either as $x^2 = 5t+1$ or $x^2 = 5t−1$ for some integer $t$. So far, I have managed to get that if $x$ is not divisible by $5$, then it is one of the following cases, where $n$ represents a positive integer: 
\begin{align*}
x & = 5n + 1\\
x & = 5n + 2\\
x & = 5n + 3\\
x & = 5n + 4
\end{align*}
I have tried substituting for $x$, but with two different variables $n$ and $t$ and everything, I'm not sure how I would prove they can be equal. Any help would be much appreciated. Thank you!
 [/INST] Once you get that far, just check every case:
$x = 5n+1$:
$$x^2 = 25n^2 - 10n + 1 = 5(5n^2 + 2n) + 1 = 5k + 1$$
$x = 5n + 2$:
$$x^2 = 25n^2 + 20n + 4 = 25n^2 + 20n + 5 - 1 = 5(5n^2 + 4n + 1) - 1 = 5t - 1$$
$x = 5n + 3$:
$$x^2 = 25n^2 + 30n + 9 = 25n^2 + 30n + 10 - 1 = 5(5n^2 + 6n + 2) -1 = 5l - 1$$
$x = 5n + 4$:
$$x^2 = 25n^2 + 40n + 16 = 25n^2 + 40n + 15 + 1 = 5(5n^2 + 8n + 3) + 1 = 5m + 1$$
$k,t,l,m$ are all positive integers.
</s>