# Erdős–Anning theorem

The Erdős–Anning theorem states that, whenever an infinite number of points in the plane all have integer distances, the points lie on a straight line. The same result holds in higher dimensional Euclidean spaces. The theorem cannot be strengthened to give a finite bound on the number of points: there exist arbitrarily large finite sets of points that are not on a line and have integer distances.
The theorem is named after Paul Erdős and Norman H. Anning, who published a proof of it in 1945. Erdős later supplied a simpler proof, which can also be used to check whether a point set forms an Erdős–Diophantine graph, an inextensible system of integer points with integer distances. The Erdős–Anning theorem inspired the Erdős–Ulam problem on the existence of dense point sets with rational distances.

## Rationality versus integrality

Although there can be no infinite non-collinear set of points with integer distances, there are infinite non-collinear sets of points whose distances are rational numbers. For instance, the subset of points on a unit circle obtained as the even multiples of one of the acute angles of an integer-sided right triangle (such as the triangle with side lengths 3, 4, and 5) has this property. This construction forms a dense set in the circle. The (still unsolved) Erdős–Ulam problem asks whether there can exist a set of points at rational distances from each other that forms a dense set for the whole Euclidean plane. According to Erdős, Stanisław Ulam was inspired to ask this question after hearing from Erdős about the Erdős–Anning theorem.
For any finite set S of points at rational distances from each other, it is possible to find a similar set of points at integer distances from each other, by expanding S by a factor of the least common denominator of the distances in S. By expanding in this way a finite subset of the unit circle construction, one can construct arbitrarily large finite sets of non-collinear points with integer distances from each other. However, including more points into S may cause the expansion factor to increase, so this construction does not allow infinite sets of points at rational distances to be transformed into infinite sets of points at integer distances.

## Proof

Shortly after the original publication of the Erdős–Anning theorem, Erdős provided the following simpler proof.
The proof assumes a given set of points with integer distances, not all on a line. It then proves that this set must be finite, using a system of curves for which each point of the given set lies on a crossing of two of the curves. In more detail, it consists of the following steps:
* Arbitrarily choose a triangle $ABC$ formed by three of the given points. The figure shows an example for which these three chosen points form a right triangle (yellow) with edge lengths 3, 4, and 5.
* Let $d$ denote the Euclidean distance function. For any given point $X$, the integer $|d(A,X)-d(B,X)|$ is at most $d(A,B)$, by the triangle inequality. Thus, $X$ lies on one of $d(A,B)$ hyperbolas, defined by equations of the form $|d(A,X)-d(B,X)|=i$ with $0\leq i<d(A,B)$. These are shown in blue in the figure. For $i=d(A,B)$ this equation instead defines two rays extending in opposite directions on the line through $A$ and $B$ (also shown in blue); this pair of rays can be treated as a degenerate hyperbola for the purposes of the proof.
* By a symmetric argument, $X$ must also lie on one of $d(B,C)+1$ hyperbolas or degenerate hyperbolas defined by equations of the form $|d(B,X)-d(C,X)|=j$ with $0\leq j\leq d(B,C)$. These are shown in red in the figure.
* The blue and red hyperbolas containing $X$ cannot coincide, because they have different pairs of foci. Thus, $X$ must be a point where they intersect. Each pair of a blue and red hyperbola have at most four intersection points, by Bézout's theorem.
* Because each given point must be one of these intersection points, the number of given points is at most the product of the number of pairs of hyperbolas and the number of intersections per pair. This is at most $4{\bigld(A,B)+1{\bigr )}{\bigld(B,C)+1{\bigr )}$ points, a finite number.
The same proof shows that, when the diameter of a set of points with integer distances is $\delta$, there are at most $4(\delta +1)^{2}$ points. The quadratic dependence of this bound on $\delta$ can be significantly improved: if a set with integer distances and diameter $\delta$ is collinear, it obviously has at most $\delta +1$ points, and if it is not collinear, it has size $\delta ^{O(1/\log \log \delta )}$, where the $O(\,)$ uses big O notation. However, it is not possible to replace $\delta$ by the minimum distance between the points: there exist arbitrarily large non-collinear point sets with integer distances and with minimum distance two.

## Maximal point sets with integral distances

An alternative way of stating the theorem is that a non-collinear set of points in the plane with integer distances can only be extended by adding finitely many additional points, before no more points can be added. A set of points with both integer coordinates and integer distances, to which no more can be added while preserving both properties, forms an Erdős–Diophantine graph.
The proof of the Erdős–Anning theorem can be used in an algorithm to check whether a given set of integer points with integer distances forms an Erdős–Diophantine graph: merely find all of the crossing points of the hyperbolas used in the proof, and check whether any of the resulting points also have integer coordinates and integer distances from the given set.

## Higher dimensions

As Anning and Erdős wrote in their original paper on this theorem, "by a similar argument we can show that we cannot have infinitely many points in $n$-dimensional space not all on a line, with all the distances being integral."