Finite Element Theorem help There is a general theorem (Ciarlet for example) that:
For $v$ in a finite dimensional space $V_{h}$, and for an element $K$, $v|_{K} \in H^{1}(K)$ for all $K$ and $v \in C^{0}(\bar{\Omega})$ implies $v \in H^1(\Omega)$. My attempt at understanding this proof starts with the fact that $v \in C^0(\bar{\Omega})$ means $v \in L^{2}(\Omega)$. But the next part of the proof, in Ciarlet anyway, simply states we need to show the weak derivatives of $v$ exist. Don't we need them to be in $L^{2}$ as well? (this isn't stated as a requirement in the proof). Can someone walk me through this (or fill in the missing detail(s) that I'm not seeing)?
 A: If you show that the weak derivative of $v$ exists, you also show
$$(\nabla v)|_K = \nabla (v|_K).$$
Since the right-hand side is in $L^2(K)$ and since there are only finitely many $K$, you have $\nabla v \in L^2(\Omega)$.
A: Lemma (see Lemma 5.3 from Peter Monk's book Finite elements method for Maxwell's equations)
Suppose $K_1$ and $K_2$ are two nonoverlaping Lipschitz domains meeting at a common surface $\Sigma$ (with non zero measure) so that $\overline K_1\cap \overline K_2=\Sigma$. Suppose $u_1\in H^1(K_1)$ and $u_2\in H^1(K_2)$ and define $u\in L^2(K_1\cup K_2\cup \Sigma)$ by 
$$u=\left\{
\begin{array}{}
u_1 \text{ on } K_1\\
u_2 \text { on } K_2
\end{array}
\right.$$
Then if $u_1=u_2$ on $\Sigma$ we have $u\in H^1(K_1\cup K_2\cup \Sigma)$.
Proof: (it is skipped in the book)
You want to prove that $$\int\limits_{K_1\cup K_2}{u\frac{\partial \varphi}{\partial x_i}dx}=-\int\limits_{K_1\cup K_2}{g\varphi dx},\,\forall \varphi\in C_0^\infty (K_1\cup K_2\cup\Sigma)$$ for some $g\in L^2(K_1\cup K_2)$ which would be the weak derivative of $u$ in $K_1\cup K_2$ (here I omit the $\Sigma$ in the integration limits, because it is of measure $0$). Let us denote by $n_i^1,\,n_i^2$ the $i-$th component of the normal vector to the boundary of $K_1$ and $K_2$ respectively. By the definition of $u$ we have:
$$\int\limits_{K_1\cup K_2}{u\frac{\partial \varphi}{\partial x_i}dx}=\int\limits_{K_1}{u_1\frac{\partial \varphi}{\partial x_i}dx}+\int\limits_{K_2}{u_2\frac{\partial \varphi}{\partial x_i}dx}=\text {(by parts) }$$
$$=-\int\limits_{K_1}{\frac{\partial u_1}{\partial x_i}\varphi dx}+\int\limits_{\partial K_1}{u_1\varphi n_i^1 ds}-\int\limits_{K_2}{\frac{\partial u_2}{\partial x_i}\varphi dx}+\int\limits_{\partial K_2}{u_2\varphi n_i^2 ds}$$
$$=-\int\limits_{K_1}{\frac{\partial u_1}{\partial x_i}\varphi dx}-\int\limits_{K_2}{\frac{\partial u_2}{\partial x_i}\varphi dx}+\underbrace{\int\limits_{\Sigma}{u_1\varphi n_i^1 ds}+\int\limits_{\Sigma}{u_2\varphi n_i^2 ds}}_{=0}=-\int\limits_{K_1\cup K_2}{g\varphi dx}$$
where $$g=\left\{
\begin{array}{}
\frac{\partial u_1}{\partial x_i} \text{ on } K_1\\
\frac{\partial u_2}{\partial x_i} \text { on } K_2
\end{array}
\right.$$
and $g\in L^2(K_1\cup K_2)$ because $\frac{\partial u_j}{\partial x_i}\in L^2(K_j),\,j=1,2$. The term in the underbrace is $0$ because $n_i^1=-n_i^2$ and by assumption $u_1=u_2$ on $\Sigma$, $\varphi\in C_0^\infty (K_1\cup K_2\cup \Sigma)$. Also the surface integrals on $\partial K_j\setminus \Sigma$ are $0$, because $\varphi$ is zero there.
Now for your problem: Using the above lemma, it is enough to show that $v\in H^1(K_1\cup K_2)$ for arbitrary $K_1$ and $K_2$ from the triangulation (take $u_1=v$ on $K_1$ and $u_2=v$ on $K_2$), because then you get $v\in H^1(K_1\cup K_2)$ and you can apply the lemma again for $K_1\cup K_2$ and $K_3$ and so on until you cover the whole domain (only finite number of elements $K$).
