Simple question about number theory in CLRS book This is theorem 11.5 from CLRS book.
Suppose $a\in \mathbb{Z}^*_p, b\in \mathbb{Z}_p$.
Consider two distinct keys $k$ and $l$ from $\mathbb{Z}_p$, so that $k \neq l$. For a given
hash function $h_{ab}$ we let
$$r =ak +b\mod p $$
$$s =al +b\mod p $$
We first note that $r \neq s$. Why? Observe that
$$r-  s \equiv a(k-l) \pmod p. $$
I'm not very well familiar with Number Theory, so my question is why
$$r-  s \equiv a(k-l) \pmod p $$
is correct?
 A: I’m turning my comment into an answer. If $r=ak+b$ mod $p$, and $s=al+b$ mod $p$, then $r-s=(ak+b)-(al+b)$ mod $p$, thus $r-s=ak-al$ mod $p$, hence $r-s=a(k-l)$ mod $p$.
A: Everything @Mindlack said, plus some explanations, since the fact that you said you are not so familiar with Number Theory.

According to Knuth's definition for the $\bmod{}$ operation, we have
\begin{align*}
a \bmod{} n = a-n \lfloor{}\frac{a}{n}\rfloor{}
\end{align*}
And with the general definition of Congruence, $a \equiv{} b \pmod{n}$ can be rewritten as
\begin{align*}
a-b=kn
\end{align*}
We then have
\begin{align*}
r &= ak+b \bmod{p} = ak+b - p \lfloor{}\frac{ak+b}{p}\rfloor{} \\
s &= al+b \bmod{p} = al+b - p \lfloor{}\frac{al+b}{p}\rfloor{} 
\end{align*}
Subtract $r$ by $s$, we have
\begin{align*}
r-s = a(k-l) - p \left( \lfloor{}\frac{ak+b}{p}\rfloor{} + \lfloor{}\frac{al+b}{p}\rfloor{} \right) \tag{A}
\end{align*}
With the definition of congruence quoted above, we can then rewrite (A) as
\begin{align*}
r-s \equiv{} a(k-l) \pmod{p}
\end{align*}
Hope this eliminates your doubts.
