Metamath Proof Explorer


Theorem ppinprm

Description: The prime-counting function ppi at a non-prime. (Contributed by Mario Carneiro, 19-Sep-2014)

Ref Expression
Assertion ppinprm
|- ( ( A e. ZZ /\ -. ( A + 1 ) e. Prime ) -> ( ppi ` ( A + 1 ) ) = ( ppi ` A ) )

Proof

Step Hyp Ref Expression
1 simprr
 |-  ( ( A e. ZZ /\ ( -. ( A + 1 ) e. Prime /\ x e. ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) ) -> x e. ( ( 2 ... ( A + 1 ) ) i^i Prime ) )
2 1 elin2d
 |-  ( ( A e. ZZ /\ ( -. ( A + 1 ) e. Prime /\ x e. ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) ) -> x e. Prime )
3 simprl
 |-  ( ( A e. ZZ /\ ( -. ( A + 1 ) e. Prime /\ x e. ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) ) -> -. ( A + 1 ) e. Prime )
4 nelne2
 |-  ( ( x e. Prime /\ -. ( A + 1 ) e. Prime ) -> x =/= ( A + 1 ) )
5 2 3 4 syl2anc
 |-  ( ( A e. ZZ /\ ( -. ( A + 1 ) e. Prime /\ x e. ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) ) -> x =/= ( A + 1 ) )
6 velsn
 |-  ( x e. { ( A + 1 ) } <-> x = ( A + 1 ) )
7 6 necon3bbii
 |-  ( -. x e. { ( A + 1 ) } <-> x =/= ( A + 1 ) )
8 5 7 sylibr
 |-  ( ( A e. ZZ /\ ( -. ( A + 1 ) e. Prime /\ x e. ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) ) -> -. x e. { ( A + 1 ) } )
9 1 elin1d
 |-  ( ( A e. ZZ /\ ( -. ( A + 1 ) e. Prime /\ x e. ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) ) -> x e. ( 2 ... ( A + 1 ) ) )
10 2z
 |-  2 e. ZZ
11 zcn
 |-  ( A e. ZZ -> A e. CC )
12 11 adantr
 |-  ( ( A e. ZZ /\ ( -. ( A + 1 ) e. Prime /\ x e. ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) ) -> A e. CC )
13 ax-1cn
 |-  1 e. CC
14 pncan
 |-  ( ( A e. CC /\ 1 e. CC ) -> ( ( A + 1 ) - 1 ) = A )
15 12 13 14 sylancl
 |-  ( ( A e. ZZ /\ ( -. ( A + 1 ) e. Prime /\ x e. ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) ) -> ( ( A + 1 ) - 1 ) = A )
16 elfzuz2
 |-  ( x e. ( 2 ... ( A + 1 ) ) -> ( A + 1 ) e. ( ZZ>= ` 2 ) )
17 uz2m1nn
 |-  ( ( A + 1 ) e. ( ZZ>= ` 2 ) -> ( ( A + 1 ) - 1 ) e. NN )
18 9 16 17 3syl
 |-  ( ( A e. ZZ /\ ( -. ( A + 1 ) e. Prime /\ x e. ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) ) -> ( ( A + 1 ) - 1 ) e. NN )
19 15 18 eqeltrrd
 |-  ( ( A e. ZZ /\ ( -. ( A + 1 ) e. Prime /\ x e. ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) ) -> A e. NN )
20 nnuz
 |-  NN = ( ZZ>= ` 1 )
21 2m1e1
 |-  ( 2 - 1 ) = 1
22 21 fveq2i
 |-  ( ZZ>= ` ( 2 - 1 ) ) = ( ZZ>= ` 1 )
23 20 22 eqtr4i
 |-  NN = ( ZZ>= ` ( 2 - 1 ) )
24 19 23 eleqtrdi
 |-  ( ( A e. ZZ /\ ( -. ( A + 1 ) e. Prime /\ x e. ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) ) -> A e. ( ZZ>= ` ( 2 - 1 ) ) )
25 fzsuc2
 |-  ( ( 2 e. ZZ /\ A e. ( ZZ>= ` ( 2 - 1 ) ) ) -> ( 2 ... ( A + 1 ) ) = ( ( 2 ... A ) u. { ( A + 1 ) } ) )
26 10 24 25 sylancr
 |-  ( ( A e. ZZ /\ ( -. ( A + 1 ) e. Prime /\ x e. ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) ) -> ( 2 ... ( A + 1 ) ) = ( ( 2 ... A ) u. { ( A + 1 ) } ) )
