# Ryan Doenges

## Sometimes the math is just gross

Programming is a little game. My opponent, past Ryan, introduces a problem into my code and I, present Ryan, program a solution. When the dust settles and I review my work I often find it inelegant. Ugly, even. Would a mathematician accept this approach? Surely I’ve made some grave error: I’ve overspecialized too early, overlooked some obvious structure inherent in the problem… It’s a frustrating feeling, and I have been trying to avoid it by remembering that good solutions don’t have to be elegant.

Some math must be taught via counterexample. The teacher makes a conjecture at the board.

Continuous functions are differentiable.

Then, as the class watches in horror, the teacher constructs a concrete counterexample.

Define $f(x) = x\sin(1/x)$ for nonzero $x$ and set $f(0) = 0$. Try to differentiate $f$ at the origin.

The presentation of the counterexample is at once an argument against the false conjecture and an argument for a better one, a theorem which avoids such “monsters.”

This post describes a concrete counterexample to an informal conjecture: to be good, a solution has to be elegant. Sometimes, as I’m going to show, there’s nothing pleasant about the right thing.

My example is the Stark-Heegner theorem. I’ve picked a theorem from math rather than some kind of software artifact because I want to emphasize that math isn’t naturally more beautiful than other lines of work. I keep the story of this theorem in my pocket for when I’m dissatisfied with my work, and I hope it’s useful to you too.

### Quadratic number fields and their rings of integers

We need to make a whirlwind tour of abstract algebra before we can state the theorem. It’s been about two years since I last took an algebra course and I think I sold my textbook, so this is all cobbled together from Wikipedia and some survey papers. If anything seems off, let me know and I can fix it. If you taught me algebra, I apologize in advance.

Recall the rational numbers $\mathbb{Q}$. They’re nice enough, but they’re missing lots of other things we like to call numbers, like $\sqrt{2}$ or $\pi$. We can tack all these missing irrational numbers onto $\mathbb{Q}$ in one fell swoop using Dedekind cuts or Cauchy sequences. This gets us the real numbers $\mathbb{R}$, which have enough analytic structure to support things like continuity and differentiation.

However, they have some algebraic gaps. If we’ve got a polynomial with numbers for coefficients, won’t it have numbers for roots? For real numbers, the answer is no: we can’t solve $x^2 + 1 = 0$ in $\mathbb{R}$. To fill this gap, we introduce the imaginary unit $i$ as a solution to our equation and then make sure all our algebraic operations still work. This gives us the complex numbers $\mathbb{C}$, whose elements act like $x + iy$ for some real numbers $x$ and $y$.

In algebra, we say that we’ve adjoined the element $i = \sqrt{-1}$ to the field $\mathbb{R}$ to obtain the field extension $\mathbb{C}$ of $\mathbb{R}$. We write $\mathbb{C} = \mathbb{R}(i)$. This operation makes sense on any field, that is, on any set supporting addition, multiplication, and division operations obeying some reasonable axioms. The Stark-Heegner theorem involves a particular class of field extensions, the quadratic field extensions $\mathbb{Q}(\sqrt{d})$.

The first thing we ought to notice is that the only values of $d$ that matter are square-free. If $k^2$ divides $d$ for some integer $k$, then there’s an $n$ smaller than $d$ such that $d = nk^2$ and $\sqrt{d} = k\sqrt{n}$. Since $k$ is just an integer, this means $\mathbb{Q}(d) = \mathbb{Q}(n)$.

Let $K = \mathbb{Q}(\sqrt{d})$ for $d$ square-free. We call a polynomial with a leading coefficient $1$ a monic polynomial. In $\mathbb{Q}$, the roots of monic polynomials with coefficients in $\mathbb{Z}$ are the integers and nothing else. However, if we look for roots in $K$ we sometimes get more than just the ordinary integers. That’s okay, because the roots still form a ring: they’re closed under multiplication and addition (but not division). We call this ring the ring of integers in $K$ and denote it by $\mathcal{O}_K$.

Rings have ideals, which are the nonempty subsets closed under addition and absorbing under multiplication. For example, the even numbers are an ideal in $\mathbb{Z}$: adding even numbers gets you an even number, and multiplying an even number by any integer gets you an even number. The even numbers are generated by $2$: you can write an even number $e$ as $2k$ for some integer $k$, and for all integers $k$, $2k$ is even. In arbitrary rings $R$, ideals do not always have unique generators: sometimes you need a few generators, and you take linear combinations of them with coefficients in $R$ to generate the ideal.

A ring in which this never happens and all ideals can be generated by a single element is called a principal ideal domain. These are particularly nice objects: in particular, rings of integers that are principal ideal domains admit unique factorization into prime elements, just like in the natural numbers. For a long time, mathematicians have wanted to figure out which quadratic field extensions $K$ have rings of integers $\mathcal{O}_K$ that are principal ideal domains. It turns out that for imaginary quadratic extensions, those extensions in which we adjoin the square root of a negative number, this question has been settled.

### 160 years of toil

The Stark-Heegner theorem goes like this.

Theorem. There are finitely many square-free negative integers $d$ for which the ring of integers in $\mathbb{Q}(\sqrt{d})$ is a principal ideal domain.

Well, that’s not really it. Here’s the real thing.

Theorem. There are exactly nine square-free negative integers $d$ for which the ring of integers in $\mathbb{Q}(\sqrt{d})$ is a principal ideal domain, and they are $-1,$ $-2,$ $-3,$ $-7,$ $-11,$ $-19,$ $-43,$ $-67,$ and $-163$.

It’s not elegant. It’s ugly and it’s frustrating. Why stop at $-163$? Is this some kind of joke? It took 160 years of collective toil to produce satisfactory answers to these two questions: a long proof, and “No.”

Gauss came up with the list of what are now known as Heegner numbers by computing the class number of many rings of integers by hand. The class number is 1 if and only if the ring is a principal ideal domain. He came up with the above list of values for $d$ and conjectured that it was complete.

That was at the turn of the 19th century. Plenty of mathematicians looked at the list and felt frustrated. It’s maddening. Why no others? Even more maddening, some 130 years later, was a result of Heilbronn and Linfoot showing that there are at most 10 valid values for $d$:

$d = -1, -2, -3, -7, -11, -19, -43, -67, -163,\ ???$

Now this was high drama. God created the integers, but did He create a tenth $d$?

In 1952, a German high school teacher named Kurt Heegner published a proof showing that there is no tenth value for $d$. But his proof took some leaps of faith and, worse yet, was “written in an amateurish and rather mystical style” that made heavy use of results proved in a poorly regarded algebra textbook. You can see where this is going: no one accepted his proof. He died in 1965 an anonymous Berliner.

It was left to Harold Stark, a young American mathematician, to cross the finish line. He learned enough German to decipher Heegner’s work and in 1967 published a proof similar to Heegner’s. This isn’t to say that he simply unearthed Heegner’s work and dusted it off. His approach was different enough that it could rightfully be called a distinct proof, and he later published a paper specifically devoted to closing “the gap” in Heegner’s proof.

The theorem carries Stark and Heegner’s names, but results like these are not proved alone. There were important contributions from Baker, Siegel, and Deuring around the same time. For more historical and mathematical details, I recommend Dorian Goldfeld’s survey paper.

### What’s the point

There are better measures of importance and quality than elegance. Exciting and worthwhile work can be clunky. Even the objectives of the work can be clunky. It’s fine.