Almost-Equidistant Sets

For a positive integer d, a set of points in d-dimensional Euclidean space is called almost-equidistant if for any three points from the set, some two are at unit distance. Let f(d) denote the largest size of an almost-equidistant set in d-space. It is known that f(2)=7\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$f(2)=7$$\end{document}, f(3)=10\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$f(3)=10$$\end{document}, and that the extremal almost-equidistant sets are unique. We give independent, computer-assisted proofs of these statements. It is also known that f(5)≥16\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$f(5) \ge 16$$\end{document}. We further show that 12≤f(4)≤13\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$12\le f(4)\le 13$$\end{document}, f(5)≤20\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$f(5)\le 20$$\end{document}, 18≤f(6)≤26\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$18\le f(6)\le 26$$\end{document}, 20≤f(7)≤34\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$20\le f(7)\le 34$$\end{document}, and f(9)≥f(8)≥24\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$f(9)\ge f(8)\ge 24$$\end{document}. Up to dimension 7, our work is based on various computer searches, and in dimensions 6–9, we give constructions based on the known construction for d=5\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$d=5$$\end{document}. For every dimension d≥3\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$d \ge 3$$\end{document}, we give an example of an almost-equidistant set of 2d+4\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$2d+4$$\end{document} points in the d-space and we prove the asymptotic upper bound f(d)≤O(d3/2)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$f(d) \le O(d^{3/2})$$\end{document}.


Introduction and Our Results
For a positive integer d, we denote the d-dimensional Euclidean space by R d . A set V of (distinct) points in R d is called almost equidistant if among any three of them, some pair is at distance 1. Let f(d) be the maximum size of an almost-equidistant set in R d . For example, the vertex set of the well-known Moser spindle ( Fig. 1) is an almost-equidistant set of 7 points in the plane and thus f ð2Þ ! 7.
In this paper we study the growth rate of the function f. We first consider the case when the dimension d is small and give some almost tight estimates on f(d) for d 9. Then we turn to higher dimensions and show 2d þ 4 f ðdÞ Oðd 3=2 Þ. We also discuss some possible generalisations of the problem.

Our Results in Low Dimensions
It is trivial that f ð1Þ ¼ 4 and that, up to congruence, there is a unique almostequidistant set on 4 points in R. Bezdek, Naszódi, and Visy [5] showed that an almost-equidistant set in the plane has at most 7 points. Talata (personal communication) showed in 2007 that there is a unique extremal set. We give a simple, computer-assisted proof of this result.
Theorem 1 (Talata, 2007) The largest number of points in an almost-equidistant set in R 2 is 7, that is, f ð2Þ ¼ 7. Moreover, up to congruence, there is only one planar almost-equidistant set with 7 points, namely the Moser spindle. Figure 2 shows an example of an almost-equidistant set of 10 points in R 3 . It is made by taking a so-called biaugmented tetrahedron, which is a non-convex polytope formed by gluing three unit tetrahedra together at faces, and rotating a copy of it along the axis through the two simple vertices so that two additional unitdistance edges are created. This unit-distance graph is used in a paper of Nechushtan [19] to show that the chromatic number of R 3 is at least 6. Györey [13] showed, by an elaborate case analysis, that this is the unique largest almost-equidistant set in dimension 3. We again give an independent, computer-assisted proof.
Theorem 2 (Györey [13]) The largest number of points in an almost-equidistant set in R 3 is 10, that is, f ð3Þ ¼ 10. Moreover, up to congruence, there is only one almost-equidistant set in R 3 with 10 points.
In dimension 4, we have only been able to obtain the following bounds.
Theorem 3 The largest number of points in an almost-equidistant set in R 4 is either 12 or 13, that is, f ð4Þ 2 f12; 13g.
The lower bound comes from a generalization of the example in Fig. 2; see also Theorem 5. The proofs of the upper bounds in the above theorems are computer assisted. Based on some numerical work to find approximate realisations of graphs, Fig. 1 The Moser spindle we believe, but cannot prove rigorously, that there does not exist an almostequidistant set of 13 points in R 4 .

Conjecture 1
The largest number of points in an almost-equidistant set in R 4 is 12, that is, f ð4Þ ¼ 12.
In dimension 5, Larman and Rogers [16] showed that f ð5Þ ! 16 by a construction based on the so-called Clebsch graph. In dimensions 6 to 9, we use their construction to obtain lower bounds that are stronger than the lower bound 2d þ 4 stated below in Theorem 5. We again complement this with some computer-assisted upper bounds. The unit-distance graph of an almost-equidistant point set P in R d is the graph obtained from P by letting P be its vertex set and by placing an edge between pairs of points at unit distance.
For every d 2 N, a unit-distance graph in R d does not contain K dþ2 (see Corollary 8) and the complement of the unit-distance graph of an almost-equidistant set is triangle-free. Thus we have f ðdÞ Rðd þ 2; 3Þ À 1, where Rðd þ 2; 3Þ is the Ramsey number of K dþ2 and K 3 , that is, the smallest positive integer N such that for every graph G on N vertices there is a copy of K dþ2 in G or a copy of K 3 in the complement of G.
Ajtai, Komlós, and Szemerédi [1] showed Rðd þ 2; 3Þ Oðd 2 = log dÞ and this bound is known to be tight [14]. We thus have an upper bound f ðdÞ Oðd 2 = log dÞ, which, as we show below, is not tight. For small values of d where the Ramsey number Rðd þ 2; 3Þ is known or has a reasonable upper bound, we obtain an upper bound for f(d). In particular, we get f ð5Þ 22, f ð6Þ 27, f ð7Þ 35, f ð8Þ 41, and  [22]. For d 2 f5; 6; 7g, we slightly improve these estimates to the bounds from Theorem 4 using our computer-assisted approach (Table 1).

