<s>[INST] How do I prove the arithmetic-geometric mean inequality? I am following along with this bare-bones proof of the arithmetic-geometric mean inequality with two real numbers. I'm having difficulty understanding the logic behind this step:
$$
\frac{a}{2}+\frac{a}{2}< \frac{b}{2}+\frac{a}{2}\Rightarrow a< \frac{b+a}{2}
$$
How is the step of adding $\frac{a}{2}$ to both sides valid? Also, if you have a better/easier way of proving this, please let me know. Thanks!
 [/INST] Assume $0< a < b$.
The first thing we want to show for this proof is that given $$a<b,$$ we want $$a<\frac{a+b}{2} <b.$$ To do this, we show the left and right inequalities separately. Now, it is a rule of elementary algebra that addition preserves ordering, i.e. $$a+k < b+k$$ for all $k\in \mathbb{R}$. If we choose $k=\frac{a}{2}$ and apply this to $$\frac{a}{2} < \frac{b}{2},$$ then we have
$$
\frac{a}{2} + \frac{a}{2} < \frac{b}{2} + \frac{a}{2}
$$
so
$$
a < \frac{a+b}{2}.
$$
This is the left side of the inequality. To get the right side, we add $\frac{b}{2}$ to the same inequality:
$$
\frac{a}{2} + \frac{b}{2} < \frac{b}{2} + \frac{b}{2}
$$
so
$$
\frac{a+b}{2} < b.
$$
Combining these two inequalities we have
$$
a< \frac{a+b}{2} < b
$$
as desired.
For the remainder, we wish to show that
$$
a < \sqrt{ab} < \frac{a+b}{2}.
$$
First, the left side. Using the fact that $0<a<b$, we have $\sqrt{a}<\sqrt{b}$. Multiplying both sides by $\sqrt{a}$, we have
$$
\sqrt{a}\sqrt{a} <\sqrt{ab}
$$
$$
a < \sqrt{ab}
$$
This is the left side. For the right, we use the fact that
$$
0 < (a-b)^2 = a^2 - 2ab + b^2
$$ 
so
$$
ab < \frac{a^2 + b^2}{2}.
$$
But because $a, b > 0$,
$$
\sqrt{ab} < \frac{a + b}{2}.
$$
This is the right side. Combining all of these, we finally have
$$
0<a<\sqrt{ab}<\frac{a+b}{2}<b.
$$
</s>