Descartes S Circle Theorem Via Elimination

Problem. Consider four mutually tangent circles in $\mathbb{R}^2$ of radii $r_1,r_2,r_3,r_4$. If three circles are inside the fourth, then take the radius of the largest circle to be negative. All other radii in this and other cases are taken positive. Show that $$2\sum_{i=1}^4 r_i^{-2}=\left(\sum_{i=1}^4 r_i^{-1}\right)^2.$$

Solution: (Note: This was a response to the solution 2 below when there was a mistake.) I have worked on this exercise also. So here is my Macaulay code that solved the exercise:

R = QQ[a_1 .. a_4,b_1 .. b_4,r_1 .. r_4];
L = for i from 1 to 4 list
  for j from 1 to 4 list if i!=j then ((a_i-a_j)^2+(b_i-b_j)^2-(r_i+r_j)^2) else 0;
I = ideal flatten L;
J = eliminate(toList(a_1 .. a_4 | b_1 .. b_4),I)

K = frac R
f = 2 * sum apply(toList(1..4),i -> 1/((r_i)^2)) - (sum apply(toList(1..4),i -> 1/((r_i))))^2
numerator f - J_0

So let's go through it slowly. I did also set up the very same equations as above. I chose a_1 up to a_4 and b_1 up to b_4 to be the coordinates of the centers of the circles and r_1 up to r_4 to be their respective radii. Indeed the fact that they only touch in one point is modeled by the equation that the (euclidean) distance of their centers is equal to the sum of their radii. Squaring this equations gives(1)
\begin{equation} (a_i-a_j)^2+(b_i-b_j)^2-(r_i+r_j)^2 \end{equation}

for all i,j with i different from j. So in the above code, the second and third line generates these equations and writes them in a list of lists. So I generate an ideal and eliminate the variables of the centers (the a-s and b-s). The rest of the code checks, whether this polynomial generated by Macaulay2 is actually the same as the rational function given on the exercise sheet: So I enter the rational function f into Macaulay2 (computation in the fraction field of the polynomial ring R) and find that the numerator of it is actually the same as the computed generator of the ideal

\begin{align} J=I\cap \mathbb{Q}[r_1,\ldots,r_4] \end{align}

So here is the generator of this ideal as Macaulay2 computed it on my computer:


—This polynomial is different from the one below. In fact the reason seems to be, that there is a typo in the definition of the ideal upstairs, namely


I assume, it will all work out fine, if this is fixed.—

Solution 2 Call the center of the circles $(x_i,y_i)$ for $i=1,\ldots,4$. For each pair $i,j$ one has from the distance formula and the fact that the circles are tangent that $$(x_i-x_j)^2+(y_i-y_j)^2=(r_i+r_j)^2.$$ (This assumes the radii are positive.) Using this information, we can turn to Macaulay and try to eliminate the x and y variables:


Then you get a principal ideal

Now we have to check that it's the right thing.
l=flatten entries gens J --get the generator of J, albeit as a list
ts=terms l#0 --get a list of terms of the generator of J
pos=for t in ts list (if leadCoefficient t > 0 then t) --pull out the positive terms
neg=for t in ts list (if leadCoefficient t < 0 then t) --and the negative terms
pos=delete(null,pos) --delete the empty elements of those lists 
neg=delete(null,neg) --(there should have been continue statements in the loops above, I think)
p=fold(plus,pos) --now sum the positive terms together
n=fold(plus,neg) --and the negative terms together

Once we've done that

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License