Metamath Proof Explorer


Theorem pczpre

Description: Connect the prime count pre-function to the actual prime count function, when restricted to the integers. (Contributed by Mario Carneiro, 23-Feb-2014) (Proof shortened by Mario Carneiro, 24-Dec-2016)

Ref Expression
Hypothesis pczpre.1 ⊢ S = sup n ∈ ℕ 0 | P n ∥ N ℝ <
Assertion pczpre ⊢ P ∈ ℙ ∧ N ∈ ℤ ∧ N ≠ 0 → P pCnt N = S

Proof

Step Hyp Ref Expression
1 pczpre.1 ⊢ S = sup n ∈ ℕ 0 | P n ∥ N ℝ <
2 zq ⊢ N ∈ ℤ → N ∈ ℚ
3 eqid ⊢ sup n ∈ ℕ 0 | P n ∥ x ℝ < = sup n ∈ ℕ 0 | P n ∥ x ℝ <
4 eqid ⊢ sup n ∈ ℕ 0 | P n ∥ y ℝ < = sup n ∈ ℕ 0 | P n ∥ y ℝ <
5 3 4 pcval ⊢ P ∈ ℙ ∧ N ∈ ℚ ∧ N ≠ 0 → P pCnt N = ι z | ∃ x ∈ ℤ ∃ y ∈ ℕ N = x y ∧ z = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ <
6 2 5 sylanr1 ⊢ P ∈ ℙ ∧ N ∈ ℤ ∧ N ≠ 0 → P pCnt N = ι z | ∃ x ∈ ℤ ∃ y ∈ ℕ N = x y ∧ z = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ <
7 simprl ⊢ P ∈ ℙ ∧ N ∈ ℤ ∧ N ≠ 0 → N ∈ ℤ
8 7 zcnd ⊢ P ∈ ℙ ∧ N ∈ ℤ ∧ N ≠ 0 → N ∈ ℂ
9 8 div1d ⊢ P ∈ ℙ ∧ N ∈ ℤ ∧ N ≠ 0 → N 1 = N
10 9 eqcomd ⊢ P ∈ ℙ ∧ N ∈ ℤ ∧ N ≠ 0 → N = N 1
11 prmuz2 ⊢ P ∈ ℙ → P ∈ ℤ ≥ 2
12 eqid ⊢ 1 = 1
13 eqid ⊢ n ∈ ℕ 0 | P n ∥ 1 = n ∈ ℕ 0 | P n ∥ 1
14 eqid ⊢ sup n ∈ ℕ 0 | P n ∥ 1 ℝ < = sup n ∈ ℕ 0 | P n ∥ 1 ℝ <
15 13 14 pcpre1 ⊢ P ∈ ℤ ≥ 2 ∧ 1 = 1 → sup n ∈ ℕ 0 | P n ∥ 1 ℝ < = 0
16 11 12 15 sylancl ⊢ P ∈ ℙ → sup n ∈ ℕ 0 | P n ∥ 1 ℝ < = 0
17 16 adantr ⊢ P ∈ ℙ ∧ N ∈ ℤ ∧ N ≠ 0 → sup n ∈ ℕ 0 | P n ∥ 1 ℝ < = 0
18 17 oveq2d ⊢ P ∈ ℙ ∧ N ∈ ℤ ∧ N ≠ 0 → S − sup n ∈ ℕ 0 | P n ∥ 1 ℝ < = S − 0
19 eqid ⊢ n ∈ ℕ 0 | P n ∥ N = n ∈ ℕ 0 | P n ∥ N
20 19 1 pcprecl ⊢ P ∈ ℤ ≥ 2 ∧ N ∈ ℤ ∧ N ≠ 0 → S ∈ ℕ 0 ∧ P S ∥ N
21 11 20 sylan ⊢ P ∈ ℙ ∧ N ∈ ℤ ∧ N ≠ 0 → S ∈ ℕ 0 ∧ P S ∥ N
22 21 simpld ⊢ P ∈ ℙ ∧ N ∈ ℤ ∧ N ≠ 0 → S ∈ ℕ 0
23 22 nn0cnd ⊢ P ∈ ℙ ∧ N ∈ ℤ ∧ N ≠ 0 → S ∈ ℂ
24 23 subid1d ⊢ P ∈ ℙ ∧ N ∈ ℤ ∧ N ≠ 0 → S − 0 = S
25 18 24 eqtr2d ⊢ P ∈ ℙ ∧ N ∈ ℤ ∧ N ≠ 0 → S = S − sup n ∈ ℕ 0 | P n ∥ 1 ℝ <
26 1nn ⊢ 1 ∈ ℕ
27 oveq1 ⊢ x = N → x y = N y
28 27 eqeq2d ⊢ x = N → N = x y ↔ N = N y
29 breq2 ⊢ x = N → P n ∥ x ↔ P n ∥ N
30 29 rabbidv ⊢ x = N → n ∈ ℕ 0 | P n ∥ x = n ∈ ℕ 0 | P n ∥ N
31 30 supeq1d ⊢ x = N → sup n ∈ ℕ 0 | P n ∥ x ℝ < = sup n ∈ ℕ 0 | P n ∥ N ℝ <
32 31 1 eqtr4di ⊢ x = N → sup n ∈ ℕ 0 | P n ∥ x ℝ < = S
33 32 oveq1d ⊢ x = N → sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ < = S − sup n ∈ ℕ 0 | P n ∥ y ℝ <
34 33 eqeq2d ⊢ x = N → S = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ < ↔ S = S − sup n ∈ ℕ 0 | P n ∥ y ℝ <
35 28 34 anbi12d ⊢ x = N → N = x y ∧ S = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ < ↔ N = N y ∧ S = S − sup n ∈ ℕ 0 | P n ∥ y ℝ <
36 oveq2 ⊢ y = 1 → N y = N 1
37 36 eqeq2d ⊢ y = 1 → N = N y ↔ N = N 1
38 breq2 ⊢ y = 1 → P n ∥ y ↔ P n ∥ 1
39 38 rabbidv ⊢ y = 1 → n ∈ ℕ 0 | P n ∥ y = n ∈ ℕ 0 | P n ∥ 1
40 39 supeq1d ⊢ y = 1 → sup n ∈ ℕ 0 | P n ∥ y ℝ < = sup n ∈ ℕ 0 | P n ∥ 1 ℝ <
41 40 oveq2d ⊢ y = 1 → S − sup n ∈ ℕ 0 | P n ∥ y ℝ < = S − sup n ∈ ℕ 0 | P n ∥ 1 ℝ <
42 41 eqeq2d ⊢ y = 1 → S = S − sup n ∈ ℕ 0 | P n ∥ y ℝ < ↔ S = S − sup n ∈ ℕ 0 | P n ∥ 1 ℝ <
43 37 42 anbi12d ⊢ y = 1 → N = N y ∧ S = S − sup n ∈ ℕ 0 | P n ∥ y ℝ < ↔ N = N 1 ∧ S = S − sup n ∈ ℕ 0 | P n ∥ 1 ℝ <
44 35 43 rspc2ev ⊢ N ∈ ℤ ∧ 1 ∈ ℕ ∧ N = N 1 ∧ S = S − sup n ∈ ℕ 0 | P n ∥ 1 ℝ < → ∃ x ∈ ℤ ∃ y ∈ ℕ N = x y ∧ S = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ <
45 26 44 mp3an2 ⊢ N ∈ ℤ ∧ N = N 1 ∧ S = S − sup n ∈ ℕ 0 | P n ∥ 1 ℝ < → ∃ x ∈ ℤ ∃ y ∈ ℕ N = x y ∧ S = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ <
46 7 10 25 45 syl12anc ⊢ P ∈ ℙ ∧ N ∈ ℤ ∧ N ≠ 0 → ∃ x ∈ ℤ ∃ y ∈ ℕ N = x y ∧ S = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ <
47 ltso ⊢ < Or ℝ
48 47 supex ⊢ sup n ∈ ℕ 0 | P n ∥ N ℝ < ∈ V
49 1 48 eqeltri ⊢ S ∈ V
50 3 4 pceu ⊢ P ∈ ℙ ∧ N ∈ ℚ ∧ N ≠ 0 → ∃! z ∃ x ∈ ℤ ∃ y ∈ ℕ N = x y ∧ z = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ <
51 2 50 sylanr1 ⊢ P ∈ ℙ ∧ N ∈ ℤ ∧ N ≠ 0 → ∃! z ∃ x ∈ ℤ ∃ y ∈ ℕ N = x y ∧ z = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ <
52 eqeq1 ⊢ z = S → z = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ < ↔ S = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ <
53 52 anbi2d ⊢ z = S → N = x y ∧ z = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ < ↔ N = x y ∧ S = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ <
54 53 2rexbidv ⊢ z = S → ∃ x ∈ ℤ ∃ y ∈ ℕ N = x y ∧ z = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ < ↔ ∃ x ∈ ℤ ∃ y ∈ ℕ N = x y ∧ S = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ <
55 54 iota2 ⊢ S ∈ V ∧ ∃! z ∃ x ∈ ℤ ∃ y ∈ ℕ N = x y ∧ z = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ < → ∃ x ∈ ℤ ∃ y ∈ ℕ N = x y ∧ S = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ < ↔ ι z | ∃ x ∈ ℤ ∃ y ∈ ℕ N = x y ∧ z = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ < = S
56 49 51 55 sylancr ⊢ P ∈ ℙ ∧ N ∈ ℤ ∧ N ≠ 0 → ∃ x ∈ ℤ ∃ y ∈ ℕ N = x y ∧ S = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ < ↔ ι z | ∃ x ∈ ℤ ∃ y ∈ ℕ N = x y ∧ z = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ < = S
57 46 56 mpbid ⊢ P ∈ ℙ ∧ N ∈ ℤ ∧ N ≠ 0 → ι z | ∃ x ∈ ℤ ∃ y ∈ ℕ N = x y ∧ z = sup n ∈ ℕ 0 | P n ∥ x ℝ < − sup n ∈ ℕ 0 | P n ∥ y ℝ < = S
58 6 57 eqtrd ⊢ P ∈ ℙ ∧ N ∈ ℤ ∧ N ≠ 0 → P pCnt N = S