I've been trying to understand the proof of the second direction of the Kraft inequality: if there exists a list of lengths $l_1, l_2, \ldots, l_m$ satisfying the Kraft inequality, then there exists a codebook $c_1, c_2, \ldots, c_m$ with lengths $l_1, l_2, \ldots, l_m$ that forms a prefix codebook.
I am seeking assistance in writing out the proof for this direction. If you could provide guidance or assistance with the steps involved in proving the second direction of the Kraft inequality, I would greatly appreciate it.
Thanks