# Continuous function in compact sets - Real analysis

I have the following proposition.

$\textbf{Proposition:}$ If $f:X\times K\longrightarrow\mathbb{R}^n$ is a continuous function, $K$ is a compact set in $\mathbb{R}^n$ and $X\subseteq\mathbb{R}^n$. Fixed $x_0\in X$, prove that for every $\varepsilon>0$ exist $\delta>0$ such that if $\|x-x_0\|<\delta$ then $\|f(x,\alpha)-f(x_0,\alpha)\|<\varepsilon$ for every $\alpha\in K$.

$\textbf{Proof Sketch:}$ Fix $x_0\in X\subseteq\mathbb{R}^n$. Consider the set $A=\{x_0\}\times K\subseteq\mathbb{R}^{2n}$; then $A$ is compact in $X\times K\subseteq\mathbb{R}^{2n}$ with the usual metric since $\{x_0\}$ is a finite set and therefore compact and $K$ is also compact in $\mathbb{R}^n$ by hypothesis and Cartesian product of compact sets is compact.

Consider the open balls in $\mathbb{R}^{2n}$ centred in $(x_0,\alpha)\in A$ and radius 1, lets say for simplicity $$A(\alpha)=B_{\mathbb{R}^{2n}}((x_0,\alpha),1)=\{y\in\mathbb{R}^{2n}\ :\ \|y-(x_0,\alpha)\|<1\}.$$

Then, we have an open cover for $A:$ $$A\subseteq\bigcup_{\alpha\in K}A(\alpha).$$

Since $A$ is compact there exist $\alpha_1,\alpha_2,\cdots,\alpha_m\in K$ such that $$A\subseteq\bigcup_{i=1}^{m}A(\alpha_i).$$

Applying $f$ to both sides, by property of the direct image then $$f(A)\subseteq f\left(\bigcup_{i=1}^{m}A(\alpha_i)\right)=\bigcup_{i=1}^{m}f(A(\alpha_i)).$$

Since $f$ is continuous then $f(A)$ is compact in $\mathbb{R}^n$, and by definition $$f(A)=\{f(x_0,\alpha)\in\mathbb{R}^n\ :\ \alpha\in K\}$$ $$f(A(\alpha_i))=\{f(x,\alpha)\in\mathbb{R}^n\ :\ \|(x,\alpha)-(x_0,\alpha_i)\|<1\}$$ for each $i=1,2,\cdots,m$.

Let $\varepsilon>0$ be arbitrary, consider the open balls in $\mathbb{R}^{n}$ centred in $f(x_0,k)$ and radius $\varepsilon$ for every $k\in K$ and define for simplicity $$B(k,\varepsilon)=B_{\mathbb{R}^n}(f(x_0,k),\varepsilon)=\{z\in\mathbb{R}^n\ :\ \|z-f(x_0,k)\|<\varepsilon\}.$$

Then, for every $\varepsilon>0$ we have an open cover for $f(A)$ $$f(A)\subseteq\bigcup_{k\in K}B(k,\varepsilon).$$

Since $f(A)$ is compact there exist $k_1,k_2,\cdots,k_{m'}\in K$ such that $$f(A)\subseteq\bigcup_{j=1}^{m'}B(k_j,\varepsilon).$$

