Introduction

The Summer of Math Exposition or SoMe is an annual competition hosted by Grant Sanderson over at 3blue1brown. In its own words, the compeititions seeks to foster the creation of excellent math content online. Last year, I had the pleasure of reviewing several SoMe submissions from content creators across the globe. One of those videos introduced a certain construction of tangential circles known as Ford Circles. Intrigued, I decided to take a deeper look.

What are Ford Circles?

I'll save you the trouble of searching for the relevant Wikepedia Article and provide the first paragraph for reference.

In mathematics, a Ford circle is a circle in the Euclidean plane, in a family of circles that are all tangent to the x-axis at rational points. For each rational number \( \frac{p}{q} \), expressed in lowest terms, there is a Ford circle whose center is at the point \( \left(\frac{p}{q}, \frac{1}{2q^2}\right) \) and whose radius is \( \frac{1}{2q^2} \). It is tangent to the x-axis at its bottom point, \( \left(\frac{p}{q}, 0\right) \). The two Ford circles for rational numbers \( \frac{p}{q} \) and \( \frac{r}{s} \) (both in lowest terms) are tangent circles when \( |ps - qr| = 1 \) and otherwise these two circles are disjoint.

If you're anything like me, you are probably wondering what exactly you just read. To answer that, I think a visual demonstration is in order. This particular graphic is interactive, so I encourage you to hover over the fractions to really get a feel for what is going on here.

Your browser does not support SVG
Interactive Ford Circle Graphic (Taken from Wikepedia)

What makes Ford Circles so miraculous is that this innocuous procedure of drawing up tangential circles given three seed circles ends passing through every rational number between 0 and 1.

Connection to the Farey Sequence

For the mathematically inclined, I draw a connection between Ford Circles and the Farey Sequence. This demonstration was modestly adapted from Harvey Yau's presentation for The Archimedeans. We'll open with a key definition and a couple of lemmas.

Definition 1

We define the smallness of a circle \( C \) with radius \( r \) to be \( \frac{1}{\sqrt{2r}} \)

Lemma 1

Consider two circles \( C_1 \) and \( C_2 \) tangent to each other and to the x-axis. The distance between the two circles is given by \( \frac{1}{s_1 s_2} \) where \( s_1 \) and \( s_2 \) are the smallness of \( C_1 \) and \( C_2 \).

Lemma 2

Consider two parent circles \( C_1 \) and \( C_2 \) tangent to each other and to the x-axis. There exists a unique child circle \( C_3 \) that is pairwise tangent to both circles and to the x-axis. Moreover, the smallness of \( C_3 \) is the sum of the smallness of \( C_1 \) and \( C_2 \).

As it so happens, Presh Talwalker has a short video working through the relevant algebra for Lemma 1 and Lemma 2. To offer an alternative perspective, Lemma 2 may be seen as consequences of Descarte's Theorem (the connection to which is made clear by viewing the x-axis as an infinitely large circle) adapted to fit the language of smallness.

Now our task is to prove the following statement.

Theorem 1

Consider two parent circles \( C_1 \) and \( C_2 \) tangent to each other and to the x-axis. We further stipulate these circles are tangent to the x-axis at \( \frac{a}{b} \) and \( \frac{c}{d} \) with \( \frac{a}{b} < \frac{c}{d} \) and have smallness \( b \) and \( d \). We need to show that the child circle \( C_3 \) is tangent to the x-axis at \( \frac{a + c}{b + d} \) (namely the mediant of its parents) and has smallness \( b + d \).

Proof

