Dedekind Sums Reciprocity with Cotangent Sums

We have already seen two ways to understand Dedekind reciprocity. The Carlitz generating-function proof starts with a rational line and follows its finite lattice staircase: horizontal and vertical edges cancel in pairs, leaving only endpoint terms. The direct Bernoulli proof unfolds the staircase into a finite rectangle and then determines the answer by its variation and average. The cotangent proof looks very different at first, because it uses a meromorphic function rather than lattice points. But it is really another encoding of the same cancellation. The finite Fourier transform converts the periodic sawtooth values along the staircase into cotangents. The two reciprocal Dedekind sums then appear as the residues from two families of nonzero poles, while the elementary rational term in the reciprocity law comes from the one common pole at the origin. Thus the pole at the origin plays exactly the role that the endpoint contribution played in the Carlitz identity.

Let h,k be coprime positive integers. The ordinary Dedekind sum is

\displaystyle s(h,k):=\sum_{r=1}^{k-1}\Big(\Big(\frac{r}{k}\Big)\Big)\Big(\Big(\frac{hr}{k}\Big)\Big),

where \displaystyle ((x))=\{x\}-\frac12 when x\notin\mathbb Z , and \displaystyle ((x))=0 when x\in\mathbb Z . We shall prove

\displaystyle s(h,k)+s(k,h)=-\frac14+\frac1{12}\Big(\frac{h}{k}+\frac{k}{h}+\frac1{hk}\Big).

The proof has two parts. First, we show that a Dedekind sum is a finite cotangent sum. Second, we put the two cotangent sums into one contour integral.

Define a function on the residue classes modulo k by \displaystyle f(r):=((r/k)) . Thus f(0)=0 , while \displaystyle f(r)=r/k-1/2 for 1\le r\le k-1 . For 0\le n\le k-1 , use the finite Fourier transform

\displaystyle \widehat f(n):=\sum_{r=0}^{k-1}f(r)\exp\Big(-\frac{2\pi i nr}{k}\Big).

The coefficient at n=0 vanishes because the sawtooth values have mean zero. Now fix 1\le n\le k-1 , and put \displaystyle \zeta:=\exp(-2\pi i n/k) . Then \zeta^k=1 and \zeta\ne1 . The finite geometric series and its derivative give

\displaystyle \sum_{r=1}^{k-1}\zeta^r=-1,\quad \sum_{r=1}^{k-1}r\zeta^r=-\frac{k}{1-\zeta}.

Consequently,

\displaystyle \begin{aligned} \widehat f(n) &=\sum_{r=1}^{k-1}\left(\frac{r}{k}-\frac12\right)\zeta^r \\ &=-\frac{1}{1-\zeta}+\frac12\\ &=\frac{i}{2}\cot\Big(\frac{\pi n}{k}\Big). \end{aligned}

The important point is that the cotangent is not introduced mysteriously. It is simply the finite Fourier transform of the periodic linear function ((r/k)) . The arithmetic oscillation of the sawtooth is being expressed in its frequency variables.

Apply finite Parseval to f(r) and f(hr) . Since multiplication by h permutes the residues modulo k , the Fourier transform of r\mapsto f(hr) is \widehat f(n\bar h) , where \bar h is an inverse of h modulo k . Reindexing the resulting sum gives

\displaystyle s(h,k)=\frac1{4k}\sum_{r=1}^{k-1}\cot\Big(\frac{\pi r}{k}\Big)\cot\Big(\frac{\pi hr}{k}\Big).

This is the cotangent form of the Dedekind sum. It is the exact analytic translation of the finite lattice statistic on the left.

Consider the function \displaystyle F(z):=\cot(\pi hz)\cot(\pi kz)\cot(\pi z).

The third cotangent factor is essential. It has no extra nonzero pole family inside one period strip, but at the origin it contributes exactly the 1/(hk) term in the reciprocity formula. The function F is periodic with period 1 . Take a rectangle with vertical sides \text{Re}(z)=-\varepsilon and \text{Re}(z)=1-\varepsilon , and horizontal sides \text{Im}(z)=\pm T , where 0<\varepsilon<1 is small. Inside this rectangle are the pole at z=0 , the poles r/h for 1\le r\le h-1 , and the poles s/k for 1\le s\le k-1 .

