Euclid's Lemma for Prime Divisors

Lemma
Let $$p$$ be a prime number.

Let $$a$$ and $$b$$ be integers such that:
 * $$p \backslash a b$$

where $$\backslash$$ means "is a divisor of".

Then $$p \backslash a$$ or $$p \backslash b$$.

Some sources use this property to define a prime number.

Generalised Lemma
Let $$p$$ be a prime number.

Let $$\displaystyle n = \prod_{i=1}^r a_i$$.

If $$p$$ divides $$n$$, then $$p$$ divides $$a_i$$ for some $$i$$ such that $$1 \le i \le r$$.

Corollary
Let $$p, p_1, p_2, \ldots, p_n$$ be primes such that:
 * $$\displaystyle p \backslash \prod_{i=1}^n p_i$$

Then:
 * $$\exists i \in \left[{1 \, . \, . \, n}\right]: p = p_i$$

Proof by Induction
For all $$r \in \N^*$$, let $$P \left({r}\right)$$ be the proposition:
 * $$\displaystyle p \backslash \prod_{i=1}^r a_i \implies \exists i \in \left[{1 \, . \, . \, r}\right]: p \backslash a_i$$.

Basis for the Induction
$$P(1)$$ is true, as this just says $$p \backslash a_1 \implies p \backslash a_1$$.

This is our basis for the induction.

Induction Hypothesis
Now we need to show that, if $$P \left({k}\right)$$ is true, where $$k \ge 1$$, then it logically follows that $$P \left({k+1}\right)$$ is true.

So this is our induction hypothesis:


 * $$\displaystyle p \backslash \prod_{i=1}^k a_i \implies \exists i \in \left[{1 \, . \, . \, k}\right]: p \backslash a_i$$

Then we need to show:


 * $$\displaystyle p \backslash \prod_{i=1}^{k+1} a_i \implies \exists i \in \left[{1 \, . \, . \, {k+1}}\right]: p \backslash a_i$$

Induction Step
This is our induction step:

Consider any product of $$k+1$$ integers which is divisible by $$p$$:
 * $$p \backslash a_1 a_2 \cdots a_k a_{k+1}$$

Either $$p$$ divides $$a_{k+1}$$ or it does not.

If $$p$$ divides $$a_{k+1}$$ we have finished.

If $$p$$ does not divide $$a_{k+1}$$, then from GCD with Prime we have:
 * $$\gcd \left\{{p, a_{k+1}}\right\} = 1$$

... that is, $$p \perp a_{k+1}$$.

So we have $$p \backslash \left({a_1 a_2 \cdots a_k}\right) a_{k+1}$$ and $$p \perp a_{k+1}$$.

Hence by Euclid's Lemma we have that $$p \backslash a_1 a_2 \cdots a_k$$.

But then by the induction hypothesis, $$p \backslash a_i$$ for some $$i$$ such that $$1 \le i \le k$$.

So either $$p \backslash a_i$$ for some $$i$$ such that $$1 \le i \le k$$, or $$p \backslash a_{k+1}$$.

That is, $$P \left({k+1}\right)$$ holds.

So $$P \left({k}\right) \implies P \left({k+1}\right)$$ and the result follows by the Principle of Mathematical Induction.

Therefore:
 * $$\displaystyle \forall r \in \N: p \backslash \prod_{i=1}^r a_i \implies \exists i \in \left[{1 \, . \, . \, r}\right]: p \backslash a_i$$

Proof of Corollary
From the main result, $$p \backslash p_i$$ for some $$i$$.

But by definition of prime, the only divisors of $$p_i$$ are $$1$$ and $$p_i$$ itself.

As $$1$$ is not prime, it follows that $$p = p_i$$.

Hence the result.