# Are max and min of a function continuous?

Let $C$ be a compact set in $\mathbb{R}^n$.

Let $f \colon v \in C \mapsto k(v) \in \mathbb{R}$ a continuous function. By Weierstrass' theorem, $f$ admits $k_1$ and $k_2$ as maximum and minimum values. Are the functions $k_i(v)$ continuous as functions on their own?

Sorry, I'll try to fix. Let's hope the following makes some sense.

Let $C$ be a compact set in $\mathbb{R}^n$. For each $P$ in $C$, $f_P \colon v \in C \mapsto f_P(v) \in \mathbb{R}$ is a continuous function. By Weierstrass' theorem, $f_P$ admits $k_1(P)$ and $k_2(P)$ as maximum and minimum values. Are the functions $k_i(P)$ continuous as functions on their own?

-
What does $k_i(v)$ mean? ($k_1$ and $k_2$ are just numbers; they are not functions of $v$.) –  Srivatsan Sep 21 '11 at 14:04
first, is $f(v) = k(v)$? Second, $k_1$ and $k_2$ are continuous since they are constants. How do they depend on $v$ if $C,f$ are fixed? –  Ilya Sep 21 '11 at 14:05
continuous in what topology and variable? Given $C$, and $f$, the minimum and maximum of $f$ on $C$ indeed exist but are just fixed numbers. We can see it as a function of $f$, keeping $C$ fixed, in which case we need to discuss what topology to put on all continuous real-valued functions on $C$, or we could vary $C$, keeping $f$, in which case we need a (hyperspace) topology on all compact subsets of $R^n$ (e.g. using the Hausdorff metric), or both. What is $k$ exactly? –  Henno Brandsma Sep 21 '11 at 14:06
(Since we are trying to guess what the OP had in mind.) Perhaps the OP has a function $g: C \times V \to \mathbb R$ and $k(v)$ is the maximum of $g(\cdot, v)$ over $C$. Now it makes sense to ask if $k(v)$ is continuous or not. –  Srivatsan Sep 21 '11 at 14:15
@SrivatsanNarayanan In which case of course the Theorem of the Maximum gives the desired conditions: en.wikipedia.org/wiki/Maximum_theorem –  Jyotirmoy Bhattacharya Sep 21 '11 at 14:39

It seems that we have a continuous function $f:\ C\times C\to{\mathbb R}, \ (x,P)\to f_P(x)$, where $C$ is a compact set in ${\mathbb R}^n$. For a given $P\in C$ one can ask about the value $m(P):=\max\{f_P(x)| x\in C\}$, and the question is whether the new function $m(\cdot):\ P\mapsto m(P)$ is continuous on $C$.
This is indeed the case. Note that $f$ is uniformly continuous on the compact set $C\times C$. This means that given an $\epsilon>0$ there is a $\delta>0$ with $f_{P_0}(x_0)<f_P(x)+\epsilon$ whenever $|x-x_0|<\delta$ and $|P-P_0|<\delta$. For fixed $P_0\in C$ there is a point $x_0\in C$ with $m(P_0)=f_{P_0}(x_0)$, and therefore we have $$m(P_0)< f_P(x_0)+\epsilon\leq m(P)+\epsilon$$ for all $P$ with $|P-P_0|<\delta$. By symmetry it follows that $|m(P)-m(P_0)|<\epsilon$ as soon as $|P-P_0|<\delta$, which proves that the function $m(\cdot)$ is continuous on $C$.