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 n p q n q p z p + 1 ..^ q z

Proof

Step Hyp Ref Expression
1 id n n
2 facmapnn x x !
3 2 a1i n x x !
4 prmgaplem2 n i 2 n 1 < n ! + i gcd i
5 eqidd n i 2 n x x ! = x x !
6 fveq2 x = n x ! = n !
7 6 adantl n i 2 n x = n x ! = n !
8 simpl n i 2 n n
9 fvexd n i 2 n n ! V
10 5 7 8 9 fvmptd n i 2 n x x ! n = n !
11 10 oveq1d n i 2 n x x ! n + i = n ! + i
12 11 oveq1d n i 2 n x x ! n + i gcd i = n ! + i gcd i
13 4 12 breqtrrd n i 2 n 1 < x x ! n + i gcd i
14 13 ralrimiva n i 2 n 1 < x x ! n + i gcd i
15 1 3 14 prmgaplem8 n p q n q p z p + 1 ..^ q z
16 15 rgen n p q n q p z p + 1 ..^ q z