TITLE: Number of pairs of points whose distance is one
QUESTION [6 upvotes]: Let $S$ be a set of $n$ points in the plane, the distance between any two of which is at most one. Show that there are at most $n$ pairs of points of $S$ at distance exactly one.

My attempt on proof:
Construct a graph $G$ in which $2$ vertices are adjacent if and only if their distance is exactly one.
Then graph contains $3$ vertices in the form of equilateral triangle (so, $3$ pairs). I don't know how to generalize this.

REPLY [2 votes]: While this seems to be a simple question, I do not know of an easy approach to it. This is the best that I could come up with.
Start off by constructing your graph with an edge between 2 vertices whenever their distance is 1.
Claim 1: If two edges have distinct endpoints, then these two edges must intersect.
Proof: Suppose not. Let the endpoints be $A, B, C, D$, where $AB$ and $CD$ are edges. Consider the convex hull of these points. If one of them is contained within (WLOG $A$), then we can show that $max(AD, AC) > AB $ which is a contradiction. Hence we must have 4 points on the convex hull, and labelled in clockwise order as (WLOG) $A, B, C, D$. Let $AC$ and $BD$ intersect at $X$. Then, by the triangle inequality, $AC + BD = XA + XC + XB + XC = (XA + XB) + (XC + XD) > 2$, which is a contradiction.
Claim 2: There are no even cycles (of length at least 4).
Proof: Suppose not. Let the even cycle be given by $v_1, v_2, \ldots v_{2n} $. Consider the line $v_1 v_2$. Then, by the previous claim, the odd and even vertices must be on different sides of $v_1 v_2$, as every consecutive pair must intersect this line. However, $v_1 v_{2n} $ and $v_2 v_3$ will not intersect, hence contradiction.
Claim 3: If there a cycle, then any edge that is not in this cycle must have an endpoint that is  contained within this cycle.
Proof: Suppose not, let the edge $AB$ have endpoints not contained in the cycle. By the first observation, each edge of the cycle must intersect $AB$, hence this splits the vertices must alternate above and below $AB$. This means that the cycle must have even length, which contradicts claim 2. 
Claim 4: We cannot have 2 different cycles. 
Proof: Suppose we do. Let the first cycle have vertices $v_1, v_2, \ldots v_{2n+1}$, and the second cycle have vertices $s_1, s_2, \ldots s_{2m+1} $. If any edge of the 2nd cycle has both endpoints in the first cycle, this will create an even cycle, which contradicts claim 2. But by claim 3, at least 1 endpoint of each edge must be in the first cycle. Hence, the endpoints of the 2nd cycle alternatively belong and don't belong to the first cycle. Hence, the 2nd cycle is even, which is a contradiction.
Claim 5: Any graph with at most 1 cycle has at most $n$ edges, where $n$ is the number of vertices.
Proof: If it has no cycle, it is a tree with at most $n-1$ edges.
If it has 1 cycle, remove 1 of the edges, and we get a tree with at most $n-1$ edges. Thus the original graph has at most $n$ edges.
Hence we are done.