Metamath Proof Explorer


Theorem pcneg

Description: The prime count of a negative number. (Contributed by Mario Carneiro, 13-Mar-2014)

Ref Expression
Assertion pcneg ⊢ P ∈ ℙ ∧ A ∈ ℚ → P pCnt − A = P pCnt A

Proof

Step Hyp Ref Expression
1 elq ⊢ A ∈ ℚ ↔ ∃ x ∈ ℤ ∃ y ∈ ℕ A = x y
2 zcn ⊢ x ∈ ℤ → x ∈ ℂ
3 2 ad2antrl ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ → x ∈ ℂ
4 nncn ⊢ y ∈ ℕ → y ∈ ℂ
5 4 ad2antll ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ → y ∈ ℂ
6 nnne0 ⊢ y ∈ ℕ → y ≠ 0
7 6 ad2antll ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ → y ≠ 0
8 3 5 7 divnegd ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ → − x y = − x y
9 8 oveq2d ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ → P pCnt − x y = P pCnt − x y
10 neg0 ⊢ − 0 = 0
11 simpr ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x = 0 → x = 0
12 11 negeqd ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x = 0 → − x = − 0
13 10 12 11 3eqtr4a ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x = 0 → − x = x
14 13 oveq1d ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x = 0 → − x y = x y
15 14 oveq2d ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x = 0 → P pCnt − x y = P pCnt x y
16 simpll ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x ≠ 0 → P ∈ ℙ
17 simplrl ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x ≠ 0 → x ∈ ℤ
18 17 znegcld ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x ≠ 0 → − x ∈ ℤ
19 simpr ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x ≠ 0 → x ≠ 0
20 2 negne0bd ⊢ x ∈ ℤ → x ≠ 0 ↔ − x ≠ 0
21 17 20 syl ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x ≠ 0 → x ≠ 0 ↔ − x ≠ 0
22 19 21 mpbid ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x ≠ 0 → − x ≠ 0
23 simplrr ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x ≠ 0 → y ∈ ℕ
24 pcdiv ⊢ P ∈ ℙ ∧ − x ∈ ℤ ∧ − x ≠ 0 ∧ y ∈ ℕ → P pCnt − x y = P pCnt − x − P pCnt y
25 16 18 22 23 24 syl121anc ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x ≠ 0 → P pCnt − x y = P pCnt − x − P pCnt y
26 pcdiv ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ x ≠ 0 ∧ y ∈ ℕ → P pCnt x y = P pCnt x − P pCnt y
27 16 17 19 23 26 syl121anc ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x ≠ 0 → P pCnt x y = P pCnt x − P pCnt y
28 eqid ⊢ sup y ∈ ℕ 0 | P y ∥ − x ℝ < = sup y ∈ ℕ 0 | P y ∥ − x ℝ <
29 28 pczpre ⊢ P ∈ ℙ ∧ − x ∈ ℤ ∧ − x ≠ 0 → P pCnt − x = sup y ∈ ℕ 0 | P y ∥ − x ℝ <
30 16 18 22 29 syl12anc ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x ≠ 0 → P pCnt − x = sup y ∈ ℕ 0 | P y ∥ − x ℝ <
31 eqid ⊢ sup y ∈ ℕ 0 | P y ∥ x ℝ < = sup y ∈ ℕ 0 | P y ∥ x ℝ <
32 31 pczpre ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ x ≠ 0 → P pCnt x = sup y ∈ ℕ 0 | P y ∥ x ℝ <
33 prmz ⊢ P ∈ ℙ → P ∈ ℤ
34 zexpcl ⊢ P ∈ ℤ ∧ y ∈ ℕ 0 → P y ∈ ℤ
35 33 34 sylan ⊢ P ∈ ℙ ∧ y ∈ ℕ 0 → P y ∈ ℤ
36 simpl ⊢ x ∈ ℤ ∧ x ≠ 0 → x ∈ ℤ
37 dvdsnegb ⊢ P y ∈ ℤ ∧ x ∈ ℤ → P y ∥ x ↔ P y ∥ − x
38 35 36 37 syl2an ⊢ P ∈ ℙ ∧ y ∈ ℕ 0 ∧ x ∈ ℤ ∧ x ≠ 0 → P y ∥ x ↔ P y ∥ − x
39 38 an32s ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ x ≠ 0 ∧ y ∈ ℕ 0 → P y ∥ x ↔ P y ∥ − x
40 39 rabbidva ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ x ≠ 0 → y ∈ ℕ 0 | P y ∥ x = y ∈ ℕ 0 | P y ∥ − x
41 40 supeq1d ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ x ≠ 0 → sup y ∈ ℕ 0 | P y ∥ x ℝ < = sup y ∈ ℕ 0 | P y ∥ − x ℝ <
42 32 41 eqtrd ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ x ≠ 0 → P pCnt x = sup y ∈ ℕ 0 | P y ∥ − x ℝ <
43 16 17 19 42 syl12anc ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x ≠ 0 → P pCnt x = sup y ∈ ℕ 0 | P y ∥ − x ℝ <
44 30 43 eqtr4d ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x ≠ 0 → P pCnt − x = P pCnt x
45 44 oveq1d ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x ≠ 0 → P pCnt − x − P pCnt y = P pCnt x − P pCnt y
46 27 45 eqtr4d ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x ≠ 0 → P pCnt x y = P pCnt − x − P pCnt y
47 25 46 eqtr4d ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ ∧ x ≠ 0 → P pCnt − x y = P pCnt x y
48 15 47 pm2.61dane ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ → P pCnt − x y = P pCnt x y
49 9 48 eqtrd ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ → P pCnt − x y = P pCnt x y
50 negeq ⊢ A = x y → − A = − x y
51 50 oveq2d ⊢ A = x y → P pCnt − A = P pCnt − x y
52 oveq2 ⊢ A = x y → P pCnt A = P pCnt x y
53 51 52 eqeq12d ⊢ A = x y → P pCnt − A = P pCnt A ↔ P pCnt − x y = P pCnt x y
54 49 53 syl5ibrcom ⊢ P ∈ ℙ ∧ x ∈ ℤ ∧ y ∈ ℕ → A = x y → P pCnt − A = P pCnt A
55 54 rexlimdvva ⊢ P ∈ ℙ → ∃ x ∈ ℤ ∃ y ∈ ℕ A = x y → P pCnt − A = P pCnt A
56 1 55 biimtrid ⊢ P ∈ ℙ → A ∈ ℚ → P pCnt − A = P pCnt A
57 56 imp ⊢ P ∈ ℙ ∧ A ∈ ℚ → P pCnt − A = P pCnt A