You dont prove p is the smallest term. The fact is that since S in contained in the positive integers then there exists a least term due to the well ordering principle. So if you take this least term and do all this stuff...

...if we show that p is prime number then the proof is over. from here; assume contrary that p is not prime then p=q.r and there can be found at least one q,r (element) Z such that 1<q<p. and q|p and p|a -->q|a and q (element) S and this contradicts witht the assumption of p be the smallest element of S since p is prime...

Then you show that this least element has prime divisors, hence if you take ANY set S containing ANY elements in the positive integers then the least term has prime divisors, hence every element in the positive integers has prime divisors.

For example take the set A that is the set S without S's least term, then by applying the same argument as above the least element of A has prime divisors...

Then the set B = A without A's least term, same argument... So B's least term has prime divisors, etc...