# What do theta functions have to do with quadratic reciprocity?

The theta function is the analytic function $\theta:U\to\mathbb{C}$ defined on the (open) right half-plane $U\subset\mathbb{C}$ by $\theta(\tau)=\sum_{n\in\mathbb{Z}}e^{-\pi n^2 \tau}$. It has the following important transformation property.

Theta reciprocity: $\theta(\tau)=\frac{1}{\sqrt{\tau}}\theta\left(\frac{1}{\tau}\right)$.

This theorem, while fundamentally analytic—the proof is just Poisson summation coupled with the fact that a Gaussian is its own Fourier transform—has serious arithmetic significance.

• It is the key ingredient in the proof of the functional equation of the Riemann zeta function.

• It expresses the automorphy of the theta function.

Theta reciprocity also provides an analytic proof (actually, the only proof, as far as I know) of the Landsberg-Schaar relation

$$\frac{1}{\sqrt{p}}\sum_{n=0}^{p-1}\exp\left(\frac{2\pi i n^2 q}{p}\right)=\frac{e^{\pi i/4}}{\sqrt{2q}}\sum_{n=0}^{2q-1}\exp\left(-\frac{\pi i n^2 p}{2q}\right)$$

where $p$ and $q$ are arbitrary positive integers. To prove it, apply theta reciprocity to $\tau=2iq/p+\epsilon$, $\epsilon>0$, and then let $\epsilon\to 0$.

This reduces to the formula for the quadratic Gauss sum when $q=1$:

$$\sum_{n=0}^{p-1} e^{2 \pi i n^2 / p} = \begin{cases} \sqrt{p} & \textrm{if } \; p\equiv 1\mod 4 \\\ i\sqrt{p} & \textrm{if } \; p\equiv 3\mod 4 \end{cases}$$

(where $p$ is an odd prime). From this, it's not hard to deduce Gauss's "golden theorem".

Quadratic reciprocity: $\left(\frac{p}{q}\right)\left(\frac{q}{p}\right)=(-1)^{(p-1)(q-1)/4}$ for odd primes $p$ and $q$.

For reference, this is worked out in detail in the paper "Applications of heat kernels on abelian groups: $\zeta(2n)$, quadratic reciprocity, Bessel integrals" by Anders Karlsson.

I feel like there is some deep mathematics going on behind the scenes here, but I don't know what.

Why should we expect theta reciprocity to be related to quadratic reciprocity? Is there a high-concept explanation of this phenomenon? If there is, can it be generalized to other reciprocity laws (like Artin reciprocity)?

Hopefully some wise number theorist can shed some light on this!

• Reminds me of how the modular transformation law for the Dedekind $eta$ function gives rise to Dedekind sums which have their own reciprocity law from which quadratic reciprocity can be derived. Commented Jan 28, 2013 at 1:36
• Interesting! I didn't know about Dedekind sums. I'll have to read up on this some time soon. Yet another piece of the grand puzzle... Commented Jan 28, 2013 at 21:12
• @AleksandarBahat, it's not clear whether or not, since you'd already "accepted an answer", my further "answer" (below) would cause you to get pinged by the system. I'm hoping that a "comment" will do so. Commented Jul 17, 2013 at 1:30
• @paulgarrett Thank you for your (very thorough) answer. Commented Aug 1, 2013 at 1:09
• Aleksandar, you are very welcome. These things are very interesting, and/but non-trivial to extract from the literature. I am glad whenever my own "suffering to understand" over the years can benefit others, and diminish the need to repeat such "suffering"! :) Commented Aug 1, 2013 at 1:31

Going in the direction of more generality:

With $\theta(\tau)=\sum_n\exp(\pi i n^2 \tau)$, theta reciprocity describes how the function behaves under the linear fractional transformation $[\begin{smallmatrix} 0&1 \\ -1&0\end{smallmatrix}]$. From this one can show it's an automorphic form (of half integral weight, on a congruence subgroup). Automorphic forms and more generally automorphic representations are linked by the Langlands program to a very general approach to a non-abelian class field theory. Your "Why should we expect ..." question is dead-on. This is very deep and surprising stuff.

