Solution (source code)

= Solution
{c}

The set $S_n$ is nonempty because $n\in S_n$. By the <well-ordering principle> for the <natural numbers>, it has a least element $p$. In particular $p>1$ and $p$ divides $n$.

If $p$ were not a <prime number>, it would have a positive <integer divisor> $d$ with $1<d<p$. Since $d$ divides $p$ and $p$ divides $n$, <divisibility> is transitive and $d$ divides $n$. This would put $d$ in $S_n$, contradicting the minimality of $p$. Hence $\boxed{p\text{ is prime}}$.