Simple question about square of a supremum I want to show that the square of the supremum of any set of non-negative numbers is the supremum of the squares. I.e. of $A\subseteq \mathbb{R}^+$ then
\begin{equation*}
\sup_{a\in A} a^2 = \left( \sup_{a\in A}a\right)^2
\end{equation*}
This is obvious if the supremum is actually attained (so it is the maximum). However, I am struggling to prove it rigorously for the case that the maximum is actually not attained. Could show this carefully?
Thanks
 A: In case you want to show this rigorously, you will need to show that $\sup \{a^2\} \leq (\sup \{a\})^2$ and vice-versa.
To show one direction, note that $\sup \{a\} \geq a$ for all $a$, hence $(\sup \{a\})^2 \geq a^2$ for all $a$, so $(\sup \{a\})^2$ is an upper bound for $\{a^2\}$, hence it is greater than the least upper bound, i.e. $(\sup\{a\})^2 \geq \sup\{a^2\}$.
To show the other direction, let $N$ be large enough such that $\sup \{a\} - \frac 1N > 0$ (if $\sup \{a\} = 0$ and all $a$ are non-negative, then it is clear what the set is and the result itself). Now for any $n>N$, the quantity $\sup \{a\} - \frac 1n$ is not an upper bound of $\{a\}$, Hence, there is some $a_n$ such that $a_n > \sup\{a\} - \frac 1n$. Square both sides(note that by non-negativity of both sides, this preserves sign) to see that $a_n^2 > \frac 1{n^2} + (\sup \{a\})^2 - \frac{2\sup \{a\}}{n}$. Now, by definition of supremum, we have $$\sup \{a^2\} \geq a_n^2 > \frac 1{n^2} + (\sup \{a\})^2 - \frac{2\sup \{a\}}{n}$$
This applies for all $n>N$. Since $(\sup \{a\})^2$ is a bounded quantity, letting $n \to \infty$, we see that $\sup \{a^2\} \geq (\sup \{a\})^2$. Hence, equality follows.
Note the trick played in the second half of the proof. You will need to use it repeatedly and become comfortable with it.
A: A swifter approach would be if you use the fact that an upper bound $S$ of $A:=\{a_1,a_2, \cdots\}$ is a supremum iff:
"For all $\epsilon'>0$ there exists an element $a\in A$ such that: $ S-\epsilon' < a$".
We now set $\epsilon':= \frac{\epsilon}{2S}$. Assuming that $S$ is a supremum of $A$ it is clear that $S^2$ is an upper bound of $A^2:=\{a_1^2,a_2^2, \cdots\}$ so it remains to show that:
"For all $\epsilon>0$ there exists an element $a^2\in A^2$ such that: $ S^2-\epsilon < a^2$".
If $\epsilon> S^2$ the statement is obviously true. If $0<\epsilon<S^2$, then there exists an $a\in A$ and an $a^2 \in A^2$ such that:
$$
S-\epsilon' < a\\
\Rightarrow S^2-2S\epsilon'+\epsilon'^2= (S-\epsilon')^2 < a^2 \\ \Rightarrow S^2-\epsilon=S^2-2S\frac{\epsilon}{2S}< a^2
.$$ (Note that: $S^2-\epsilon>0\implies S-\frac{\epsilon}{2S}>0$, so squaring the first inequality doesn't flip the inequality sign.)