In the direction of more specificity, the connection to the heat kernel is fascinating. (In this context, Serge Lang was a great promoter of 'the ubiquitous heat kernel.') The theta function proof is also discussed in Dym and McKean's 1972 book "Fourier Series and Integrals" and in Richard Bellman's 1961 book "A Brief Introduction to Theta Functions." Bellman points out that theta reciprocity is a remarkable consequence of the fact that when the theta function is extended to two variables, both sides of the reciprocity law are solutions to the heat equation. One is, for $t\to 0$ what physicists call a 'similarity solution' while the other is, for $t\to \infty$ the separation of variables solution. By the uniqueness theorem for solutions to PDEs, the two sides must be equal!

A special case of quadratic reciprocity is that an odd prime $p$ is a sum of two squares if and only if $p\equiv 1\bmod 4$. This can be be done via the theta function and is in fact given in Jacobi's original 1829 book "Fundamenta nova theoriae functionum ellipticarum."

• Re your first para: here is something I've never understood. $\theta$ has half-integral weight, so is an automorphic form not on $GL(2)$ or $GL(1)$ but on some metaplectic group. My understanding is that it is not clear what the link is between the representation theory of the metaplectic group, and Galois representations (because the metaplectic group is not an algebraic group so the general yoga doesn't apply), so although your first para sounds appealing from some "general overview" point of view, I am always very confused about the actual details of what is going on--can you supply them? Commented Jan 28, 2013 at 22:01

One way a person could stumble on quadratic reciprocity while looking at theta functions is by trying to prove that Weil's construction of an adelic "Segal-Shale-Weil/oscillator representation" really is a representation, and really produces automorphic forms. This would lead a person to see that certain products of local characters must be Hecke characters... and that Poisson summation exactly proves this.

In somewhat more detail: given a local field $k$ (maybe not char 2), the "basic" local Segal-Shale-Weil repn is a repn of a two-fold cover $Mp_1(k)$ on Schwartz functions on $k$. For $K$ either a quadratic extension of $k$ or $k\oplus k$, the analogous repn of $Mp_1(k)$ descends to $SL_2(k)$, since the relevant cycle "splits". Without even knowing how to verify that splitting, one could still just try to directly assemble this local repn from a Bruhat decomposition and from the action of the standard unipotent radical, the standard Levi, and the Weyl element.

That is, with the rough idea that the Weyl element should be Fourier transform, up to sign..., that the Levi component should act by dilation, up to maybe a character and a norm to make the operator unitary, and that the unipotent radical should act by multiplication by a quadratic exponential... (which one might get from the repn of the Lie algebra of $SL_2(\mathbb R)$ on various function spaces on $\mathbb R$!!!)... one sees that for these pieces to fit together to make a repn, the Levi action is indeed not just dilation (with adjustment by norm), but twisted by the norm residue character attached to $K/k$. This gives a repn of $O(N_{K/k})\times SL_2(k)$ viewing the norm as a quadratic form on $K$.

