Metamath Proof Explorer


Theorem pcfac

Description: Calculate the prime count of a factorial. (Contributed by Mario Carneiro, 11-Mar-2014) (Revised by Mario Carneiro, 21-May-2014)

Ref Expression
Assertion pcfac N0MNPPpCntN!=k=1MNPk

Proof

Step Hyp Ref Expression
1 fveq2 x=0x=0
2 fveq2 x=0x!=0!
3 2 oveq2d x=0PpCntx!=PpCnt0!
4 fvoveq1 x=0xPk=0Pk
5 4 sumeq2sdv x=0k=1mxPk=k=1m0Pk
6 3 5 eqeq12d x=0PpCntx!=k=1mxPkPpCnt0!=k=1m0Pk
7 1 6 raleqbidv x=0mxPpCntx!=k=1mxPkm0PpCnt0!=k=1m0Pk
8 7 imbi2d x=0PmxPpCntx!=k=1mxPkPm0PpCnt0!=k=1m0Pk
9 fveq2 x=nx=n
10 fveq2 x=nx!=n!
11 10 oveq2d x=nPpCntx!=PpCntn!
12 fvoveq1 x=nxPk=nPk
13 12 sumeq2sdv x=nk=1mxPk=k=1mnPk
14 11 13 eqeq12d x=nPpCntx!=k=1mxPkPpCntn!=k=1mnPk
15 9 14 raleqbidv x=nmxPpCntx!=k=1mxPkmnPpCntn!=k=1mnPk
16 15 imbi2d x=nPmxPpCntx!=k=1mxPkPmnPpCntn!=k=1mnPk
17 fveq2 x=n+1x=n+1
18 fveq2 x=n+1x!=n+1!
19 18 oveq2d x=n+1PpCntx!=PpCntn+1!
20 fvoveq1 x=n+1xPk=n+1Pk
21 20 sumeq2sdv x=n+1k=1mxPk=k=1mn+1Pk
22 19 21 eqeq12d x=n+1PpCntx!=k=1mxPkPpCntn+1!=k=1mn+1Pk
23 17 22 raleqbidv x=n+1mxPpCntx!=k=1mxPkmn+1PpCntn+1!=k=1mn+1Pk
24 23 imbi2d x=n+1PmxPpCntx!=k=1mxPkPmn+1PpCntn+1!=k=1mn+1Pk
25 fveq2 x=Nx=N
26 fveq2 x=Nx!=N!
27 26 oveq2d x=NPpCntx!=PpCntN!
28 fvoveq1 x=NxPk=NPk
29 28 sumeq2sdv x=Nk=1mxPk=k=1mNPk
30 27 29 eqeq12d x=NPpCntx!=k=1mxPkPpCntN!=k=1mNPk
31 25 30 raleqbidv x=NmxPpCntx!=k=1mxPkmNPpCntN!=k=1mNPk
32 31 imbi2d x=NPmxPpCntx!=k=1mxPkPmNPpCntN!=k=1mNPk
33 fzfid Pm01mFin
34 sumz 1m11mFink=1m0=0
35 34 olcs 1mFink=1m0=0
36 33 35 syl Pm0k=1m0=0
37 0nn0 00
38 elfznn k1mk
39 38 nnnn0d k1mk0
40 nn0uz 0=0
41 39 40 eleqtrdi k1mk0
42 41 adantl Pm0k1mk0
43 simpll Pm0k1mP
44 pcfaclem 00k0P0Pk=0
45 37 42 43 44 mp3an2i Pm0k1m0Pk=0
46 45 sumeq2dv Pm0k=1m0Pk=k=1m0
47 fac0 0!=1
48 47 oveq2i PpCnt0!=PpCnt1
49 pc1 PPpCnt1=0
50 48 49 eqtrid PPpCnt0!=0
51 50 adantr Pm0PpCnt0!=0
52 36 46 51 3eqtr4rd Pm0PpCnt0!=k=1m0Pk
53 52 ralrimiva Pm0PpCnt0!=k=1m0Pk
54 nn0z n0n
55 54 adantr n0Pn
56 uzid nnn
57 peano2uz nnn+1n
58 55 56 57 3syl n0Pn+1n
59 uzss n+1nn+1n
60 ssralv n+1nmnPpCntn!=k=1mnPkmn+1PpCntn!=k=1mnPk
61 58 59 60 3syl n0PmnPpCntn!=k=1mnPkmn+1PpCntn!=k=1mnPk
62 oveq1 PpCntn!=k=1mnPkPpCntn!+PpCntn+1=k=1mnPk+PpCntn+1
63 simpll n0Pmn+1n0
64 facp1 n0n+1!=n!n+1
65 63 64 syl n0Pmn+1n+1!=n!n+1
66 65 oveq2d n0Pmn+1PpCntn+1!=PpCntn!n+1
67 simplr n0Pmn+1P
68 faccl n0n!
69 nnz n!n!
70 nnne0 n!n!0
71 69 70 jca n!n!n!0
72 63 68 71 3syl n0Pmn+1n!n!0
73 nn0p1nn n0n+1
74 nnz n+1n+1
75 nnne0 n+1n+10
76 74 75 jca n+1n+1n+10
77 63 73 76 3syl n0Pmn+1n+1n+10
78 pcmul Pn!n!0n+1n+10PpCntn!n+1=PpCntn!+PpCntn+1
79 67 72 77 78 syl3anc n0Pmn+1PpCntn!n+1=PpCntn!+PpCntn+1
80 66 79 eqtr2d n0Pmn+1PpCntn!+PpCntn+1=PpCntn+1!
81 63 adantr n0Pmn+1k1mn0
82 81 nn0zd n0Pmn+1k1mn
83 prmnn PP
84 83 ad2antlr n0Pmn+1P
85 nnexpcl Pk0Pk
86 84 39 85 syl2an n0Pmn+1k1mPk
87 fldivp1 nPkn+1PknPk=ifPkn+110
88 82 86 87 syl2anc n0Pmn+1k1mn+1PknPk=ifPkn+110
89 elfzuz k1mk1
90 63 73 syl n0Pmn+1n+1
91 67 90 pccld n0Pmn+1PpCntn+10
92 91 nn0zd n0Pmn+1PpCntn+1
93 elfz5 k1PpCntn+1k1PpCntn+1kPpCntn+1
94 89 92 93 syl2anr n0Pmn+1k1mk1PpCntn+1kPpCntn+1
95 simpllr n0Pmn+1k1mP
96 81 73 syl n0Pmn+1k1mn+1
97 96 nnzd n0Pmn+1k1mn+1
98 39 adantl n0Pmn+1k1mk0
99 pcdvdsb Pn+1k0kPpCntn+1Pkn+1
100 95 97 98 99 syl3anc n0Pmn+1k1mkPpCntn+1Pkn+1
101 94 100 bitr2d n0Pmn+1k1mPkn+1k1PpCntn+1
102 101 ifbid n0Pmn+1k1mifPkn+110=ifk1PpCntn+110
103 88 102 eqtrd n0Pmn+1k1mn+1PknPk=ifk1PpCntn+110
104 103 sumeq2dv n0Pmn+1k=1mn+1PknPk=k=1mifk1PpCntn+110
105 fzfid n0Pmn+11mFin
106 63 nn0red n0Pmn+1n
107 peano2re nn+1
108 106 107 syl n0Pmn+1n+1
109 108 adantr n0Pmn+1k1mn+1
110 109 86 nndivred n0Pmn+1k1mn+1Pk
111 110 flcld n0Pmn+1k1mn+1Pk
112 111 zcnd n0Pmn+1k1mn+1Pk
113 106 adantr n0Pmn+1k1mn
114 113 86 nndivred n0Pmn+1k1mnPk
115 114 flcld n0Pmn+1k1mnPk
116 115 zcnd n0Pmn+1k1mnPk
117 105 112 116 fsumsub n0Pmn+1k=1mn+1PknPk=k=1mn+1Pkk=1mnPk
118 fzfi 1mFin
119 91 nn0red n0Pmn+1PpCntn+1
120 eluzelz mn+1m
121 120 adantl n0Pmn+1m
122 121 zred n0Pmn+1m
123 prmuz2 PP2
124 123 ad2antlr n0Pmn+1P2
125 90 nnnn0d n0Pmn+1n+10
126 bernneq3 P2n+10n+1<Pn+1
127 124 125 126 syl2anc n0Pmn+1n+1<Pn+1
128 119 108 letrid n0Pmn+1PpCntn+1n+1n+1PpCntn+1
129 128 ord n0Pmn+1¬PpCntn+1n+1n+1PpCntn+1
130 90 nnzd n0Pmn+1n+1
131 pcdvdsb Pn+1n+10n+1PpCntn+1Pn+1n+1
132 67 130 125 131 syl3anc n0Pmn+1n+1PpCntn+1Pn+1n+1
133 84 125 nnexpcld n0Pmn+1Pn+1
134 133 nnzd n0Pmn+1Pn+1
135 dvdsle Pn+1n+1Pn+1n+1Pn+1n+1
136 134 90 135 syl2anc n0Pmn+1Pn+1n+1Pn+1n+1
137 133 nnred n0Pmn+1Pn+1
138 137 108 lenltd n0Pmn+1Pn+1n+1¬n+1<Pn+1
139 136 138 sylibd n0Pmn+1Pn+1n+1¬n+1<Pn+1
140 132 139 sylbid n0Pmn+1n+1PpCntn+1¬n+1<Pn+1
141 129 140 syld n0Pmn+1¬PpCntn+1n+1¬n+1<Pn+1
142 127 141 mt4d n0Pmn+1PpCntn+1n+1
143 eluzle mn+1n+1m
144 143 adantl n0Pmn+1n+1m
145 119 108 122 142 144 letrd n0Pmn+1PpCntn+1m
146 eluz PpCntn+1mmPpCntn+1PpCntn+1m
147 92 121 146 syl2anc n0Pmn+1mPpCntn+1PpCntn+1m
148 145 147 mpbird n0Pmn+1mPpCntn+1
149 fzss2 mPpCntn+11PpCntn+11m
150 148 149 syl n0Pmn+11PpCntn+11m
151 sumhash 1mFin1PpCntn+11mk=1mifk1PpCntn+110=1PpCntn+1
152 118 150 151 sylancr n0Pmn+1k=1mifk1PpCntn+110=1PpCntn+1
153 hashfz1 PpCntn+101PpCntn+1=PpCntn+1
154 91 153 syl n0Pmn+11PpCntn+1=PpCntn+1
155 152 154 eqtrd n0Pmn+1k=1mifk1PpCntn+110=PpCntn+1
156 104 117 155 3eqtr3d n0Pmn+1k=1mn+1Pkk=1mnPk=PpCntn+1
157 105 112 fsumcl n0Pmn+1k=1mn+1Pk
158 105 116 fsumcl n0Pmn+1k=1mnPk
159 119 recnd n0Pmn+1PpCntn+1
160 157 158 159 subaddd n0Pmn+1k=1mn+1Pkk=1mnPk=PpCntn+1k=1mnPk+PpCntn+1=k=1mn+1Pk
161 156 160 mpbid n0Pmn+1k=1mnPk+PpCntn+1=k=1mn+1Pk
162 80 161 eqeq12d n0Pmn+1PpCntn!+PpCntn+1=k=1mnPk+PpCntn+1PpCntn+1!=k=1mn+1Pk
163 62 162 imbitrid n0Pmn+1PpCntn!=k=1mnPkPpCntn+1!=k=1mn+1Pk
164 163 ralimdva n0Pmn+1PpCntn!=k=1mnPkmn+1PpCntn+1!=k=1mn+1Pk
165 61 164 syld n0PmnPpCntn!=k=1mnPkmn+1PpCntn+1!=k=1mn+1Pk
166 165 ex n0PmnPpCntn!=k=1mnPkmn+1PpCntn+1!=k=1mn+1Pk
167 166 a2d n0PmnPpCntn!=k=1mnPkPmn+1PpCntn+1!=k=1mn+1Pk
168 8 16 24 32 53 167 nn0ind N0PmNPpCntN!=k=1mNPk
169 168 imp N0PmNPpCntN!=k=1mNPk
170 oveq2 m=M1m=1M
171 170 sumeq1d m=Mk=1mNPk=k=1MNPk
172 171 eqeq2d m=MPpCntN!=k=1mNPkPpCntN!=k=1MNPk
173 172 rspcv MNmNPpCntN!=k=1mNPkPpCntN!=k=1MNPk
174 169 173 syl5 MNN0PPpCntN!=k=1MNPk
175 174 3impib MNN0PPpCntN!=k=1MNPk
176 175 3com12 N0MNPPpCntN!=k=1MNPk