# 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 $\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

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

This is Mine 12,3th Post!!!

3. yeah I started my proof trying to get it to show$\displaystyle 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!