Notice: The post An atlas of the affine line over the integers and the page An atlas for $\mathrm{Spec}\,\mathbb{Z}[x]$ might be interesting if you came here by your favourite search engine.


As promised on Twitter I decided to draw a TeX version of Mumford's drawing of an elusive object: $\mathrm{Spec}\,\mathbb{Z}[x]$

This can be considered as the first non-trivial example in scheme theory. Mumford's treasure map tries to depict how we could (but we can't or shouldn't for a myriad of reasons) visualize its geometry. The meaning behind it, as found in the mimeographed notes named The Red Book, is discussed thoroughly at neverendingbooks.org's series on Brave New Geometries.

So in case you don't know the drawing, we're talking about

Original version of Mumford's impression of Spec Z[x]

The entire series (and by extension the weblog) is a must-read for every math student by the way! As a matter of fact, it was the strangeness and all the layers of meaning in this picture that first got me started in mathematics when I was still a CS student.

Anyhow, I won't go into any details concerning the drawing's many layers of meaning, the neverending author has done this better than I ever could. Although I would like to discuss one little remark he made when we were discussing this (and other) visualizations a few days ago which he didn't make explicitly in his own posts. A summary:

By connecting the points into a (smooth) curve, you suggest that local information is important. As in analysis the value in a point tells us something about the values near that point, for a certain amount of nearness. But the points corresponding to different prime numbers are by no means related to each other! There is a vast vacuum between to vertical lines and horizontal lines / curves, which we decided to fill by putting some (smooth) curve in there. Yet the information in one point conveys nothing about the values which look like they are near. We cannot say that consecutive primes are near, the smallest known prime (for the moment that would be 2) is as related to 3 as to the biggest Mersenne prime known nowadays which is 243112609-1.

I'm not saying this is a wonderful new insight, but of the entire talk I had with Lieven Le Bruyn on this subject, if I should stress one thing, it's this. Most other features of the drawing have a scheme-theoretical interpretation associated with, but this important remark stresses how this is nothing but an impression which is bound to fail on many aspects.

So we're going to reproduce that particular drawing? Kind of, but I will be basing myself on the second version, which is a bit less sketchy. It looks like

An improved version of Mumford's impression of Spec Z[x]

It's not that hard to reproduce this, but there are two non-trivial aspects to this: the construction of the curved line and the doodles in at the top and right edges.

Curved paths and relative tangents

The manual has a nice introduction to the construction of curved paths, using the .. controls (x,y) and (z,w) .. construction. The example that's given is

\draw (0,0) .. controls (1,1) and (2,1) .. (2,0)
which says
draw me a line from (0,0) to (2,0) but don't make it straight, make it a curve with tangents (1,1) at the origin and (2,1) at the end point.

Well, my nice discovery when drawing Mumford's map was that you can specify the tangents relatively! So the example from the manual becomes

\draw (0,0) .. controls ++ (1,1) and ++ (1,0) .. (2,0)

Not a great improvement in this case, but when your coordinates become more difficult (which they did in my case) it's a relief to be able to specify your tangents relative from the current position. And the only part where this is mentioned (or better: used implicitly) in the manual is in the introduction to the chapter on Mathematical and Object-Oriented Engines and it is used in exactly the same way as I did, but it is rather easily overlooked.

Doodles

The other non-trivial part are the doodles. It took me a while to find it in the enormous TikZ manual, but using the decorations.pathmorphing library which contains a random steps decoration it's rather easy. At first I was trying to implement this like I implemented H-tree fractals, but this failed miserably. The random number generator didn't work the way I wanted (it seemed like it was reseeded every time) and it was hard to determine where you should go after having drawn the first part of the line. But using random steps we can connect two points using a jagged line, that is generated at random (wonder, oh wonder). To create a full-fledged doodle, we iterate this procedure a couple of times. In case of the linear doodle in the lower-right corner this is done 6 times, in the quadratic doodle above it, 11 times. For the reason behind this, see neverendingbooks.org.

So a modified snippet from the result would be

\usetikzlibrary{decorations.pathmorphing}

