Distance between point and linear Space

Suppose $E$ is a normed vector space. Let $f$ be a continuous linear functional on $E$ and denote by $M$ the Kernel of $f$. Let $x\in E$. How to show that $$\operatorname{dist}(x,M)=\displaystyle\inf_{y\in M}\|y-x\|=\frac{|f(x)|}{\|f\|}\, ? $$


Solution 1:

We assume that $f$ doesn't vanish identically. First, if $y\in \ker f$, then $$|f(x-y)|=|f(x)|\leqslant \lVert x-y\rVert\cdot\lVert f\rVert,$$ hence $$\operatorname{dist}(x,\ker f)\geqslant \frac{|f(x)|}{\lVert f\rVert}.$$ Let $\{y_n\}\subset E$ such that $f(y_n)/\lVert y_n\rVert\to \lVert f\rVert$. As $x-\frac{f(x)}{f(y_n)}y_n\in \ker f$, we have $$\operatorname{dist}(x,\ker f)\leqslant\inf_n\left\lVert x-\frac{f(x)}{f(y_n)}y_n-x\right\rVert=|f(x)|\inf_n\left|\frac 1{f(y_n)}y_n\right|\leqslant \frac{|f(x)|}{\lVert f\rVert}.$$