Solution (source code)

= Solution

A <metric space> is <complete> if every <Cauchy sequence> in it converges to a point of that space. The stated shrinking-set characterization is the <Cantor intersection theorem> together with its converse.

First assume <completeness>, and choose $x_n\in A_n$. If $m,n\geq N$, then both points belong to $A_N$, so $d(x_m,x_n)\leq\operatorname{diam}(A_N)$. The vanishing <diameters> imply that $(x_n)$ is a <Cauchy sequence>, hence it converges to some $x\in X$. For every fixed $N$, its tail belongs to the <closed set> $A_N$, so $x\in A_N$. Thus $x\in\bigcap_N A_N$. In fact the intersection contains only one point, since any two of its points have distance at most every diameter.

Conversely assume the stated intersection property and let $(x_n)$ be a <Cauchy sequence>. Put
$$
 A_N=\overline{\{x_n:n\geq N\}}^{\,X}.
$$
These <closures> are nonempty, closed and nested. Taking a <closure> does not increase the <diameter>: approximate two points of the closure by points of the set and use <continuity> of distance. The <Cauchy sequence> therefore makes $\operatorname{diam}(A_N)\to0$. Choose $x$ in the intersection. For $n\geq N$, both $x_n$ and $x$ belong to $A_N$, and $d(x_n,x)\leq\operatorname{diam}(A_N)\to0$. Every <Cauchy sequence> converges in $X$, proving \b[completeness].