Tutorials › Real Analysis › Neighborhoods in Metric Spaces

Metric Spaces · Tutorial 659 of 1000

Neighborhoods in Metric Spaces

Learn to recognize neighborhoods in a metric space and use them to describe local openness and finite intersections.

Advanced 10 min read

What You'll Learn

  • Define neighborhoods and open neighborhoods of a point in a metric space
  • Use metric balls as a neighborhood basis
  • Characterize open sets by neighborhoods of their points
  • Determine when finite intersections of neighborhoods remain neighborhoods
  • Compare neighborhoods in ordinary, discrete, and restricted metrics

Local Structure Around a Point

Open sets and metric balls describe the space near each of their points. Neighborhoods give us a convenient way to discuss that local structure without requiring the set under consideration to be open itself. For example, a closed interval can contain a ball around one of its interior points even though the interval is not open. The relevant question is whether a sufficiently small ball around the point fits inside the set.

We will use the convention that a neighborhood of a point is any set containing an open ball around that point. Some texts use the word “neighborhood” only for an open set containing the point. We will distinguish these ideas explicitly: a neighborhood need not be open, while an open neighborhood is both open and a neighborhood of the point.

Definition: Let \((X,d)\) be a metric space and \(x\in X\). A set \(N\subseteq X\) is a neighborhood of \(x\) if there is an \(r>0\) such that \(B_r(x)\subseteq N\). It is an open neighborhood of \(x\) if, in addition, \(N\) is open in \(X\).

Every neighborhood of \(x\) contains \(x\), because \(d(x,x)=0<r\) for every \(r>0\), so \(x\in B_r(x)\). The converse is not generally true: merely containing \(x\) does not ensure that a set contains any ball around it. The definition is therefore a condition about how much of the space near \(x\) lies in the set.

Balls as a Local Basis

The definition says that every neighborhood contains a ball centered at the point. Conversely, every open ball centered at \(x\) is itself a neighborhood of \(x\). Thus, to test whether a set is a neighborhood of \(x\), it is enough to find one suitable radius. The collection of all such balls provides a local basis at \(x\).

Theorem (Metric-Ball Neighborhood Basis): Let \(N\subseteq X\) and \(x\in X\). Then \(N\) is a neighborhood of \(x\) if and only if there is an open ball centered at \(x\) and contained in \(N\). In particular, the balls \(B_r(x)\), for \(r>0\), form a neighborhood basis at \(x\): every neighborhood of \(x\) contains one of these balls.

Proof. If \(N\) is a neighborhood of \(x\), its definition gives an \(r>0\) such that \(B_r(x)\subseteq N\). This is an open ball centered at \(x\) and contained in \(N\). Conversely, if \(B_r(x)\subseteq N\) for some \(r>0\), then \(N\) is a neighborhood of \(x\) by definition. The balls are therefore neighborhoods, and every neighborhood contains one of them. \(\square\)

The basis property also explains why the particular shape of a neighborhood is usually secondary. A neighborhood might be irregular, or it might include distant points as well as points near \(x\). What matters locally is that it contains some ball centered at \(x\). For local questions, that ball is a simpler set to work with.

Worked Example: A Neighborhood That Is Not Open

In \(\mathbb{R}\) with the usual metric, let \(N=[-1,2]\) and \(x=0\). The ball \(B_1(0)=(-1,1)\) is contained in \(N\), so \(N\) is a neighborhood of \(0\). But \(N\) is not open: no ball centered at \(-1\) is contained in \(N\), since every positive-radius ball around \(-1\) includes points less than \(-1\). Thus, a set can be a neighborhood of one of its points without being open.

The same set is not a neighborhood of \(2\). For every \(r>0\), the ball \(B_r(2)\) contains points greater than \(2\), and none of those points belongs to \(N\). This illustrates the point-specific nature of the definition: whether a set is a neighborhood depends on the point being considered.

Worked Example: Neighborhoods in a Discrete Metric

