Suppose there are only finitely many primes. [this is a premise. Note the use of “suppose.”]
There must be a largest prime, call it \(p\text{.}\) [follows from line 1, by the definition of “finitely many.”]
Let \(N = p! + 1\text{.}\) [basically just notation, although this is the inspired part of the proof; looking at \(p! + 1\) is the key insight.]
\(N\) is larger than \(p\text{.}\) [by the definition of \(p!\)]
\(N\) is not divisible by any number less than or equal to \(p\text{.}\) [by definition, \(p!\) is divisible by each number less than or equal to \(p\text{,}\) so \(p! + 1\) is not.]
The prime factorization of \(N\) contains prime numbers greater than \(p\text{.}\) [since \(N\) is divisible by each prime number in the prime factorization of \(N\text{,}\) and by line 5.]
Therefore \(p\) is not the largest prime. [by line 6, \(N\) is divisible by a prime larger than \(p\text{.}\)]
This is a contradiction. [from line 2 and line 7: the largest prime is \(p\) and there is a prime larger than \(p\text{.}\)]
Therefore there are infinitely many primes. [from line 1 and line 8: our only premise lead to a contradiction, so the premise is false.]