# Help to manipulate and rearrange this inequality

I am working through a proof and I am trying to understand all of the steps. It uses one inequality to show another: Let $a_1, \ldots, a_k$ be given real numbers and $p_1, \ldots, p_k$ where $p_i \geq 0$ and $\underset{i=1}{\overset{k}{\sum}}p_i=1$. Then it can be shown that \begin{equation*} \underset{i=1}{\overset{k}{\sum}} p_i(a_i - \log p_i) \leq \log\left( \underset{i=1}{\overset{k}{\sum}}e^{a_i} \right). \end{equation*} I want to use this inequality to show that \begin{equation*} 0 \geq \underset{i=1}{\overset{k}{\sum}} p_i\left(a_i - \log p_i - \log( \underset{i=1}{\overset{k}{\sum}}e^{a_i}) \right). \end{equation*} However I cant quite see how to do this?

• Are you sure about the second sum? Normally nested sums will change the index, so I'd expect the second sum to be adding over $j$ or something – Dr Xorile Jul 28 '15 at 13:55
• If you change $\sum_{i=1}^ke^{a_i}$ to $\sum_{j=1}^ke^{a_j}$, all should be well. (It's not appropriate to use the same index of summation in a nested expression, which is what you have in the inequality you want to show.) – Barry Cipra Jul 28 '15 at 13:57

The log term is just a constant, equal to $C$ say, so it also equals $C\sum_ip_i$.