# Question about conditional expectation as projection

I'm studying through a book on probability and measure theory, and I got stuck on the definition of conditional expectations which are presented as projections onto subspaces. Given the measure $(\Omega, \mathcal{F}, P)$ and a sub-sigma algebra $\mathcal{B} \subset \mathcal{F}$, we take the random variable $Y \in L^2(\Omega, \mathcal{F}, P)$ and define $E[Y|\mathcal{B}]$ as the projection of $Y$ to the subspace $L^2(\Omega, \mathcal{B}, P)$. However, in order to prove the projection exists, we need to establish that the subspace $L^2(\Omega, \mathcal{B}, P)$ is closed.

The brief justification for the closedness given in the book is that convergence in $L^2$ of a sequence of random variables implies that there exists a subsequence which converges almost surely. How does this imply that the subspace $L^2(\Omega, \mathcal{B}, P)$ is closed?

Apologies if the question is too elementary.

• The a.e. limit of a sequence of functions measurable wrt some complete sigma algebra is again measurable wrt that sigma algebra. The $L^2$ limit of your original sequence is necessarily this a.e. limit and is thus measurable and in particular $L^2$. – Ian Jan 12 '18 at 4:41
• I'll add that if $\mathcal{B}$ is not complete then not every a.e. limit is guaranteed to be $\mathcal{B}$-measurable. (Take a sequence consisting of just the zero function, and consider the a.e. limit $1_A$ for any nonmeasurable null set $A$.) But some a.e. limit is guaranteed to be $\mathcal{B}$-measurable. – Ian Jan 12 '18 at 19:01

An alternative way to see this, I think, is to use the general fact that $L^2(\Omega, B, P)$ is a Hilbert space. In particular, it is always complete. Since it is a subspace of $L^2(\Omega,F, P)$ (in such a way that preserves the inner produce), the fact that it is closed follows from:
Proof: Let $x_i$ be a sequence of points in $V$ converging to some $x \in H$. Thus, $\{x_i\}$ is a Cauchy sequence, so there is a $x' \in V$ so that $x_i$ converges to $x'$, because $V$ is complete. In $H$, $x_i$ converges to $x'$ and also $x$. Because of uniqueness of limits, $x' = x.$