TITLE: $\varphi:B\times A\rightarrow\mathbb{R} $ defined by $\varphi (f,x)=f(x) $is continuous.
QUESTION [0 upvotes]: Problem says: 

Let $A\subset\mathbb{R}^{n}$ be compact and let $B\subset\mathcal{C}(A,\mathbb{R})$   be compact. Show that there are an $f_{0}\in B$   and an $x_{0}\in A$   such that $g(x)\leq f_{0}(x_{0})$   for all $g\in B$  and $x\in A$.

My solution is:

Since ,$\forall g\in B   $, $g(A)$   is compact subset of $\mathbb{R}$, $g(A)$   is closed and bounded. Define $\varphi:B\times A\rightarrow\mathbb{R}$ by  $\varphi(f,x)=f(x)$. If $\varphi$  is continuous, since $B\times A$   is compact, $\varphi(B\times A)$ is compact. Then given $g\in B$ and $x\in A$  , there exists upper bound $M\in\varphi(B\times A)$ of $\varphi(B\times A)$, that is, $g(x)\leq M$. But since $\varphi(B\times A)$ is closed, $M\in\varphi(B\times A)$. So, $M=f_{0}(x_{0})$ for some $f_{0}\in B$ and $x_{0}\in A$.
Now, show that $\varphi$ is continuous. Let $U$ be an open neighborhood of $f(x)$ with radius $\epsilon$. Then to show that $\varphi$ is continuous, it suffices to show that there exists an open ball $V$ of $B\times A$ such that it contains $(f,x)$ and is contained in $\varphi^{-1}(U)$. Let $V_{1}$ be defined by $V_{1}=\{g\in B:||f-g||<\frac{\epsilon}{2}\}$. Then $V_{1}$ is open in $\mathcal{C}(A,\mathbb{R})$. Now since $f$ is continuous, we can take $\delta>0$   so that if $||y-x||<\delta$, then $|f(x)-f(y)|<\frac{\epsilon}{2}$. Then let $V_{2}=\{y\in A:|x-y|<\delta\}$. Then $V_{2}$ is open in $\mathbb{R}$. By the product topology, $V_{1}\times V_{2}$ is open in $\mathcal{C}(A,\mathbb{R})\times\mathbb{R}$. Also, since $f\in V_{1}$ and $x\in V_{2}$ by construction, $(f,x)\in V_{1}\times V_{2}$. Now it remains to show that $V_{1}\times V_{2}\subseteq\varphi^{-1}(U)$, that is, $\varphi(V_{1}\times
V_{2})\subseteq U$. Let $(x,f)$ and $(y,g)\in V_{1}\times V_{2}$. Then $d\left(f(x),g(y)\right)\leq|f(x)-g(y)|\leq|f(x)-g(x)|+|g(x)-g(y)|\leq\frac{\epsilon}{2}+\frac{\epsilon}{2}=\epsilon$. Thus, $\varphi(V_{1}\times V_{2})\subseteq U$. Thus, $\varphi$ is continuous.

Am I right?

REPLY [2 votes]: In the firs paragraph, we usually just use the fact that a real-valued function on a compact set attains its supremum (which you probably saw in class). You are essentially explaining why this is true from other results (namely, that "the image of a compact set under a continuous function is compact", and that "every compact set in $\mathbb{R}$ is bounded and closed"). That said, your argument is correct (but it can me made more direct).
In your second paragraph, when you want to show that the function $\varphi$ is continuous, the first thing you do is fix $(f,x)\in B\times A$ and $\epsilon>0$. Otherwise, we do not know what is $f(x)$ and $\epsilon$, since you never introduced these elements. You should try to correct this in the first two phrases.
Then you choice of $V_1$ and $V_2$ is ok. Closer to the end, you confused the order of some things, namely, it should read "[...]Now it remains to show that $V_1\times V_2\subseteq\varphi^{-1}(U)$, that is $\varphi(V_1\times V_2)\subseteq U$. Let $(g,y)\in V_1\times V_2$" (again, you don't need to introduce $(f,x)$ again, since they were fixed at the beggining of the paragraph). "Then $d(f(x),g(y))=|f(x)-g(y)|\leq |f(x)-f(y)|+|f(y)-g(y)|<\epsilon$.[...]"
{"set_name": "stack_exchange", "score": 0, "question_id": 1781211}