The plan of attack is to use Lemmas to compute the distance between \( C_1 \) and \( C_3 \). From there, we'll add back the original position of \( C_1 \) and massage the sum into the desired result.

  1. Lemma 2, \( s_3 = s_1 + s_2 = b + d \)
  2. Lemma 1, the distance between \( C_1 \) and \( C_3 \) is \( \frac{1}{s_1 s_3} = \frac{1}{b(b + d)} \)
  3. Adding the position of \( C_1 \) we have \( \frac{a}{b} + \frac{1}{b(b + d)} = \frac{a(b + d) + 1}{b(b + d)} \)
  4. Since the desired result involves \( c \), we are motivated to incorporate that. Notice that from Lemma 1, we have \( \frac{c}{d} - \frac{a}{b} = \frac{1}{bd} \) which directly implies \( bc - ad = 1 \)
  5. Substituting \( bc - ad = 1 \) into the third bullet, we have \( \frac{a(b + d) + bc - ad}{b(b + d)} = \frac{a + c}{b + d} \) which is what we wanted to show.

The key observation here is that so long as our parent circles have a smallness that aligns with denominator of their x-coordinate, then their child circle follows suit. In effect, we can repeteadly apply Theorem 1 to all child circles produced by the procedure. The Ford Circles are initiated by two circles of diameter 1 positioned at \( \frac{0}{1} \) and \( \frac{1}{1} \) satisfying the requirements of Theorem 1. We now consider the following sequence:

\begin{align*} & F_1 = \left\{ \frac{0}{1}, \frac{1}{1} \right\} \\ & F_2 = \left\{ \frac{0}{1}, \frac{1}{2}, \frac{1}{1} \right\} \\ & F_3 = \left\{ \frac{0}{1}, \frac{1}{3}, \frac{1}{2}, \frac{2}{3}, \frac{1}{1} \right\} \\ & F_4 = \left\{ \frac{0}{1}, \frac{1}{4}, \frac{1}{3}, \frac{1}{2}, \frac{2}{3}, \frac{3}{4}, \frac{1}{1} \right\} \\ \end{align*}

This sequence of fractions is fancifully called the Farey Sequence and is closely related to the Stern Brocot Tree. It is well known that every rational number \( \frac{a}{b} \) with coprime integers \( a \) and \( b \) satisfying \( 0 \le a < b \) appears exactly once in the Stern Brocot Tree. While I won't delve into a full-blown proof of this fact, I will provide a curious result that builds intuition on how one might approach such a proof.

Theorem 2

The mediant of two fractions lies strictly between those two fractions. Explicitly, if \( 0 \le \frac{a}{b} < \frac{c}{d} \) then \( \frac{a}{b} < \frac{a + c}{b + d} < \frac{c}{d} \)

Proof

The plan of attack is to directly compute \( \frac{a + c}{b + d} - \frac{a}{b} \) and \( \frac{c}{d} - \frac{a + c}{b + d} \) and use the fact that \( \frac{a}{b} < \frac{c}{d} \) to show that both differences are strictly poisitve.

  1. \( \frac{a + c}{b + d} - \frac{a}{b} = \frac{bc - ad}{b(b + d)} = \frac{c}{b + d} - \frac{ad}{b(b + d)} = \frac{d}{b + d} \left ( \frac{c}{d} - \frac{a}{b} \right ) \)
  2. \( \frac{c}{d} - \frac{a+c}{b+d} = \frac{bc - ad}{d(b+d)} = \frac{bc}{d(b + d)} - \frac{a}{b + d} = \frac{b}{b+d} \left( \frac{c}{d} - \frac{a}{b} \right) \)
  3. Since the product of two positive numbers is also positive, we conclude that both differences are positive as desired.

Given Theorem 2, it is not hard to imagine that iteratively computing mediants essentially squeezes out all rational numbers between \( 0 \) and \( 1 \) in the limit. For a more rigorous treatment, I recommend checking out Theorem 4.4 of this paper on the topic.

Creating An Apollonian Gasket

Taking inspiration from this Code Golf we can whipp up some pseudo-code that draws an Apollonian Gasket associated with the Ford Circles.

                
                    def drawApollonianCircle(parents):
                        if (parents[-1].recursionDepth == DEPTH): return;
                        else:
                            apollonian = getCircle(*parents)
                            self.add(apollonian)
                            pairs = list(combinations(parents, 2))
                            for pair in pairs:
                                pair = list(pair)
                                pair.append(apollonian)
                                drawApollonianCircle(pair)
                
            

