# Lemma for Stone-Weierstrass

During the proof of the Stone-Weierstrass Theorem there is a lemma given:

Lemma: Let $g_{1}$ and $g_{2}$ be in $\mathcal{A}$ (an algebra of real-valued continuous functions which strongly separates points in an arbitrary compact metric space $M$). Then for every error $1/m$ there exist functions $g_{3}$ and $g_{4}$ in $\mathcal{A}$ such that $|g_{3}-\max(g_{1},g_{2})| \le 1/m$ and $|g_{4}-\min(g_{1},g_{2})| \le 1/m$ for all points of $M$.

The proof of the lemma starts of by saying that it suffices to prove the following: if $g$ is in $\mathcal{A}$ then there exists $g_{1}$ in $\mathcal{A}$ with $|g_{1}-|g|| \le 1/m$. I'm sure this is quite trivial but I can't justify why it's sufficient to prove this statement. Could someone explain why?

You have $\max(f,g)=\frac12(f+g+|f-g|)$ and $\min(f,g)=\frac12(f+g-|f-g|)$. So if you can approximate $|f-g|$ well, you can approximate $\min$ and $\max$.
• It is necessary. You start with $h_1,h_2\in\cal A$, then you find $H\in \cal A$ such that $|H-|h_1-h_2||<\frac1m$, then you have for $\min(h_1,h_2)$ that $|\frac12(h_1+h_2+H)-\min(h_1,h_2)|=\frac12|H-|h_1-h_2||<\frac{1}{2m}$ and (as $\cal A$ is a vector space) $\frac12(h+1+h_2+H)\in \cal A$. – Kusma Jul 16 '18 at 16:36