Let \(X\) have the discrete metric, so distinct points have distance \(1\). For any \(x\in X\), the ball \(B_{1/2}(x)\) is \(\{x\}\). If \(N\subseteq X\) contains \(x\), then \(B_{1/2}(x)\subseteq N\), so \(N\) is a neighborhood of \(x\). If \(N\) does not contain \(x\), it cannot be a neighborhood of \(x\), because every neighborhood contains its center. Hence, in a discrete metric space, the neighborhoods of \(x\) are exactly the sets containing \(x\).

In particular, \(\{x\}\) is an open neighborhood of \(x\), since \(\{x\}=B_{1/2}(x)\) is open. This example shows that the local meaning of “small” depends on the metric: here, a ball can isolate its center completely.

Neighborhoods and Open Sets

Neighborhoods give a point-by-point way to express openness. A set is open precisely when every point in it has enough room around it to contain a ball that stays inside the set. In neighborhood language, the same condition says that each point of the set has the set itself as a neighborhood.

Theorem (Neighborhood Characterization of Open Sets): A set \(U\subseteq X\) is open if and only if \(U\) is a neighborhood of each of its points.

Proof. Suppose first that \(U\) is open. For each \(x\in U\), the definition of an open set gives an \(r>0\) such that \(B_r(x)\subseteq U\). Therefore \(U\) is a neighborhood of \(x\). This holds for every \(x\in U\).

Conversely, suppose \(U\) is a neighborhood of each of its points. For each \(x\in U\), there is an \(r_x>0\) such that \(B_{r_x}(x)\subseteq U\). The existence of this ball at every \(x\in U\) is exactly the definition of openness. Thus \(U\) is open. If \(U=\varnothing\), the condition has no points to check, and \(\varnothing\) is open as well. \(\square\)

The empty-set case matters because the statement “every point of \(U\) has a neighborhood contained in \(U\)” is vacuously true when there are no points. This agrees with the standard definition that the empty set is open. No extra condition is needed for that case.

Worked Example: Recognizing an Open Interval by Neighborhoods

Consider \(U=(1,4)\) in \(\mathbb{R}\). Fix any \(x\in U\), so \(1<x<4\), and set $$ r=\frac{1}{2}\min\{x-1,4-x\}. $$ Both \(x-1\) and \(4-x\) are positive, so \(r>0\). If \(y\in B_r(x)\), then \(|y-x|<r\), and therefore $$ y>x-r\geq x-\frac{x-1}{2}=\frac{x+1}{2}>1 $$ and $$ y<x+r\leq x+\frac{4-x}{2}=\frac{x+4}{2}<4. $$ Thus \(B_r(x)\subseteq(1,4)\), so \(U\) is a neighborhood of each of its points. The neighborhood characterization proves that \(U\) is open.

The radius is allowed to depend on \(x\). Points close to either endpoint need a smaller radius than points near the middle. Openness requires a suitable ball at each point, not one common radius that works throughout the entire set.

Finite Intersections and Neighborhoods

At a fixed point, finitely many neighborhood conditions can be satisfied at once. If one set contains a ball of radius \(r\) around \(x\) and another contains a ball of radius \(s\), then the smaller of the two balls lies in both sets. The same reasoning works for any finite collection.

Theorem (Finite Intersections of Neighborhoods): If \(N_1,\ldots,N_m\) are neighborhoods of \(x\), where \(m\geq1\), then \(\bigcap_{j=1}^m N_j\) is a neighborhood of \(x\). Also, any set containing a neighborhood of \(x\) is itself a neighborhood of \(x\).

Proof. For each \(j\in\{1,\ldots,m\}\), choose \(r_j>0\) such that \(B_{r_j}(x)\subseteq N_j\). Since there are finitely many positive radii, their minimum $$ r=\min\{r_1,\ldots,r_m\} $$ is positive. If \(y\in B_r(x)\), then \(d(x,y)<r\leq r_j\) for each \(j\), so \(y\in B_{r_j}(x)\subseteq N_j\) for every \(j\). Hence $$ B_r(x)\subseteq\bigcap_{j=1}^m N_j, $$ which proves that the intersection is a neighborhood of \(x\).

For the second claim, suppose \(N\) is a neighborhood of \(x\) and \(N\subseteq M\). There is an \(r>0\) such that \(B_r(x)\subseteq N\). Then \(B_r(x)\subseteq M\), so \(M\) is a neighborhood of \(x\) as well. \(\square\)