Our Results in Higher Dimensions
We now turn to higher dimensions. The obvious generalization of the Moser spindle gives an example of an almost-equidistant set of 2d þ 3 points in R d . The next theorem improves this by 1. It is a generalization of the almost-equidistant set on 10 points in R 3 from Fig. 2.
Rosenfeld [23] showed that an almost-equidistant set on a sphere in R d of radius 1= ffiffi ffi 2 p has size at most 2d, which is best possible. Rosenfeld's proof, which uses linear algebra, was adapted by Bezdek and Langi [4] to spheres of other radii. They showed that an almost-equidistant set on a sphere in R d of radius 1= ffiffi ffi 2 p has at most 2d þ 2 elements, which is attained by the union of two d-simplices inscribed in the same sphere.
Pudlák [21] and Deaett [10] gave simpler proofs of Rosenfeld's result. Our final result is an asymptotic upper bound for the size of an almost-equidistant set, based on Deaett's proof [10].
Theorem 6 An almost-equidistant set of points in R d has cardinality Oðd 3=2 Þ.
We note that Polyanskii [20] recently found an upper bound of Oðd 13=9 Þ for the size of an almost-equidistant set in R d and Kupavskii, Mustafa, and Swanepoel [15] improved this to Oðd 4=3 Þ. Both papers use ideas from our proof of Theorem 6.
In this paper, we use v k k to denote the Euclidean norm of a vector v from R d . For a subset S of R d , we use span ðSÞ and aff ðSÞ to denote the linear hull and the affine hull of S, respectively.
The proofs of Theorems 5 and 6 are in Sect. 2. Theorems 1, 2, 3 and 4 are proved in Sect. 3. In Sect. 4, we discuss a possible generalization of the problem of determining the function f.

High Dimensions
In this section, we first prove Theorem 5 by constructing, for every integer d ! 3, an almost-equidistant set in R d with 2d þ 4 points. In the rest of the section, we prove Theorem 6 by showing the upper bound f ðdÞ Oðd 3=2 Þ.