Recall that $f$ is continuous and so there is $\delta_j>0$ such that $f(B'_j)\subseteq B(k_j,\varepsilon)$ where $B'_j$ is the open ball in $\mathbb{R}^{2n}$ centred in $(x_0,k_j)$ with radius $\delta_j$ for each $j=1,2,\cdots,m'$. That is to say, $$B'_j=B_{\mathbb{R}^{2n}}((x_0,k_j),\delta_j)=\{y\in\mathbb{R}^{2n}\ :\ \|y-(x_0,k_j)\|<\delta_j\}$$ $$f(B'_j)=\{f(x,\alpha)\in\mathbb{R}^{n}\ :\ \|(x,\alpha)-(x_0,k_j)\|<\delta_j\}$$

Then, doing the joint of sets $$\bigcup_{j=1}^{m'}f(B'_j)\subseteq\bigcup_{j=1}^{m'}B(k_j,\varepsilon)$$

$\textbf{¡Stack!:}$ This where I get stuck; I've been thinking for a long time without resolution how to relate each $\alpha_i$ with each $k_j$ so that considering something like $\delta=\min\{1,\delta_1,\delta_2,\cdots,\delta_{m'}\}$ and assuming $\|x-x_0\|<\delta$ then I can get the desired result.

I also think that this "proof" can be simpler without having to consider so many sets, however it's the path that comes to my mind. I have an introductory knowledge in real analysis so I look for any help you can give me.

## Edit

Inspired by the contribution made by Mikhail Katz:

$\textbf{Proof Sketch 2:}$ Fix $x_0\in X\subseteq\mathbb{R}^n$. Consider the closed ball in $\mathbb{R}^n$ centred in $x_0$ with radius 1: $$B=B[x_0,1]=\{x\in\mathbb{R}^n:\|x-x_0\|\leq1\}$$ Every closed ball in $\mathbb{R}^n$ is compact so $B$ is compact and so closed and bounded in $\mathbb{R}^n$. Consider the adherence (closure) of $X$, this is $\overline{X}$.

Define $L=\overline{X}\cap B=\{x\in \overline{X}:\|x-x_0\|\leq1\}$.

Since $L\subseteq B$ then $L$ is bounded. Since $\overline{X}$ and $B$ are closed and intersection of closed sets is always closed then $L$ is closed. So, by Heine-Borel's Theorem $L$ is compact in $\mathbb{R}^n$.

Define $S=X\cap B=\{x\in X:\|x-x_0\|\leq1\}\subseteq X$.

Therefore $S\subseteq L$ and $\overline{S}=L$; so $S$ is dense in $L$.

By hypothesis $f$ is continuous in $X\times K$; particularly $f$ is continuous in $S\times K$. Since $S$ is dense in $L$ then $S\times K$ is dense in $L\times K$. Therefore exist a continuous extension of $f$ from $S\times K$ to $L\times K$, say $g$.

The set $L\times K$ is a Cartesian product of compact sets in $\mathbb{R}^n$ so it's compact in $\mathbb{R}^{2n}$. Since $g$ is continuous in $L\times K$ then $g$ is uniformly continuous.

For every $\varepsilon>0$ there is $\delta>0$ such that if $\|(x_1,\alpha_1)-(x_2,\alpha_2)\|<\delta$ then $\|g(x_1,\alpha_1)-g(x_2,\alpha_2)\|<\varepsilon$ for all $(x_1,\alpha_1),(x_2,\alpha_2)\in L\times K$.

In particular, for $x_1=x\in S$, $x_2=x_0\in S$ and $\alpha_1=\alpha_2=\alpha\in K$. Suppose: $$\|(x,\alpha)-(x_0,\alpha)\|=\|(x-x_0,\bar{0})\|=\|x-x_0\|<\delta$$

Since $g$ is an extension of $f$ and $x,x_0\in S$ then: $$\|g(x,\alpha)-g(x_0,\alpha)\|=\|f(x,\alpha)-f(x_0,\alpha)\|<\varepsilon$$ for all $\alpha\in K$.

$\textbf{Observation:}$ To guarantee the existence of $g$ it's sufficient that the set $S\times X$ be closed. If not, the statement may not be true. I don't know if this condition is satisfied or not in this context because $X$ is given as a nonempty set of $\mathbb{R}^n$ and nothing more about itself.

For example, if we had in the hypotheses that $X\subseteq\mathbb{R}^n$ is closed then $X=\overline{X}$ and so $L=S$; the proof is complete and would be even simpler.

## Edit 2

I made the following proof, let me know if it's correct.

$\textbf{Proposition:}$ If $f:X\times K\longrightarrow\mathbb{R}^n$ is a continuous function, $K$ is a compact set in $\mathbb{R}^n$ and $X\subseteq\mathbb{R}^n$. Fixed $x_0\in X$, prove that for every $\varepsilon>0$ exist $\delta>0$ such that for all $x\in X$ and for all $\alpha\in K$:

If $||x-x_0||<\delta$ then $||f(x,\alpha)-f(x_0,\alpha)||<\varepsilon$.

$\textbf{Proof by Contradiction:}$ Fix $x_0\in X\subseteq\mathbb{R}^n$. Suppose that there is $\varepsilon>0$ such that for all $\delta>0$ exist $x\in X$ and $\alpha\in K$ such that $$\|x-x_0\|<\delta\ \wedge\ \|f(x,\alpha)-f(x_0,\alpha)\|\geq\varepsilon$$

With $\varepsilon>0$ fixed, take $\delta_n=\frac{1}{n}>0$ for each $n\in\mathbb{N}$.

Then there is a sequence $(x_n)$ in $X$ and a sequence $(\alpha_n)$ in $K$ such that for $n=1,2,3,\cdots$ $$\|x_n-x_0\|<\frac{1}{n}\ \wedge\ \|f(x_n,\alpha_n)-f(x_0,\alpha_n)\|\geq\varepsilon$$

Since $\lim_{n\to\infty}\delta_n=\lim_{n\to\infty}\frac{1}{n}=0$ then $\lim_{n\to\infty}x_n=x_0$.

Futhermore, $K$ is compact in $\mathbb{R}^n$ and so sequentially compact. Since $(\alpha_n)$ is a sequence in $K$ sequentially compact then there is a convergent subsequence $(\alpha_{n_k})$ and so exist $\alpha\in K$ such that $\lim_{k\to\infty}\alpha_{n_k}=\alpha$.

We have that the sequence $(x_n)$ converges to $x_0$ so that all subsequence converges and converges to $x_0$; in particular for the subsequence $(x_{n_k})$ then $\lim_{k\to\infty}x_{n_k}=x_0$.

By our assumption, for each $k=1,2,3,\cdots$ must hold $\|f(x_{n_k},\alpha_{n_k})-f(x_0,\alpha_{n_k})\|\geq\varepsilon$.

Since $f$ is continuous in $X\times K$ we have: $$\lim_{k\to\infty}f(x_{n_k},\alpha_{n_k})=f(x_0,\alpha)=\lim_{k\to\infty}f(x_0,\alpha_{n_k})$$

Therefore, $\lim_{k\to\infty}(f(x_{n_k},\alpha_{n_k})-f(x_0,\alpha_{n_k}))=f(x_0,\alpha)-f(x_0,\alpha)=\bar{0}$

By definition of limit, for the given $\varepsilon>0$ exist $N\in\mathbb{N}$ such that if $k>N$ then $$\|f(x_{n_k},\alpha_{n_k})-f(x_0,\alpha_{n_k})-\bar{0}\|=\|f(x_{n_k},\alpha_{n_k})-f(x_0,\alpha_{n_k})\|<\varepsilon$$

A contradiction. $\blacksquare$

• Is there still a question here to be resolved? – T_M May 30 '18 at 22:01
• Yes, in the "Observation"... – CrisPaint May 30 '18 at 22:20

Letting $x$ range through a compact set $L$, we obtain that $f$ is continuous on a compact set $L\times K$. Continuity on a compact set implies uniform continuity. Thus, for every epsilon you can choose a delta such that etc. In particular the estimate holds when $|x-x_0|<\delta$.
• Can you explain in more detail how to choose the compact $L$? I don't see it so clear because in the proposition that part of the domain of $f$ is defined on $X\subseteq\mathbb{R}^n$ but we don't now anything else besides $x_0\in X$. Thanks for your answer! I appreciate it. – CrisPaint May 30 '18 at 17:34
• I am not sure what kind of set $X$ you have in mind but in any case by Titse (sorry about the spelling) extension lemma you can extend the continuous function to an open neighborhood and then choose a compact ball containing $x$. – Mikhail Katz May 30 '18 at 17:39
• The set $X$ from the hypotheses: $Dom(f)=X\times K$. But we need that the domain of $f$ be closed to use that lemma. I don't know if there is something that I'm missing. – CrisPaint May 30 '18 at 17:55