tildedave.comWebsite of Dave King, Bay Area Software person
http://www.tildedave.com
2018: In Review<p>So it’s been a pretty good year over here. After four years in California I finally feel like I live here and I get to have my own life now, instead of performing some version of the life that I thought I wanted when I moved out here. My stress levels have been a lot lower and I’ve had time and energy after work to really develop my own interests.</p>
<p>I got a new job this year (Software Engineer at Chartio) and it’s helped clarify what I really enjoy out of work. I’ve worked enough different places now to get a feel for the types of projects I enjoy the most. These projects tend to be situations where I have a lot of autonomy while I get to learn a lot at the same time, and the new job lets me have that more often than not, fulltime. Pretty nice.</p>
<p>Another thing that’s quite nice is the company size - I really like a smaller team size. Tilt and Lyft oriented their teams around product verticals which may be the way you need to organize once you get to a certain size, but it’s not enjoyable to have any of the “my team” vs “your team” that comes out of a structure like that (works great if you’re on “my team” and never have to deal with “your team” I guess). It’s also really nice to have the more direct line to the customers that comes in a smaller environment.</p>
<p>I ended up doing some recreational coding. I did the first few <a href="https://cryptopals.com">Cryptopals</a> problem sets in April using <a href="https://github.com/tildedave/cryptopals-ocaml">OCaml</a>, implemented <a href="https://github.com/tildedave/go-finite-fields">Berklekamp and Cantor-Zassanhaus Factorization</a> for polynomials over finite fields in Golang for reasons I still can’t identify, and returned to my <a href="https://github.com/tildedave/ra-chess-engine">new Golang chess engine</a> that I started last year. Ra (new engine) still consistently loses to Apep (<a href="https://github.com/tildedave/apep-chess-engine">my old C++ chess engine</a>) but I’m pretty sure I can change that with a bit more work. Chess engines are super fun and they make me want to develop my chess skills so I can handle myself a little better over the board. Maybe one day I’ll get to writing some articles on chess programming up.</p>
<p>I also dedicated a bunch of time to improving my abilities with <a href="https://coq.inria.fr/">Coq</a>. I read through <a href="https://www.springer.com/us/book/9783540208549"><em>Interactive Theorem Proving and Program Development</em></a> and more or less grok everything in it. I <a href="https://github.com/tildedave/coq-playground/blob/master/digits.v">completed my proof</a> of grade-school arithmetic (started last year). After going through all the teeth-pulling that it takes to formalize proving base 10 addition with carry-over is the same as the built-in addition operator, I’m not sure how mainstream theorem proving will ever be. Obviously the startup world where I work has major issues to solve before it gets to certifying the correctness of our programs, but it feels impractical even in fields where it might ostensibly make sense, such as professional mathematics. The idea that modern math papers could come with a program proving it correct is extremely far out of reach, or at least that dependent typing isn’t the right tool for the job. It would take a herculean effort to certify the first 30 pages of one of the number theory textbooks that I read.</p>
<p>I did some reading. I finally read Ursula Le Guin, though unfortunately she had to die to get herself high enough on my radar. The <em>Left Hand of Darkness</em> was a wonderful book and I find myself wanting to return to its world (maybe in the new year). One of my goals for the Christmas break is to read through a few of her Earthsea books. I really liked <em>The Dispossessed</em>, which I interpreted as her take on <em>The Fountainhead</em>. I think it’s important for us whose politics are on the left to understand how the themes in <em>The Fountainhead</em> resonate with people, even if we disagree with the ends that its author turns them towards. Shevek is a brilliant scientist who is stranded in a backwater where he can’t work except as servant to a university elder. He rejects his homeland to join the place where “real science” is done, but then discovers he is nothing but a pawn of those in power, and must rebel again. Great stuff.</p>
<p>I also read the first four Dune novels. I’m not sure why it took me this long to get around to it - it was sort of intimidating, I guess. Afterwards, it’s easy to see its fingerprints over many of my favorite sci-fi/fantasy worlds. The one I spent the most time thinking about was Miyazaki’s <em>Nausicaa of the Valley of the Wind</em> (there’s a movie, but like any true nerd I’ll tell you the manga is way better). Nausicaa is a very similar protagonist in some ways but makes very different choices from the Atreides madmen. After the first Dune book, the Atreides consistently embrace autocracy over allowing the common people a voice, usually justifying it by some imagined horrific future that never seems to manifest. Nausicaa chooses differently - she rejects the mantle of rulership, and given the opportunity to remake her world into a paradise (like the Atreides eventually do for Arrakis), she destroys the tools of the past that the ruling class uses to dominate the world (while the Atreides horde the spice to cement their rule). Our world could use a lot more of Nausicaa and a lot less of the Atreides.</p>
<p>And of course, I did some surgery on this blog. I de-listed a bunch of older articles that didn’t age well for one reason or another. Either I now disagreed with them, didn’t think they made their points very well, or they just weren’t unique enough. One of my favorite internet jokes is Clickhole’s “The Time I Spent On A Commercial Whaling Ship Totally Changed My Perspective On The World”, where all of Melville’s beautiful prose in Moby Dick gets turned into the doggerel of the internet just by being presented on a webpage. There are enough programming blogs out there that talk about stuff you did in the context of work and isn’t work/my company/my team just the greatest. I feel a little embarrassed by my past contribution to the genre but I’m doing my best to turn this little corner of the internet into as weird and unique a place as I can possibly make it. Not sure where that will go but I guess that’s the point. Best wishes for a great 2019, all.</p>
Thu, 20 Dec 2018 00:00:00 -0800
http://www.tildedave.com/2018/12/20/year-in-review.html
http://www.tildedave.com/2018/12/20/year-in-review.htmlThe Joy of Algebraic Number Theory<p>Algebraic number theory is the study of how prime numbers behave in field extensions of the rational numbers. For example, 13 is a prime number in the integers. However, in the field extension <script type="math/tex">\mathbb{Q}[i]</script>, 13 is a product of two irreducible elements <script type="math/tex">(2 + 3i)</script> and <script type="math/tex">(2 - 3i)</script>, and so is no longer a “prime”.</p>
<p>Algebraic number theory grew out of Gauss and other mathematicians looking for a way to extend quadratic reciprocity (which numbers can be written as <script type="math/tex">x^2</script> mod <script type="math/tex">p</script>?) to higher dimensions. Adding new types of numbers allowed them to investigate these problems in fuller generality. Later, Kummer and others expanded its techniques in a failed attempt to solve Fermat’s Last Theorem (<script type="math/tex">x^p + y^p = z^p</script> has no integer solutions for <script type="math/tex">p > 2</script>). While these techniques did not succeed, it resulted in them developing out the theory of cyclotomic fields (the field extensions of the form <script type="math/tex">\mathbb{Q}[\zeta]</script>, <script type="math/tex">\zeta</script> being a complex root of unity).</p>
<p>I started learning algebraic number theory this year and I wanted to write a bit about its core concepts and convey some of its flavor, and the reasons I think it’s an interesting topic. There are a lot of high quality resources on the internet that I’ve used to augment my main resource, which has been the textbook <em>Number Fields</em> by Daniel Marcus.</p>
<h2 id="definitions">Definitions</h2>
<p>Let <script type="math/tex">K</script> by a finite field extension of <script type="math/tex">\mathcal{Q}</script>, i.e. there is some set <script type="math/tex">\{ e_1, \ldots, e_n \in K \}</script> that forms a basis of <script type="math/tex">K</script> over <script type="math/tex">\mathbb{Q}</script>. Call this type of extension a <em>number field</em>. Every number field <script type="math/tex">K</script> has a subring <script type="math/tex">\mathcal{O_K}</script> of the elements which are solutions to polynomials with integer coefficients: <script type="math/tex">a_n x^n + a_{n-1} x^{n-1} + \ldots + a_0</script> where each of the <script type="math/tex">a_i \in \mathbb{Z}</script>. (These are also called <em>algebraic integers</em>).</p>
<p>In a <em>quadratic</em> field extension <script type="math/tex">\mathbb{Q}[\sqrt{d}]</script>, you take the rational numbers adjoined with the square root of some number <script type="math/tex">d</script> m (e.g. <script type="math/tex">\sqrt{3}</script>, <script type="math/tex">\sqrt{6}</script>, etc), the algebraic integers end up being <script type="math/tex">\mathbb{Z}[\sqrt{d}]</script> if <script type="math/tex">d \equiv 2, 3\ (4)</script>, and <script type="math/tex">\mathbb{Z}[\frac{1 + \sqrt{d}}{2}]</script> if <script type="math/tex">d \equiv 1\ (4)</script>.</p>
<p><em>Cyclotomic number fields</em> are the rational numbers adjoined with <script type="math/tex">\zeta_{m}</script> for some <script type="math/tex">m</script>. The algebraic integers for a cyclotomic field <script type="math/tex">\mathbb{Q}[\zeta_m]</script> end up just being <script type="math/tex">\mathbb{Z}[\zeta_m]</script>.</p>
<p>We can use Sage to compute an basis for the ring of integers for various field extensions (called an <em>integral basis</em>). (The <code class="highlighter-rouge">a</code> that shows up is each field’s generating element.)</p>
<div class="highlighter-rouge"><pre class="highlight"><code>sage: K = QuadraticField(14)
sage: K.integral_basis()
[1, a]
sage: K = QuadraticField(17)
sage: K.integral_basis()
[1/2*a + 1/2, a]
sage: K = CyclotomicField(13)
sage: K.integral_basis()
[1, zeta13, zeta13^2, zeta13^3, zeta13^4, zeta13^5, zeta13^6, zeta13^7, zeta13^8, zeta13^9, zeta13^10, zeta13^11]
</code></pre>
</div>
<p>The above examples are a little deceiving in their lack of complexity, as the ring of integers for the field extension always has the form <script type="math/tex">\mathbb{Z}[\alpha]</script> for some <script type="math/tex">\alpha</script>. However, this is not always the case - <a href="https://math.stackexchange.com/questions/912148/why-a-particular-ring-of-integers-is-not-generated-by-a-single-element">a counterexample</a> is the field extension <script type="math/tex">\mathbb{Q}</script> extended by a root <script type="math/tex">\alpha</script> of the cubic equation <script type="math/tex">x^3 + x^2 - 2x + 8</script>.</p>
<div class="highlighter-rouge"><pre class="highlight"><code>sage: K.<a> = QQ.extension(x^3 + x^2 - 2*x + 8)
sage: K.integral_basis()
[1, 1/2*a^2 + 1/2*a, a^2]
</code></pre>
</div>
<p>Computing an integral basis turns out to be little trickier than computing the basis of a field extension. See [5] for more information.</p>
<h2 id="lack-of-unique-factorization">Lack of Unique Factorization</h2>
<p>One of the things that makes the integers really nice to work with is that every number can be broken down into a unique product of prime elements. For example, the number <script type="math/tex">1176 = 2^3 \cdot 3 \cdot 7^2</script>. Other than choosing negative numbers, there aren’t any alternative factorizations of <script type="math/tex">1176</script>.</p>
<p>This fundamental property of number theory may fail in a ring of integers. For example, let <script type="math/tex">K = \mathbb{Q}[\sqrt{-5}]</script>. Then <script type="math/tex">6 = 2 \cdot 3</script> but also <script type="math/tex">6 = (1 + \sqrt{-5})(1 - \sqrt{-5})</script>.</p>
<p>In order to solve this difficulty, we start operating on <em>ideals</em>. Ideals (denoted by the symbol <script type="math/tex">I</script>) are subsets of a mutiplicative ring that are internally closed under addition (so for any two elements <script type="math/tex">f, g \in I</script>, <script type="math/tex">f + g \in I</script>) and are closed under multiplication from the rest of the ring (so for any element <script type="math/tex">f \in I</script> and an element from the broader ring <script type="math/tex">r \in R</script>, <script type="math/tex">r \cdot f \in I</script>).</p>
<p>It’s not too difficult to see that the ideals of the integers <script type="math/tex">\mathbb{Z}</script> are all the multiples of some prime. However, in the ring of integers, ideals may be the product of multiple generating elements, written <script type="math/tex">I = (i_0, \ldots, i_n)</script>.</p>
<p>Given two ideals <script type="math/tex">I, J</script>, you can define the ideal <script type="math/tex">I \cdot J</script> to be the ideal generated by every element <script type="math/tex">i \in I</script> multiplied by every element <script type="math/tex">j \in J</script>.</p>
<p>Seen through the lens of ideals, the ring of integers admits unique factorization, except that now we’re not factoring numbers into a product of primes, we’re factoring ideals into a product of <em>prime ideals</em>.</p>
<p>Let’s ask Sage to shed some light on the situation where <script type="math/tex">F = \mathbb{Q}[\sqrt{-5}]</script>:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>sage: K = QuadraticField(-5)
sage: K.factor(6)
(Fractional ideal (2, a + 1))^2 * (Fractional ideal (3, a + 1)) * (Fractional ideal (3, a + 2))
sage: I, J1, J2 = [x[0] for x in K.factor(6)]
sage: I * J1
Fractional ideal (a + 1)
sage: I * J2
Fractional ideal (-a + 1)
sage: I*I
Fractional ideal (2)
sage: J1*J2
Fractional ideal (3)
</code></pre>
</div>
<p>To summarize, in the ring of integers <script type="math/tex">\mathcal{O_F}</script>, we have the following factorizations:</p>
<script type="math/tex; mode=display">% <![CDATA[
\begin{eqnarray*}
(6) &=& (2, \sqrt{-5} + 1)^2 \cdot (3, \sqrt{-5} + 1) \cdot (3, \sqrt{-5} + 2) \\
(2) &=& (2, \sqrt{-5} + 1)^2 \\
(3) &=& (3, \sqrt{-5} + 1) \cdot (3, \sqrt{-5} + 2)\\
(1 + \alpha) &=& (2, \sqrt{-5} + 1) \cdot (3, \sqrt{-5} + 1)\\
(1 - \alpha) &=& (2, \sqrt{-5} + 1) \cdot (3, \sqrt{-5} + 2)\\
\end{eqnarray*} %]]></script>
<p>Above, you can also see that ideal <script type="math/tex">(2, \sqrt{-5} + 1)</script> is <em>non-principal</em> - that is, there is no element <script type="math/tex">\alpha</script> such that generates the ideal <script type="math/tex">(2, \sqrt{-5} + 1)</script>. In math-speak this means that the ring of integers may not be a <em>Principal Ideal Domain</em> (abbreviated PID). (This differs from the regular integers <script type="math/tex">\mathbb{Z}</script>, where every ideal is the multiples of some prime number.) It’s not even known if there are infinitely many quadratic extensions (degree 2) with a ring of integers that’s a PID.</p>
<h2 id="personal-reflection">Personal Reflection</h2>
<p>So obviously, I find this stuff pretty interesting. I can only really explain this in contrast to my reaction to mathematical logic, a subject I respect more than I love. Much of what you learn in mathematical logic is not just the history of the results, but the history of how the results are interpreted - many of the key results in logic end up having a political feel, wherein the ability to make a mathematical construction comes with some statement about the value of your assumptions.</p>
<p>For example, one of the main problems in logic is the Continuum Hypothesis (is the cardinality of the real line the first uncountable infinity?). Gödel showed you could construct models of set theory where it was true. Cohen showed you could make models where it was false, using an elaborate technique - you blow up an <script type="math/tex">\aleph_0</script>-sized model of ZFC Set Theory into an <script type="math/tex">\aleph_2</script>-sized model, then show that the statement “This is an <script type="math/tex">\aleph_2</script>-sized set”, provable in your new model, relativizes back to ‘real mathematics’ because “This is an <script type="math/tex">\aleph_2</script>-sized set” is a <script type="math/tex">\Pi^{0}_2</script> statement.</p>
<p>Whatever this says, it has a <em>meaning</em>. Should we change our assumptions to disallow this result? Should we say the Continuum Hypothesis is true anyways? Or false anyways? What does uncountable infinity even <em>mean</em>? Should we use other axiom systems than ZFC? Should we just ditch all this infinity stuff in the first place?</p>
<p>In contrast, the objects of study in algebra feel familiar (the rational numbers! irreducible polynomials!), useful in their own right (finite fields and their factorings are used in cryptosystems), and accessible (tools like Sage allow you to explore your understanding without needing your advisor’s intuition to walk you through the easy stuff). Results don’t trigger this metaphysical quandry, and the clear motivation from simple equations over the integers helps me stay engaged. These problems motivated these mathematical greats (Gauss, Euler, and Fermat), and centuries later we get to understand the issues to which they devoted their lives.</p>
<h2 id="references">References</h2>
<ol>
<li><a href="https://wstein.org/books/ant/">Algebraic Number Theory, a Computational Approach</a> by William Stein</li>
<li><a href="http://www.jmilne.org/math/CourseNotes/ant.html">Algebraic Number Theory</a> by J.S. Milne</li>
<li><a href="https://faculty.math.illinois.edu/~r-ash/ANT.html">A Course In Algebraic Number Theory</a> by Richard Ash</li>
<li><a href="https://ctnt-summer.math.uconn.edu/schedules-and-abstracts-2018/">Basic Algebraic Number Theory</a> from CTNT 2018, Liang Xiao,</li>
<li><a href="https://pdfs.semanticscholar.org/ac59/767929639347bb2d0ef52621d973ad743af8.pdf">Computing Integral Bases</a>, John Paul Cook.</li>
</ol>
Wed, 19 Dec 2018 00:00:00 -0800
http://www.tildedave.com/2018/12/19/the-joy-of-algebraic-number-theory.html
http://www.tildedave.com/2018/12/19/the-joy-of-algebraic-number-theory.htmlQuadratic Gaussian Sums<p>Let <script type="math/tex">p</script> be an odd prime. I’ll now show how sums over complex roots of unity can be used to show the law of <em>quadratic reciprocity</em>, which states that <script type="math/tex">p</script> being a square mod <script type="math/tex">q</script> is related to whether <script type="math/tex">q</script> is a square mod <script type="math/tex">p</script>.</p>
<p>Let <script type="math/tex">(p / q)</script> be the Legendre symbol: it takes on the value 0 if <script type="math/tex">p</script> is 0, <script type="math/tex">1</script> if <script type="math/tex">p</script> is a square mod <script type="math/tex">q</script>, and <script type="math/tex">-1</script> otherwise. We’ll be seeing what happens when you sum up some complex roots of unity and square the resulting value. I am following the proof given in <a href="https://www.springer.com/us/book/9780387973296">A Classical Introduction to Modern Number Theory, Ireland and Rosen</a>.</p>
<h2 id="summing-complex-roots-of-unity">Summing Complex Roots of Unity</h2>
<p>Let <script type="math/tex">\zeta</script> be a complex <script type="math/tex">p</script>-th root of unity <script type="math/tex">\zeta = e^{2\pi i/p}</script>. The quadratic Gaussian sum is the value <script type="math/tex">g_{a} = \sum_{t} (t/p) \zeta^{at}</script>.</p>
<p>Why might this be useful? It’s not hard to show that for all <script type="math/tex">a</script>, <script type="math/tex">g_a = (a/p)g_1</script>, meaning that we can recover the value <script type="math/tex">(a/p)</script> by knowing the value of <script type="math/tex">g_a</script>.</p>
<p>For example, when <script type="math/tex">p = 5</script>:</p>
<script type="math/tex; mode=display">% <![CDATA[
\begin{eqnarray*}
g_1 &=& \zeta - \zeta^{2} - \zeta^{3} + \zeta^{4}\\
g_2 &=& \zeta^{2} - \zeta^{4} - \zeta^{6} + \zeta^{8} = \zeta^{2} + \zeta^{3} - \zeta^{4} - \zeta &=& -g_1\\
g_3 &=& \zeta^{3} - \zeta^{6} - \zeta^{9} + \zeta^{12} = \zeta^{2} + \zeta^{3} - \zeta^{4} - \zeta &=& -g_1\\
g_4 &=& \zeta^{4} - \zeta^{8} - \zeta^{12} + \zeta^{16} = \zeta + \zeta^{4} - \zeta^{2} - \zeta^{3} &=& g_1\\
\end{eqnarray*} %]]></script>
<p>2 and 3 are non-residues mod 5, so the sign of the quadratic Gaussian sum <script type="math/tex">g_2</script> and <script type="math/tex">g_3</script> is negative.</p>
<p><strong>Lemma:</strong> <script type="math/tex">g_a = (a/p)g_1</script></p>
<p><strong>Proof:</strong> We only consider the case where <script type="math/tex">a</script> is coprime to <script type="math/tex">p</script>.</p>
<script type="math/tex; mode=display">\left(\frac{a}{p}\right) g_a = \sum_{t} \left(\frac{at}{p}\right) \zeta^{at} = \sum_{x} \left(\frac{x}{p}\right) \zeta^{x} = g_1</script>
<p>(Because <script type="math/tex">p</script> is a prime and <script type="math/tex">a</script> is coprime to <script type="math/tex">p</script>, <script type="math/tex">at</script> must take on all values <script type="math/tex">1, 2, \ldots, p - 1</script> mod <script type="math/tex">p</script>). Multiplying both sides by <script type="math/tex">\left(\frac{a}{p}\right)</script> gives the desired result. <script type="math/tex">\tag*{$\Box$}</script></p>
<p><strong>Lemma:</strong> <script type="math/tex">g_1^2 = (-1)^{(p - 1)/2} p</script></p>
<p><strong>Proof:</strong> To show this, we evaluate <script type="math/tex">\sum_{a} g_{a}g_{-a}</script> in two different ways. Again we only focus on <script type="math/tex">a</script> coprime to <script type="math/tex">p</script>.</p>
<p>First, by the previous lemma, we have <script type="math/tex">g_{a}g_{-a} = (a/p)(-a/p) g_1^2 = (-1/p) g_1^2</script>. Summing over all <script type="math/tex">a</script> gives us <script type="math/tex">\sum_{a} g_{a}g_{-a} = \left(\frac{-1}{p}\right)(p-1)g^2</script>.</p>
<p>Direct expansion gives:</p>
<script type="math/tex; mode=display">g_{a}g_{-a} = \sum_{x} \sum_{y} \left(\frac{x}{p}\right) \left(\frac{y}{p}\right) \zeta^{a(x - y)}</script>
<p>When summing this term over <script type="math/tex">a</script>, terms where <script type="math/tex">x \not\equiv y\ (p)</script> vanish, since these end up summing over all roots of unity. For each <script type="math/tex">x</script>, when <script type="math/tex">x \equiv y\ (p)</script>, there are <script type="math/tex">p</script> terms. Therefore:</p>
<script type="math/tex; mode=display">\sum_{a} g_{a}g_{-a} = \sum_{x} \left(\frac{x}{p}\right) \left(\frac{x}{p}\right) p = (p - 1)p</script>
<p>Therefore <script type="math/tex">(p - 1)p = \left(\frac{-1}{p}\right)(p-1)g^2</script>. Cancelling terms of <script type="math/tex">p - 1</script> and multiplying both sides by <script type="math/tex">(-1/p)</script> gives the desired result. (By Fermat’s little theorem we have <script type="math/tex">(-1/p) = (-1)^{(p-1)/2}</script>.)
<script type="math/tex">\tag*{$\Box$}</script></p>
<h2 id="quadratic-reciprocity">Quadratic Reciprocity</h2>
<p>We are in a place to prove the law of quadratic reciprocity, which links the values <script type="math/tex">\left(\frac{p}{q}\right)</script> and <script type="math/tex">\left(\frac{q}{p}\right)</script>.</p>
<div class="theorem" text="Quadratic Reciprocity">
$$\left(\frac{p}{q}\right)\left(\frac{q}{p}\right) = (-1)^{((p-1)/2)((q-1)/2)}$$
</div>
<p>If either <script type="math/tex">p</script> or <script type="math/tex">q</script> are <script type="math/tex">\equiv 1\ (4)</script>, the right hand side is <script type="math/tex">1</script>, and <script type="math/tex">p</script> is a residue in <script type="math/tex">q</script> if and only if <script type="math/tex">q</script> is a residue in <script type="math/tex">p</script>. Let <script type="math/tex">p = 13</script> and <script type="math/tex">q = 17</script> - it happens that <script type="math/tex">17 \equiv 4\ (13)</script>. <script type="math/tex">4</script> is a square mod <script type="math/tex">13</script> (<script type="math/tex">2^2 \equiv 4\ (13)</script>) and <script type="math/tex">13</script> is a square mod <script type="math/tex">17</script> (<script type="math/tex">8^2 \equiv 13\ (17)</script>).</p>
<p>However, if both <script type="math/tex">p</script> and <script type="math/tex">q</script> are <script type="math/tex">\equiv 3\ (4)</script>, then the relationship is flipped: <script type="math/tex">p</script> is a residue in <script type="math/tex">q</script> if and only if <script type="math/tex">q</script> is not a residue in <script type="math/tex">p</script>. For example, <script type="math/tex">p = 7</script> and <script type="math/tex">q = 23</script>: <script type="math/tex">23 \equiv 2\ (7)</script> and 2 is a square mod <script type="math/tex">7</script> (<script type="math/tex">3^2\equiv 2\ (7)</script>, but <script type="math/tex">7</script> is not a square mod <script type="math/tex">23</script>.</p>
<p><strong>Proof:</strong>
Let <script type="math/tex">p' = (-1)^{(p - 1)/2} p</script>. By the above lemma we have <script type="math/tex">g_1^2 = p'</script>. Take <script type="math/tex">q</script>, another odd prime. Then we have:</p>
<p><script type="math/tex">g_1^{q-1} = (g_1^2)^{(q-1)/2} = p'^{(q-1)/2} \equiv \left(\frac{p'}{q}\right)\ (q)</script>.</p>
<p>Multiplying both sides by <script type="math/tex">g_1</script> gives:</p>
<script type="math/tex; mode=display">g_1^{q} \equiv \left(\frac{p'}{q}\right)g_1\ (q)</script>
<p>Since we are examining congruences modulo <script type="math/tex">q</script>, we can “push” the exponent down into the sum, giving, <script type="math/tex">g_1^{q} = g_{q} = (q/p)g_1\ (q)</script> as per our first lemma. Therefore we have:</p>
<script type="math/tex; mode=display">% <![CDATA[
\begin{eqnarray*}
\left(\frac{q}{p}\right)g_1 &\equiv& \left(\frac{p'}{q}\right)g_1 \ (q)\\
\left(\frac{q}{p}\right)g_1^2 &\equiv& \left(\frac{p'}{q}\right)g_1^2 \ (q)\\
\left(\frac{q}{p}\right)p' &\equiv& \left(\frac{p'}{q}\right)p' \ (q)\\
\left(\frac{q}{p}\right) &\equiv& \left(\frac{p'}{q}\right) \ (q)\\
\left(\frac{q}{p}\right) &=& \left(\frac{p'}{q}\right)\\
\end{eqnarray*} %]]></script>
<p>The value <script type="math/tex">\left(\frac{p'}{q}\right)</script> can be seen to equal <script type="math/tex">(-1)^{((q-1)/2)((p - 1) / 2)} \left(\frac{p}{q}\right)</script> as <script type="math/tex">p' = (-1)^{(p-1)/2} p</script>: therefore <script type="math/tex">p'</script> is a residue mod <script type="math/tex">q</script> if both <script type="math/tex">(-1)^{(p-1)/2}</script> and <script type="math/tex">p</script> are residues mod <script type="math/tex">q</script> or they are both non-residues. Arranging terms gives the desired result.</p>
<script type="math/tex; mode=display">\tag*{$\Box$}</script>
<h2 id="notes">Notes</h2>
<p>Quadratic reciprocity is what really hooked me on my study of the Ireland and Rosen textbook. The previous few chapters had been about congruences and the structure of subrings of integers - interesting stuff but sort of dry, and not too different from the standard abstract algebra I had covered in undergrad.</p>
<p>However, <em>this</em> theorem sort of came out of left field: it seemed strange that <script type="math/tex">p</script> being a square mod <script type="math/tex">q</script> would be related at all to <script type="math/tex">q</script> being a square mod <script type="math/tex">p</script> - especially given that one of these numbers is larger than the other! (When you talk about <script type="math/tex">p</script> being a square mod <script type="math/tex">q</script>, it’s actually a statement about <script type="math/tex">p</script>’s coset in the integers mod <script type="math/tex">q</script>.)</p>
<p>There are a few different proofs presented in the textbook, but the presentation of quadratic Gaussian sums struck me as exceptionally simple. The Legendre symbol initially seemed to me as a strange thing to include in the sum terms, but it can be shown that the Legendre symbol is just an example of a <em>multiplicative character</em>, which maps a finite field into the unit circle in a way that preserves multiplication. The unit circle hooked me on trigonometry back in high school and I love seeing it appear again and again.</p>
Sun, 14 Oct 2018 00:00:00 -0700
http://www.tildedave.com/2018/10/14/quadratic-gaussian-sums.html
http://www.tildedave.com/2018/10/14/quadratic-gaussian-sums.htmlFor Which Primes is 2 a Square?<p>We work in the integers mod some odd prime <script type="math/tex">p</script>, and we start squaring things. It turns out that some numbers show up when we do this, and some don’t: for example, the numbers mod 5 are 0, 1, 2, 3, 4, and their squares are 0, 1, 4, 4, and 1. Since 4 shows up in this list, 4 is a square mod 5, but 2 doesn’t show up, so 2 is not a square.</p>
<p>If you’re given a <script type="math/tex">p</script>, it turns out to be relatively easy to test if a number is a square: just square everything and see if the number you’re looking for shows up. But what about the reverse problem: given a number <script type="math/tex">a</script>, for which primes <script type="math/tex">p</script> is <script type="math/tex">a</script> a square? This is the <em>quadratic residue</em> problem, one of the most famous problems in elementary number theory.</p>
<p>In this article I’ll show how to determine the primes for which the number 2 is a square, which follows a proof given in <a href="https://www.springer.com/us/book/9780387973296">A Classical Introduction to Modern Number Theory, Ireland and Rosen</a>. The proof relies on using complex roots of unity, which feels like a total non-sequitor after digging through a few chapters of congruences and mainly applications of classical algebra. Like all things math, I feel like this reveals some deep structure that requires a certain state of enlightenment to grasp.</p>
<h2 id="preliminaries">Preliminaries</h2>
<p>Looking over the first few primes see that 2 is not a square for <script type="math/tex">p = 3, p = 5, p = 11, p = 13</script> but is a square for <script type="math/tex">p = 7, p = 17, p = 23</script>.</p>
<p>Let <script type="math/tex">(a / p)</script> (the <em>Legendre symbol</em>) be 0 if <script type="math/tex">a = 0</script>, 1 if there is some <script type="math/tex">x</script> such that <script type="math/tex">x^2\equiv a\ (p)</script>, and -1 otherwise. Determining when 2 is a square means determining the <script type="math/tex">p</script> for which <script type="math/tex">(a / p) = 1</script>.</p>
<p>The key observation is that <script type="math/tex">a^{(p - 1)/2} \equiv (a / p)\ (p)</script>. This uses some group theory: every number <script type="math/tex">a^{p-1} \equiv 1\ (p)</script> (<em>Fermat’s Little Theorem</em>), so <script type="math/tex">(a^{(p-1)/2})^2 = 1</script>, meaning that it can only take on two possible values modulo <script type="math/tex">p</script>, 1 and -1.</p>
<h2 id="the-proof">The Proof</h2>
<p>Take <script type="math/tex">\zeta = e^{2\pi i / 8}</script>, a complex eighth root of unity which satisfies <script type="math/tex">\zeta^8 = 1</script>. Note that <script type="math/tex">\zeta^4 = -1</script> so <script type="math/tex">\zeta^2 = -\zeta^{-2}</script>. Consider the expression <script type="math/tex">\zeta + \zeta^{-1}</script> (this is just adding a number to its complex conjugate, so it’s a real number). Squaring this value yields <script type="math/tex">(\zeta + \zeta^{-1})^2 = \zeta^2 + 2 + \zeta^{-2} = 2</script>.</p>
<script type="math/tex; mode=display">% <![CDATA[
\begin{eqnarray*}
(2/p) &\equiv& 2^{(p-1)/2}\ (p)\\
&\equiv& (\zeta + \zeta^{-1})^2)^{(p - 1)/2}\ (p)\\
&\equiv& (\zeta + \zeta^{-1})^{p - 1}\ (p)\\
\end{eqnarray*} %]]></script>
<p>(Since <script type="math/tex">\zeta</script> is an <em>algebraic integer</em> - a root of a polynomial with integer coefficients - the concept of congruences can be shown to make sense.)</p>
<p>Multiplying both sides by <script type="math/tex">\zeta + \zeta^{-1}</script> gives:</p>
<script type="math/tex; mode=display">% <![CDATA[
\begin{eqnarray*}
(2/p)(\zeta + \zeta^{-1}) &\equiv& (\zeta + \zeta^{-1})^p\ (p)\\
&\equiv& \zeta^{p} + \zeta^{-p}\ (p)
\end{eqnarray*} %]]></script>
<p>(This uses the simplification <script type="math/tex">(x + y)^p \equiv x^p + y^p\ (p)</script> - this is possible because the binomial coefficients all being mod <script type="math/tex">p</script> and so zero out.)</p>
<p>Next, we split into cases based on the value <script type="math/tex">p</script> has congruent to 8. Since <script type="math/tex">p</script> is an odd prime, it can only take on four possible values: <script type="math/tex">p \equiv 1, 3, 5, 7\ (8)</script>.</p>
<script type="math/tex; mode=display">% <![CDATA[
\zeta^{p} + \zeta^{-p} = \left\{
\begin{array}{cc}
\zeta + \zeta^{-1} & p \equiv 1, 7\ (8)\\
\zeta^{3} + \zeta^{-3} = -(\zeta + \zeta^{-1}) & p \equiv 3, 5\ (8)
\end{array}
\right. %]]></script>
<p>This gives the result:</p>
<script type="math/tex; mode=display">% <![CDATA[
(2/p) = \left\{
\begin{array}{cc}
1 & p \equiv 1, 7\ (8)\\
-1 & p \equiv 3, 5\ (8)
\end{array}
\right. %]]></script>
<p>Verifying this with <a href="http://www.sagemath.org/">Sage</a> and choosing a random prime off a <a href="https://primes.utm.edu/lists/small/10000.txt">list of small primes</a>, we see:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>sage: 102929 % 8
1
sage: 2 in quadratic_residues(102929)
True
</code></pre>
</div>
<p>We can also verify the pattern holds for the first 100 primes:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>sage: P = Primes()
sage: for i in range(0, 100):
....: p = P.unrank(i)
....: print(p, p % 8, 2 in quadratic_residues(p))
....:
(2, 2, False)
(3, 3, False)
(5, 5, False)
(7, 7, True)
(11, 3, False)
(13, 5, False)
(17, 1, True)
(19, 3, False)
(23, 7, True)
(29, 5, False)
(31, 7, True)
(37, 5, False)
(41, 1, True)
(43, 3, False)
(47, 7, True)
(53, 5, False)
(59, 3, False)
(61, 5, False)
(67, 3, False)
(71, 7, True)
(73, 1, True)
(79, 7, True)
...
</code></pre>
</div>
<h2 id="references">References</h2>
<ul>
<li>Kenneth Ireland and Michael Rosen, <em>A Classical Introduction to Modern Number Theory</em> (2nd Edition)</li>
</ul>
Fri, 12 Oct 2018 00:00:00 -0700
http://www.tildedave.com/2018/10/12/for-which-primes-is-2-a-square.html
http://www.tildedave.com/2018/10/12/for-which-primes-is-2-a-square.htmlThe Joy of Field Extensions<p>One of my projects this year was learning Galois Theory, a subject in abstract algebra that goes into the structure of the roots of polynomial equations. In high school I learned that <script type="math/tex">x^2 + 1 = 0</script> had no solutions in the real numbers, but - good news! (massive leap of faith here) there’s some number <script type="math/tex">i</script> so that <script type="math/tex">i^2 + 1 = 0</script> is satisfied. Oh and by the way, <script type="math/tex">(-i)^2 + 1 = 0</script> also.</p>
<p>It turns out that by adding <script type="math/tex">i</script> to the real numbers you end up with this number system <script type="math/tex">\mathbb{C}</script>, the complex numbers. These behave similar to the familiar real numbers except that for any polynomial that describes a complex relationship there’s this transformation <em>complex conjugation</em> that turns one number satisfying the polynomial into another different number.</p>
<p>For example <script type="math/tex">x^3 - 2 = 0</script> has three solutions in the complex numbers, one is <script type="math/tex">\sqrt[3]{2}</script>, but it turns if you take <script type="math/tex">\omega</script> to be a complex number such that <script type="math/tex">\omega^3 = 1</script>, the other solutions to <script type="math/tex">x^3 - 2 = 0</script> are <script type="math/tex">\omega\sqrt[3]{2}</script> and <script type="math/tex">\omega^2\sqrt[3]{2}</script>, and it just so happens that <script type="math/tex">\omega\sqrt[3]{2}</script> is complex conjugate to <script type="math/tex">\omega^2\sqrt[3]{2}</script>. So the solutions to polynomial equations end up having this hidden structure to them that you might not have expected originally.</p>
<h2 id="jury-rigging-fields">Jury Rigging Fields</h2>
<p>The basic idea of a field extension is that you take a field (numbers can be multiplied, added, and divided with one another), adjoin extra elements to it, and see what the new object looks like. Generally you work in <script type="math/tex">\mathbb{Q}</script> which are the the rational numbers (1, -2, 3/4, 1/2, but no square roots, no crazy imaginary elements, etc).</p>
<p>The idea then is to take some polynomial that has no solutions in the “base field”, for example there are no rational numbers that satisfy <script type="math/tex">x^3 - 2 = 0</script>. So you say, “okay, since there’s no <script type="math/tex">x</script> such that cubing it is 2, let’s add an element that does and see what comes of it”. We’ll call that number <script type="math/tex">\sqrt[3]{2}</script> and add it to <script type="math/tex">\mathbb{Q}</script>. This ends up getting us a new field <script type="math/tex">\mathbb{Q}[\sqrt[3]{2}]</script>.</p>
<p>What does this new field look like? Well, it’s a field, it has all the same familiar rational numbers, but it also has this crazy new number <script type="math/tex">\sqrt[3]{2}</script>. Since it’s a field it has <script type="math/tex">1 / \sqrt[3]{2}</script>, and it also has all algebraic combinations of <script type="math/tex">\sqrt[3]{2}</script> with every other element in the field including itself. So this number system has all these new numbers <script type="math/tex">(\sqrt[3]{2})^2</script>, <script type="math/tex">(13 / \sqrt[3]{2})^8</script>, <script type="math/tex">(1 + \sqrt[3]{2})/17</script>, and so on. It’s still a number system like you’re used to, there’s just this new number along for the ride, and it turns out if you cube it you get <script type="math/tex">2</script>. Normal enough.</p>
<p>It turns out that for any field <script type="math/tex">K</script> and any irreducible polynomial <script type="math/tex">p(x)</script> (with coefficients in <script type="math/tex">K</script>), you can create a new field <script type="math/tex">L = K[x]</script> where <script type="math/tex">x</script> is a root of the irreducible polynomial. (The choice of what this <script type="math/tex">x</script> ‘actually is’ - for example if you consider what it is in projection into the complex numbers - ends up not mattering, there’s a theorem that all “stem fields” are the same.)</p>
<h2 id="thats-no-field">That’s No Field…</h2>
<p>Of course, mathematicians love it when they can recognize existing systems in new structures. It turns out you can view a field extension as a vector space over the original field - so our field <script type="math/tex">K</script> with all its new numbers is really a vector space with basis vectors <script type="math/tex">1, \sqrt[3]{2}, (\sqrt[3]{2})^2</script>. If you go back to all our “new numbers” we got, it turns out that each of these can be expressed as a combination of these basis vectors with constants from the base field <script type="math/tex">\mathbb{Q}</script>.</p>
<p>Since our field extension is now a vector space it makes sense to talk about its <em>dimension</em>, which in linear algebra is the size of its basis. Our extension <script type="math/tex">x^3 - 2</script> has dimension 3 because it has 3 basis vectors. It turns out that when you take an irreducible polynomial of degree <script type="math/tex">n</script> and adjoin it to a base field <script type="math/tex">K</script> the resulting vector space has degree <script type="math/tex">n</script> as well.</p>
<h2 id="extensions-of-extensions">Extensions of Extensions</h2>
<p>Looking back at the original polynomial <script type="math/tex">x^3 - 2</script> we notice it only has 1 solution in <script type="math/tex">\mathbb{Q}[\sqrt[3]{2}]</script>. In the complex numbers it has 3 solutions - <script type="math/tex">\sqrt[3]{2}, \omega\sqrt[3]{2}, \omega^2\sqrt[3]{2}</script>. So how we create a structure which has all three solutions?</p>
<p>It turns out that in the structure <script type="math/tex">\mathbb{Q}[\sqrt[3]{2}]</script> the polynomial <script type="math/tex">P = x^2 + (\sqrt[3]{2})x + (\sqrt[3]{2})^2</script> has no solutions, so we take a new element <script type="math/tex">x</script> that satisfies this equation (\if you call it <script type="math/tex">\omega\sqrt[3]{2}]</script> all the equations work out) and adjoin it to <script type="math/tex">\mathbb{Q}[\sqrt[3]{2}]</script>, getting us this new structure <script type="math/tex">\mathbb{Q}[\sqrt[3]{2}, \omega\sqrt[3]{2}]</script>. This new structure ends up having all 3 roots for <script type="math/tex">x^3 - 2</script>.</p>
<p>Since both <script type="math/tex">\sqrt[3]{2}</script> and <script type="math/tex">\omega\sqrt[3]{2}</script> are elements of this new field so is the <script type="math/tex">\omega</script> element (<script type="math/tex">\omega = \omega\sqrt[3]{2} \cdot 1/\sqrt[3]{2}</script>). Since <script type="math/tex">\omega^3 = 1</script> it also satisfies some strange-looking relationships: <script type="math/tex">\omega^{-1} = \omega^2</script> and <script type="math/tex">\omega^2 = -(\omega + 1)</script>. This shows us that the second root of the polynomial <script type="math/tex">P</script> is expressable as <script type="math/tex">-(\omega + 1) \cdot \sqrt[3]{2}</script>. So the members of this new field end up as being expressable as linear combinations of <script type="math/tex">1, \omega, \sqrt[3]{2}, (\sqrt[3]{2})^2, \omega\sqrt[3]{2}, \omega\sqrt[3]{2}</script> with coefficients from <script type="math/tex">\mathbb{Q}</script>. Thus the dimension of the new structure over the rationals is 6.</p>
<p>Since <script type="math/tex">\omega</script> is a member of <script type="math/tex">\mathbb{Q}[\sqrt[3]{2}, \omega\sqrt[3]{2}]</script> we know there’s also a subfield of $M$ that contains the rationals and <script type="math/tex">\omega</script> (dimension 2). Are there any other subfields? (Maybe some combination of <script type="math/tex">\omega</script> and <script type="math/tex">\sqrt[3]{2}</script>?)</p>
<p>It turns out there’s this great theorem that helps explain the structure of fields and their subextensions. Let <script type="math/tex">K</script> be a field, let <script type="math/tex">L</script> an extension of <script type="math/tex">K</script> and <script type="math/tex">M</script> an extension of <script type="math/tex">L</script>. Then:</p>
<div class="theorem" text="Tower Law">
$$[M : K] = [M : L][L : K]$$
</div>
<p>Since <script type="math/tex">M</script> over <script type="math/tex">K</script> has dimension 6 we know by the Tower Law that there can’t be any subfields of dimension 4 - 4 doesn’t divide 6. We can go through the divisors of the dimension of <script type="math/tex">M</script> to find all of its subfields. The final structure ends up looking like:</p>
<p><img class="img-responsive" style="display: block; margin: auto; max-width: 500px" src="/images/field-extension-subfields.svg" /></p>
<p>So, even though we constructed <script type="math/tex">M</script> by bolting on <script type="math/tex">\sqrt[3]{2}</script> and then <script type="math/tex">\omega\sqrt[3]{2}</script>, there’s another way to construct it by bolting on <script type="math/tex">\omega</script> and then <script type="math/tex">\sqrt[3]{2}</script>. It doesn’t matter what order you go, you get the same structure at the end.</p>
<h2 id="conclusion">Conclusion</h2>
<p>Field extensions are a way that you take one well-behaved structure and get another well-behaved structure. Irreducible polynomials are key to this as they express relationships that aren’t satisfied in the original structure but do end up satisfied in the new structure.</p>
<p>Field extensions actually end up being a really powerful tool - their theory can be used to show the impossibility of angle trisection with a compass and straightedge. The basic idea: start with numbers 0 and 1, allow constructing numbers in the complex plane through compass and straightedge. The only numbers that are constructible this way exist in field extensions that have dimension <script type="math/tex">2^n</script> over the rationals. However, to trisect the angle <script type="math/tex">2\pi/3</script>, we would need to be able to construct a number (<script type="math/tex">\cos {2\pi / 9}</script>) that exists in a field extension of dimension 3 over the rationals. Therefore general trisection is impossible.</p>
<h2 id="references">References</h2>
<ul>
<li>Ian Stewart, <em>Galois Theory</em> (4th Edition)</li>
</ul>
Sat, 04 Aug 2018 00:00:00 -0700
http://www.tildedave.com/2018/08/04/the-joy-of-field-extensions.html
http://www.tildedave.com/2018/08/04/the-joy-of-field-extensions.htmlNostalgia: Mr. Rogers and Mad Men's Carousel<p>One of the most famous scenes in AMC’s <em>Mad Men</em> comes at the end of Season 1. Don Draper’s been having a hard time of things lately - his marriage is falling apart and his relationship with his coworkers has taken a major downwards trend. To keep those plates spinning, Don gives the pitch of a lifetime.</p>
<center><iframe width="560" height="315" src="https://www.youtube.com/embed/suRDUFpsHus" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe></center>
<p>This is one of the most famous scenes of the series, but after having rewatched Mad Men a few times I’ve come to a really bleak reading of it. All the pictures of his wife are from their courtship and he’s just spent the last 13 episodes ignoring her, either by not being around, or by gaslighting her concerns about her life and their marriage. After the scene he tries to go home and live it and Betty’s gone, having taken the kids away for Thanksgiving (there was an argument earlier in the episode about this). Don might want to use nostalgia to go that place where he knows that he’s loved, but that place doesn’t exist inside of him. He can only summon it into being as an abstraction that he can use to land an account.</p>
<p>I found myself thinking about Don Draper’s Carousel after watching the new documentary <em>Won’t You Be My Neighbor</em>. I grew up a <em>Mr. Roger’s Neighborhood</em> kid and if you also watched while young, just try to make it through the trailer without tearing up a bit:</p>
<center><iframe width="560" height="315" src="https://www.youtube.com/embed/FhwktRDG_aQ" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe></center>
<p>Something that the documentary addresses is the everpresent question “<em>Was he really like that?</em>”, to which the answer appears to be “Yes”. Mr. Rogers wasn’t a Navy SEAL, he doesn’t have tattooed arms underneath his sweater, and the closest we see him get to angry is in a clip of him talking about how we are letting our children down. Mr. Rogers really <em>was</em> just a person who cared deeply about children, thought they had something to useful to say, and wanted the rest of society to care as much as he did.</p>
<p><em>Won’t You Be My Neighbor</em> is uses the same tools as Don Draper’s Carousel (nostaglia), except that instead of the fictional Don Draper using it to make you buy something, it’s summoning into your adult consciousness the perspective of a child and a language that makes the emotional issues we deal as adults super-explicit.</p>
<p>At one point they sing <a href="http://www.neighborhoodarchive.com/music/songs/sometimes_wonder_mistake.html"><em>Sometimes I Wonder If I’m a Mistake</em></a>. Daniel Striped Tiger vocalizes all these uncertainties and anxieties - he’s so different from everyone else and he can’t do anything right.</p>
<center><iframe width="560" height="315" src="https://www.youtube.com/embed/x6XAP_VThhk" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe></center>
<p>In the documentary, the Lady Aberlin actress points out that Daniel doesn’t “snap out of it” during singing - the fear doesn’t go away just because you’ve had someone tell you you’re better. And of course, the fears of Daniel aren’t just the anxieties of a child - adults have these same anxieties and just because you’re a little bigger, that doesn’t mean you don’t need someone to accept you just as you are.</p>
<p>Later, there’s a scene where various people who worked with Mr. Rogers think back to someone who helped them, someone who was there for them - their parents, old teachers, old friends and loved ones. They’re there, inside of you, and the documentary bought to life for me how important that emotional place is to maintain as an oasis among all the struggles of adulthood.</p>
<p>It’s powerful stuff, but the nostalgia is what makes it even more powerful: these songs and characters still rattle around my brain thirty years after the last time I sat down to watch an episode of it, and the documentary reframed all those songs and characters in a way that was really impactful to me as an adult viewer.</p>
Sun, 24 Jun 2018 00:00:00 -0700
http://www.tildedave.com/2018/06/24/mr-rogers-and-mad-mens-carousel.html
http://www.tildedave.com/2018/06/24/mr-rogers-and-mad-mens-carousel.htmlAn Appreciation - Blow-Up<p><em>Blow-Up</em> is Michalengelo Antonioni’s first English film and was released at the end of 1966. The plot is quickly summarized: in 1960s London, a professional photographer (Thomas) tries to escape his day-to-day by taking pictures in a nearby park. There he encounters a couple and takes their photos from a distance. He is confronted by a woman who demands he surrender his roll of film, and she persists in following him to his studio to try to get it back. Later he develops the pictures and notices a little detail in one of them - upon magnifying it (thus given name to the title), he discovers in the grainy detail of his photographs a potential murder plot.</p>
<center><iframe width="560" height="315" src="https://www.youtube.com/embed/Q62gRiUrylw" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe></center>
<p>He returns to the park and finds a dead body, hiding under the trees. Upon returning to his studio he finds all of his film and photographs of the scene have been taken. Later, returning to the park, he finds no evidence of the dead body. Was there ever a murder? The End.</p>
<p>For me <em>Blow-Up</em> is more relevant today than Antonioni’s other works, great though they are. His “alienation triology” (<em>L’Avventura</em>, <em>La Notte</em> and <em>L’Eclisse</em>) are great movies that touch on alienation in the modern world, but the characters in those movies always struck me as abstract and were just a bit harder to relate to.</p>
<p>In contrast it’s always been easy for me to identify with Thomas, and his emotional arc gets reinforced by the movie in ways that Antonioni’s other movies are less interested in. At the start of the movie, he is brash and overconfident. When he first “discovers” the murder plot he initially thinks he’s saved someone’s life (he’s basically a hero!). Then he takes another look at the photographs and discovers there might be a dead body body there (it’s so grainy!). He goes to the park again but it seems completely unreal, the dead body hasn’t moved in 12 hours. It seems fake. He loses his photos and then can’t even reconstruct a plausible story of what <em>did</em> happen. At the end of the movie in one of my favorite movie endings of all time, he watches the mimes playing tennis with an invisible ball … and then slowly begin to hear through his ear, the sounds of the invisible ball hitting the court. His feeling of objective truth is shattered, the camera pans out, and he vanishes into into landscape.</p>
<p>Outside its main arc, the themes of <em>Blow-Up</em> remain relevant in today’s world where everyone has a camera in their pocket and presents themselves to the world through a set of carefully curated pictures. Thomas’s lens of the world is one of intense privilege - he forces other people to adapt to his world as he encounters them. For his professional work, he forces the women in front of the camera to supplicate themselves to him, but it’s clear that they’re more complicated than the version of them that ends up captured by the film. In attempting to get back the park photos, Vanessa Redgrave tries to seduce him, presented as a “well, maybe this will work?” attempt by a goal-driven woman. It’s hard to feel like Thomas really <em>knows</em> anyone that he interacts with. Other people are just things be forced into perspective by his lens on the world.</p>
<p><img class="img-responsive" style="display: block; margin: auto; max-width: 600px" src="/images/blow-up-david-hemmings.jpg" /></p>
<p>Once the movie is over, I’m not sure where Thomas would go or what he would do. What happens after your view on the world has been totally shattered? Better to just leave him on the grass - he’s finally living in the real world instead a carefully managed construction. It’s a really great movie.</p>
Sun, 20 May 2018 00:00:00 -0700
http://www.tildedave.com/2018/05/20/an-appreciation-blow-up.html
http://www.tildedave.com/2018/05/20/an-appreciation-blow-up.htmlBook Review - A Distant Mirror<p>The middle ages weren’t a pleasant time to be alive. The Black Death killed half of the European population, out-of-control mercenary companies ravaged the land, peasants were exploited on every level by the nobility. In <em>A Distant Mirror</em>, Barbara Tuchman (author of <em>The Guns of August</em> on the runup to the Great War) walks through what life was like, with an eye towards the politics of the nobility and a focus on France in the midst of the Hundred Years war.</p>
<p>Wars between kings are expensive, usually funded by taxes on the peasantry around extremely pointless issues, and come to anticlimatic resolution. <a href="https://en.wikipedia.org/wiki/Louis_I,_Duke_of_Anjou">One French Duke</a> spends several chapters trying to get money to fund a company to go to Italy to press his claim on the Kingdom of Napes. In doing this he ignores the troubles of the French state (Charles VI has succeeded his father but is only a boy). Once he does get troops together they march down into Italy, manage to piss off all the Italian city states, ignores an opportunity to score a political win for the French state by capturing Urban VI (half of a papal schmism), and eventually dies without accomplishing much of anything. Later Tuchman characterizes this mindset:</p>
<blockquote>
<p>What moved knights to war was desire to do deeds of valor augmented by zeal for the faith, not the gaining of a political end by force of arms. They were concerned with the action, not the goal—which was why the given goal was so rarely attained.</p>
</blockquote>
<p>The book is full of stories like this - from our view of things, political actors pursue the wrong goals, squander their opportunities, and ultimately accomplish nothing. It’s clear George RR Martin took inspiration for his <em>Game of Thrones</em> from this portrait of the era. As much as his later books are criticized for going nowhere, history has way more examples of action that goes nowhere. If anything, <em>A Feast For Crows</em> and <em>A Dance With Dragons</em> have way more action than their historical models.</p>
<p><em>A Distant Mirror</em> ends with the story of the Battle of Nicopolis. The French knights go to Hungary to help the King of Hungary defend against the Ottoman Turks. In doing this they squander their money on luxuries for the traveling nobles, underestimate their opponents, ignore good battle advice, and make an ill-advise glory-seeking charge. The knights end up losing and are captured and ransomed by the Turks.. Later, French knights are cut down by English professional soldiers at the Battle of Agincourt, the English’s attempts to claim the French crown are foiled by revolts from Joan d’Arc and the emergence of a French national identity, and in a final act of pointlessness the main character’s castle is ultimately blown up in a show of force by Erich Luderdorff’s troops in the Great War.</p>
<p>Why do we read history? The fourteenth century is so disconnected from today’s political situation that it’s impossible to draw major connections, but people today are still much like people six hundred years earlier. What Tuchman does on page after page is to draw out the people - who they were, what they wanted, how they lived. There aren’t many books like this one.</p>
Sun, 11 Feb 2018 00:00:00 -0800
http://www.tildedave.com/2018/02/11/a-distant-mirror.html
http://www.tildedave.com/2018/02/11/a-distant-mirror.htmlRewatching The Wire<p>It’s been nine years since I last watched <em>The Wire</em> and I’m finally going through and doing a proper rewatch. <em>The Wire</em> is one reason I stopped gushing to people over TV shows - too many people gushing about the show, and the Stuff White People Like <a href="https://stuffwhitepeoplelike.com/2008/03/09/85-the-wire/">article</a> is a little too on the nose. Better to let people find this stuff for themselves than listen to me blabbing about how great things are.</p>
<p>I liked the show when I first watched it, but I was also never really compelled to rewatch it. Some of the moments are so painful - Frank Sobotka walking off to the meet at the end of Season 2, Randy’s group home at the end of Season 4 - that it’s difficult to want to revisit.</p>
<p>What the show does so well is the the small moments among the gang members: Bodie listening to Prairie Home Companion, <a href="https://www.youtube.com/watch?v=7ttbQTz8tAE">great lessons about the power of repetition</a>, crazy moments where the civil servents reveal they’re <a href="https://www.youtube.com/watch?v=gjtz-w0Xouo">willfully cruel</a>. On first watch Stringer Bell came off as pretty smart, on rewatch it’s clear he’s trying to put on a mask in order to escape his life, but he can’t.</p>
<p>What grates on me is the reputation the show has for realism. It’s hard for me to click with some of the characters - McNulty has some great moments but his writing is a bit cliche, maybe I missed something but I’m not sure why DeAngelo is so “woke” compared to his peers. Some of the people it creates are cartoons (Brother Mouzone and yes, even Omar) or so willfully evil (Rawls, Burrell) that it’s difficult to look at the world as anything other than a political rant.</p>
<p>Still, it’s a fun political rant to listen to, and the evil in the every-day frequently lands directly on target. <em>Deputy likes dots.</em></p>
Wed, 06 Dec 2017 00:00:00 -0800
http://www.tildedave.com/2017/12/06/rewatching-the-wire.html
http://www.tildedave.com/2017/12/06/rewatching-the-wire.htmlEngineering on Product-Focused Teams<p>So the new job orients engineers across product verticals, too. This also a <a href="http://engineering.tilt.com/engineering-your-organization/">change my last employer made</a> a few years ago. My first awareness of this organizational structure came from Spotify’s first article on <a href="https://labs.spotify.com/2014/03/27/spotify-engineering-culture-part-1/">“Scaling Agile”</a>, and it seems to be a pretty common organization nowadays for technology companies at a certain size. Having worked in this environment for a few years I figured I would write down some of my observations and the tensions that I’ve seen emerge.</p>
<h2 id="for-the-organization">For the Organization</h2>
<p>The main benefit to the overall organization over a technology-focused team (“frontend team”, “backend team”, “mobile team”) is that your resourcing dependencies are a lot clearer, and you can have a better understanding of your capacity a few months out. Organizations tend to think in workstreams - how many simultaneous projects can we have moving at once? Since a workstream often requires work done on a number of different levels of the stack, if you’re organized around technologies, the questions around workstreams are harder. If you have three backend engineers and five frontend engineers, will teams be constantly utilized? How many engineers will we need to hire looking at the six month window, and what types? How do we prioritize a frontend hire over a backend hire?</p>
<p>It’s easier to say, okay, we have three teams with four engineers each, each of these can reasonably handle 1 project at a time, certain projects take a few months - bam, you have a roadmap. Your problems then shift to how to help each team be able to execute on these projects more or less independently. This requires a few more things of your technology: is it possible for teams to work in the same codebase without stepping on each other toes or causing regressions? This is indicative of your overall level of tech debt and quality processes, but some level of churn should probably be expected here, as long as it’s managed well.</p>
<h2 id="for-the-engineer">For the Engineer</h2>
<p>As an engineer in this organization, your benefit is that you get a chance to really zero in on an aspect of the overall product, and you may have a direct line to a product manager who can explain your team’s slice of the world. Overall this can be a lot less alienating than the assembly-line feeling of “get ticket, do ticket” since you’ll have an opportunity to really explore the <em>why</em> for various things on your roadmap.</p>
<p>However, you may end up with your day-to-day being very disconnected from the day-to-day of the people that sit next to you. You may be building some frontend widget while your co-workers is building an API route - you each see the output of each other’s work, but the details of how it’s done, and the edge cases, can be harder to understand. The reason this isolation ends up happening is that organizations rarely have more resources than they need, and teams with extra developers with skills in a particular technology area are assumed to be able to handle a number of projects at once.</p>
<p>Since getting technical feedback from your co-workers can be difficult, you will need to find thought partners across your technology unit to bounce ideas off of and work through issues that come up during implementation. You might end up with your code reviews primarily being done by people outside your team, which never feels great - are they as invested in your success as your teammates?</p>
<p>Longer term - what does your career development look like? On a technology-focused team the path looks more clear - you sit with developers more senior than you, eventually you’d take on the things that they’re doing. If you’re the only frontend developer on a team, how can you continue to develop your skills? Here, you have to be proactive - look for opportunities to improve your team’s part of the codebase and figure out how to make your manager understand the value of this investment.</p>
<p>One positive of this is that you will have opportunities to stretch your understanding of the technology stack that your company is dealing with. If you’re primarily a frontend developer, you’ll have natural partners on your team to help you dive into new stacks if this is something you’re interested in. While this might not end up with you immediately gaining deep experience, it’s a great way to get your feet wet and start to see things from a different point of view.</p>
<p>There might also be times where you are asked to contribute to new codebases. I’ve been in this situation a few times, and my recommendation from this is to not be too proscriptive with how you view your career - I’ve always followed what’s seemed interesting, and it’s lead me to areas I’d never have dreamed (<em>“Peculiar travel suggestions are dancing lessons from God”</em> - Kurt Vonnegut). Ultimately I think understanding how the server works makes you a better frontend developer and vice versa. This is a healthy tension that I’d recommend exploring, rather than being too closed off to.</p>
<p>A benefit of this organization is that you have a lot more empowerment if you see something on your team’s roadmap that you disagree with. On a product-centered team you should have both access to tools to measure impact of the work you’re doing and your team’s likely also been given the autonomy to decide what to work on. Contrast this an organization centered around a technology stack - if you see a feature coming you don’t agree with … what? Does every team involved with a feature end up with a veto on every item on the roadmap? (You can still get the right outcomes in these situations, it’s just much harder.) Product-centric teams at least provide a framework where your team can resist ideas that need more baking, rather than forcing this disagreement into cross-team hell.</p>
<h2 id="for-the-front-line-manager">For the Front-Line Manager</h2>
<p>As a front-line manager, the main challenge I’ve seen arise from this team structure is in dealing a team responsible for a set of code across a number of different technology stacks (frontend, backend, mobile). In this situation, you will have people reporting to you who are working in languages and possibly even entire stacks you are unfamiliar with; maybe you’re a former backend developer who has a frontend developer reporting to you now, for example.</p>
<p>Many of the tools you have as a manager rely on digging into a situation someone’s having, pattern matching it with something you’ve dealt with in the past, and then providing guidance on a way forward. In teams with a more homogenous technology, you can lean more on other team members to solve issues here - but if your only frontend developer is having a problem with their particular technology stack, you can’t really ask them to thought partner with the backend engineer.</p>
<p>As the manager in this situation you also rely on strong feedback cycles for your directs in order to better coach them through challenges they’re having - only taking the direct’s view of the world leaves you with some pretty big blind spots about their performance and areas where they could improve.</p>
<p>Another issue is that if you have many developers in a particular codebase spread across multiple teams, the team retrospective - one of the best tools if you’re looking to improve the team - is a lot harder to use. Developers running into issues with a shared codebase on a particular team aren’t as free to experiment with different solutions to the problem (maybe these ideas have been tried and considered, maybe they aren’t even good ideas). Getting the right people in a room to brainstorm on a way to improve a problem your team is having becomes a lot harder.</p>
<h2 id="for-the-technology">For the Technology</h2>
<p>I don’t think anyone who’s worked in a non-trivial codebase would disagree that some level of technological upkeep is required - code needs constant refactoring to stay healthy. The architecture needs to be re-examined from time to time and engineers need to be constantly thinking about not just the feature, but how to improve the codebase that everyone’s adding to. The invisible and non-functional requirements are things that matter, often aren’t measured precisely, and can be a place where unknown behaviors of the system surprise you, requiring massive resource investments even to understand what’s going on.</p>
<p>Handling architectural improvements at the same time as product features is a huge amount of work, and it probably isn’t reflected on any of your team’s roadmaps. How can engineers be encouraged to work the non-functional aspects of their jobs and really work towards improving the codebase along with the rest of their day-to-day? The goal here is to avoid a Tragedy of the Commons situation where a shared resource is depleted through individually selfish action - and the model I’d use to solve this is figuring out how to instill in your culture a “boy scout rule” - leave the code better than when you found it, and spend a certain percentage of your time on each task making sure that things are getting better.</p>
<p>Beyond that, are there engineers whose full-time job is to make other engineers more effective? At my current job this is reflected through investment in our “infrastructure” headcount, and people in this area do engineering-facing work like building systems to allow teams to automatically create alarms for bad things that happen in production, evaluate third party SDKs for our mobile clients, build internal database services, and the like. At my last role (20 engineers) we often had a need for solutions in this area, but it was never enough to justify a full-time engineer as investment as opposed to building out or maintaining the product. We kept muddling through, which feels right in retrospect - despite our size, we were still searching for product/market fit, which meant that every hand on deck needed to be focused towards ways to help the company find ways to be successful. At my current role, we have a sizable infrastructure team making sure that different teams oriented around product verticals are set up to succeed (server, mobile, frontend).</p>
<h2 id="conclusions">Conclusions</h2>
<p>Ultimately I think aligning your engineering organization around product verticals is a healthy thing after a certain size if your business’s goal is to ship a product. With the day-to-day independence and the bond you develop with your cross-functional team comes its own set of dysfunctions related to how you interact with the rest of the company. I’ve tried to lay out the ones I’ve had experience with and I hope they’ll be useful for you.</p>
<ul>
<li>Aligning engineers along product verticals allows easier answers to questions around organizational roadmap and planning future resourcing.</li>
<li>Because resources are finite, developers across a technology stack may have poor “per-team” representation - sometimes only one developer per technology stack.</li>
<li>As an engineer, I’d recommend viewing this as a way to stretch your technological boundaries and see where the job takes you.</li>
<li>As a manager, you still need to keep your engineers engaged while the tools you usually have to evaluate individuals’ performance and implement team change are less effective.</li>
<li>It’s still important to make sure engineers are investing in the codebase and leaving things better than when they found it.</li>
</ul>
Tue, 27 Jun 2017 00:00:00 -0700
http://www.tildedave.com/2017/06/27/product-focused-teams.html
http://www.tildedave.com/2017/06/27/product-focused-teams.html