# Heat equation energy estimates

We consider the following 3D and periodic Heat equation $$\partial_t u-\Delta u=0,~~~u(0)=u_0\in L^2(\mathbb{T}^3)~~\mbox{for } (t,x)\in \mathbb{R}_+\times \mathbb{T}^3$$ Where $u(t,x)$ stands for the unknown heat at the instant $t$ and the spatial position $x$. We approximate the aformentioned Heat equation by Galerkin method as follows $$P_nu=u_n=\sum_{|k|\leq n}\hat{u}_ke^{ikx}\Rightarrow \partial_t u_n-\Delta u_n=0,~~~u_n(0)=P_nu_0\in L^2(\mathbb{T}^3)$$ By taking the inner product of the approximated Heat equation by $u_n$ we obtain $$\langle \partial_t u_n,u_n\rangle_{L^2}-\langle \Delta u_n,u_n\rangle_{L^2}=0$$ My question is how to get in a detailed and rigorous manner please the following energy estimate $$\|u\|_{L^2}+\int_0^t\|\nabla u(\tau)\|_{L^2}d\tau\leq \|u_0\|_{L^2}$$ with taking into account all details like the passage to the limit as $n$ goes to infinity and how to close the energy estimate etc (because the details are needed). Thank you in advance

Hint: integrating by part over $\mathbb{T}^{3}$, you'll find $$\frac{1}{2}\partial _{t}\left\Vert u_{n}\right\Vert ^{2}+\left\Vert \nabla u_{n}\right\Vert ^{2}=0$$ inegrating again over $(0,t)$ to find $$\frac{1}{2}\left\Vert u_{n}\right\Vert ^{2}+\int_{0}^{t}\left\Vert \nabla u_{n}\left( s\right) \right\Vert ^{2}ds=\frac{1}{2}\left\Vert u_{n}\left( 0\right) \right\Vert ^{2}$$ therefore, $u_{n}$ is bounded in $L^{2}(0,T,H^{1}(\mathbb{T}^{3}))$, use the Lions-Aubin lemma to pass to the limit.
Passing to the limit when $n$ tends to infinity: to obtain a strong convergence you can use the aubin-lion lemma or in general a compactness method; Finally: don't forget to close you energy estimate, in your case this is simple since your equation is a linear one.