# Find the orthogonal projection of a function on the set of $L^2$ functions whose integrals are $0$

Given $$u\in L^2(0, 1)$$, find its orthogonal projection on $$V =\{v∈L^2(0,1):\int_0^1 v(x)\ dx=0\}$$.

For Hilbert spaces it holds a theorem about projections on a closed convex set which states that given a subset $$C$$ of an Hilber space $$H$$, $$u\in H$$, $$v\in C$$, then $$\langle u-v,g-v\rangle\le0,\ \forall\ g\in C$$, and $$v$$ is the orthogonal projecition of $$u$$ in $$C$$.

$$V$$ is closed if every sequence $$\{v_n\}\subset V$$ converges to an element of $$V$$, i.e. if $$\forall\ \phi(x)\in L^2(0,1):\lim_{n\to+\infty}\int_0^1v_n\phi=\int_0^1v\phi$$ (weak convergence).

Take $$\phi=\chi_{(0,1)}$$, then $$\int_0^1v_n\phi=\int_0^1v_n=0$$ and $$\lim_{n\to+\infty}\int_0^1v_n=\int_0^1v=0$$. Then $$V$$ is closed.

$$V$$ is convex if every convex combination of two elements of $$V$$ is still an element of $$V$$, but I don't know how to check this.

Another theorem about Hilbert spaces says that every Hilbert space splits into the direct sum of any closed subspace and its orthogonal. Statement: given a Hilbert space $$X$$, a closed subspace $$Y$$ and the map $$p$$ which sends any element $$x\in X$$ to its closest element in $$Y$$, then $$p$$ is linear, continuous, and $$x-p(x)$$ is orthogonal to $$Y$$. Moreover, if $$\{e_1,...,e_n\}$$ is an orthonormal basis of $$Y$$, then $$p(x)=\sum_1^n\langle x,e_i\rangle e_i$$.

I read that examples of orthonormal basis for $$L^2[0,1]$$ are $$\{e^{2πinx}\}$$, for $$n$$ from $$-\infty$$ to $$+\infty$$, and the Legendre polynomials. But these two basis have infinite dimension and so cannot be used to compute $$p(x)$$, right?

Any hint on how to start the exercise?

Note that $$V = \left\{ f \in L^2 : \int_0^1 fdx = 0 \right\} = [\{ 1\}]^{\perp}.$$ So $$L^2=V\oplus [\{1\}]$$. The orthogonal projection of $$f$$ onto $$[\{1\}]$$ is $$\langle f,1\rangle 1$$, and the orthogonal projection of $$f$$ onto $$V$$ is $$f-\langle f,1\rangle 1$$.

• @soundwave : $[\{1\}]$ is the linear span of the elements of $\{1\}$, and $\perp$ is the orthogonal complement. – DisintegratingByParts Nov 29 '18 at 13:42
• @soundwave : That was the standard notation I was taught for the linear span of a set of vectors. In this case it is a set with one vector, and the span consists of all scalar multiples of the constant function $1$. – DisintegratingByParts Nov 29 '18 at 19:03
• @soundwave $[\{ 1 \}]= \{ f : f =\alpha 1 \}$, which is just the one-dimensional subspace of constant functions. $[\{ 1\}]^{\perp}=\{ 1\}^{\perp}$ is the set of all functions $f$ that are orthogonal to $1$, i.e., for which $\langle f,1\rangle=\int_0^1 f(t)dt=0$. – DisintegratingByParts Nov 30 '18 at 0:30
• @soundwave : It was just my generic scalar in this comment. No connection with anything else intended. – DisintegratingByParts Nov 30 '18 at 10:23
• @soundwave Yes, $1$ is a unit vector, and $\{1\}$ is an orthonormal basis of $[\{1\}]$. So $Pf = \langle f,1\rangle 1$ is the orthogonal projection onto $[\{1\}]$. – DisintegratingByParts Nov 30 '18 at 16:57

For each $$u\in L^2\bigl((0,1)\bigr)$$,$$u=\overbrace{u-\int_0^1u(x)\,\mathrm dx}^{\in V}+\overbrace{\int_0^1u(x)\,\mathrm dx}^{\in V^\perp}$$and therefore the projection that you're after is$$u-\int_0^1u(x)\,\mathrm dx.$$

• Thank you, is $\text{Id}$ the identity function? If so, why you considered it? – sound wave Nov 28 '18 at 18:48
• Yes, $\operatorname{Id}$ is the identity function. I considered it because$$V=\left\{v\in L^2\bigl((0,1)\bigr)\,\middle|\,\langle v,\operatorname{Id}\rangle=0\right\}.$$ – José Carlos Santos Nov 28 '18 at 18:50
• @JoséCarlosSantos $\mathrm{Id}$ should be the constant function $1$ as in DisintegrationByParts's answer. I would not call it "identity function". – MaoWao Nov 28 '18 at 20:02
• @MaoWao Of course! That was a really silly mistake that I made here. I've edited my answer. Thank you. – José Carlos Santos Nov 28 '18 at 22:36

You ask "Where do I start?" and the answer to that is to look at "But these two bases have infinite dimension and so cannot be used to compute $$p(x)$$, right?" In a finite-dimensional vector space, there is only one way to add up linear combinations of basis vectors -- repeated two-vector addition. But in infinite-dimensional vector spaces, there are multiple possibilities. So, when you say, "I read that examples of orthonormal bases for $$L^2[0, 1]$$ are ...", you are implicitly referencing the definitions of linear combination (addition) used in the proofs that those two sets are bases. So make sure you understand what those definitions are. Within that context, an (infinite) basis of an infinite-dimensional vector space will act (much) like a finite-dimensional vector space.

After that, I note that $$V = \{v: v \cdot 1 = 0 \}$$ (where $$1$$ is the constant-1 function), and $$1$$ is a member of both orthonormal bases that you mention...

• Thank you, could you explain what follows from your last sentence? – sound wave Nov 29 '18 at 23:04
• At that point, we've shown that the question is "How do you remove the portion of $v$ that is a multiple of $1$ (one of the orthonormal basis vectors)?" works as it would in a finite-dimensional vector space. The other answers describe how to do that. – Dale Dec 1 '18 at 1:09