A sequence of functions can fail to converge for two different reasons. It may fail at a particular input, or it may converge at every input while the error remains large somewhere else. The uniform metric is designed to measure the second phenomenon: it asks for the largest possible output error over the whole domain, rather than checking each input in isolation.
text
admin
The construction is deliberately insensitive to algebra. The domain $S$ is only a set, while the codomain $(Y,e)$ is a [metric space](/page/Metric%20Space). This makes the uniform metric available before vector spaces, integrals, differentiability, or topology on the domain have entered the discussion. It is the metric structure on $Y$ that supplies the notion of error.
text
admin
The price for measuring the largest error is that the largest error must be finite. This is why bounded functions, or more precisely functions whose images are bounded in $Y$, are the natural arena. Without boundedness the same formula may take the value $\infty$, which is not allowed for an ordinary metric.
text
admin
[example: Escaping Error on an Unbounded Domain]
Let $S=\mathbb R$, let $Y=\mathbb R$ with $e(a,b)=|a-b|$, and define $f,g:\mathbb R\to\mathbb R$ by $f(x)=0$ and $g(x)=x$. For each fixed $x\in\mathbb R$, the pointwise error is the finite real number
\begin{align*}
e(f(x),g(x))=|f(x)-g(x)|=|0-x|=|-x|=|x|.
\end{align*}
The collection of all pointwise errors is unbounded above. Indeed, if $M\ge 0$, choose $x=M+1$. Then $x\in\mathbb R$ and
\begin{align*}
|f(x)-g(x)|=|0-(M+1)|=M+1>M.
\end{align*}
Thus no finite real number bounds the set $\{|f(x)-g(x)|:x\in\mathbb R\}$ from above, so
\begin{align*}
\sup_{x\in\mathbb R}|f(x)-g(x)|=\infty.
\end{align*}
The largest-error formula therefore does not produce an ordinary finite distance for these two functions; restricting to bounded functions is what prevents this kind of error from escaping to infinity across the domain.
[/example]
example
admin
The example shows why the word "uniform" is not cosmetic. A pointwise comparison can inspect every input separately and still miss the fact that the errors escape to infinity across the domain. The uniform metric turns that global failure into a single numerical distance.
text
admin
## Bounded Function Spaces
h2
admin
Before defining the distance between two functions, we need to say which functions are allowed. In a general metric codomain there is no preferred zero vector, so boundedness cannot mean $|f(s)| \le M$. It must mean that the image of the function has finite diameter.
text
admin
[definition: Bounded Function into a Metric Space]
Let $S$ be a set and let $(Y,e)$ be a metric space. If $S=\varnothing$, the unique function $f:\varnothing\to Y$ is bounded by convention. If $S\neq\varnothing$, a function $f: S \to Y$ is bounded if there exists $y_0 \in Y$ and $M \ge 0$ such that
\begin{align*}
e(f(s),y_0) \le M
\end{align*}
for every $s \in S$.
[/definition]
definition
admin
In a metric space, the choice of base point is not part of the data. If the image of $f$ lies in a ball around one point of $Y$, then it lies in a possibly larger ball around any other fixed point of $Y$. For real-valued functions this recovers the usual condition that $|f(s)|$ is bounded above. We need a named ambient collection of exactly these functions, because the uniform distance will be finite only on that collection.
text
admin
[definition: Space of Bounded Functions]
Let $S$ be a set and let $(Y,e)$ be a metric space. The space of bounded functions from $S$ to $Y$ is
\begin{align*}
B(S,Y) = \{f:S \to Y : f \text{ is bounded}\}.
\end{align*}
[/definition]
definition
admin
The notation $B(S,Y)$ now gives a precise domain on which the largest-error formula can be finite. With that support in place, the page's central object can be defined directly.
text
admin
## Definition
h2
admin
Now the distance between two bounded functions is obtained by looking at every input at once. The formula records the worst output error, using the metric $e$ in the codomain.
text
admin
[definition: Uniform Metric on Bounded Functions]
Let $S$ be a set and let $(Y,e)$ be a metric space. For $f,g \in B(S,Y)$, the uniform metric, also called the sup metric, is the function $D: B(S,Y) \times B(S,Y) \to [0,\infty)$ defined by
\begin{align*}
D(f,g)=\sup_{s \in S} e(f(s),g(s)).
\end{align*}
If $S=\varnothing$, the supremum over the empty index set is defined to be $0$.
[/definition]
definition
admin
The supremum is finite because the two images are bounded subsets of $Y$. If $f(S)$ lies in a ball of radius $M_f$ around $y_f$ and $g(S)$ lies in a ball of radius $M_g$ around $y_g$, then the triangle inequality gives
A supremum is used rather than a maximum because the worst error might be approached without being attained. This distinction matters as soon as the domain is not finite or compact.
text
admin
[remark: Supremum Need Not Be Maximum]
The notation $\sup$ is essential. If $S=(0,1)$, $Y=\mathbb R$, $f(x)=x$, and $g(x)=0$, then
\begin{align*}
D(f,g)=\sup_{x \in (0,1)} |x| = 1,
\end{align*}
but there is no $x \in (0,1)$ at which $|f(x)-g(x)|=1$.
[/remark]