# Metric spaces: equivalence of neighborhood definition of continuity with usual one. Don't we need a constraint asserting existence of neighborhoods?

From Kaplansky Set theory and metric spaces p. 80:

Let $$X,Y$$ be metric spaces, let $$f$$ be a function $$f: X \to Y$$, let $$x_0$$ be a point in $$X$$, and let $$y_0 := f(x_0)$$. Prove $$f$$ is continuous at $$x_0$$ if and only if, for any neighborhood $$V$$ of $$y_0$$, there exists a neighborhood $$U$$ of $$x_0$$ with $$f(U) \subset V$$.

The author defines a neighborhood of $$x$$ as a subset of the metric space containing at least one open set that contains $$x$$.

Perhaps I don't understand the material very well yet, but don't we need to add an additional constraint to the theorem stating something along the lines "there is at least one neighborhood of $$y_0$$", or something analogous? Maybe also for $$x_0$$? Because the proof requires as a first statement: "Let V be an arbitrary neighborhood of $$y_0$$". But since the function we've defined is completely arbitrary, we know next to nothing about it, and so it might actually have no neighborhoods. Is there maybe another way to implicitly derive the existence of neighborhoods from what is already given that I'm not seeing? From continuity maybe?

Thanks for any help!

• Note that given any metric space $X$ and $x_0 \in X$, there is one trivial neighbourhood of $x_0$: namely $X$. Commented Aug 22, 2021 at 9:24
• @AryamanMaithani oh! that's a very important point! thank you! Commented Aug 22, 2021 at 9:26
• what is your definition of continuity? Commented Aug 22, 2021 at 10:24
• @CSquared $f$ is continuous at $x_0$ if and only if $\forall \epsilon >0 \exists \delta >0: d(x,x_0) < \delta \implies d[f(x), y_0] < \epsilon$, where $d$ is the distance function Commented Aug 22, 2021 at 10:28
• note that your definition may be written as follows: $$\forall\varepsilon>0\exists\delta>0: x\in B(x_0,\delta)\implies f(x)\in B(f(x_0),\varepsilon)$$ which may help clear up the neighborhood business, as $B(f(x_0),\varepsilon)$ is a neighborhood of $f(x_0)$ for any $\varepsilon>0$, likewise, $B(x_0,\delta)$ is a neighborhood of $x_0$ for any $\delta>0$. Commented Aug 22, 2021 at 10:36

In any metric spaces $$X$$ and $$Y$$, regardless of what $$f$$ is, any $$f(x_0) \in Y$$ has plenty of neighbourhoods: all open balls $$B(f(x_0), r)$$ where $$r>0$$ and likewise for $$x_0$$ we have $$B(x_0, r)$$ as well, in their respective spaces, and their supersets. For general spaces we always have $$X$$ and $$Y$$ as possible neighbourhoods, but in metric spaces we can say more.
Note that from this general criterion (which holds in all spaces) $$\varepsilon$$-$$\delta$$ continuity follows: for $$\varepsilon>0$$ we have that $$V =B(y_0, \varepsilon)$$ is a neighbourhood of $$y_0=f(x_0)$$ so we have a neighbourhood $$U$$ of $$x_0$$ so that $$f[U] \subseteq V$$. As $$x_0 \in \operatorname{int}(U)$$ there is some $$\delta>0$$ so that $$B(x_0, \delta) \subseteq U$$. So if $$d(x,x_0) < \delta$$, $$x \in B(x_0, \delta)$$, hence $$x \in U$$, so $$f(x) \in V$$ which means $$d(f(x), f(x_0)) < \varepsilon$$...
• @shintuku No, it an always happen that $B(x, r)=\{x\}$ for some $r>0$. We just have an isolated point in that case. Any function will be continuous in an isolated point (in the domain) and if a continuous $f$ maps onto an isolated point, it will be locally constant around it.. These are just consequences of the definition. Commented Aug 22, 2021 at 10:42