This is not homework. I'm going over my lecture notes to study for an exam.
For an Abstract Elliptic Problem such as the problem with V a Hilbert Space
$$\begin{cases} \text{Find } u \in V \text{ such that} \\ a(u,v) = L(v) && \forall v\in V \end{cases}$$
where $a$ is a bounded, coercive bilinear form. $L \in V^*$. We know that by Lax-Milgram that $u$ is the unique solution
We search for approximations to $u$, $u_m \in V_m \subset V$ where $V_m$ is a finite dimensional subset of $V$.
In the Galerkin method we seek the best approximation $u_m$ of $u$ with respect to the bilinear form $a$ described above.
$$\begin{cases} \text{Find } u_m \in V_m \text{ such that} \\ a(u_m,v_m) = L(v_m) && \forall v_m\in V_m \end{cases}$$
The Galerkin orthogonality states that:
$$a(u-u_m, v_m) = 0$$
which implies that orthogonality of the error with respect to $a$. The usual proof is given as follows:
$$a(u-u_m, v_m) = a(u,v_m) - a(u_m,v_m) = L(v_m) - L(v_m) = 0$$
What I don't understand is why the two $L$s in the above are the same. Since from Riesz Representation Theorem, $L$ is the unique functional in the dual of $V$ or $V_m$, how can they possibly be equal otherwise $u=u_m$?
Edit: From comments below, the two functionals (L) are not technically operating in the same spaces. On the other hand, they both represent some inner product ($L^2$ or other) and they both produce the same result, hence equality in result without necessarily equivalance.