We show that recognizing the K3-freeness and K4-freeness of graphs is hard, respectively, for
two-player nondeterministic communication protocols using exponentially many partitions
and for nondeterministic syntactic read-r times branching programs.
The key ingredient is a generalization of a colouring lemma, due to Papadimitriou and
Sipser, which says that for every balanced red—blue colouring of the edges of the complete
n-vertex graph there is a set of εn2 triangles, none of which is monochromatic, such that
no triangle can be formed by picking edges from different triangles. We extend this lemma
to exponentially many colourings and to partial colourings.