I am following the book Topics in Functional analysis and applications by S. Kesavan. The text introduces the finite element method as:
Let $V$ be a real Hilbert space and let $a: V × V → \mathbb{R}$ be a $V$-elliptic and continuous bilinear form. Let $f \in V$. Then by the Lax-Milgram theorem there exists a unique $u \in V$ such that$$ a(u, v) = (f, v). \quad \forall v \in V \tag{3.7.1} $$ We have seen in Section 3.2 several examples of this set-up. We now turn to the approximation of the solution $u$. The Galerkin method described in Section 3.4 gives us an idea as to how to proceed to do this.
Let $h > 0$ be a parameter. To it we associate $V_h$ which is a finite dimensional subspace of $V$. Now consider the following problem: Find $u_h \in V_h$ such that$$ a(u_h, v_h) = (f, v_h). \quad \forall v_h \in V_h \tag{3.7.2} $$ Since $a$ is continuous and $V$-elliptic, it is so on $V_h$ as well and by the Lax-Milgram theorem, $u_h$ exists uniquely.
In Section 3.2, we have seen several examples of the program set out in Step 1 above. Thus we will have a bounded domain $\mit Ω$ and a problem set out in a space $V$ which will usually be a subspace of $H^1({\mit Ω})$ (if the problem is of the second order) or $H^2({\mit Ω})$ (for the fourth order problems).
The basic idea to construct the spaces $V_h$ is to partition the domain into smaller entities, say, triangles. Assume, for simplicity, that $\mit Ω$ is a polygonal domain. A triangulation $\mathscr{T}_h$ of $\mit Ω$ is a partition of $\mit Ω$ into triangles (i.e. “$n$”-simplices in $\mathbb{R}^n$) such that each “side” is either part of the boundary $\mit Γ$ or is a “side” of an adjacent triangle. Thus we do not allow triangles as shown in Fig. 13.
Thus we have a triangulation as follows

We denote by $K$ any generic triangle in $\mathscr{T}_h$, The “$h$” now stands for$$ h = \max_{K \in \mathscr{T}_h} \operatorname{diam}(K) $$ so that as $h → 0$ the triangles are smaller and smaller and we get a fine mesh on $\mit Ω$.
Now we say that $V_h$ must be a space of piecewise polynomials with respect to $\mathscr{T}_h$. That is we fix an integer $k$ and if $P_k$ stands for polynomials of degree $\leqslant k$ in $n$ variables, then we wish that if $v \in V_h$ then $v|_K \in P_k$ for every $K \in \mathscr{T}_h$. Thus $V_h$ is clearly finite dimensional and once $k$ is fixed, the dimension of $V_h$ can be increased by just refining the given triangulation. Thus as $h → 0$, $N(h) → ∞$.
- Can someone explain me the last paragraph of the last page where the text mentions about the subspace $V_h$ as the space of polynomials?
- What is $\left.v\right|_K$?
$\Omega$ is the domain of the PDE we're trying to solve. When they say to partition $\Omega$ into a mesh of triangles, they really mean to discretize $\Omega$ as the vertices of said triangles (call them "nodes"). They want to find an approximate solution $u_h \in V_h \subset V$ that is at least defined at every node in our discretization of $\Omega$. For points in $\Omega$ that are between nodes, $u_h$ is interpolated as a polynomial of order $k$. Thus $V_h$ (which contains $u_h$) is a space of piecewise polynomials "with respect" to the triangles $\mathscr{T}_h$. That is, each $v \in V_h$ is an entire piecewise-polynomial function defined everywhere on $\Omega$ and they use the symbol $v|_K \in P_k$ to denote the "piece" of it that is "over" (interpolates through) a specific triangle $K \in \mathscr{T}_h$. To clarify, if our mesh contains $N$ triangles then for all $\omega \in \Omega$ we have, $$ v(\omega) = \begin{cases} v|_{K_1}(\omega) \in P_k & \text{for } \omega \in K_1 \subset \Omega\\ \vdots \\ v|_{K_N}(\omega) \in P_k & \text{for } \omega \in K_N \subset \Omega \end{cases} $$