Ryan Doenges - Articles
http://ryandoeng.es
Sometimes the math is just gross<p>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. <em>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…</em> It’s
a frustrating feeling, and I have been trying to avoid it by remembering that
good solutions don’t have to be elegant.</p>
<p>Some math must be taught via counterexample. The teacher makes a conjecture at
the board.</p>
<blockquote>
<p>Continuous functions are differentiable.</p>
</blockquote>
<p>Then, as the class watches in horror, the teacher constructs a concrete
counterexample.</p>
<blockquote>
<p>Define <script type="math/tex">f(x) = x\sin(1/x)</script> for nonzero <script type="math/tex">x</script> and set <script type="math/tex">f(0) = 0</script>.
Try to differentiate <script type="math/tex">f</script> at the origin.</p>
</blockquote>
<p>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.”</p>
<p>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.</p>
<p>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.</p>
<h3 id="quadratic-number-fields-and-their-rings-of-integers">Quadratic number fields and their rings of integers</h3>
<p>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.</p>
<p>Recall the rational numbers <script type="math/tex">\mathbb{Q}</script>. They’re nice enough, but they’re
missing lots of other things we like to call numbers, like <script type="math/tex">\sqrt{2}</script> or
<script type="math/tex">\pi</script>. We can tack all these missing <em>irrational numbers</em> onto <script type="math/tex">\mathbb{Q}</script>
in one fell swoop using Dedekind cuts or Cauchy sequences. This gets us the real
numbers <script type="math/tex">\mathbb{R}</script>, which have enough analytic structure to support things
like continuity and differentiation.</p>
<p>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 <script type="math/tex">x^2 + 1 = 0</script> in <script type="math/tex">\mathbb{R}</script>. To fill this gap, we
introduce the imaginary unit <script type="math/tex">i</script> as a solution to our equation and then make
sure all our algebraic operations still work. This gives us the complex numbers
<script type="math/tex">\mathbb{C}</script>, whose elements act like <script type="math/tex">x + iy</script> for some real numbers <script type="math/tex">x</script>
and <script type="math/tex">y</script>.</p>
<p>In algebra, we say that we’ve <em>adjoined</em> the element <script type="math/tex">i = \sqrt{-1}</script> to the
field <script type="math/tex">\mathbb{R}</script> to obtain the <em>field extension</em> <script type="math/tex">\mathbb{C}</script> of
<script type="math/tex">\mathbb{R}</script>. We write <script type="math/tex">\mathbb{C} = \mathbb{R}(i)</script>. 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 <em>quadratic field
extensions</em> <script type="math/tex">\mathbb{Q}(\sqrt{d})</script>.</p>
<p>The first thing we ought to notice is that the only values of <script type="math/tex">d</script> that matter
are <em>square-free</em>. If <script type="math/tex">k^2</script> divides <script type="math/tex">d</script> for some integer <script type="math/tex">k</script>, then there’s
an <script type="math/tex">n</script> smaller than <script type="math/tex">d</script> such that <script type="math/tex">d = nk^2</script> and <script type="math/tex">\sqrt{d} = k\sqrt{n}</script>.
Since <script type="math/tex">k</script> is just an integer, this means <script type="math/tex">\mathbb{Q}(d) = \mathbb{Q}(n)</script>.</p>
<p>Let <script type="math/tex">K = \mathbb{Q}(\sqrt{d})</script> for <script type="math/tex">d</script> square-free. We call a polynomial
with a leading coefficient <script type="math/tex">1</script> a <em>monic polynomial</em>. In <script type="math/tex">\mathbb{Q}</script>, the
roots of monic polynomials with coefficients in <script type="math/tex">\mathbb{Z}</script> are the integers
and nothing else. However, if we look for roots in <script type="math/tex">K</script> we sometimes get more
than just the ordinary integers. That’s okay, because the roots still form
a <em>ring</em>: they’re closed under multiplication and addition (but not division).
We call this ring the <em>ring of integers in <script type="math/tex">K</script></em> and denote it by
<script type="math/tex">\mathcal{O}_K</script>.</p>
<p>Rings have <em>ideals</em>, which are the nonempty subsets closed under addition and
absorbing under multiplication. For example, the even numbers are an ideal in
<script type="math/tex">\mathbb{Z}</script>: 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
<em>generated</em> by <script type="math/tex">2</script>: you can write an even number <script type="math/tex">e</script> as <script type="math/tex">2k</script> for some
integer <script type="math/tex">k</script>, and for all integers <script type="math/tex">k</script>, <script type="math/tex">2k</script> is even. In arbitrary rings
<script type="math/tex">R</script>, ideals do not always have unique generators: sometimes you need a few
generators, and you take linear combinations of them with coefficients in <script type="math/tex">R</script>
to generate the ideal.</p>
<p>A ring in which this never happens and all ideals can be generated by a single
element is called a <em>principal ideal domain</em>. 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 <script type="math/tex">K</script> have rings of integers <script type="math/tex">\mathcal{O}_K</script> 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.</p>
<h3 id="years-of-toil">160 years of toil</h3>
<p>The Stark-Heegner theorem goes like this.</p>
<blockquote>
<p><strong>Theorem.</strong> <em>There are finitely many square-free negative integers <script type="math/tex">d</script> for
which the ring of integers in <script type="math/tex">\mathbb{Q}(\sqrt{d})</script> is a principal ideal
domain.</em></p>
</blockquote>
<p>Well, that’s not really it. Here’s the real thing.</p>
<blockquote>
<p><strong>Theorem.</strong> <em>There are exactly nine square-free negative integers <script type="math/tex">d</script> for
which the ring of integers in <script type="math/tex">\mathbb{Q}(\sqrt{d})</script> is a principal ideal
domain, and they are <script type="math/tex">-1,</script> <script type="math/tex">-2,</script> <script type="math/tex">-3,</script> <script type="math/tex">-7,</script> <script type="math/tex">-11,</script> <script type="math/tex">-19,</script>
<script type="math/tex">-43,</script> <script type="math/tex">-67,</script> and <script type="math/tex">-163</script>.</em></p>
</blockquote>
<p>It’s not elegant. It’s ugly and it’s frustrating. Why stop at <script type="math/tex">-163</script>? 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.”</p>
<p>Gauss came up with the list of what are now known as Heegner numbers by
computing the <em>class number</em> 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 <script type="math/tex">d</script> and conjectured that it was complete.</p>
<p>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 <script type="math/tex">d</script>:</p>
<p>\[d = -1, -2, -3, -7, -11, -19, -43, -67, -163,\ ???\]</p>
<p>Now this was high drama. God created the integers, but did He create a tenth
<script type="math/tex">d</script>?</p>
<p>In 1952, a German high school teacher named Kurt Heegner published a proof
showing that there is no tenth value for <script type="math/tex">d</script>. 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.</p>
<p>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.</p>
<p>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
<a href="https://projecteuclid.org/download/pdf_1/euclid.bams/1183552617">Dorian Goldfeld’s survey paper</a>.</p>
<h3 id="whats-the-point">What’s the point</h3>
<p>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.</p>
Sat, 07 Oct 2017 00:00:00 -0400
http://ryandoeng.es/2017/10/07/stark-heegner/
http://ryandoeng.es/2017/10/07/stark-heegner/tactic : tactical :: function : functional<p><em>I’m going to try using this blog as a lab notebook. As a first entry in that
style, here’s a note about names.</em></p>
<p>In Coq, tactics build proofs and tacticals build complex tactics from simpler
ones. These names, particularly “tactical”, have always seemed strange to me.
While the Coq reference manual does explain what tactics and tacticals are, it
rejects “tactical” as a vague “folklore notion” and never elaborates on how the
names came to be.</p>
<blockquote>
<p>Tactics are built from atomic tactics and tactic expressions (which extends
the folklore notion of tactical) to combine those atomic tactics.</p>
</blockquote>
<p>It turns out that the people who invented tactic-based interactive theorem
proving in the LCF project also invented the names “tactic” and “tactical”. In
their 1972 paper “A Metalanguage for Interactive Proof in LCF”, Gordon et al.
are nice enough to explain why they choose the names they do:</p>
<blockquote>
<p>A strategy—or recipe for proof—could be something like “induction on f and
g, followed by assuming antecedents and doing case analysis, all interleaved
with simplification”. This is imprecise—analysis of what cases?—what kind
of induction, etc, etc.—but these in turn may well be given by further
recipes still in the same style. The point is that such strategies appear to
be built from simpler ones (which we call <em>tactics</em> rather than strategies) by
a number of general operations in fairly regular ways; we call these
operations <em>tacticals</em> by analogy with functionals.</p>
</blockquote>
<p>A functional is a function that takes functions as arguments. For example,
integration on the unit interval is a functional which takes a function
integrable on [0, 1] and produces a real number.</p>
<p>The use of “tactic” has migrated a bit since 1972. In LCF a tactic is an atomic
action on proof state and a strategy is built from tactics or sub-strategies
structured by tacticals. In Coq an LCF tactic is called an atomic tactic and an
LCF strategy is called a tactic, while tacticals or tactic expressions are
still tacticals. These are fuzzy correspondences: for example, an LCF strategy
might better correspond to a full-on Coq proof, which (CPDT advice aside) is
almost always going to be at least several tactics long. Got it?</p>
Sun, 19 Feb 2017 00:00:00 -0500
http://ryandoeng.es/2017/02/19/tactical/
http://ryandoeng.es/2017/02/19/tactical/