Understanding lemma for proof of convexity The lemma says:

Lemma: Suppose $f$ is differentiable and $f'$ is increasing. If $a < b$ and $f(a) = f(b)$, then $f(x) < f(a) = f(b)$ for $a < x < b$.
Proof: Suppose first that $f(x) > f(a) = f(b)$ for some $x$ in $(a, b)$. Then the maximum of $f$ on $[a, b]$ occurs at some point $x_0$ in $(a, b)$ with $f(x_0) > f(a)$ and of course $f'(x_0) = 0$.

Then the proof continues:

On the other hand, applying the Mean Value Theorem to the interval $[a, x_0]$, we find that there is $x_1$ with $a < x_1 < x_0$ and
$$f'(x_1) = \frac{f(x_0) - f(a)}{x_0 - a} > 0$$
Contradicting the fact that $f'$ is increasing. [...]

I understand the lemma tells us that if $f'$ is increasing, then the graph of $f$ will be below any horizontal secant line through $(a, f(a))$ and $(b, f(b))$.
I can also see the proof is by contradiction here, we will show that if $f(x) > f(a) = f(b)$ then $f'$ can't be increasing. Also clear is that $f'(x_0) = 0$ since we are looking at a local maximum for the first case of the proof.
What I'm having trouble with is what the application of the Mean Value Theorem. For the first case where we work with the local maximum, I understand we find a point $a < x_1 < x_0$ with the same slope as the line connecting the endpoints of the interval $[a, x_0]$ would have, but how does it show $f'$ can't be increasing and how do we know $f'(x_1) > 0$?

First, it shows that $f'$ can't always be increasing because it is positive at $x_1$ but it's $0$ at $x_0 \gt x_1$, so $f'$ must have decreased.  As for knowing $f'\left(x_1\right) \gt 0$, since the maximum of $f$ occurs at $x_0$, then $f\left(x_0\right) \gt f\left(a\right)$. Also, by the condition for $x_0$, you have that $x_0 \gt a$. Thus, both the numerator and denominator of $f'\left(x_1\right)$ are positive, making the result $\gt 0$.
