Metamath Proof Explorer


Theorem prmgap

Description: The prime gap theorem: for each positive integer there are (at least) two successive primes with a difference ("gap") at least as big as the given integer. (Contributed by AV, 13-Aug-2020)

Ref Expression
Assertion prmgap npqnqpzp+1..^qz

Proof

Step Hyp Ref Expression
1 id nn
2 facmapnn xx!
3 2 a1i nxx!
4 prmgaplem2 ni2n1<n!+igcdi
5 eqidd ni2nxx!=xx!
6 fveq2 x=nx!=n!
7 6 adantl ni2nx=nx!=n!
8 simpl ni2nn
9 fvexd ni2nn!V
10 5 7 8 9 fvmptd ni2nxx!n=n!
11 10 oveq1d ni2nxx!n+i=n!+i
12 11 oveq1d ni2nxx!n+igcdi=n!+igcdi
13 4 12 breqtrrd ni2n1<xx!n+igcdi
14 13 ralrimiva ni2n1<xx!n+igcdi
15 1 3 14 prmgaplem8 npqnqpzp+1..^qz
16 15 rgen npqnqpzp+1..^qz