The nonzero poles from the first two families do not overlap. Indeed, if r/h=s/k , then kr=hs . Coprimality of h and k would force h\mid r , impossible when 1\le r<h . Thus all nonzero poles are simple. The vertical integrals cancel by 1 -periodicity. On the upper edge, each cotangent tends uniformly to -i , so F(z)\to(-i)^3=i . Since the upper edge is traversed from right to left, its limiting contribution is -i . On the lower edge, each cotangent tends to i , so F(z)\to i^3=-i ; the lower edge is traversed from left to right, and its limiting contribution is again -i . Therefore

\displaystyle \lim_{T\to\infty}\int_{\partial R_T}F(z) dz=-2i.

The residue theorem now gives the basic bookkeeping identity

\displaystyle \sum_{\text{poles in one period strip}}\text{Res} F=\lim_{T\to\infty} \frac{1}{2\pi i} \int_{\partial R_T}F(z) dz=-\frac1\pi.

At a pole z=r/h , only \cot(\pi hz) is singular, and its residue is 1/(\pi h) . Hence

\displaystyle \text{Res}_{z=r/h}F(z)=\frac1{\pi h}\cot\Big(\frac{\pi kr}{h}\Big)\cot\Big(\frac{\pi r}{h}\Big).

After summing over r=1,\dots,h-1 and using the cotangent formula, we get

\displaystyle \sum_{r=1}^{h-1}\text{Res}_{z=r/h}F(z)=\frac4\pi s(k,h).

Likewise, the poles at z=s/k contribute

\displaystyle \sum_{s=1}^{k-1}\text{Res}_{z=s/k}F(z)=\frac4\pi s(h,k).

These two families are the analytic versions of the two reciprocal staircases in the Carlitz proof. Each family consists of the rational fractions associated with one denominator, and each total residue is exactly the corresponding Dedekind sum.

It remains to compute the residue at z=0 . The Laurent expansion is

\displaystyle \cot(\pi mz)=\frac1{\pi mz}-\frac{\pi mz}{3}+O(z^3).

To obtain the coefficient of z^{-1} in the product of the three cotangents, we must take the linear term from exactly one factor and the principal z^{-1} terms from the other two. Taking the linear term from the h -factor contributes

\displaystyle -\frac{\pi hz}{3}\cdot\frac1{\pi kz}\cdot\frac1{\pi z}=-\frac{h}{3\pi k}\frac1z.

The analogous choices from the k -factor and the final factor contribute \displaystyle -\frac{k}{3\pi h}\frac1z and \displaystyle -\frac1{3\pi hk}\frac1z . Thus

\displaystyle \text{Res}_{z=0}F(z)=-\frac1{3\pi}\Big(\frac{h}{k}+\frac{k}{h}+\frac1{hk}\Big).

This is the analytic counterpart of the endpoint term in the Carlitz identity. All the complicated arithmetic has been assigned to the two nonzero pole families. The remaining correction is determined locally by the common corner z=0 .

Adding the residues from the two nonzero families and from the origin gives

\displaystyle \frac4\pi\big(s(h,k)+s(k,h)\big)-\frac1{3\pi}\Big(\frac{h}{k}+\frac{k}{h}+\frac1{hk}\Big)=-\frac1\pi.

Multiplying by \pi/4 proves

\displaystyle s(h,k)+s(k,h)=-\frac14+\frac1{12}\Big(\frac{h}{k}+\frac{k}{h}+\frac1{hk}\Big).

The Carlitz proof, the direct Bernoulli-averaging proof, and the cotangent-residue proof all have the same shape beneath their different notation. In the Carlitz identity, the two staircases meet along a path, and all interior vertices cancel. In the direct Bernoulli proof, the two sums unfold into a rectangle, and the interior variation is controlled by periodicity and averaging. In the residue proof, the two nonzero pole families produce the two boundary sums, while the common origin produces the endpoint correction. The three proofs are therefore three ways of saying the same thing: reciprocity is the exact identity left behind after the interior contributions cancel.

Leave a comment