When the local situation arises across all places from a number field extension $K/k$ (or function field, too, tho' eschewing char$=2$), one can try to apply this to the global pair $O(N_{K/k})\times SL_2(k)$ to make binary theta series and "special waveforms" by lifting Hecke characters from the adele group of $SO(K/k)$ to the adele group of $SL_2(k)$. This is the smallest interesting "theta correspondence", and the holomorphic case was known to Hecke, and the waveform case was Maass' thesis, though of course they wrote things classically and over $\mathbb Q$.

To a Schwartz function $\varphi$ on the adeles of $K$ attach a "theta kernel" by $\theta_\varphi(g,h)=\sum_{\lambda\in K} \big((g,h)\cdot \varphi\big)(x+\lambda)$ where $g,h$ are in the adelized $SL_2(k)$ and $O(N_{K/k})$. This is immediately invariant under the action of the rational points of $O(N_{K/k})$, but it is not obvious that it is invariant under $SL_2(k)$. But, as expected (!), one can verify that it is.

One point is that the character by which the Levi acts is a Hecke character. If not, the theta kernel will not be suitably invariant... but/and one uses Poisson summation and natural computations to prove that it is a Hecke character. Great! That is, one proves that the product of the local norm residue symbols is a Hecke character. From this, one proves the corresponding reciprocity for the quadratic Hilbert symbols, and then for quadratic symbols.

The argument is not as short as one might wish... but is fairly natural.

I did not quite see/find exactly that argument in Weil, despite looking again later, perhaps because of the style of his piece, but/and I'm sure he would say it is implicit, and one sees that it must be.

After I went through the above story first-hand years ago, I wrote up the spin-off that proves quadratic reciprocity over global fields not char zero... a recently-slightly-revised version is at http://www.math.umn.edu/~garrett/m/v/quad_rec_02.pdf

Hecke generalized the argument that you mention to prove quadratic reciprocity relative to any given number field $K$ (see, e.g. his Lectures on the Theory of Algebraic Numbers).

In The Fourier-Analytic Proof of Quadratic Reciprocity Michael C. Berg describes the subsequent development of this line of research. Quoting from the book's summary:

The relative quadratic case was first settled by Hecke in 1923, then recast by Weil in 1964 into the language of unitary group representations. The analytic proof of the general n-th order case is still an open problem today, going back to the end of Hecke's famous treatise of 1923.

• I'll add Hecke's quote on p.201 (in my English translation): "precise knowledge of the behavior of an analytic function in the neighborhood of its singular points is a source of number-theoretic theorems." Commented Jan 28, 2013 at 1:31
• I've heard of Hecke's generalization before, but I still feel my "Why should we expect..." question is unresolved. Although the usefulness of analytic functions in number theory is no longer surprising to me, I'd like to understand specifically why somebody would see quadratic reciprocity and think, "Hmm, $\theta(z)=z^{-1/2}\theta(1/z)$ is relevant." Why this piece of analysis in particular? Commented Jan 31, 2013 at 14:18

I think you're looking for the work of Tomio Kubota.

1. The square of the theta function is a modular form. For a while, and still today, the theta function itself is sometimes considered a modular form "of half-integral weight".

However, mostly through work of André Weil, it was then understood that $$\operatorname{SL}_2$$ of the adèles of a number field admits a degree 2 central extension, the metaplectic extension. Other answers have mentioned this. The theta function is then most elegantly understood as an automorphic form not for $$\operatorname{SL}_2$$ itself, but for this central extension.

People like Calvis C. Moore, Matsumoto, Steinberg and Kubota have then discovered that the cocycle describing this central extension (recall that central extensions of groups are classified by cohomology classes in $$H^2$$ of group cohomology) permits a simple expression in terms of the classical Hilbert symbol. You can find out more about this if you google for "Kubota cocycle" formula (or just look it up in the book of Kubota cited below).

Once you phrase quadratic reciprocity as Hilbert reciprocity for Q, quadratic reciprocity then becomes equivalent to the statement that the central extension splits when $$\operatorname{SL}_2$$ is pulled back along the diagonal ring map $$\mathbb{Q}^{\times} \hookrightarrow$$ adèles.

But if this holds, it should be reflected by a property of the automorphic form that is the theta series. And indeed, unravelling this leads you exactly to the observation you're making about theta reciprocity.

1. The same people then discovered that the adèles of any number field possess a unique topological central extension, then also called metaplectic extension. In general it is a central extension of $$\operatorname{SL}_2$$ of degree equal to the number of roots of unity in the number field

(so for Q, where +1 and -1 are the only roots of unity, so this is a degree 2 covering)

There is a corresponding theory of modular forms for these extensions. They are in general called metaplectic forms. There is a very important foundational paper by Kazhdan-Patterson about this (Metaplectic Forms, Publ IHES). (beware of a sign mistake, explained in follow-up literature, or ask Daniel Bump or Ben Brubaker about this)

It is very hard to get much explicit control for this type of metaplectic form. Anyway, Kubota's little book https://repository.kulib.kyoto-u.ac.jp/dspace/bitstream/2433/84907/1/Lectures_in_Mathematics_2.pdf (Automorphic Forms and Reciprocity Law for Number Fields) shows that nonzero metaplectic forms really exist, but the proof is less explicit than you might like. Patterson has some papers about explicit formulae for number fields with a primitive third root of unity. It's all very intimidating stuff, and the whole field is notorious for how easily sign (or worse) mistakes slip into computations. It's the kind of maths which can only be done by super-careful people.

Anyway. The much-desired theta reciprocity law for general (degree n) metaplectic theta series for arbitrary number fields with a primitive n-th root of unity has still not been found (as of April 2024). But it should exist. For a general number field, the Hilbert reciprocity law should follow. This would be a spectacular result, at least if you manage to bypass using class field theory as input.

Sadly, not very many mathematicians are still active in this quest. Some of the leading figures are retired or have passed away. Still, it would be absolutely spectacular.

At present, it's difficult even to just run experiments, for our ability to explicitly do computations with metaplectic forms is far too limited. Contact people like Brubaker, Weissman or perhaps Toshiaki Suzuki for more on this. Stay strong!

1. I've talked a lot about $$\operatorname{SL}_2$$, but you can do all this for more general groups, look at work of Weissman or the famous paper Brylinski-Deligne on central extensions by $$K_2$$. However, if you only want the connection between reciprocity laws and theta series, the $$\operatorname{SL}_2$$ situation should be enough for all you want. In this setting, the central extension is essentially unique, so you can ignore all of the Brylinski-Deligne structure theory.

This is not an answer but a comment concerning the Landsberg-Schaar relation (LS). It admits not only analytic proof. The article A proof of the Landsberg-Schaar relation by finite methods by Ben Moore gives an elementary proof of the LS. But this proof is unreasonably complicated. The LS can be proven in two lines.

It is well known that an arbitrary complex-valued function $$f$$ is represented by its finite (discrete) Fourier series $$f(x)=\sum\limits_{k=0}^{n-1}\widehat{f}_n(k)e\left(\frac{kx}{n}\right)\qquad(0\le x with finite Fourier coefficients $$\widehat{f}_n(k)=\dfrac{1}{n}\sum\limits_{x=0}^{n-1}f(x)e\left(-\frac{kx}{n}\right)\qquad(0\le k where $$e(t)=e^{2\pi it}$$. The first step is “A Discrete Analog of the Poisson Summation Formula”: if $$n=n_1n_2$$ then $$\sum\limits_{x=0}^{n_2-1}f(n_1x)=n_2 \sum\limits_{x=0}^{n_1-1}\widehat{f}_n(n_2x).$$ It follows directly from the formula for $$\widehat{f}_n(k)$$.

The function $$f(x)=e\left(x^2/( 4pq)\right)$$ is periodic with the period $$n=2pq$$ and \begin{align*} \widehat{f}_{2pq}(k)=&\frac{1}{ 2pq}\sum_{y=0}^{2pq-1}e\left(\frac{y^2-2ky}{ 4pq}\right)=\frac{1}{ 2pq}\sum_{y=0}^{2pq-1}e\left(\frac{(y-k)^2-k^2}{ 4pq}\right)=\\=& \frac{1}{ 2pq}e\left(-\frac{k^2}{ 4pq}\right)\sum_{y=0}^{2pq-1}e\left(-\frac{y^2}{ 4pq}\right)=\frac{1}{ 2pq}e\left(-\frac{k^2}{ 4pq}\right)\cdot\frac{S(4pq)}{ 2}, \end{align*} where $$S(p)=\sum\limits_{x=1}^{p}e(x^2/p)=\frac{1+i^{-p}}{1+i^{-1}}\cdot\sqrt{p}$$ is a Gauss sum. So (the second step) applying the discrete Poisson summation formula to $$f$$ with $$n_1=2q$$, $$n_2=p$$ and $$n=n_1n_2=2pq$$ we get the formula $$\sum_{x=0}^{p-1}e\left(\frac{qx^2}{ p}\right)=\frac{S(4pq)}{4q}\sum_{x=0}^{2q-1}e\left(-\frac{px^2}{ 4q}\right),$$ which is equivalent to LS.

• How is $\sum\limits_{x=1}^{p}e(x^2/p)=\frac{1+i^{-p}}{1+i^{-1}}\cdot\sqrt{p}$ obtained? Commented Mar 7, 2023 at 22:44
• @Dabed One can prove it using Poisson summation formula, but it also can be proven using discrete variant of Poisson summation in the similar manner. Commented Mar 9, 2023 at 14:53