Metamath Proof Explorer


Theorem logfac2

Description: Another expression for the logarithm of a factorial, in terms of the von Mangoldt function. Equation 9.2.7 of Shapiro, p. 329. (Contributed by Mario Carneiro, 15-Apr-2016) (Revised by Mario Carneiro, 3-May-2016)

Ref Expression
Assertion logfac2 A 0 A log A ! = k = 1 A Λ k A k

Proof

Step Hyp Ref Expression
1 flge0nn0 A 0 A A 0
2 logfac A 0 log A ! = n = 1 A log n
3 1 2 syl A 0 A log A ! = n = 1 A log n
4 fzfid A 0 A 1 A Fin
5 fzfid A 0 A k 1 A 1 A Fin
6 ssrab2 x 1 A | k x 1 A
7 ssfi 1 A Fin x 1 A | k x 1 A x 1 A | k x Fin
8 5 6 7 sylancl A 0 A k 1 A x 1 A | k x Fin
9 flcl A A
10 9 adantr A 0 A A
11 fznn A k 1 A k k A
12 10 11 syl A 0 A k 1 A k k A
13 12 anbi1d A 0 A k 1 A n 1 A k n k k A n 1 A k n
14 nnre k k
15 14 ad2antlr A 0 A k n 1 A k n k
16 elfznn n 1 A n
17 16 ad2antrl A 0 A k n 1 A k n n
18 17 nnred A 0 A k n 1 A k n n
19 reflcl A A
20 19 ad3antrrr A 0 A k n 1 A k n A
21 simprr A 0 A k n 1 A k n k n
22 nnz k k
23 22 ad2antlr A 0 A k n 1 A k n k
24 dvdsle k n k n k n
25 23 17 24 syl2anc A 0 A k n 1 A k n k n k n
26 21 25 mpd A 0 A k n 1 A k n k n
27 elfzle2 n 1 A n A
28 27 ad2antrl A 0 A k n 1 A k n n A
29 15 18 20 26 28 letrd A 0 A k n 1 A k n k A
30 29 expl A 0 A k n 1 A k n k A
31 30 pm4.71rd A 0 A k n 1 A k n k A k n 1 A k n
32 an12 n 1 A k k n k n 1 A k n
33 an21 k k A n 1 A k n k A k n 1 A k n
34 31 32 33 3bitr4g A 0 A n 1 A k k n k k A n 1 A k n
35 13 34 bitr4d A 0 A k 1 A n 1 A k n n 1 A k k n
36 breq2 x = n k x k n
37 36 elrab n x 1 A | k x n 1 A k n
38 37 anbi2i k 1 A n x 1 A | k x k 1 A n 1 A k n
39 breq1 x = k x n k n
40 39 elrab k x | x n k k n
41 40 anbi2i n 1 A k x | x n n 1 A k k n
42 35 38 41 3bitr4g A 0 A k 1 A n x 1 A | k x n 1 A k x | x n
43 elfznn k 1 A k
44 43 adantl A 0 A k 1 A k
45 vmacl k Λ k
46 44 45 syl A 0 A k 1 A Λ k
47 46 recnd A 0 A k 1 A Λ k
48 47 adantrr A 0 A k 1 A n x 1 A | k x Λ k
49 4 4 8 42 48 fsumcom2 A 0 A k = 1 A n x 1 A | k x Λ k = n = 1 A k x | x n Λ k
50 fsumconst x 1 A | k x Fin Λ k n x 1 A | k x Λ k = x 1 A | k x Λ k
51 8 47 50 syl2anc A 0 A k 1 A n x 1 A | k x Λ k = x 1 A | k x Λ k
52 fzfid A 0 A k 1 A 1 A k Fin
53 simpll A 0 A k 1 A A
54 eqid m 1 A k k m = m 1 A k k m
55 53 44 54 dvdsflf1o A 0 A k 1 A m 1 A k k m : 1 A k 1-1 onto x 1 A | k x
56 52 55 hasheqf1od A 0 A k 1 A 1 A k = x 1 A | k x
57 simpl A 0 A A
58 nndivre A k A k
59 57 43 58 syl2an A 0 A k 1 A A k
60 nngt0 k 0 < k
61 14 60 jca k k 0 < k
62 43 61 syl k 1 A k 0 < k
63 divge0 A 0 A k 0 < k 0 A k
64 62 63 sylan2 A 0 A k 1 A 0 A k
65 flge0nn0 A k 0 A k A k 0
66 59 64 65 syl2anc A 0 A k 1 A A k 0
67 hashfz1 A k 0 1 A k = A k
68 66 67 syl A 0 A k 1 A 1 A k = A k
69 56 68 eqtr3d A 0 A k 1 A x 1 A | k x = A k
70 69 oveq1d A 0 A k 1 A x 1 A | k x Λ k = A k Λ k
71 59 flcld A 0 A k 1 A A k
72 71 zcnd A 0 A k 1 A A k
73 72 47 mulcomd A 0 A k 1 A A k Λ k = Λ k A k
74 51 70 73 3eqtrd A 0 A k 1 A n x 1 A | k x Λ k = Λ k A k
75 74 sumeq2dv A 0 A k = 1 A n x 1 A | k x Λ k = k = 1 A Λ k A k
76 16 adantl A 0 A n 1 A n
77 vmasum n k x | x n Λ k = log n
78 76 77 syl A 0 A n 1 A k x | x n Λ k = log n
79 78 sumeq2dv A 0 A n = 1 A k x | x n Λ k = n = 1 A log n
80 49 75 79 3eqtr3d A 0 A k = 1 A Λ k A k = n = 1 A log n
81 3 80 eqtr4d A 0 A log A ! = k = 1 A Λ k A k