Let be a longest path. All neighbours of lie on , in the colour class opposite to , so . If , the first edges give the required path. Otherwise , and all vertices of the opposite colour on must be neighbours of ; in particular is an edge, giving a cycle of length . The graph has minimum degree but only vertices, so it has no path of length .
For the stronger assertion, assume there is no -cycle. Rotate a longest path about each edge from to obtain possible endpoints in the colour class of . Every neighbour of each rotated endpoint lies on , since otherwise the corresponding path could be extended. In a -cycle-free bipartite graph, two vertices in one colour class have at most one common neighbour. The neighbourhood bound for a square-free bipartite graph therefore shows that the colour class opposite to contains at least vertices of . If the endpoints have opposite colours, repeating the argument from gives the same bound for the other class. If they have the same colour, their class has one more vertex on than the opposite class. In either case has at least vertices and length at least . Consequently contains either such a path or a -cycle.
Solved by gpt-5.6-sol high.
Codex Wiki