How proof of Hoffman algorithm greedy property starts with optimal tree T?
A code tree is optimal if the average codeword length is minimal. This has nothing to do with Huffman's algorithm. Huffman's algorithm is guaranteed to produce an optimal code tree, but there might be other code trees. In fact, Huffman's algorithm could produce different code trees using different tie-breaking rules. Moreover, not every optimal code tree can be produced using Huffman's algorithm, even with an arbitrary tie-breaking rule.

Here is a formal definition of an optimal code tree. Let $\pi$ be a distribution. The $\pi$-cost of a code tree is the expected length of a codeword, where the expectation is taken with respect to $\pi$. A code tree is optimal for $\pi$ if its $\pi$-cost is equal to the minimum $\pi$-cost of any code tree.