Wilson's Theorem: (n-1)! is congruent to -1(mod n) implies that n is prime. I have researched Wilson's theorem several times over stack exchange. I would only like to prove one direction. This seems to be a good explanation: Prove that $(n-1)! \equiv -1 \pmod{n}$ iff $n$ is prime
However, on their explanation, the author states that $k|(n-1)!$ implies that $k$ is congruent to $1$(mod $n$). I don't see their jump in logic. I am looking for either an explanation or a reference to a theorem if possible. Any assistance is appreciated. Thank you

This isn't true in general. For example, $2 | (3-1)! = 2$ but $2$ is not congruent to $1 \pmod 3$. What the author on the question you referenced said was that from the conditions in Wilson's Theorem, $k | (n-1)!$ and also $k$ is congruent to $1 \pmod n$, not that $k | (n-1)!$ implies $k$ is congruent to $1 \pmod n$. 
