Riesz representation theorem

Theorem
Let $$f$$ be a bounded linear functional in a Hilbert space $$X$$ over $$\mathbb K$$. Then there exists a unique $$y\in X$$ such that, for all $$x\in X$$, and
 * $$f(x)=\langle x,y\rangle$$
 * $$\lVert f\rVert =\lVert y\rVert$$

Proof
If $$f=0$$ take $$y=0$$. Suppose then that $$f\neq 0$$ and consider $$\ker f$$, which is a closed space by this proposition. By the Hilbert space decomposition theorem we then have and, since $$\ker f \not =X$$, $$(\ker f)^\perp$$ has an element $$z$$ such that $$\lVert z\rVert =1$$. Note now that, for all $$x\in X$$ and, since $$z\in (\ker f)^\perp$$, that is to say with $$y=\overline{f(z)}z$$. To prove uniqueness, suppose that for all $$x\in X$$ for some two elements $$y_1,y_2\in X$$. Then $$\langle x,y_1\rangle -\langle x,y_2\rangle=\langle x,y_1-y_2\rangle=0$$ for all $$x\in X$$. In particular, for $$x=y_1-y_2$$ which would imply $$\lVert y_1-y_2\rVert ^2=0$$ and hence $$y_1=y_2$$. Finally, since the inner product is continuous on the first variable is a linear functional that is continuous, and hence bounded by the bounded operator equivalence theorem. Applying the Cauchy-Schwarz inequality, we get and so $$\lVert f\rVert =\sup_{\lVert x\rVert =1}\; |f(x)|\leq \lVert y\rVert$$. If $$y=0$$ then $$\lVert f\rVert=0$$ so $$f=0$$. If not, consider $$z=\lVert y\rVert^{-1}y$$ to obtain which yields $$\lVert f\rVert=\lVert y\rVert$$.
 * $$X=\ker f\oplus (\ker f)^\perp$$
 * $$f(x)z-f(z)x\in \ker f$$
 * $$0=\langle f(x)z-f(z)x,z\rangle =f(x)-\langle x,\overline{f(z)}z\rangle $$
 * $$f(x)=\langle x,\overline{f(z)}z\rangle =\langle x,y\rangle $$
 * $$f(x)=\langle x,y_1\rangle =\langle x,y_2\rangle $$
 * $$f\colon X\to \mathbb K$$, $$f(x)=\langle x,y\rangle $$
 * $$|f(x)| =|\langle x,y\rangle|\leq\lVert x\rVert\cdot\lVert y\rVert$$
 * $$|f(z)|=\left|\left\langle\frac{y}{\lVert y\rVert},y\right\rangle\right|=\frac{1}{\lVert y\rVert}\langle y,y\rangle=\lVert y\rVert$$