# Uniform semi-continuity

## Background

It is a standard and important fact in basic calculus/real analysis that a continuous function on a compact metric space is in fact uniformly continuous. That is, suppose $(X,d)$ is a compact metric space and $f\colon X \to\mathbb R$ is such that for every $x\in X$ and $\varepsilon>0$ there exists $\delta>0$ such that $d(x,y)<\delta$ implies $|f(x)-f(y)|<\varepsilon$. Then in fact, such a $\delta$ can be chosen independently of $x$.

## Question

Does a similar statement hold regarding semi-continuous functions? For concreteness, let's consider upper semi-continuous functions, so suppose $(X,d)$ is compact and $f\colon X \to\mathbb R$ has the property that for every $x\in X$ and $\varepsilon >0$ there exists $\delta >0$ such that $d(x,y)<\delta$ implies $f(y) < f(x)+\varepsilon$. (Note the asymmetry of $x$ and $y$ in this definition.) Then is it true that $\delta=\delta(\varepsilon)$ can be chosen independently of $x$?

## Reformulation

Given $\delta, \epsilon > 0$, consider the set $$X_\delta^\epsilon := \lbrace x\in X \mid f(y) < f(x) + \epsilon \text{ for every } y\in B(x,\delta) \rbrace.$$ Then $f$ is upper semi-continuous if and only if $\displaystyle\bigcup_{\delta>0} X_\delta^\epsilon = X$ for every $\epsilon > 0$, and $f$ is uniformly upper semi-continuous if and only if this union stabilises -- that is, if for every $\epsilon > 0$ there exists $\delta>0$ such that $X_\delta^\epsilon = X$.

$f(x)=0 \ (x\le0)$, $f(x)=-1/x \ (x\gt0)$ is upper semi-continuous on $[-1;1]$ — but not uniformly.
Proof. Let $f$ be uniformly upper semi-continuous. Then for every $\epsilon>0$ there exists $\delta>0$ such that for every $x\in X$, we have $f(y) < f(x) + \epsilon$ whenever $y\in B(x,\delta)$. However, since this statement holds for every $x$, it also holds with $x$ and $y$ reversed; in the language of the original post, both $x$ and $y$ are contained in the set $X_\delta^\epsilon = X$. Since $y$ is in this set and $x\in B(y,\delta)$, we also have $f(x) < f(y) + \epsilon$, and thus $|f(x) - f(y)| < \epsilon$. But this is just the definition of uniform continuity.