# Thread: Wondering if a difference of 1 in a relation affects my proof

1. ## Wondering if a difference of 1 in a relation affects my proof

Let $k,n$ be integers such that $1 <= k <= n <= p-1$ where $p is prime$.
Assume $(a,p) = 1$.
Show that $ak \equiv an mod p$ iff $k = n$.

Proof:
$ak \equiv an mod p$
$k \equiv n mod p$ (since $(a,p) = 1$)

Then I used a Lemma that states:
Let $i$and $j$ be integers with $1 <= i <= j <= m$. If $i \equiv j mod m$, then $i = j$.

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

Thanks

2. Originally Posted by Th3sandm4n
Proof:
$ak \equiv an mod p$
$k \equiv n mod p$ (since $(a,p) = 1$)
Once you know $k\equiv n(\bmod p)$ it would follow that $k=n$. This is because $k\leq n$ and so $0\geq 0 n-k. The only way for $n-k$ to be divisible by $p$ is for $n-k = 0\implies n=k$.

This is Mine 12,3th Post!!!

3. yeah I started my proof trying to get it to show $n-k = 0$ but then saw the Lemma and thought that would show it better. Thank you for the clearer explanation though, and congrats on the posts, that is a lot of helping!