The finiteness hypothesis in the intersection result is important. For example, in \(\mathbb{R}\), each set \(N_n=(-1/n,1/n)\) is a neighborhood of \(0\), but their intersection is \(\{0\}\), which is not a neighborhood of \(0\) in the usual metric. Indeed, no positive-radius ball around \(0\) is contained in \(\{0\}\). The radii shrink without bound as \(n\) increases, leaving no positive radius that works for the whole intersection.

Worked Example: Intersecting Two Neighborhoods

In \(\mathbb{R}\), let \(N_1=(-2,3]\) and \(N_2=[-1,1)\). Both are neighborhoods of \(0\): \(B_1(0)=(-1,1)\subseteq N_1\), and \(B_{1/2}(0)=(-1/2,1/2)\subseteq N_2\). Their intersection is $$ N_1\cap N_2=[-1,1). $$ The ball \(B_{1/2}(0)=(-1/2,1/2)\) is contained in this intersection, so it too is a neighborhood of \(0\). It is not necessary for either original set to be open for the intersection to be a neighborhood.

The proof by minimum radius gives the general method. Given radii \(1\) and \(1/2\), the smaller radius \(1/2\) works for both sets. For a larger finite collection, take the minimum of all the available radii.

Relative Neighborhoods and Common Pitfalls

Neighborhoods are always relative to the metric space in which the balls are formed. If \(A\subseteq X\) is given the restricted metric, the ball around \(x\in A\) is $$ B_r^A(x)=\{y\in A:d(x,y)<r\}=A\cap B_r^X(x). $$ Consequently, whether a set is a neighborhood in \(A\) must be checked using these relative balls, not by silently using balls in the larger space. The theorem on balls in a restricted metric gives the corresponding relationship between those balls.

Worked Example: A Neighborhood in a Restricted Metric

Let \(A=(0,1)\subseteq\mathbb{R}\) with the restricted usual metric, and let \(N=(0,1/3]\subseteq A\). We check that \(N\) is a neighborhood of \(x=1/4\) in \(A\). Take \(r=1/24\). If \(y\in B_r^A(1/4)\), then $$ \frac{1}{4}-\frac{1}{24}<y<\frac{1}{4}+\frac{1}{24}, $$ so \(5/24<y<7/24<1/3\). In particular, \(y\in(0,1/3]\), and \(B_r^A(1/4)\subseteq N\). Thus \(N\) is a neighborhood of \(1/4\) in \(A\).

The set \(N\) is not open in \(A\), because it includes \(1/3\) but no relative ball around \(1/3\) stays inside \(N\): every such ball contains points of \(A\) greater than \(1/3\). The neighborhood and open-neighborhood distinction applies in restricted spaces just as it does in the larger space.

A frequent mistake is to assume that any set containing a point is a neighborhood of that point. For example, \(\{0\}\subseteq\mathbb{R}\) contains \(0\), but no ball \(B_r(0)\) with \(r>0\) is contained in \(\{0\}\). Another mistake is to assume that a neighborhood must itself be open. The set \([-1,2]\) is a neighborhood of \(0\) in \(\mathbb{R}\), but it is not open. The test in both cases is the same: find, or rule out, a positive-radius ball centered at the specified point and contained in the set.

Takeaway: A neighborhood of \(x\) is a set containing a ball centered at \(x\). Such balls form a local basis, a set is open exactly when it is a neighborhood of each of its points, and finite intersections of neighborhoods of the same point remain neighborhoods of that point.

Check Your Understanding

Use the definitions and results above to answer the following questions.

  1. Why does every neighborhood of \(x\) contain \(x\), and why does containing \(x\) alone not guarantee that a set is a neighborhood?
  2. What does it mean for the balls centered at \(x\) to form a neighborhood basis at \(x\)?
  3. How can neighborhoods be used to characterize whether a set is open?
  4. Why does a finite intersection of neighborhoods of \(x\) remain a neighborhood of \(x\), and where is finiteness used?
  5. In a discrete metric space, which subsets are neighborhoods of a given point \(x\)?
  6. Why must balls in a restricted metric be understood relative to the subset on which that metric is defined?