Some Background
This is from a proof of the existence of inverses modulo m.
Briefly written...
Let $a, m \in \mathbb{Z}$.
Assume $\gcd(a,m)=1$.
By Bezout, $\gcd(a,m)=as+mt=1$ for some $s, t \in \mathbb{Z}$.
Taking$\mod m$ we get
$$ \begin{align} 1 & \equiv as+mt \pmod m && \text{(1)}\\ & \equiv as+0\cdot t \pmod m && \text{(2) since } m\equiv 0 \pmod m \\ & \equiv as && \text{(3)}\\ & \equiv a(s\bmod m) && \text{(4)} \end{align}$$
$\therefore s\bmod m \in \{1,...,m-1\}$ is an inverse of $a$, modulo m.
My Question
My question refers to line (4). How come we are free to replace $s$ by the remainder of $s$ modulo m ($s\bmod m$)? What is the property behind this action?
Thank you.