# Note 7 - Metric Spaces

## Table of Contents

## Metric Space

- Simplest mathematical structure. We need to talk about “distance,” which allows us to talk about “\(\epsilon\)-neighborhoods” and “convergence”, etc.

**Definition**: A **metric space** \((S, d)\) is a set \(S\), and a distance function \(d: S \times S \rightarrow \mathbb{R}\) that satisfies:

- \(d(x,x) = 0\ \forall x \in S\)
- \(d(x, y) > 0\ \forall x, y \in S \textrm{ and } x \neq y\)
- \(d(x,y) + d(y,z) \geq d(x,z)\ \forall x,y,z \in S\)
- \(d(x,y) = d(y,x)\)

### Examples

- \(S = \mathbb{R}^2, \textrm{ and } d((x_1, y_1), (x_2, y_2)) = \sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2}\)
- \(S = \mathbb{R}^2, \textrm{ and } d((x_1, y_1), (x_2, y_2)) = 0 if (x_1, y_1) = (x_2, y_2), 1 if (x_1, y_1) \neq (x_2, y_2)\)
- \(S = \mathbb{R}, d(x, y) = \vert x-y \vert\)

## Neighborhoods

**Definition**: Let \((S, d)\) be a metric space, \(x \in S, r > 0\). We can create a **Ball** with radius \(r\) that contains all elements within that radius, denoted \(B_r(x) := \{y \in S \vert d(x, y) < r\}\).

### Examples

\(S = \mathbb{R}^2, d((x_1, y_1), (x_2, y_2)) = \sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2}\).

\(B_1(0, 0) =\) circle with radius 1, boundary excluded.

\(S = \mathbb{R}, d(x, y) = \vert x-y \vert\)

\(B_1(1) = (0, 2)\)

## Open Subsets

**Definition**: Let \((S, d)\) be a metric space, and \(E \subset S\). We say \(E\) is an **open subset** of \(S\) if \(\forall x \in E, \exists r > 0\) such that \(B_r(x) \in E\).

### Examples

**Q:** Let \((R, d)\) be a metric space. Is \([0, 1] \subset \mathbb{R}\) an open subset?

Answer: No. If we take a look at the “edge” (ie. point 0), we can see that the ball around this point is not in the set. Formally, \(\forall r > 0, B_r(1) \not\subset [0, 1]\) since \(B_r(1)\) implies the range \((1-r, 1+r)\), which contains elements outside.

**Q:** Taking the same setup above, is \((0, 1) \in \mathbb{R}\) open?

Answer: Any element must be in \((0, 1)\), so we can always take the radius to be half the distance to the shorter border.

Formally, if \(r = min\{x, 1-x\}\), then \(B_r(x) \subset (0, 1)\).

**Q:** In general, for any metric space, is \(B_r(x) \in S\) open?

To prove this, we must show \(\forall y \in B_r(x)\), we have some \(r' > 0\) such that \(B_{r'}(y) \subset B_r(x)\).

Let us define \(d(x, y) = r_0\).

Claim: \(B_{r - r_0}(y) \in B_r(x)\).

\(\forall z \in B_{r - r_0}(y), d(z, y) < r - r_0\). By Triangle Inequality, \(d(z, x) \leq d(z, y) + d(y, x) < (r - r_0) + r_0 = r\). This means that \(z \in B_r(x)\), which completes the proof.

## Closed Subsets

**Definition**: Let \((S, d)\) be a metric space with \(E \in S\). We say \(E\) is a **closed subset** of \(S\) if \(E^C \in S\) is open (where \(E^C = \{x \in S \vert x \not\in E\})\).

### Examples

**Q:** Is \([0, 1] \in R\) closed?

Yes. \([0, 1]^\complement = (-\infty, 0) \cup (1, \infty)\). We can then use the same argument as above to show that it is open.

**Q:** Is \((0, 1) \in R\) closed?

No. \((0, 1)^\complement = (-\infty, 0] \cup [1, \infty)\). We can then use the same argument as above to show that it is not open.

**Q:** Is \(E := \{\frac{1}{n} \vert n \in \mathbb{R}\} \in R\) closed?

No. \(E^\complement = (1, \infty) \cup (1/2, 1) \cup (1/3, 1/2) \cup ... \cup (-\infty, 0]\). For any radius \(r\) around \(0\), we can find a \(1/n\) such that it’s within this radius.

Equivalently, \(\forall r>0, B_r(0)\) always contains some elements in \(E\). This implies that \(B_r(0) \not\subset E^\complement\), so \(E\) is not closed.

These examples illustrate that *for a set to be closed, it should contain all its limit points*.

## Limit Points

**Definition**: Let \((S, d)\) be a metric space, with \(E \in S\). We call \(x \in S\) a **limit point** of \(E\) if \(\forall r > 0, B_r(x) \cap E\) contains a point \(y\) such that \(y \neq x\).

### Examples

**Q:** What are the limit points of \(E := (0, 1) \in R\)?

\(0\) is a limit point, since there exists points in \(B_r(0) \not\in R\ \forall r\) Every point in \([0, 1]\) is a limit point of \((0, 1)\).

**Q:** Is it true that *any point* \(x \in E\) is a limit point of \(E\)?

No. Take the example \(E = \{1, 2, 3\}\). \(1\) is not a limit point of \(E\).

## Closure

**Definition**: The **closure** of \(E \in S\) is defined to be the union of \(E\) and its limit points.

\(\overline{E} = E \cup \{\textrm{ limit points of }E\}\)

e.g. \(\overline{(0, 1)} = [0, 1]\)

**Theorem**: Let \((S, d)\) be a metric space, and \(E \subset S\). We claim that \(E\) is closed if and only if \(E\) contains all the limit points of \(E\).

Proof \(\rightarrow\): We want to show that if \(x \not\in E\), then \(x\) is not a limit point of \(E\).

\(x \not\in E\) if and only if \(x \in E^\complement\) is open. This implies that \(\exists r > 0\) such that \(B_r(x) \subset E^\complement\), which means that \(B_r(x) \cap E = \emptyset\). This shows that x is not a limit point of \(E\).Proof \(\leftarrow\): We want to show \(E^\complement\) is open. \(\forall x \in E^\complement\), we know \(x \not\in E = \overline{E}\), which means \(x\) is not a limit point of \(E\). This means \(\exists r > 0\) such that \(B_r(x) \cap E\) is either \emptyset or \(\{x\}\). The second case cannot be true, since \(x \not\in E\). Therefore, \(B_r(x) \cap E = \emptyset\), so \(B_r(x) \in E^\complement\). This shows that \(E^\complement\) is open, so \(E\) is closed.

**Exercise**: Is \(\mathbb{Q} \in \mathbb{R}\) open or closed? What about \(\overline{\mathbb{Q}}\)?