Metamath Proof Explorer


Theorem dchrsum2

Description: An orthogonality relation for Dirichlet characters: the sum of all the values of a Dirichlet character X is 0 if X is non-principal and phi ( n ) otherwise. Part of Theorem 6.5.1 of Shapiro p. 230. (Contributed by Mario Carneiro, 28-Apr-2016)

Ref Expression
Hypotheses dchrsum.g G = DChr N
dchrsum.z Z = /N
dchrsum.d D = Base G
dchrsum.1 1 ˙ = 0 G
dchrsum.x φ X D
dchrsum2.u U = Unit Z
Assertion dchrsum2 φ a U X a = if X = 1 ˙ ϕ N 0

Proof

Step Hyp Ref Expression
1 dchrsum.g G = DChr N
2 dchrsum.z Z = /N
3 dchrsum.d D = Base G
4 dchrsum.1 1 ˙ = 0 G
5 dchrsum.x φ X D
6 dchrsum2.u U = Unit Z
7 eqeq2 ϕ N = if X = 1 ˙ ϕ N 0 a U X a = ϕ N a U X a = if X = 1 ˙ ϕ N 0
8 eqeq2 0 = if X = 1 ˙ ϕ N 0 a U X a = 0 a U X a = if X = 1 ˙ ϕ N 0
9 fveq1 X = 1 ˙ X a = 1 ˙ a
10 1 3 dchrrcl X D N
11 5 10 syl φ N
12 11 adantr φ a U N
13 simpr φ a U a U
14 1 2 4 6 12 13 dchr1 φ a U 1 ˙ a = 1
15 9 14 sylan9eqr φ a U X = 1 ˙ X a = 1
16 15 an32s φ X = 1 ˙ a U X a = 1
17 16 sumeq2dv φ X = 1 ˙ a U X a = a U 1
18 2 6 znunithash N U = ϕ N
19 11 18 syl φ U = ϕ N
20 11 phicld φ ϕ N
21 20 nnnn0d φ ϕ N 0
22 19 21 eqeltrd φ U 0
23 6 fvexi U V
24 hashclb U V U Fin U 0
25 23 24 ax-mp U Fin U 0
26 22 25 sylibr φ U Fin
27 ax-1cn 1
28 fsumconst U Fin 1 a U 1 = U 1
29 26 27 28 sylancl φ a U 1 = U 1
30 19 oveq1d φ U 1 = ϕ N 1
31 20 nncnd φ ϕ N
32 31 mulid1d φ ϕ N 1 = ϕ N
33 29 30 32 3eqtrd φ a U 1 = ϕ N
34 33 adantr φ X = 1 ˙ a U 1 = ϕ N
35 17 34 eqtrd φ X = 1 ˙ a U X a = ϕ N
36 1 dchrabl N G Abel
37 ablgrp G Abel G Grp
38 3 4 grpidcl G Grp 1 ˙ D
39 11 36 37 38 4syl φ 1 ˙ D
40 1 2 3 6 5 39 dchreq φ X = 1 ˙ k U X k = 1 ˙ k
41 40 notbid φ ¬ X = 1 ˙ ¬ k U X k = 1 ˙ k
42 rexnal k U ¬ X k = 1 ˙ k ¬ k U X k = 1 ˙ k
43 41 42 bitr4di φ ¬ X = 1 ˙ k U ¬ X k = 1 ˙ k
44 df-ne X k 1 ˙ k ¬ X k = 1 ˙ k
45 11 adantr φ k U N
46 simpr φ k U k U
47 1 2 4 6 45 46 dchr1 φ k U 1 ˙ k = 1
48 47 neeq2d φ k U X k 1 ˙ k X k 1
49 26 adantr φ k U X k 1 U Fin
50 eqid Base Z = Base Z
51 1 2 3 50 5 dchrf φ X : Base Z
52 50 6 unitss U Base Z
53 52 sseli a U a Base Z
54 ffvelrn X : Base Z a Base Z X a
55 51 53 54 syl2an φ a U X a
56 55 adantlr φ k U X k 1 a U X a
57 49 56 fsumcl φ k U X k 1 a U X a
58 0cnd φ k U X k 1 0
59 51 adantr φ k U X k 1 X : Base Z
60 simprl φ k U X k 1 k U
61 52 60 sselid φ k U X k 1 k Base Z
62 59 61 ffvelrnd φ k U X k 1 X k
63 subcl X k 1 X k 1
64 62 27 63 sylancl φ k U X k 1 X k 1
65 simprr φ k U X k 1 X k 1
66 subeq0 X k 1 X k 1 = 0 X k = 1
67 62 27 66 sylancl φ k U X k 1 X k 1 = 0 X k = 1
68 67 necon3bid φ k U X k 1 X k 1 0 X k 1
69 65 68 mpbird φ k U X k 1 X k 1 0
70 oveq2 x = a k Z x = k Z a
71 70 fveq2d x = a X k Z x = X k Z a
72 71 cbvsumv x U X k Z x = a U X k Z a
73 1 2 3 dchrmhm D mulGrp Z MndHom mulGrp fld
74 73 5 sselid φ X mulGrp Z MndHom mulGrp fld
75 74 ad2antrr φ k U X k 1 a U X mulGrp Z MndHom mulGrp fld
76 61 adantr φ k U X k 1 a U k Base Z
77 53 adantl φ k U X k 1 a U a Base Z
78 eqid mulGrp Z = mulGrp Z
79 78 50 mgpbas Base Z = Base mulGrp Z
80 eqid Z = Z
81 78 80 mgpplusg Z = + mulGrp Z
82 eqid mulGrp fld = mulGrp fld
83 cnfldmul × = fld
84 82 83 mgpplusg × = + mulGrp fld
85 79 81 84 mhmlin X mulGrp Z MndHom mulGrp fld k Base Z a Base Z X k Z a = X k X a
86 75 76 77 85 syl3anc φ k U X k 1 a U X k Z a = X k X a
87 86 sumeq2dv φ k U X k 1 a U X k Z a = a U X k X a
88 72 87 syl5eq φ k U X k 1 x U X k Z x = a U X k X a
89 fveq2 a = k Z x X a = X k Z x
90 11 nnnn0d φ N 0
91 2 zncrng N 0 Z CRing
92 crngring Z CRing Z Ring
93 eqid mulGrp Z 𝑠 U = mulGrp Z 𝑠 U
94 6 93 unitgrp Z Ring mulGrp Z 𝑠 U Grp
95 90 91 92 94 4syl φ mulGrp Z 𝑠 U Grp
96 eqid b U c U b Z c = b U c U b Z c
97 6 93 unitgrpbas U = Base mulGrp Z 𝑠 U
98 93 81 ressplusg U V Z = + mulGrp Z 𝑠 U
99 23 98 ax-mp Z = + mulGrp Z 𝑠 U
100 96 97 99 grplactf1o mulGrp Z 𝑠 U Grp k U b U c U b Z c k : U 1-1 onto U
101 95 60 100 syl2an2r φ k U X k 1 b U c U b Z c k : U 1-1 onto U
102 96 97 grplactval k U x U b U c U b Z c k x = k Z x
103 60 102 sylan φ k U X k 1 x U b U c U b Z c k x = k Z x
104 89 49 101 103 56 fsumf1o φ k U X k 1 a U X a = x U X k Z x
105 49 62 56 fsummulc2 φ k U X k 1 X k a U X a = a U X k X a
106 88 104 105 3eqtr4rd φ k U X k 1 X k a U X a = a U X a
107 57 mulid2d φ k U X k 1 1 a U X a = a U X a
108 106 107 oveq12d φ k U X k 1 X k a U X a 1 a U X a = a U X a a U X a
109 57 subidd φ k U X k 1 a U X a a U X a = 0
110 108 109 eqtrd φ k U X k 1 X k a U X a 1 a U X a = 0
111 1cnd φ k U X k 1 1
112 62 111 57 subdird φ k U X k 1 X k 1 a U X a = X k a U X a 1 a U X a
113 64 mul01d φ k U X k 1 X k 1 0 = 0
114 110 112 113 3eqtr4d φ k U X k 1 X k 1 a U X a = X k 1 0
115 57 58 64 69 114 mulcanad φ k U X k 1 a U X a = 0
116 115 expr φ k U X k 1 a U X a = 0
117 48 116 sylbid φ k U X k 1 ˙ k a U X a = 0
118 44 117 syl5bir φ k U ¬ X k = 1 ˙ k a U X a = 0
119 118 rexlimdva φ k U ¬ X k = 1 ˙ k a U X a = 0
120 43 119 sylbid φ ¬ X = 1 ˙ a U X a = 0
121 120 imp φ ¬ X = 1 ˙ a U X a = 0
122 7 8 35 121 ifbothda φ a U X a = if X = 1 ˙ ϕ N 0