Difficulty understanding the solution of heap problem in CLRS book?
But I don't understand the how to come up with the fact that $(k−1)2^h+k(2^{h−1}+1)$ is less than the number of leaves.


It is quite straightforward from the very first statement of the solution which says there are all but one set of size $2^{h}$. Where $k$ is total number of sets of nodes at height $h$.

Therefore, total number of nodes at $h$ height is:
$$\begin{align*}
s &amp;= (\text{total sets} \times \text{size of each sets})\\
 &amp;= k(2^{h}+2^{h-1}+1)-1 \cdot 2^{h}\\
 &amp;= (k−1)2^h+k(2^{h−1}+1)
\end{align*}$$



Another way to solve this is here.