Metamath Proof Explorer


Theorem ppidif

Description: The difference of the prime-counting function ppi at two points counts the number of primes in an interval. (Contributed by Mario Carneiro, 21-Sep-2014)

Ref Expression
Assertion ppidif N M π _ N π _ M = M + 1 N

Proof

Step Hyp Ref Expression
1 eluzelz N M N
2 eluzel2 N M M
3 2z 2
4 ifcl M 2 if M 2 M 2
5 2 3 4 sylancl N M if M 2 M 2
6 3 a1i N M 2
7 2 zred N M M
8 2re 2
9 min2 M 2 if M 2 M 2 2
10 7 8 9 sylancl N M if M 2 M 2 2
11 eluz2 2 if M 2 M 2 if M 2 M 2 2 if M 2 M 2 2
12 5 6 10 11 syl3anbrc N M 2 if M 2 M 2
13 ppival2g N 2 if M 2 M 2 π _ N = if M 2 M 2 N
14 1 12 13 syl2anc N M π _ N = if M 2 M 2 N
15 min1 M 2 if M 2 M 2 M
16 7 8 15 sylancl N M if M 2 M 2 M
17 eluz2 M if M 2 M 2 if M 2 M 2 M if M 2 M 2 M
18 5 2 16 17 syl3anbrc N M M if M 2 M 2
19 id N M N M
20 elfzuzb M if M 2 M 2 N M if M 2 M 2 N M
21 18 19 20 sylanbrc N M M if M 2 M 2 N
22 fzsplit M if M 2 M 2 N if M 2 M 2 N = if M 2 M 2 M M + 1 N
23 21 22 syl N M if M 2 M 2 N = if M 2 M 2 M M + 1 N
24 23 ineq1d N M if M 2 M 2 N = if M 2 M 2 M M + 1 N
25 indir if M 2 M 2 M M + 1 N = if M 2 M 2 M M + 1 N
26 24 25 eqtrdi N M if M 2 M 2 N = if M 2 M 2 M M + 1 N
27 26 fveq2d N M if M 2 M 2 N = if M 2 M 2 M M + 1 N
28 fzfi if M 2 M 2 M Fin
29 inss1 if M 2 M 2 M if M 2 M 2 M
30 ssfi if M 2 M 2 M Fin if M 2 M 2 M if M 2 M 2 M if M 2 M 2 M Fin
31 28 29 30 mp2an if M 2 M 2 M Fin
32 fzfi M + 1 N Fin
33 inss1 M + 1 N M + 1 N
34 ssfi M + 1 N Fin M + 1 N M + 1 N M + 1 N Fin
35 32 33 34 mp2an M + 1 N Fin
36 7 ltp1d N M M < M + 1
37 fzdisj M < M + 1 if M 2 M 2 M M + 1 N =
38 36 37 syl N M if M 2 M 2 M M + 1 N =
39 38 ineq1d N M if M 2 M 2 M M + 1 N =
40 inindir if M 2 M 2 M M + 1 N = if M 2 M 2 M M + 1 N
41 0in =
42 39 40 41 3eqtr3g N M if M 2 M 2 M M + 1 N =
43 hashun if M 2 M 2 M Fin M + 1 N Fin if M 2 M 2 M M + 1 N = if M 2 M 2 M M + 1 N = if M 2 M 2 M + M + 1 N
44 31 35 42 43 mp3an12i N M if M 2 M 2 M M + 1 N = if M 2 M 2 M + M + 1 N
45 14 27 44 3eqtrd N M π _ N = if M 2 M 2 M + M + 1 N
46 ppival2g M 2 if M 2 M 2 π _ M = if M 2 M 2 M
47 2 12 46 syl2anc N M π _ M = if M 2 M 2 M
48 45 47 oveq12d N M π _ N π _ M = if M 2 M 2 M + M + 1 N - if M 2 M 2 M
49 hashcl if M 2 M 2 M Fin if M 2 M 2 M 0
50 31 49 ax-mp if M 2 M 2 M 0
51 50 nn0cni if M 2 M 2 M
52 hashcl M + 1 N Fin M + 1 N 0
53 35 52 ax-mp M + 1 N 0
54 53 nn0cni M + 1 N
55 pncan2 if M 2 M 2 M M + 1 N if M 2 M 2 M + M + 1 N - if M 2 M 2 M = M + 1 N
56 51 54 55 mp2an if M 2 M 2 M + M + 1 N - if M 2 M 2 M = M + 1 N
57 48 56 eqtrdi N M π _ N π _ M = M + 1 N