For a measure space (X,Σ,μ)(X,\Sigma,\mu), the complex Hilbert space L2(X,μ)L^2(X,\mu) consists of measurable f:X→Cf:X\to\mathbb C with ∫∣f∣2 dμ<∞\int |f|^2\,d\mu<\infty, identified modulo almost-everywhere equality, with

⟨f,h⟩=∫Xfh‾ dμ,∥f∥2=(∫X∣f∣2 dμ)1/2.\langle f,h\rangle=\int_X f\overline h\,d\mu, \qquad \|f\|_2=\left(\int_X|f|^2\,d\mu\right)^{1/2}.

The inner product here is linear in its first argument. Completeness is the p=2p=2 case of completeness of .

Probability spaces

If μ(X)=1\mu(X)=1, then 1∈L21\in L^2, ∥1∥2=1\|1\|_2=1, and L∞⊆L2⊆L1L^\infty\subseteq L^2\subseteq L^1. The orthogonal complement of constants is the space of mean-zero observables.

Finite example

On a uniform nn-point space this is Cn\mathbb C^n with ⟨z,w⟩=n−1∑jzjwj‾\langle z,w\rangle=n^{-1}\sum_j z_j\overline{w_j}. As a Hilbert space it has dimension nn; the separate function algebra on the same set uses coordinatewise multiplication.