using the inverse of a for negative x. Since ar≡1, f(x+r)=f(x). Conversely, if f(x)=f(y) then ax−y≡1, so the definition of order gives r∣x−y. Two integers in the same block of r consecutive integers cannot differ by a nonzero multiple of r. Hence f is one-to-one within each period.