# Proof: If no prime less than or equal to $\sqrt{n}$ divides $n$, then $n$ is a prime [duplicate]

I have the following theorem:

If no prime less than or equal to $\sqrt{n}$ divides $n$, then $n$ is a prime.

And the following proof (proof by contradiction) for said theorem:

Suppose that no prime less than or equal to $\sqrt{n}$ divides $n$ but $n = ab$, with neither $a$ nor $b$ equal to $1$.

Now $a$ and $b$ cannot both be strictly larger than $\sqrt{n}$ or their product would be larger than $n$.

So one of $a$ or $b$ is not larger than $\sqrt{n}$: assume (without loss of generality) that $a \le \sqrt{n}$.

Now $a$ cannot be prime (as we have assumed $n$ has no prime factor this small), and so is composite.

Therefore $a$ has a prime factor $p$, which must be less than $a$.

But then $p < a \le \sqrt{n}$ is a prime factor of $n$, and this contradicts our hypothesis.

Hence $n$ is prime.

We deduce that $a$ is composite. But why does this then mean that $a$ has a prime factor $p$? So this is saying that all composite numbers have a prime factor? Why?

I would greatly appreciate it if people could please take the time to clarify this.

PostScript: I am assuming that this is the definition of composite number being used here.

## marked as duplicate by lab bhattacharjee elementary-number-theory StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Aug 14 '18 at 11:35

• Any integer, composite or not, which is greater than $1$ has prime factors. Is this not obvious to you? – Arthur Aug 14 '18 at 11:23
• @Sudix Maybe. It's not very difficult to prove, though. The smallest divisor $a$ (apart from $1$) of any given natural number $n>1$ has to be prime because the divisors of $a$ will also be divisors of $n$, and $n$ has no divisors smaller than $a$, so $a$ can't have any divisors smaller than $a$ either. – Arthur Aug 14 '18 at 11:41
We have assumed $a>1$ (See the first line) and we have show it cannot be prime (otherwise $n$ has a prime factor $\leq\sqrt n$).
Typically, the definition of composite is that the number can be written as the product of more than one prime (that is, is greater than $1$ and isn’t prime). This follows from the Fundamental Theorem of Arithmetic.