Let $\displaystyle k,n$ be integers such that $\displaystyle 1 <= k <= n <= p-1$ where $\displaystyle p is prime$.

Assume $\displaystyle (a,p) = 1$.

Show that $\displaystyle ak \equiv an mod p$ iff$\displaystyle k = n$.

Proof:

$\displaystyle ak \equiv an mod p$

$\displaystyle k \equiv n mod p$ (since $\displaystyle (a,p) = 1$)

Then I used a Lemma that states:

Let$\displaystyle i $and $\displaystyle j$ be integers with $\displaystyle 1 <= i <= j <= m$. If $\displaystyle i \equiv j mod m$, then $\displaystyle i = j$.

Where I use $\displaystyle i = k$, $\displaystyle j = n$, and $\displaystyle m = p$. So that gives $\displaystyle k = n$. My question is, am I allowed to use the theorem if the equivalences are 1 off?:

$\displaystyle 1 <= k <= n <= p-1$ Proof

$\displaystyle 1 <= i <= j <= m$ Lemma

Thanks