# The $L_2$ projection

The $L_2$ projection is a simple projection of an arbitrary function $u\in L_2(\Omega)$ into a finite element space $V_h\subset L_2(\Omega)$, with $\Omega\subset\mathbb{R}^d$ a domain. Mathematically, this can be formulated as a minimisation problem as follows:

Find $u_h\in V_h$ such that $$J(u_h) := \frac{1}{2}||u_h-u||^2_{L_2(\Omega)} \quad\to\quad\min$$

As $J(\cdot)$ is convex, the solution of the above problem is the unique critical point of the above function. Using the Frechet derivative $DJ(u_h)(\cdot)=(u_h-u,\cdot)$ of the above function, the necessary optimality condition reads $$DJ(u_h)v_h = (u_h-u,v_h) = 0 \qquad\text{for all v_h\in V_h},$$ or equivalently

$$(u_h,v_h) = (u,v_h) \qquad\text{for all v_h\in V_h}.$$

Using the usual finite element method for the approximation, the corresponding discrete counterpart of this system reads $$M x = b$$ with

• $M$ the mass matrix defined by $m_{ij}=(\varphi_j,\varphi_i)$,

• $\{\varphi_i\}$ a basis of the finite element space $V_h$,

• $x$ the vector with degrees of freedom in $u_h=\sum_i x_i \varphi_i$, and

• the components of $b$ defined by $b_i = (u,\varphi_i)$.