For four vertices , write and define
Lemma. In a connected graph with vertices, if one of these three sums is strictly greater than both others, it is at most . The four vertices may repeat.
We prove the lemma by induction on . The one-vertex case is immediate.
First suppose the graph has no cut vertex, where a cut vertex is a vertex whose removal disconnects the graph. Take two vertices at distance , and group the vertices by their distance from the first.
Each layer contains at least two vertices. If a layer contained just one vertex, every path between the chosen endpoints would pass through it, making it a cut vertex. Counting the endpoints and these layers gives
Thus every distance is at most , and every is at most . This proves the lemma in this case.