Hilbert projection theorem