Proof of Theorem 5
Consider an equilateral d-simplex M with vertex set S ¼ fx 0 ; . . .; x d g. Let x 0 i be the reflection of x i in the hyperplane through the facet of M not containing x i . We will show that there exists an isometry q of R d that fixes the line determined by x 0 0 and x 0 1 such that the distances x 0 À qðx 0 Þ k kand x 1 À qðx 1 Þ k kare both 1, and such that fx 0 ; . . .; x d g is disjoint from fqðx 0 Þ; . . .; qðx d Þg.
With such an isometry q, the set R :¼ S [ qðSÞ [ fx 0 0 ; x 0 1 g clearly contains 2d þ 4 distinct points. We next show that R is almost equidistant. Suppose for contradiction there is a subset of R with three points and with no pair of points at distance 1. Since S and qðSÞ form cliques in the unit-distance graph of R and every point from S [ qðSÞ is at unit distance from x 0 0 or x 0 1 , this subset is necessarily fx i ; qðx j Þ; x 0 k g for some i; j 2 f0; . . .; dg and k 2 f0; 1g. Since x 0 k is at distance 1 from all other points in S [ qðSÞ except x k and qðx k Þ, we obtain i ¼ k and j ¼ k. However, then the points x k and qðx k Þ are at distance 1, as the isometry q is chosen so that x k À qðx k Þ k k¼ 1, contradicting the choice of the 3-point subset.
It remains to show that there exists an isometry q as described above. Let c :¼ 1 2 ðx 0 þ x 1 Þ, and assume without loss of generality that 1 2 ðx 0 0 þ x 0 1 Þ is the origin o. Let H be the ðd À 1Þ-dimensional subspace through o with normal x 1 À x 0 . Note that c; x 2 ; . . .; x d 2 H. Let V be any 2-dimensional subspace containing o and c. (For instance, we can let V be the linear span of c and x 2 .) Let p be the orthogonal projection of R d onto V. Then pðx 0 Þ ¼ pðx 1 Þ ¼ c and pðx 0 0 Þ ¼ pðx 0 1 Þ ¼ o. Let q V be a rotation of V around o such that c À q V ðcÞ k k¼ 1. Define q : R d ! R d by qðxÞ :¼ q V ðpðxÞÞ þ ðx À pðxÞÞ. Then q is an isometry that fixes the orthogonal complement of V (including x 0 0 and x 0 1 ) and moves x 0 and x 1 by a distance of 1. Since x 0 ; x 1 6 2 H, it follows that qðx 0 Þ; qðx 1 Þ 6 2 H, hence qðx 0 Þ; qðx 1 Þ do not coincide with any of x 2 ; . . .; x d . Similarly, x 0 ; x 1 do not coincide with any of qðx 2 Þ; . . .; qðx d Þ. It remains to show that fx 2 ; . . .; x d g is disjoint from fqðx 2 Þ; . . .; qðx d Þg. It is sufficient to prove that i and j, and q does not fix any of x 2 ; . . .; x d . We first calculate that Note that and similarly, It follows that We can embed R d isometrically into the hyperplane which is the first half of (1). Similarly, it follows that which establishes the second half of (1). Since the isometry q is a rotation in V, from o by a distance of 1, it will move each point in R d at distance less than ffiffiffiffiffiffiffiffiffiffiffi ffi 1 À 1 from o by a distance less than 1.
Therefore, x 2 ; . . .; x d are all moved by a distance less than 1, and the proof is finished.

Proof of Theorem 6
As a first step towards this proof, we show the following lemma, whose statement is illustrated in Fig. 3. This lemma is also used later in Sect. 3.

Lemma 7
For d; k 2 N, let C be a set of k points in R d such that the distance between any two of them is 1. Let c:¼ 1 k P p2C p be the centroid of C and let A:¼ span ðC À cÞ. Then the set of points equidistant from all points of C is the affine space c þ A ? orthogonal to A and passing through c. Furthermore, the intersection of all unit spheres centred at the points in C is the ðd À kÞ-dimensional sphere of radius ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ðk þ 1Þ=ð2kÞ p centred at c and contained in c þ A ? .
which gives the first part of the lemma. For every x 2 R d and each i 2 f1; . . .; kg, we have Let M be the standard ðk À 1Þ-simplex with vertices ð1; 0; . . .; 0Þ; . . .; ð0; . . .; 0; 1Þ embedded in R k . Note that ffiffi ffi 2 p p i À c k kis the distance between a vertex of M and its centroid ð1=k; . . .; 1=kÞ, which is ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ðk À 1Þ=k p . Therefore p i À c k k¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ðk À 1Þ=ð2kÞ p and, in particular, for every i 2 f1; . . .; kg. Now, assume that x 2 c þ A ? . Then, since p i À c 2 A for every i 2 f1; . . .; kg, we have x À c; p i À c h i¼ 0. By (2), we obtain for every i 2 f1; . . .; kg and thus . . .; kg, then the equality (2) gives Using this fact and the expression of c, we obtain An illustration of the statement of Lemma 7 for d ¼ k ¼ 2. The points p 1 and p 2 are at distance 1. The intersection of the unit spheres centred at p 1 and p 2 is the 0-dimensional sphere of radius ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ðk þ 1Þ=ð2kÞ where o denotes the origin in R d . Thus x À c; p i À c h i¼ g ¼ 0 for every i 2 f1; . . .; kg and, since every element of A is a linear combination of elements from For the second part of the lemma, let S be the intersection of all unit spheres centred at the points in C. By the first part of the lemma, we know that Proof Lemma 7 applied to a set C of d points in R d with all pairs of points at unit distance implies that the set of points that are at unit distance from all points in C lies on a 0-dimensional sphere of diameter 2 ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ðd þ 1Þ=ð2dÞ The following is a well-known result that bounds the rank of a square matrix from below in terms of the entries of the matrix [2, 10, 21]. Lemma 9 Let A ¼ ½a i;j be a non-zero symmetric m Â m matrix with real entries. Then The last lemma before the proof of Theorem 6 can be proved by a calculation, using its assumption that the vectors v i have pairwise inner products e, so they differ from an orthogonal set by some skewing. Lemma 10 For n; t 2 N with t n, let w 1 ; . . .; w t be unit vectors in R n such that w i ; w j ¼ e for all i, j with 1 i\j t, where e 2 ½0; 1Þ. Then the set fw 1 ; . . .; w t g can be extended to fw 1 ; . . .; w n g such that w i ; w j ¼ e for all i, j with 1 i\j n, and such that for some orthonormal basis e 1 ; . . .; e n we have Moreover, e i þ ke k k 2 ¼ ð1 À eÞ À1 for each i 2 f1; . . .; ng and for every x 2 R n we have Proof Let e 2 ½0; 1Þ and w 1 ; . . .; w t be from the statement of the lemma. We first extend the set fw 1 ; . . .; w t g to a set fw 1 ; . . .; w n g of unit vectors in R n so that w i ; w j ¼ e for all i, j with 1 i\j n. We proceed iteratively, choosing w iþ1 after the vectors w 1 ; . . .; w i have been obtained for some i with t i\n. The condition w i ; w j ¼ e for each j with 1 j\i says that the desired point w iþ1 lies in the Since e ! 0, the intersection of these hyperplanes taken over j 2 f1; . . .; ig is an affine subspace A of dimension at least n À i ! 1. The subspace A contains the point which is in the convex hull of fw 1 ; . . .; w jÀ1 ; ew j ; w jþ1 ; . . .; w i g for every j 2 f1; . . .; ig. Since e\1, each point ew j is inside the unit ball centred in the origin and so is a. Additionally, A does not contain any of the points w 1 ; . . .; w i . Altogether, A intersects the unit sphere centred in the origin at a point that is not in fw 1 ; . . .; w i g. We let w iþ1 be an arbitrary point from this intersection. For i ¼ n À 1, we obtain the set fw 1 ; . . .; w n g. We now let e i :¼w i = ffiffiffiffiffiffiffiffiffiffi ffi 1 À e p À ke for every i 2 f1; . . .; ng, where e ¼ Þ=n. That is, we skew the vectors w 1 ; . . .; w n so that they are pairwise orthogonal and we scale the resulting vectors so that they will form an orthonormal basis. Note that kn q . Using this fact and the choice of e 1 ; . . .; e n , we obtain We now verify that e 1 ; . . .; e n form an orthonormal basis of R n . Let i 2 f1; . . .; ng be fixed. Note that w i ; e h i ¼ 1þðnÀ1Þe ffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi , as every w j is a unit vector and pairwise inner products of vectors w 1 ; . . .; w n equal e. Summing over i, we obtain e; e h i ¼ Using these facts and the choice of k, we derive Therefore each e i is a unit vector. Similarly, for all distinct i and j from f1; . . .; ng, we have We thus see that e 1 ; . . .; e n is indeed an orthonormal basis in R n .
To show e i þ ke k k 2 ¼ ð1 À eÞ À1 for each i 2 f1; . . .; ng, we simply use the fact that w i is a unit vector and derive It remains to prove the last expression in the statement of the lemma. Let x be an arbitrary point from R n . Since e 1 ; . . .; e n is a basis of R n , we have x ¼ P n i¼1 a i e i for some ða 1 ; . . .; a n Þ 2 R n . For each j 2 f1; . . .; ng, we express the term x; w j as using the facts that the basis e 1 ; . . .; e n is orthonormal and that w j ¼ ffiffiffiffiffiffiffiffiffiffi ffi 1 À e p ðe j þ keÞ. Now, we have Since the basis e 1 ; . . .; e n is orthonormal, we have x k k 2 ¼ P n i¼1 P n j¼1 a i a j e i ; e j ¼ P n i¼1 a 2 i and, since e ¼ P n j¼1 e j , we also have x; e h i ¼ P n i¼1 P n j¼1 a i e i ; e j ¼ P n i¼1 a i . The above expression thus equals ð1 À eÞ À x k k 2 þð2k þ k 2 nÞ x; e h i 2 Á À 2e ffiffiffiffiffiffiffiffiffiffi ffi 1 À e p ð1 þ knÞ x; e h iþ ne 2 : Using the facts that 2k þ k 2 n ¼ e=ð1 À eÞ and 1 þ kn ¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi 1þðnÀ1Þe 1Àe q , this expression can be further simplified as x; e h iþ ne and then rewritten to the final form ð1 À eÞð x k k 2 ÀeÞ þ e x; e h iÀ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi 1 þ ðn À 1Þe We are now ready to prove Theorem 6. For d ! 2, let V & R d be an almostequidistant set. We let G ¼ ðV; EÞ be the unit-distance graph of V and let k:¼b2 ffiffiffi d p c. Note that 1 k d. Let S V be a set of k points such that the distance between any two of them is 1. If such a set does not exist, then, since the complement of G does not contain a triangle, we have jVj\Rðk; 3Þ, where R(k, 3) is the Ramsey number of K k and K 3 .
Using the bound Rðk; 3Þ k þ 3 À 2 3 À 1 obtained by Erd} os and Szekeres [11], we . Thus we assume in the rest of the proof that S exists. Let B be the set of common neighbours of S, that is, Since V is equidistant, the set of non-neighbours of any vertex of G is a clique and so it has size at most d þ 1 by Corollary 8. Every vertex from VnB is a nonneighbour of some vertex from S and thus it follows that VnB j j kðd þ 2Þ. We now estimate the size of B. By Lemma 7 applied to S, the set B lies on a sphere of radius ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi ðk þ 1Þ=2k p in an affine subspace of dimension d À k þ 1. We may take the centre of this sphere as the origin, and rescale by ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi 2k=ðk þ 1Þ p to obtain a set B 0 of m unit vectors v 1 ; . . .; v m 2 R dÀkþ1 where m:¼ B j j. For any three of the vectors from B 0 , the distance between some two of them is ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi 2k=ðk þ 1Þ p . For where e:¼1=ðk þ 1Þ. Note that the opposite implication also holds. That is, if v i ; v j ¼ e, then v i and v j are at distance ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi 2k=ðk þ 1Þ p . Let A ¼ ½a i;j be the m Â m matrix defined by a i;j :¼ v i ; v j À e. Clearly, A is a symmetric matrix with real entries. If m ! d À k þ 2, then A is also non-zero, as G contains no K dþ2 and every vertex from B is adjacent to every vertex from S in G. We recall that rankXY minfrankX; rankYg and rankðX þ YÞ rankX þ rankY for two matrices X and Y.
where J is the m Â m matrix with each entry equal to 1, we have By Lemma 9, rankA ! P m i¼1 a i;i For i 2 f1; . . .; mg, let N i be the set of vectors from B 0 that are at distance ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi 2k=ðk þ 1Þ p from v i . That is, Then for each fixed v i we have Note that the vectors from B 0 nðN i [ fv i gÞ have pairwise inner products e, as neither of them is at distance ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi 2k=ðk þ 1Þ p from v i , and thus jB 0 nðN i [ fv i gÞj d À k þ 2. In fact, we even have jB 0 nðN i [ fv i gÞj d À k þ 1, since B 0 contains only unit vectors and any subset of d À k þ 2 points from B 0 with pairwise distances ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi 2k=ðk þ 1Þ p would form the vertex set of a regular ðd À k þ 1Þ-simplex with edge lengths ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi 2k=ðk þ 1Þ p centred at the origin. However, then the distance from the centroid of such a simplex to its vertices would be equal to ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi kðd À k þ 1Þ=ððk þ 1Þðd À k þ 2ÞÞ p 6 ¼ 1, which is impossible. Thus setting n:¼d À k þ 1 and t:¼jB 0 nðN i [ fv i gÞj, we have t n. Applying Lemma 10 to the t vectors from B 0 nðN i [ fv i gÞ R n with e ¼ ðk þ 1Þ À1 and x ¼ v i , we see that the last sum in (5) is at most where e ¼ P dÀkþ1 j¼1 e j for some orthonormal basis e 1 ; . . .; e dÀkþ1 of R dÀkþ1 . By the Cauchy-Schwarz inequality, If we substitute this upper bound back into (4), then with (3) we obtain that d À k þ 2 [ m 2 ð1 À eÞ 2 =ð4medÞ and thus m\ð4edÞðd À k þ 2Þ=ð1 À eÞ 2 . Using the choice k ¼ b2 ffiffiffi d p c and the expression e ¼ ðk þ 1Þ À1 , we obtain ðd À k þ 2Þ=ð1 À eÞ 2 \d, if d ! 8, and thus m\4d 2 =ðk þ 1Þ.
Again, using the choice This finishes the proof of Theorem 6.

Low Dimensions
In this section, we give proofs of Theorems 1, 2, 3, and 4. Before doing so, we introduce the notion of abstract almost-equidistant graphs. Denote the complete tpartite graph with classes of sizes m 1 ; . . .; m t by K m 1 ;...;m t or K t ðm 1 ; . . .; m t Þ. A graph G is said to be an abstract almost-equidistant graph in R d if the complement of G does not contain K 3 and either • d ¼ 2 and G does not contain K 4 nor K 2;3 ; • or d ! 3, d odd and G does not contain K dþ2 nor K ðdþ1Þ=2 ð3; . . .; 3Þ; • or d ! 4, d even and G does not contain K dþ2 nor K ðdþ2Þ=2 ð1; 3; . . .; 3Þ.
The following lemma justifies the notion of abstract almost-equidistant graphs. We will see later that its converse is not true, as there are abstract almost-equidistant graphs in R d that are not unit-distance graphs of any point set from R d .

Lemma 11
For every d ! 2 and every almost-equidistant set P from R d , the unitdistance graph of P is an abstract almost-equidistant graph in R d .
Proof Let G be the unit-distance graph of an almost-equidistant set P & R d . Clearly, the complement of G does not contain a triangle, as P is almost equidistant. The graph G also does not contain a copy of K dþ2 by Corollary 8. Thus it remains to show that K 2;3 does not occur as a unit-distance graph in R 2 , K ðdþ1Þ=2 ð3; . . .; 3Þ does not occur as a unit-distance graph for odd d ! 3, and K ðdþ2Þ=2 ð1; 3; . . .; 3Þ does not occur as a unit-distance graph for even d ! 4. For d ¼ 2, suppose that K 2;3 occurs as a unit-distance graph in R 2 . Let the class with two points be fp; qg. The set of points that are at the same distance from both p and q is the intersection of two unit circles centred at p and q, respectively, and thus contains at most two points. Therefore, the other class cannot contain three points.
For odd d ! 3, suppose for contradiction that there exist sets V 1 ; . . .; V k , where k ¼ ðd þ 1Þ=2, such that each V i contains three points, and such that the distance between any two points from different V i equals 1. As in the proof of Lemma 7, it is easy to show that each V i lies on a circle. Furthermore, for any distinct i, j, a 1 À a 2 ? b 1 À b 2 for all a 1 ; a 2 2 V i and b 1 ; b 2 2 V j . Thus the affine hulls of the V i s are pairwise orthogonal to each other, hence V 1 [ . . . [ V k together span a space of dimension at least 2k [ d, a contradiction.
For even d ! 4, suppose that there exist sets V 1 ; . . .; V k in R d , where k ¼ d=2, such that V 1 contains four points a, b, c, d with a À b k k¼ a À c k k¼ a À d k k¼ 1, the sets V 2 ; . . .; V k each contains three points, and such that the distance between any two points from different V i equals 1. As in the case of odd d, the V i lie on circles (or a sphere in the case of V 1 ), the affine hulls of the V i s have dimension at least 2 and are pairwise orthogonal to each other, hence V 1 [ . . . [ V k together span a space of dimension at least 2k ¼ d. It follows that the affine hull of V 1 [ . . . [ V k has dimension exactly 2k, and that the affine hulls of all the the V i s are 2-dimensional. In particular, we have that a, b, c, d lie on a circle C. However, then C and the unit circle with centre a intersect in 3 points, a contradiction. h there is a point set P in R d , called a realisation of G, and a one-to-one correspondence f : P ! V such that, for all points p and q from P, if ff ðpÞ; f ðqÞg 2 E, then p and q are at unit distance. If G is not realisable in R d , then we say that it is non-realisable. For a realisable graph G and its realisation P, we sometimes do not distinguish between the vertices of G and the points from P.
By Lemma 11, if there is no realisable abstract almost-equidistant graphs in R d on n vertices, then there is no almost-equidistant set in R d of size n. Using a simple exhaustive computer search, we enumerated all non-isomorphic graphs that are abstract almost-equidistant in R d for d 2 f2; 3; 4; 5; 6g. We filtered out graphs that are minimal, meaning that any graph obtained by removing any edge from such a graph is no longer abstract almost-equidistant. We summarise our results obtained by the computer search in Tables 2 and 3. More detailed description of our computations can be found in Sect. 3.5.
The core of the proofs of Theorems 1, 2, and 3 is to show that none of the minimal abstract almost-equidistant graphs in R d is realisable in R d for d ¼ 2; 3; 4, respectively.

Proof of Theorem 1
We show that f ð2Þ ¼ 7 and that, up to congruence, there is only one planar almostequidistant set with 7 points, namely the Moser spindle.
A computer search shows that, up to isomorphism, there are exactly two abstract almost-equidistant graphs on 7 vertices. One of them is the Moser spindle (Fig. 1), which is clearly uniquely realisable in the plane up to congruence. The other graph (part (a) of Fig. 4) is the graph of the square antiprism with one point removed, which is easily seen to be non-realisable in the plane. Lemma 11 thus implies that the Moser spindle is the unique (up to congruence) almost-equidistant set in the plane on 7 points.
There is a unique abstract almost-equidistant graph on 8 vertices, namely the graph of the square antiprism (part (b) of Fig. 4), which is not realisable in the plane because it contains a non-realisable subgraph, namely the non-realisable abstract almost-equidistant graph on 7 vertices drawn in part (a) of Fig. 4. Thus, by Lemma 11, there is no almost-equidistant set in the plane on 8 points.

Proof of Theorem 2
We prove f ð3Þ ¼ 10 and that, up to congruence, there is only one almost-equidistant set in R 3 with 10 points.
A computer search shows that there is exactly one abstract almost-equidistant graph G 11 in R 3 on 11 vertices (Fig. 5), and exactly 7 abstract almost-equidistant graphs in R 3 on 10 vertices, four of which are minimal (Figs. 2 and 6).
Although G 11 contains the first graph in Fig. 6, and we will show that none of the graphs in Fig. 6 are realisable in R 3 , it is worth observing the following direct argument for the non-realisability of G 11 . Suppose for contradiction that it is realisable in R 3 . We label the vertices p 0 to p 10 , with subscripts modulo 11, such that fp i ; p j g is an edge of G 11 if and only if i À j AE1; AE2ðmod 11Þ. There are 11 equilateral tetrahedra p i p iþ1 p iþ2 p iþ3 in a realisation of G 11 . Let T : R 3 ! R 3 be the unique isometry that maps the tetrahedron p 0 p 1 p 2 p 3 to p 1 p 2 p 3 p 4 , that is, Tðp i Þ ¼ p iþ1 for i ¼ 0; 1; 2; 3. Note that the vertex p iþ4 is uniquely determined by p i p iþ1 p iþ2 p iþ3 . In fact p iþ4 is the reflection of p i through the centroid of the triangle p iþ1 p iþ2 p iþ3 . It follows that Tðp i Þ ¼ p iþ1 for every i. Therefore the centroid c:¼ 1 11 P 10 i¼0 p i is a fixed point of T and all points p i are on a sphere with centre c. However, the points p 0 ; p 1 ; p 2 ; p 3 ; p 4 are easily seen not to lie on a sphere (for example, by using Lemma 7) and we have a contradiction. Thus, by Lemma 11, there is no almost-equidistant set in R 3 on 11 points.
We have already described a realisation in R 3 of the graph from Fig. 2 in the proof of Theorem 5. It is unique up to congruence, and it is easy to check that there are no further unit distances between vertices. We next show that the other three graphs are not realisable in R 3 .
The graph in part (a) of Fig. 6 consists of six copies of K 4 , namely p 0 p 1 p 2 p 3 , p 1 p 2 p 3 p 4 , p 2 p 3 p 4 p 5 , p 4 p 5 p 6 p 7 , p 5 p 6 p 7 p 8 , p 6 p 7 p 8 p 9 , together with the edges p 0 p 9 , Table 2 Numbers of minimal abstract almost-equidistant graphs in R d on n vertices for d 2 f2; 3; 4; 5; 6g and some values of n from f4; . . .; 27g For comparison, the last column contains numbers of minimal n-vertex graphs with triangle-free complements [7,9,25]. The entries denoted by ''?'' are not known c 2 m 0 m 4 , that is, m 0 À m 4 k k¼ r is a diameter of R. However, R contains two circles on its boundary of radius r, a contradiction.
Thus there is only one realisable abstract almost-equidistant graph in R 3 on 10 vertices and, by Lemma 11, there is also a unique (up to congruence) almostequidistant set in R 3 on 10 points.

Proof of Theorem 3
We want to show that 12 f ð4Þ 13. To do so, we use the following result, which says that the graph in Fig. 7 is not realisable in R 4 . Now, we can proceed with the proof of Theorem 3. The lower bound of f ð4Þ ! 12 follows from Theorem 5. A computer search shows that there are no abstract almost-equidistant graphs in R 4 on 17 or more vertices, a unique one on 16 vertices, a unique one on 15 vertices, and four on 14 vertices, three of which are minimal; see Figs. 8 and 9.
The first of these three consists of the graphs of a 3-dimensional octahedron q 0 Á Á Á q 5 and a 4-dimensional cross-polytope p 0 Á Á Á p 7 with a biregular graph between their respective vertex sets, as in part (a) of Fig. 8. It contains the graph G 10 as a subgraph on vertices fp 0 ; . . .; p 7 g [ fq 0 ; q 1 g.
The second of these graphs (part (b) of Fig. 8) contains the graph G 10 as an induced subgraph on vertices fp 0 Á Á Á p 7 g [ fq 1 ; q 5 g. Note that the edge fp 1 ; p 3 g is missing. Thus these two graphs are not realisable in R 4 by Lemma 12.
The last of the three graphs, called G 14 and shown in Fig. 9, is the complement of the graph that is obtained from the cycle C 14 by adding the diagonals and chords of length 4. We show that G 14 is non-realisable in R 4 using an analogous approach as we used to show that the graph G 11 is not realisable in R 3 .
Suppose for contradiction that the graph G 14 is realisable in R 4 . We label the vertices p 0 to p 13 , with subscripts modulo 14, such that fp i ; p j g is an edge of G 14 if and only if i À j AE2; AE3; AE5; AE6ðmod 14Þ. There are 14 equilateral 4-simplices p i p iþ2 p iþ5 p iþ8 p iþ11 in a realisation of G 14 . Let T : R 4 ! R 4 be the unique isometry that maps the simplex p 0 p 2 p 5 p 8 p 11 to p 3 p 5 p 8 p 11 p 0 , that is, Tðp i Þ ¼ p iþ3 for i ¼ 0; 2; 5; 8; 11. Note that the vertex p iþ3 is the reflection of p iþ2 through the centroid of the tetrahedron p i p iþ5 p iþ8 p iþ11 and thus it is uniquely determined by p i p iþ5 p iþ8 p iþ11 . It follows that Tðp i Þ ¼ p iþ3 for every i. Therefore the centroid c:¼ 1 14 P 13 i¼0 p i is a fixed point of T and all points p i are on a sphere with centre c. However, the points p 0 ; p 2 ; p 3 ; p 5 ; p 8 ; p 11 are easily seen not to lie on a sphere (for example, by using Lemma 7), a contradiction. Fig. 8 Two non-realisable abstract almost-equidistant graphs in R 4 on 14 vertices. We use colours on edges between the two cross-polytopes to emphasise the symmetries of the graphs. The missing edge fp 1 ; p 3 g in b is denoted by a dotted segment from S 0 . Analogously as before, the distance between every point from S 0 and every point of S is 1, as the norm of every vector from S 0 is ffiffiffiffiffiffiffi ffi 3=8 p and E 1 ? E 2 . We can thus assume T S 0 . If two vectors from S 0 differ only in the first coordinate, then their distance is 1. Since every triple of vectors from S 0 contains a pair of vectors that differ only in the first coordinate, we obtain that T contains a pair of points at unit distance and thus f ð7Þ ! 20.
Next consider We place S in E 1 and S 0 :¼ 1 ffiffi 8 p fAE1g 3 in E 2 . Again, it suffices to check triples T of points from S [ S 0 with T \ S 0 6 ¼ ;. The distance between every point in S and every point in S 0 again equals 1 and thus we can assume T S 0 . Every triple of points from S 0 contains a pair of points that differ in exactly two coordinates and so they are at distance 1. Thus S 0 is an almost-equidistant set of 8 points. It follows that S [ S 0 is an almostequidistant set of 24 points in R 8 , which implies that f ð9Þ ! f ð8Þ ! 24.

The Computer Search
In this subsection we describe how we computed the entries as stated in Tables 2  and 3, and also the upper bounds as stated in Table 1.
First, we describe our simple approach to generate all n-vertex abstract almostequidistant graphs in R d for given n and d. We start with a single vertex and repeatedly add a new vertex and go through all possibilities of joining the new vertex to the old vertices. For each possibility of adding edges, we check if the resulting graph contains one of the two forbidden subgraphs and that its complement does not contain a triangle. We use two tricks to speed this up. First, when adding a vertex, we can assume that the newly inserted vertex has minimum degree in the extended graph. Secondly, we only have to go through all possibilities of adding at least n À d À 1 new edges, where n is the number of vertices before extending the graph. This is because the degree of the newly added vertex has to be at least n À d À 1, since the complement of an abstract almost-equidistant graph G is triangle-free, hence the non-neighbours of each vertex induce a clique in G, which has at most d þ 1 vertices. To find all minimal graphs, we repeatedly attempt to remove an edge and check that the complement is still triangle-free. Once this is no longer possible, we know that we have a minimal abstract almost-equidistant graph.
We implemented this approach in Sage and used it to obtain all abstract almostequidistant graphs in R d for d 2 f2; 3; 4g. To find all abstract almost-equidistant graphs in R 5 on at most 15 vertices and in R 6 on at most 13 vertices, we used a C?? implementation of this approach. The obtained numbers of abstract almostequidistant graphs are summarized in Table 3.
Unfortunately, our program was not able to find all minimal abstract almostequidistant graphs in R d on n vertices for d ! 5 and large n in reasonable time. To do this, we used the programs Triangleramsey [8,9] by Brinkmann, Goedgebeur, and Schlage-Puchta and MTF [6,7] by Brandt, Brinkmann, and Harmuth. These programs generate all minimal K dþ2 -free graphs with no K 3 in their complement, the so-called Ramsey ð3; d þ 2Þ-graphs. For each Ramsey ð3; d þ 2Þ-graph on the output we tested whether it is a minimal abstract almost-equidistant graph in R d using a simple C?? program that checks forbidden subgraphs from Lemma 11. This allowed us to find all minimal abstract almost-equidistant graphs in R 5 and all minimal abstract almost-equidistant graphs in R 6 with at most 19 vertices; see Table 2. We were also able to find some minimal abstract almost-equidistant graphs in R 6 on 25 vertices.
To improve the upper bounds on f(d) for d 2 f5; 6; 7g, we checked forbidden subgraphs in all minimal Ramsey (3, 7)-graphs on 21 and 22 vertices, minimal Ramsey (3,8)-graphs on 27 vertices, and minimal Ramsey (3,9)-graphs on 35 vertices, respectively. A complete list of these graphs is available on the website [17] of McKay. Since none of these graphs are abstract almost-equidistant, we obtain f ð5Þ 20, f ð6Þ 26, and f ð7Þ 34; see Table 1.
The source code of our programs and the files are available on a separate website [24].

A More General Setting
We consider the following natural generalization of the problem of determining the maximum sizes of almost-equidistant sets. For positive integers d, k, and l with l k, let f(d, k, l) be the maximum size of a point set P in R d such that among any k þ 1 points from P there are at least l þ 1 points that are pairwise at unit distance. Since every subset of R d with all pairs of points at unit distance has size at most d þ 1, we have f ðd; 1; 1Þ ¼ d þ 1 for every d. In the case k ¼ 2 and l ¼ 1, Theorems 5 and 6 give 2d þ 4 f ðd; 2; 1Þ Oðd 3=2 Þ for every d ! 3. In this section, we discuss the problem of determining the growth rate of f(d, k, l) for larger values of d, k, and l.
A similar problem, where the notion of unit distance is replaced by orthogonality, has been studied by several authors [3,10,12,23]. More specifically, for positive integers d, k, and l with l k, let aðd; k; lÞ be the maximum size of a set V of nonzero vectors from R d such that among any k þ 1 vectors from V there are at least l þ 1 pairwise orthogonal vectors. Füredi and Stanley [12] showed that aðd; k; lÞ ð1 þ oð1ÞÞ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi pd=ð2lÞ p ððl þ 1Þ=lÞ d=2À1 k. Alon and Szegedy [3] used a probabilistic argument to show the following lower bound on aðd; k; lÞ. where the logarithms are base 2.
Let d, k, and l be positive integers with d ! 2 log k and with k sufficiently large with respect to l. It follows from the proof of Theorem 13 that there is a d ¼ dðlÞ [ 0 and a subset F ¼ Fðd; k; lÞ of fÀ1; 1g d of size at least d d log ðkþ2Þ= log log ðkþ2Þ such that among any k þ 1 vectors from F there are at least l þ 1 pairwise orthogonal vectors. We define the set P F ¼ 1 ffiffiffi ffi . Clearly, jP F j ¼ jFj.
Since F fÀ1; 1g d , it is not difficult to verify that any two points p u and p v from P F are at unit distance if and only if the vectors u and v from F are orthogonal. It follows that for every fixed positive integer l there are some d ¼ dðlÞ [ 0 and k 0 ðlÞ such that for every k ! k 0 ðlÞ and every d ! 2 log k, f ðd; k; lÞ ! d d log ðkþ2Þ= log log ðkþ2Þ : Let d, k, l be positive integers. The following simple argument, which is based on an estimate on the chromatic number of R d , gives an upper bound on f(d, k, l) that is linear in k and exponential in d.
Let P be a set of points in R d such that among any k þ 1 points from P there are l þ 1 points that are pairwise at unit distance. Let G be the unit-distance graph for P. Let c be a colouring of G with m:¼vðGÞ colours and let P ¼ C 1 [ Á Á Á [ C m be the colour classes induced by c. For every unit-distance graph H in R d , Larman and Rogers [16] showed that vðHÞ ð3 þ oð1ÞÞ d . We thus have m ð3 þ oð1ÞÞ d . Since there are at least l þ 1 ! 1 edges among any set of k þ 1 vertices of G, we have jC i j k for every i 2 f1; . . .; mg. In particular, jPj mk ð3 þ oð1ÞÞ d k. We thus obtain the following estimate.