Metamath Proof Explorer


Theorem musum

Description: The sum of the Möbius function over the divisors of N gives one if N = 1 , but otherwise always sums to zero. Theorem 2.1 in ApostolNT p. 25. This makes the Möbius function useful for inverting divisor sums; see also muinv . (Contributed by Mario Carneiro, 2-Jul-2015)

Ref Expression
Assertion musum N k n | n N μ k = if N = 1 1 0

Proof

Step Hyp Ref Expression
1 fveq2 n = k μ n = μ k
2 1 neeq1d n = k μ n 0 μ k 0
3 breq1 n = k n N k N
4 2 3 anbi12d n = k μ n 0 n N μ k 0 k N
5 4 elrab k n | μ n 0 n N k μ k 0 k N
6 muval2 k μ k 0 μ k = 1 p | p k
7 6 adantrr k μ k 0 k N μ k = 1 p | p k
8 5 7 sylbi k n | μ n 0 n N μ k = 1 p | p k
9 8 adantl N k n | μ n 0 n N μ k = 1 p | p k
10 9 sumeq2dv N k n | μ n 0 n N μ k = k n | μ n 0 n N 1 p | p k
11 simpr μ n 0 n N n N
12 11 a1i N n μ n 0 n N n N
13 12 ss2rabdv N n | μ n 0 n N n | n N
14 ssrab2 n | μ n 0 n N
15 simpr N k n | μ n 0 n N k n | μ n 0 n N
16 14 15 sselid N k n | μ n 0 n N k
17 mucl k μ k
18 16 17 syl N k n | μ n 0 n N μ k
19 18 zcnd N k n | μ n 0 n N μ k
20 difrab n | n N n | μ n 0 n N = n | n N ¬ μ n 0 n N
21 pm3.21 n N μ n 0 μ n 0 n N
22 21 necon1bd n N ¬ μ n 0 n N μ n = 0
23 22 imp n N ¬ μ n 0 n N μ n = 0
24 23 a1i n n N ¬ μ n 0 n N μ n = 0
25 24 ss2rabi n | n N ¬ μ n 0 n N n | μ n = 0
26 20 25 eqsstri n | n N n | μ n 0 n N n | μ n = 0
27 26 sseli k n | n N n | μ n 0 n N k n | μ n = 0
28 fveqeq2 n = k μ n = 0 μ k = 0
29 28 elrab k n | μ n = 0 k μ k = 0
30 29 simprbi k n | μ n = 0 μ k = 0
31 27 30 syl k n | n N n | μ n 0 n N μ k = 0
32 31 adantl N k n | n N n | μ n 0 n N μ k = 0
33 fzfid N 1 N Fin
34 dvdsssfz1 N n | n N 1 N
35 33 34 ssfid N n | n N Fin
36 13 19 32 35 fsumss N k n | μ n 0 n N μ k = k n | n N μ k
37 fveq2 x = p | p k x = p | p k
38 37 oveq2d x = p | p k 1 x = 1 p | p k
39 35 13 ssfid N n | μ n 0 n N Fin
40 eqid n | μ n 0 n N = n | μ n 0 n N
41 eqid m n | μ n 0 n N p | p m = m n | μ n 0 n N p | p m
42 oveq1 q = p q pCnt x = p pCnt x
43 42 cbvmptv q q pCnt x = p p pCnt x
44 oveq2 x = m p pCnt x = p pCnt m
45 44 mpteq2dv x = m p p pCnt x = p p pCnt m
46 43 45 syl5eq x = m q q pCnt x = p p pCnt m
47 46 cbvmptv x q q pCnt x = m p p pCnt m
48 40 41 47 sqff1o N m n | μ n 0 n N p | p m : n | μ n 0 n N 1-1 onto 𝒫 p | p N
49 breq2 m = k p m p k
50 49 rabbidv m = k p | p m = p | p k
51 prmex V
52 51 rabex p | p k V
53 50 41 52 fvmpt k n | μ n 0 n N m n | μ n 0 n N p | p m k = p | p k
54 53 adantl N k n | μ n 0 n N m n | μ n 0 n N p | p m k = p | p k
55 neg1cn 1
56 prmdvdsfi N p | p N Fin
57 elpwi x 𝒫 p | p N x p | p N
58 ssfi p | p N Fin x p | p N x Fin
59 56 57 58 syl2an N x 𝒫 p | p N x Fin
60 hashcl x Fin x 0
61 59 60 syl N x 𝒫 p | p N x 0
62 expcl 1 x 0 1 x
63 55 61 62 sylancr N x 𝒫 p | p N 1 x
64 38 39 48 54 63 fsumf1o N x 𝒫 p | p N 1 x = k n | μ n 0 n N 1 p | p k
65 fzfid N 0 p | p N Fin
66 56 adantr N z 0 p | p N p | p N Fin
67 pwfi p | p N Fin 𝒫 p | p N Fin
68 66 67 sylib N z 0 p | p N 𝒫 p | p N Fin
69 ssrab2 s 𝒫 p | p N | s = z 𝒫 p | p N
70 ssfi 𝒫 p | p N Fin s 𝒫 p | p N | s = z 𝒫 p | p N s 𝒫 p | p N | s = z Fin
71 68 69 70 sylancl N z 0 p | p N s 𝒫 p | p N | s = z Fin
72 simprr N z 0 p | p N x s 𝒫 p | p N | s = z x s 𝒫 p | p N | s = z
73 fveqeq2 s = x s = z x = z
74 73 elrab x s 𝒫 p | p N | s = z x 𝒫 p | p N x = z
75 74 simprbi x s 𝒫 p | p N | s = z x = z
76 72 75 syl N z 0 p | p N x s 𝒫 p | p N | s = z x = z
77 76 ralrimivva N z 0 p | p N x s 𝒫 p | p N | s = z x = z
78 invdisj z 0 p | p N x s 𝒫 p | p N | s = z x = z Disj z = 0 p | p N s 𝒫 p | p N | s = z
79 77 78 syl N Disj z = 0 p | p N s 𝒫 p | p N | s = z
80 56 adantr N z 0 p | p N x s 𝒫 p | p N | s = z p | p N Fin
81 69 72 sselid N z 0 p | p N x s 𝒫 p | p N | s = z x 𝒫 p | p N
82 81 57 syl N z 0 p | p N x s 𝒫 p | p N | s = z x p | p N
83 80 82 ssfid N z 0 p | p N x s 𝒫 p | p N | s = z x Fin
84 83 60 syl N z 0 p | p N x s 𝒫 p | p N | s = z x 0
85 55 84 62 sylancr N z 0 p | p N x s 𝒫 p | p N | s = z 1 x
86 65 71 79 85 fsumiun N x z = 0 p | p N s 𝒫 p | p N | s = z 1 x = z = 0 p | p N x s 𝒫 p | p N | s = z 1 x
87 iunrab z = 0 p | p N s 𝒫 p | p N | s = z = s 𝒫 p | p N | z 0 p | p N s = z
88 56 adantr N s 𝒫 p | p N p | p N Fin
89 elpwi s 𝒫 p | p N s p | p N
90 89 adantl N s 𝒫 p | p N s p | p N
91 ssdomg p | p N Fin s p | p N s p | p N
92 88 90 91 sylc N s 𝒫 p | p N s p | p N
93 ssfi p | p N Fin s p | p N s Fin
94 56 89 93 syl2an N s 𝒫 p | p N s Fin
95 hashdom s Fin p | p N Fin s p | p N s p | p N
96 94 88 95 syl2anc N s 𝒫 p | p N s p | p N s p | p N
97 92 96 mpbird N s 𝒫 p | p N s p | p N
98 hashcl s Fin s 0
99 94 98 syl N s 𝒫 p | p N s 0
100 nn0uz 0 = 0
101 99 100 eleqtrdi N s 𝒫 p | p N s 0
102 hashcl p | p N Fin p | p N 0
103 56 102 syl N p | p N 0
104 103 adantr N s 𝒫 p | p N p | p N 0
105 104 nn0zd N s 𝒫 p | p N p | p N
106 elfz5 s 0 p | p N s 0 p | p N s p | p N
107 101 105 106 syl2anc N s 𝒫 p | p N s 0 p | p N s p | p N
108 97 107 mpbird N s 𝒫 p | p N s 0 p | p N
109 eqidd N s 𝒫 p | p N s = s
110 eqeq2 z = s s = z s = s
111 110 rspcev s 0 p | p N s = s z 0 p | p N s = z
112 108 109 111 syl2anc N s 𝒫 p | p N z 0 p | p N s = z
113 112 ralrimiva N s 𝒫 p | p N z 0 p | p N s = z
114 rabid2 𝒫 p | p N = s 𝒫 p | p N | z 0 p | p N s = z s 𝒫 p | p N z 0 p | p N s = z
115 113 114 sylibr N 𝒫 p | p N = s 𝒫 p | p N | z 0 p | p N s = z
116 87 115 eqtr4id N z = 0 p | p N s 𝒫 p | p N | s = z = 𝒫 p | p N
117 116 sumeq1d N x z = 0 p | p N s 𝒫 p | p N | s = z 1 x = x 𝒫 p | p N 1 x
118 elfznn0 z 0 p | p N z 0
119 118 adantl N z 0 p | p N z 0
120 expcl 1 z 0 1 z
121 55 119 120 sylancr N z 0 p | p N 1 z
122 fsumconst s 𝒫 p | p N | s = z Fin 1 z x s 𝒫 p | p N | s = z 1 z = s 𝒫 p | p N | s = z 1 z
123 71 121 122 syl2anc N z 0 p | p N x s 𝒫 p | p N | s = z 1 z = s 𝒫 p | p N | s = z 1 z
124 75 adantl N z 0 p | p N x s 𝒫 p | p N | s = z x = z
125 124 oveq2d N z 0 p | p N x s 𝒫 p | p N | s = z 1 x = 1 z
126 125 sumeq2dv N z 0 p | p N x s 𝒫 p | p N | s = z 1 x = x s 𝒫 p | p N | s = z 1 z
127 elfzelz z 0 p | p N z
128 hashbc p | p N Fin z ( p | p N z) = s 𝒫 p | p N | s = z
129 56 127 128 syl2an N z 0 p | p N ( p | p N z) = s 𝒫 p | p N | s = z
130 129 oveq1d N z 0 p | p N ( p | p N z) 1 z = s 𝒫 p | p N | s = z 1 z
131 123 126 130 3eqtr4d N z 0 p | p N x s 𝒫 p | p N | s = z 1 x = ( p | p N z) 1 z
132 131 sumeq2dv N z = 0 p | p N x s 𝒫 p | p N | s = z 1 x = z = 0 p | p N ( p | p N z) 1 z
133 1pneg1e0 1 + -1 = 0
134 133 oveq1i 1 + -1 p | p N = 0 p | p N
135 binom1p 1 p | p N 0 1 + -1 p | p N = z = 0 p | p N ( p | p N z) 1 z
136 55 103 135 sylancr N 1 + -1 p | p N = z = 0 p | p N ( p | p N z) 1 z
137 134 136 eqtr3id N 0 p | p N = z = 0 p | p N ( p | p N z) 1 z
138 eqeq2 1 = if N = 1 1 0 0 p | p N = 1 0 p | p N = if N = 1 1 0
139 eqeq2 0 = if N = 1 1 0 0 p | p N = 0 0 p | p N = if N = 1 1 0
140 nprmdvds1 p ¬ p 1
141 simpr N N = 1 N = 1
142 141 breq2d N N = 1 p N p 1
143 142 notbid N N = 1 ¬ p N ¬ p 1
144 140 143 syl5ibr N N = 1 p ¬ p N
145 144 ralrimiv N N = 1 p ¬ p N
146 rabeq0 p | p N = p ¬ p N
147 145 146 sylibr N N = 1 p | p N =
148 147 fveq2d N N = 1 p | p N =
149 hash0 = 0
150 148 149 eqtrdi N N = 1 p | p N = 0
151 150 oveq2d N N = 1 0 p | p N = 0 0
152 0exp0e1 0 0 = 1
153 151 152 eqtrdi N N = 1 0 p | p N = 1
154 df-ne N 1 ¬ N = 1
155 eluz2b3 N 2 N N 1
156 155 biimpri N N 1 N 2
157 154 156 sylan2br N ¬ N = 1 N 2
158 exprmfct N 2 p p N
159 157 158 syl N ¬ N = 1 p p N
160 rabn0 p | p N p p N
161 159 160 sylibr N ¬ N = 1 p | p N
162 56 adantr N ¬ N = 1 p | p N Fin
163 hashnncl p | p N Fin p | p N p | p N
164 162 163 syl N ¬ N = 1 p | p N p | p N
165 161 164 mpbird N ¬ N = 1 p | p N
166 165 0expd N ¬ N = 1 0 p | p N = 0
167 138 139 153 166 ifbothda N 0 p | p N = if N = 1 1 0
168 132 137 167 3eqtr2d N z = 0 p | p N x s 𝒫 p | p N | s = z 1 x = if N = 1 1 0
169 86 117 168 3eqtr3d N x 𝒫 p | p N 1 x = if N = 1 1 0
170 64 169 eqtr3d N k n | μ n 0 n N 1 p | p k = if N = 1 1 0
171 10 36 170 3eqtr3d N k n | n N μ k = if N = 1 1 0