# Distance of functions defined on a Hilbert Space

In our Topology class, we touched on Hilbert spaces for a couple of weeks. I've been studying various problems around the topics we covered, and I came across this one on a list of supplemental problems that was given to us from our instructor. I am having trouble figuring it out. Can anyone help?

Consider the Hilbert space $H = L^2[0,1]$ with the norm on $H$ is defined by $||f||^2 = \int^{1}_{0} f^2(x) dx$. Also, consider the functions $f_1$, $f_2$, and $f_3$ in $H$ such that $f_1(x)=1$, $f_2(x)=x$ and $f_3(x)=x^2$ for $0 \leq x \leq 1$. In $H$, what is the distance from $f_1$ to the linear subspace spanned by $f_2$ and $f_3$?

-
Do you know about the Gram-Schmidt orthogonalization process? –  Srivatsan Nov 15 '11 at 16:21
I remember learning about it when I took functional analysis, but we never spoke of it in our Topology course. This problem was from a list of problems that was given to us as supplemental practice from our instructor. –  josh Nov 15 '11 at 16:27
I read the problem wrong. $f_1(x)$ is the constant 1, not any constant. –  josh Nov 15 '11 at 17:09

Since I am not completely sure about your background, I will review some linear algebra that will be useful for us. Apologies if the answer is too basic. I avoid the use of the Gram-Schmidt process in this answer.

You might be familiar that a Hilbert space is an inner product space (that is also complete w.r.t. the metric induced by the inner product, but this point is irrelevant for us). In your case, the inner product space is $L^2[0,1]$ with the inner product $(f,g) \mapsto \langle f, g \rangle := \int_0^1 f(x) g(x) dx$. I will call the elements of this function space "vectors".

Let $A$ be a given subspace and $h$ a vector not necessarily in $A$. It is a basic linear algebraic fact that the point $a$ of $A$ that is closest to $h$ is the projection of $h$ onto $A$, henceforth denoted $h_{\Pi}$. So in order to determine the distance of a vector $h$ from a subspace $A$, one should project $h$ onto the subspace $A$, and compute the distance of $h$ from its projection. To do this, we will decompose $h$ into a sum $h_{\Pi} + h_{\bot}$, such that $h_{\Pi} \in A$ and $h_{\bot}$ is orthogonal to $A$.

In the given example, $h= f_1$ and $A = \operatorname{Span} \{ x, x^2 \}$, so we can write $h_\Pi = ax + bx^2$ for some undetermined scalars $a, b \in \mathbb R$. We have the constraint that $h_{\bot}$ is orthogonal to $\{ x, x^2 \}$; i.e., $\langle h_{\bot}, x \rangle = 0$ and $\langle h_{\bot}, x^2 \rangle = 0$. Since $$h_{\Pi} + h_\bot = h,$$ we then have $$\begin{eqnarray*} \langle h_\Pi, x \rangle &=& \langle h, x \rangle, \\ \langle h_\Pi, x^2 \rangle &=& \langle h, x^2 \rangle. \end{eqnarray*}$$ That is, $$\begin{eqnarray*} \int_0^1 (ax + bx^2) x \ dx &=& \int_0^1 1 \cdot x \ dx, \\ \int_0^1 (ax + bx^2) x^2 \ dx &=& \int_0^1 1 \cdot x^2 \ dx. \end{eqnarray*}$$ This gives us the linear system of equations: $$\begin{eqnarray*} \frac13a + \frac14b &=& \frac12, \\ \frac14a + \frac15b &=& \frac13; \end{eqnarray*}$$ solving this gives $a$ and $b$.

Final steps. Using the computed values of $a$ and $b$, we can compute $h_\bot(x) = h(x) - (ax + bx^2)$. The required distance is just $$\| h_{\bot} \| = \left( \int_0^1 h_\bot(x)^2 dx \right)^{1/2}.$$

-
@ Srivatsan, this follows exactly what we did in class. Thank you so much! –  josh Nov 25 '11 at 17:04

The subspace spanned by $f_2$ and $f_3$ is simply a two dimensional vector space of quadratic equations with no free coefficient. You get that the distance of $f_1$ from $Span\{f_2,f_3\}$ is simply the distance $||f_1-Pf_1||$, where $Pf_1$ is the orthogonal projection onto that subspace.

Applying Gram-Schmidt's process to $\{f_2, f_3\}$ (with the described inner product) you get the orthogonal base $\{ x, x^2 - \frac {3}{4}x \}$.

It's now easy to calculate the projection of $f_1$ unto $span\{f_2, f_3\}$.

As with any inner product space, the projection vector minimizes the distance between the projected vector and the projection space, so it just remains to take the distance between them (if we denote the projection vector $Pf_1$, you want to calculate $\sqrt{}$).

-