There is a some question that arise from the proof of Lemma 5.8.1 of Cover's book on information theory that confuse me.
First question is why he assumes that we can "Consider an optimal code $C_m$. Is he assuming that we are encoding a finite number of words so that $\sum p_i l_i$ must have a minimum value? Here I give you the relevant snapshot.
Second, there is an observation made on this notes that was also done in my class before proving the theory of optimality of huffman codes, that is,
observe that earlier results allow us to restrict our attention to instantaneously decodeable codes
I don't really understand why this observation is necessary.