Metamath Proof Explorer


Theorem prmgapprmo

Description: Alternate proof of prmgap : in contrast to prmgap , where the gap starts at n! , the factorial of n, the gap starts at n#, the primorial of n. (Contributed by AV, 15-Aug-2020) (Revised by AV, 29-Aug-2020) (Proof modification is discouraged.) (New usage is discouraged.)

Ref Expression
Assertion prmgapprmo n p q n q p z p + 1 ..^ q z

Proof

Step Hyp Ref Expression
1 id n n
2 eqid j k = 1 j m if m m 1 k = j k = 1 j m if m m 1 k
3 fzfid j 1 j Fin
4 eqidd j k 1 j m if m m 1 = m if m m 1
5 eleq1 m = k m k
6 id m = k m = k
7 5 6 ifbieq1d m = k if m m 1 = if k k 1
8 7 adantl j k 1 j m = k if m m 1 = if k k 1
9 elfznn k 1 j k
10 9 adantl j k 1 j k
11 1nn 1
12 11 a1i k 1 j 1
13 9 12 ifcld k 1 j if k k 1
14 13 adantl j k 1 j if k k 1
15 4 8 10 14 fvmptd j k 1 j m if m m 1 k = if k k 1
16 15 14 eqeltrd j k 1 j m if m m 1 k
17 3 16 fprodnncl j k = 1 j m if m m 1 k
18 2 17 fmpti j k = 1 j m if m m 1 k :
19 nnex V
20 19 19 elmap j k = 1 j m if m m 1 k j k = 1 j m if m m 1 k :
21 18 20 mpbir j k = 1 j m if m m 1 k
22 21 a1i n j k = 1 j m if m m 1 k
23 prmgapprmolem n i 2 n 1 < # p n + i gcd i
24 eqidd n i 2 n j k 1 j m if m m 1 = m if m m 1
25 7 adantl n i 2 n j k 1 j m = k if m m 1 = if k k 1
26 9 adantl n i 2 n j k 1 j k
27 elfzelz k 1 j k
28 1zzd k 1 j 1
29 27 28 ifcld k 1 j if k k 1
30 29 adantl n i 2 n j k 1 j if k k 1
31 24 25 26 30 fvmptd n i 2 n j k 1 j m if m m 1 k = if k k 1
32 31 prodeq2dv n i 2 n j k = 1 j m if m m 1 k = k = 1 j if k k 1
33 32 mpteq2dva n i 2 n j k = 1 j m if m m 1 k = j k = 1 j if k k 1
34 oveq2 j = n 1 j = 1 n
35 34 prodeq1d j = n k = 1 j if k k 1 = k = 1 n if k k 1
36 35 adantl n i 2 n j = n k = 1 j if k k 1 = k = 1 n if k k 1
37 simpl n i 2 n n
38 fzfid n i 2 n 1 n Fin
39 elfznn k 1 n k
40 11 a1i k 1 n 1
41 39 40 ifcld k 1 n if k k 1
42 41 adantl n i 2 n k 1 n if k k 1
43 38 42 fprodnncl n i 2 n k = 1 n if k k 1
44 33 36 37 43 fvmptd n i 2 n j k = 1 j m if m m 1 k n = k = 1 n if k k 1
45 nnnn0 n n 0
46 prmoval n 0 # p n = k = 1 n if k k 1
47 45 46 syl n # p n = k = 1 n if k k 1
48 47 eqcomd n k = 1 n if k k 1 = # p n
49 48 adantr n i 2 n k = 1 n if k k 1 = # p n
50 44 49 eqtrd n i 2 n j k = 1 j m if m m 1 k n = # p n
51 50 oveq1d n i 2 n j k = 1 j m if m m 1 k n + i = # p n + i
52 51 oveq1d n i 2 n j k = 1 j m if m m 1 k n + i gcd i = # p n + i gcd i
53 23 52 breqtrrd n i 2 n 1 < j k = 1 j m if m m 1 k n + i gcd i
54 53 ralrimiva n i 2 n 1 < j k = 1 j m if m m 1 k n + i gcd i
55 1 22 54 prmgaplem8 n p q n q p z p + 1 ..^ q z
56 55 rgen n p q n q p z p + 1 ..^ q z