[Math] Check the proof of showing that diam$(A)=$ diam$(\bar{A})$

alternative-proofmetric-spacesproof-verificationproof-writing

Let $(X,d)$ be a metric space. The diameter of a set $A\subset X$ is defined to be
diam$(A)=$ sup$\{d(x,y):x,y\in A\}$.

Show that for any set $A\subset X$, diam$(A)=$ diam$(\bar{A})$ where $\bar{A}$ is the closure of $A$.

It is quite easy to see why the statement is correct. This is how I wrote the proof but not sure whether it is rigorous enough or did I miss any arguments.

Since $d(x,y)\leq d(x', y')$ for all $x,y\in A$ and $x',y'\in\bar{A}$,
hence sup$\{d(x,y):x,y\in A\}=$ sup$\{d(x',y'):x',y'\in\bar{A}\}$ which implies that diam$(A)=$ diam$(\bar{A})$.

Is my proof correct?
If it is wrong how can I fix it?
If it is correct how can how can I improve it?

Many thanks in advance!

Best Answer

Let $a=\operatorname{diam}(A)$ and let $x,y\in\overline A$. Let $\varepsilon>0$. If $x,y\in A$ there is nothing to prove. If $x\in A$, $y\notin A$, then $y$ is a limit point of $A$, so there exists $z\in A$ such that $d(y,z)<\varepsilon$, then $$d(x,y)<d(x,z)+d(y,z)<a+\varepsilon.$$ If $x,y\notin A$, then there are $z,w\in A$ with $d(z,x)<\frac\varepsilon2$, $d(w,y)<\frac\varepsilon2$ and hence $$d(x,y) \leqslant d(x,z) + d(z,w) + d(w,y) < \frac\varepsilon2 + a + \frac\varepsilon2 < a+\varepsilon. $$ It follows that $\operatorname{diam}\overline A\leqslant a$.