# Supremum equals maximum on a subset of natural numbers

I'm wondering if $$\sup_{x \in M} f(x) = \max_{x \in M} f(x)$$ holds when $$f$$ is some arbitrary function and $$M = \{0,1,\dots,n\}$$ for some $$n \in \mathbb N$$.

My idea is that $$M$$ is closed and bounded as a (finite) union of closed and bounded sets containing one element each, so its compact due to Heine-Borel and if $$f$$ is continous then this equality will hold. But what if $$f$$ is not continous? Also what happens in the limit $$n \to \infty,$$ so that $$M = \mathbb N_0$$?

Thanks!

• – Robert Z May 21 at 13:48

I will assume that $$f$$ is a map from $$\mathbb N$$ into $$\mathbb R$$.
If $$M=\{1,2,\ldots,n\}$$ then $$\{f(1),\ldots,f(n)\}$$ is a finite set of real numbers and for every finite non-empty subcet $$F$$ of $$\mathbb R$$, there is always some element greater or equal than all the otheres. That element will be both $$\max F$$ and $$\sup F$$.
On the other hand, if the domain of $$f$$ is $$\mathbb N$$, then, even if $$\sup\{f(n)\,|\,n\in\mathbb N\}$$ exists, it doesn't have to be a maximum. Take $$f(n)=-\frac1n$$, for instance. Then $$\sup\{f(n)\,|\,n\in\mathbb N\}=0$$, but $$0\notin\{f(n)\,|\,n\in\mathbb N\}$$.