\begin{tikzpicture}[generic/.style = {thick, decorate, decoration = {random steps, segment length = 2.5mm, amplitude = 2mm}, rounded corners}]
\foreach \k in {0,...,10} {
\draw[generic] (0,0) -- ++ (1,0);
}
\end{tikzpicture}[/sourcecode]I should find a way to get rid of the explicit loop though. Of course a macro would be possible, but there might be a more TikZ-y way.
<h3>Results</h3>
<p>So, I'm interested in your result! Well, here it is:<img src="/assets/mumford-mine.png" alt="My rendering of Mumford's Spec Z[x]" />I tried to adhere to the original version as much as possible. And the code to produce this:[sourcecode language="latex" collapse="true" wraplines="false"]\begin{tikzpicture}
[line/.style = {very thick},
generic/.style = {thick, decorate, decoration = {random steps, segment length = 2.5mm, amplitude = 2mm}, rounded corners},
font = \scriptsize]
% logarithmic x-axis
\newcommand\primelog[1]{-30/(#1^.2)}
\pgfmathsetseed{1002}

% how high do we want our picture to go?
\def\height{6}
% how many primes should we depict?
\def\primes{2,3,5,7,11,13,17,19}

% the square containing our picture
\draw ({\primelog{2}-1.5},-.5)
-- ({\primelog{25}+1.5},-.5)
-- ({\primelog{25}+1.5},\height-.5)
-- ({\primelog{2}-1.5},\height-.5)
-- cycle;

% vertical lines
\foreach \p in \primes {
\draw[line] ({\primelog{\p}},-1) -- ++ (0,\height+1);
}

% we only name a few of the vertical lines end their generic points
\foreach \p in {2,3,5,7} {
\ifthenelse{\p<7}{\node at ({\primelog{\p}+0.2},\height-1.5) [right] {$[(\p)]$};}{}
\node at ({\primelog{\p}},-1) [below] {$\mathbb{V}((\p))$};
\foreach \k in {0,...,8} {
\draw[generic] ({\primelog{\p}},\height-1) -- ++ (0,-1);
}
}
\node at ({\primelog{11}},-1) [below] {\phantom{$\mathbb{V}$}$\ldots$\phantom{$\mathbb{V}$}}; % TODO ugly hack

% generic point
\node at ({\primelog{27}},\height-2.3) {$[(0)]$ generic point};
\foreach \k in {0,...,6} {
\draw[generic] ({\primelog{25}+1},\height-1) -- ++ (0,-1) -- ++ (-.3,.7) -- ++ (-.7,.3) -- ++ (1,0) -- ++ (-.4,-.4);
}

% linear (p,x)
\foreach \p in {2,3,5} {
\draw[fill] ({\primelog{\p}},0) circle (2pt) node [above right] {$[(\p,X)]$};
}
\foreach \p in {7,11,13,17,19,23} {
\draw[fill] ({\primelog{\p}},0) circle (2pt);
}
\draw[line] ({\primelog{2}-1},0) -- ({\primelog{25}+1.5},0);
\node at ({\primelog{25}+.5},0.3) {$(X)$};
\foreach \k in {0,...,5} {
\draw[generic, decoration = {amplitude = 1mm}] ({\primelog{25}},0) -- ++ (1,0);
}

% the linear points
\foreach \p/\k/\h/\pos in {2/1/2/left, 3/1/1/right, 5/1/0.8/right, 3/2/3/right, 5/2/1.6/below right, 5/3/2.4/above right, 5/4/3.2/right} {
\draw[fill] ({\primelog{\p}},\h) circle (2pt) node [\pos] {$[(\p,X+\k)]$};
}
\foreach \h in {1,2,3,5,6,7} {
\draw[fill] ({\primelog{7}},4/8*\h) circle (2pt);
}

% x^2+1
\draw[line]
({\primelog{2}},2)
.. controls ++ (0,1) and ++ (-1,0) ..
({\primelog{3}},2+1/10)
.. controls ++ (1,0) and ++ (-1,0) ..
({\primelog{5}},12/5)
.. controls ++ (.5,0) and ++ (-.5,0) ..
({\primelog{7}},16/8+1/10)
-- ++ (0.5,0);
\draw[line]
({\primelog{2}},2)
.. controls ++ (0,-1) and ++ (-1,0) ..
({\primelog{3}},2-1/10)
.. controls ++ (1,0) and ++ (-1,0) ..
({\primelog{5}},8/5)
.. controls ++ (.5,0) and ++ (-.5,0) ..
({\primelog{7}},16/8-1/10)
-- ({\primelog{25}+1.5},16/8-1/10);
\draw[densely dashed] ({\primelog{3}},2) ellipse [x radius = 4pt, y radius = 6pt];
\draw[densely dashed] ({\primelog{7}},2) ellipse [x radius = 4pt, y radius = 6pt];

\node at ({\primelog{25}+.5},2.3) {$(X^2+1)$};
\foreach \k in {0,...,10} {
\draw[generic] ({\primelog{25}},16/8-1/10) -- ++ (1,0);
}
\end{tikzpicture}

I'm not saying this is the most elegant code, but it was a nice exercise so far.

Remark how the second (i.e., the printed) version (wrongly) depicts the doodle corresponding to $(2)$ with curls, which I believe to be wrong. Only the generic point captures information coming from all directions.

Now comes the possibility for generalization: use Sage to produce certain parts of the picture, depicting the behavior of other polynomials, for instance cyclotomic polynomials. This will have to wait a while as my exams are nearing but, but I would like to thank Lieven Le Bruyn so far for his explanation, motivation and inspiration. And his scan of the original mimeographed version.