Succinct definition of boundary starting from open sets:
Let $X$ be a set and its topology is just a collection $T\subset P(X)$ of some of its subsets that are going to be called open. The collection is required to have some properties which you can check in Wikipedia's article for topology.
The set $X$ with the collection $T$ is called a topological space.
Examples:
- $X=\mathbb{R}$ and $T$ consist of the sets that can be obtained by making arbitrary unions of intervals of the form $(a,b)$.
- $X=\mathbb{N}$ and $T$ consists of all possible subsets of $X$.
- $X=\{3,4,5\}$ and $T$ consists of all possible subsets of $X$.
Interior: Given a topological space $X$ with topology $T$ and given a subset $A\subset X$, the interior of $A$ is the union of all elements of $T$ that are subsets of $A$.
Example:
- The interior of $[a,b)$ in the topological space (1) is $(a,b)$.
- The interior of $\{3,4,5\}$ in the topological space (2) is $\{3,4,5\}$.
Closure: Given a topological space $X$ with topology $T$ and given a subset $A\subset X$, the closure of $A$ is the complement of the union of all elements of $T$ that are completely outside of $A$.
Example:
- The closure of the example (4) is $[a,b]$
- The closure of the example (5) is $\{3,4,5\}$
Boundary: Given a topological space $X$ with topology $T$ and given a subset $A\subset X$, the boundary of $A$ is the difference of its closure minus its interior.
Example:
- The boundary of example (4) is $\{a,b\}$
- The boundary of example (5) is empty
The case of boundary of intervals in $\mathbb{R}$
Given an finite interval that includes or not its extreme points ($A=(a,b)$, $[a,b)$, $(a,b]$, or $[a,b]$) it is always the case that its boundary is the set of its extreme points.
Observe that the interior is the interval excluding its extreme points $(a,b)$. This is an element of the topology (see example 1) and we cannot fit any more intervals without extreme points inside $A$.
The closure is always $[a,b]$. Observe that in the complement of $A$ we can fit the intervals $(b,+\infty)$ and $(-\infty,a)$. Any other is inside those two. The complement of $(-\infty,a)\cup(b,+\infty)$ is $[a,b]$, and that is the closure.
Finally the boundary is closure $[a,b]$ minus interior $(a,b)$. That is $\{a,b\}$.
Topology from metric
Given a set $X$ and a metric $d$ on it. One can define a topology $T$ to consist of arbitrary unions of balls $B(a,r)=\{x\in X:\ d(a,x)<r\}$.
Examples:
- The usual topology in $\mathbb{R}$ is of this form. Observe that the intervals $(a,b)$ are just the balls $B(\frac{a+b}{2},\frac{b-a}{2})$.
Impossibility of a topology on $\mathbb{N}$ such that the boundary of finite intervals consists of its extreme points
Assume we want to put a topology on $\mathbb{N}$ such that for every finite interval (finitely many consecutive integers) the boundary is its extreme points.
If the boundary of $A=\{a,a+1,a+2,...,a+n\}$ ought to be $\{a,a+n\}$. Then its interior would have to be $\{a+1,a+2,...,a+n-1\}$. Since $a$ and $n$ were arbitrary, that means (taking $n=1$) that all sets of the form $\{a\}$ are open (elements of the topology). By a property required for topologies, which you are supposed to read, this means that all subsets are open.
But if all subsets are open, then $A$ is open. Therefore, the interior of $A$ would have to be $A$ and its complement would have to be $A$ as well. This causes that the boundary is empty.
Thereofore, there is no such topology as we wanted. In particular, there is no such topology defined by a metric.