Metamath Proof Explorer


Theorem pcbc

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

Ref Expression
Assertion pcbc N K 0 N P P pCnt ( N K) = k = 1 N N P k N K P k + K P k

Proof

Step Hyp Ref Expression
1 simp3 N K 0 N P P
2 nnnn0 N N 0
3 2 3ad2ant1 N K 0 N P N 0
4 3 faccld N K 0 N P N !
5 4 nnzd N K 0 N P N !
6 4 nnne0d N K 0 N P N ! 0
7 fznn0sub K 0 N N K 0
8 7 3ad2ant2 N K 0 N P N K 0
9 8 faccld N K 0 N P N K !
10 elfznn0 K 0 N K 0
11 10 3ad2ant2 N K 0 N P K 0
12 11 faccld N K 0 N P K !
13 9 12 nnmulcld N K 0 N P N K ! K !
14 pcdiv P N ! N ! 0 N K ! K ! P pCnt N ! N K ! K ! = P pCnt N ! P pCnt N K ! K !
15 1 5 6 13 14 syl121anc N K 0 N P P pCnt N ! N K ! K ! = P pCnt N ! P pCnt N K ! K !
16 bcval2 K 0 N ( N K) = N ! N K ! K !
17 16 3ad2ant2 N K 0 N P ( N K) = N ! N K ! K !
18 17 oveq2d N K 0 N P P pCnt ( N K) = P pCnt N ! N K ! K !
19 fzfid N K 0 N P 1 N Fin
20 nnre N N
21 20 3ad2ant1 N K 0 N P N
22 21 adantr N K 0 N P k 1 N N
23 simpl3 N K 0 N P k 1 N P
24 prmnn P P
25 23 24 syl N K 0 N P k 1 N P
26 elfznn k 1 N k
27 26 nnnn0d k 1 N k 0
28 27 adantl N K 0 N P k 1 N k 0
29 25 28 nnexpcld N K 0 N P k 1 N P k
30 22 29 nndivred N K 0 N P k 1 N N P k
31 30 flcld N K 0 N P k 1 N N P k
32 31 zcnd N K 0 N P k 1 N N P k
33 11 nn0red N K 0 N P K
34 21 33 resubcld N K 0 N P N K
35 34 adantr N K 0 N P k 1 N N K
36 35 29 nndivred N K 0 N P k 1 N N K P k
37 36 flcld N K 0 N P k 1 N N K P k
38 37 zcnd N K 0 N P k 1 N N K P k
39 33 adantr N K 0 N P k 1 N K
40 39 29 nndivred N K 0 N P k 1 N K P k
41 40 flcld N K 0 N P k 1 N K P k
42 41 zcnd N K 0 N P k 1 N K P k
43 38 42 addcld N K 0 N P k 1 N N K P k + K P k
44 19 32 43 fsumsub N K 0 N P k = 1 N N P k N K P k + K P k = k = 1 N N P k k = 1 N N K P k + K P k
45 3 nn0zd N K 0 N P N
46 uzid N N N
47 45 46 syl N K 0 N P N N
48 pcfac N 0 N N P P pCnt N ! = k = 1 N N P k
49 3 47 1 48 syl3anc N K 0 N P P pCnt N ! = k = 1 N N P k
50 11 nn0ge0d N K 0 N P 0 K
51 21 33 subge02d N K 0 N P 0 K N K N
52 50 51 mpbid N K 0 N P N K N
53 11 nn0zd N K 0 N P K
54 45 53 zsubcld N K 0 N P N K
55 eluz N K N N N K N K N
56 54 45 55 syl2anc N K 0 N P N N K N K N
57 52 56 mpbird N K 0 N P N N K
58 pcfac N K 0 N N K P P pCnt N K ! = k = 1 N N K P k
59 8 57 1 58 syl3anc N K 0 N P P pCnt N K ! = k = 1 N N K P k
60 elfzuz3 K 0 N N K
61 60 3ad2ant2 N K 0 N P N K
62 pcfac K 0 N K P P pCnt K ! = k = 1 N K P k
63 11 61 1 62 syl3anc N K 0 N P P pCnt K ! = k = 1 N K P k
64 59 63 oveq12d N K 0 N P P pCnt N K ! + P pCnt K ! = k = 1 N N K P k + k = 1 N K P k
65 9 nnzd N K 0 N P N K !
66 9 nnne0d N K 0 N P N K ! 0
67 12 nnzd N K 0 N P K !
68 12 nnne0d N K 0 N P K ! 0
69 pcmul P N K ! N K ! 0 K ! K ! 0 P pCnt N K ! K ! = P pCnt N K ! + P pCnt K !
70 1 65 66 67 68 69 syl122anc N K 0 N P P pCnt N K ! K ! = P pCnt N K ! + P pCnt K !
71 19 38 42 fsumadd N K 0 N P k = 1 N N K P k + K P k = k = 1 N N K P k + k = 1 N K P k
72 64 70 71 3eqtr4d N K 0 N P P pCnt N K ! K ! = k = 1 N N K P k + K P k
73 49 72 oveq12d N K 0 N P P pCnt N ! P pCnt N K ! K ! = k = 1 N N P k k = 1 N N K P k + K P k
74 44 73 eqtr4d N K 0 N P k = 1 N N P k N K P k + K P k = P pCnt N ! P pCnt N K ! K !
75 15 18 74 3eqtr4d N K 0 N P P pCnt ( N K) = k = 1 N N P k N K P k + K P k