27 9 26 eleqtrd
 |-  ( ( A e. ZZ /\ ( -. ( A + 1 ) e. Prime /\ x e. ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) ) -> x e. ( ( 2 ... A ) u. { ( A + 1 ) } ) )
28 elun
 |-  ( x e. ( ( 2 ... A ) u. { ( A + 1 ) } ) <-> ( x e. ( 2 ... A ) \/ x e. { ( A + 1 ) } ) )
29 27 28 sylib
 |-  ( ( A e. ZZ /\ ( -. ( A + 1 ) e. Prime /\ x e. ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) ) -> ( x e. ( 2 ... A ) \/ x e. { ( A + 1 ) } ) )
30 29 ord
 |-  ( ( A e. ZZ /\ ( -. ( A + 1 ) e. Prime /\ x e. ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) ) -> ( -. x e. ( 2 ... A ) -> x e. { ( A + 1 ) } ) )
31 8 30 mt3d
 |-  ( ( A e. ZZ /\ ( -. ( A + 1 ) e. Prime /\ x e. ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) ) -> x e. ( 2 ... A ) )
32 31 2 elind
 |-  ( ( A e. ZZ /\ ( -. ( A + 1 ) e. Prime /\ x e. ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) ) -> x e. ( ( 2 ... A ) i^i Prime ) )
33 32 expr
 |-  ( ( A e. ZZ /\ -. ( A + 1 ) e. Prime ) -> ( x e. ( ( 2 ... ( A + 1 ) ) i^i Prime ) -> x e. ( ( 2 ... A ) i^i Prime ) ) )
34 33 ssrdv
 |-  ( ( A e. ZZ /\ -. ( A + 1 ) e. Prime ) -> ( ( 2 ... ( A + 1 ) ) i^i Prime ) C_ ( ( 2 ... A ) i^i Prime ) )
35 uzid
 |-  ( A e. ZZ -> A e. ( ZZ>= ` A ) )
36 35 adantr
 |-  ( ( A e. ZZ /\ -. ( A + 1 ) e. Prime ) -> A e. ( ZZ>= ` A ) )
37 peano2uz
 |-  ( A e. ( ZZ>= ` A ) -> ( A + 1 ) e. ( ZZ>= ` A ) )
38 fzss2
 |-  ( ( A + 1 ) e. ( ZZ>= ` A ) -> ( 2 ... A ) C_ ( 2 ... ( A + 1 ) ) )
39 ssrin
 |-  ( ( 2 ... A ) C_ ( 2 ... ( A + 1 ) ) -> ( ( 2 ... A ) i^i Prime ) C_ ( ( 2 ... ( A + 1 ) ) i^i Prime ) )
40 36 37 38 39 4syl
 |-  ( ( A e. ZZ /\ -. ( A + 1 ) e. Prime ) -> ( ( 2 ... A ) i^i Prime ) C_ ( ( 2 ... ( A + 1 ) ) i^i Prime ) )
41 34 40 eqssd
 |-  ( ( A e. ZZ /\ -. ( A + 1 ) e. Prime ) -> ( ( 2 ... ( A + 1 ) ) i^i Prime ) = ( ( 2 ... A ) i^i Prime ) )
42 41 fveq2d
 |-  ( ( A e. ZZ /\ -. ( A + 1 ) e. Prime ) -> ( # ` ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) = ( # ` ( ( 2 ... A ) i^i Prime ) ) )
43 peano2z
 |-  ( A e. ZZ -> ( A + 1 ) e. ZZ )
44 43 adantr
 |-  ( ( A e. ZZ /\ -. ( A + 1 ) e. Prime ) -> ( A + 1 ) e. ZZ )
45 ppival2
 |-  ( ( A + 1 ) e. ZZ -> ( ppi ` ( A + 1 ) ) = ( # ` ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) )
46 44 45 syl
 |-  ( ( A e. ZZ /\ -. ( A + 1 ) e. Prime ) -> ( ppi ` ( A + 1 ) ) = ( # ` ( ( 2 ... ( A + 1 ) ) i^i Prime ) ) )
47 ppival2
 |-  ( A e. ZZ -> ( ppi ` A ) = ( # ` ( ( 2 ... A ) i^i Prime ) ) )
48 47 adantr
 |-  ( ( A e. ZZ /\ -. ( A + 1 ) e. Prime ) -> ( ppi ` A ) = ( # ` ( ( 2 ... A ) i^i Prime ) ) )
49 42 46 48 3eqtr4d
 |-  ( ( A e. ZZ /\ -. ( A + 1 ) e. Prime ) -> ( ppi ` ( A + 1 ) ) = ( ppi ` A ) )