User:TheNothingNihilates/sandbox

Uniqueness without Euclid's lemma
The Fundamental Theorem of Arithmetic (FTA) can also be proved without using Euclid's lemma. The proof begins by assuming that the FTA is not true, and shows that this leads to a contradiction.

Assume, then, that the FTA is false, and that there exist numbers with more than one factorization as a product of primes. Let $$s$$ be the smallest such number which can be expressed as the product of prime numbers in two different ways. (Note that since $$s$$ is the smallest such number, all smaller numbers $$> 2$$ will have a unique prime factorization.)

$$ s = p_1 p_2 \cdots p_m = q_1 q_2 \cdots q_n. $$

Since the order of multiplication makes no difference, we can assume these products of primes are in order by size, so that $$p_1 \le p_2 \le \cdots \le p_m $$ and $$q_1 \le q_2 \le \cdots \le q_n $$

We may assume without loss of generality that $$p_1 \le q_1$$. Furthermore, every $$p_i$$ must be distinct from every $$q_j$$, since otherwise, if $$p_i=q_j$$, we could divide both products by $$p_i=q_j$$ to derive two distinct prime factorizations for a number smaller than $$s$$, contradicting our definition of $$s$$. In particular, $$p_1 \ne q_1$$. Hence $$p_1 < q_1$$.

Let $$P=p_2\cdots p_m$$ and $$Q=q_2\cdots q_n$$.

I.e. $$s=p_1P=q_1Q$$.

Since both $$P$$ and $$Q$$ are less than $$s$$, the prime factorizations in their definitions are unique.

Let $$t = (q_1-p_1)Q$$

Then, $$ t = s - p_1Q = p_1P - p_1Q = p_1(P - Q)$$.

Clearly, $$t < s$$, since $$t = (q_1 - p_1)Q < q_1Q = s$$. Therefore, $$t$$ has a unique prime factorization. It consists of the primes whose product is $$Q$$, and the prime factors of $$q_1 - p_1$$. Since $$t = p_1(P - Q)$$, $$p_1$$ is one of these primes in the unique factorization of $$t$$. Since $$p1$$ is smaller than $$q1$$, and $$q1$$ is less than or equal to all the primes in the factorization of $$Q$$, $$p1$$ is not one of those primes whose product is $$Q$$. Thus $$p_1$$ must be a factor of $$q_1 - p_1$$, which means it must be a factor of $$q_1$$. This is not possible since $$q_1$$ and $$p_1$$ are distinct primes. Contradiction.