Tietze extension theorem

In topology, the Tietze extension theorem (also known as the Tietze–Urysohn–Brouwer extension theorem or Urysohn-Brouwer lemma ) states that any real-valued, continuous function on a closed subset of a normal topological space can be extended to the entire space, preserving boundedness if necessary.

Formal statement
If $$X$$ is a normal space and $$f : A \to \R$$ is a continuous map from a closed subset $$A$$ of $$X$$ into the real numbers $$\R$$ carrying the standard topology, then there exists a of $$f$$ to $$X;$$ that is, there exists a map $$F : X \to \R$$ continuous on all of $$X$$ with $$F(a) = f(a)$$ for all $$a \in A.$$ Moreover, $$F$$ may be chosen such that $$\sup \{|f(a)| : a \in A\} ~=~ \sup \{|F(x)| : x \in X\},$$ that is, if $$f$$ is bounded then $$F$$ may be chosen to be bounded (with the same bound as $$f$$).

Proof
The function $$F$$ is constructed iteratively. Firstly, we define $$ \begin{align} c_0 &= \sup \{|f(a)|:a\in A\}\\ E_0 &= \{a\in A:f(a)\geq c_0/3\}\\ F_0 &=\{a\in A:f(a)\leq -c_0/3\}. \end{align} $$ Observe that $$E_0$$ and $$F_0$$ are closed and  disjoint subsets of $$A$$. By taking a linear combination of the function obtained from the proof of Urysohn's lemma, there exists a continuous function $$g_0:X\to \mathbb{R}$$ such that $$ \begin{align} g_0 &= \frac{c_0}{3}\text{ on }E_0\\ g_0 &= -\frac{c_0}{3}\text{ on }F_0 \end{align} $$ and furthermore $$-\frac{c_0}{3}\leq g_0 \leq \frac{c_0}{3}$$ on $$X$$. In particular, it follows that $$ \begin{align} |g_0| &\leq \frac{c_0}{3}\\ |f-g_0| &\leq \frac{2c_0}{3} \end{align}$$ on $$A$$. We now use induction to construct a sequence of continuous functions $$(g_n)_{n=0}^\infty$$ such that $$ \begin{align} \end{align}$$ We've shown that this holds for $$n=0$$ and assume that $$g_0,...,g_{n-1}$$ have been constructed. Define $$c_{n-1} = \sup\{|f(a)-g_0(a)-...-g_{n-1}(a)|:a\in A\}$$ and repeat the above argument replacing $$c_0$$ with $$c_{n-1}$$ and replacing $$f$$ with $$f-g_0-...-g_{n-1}$$. Then we find that there exists a continuous function $$g_n:X\to \mathbb{R}$$ such that $$ \begin{align} \end{align} $$ By the inductive hypothesis, $$c_{n-1}\leq 2^nc_0/3^n$$ hence we obtain the required identities and the induction is complete. Now, we define a continuous function $$F_n:X\to \mathbb{R}$$ as $$F_n = g_0+...+g_n.$$ Given $$n\geq m$$, $$ \begin{align} &\leq \left(\left(\frac{2}{3}\right)^{m+1}+...+\left(\frac{2}{3}\right)^{n}\right)\frac{c_0}{3}\\ &\leq \left(\frac{2}{3}\right)^{m+1}c_0. \end{align} $$ Therefore, the sequence $$(F_n)_{n=0}^\infty$$ is Cauchy. Since the space of continuous functions on $$X$$ together with the  sup norm is a complete metric space, it follows that there exists a continuous function $$F:X\to \mathbb{R}$$ such that $$F_n$$  converges uniformly to $$F$$. Since $$|f-F_n|\leq \frac{2^{n}c_0}{3^{n+1}}$$ on $$A$$, it follows that $$F=f$$ on $$A$$. Finally, we observe that $$ $$ hence $$F$$ is bounded and has the same bound as $$f$$. $$\square$$
 * g_n|&\leq \frac{2^nc_0}{3^{n+1}}\\
 * f-g_0-...-g_{n}|&\leq \frac{2^{n+1}c_0}{3^{n+1}}.
 * g_n|&\leq \frac{c_{n-1}}{3}\\
 * f-g_0-...-g_n|&\leq \frac{2c_{n-1}}{3}.
 * F_n - F_m| &= |g_{m+1}+...+g_n|\\
 * F_n|\leq \sum_{n=0}^\infty |g_n|\leq c_0

History
L. E. J. Brouwer and Henri Lebesgue proved a special case of the theorem, when $$X$$ is a finite-dimensional real vector space. Heinrich Tietze extended it to all metric spaces, and Pavel Urysohn proved the theorem as stated here, for normal topological spaces.

Equivalent statements
This theorem is equivalent to Urysohn's lemma (which is also equivalent to the normality of the space) and is widely applicable, since all metric spaces and all compact Hausdorff spaces are normal. It can be generalized by replacing $$\R$$ with $$\R^J$$ for some indexing set $$J,$$ any retract of $$\R^J,$$ or any normal absolute retract whatsoever.

Variations
If $$X$$ is a metric space, $$A$$ a non-empty subset of $$X$$ and $$f : A \to \R$$ is a Lipschitz continuous function with Lipschitz constant $$K,$$ then $$f$$ can be extended to a Lipschitz continuous function $$F : X \to \R$$ with same constant $$K.$$ This theorem is also valid for Hölder continuous functions, that is, if $$f : A \to \R$$ is Hölder continuous function with constant less than or equal to $$1,$$ then $$f$$ can be extended to a Hölder continuous function $$F : X \to \R$$ with the same constant.

Another variant (in fact, generalization) of Tietze's theorem is due to H.Tong and Z. Ercan: Let $$A$$ be a closed subset of a normal topological space $$X.$$ If $$f : X \to \R$$ is an upper semicontinuous function, $$g : X \to \R$$ a lower semicontinuous function, and $$h : A \to \R$$ a continuous function such that $$f(x) \leq g(x)$$ for each $$x \in X$$ and $$f(a) \leq h(a) \leq g(a)$$ for each $$a \in A$$, then there is a continuous extension $$H : X \to \R$$ of $$h$$ such that $$f(x) \leq H(x) \leq g(x)$$ for each $$x \in X.$$ This theorem is also valid with some additional hypothesis if $$\R$$ is replaced by a general locally solid Riesz space.

Dugundji (1951) extends the theorem as follows: If $$X$$ is a metric space, $$Y$$ is a locally convex topological vector space, $$A$$ is a closed subset of $$X$$ and $$f:A\to Y$$ is continuous, then it could be extended to a continuous function $$\tilde f$$ defined on all of $$X$$. Moreover, the extension could be chosen such that $$\tilde f(X)\subseteq \text{conv} f(A)$$