Let and suppose
If some coefficient is nonzero, let be the largest index with . Choose a path
whose endpoints realize the graph diameter. Every initial segment is a shortest path, since a shorter route from to could be followed by the remaining segment to shorten the path from to . Thus
By the walk count from powers of an adjacency matrix,
Taking the entry of the assumed relation and using maximality of gives
a contradiction. Every coefficient is therefore zero, proving the linear independence of adjacency powers up to the diameter:
Take the infinite family
Each complete graph is connected and has graph diameter one. If is its adjacency matrix, then
and direct multiplication gives the adjacency-matrix quadratic relation for a complete graph
Consequently
so , which are precisely the powers through , are linearly dependent for every .