Graph lemma quantifies the defect effect of a system of word equations. That is, it provides an upper bound on the rank of the system.
We formalize the proof based on the decomposition of a solution into its free basis. A direct application is an alternative proof of the fact that two noncommuting words form a code.