Running through that workflow, I managed to create a 5th order Apollonian Gasket involving the Ford Circles!

Your browser does not support SVG
5th Order Apollonian Gasket with Farey Lines Superimposed
Addendum

As it so happens, computing the center coordinates and radius of a child circle given three pairwise tangent parent circles is tedious. Here, I sketch the procedure. We'll start by snagging three key equations from Wikepedia.

\begin{align*} & k_{4} = k_{1} + k_{2} + k_{3} + 2\sqrt{k_{1}k_{2} + k_{2}k_{3} + k_{3}k_{1}} \\ & z = x + iy \\ & z_{4}=\frac{z_{1}k_{1}+z_{2}k_{2}+z_{3}k_{3}+2\sqrt{k_{1}k_{2}z_{1}z_{2}+k_{2}k_{3}z_{2}z_{3}+k_{1}k_{3}z_{1}z_{3}}}{k_{4}} \end{align*}

To clarify, the signed curvature of a circle is defined as \( k = \pm \frac{1}{r} \) where \( r \) is its radius. In effect, the first equation allows us to directly compute the radius of a child circle given its three parents. To find the center coordinates, however, we'll need to rely on the second and third equations. The game plan is to split \( z_{4} \) into real and imaginary parts since the second equation tells us those correspond to the \( x \) and \( y \) coordinates of the child circle's center.

We'll start by expressing the products under the radical in general.

\[ k_{a}k_{b}z_{a}z_{b} = k_{a}k_{b}\left(x_{a}x_{b}-y_{a}y_{b}\right)+k_{a}k_{b}i\left(x_{a}y_{b}+x_{b}y_{a}\right) \]

Using this identity, we can write the expression under the radical as \( a + ib \) for \( a \) and \( b \) given below.

\begin{align*} & a = k_{1}k_{2}\left(x_{1}x_{2}-y_{1}y_{2}\right)+k_{2}k_{3}\left(x_{2}x_{3}-y_{2}y_{3}\right)+k_{1}k_{3}\left(x_{1}x_{3}-y_{1}y_{3}\right) \\ & b = k_{1}k_{2}\left(x_{1}y_{2}+x_{2}y_{1}\right)+k_{2}k_{3}\left(x_{2}y_{3}+x_{3}y_{2}\right)+k_{1}k_{3}\left(x_{1}y_{3}+x_{3}y_{1}\right) \end{align*}

At the moment, the radical makes it difficult to split \( z_{4} \) into real and imaginary parts. Ideally, we'd get rid of the radical by writing the expression \( a + ib \) as \( (u + iv)^{2} \) for some choices of \( u \) and \( v \). Assuming that such choices exist, it follows \( a = u^{2} - v^{2} \) and \( b = 2uv \). Writing \( v \) in terms of \( u \), we are left with \( a = u^{2} - \left ( \frac{b}{2u} \right )^2 \) which, conveniently, is quadratic in \( u^{2} \). Applying the quadratic formula, we find \( u \) and \( v \).

\[ |u| = \sqrt{\frac{4a \pm \sqrt{16a^{2}+16b^{2}}}{8}} \hspace{0.5em} |v| = \sqrt{\frac{4a \pm \sqrt{16a^{2}+16b^{2}}}{8}-a} \]

At this point, we can directly split \( z_{4} \) into real and imaginary parts. The center coordinates are given below.

\[ x_{c} = \frac{k_{1}x_{1}+k_{2}x_{2}+k_{3}x_{3}+2\cdot u}{k_{4}} \hspace{0.5em} y_{c}=\frac{k_{1}y_{1}+k_{2}y_{2}+k_{3}y_{3}+2\cdot v}{k_{4}} \]

Comment Section