I am studying a proof for a version of Poincaré's inequality for the Sobolev space $H^1_0(\Omega)$, where $\Omega\subseteq\{x\in\mathbb{R}^n:0<x_n<a\}$, for some $a>0$. I am trying to prove that, for any $u\in H^1_0(\Omega)$, $$\int_\Omega |u(x)|^2 dx \leq a\int_{\Omega}\left|\dfrac{\partial u}{\partial x_n}\right|dx.$$
By density, it is enough to prove this fact for $u\in C_c^{\infty}(\Omega)$. So write $x=(x',x_n)$, with $x'=(x_1,...,x_{n-1})$. We know that $$|u(x',x_n)|=\left|\int_0^{x_n} \dfrac{\partial u}{\partial x_n}(x',t)dt\right|\leq \int_0^{a} \left|\dfrac{\partial u}{\partial x_n}(x',t)\right|dt\leq \sqrt{a}\left(\int_0^{a} \left|\dfrac{\partial u}{\partial x_n}(x',t)\right|^2dt\right)^{1/2},$$ by Holder's inequality. Hence $$|u(x',x_n)|^2\leq a \int_0^{a} \left|\dfrac{\partial u}{\partial x_n}(x',t)\right|^2dt.$$ Now the idea is to integrate first with respect to $x_n$ and then with respect to $x'$ and this is what I can not do properly.
Integrating the equality with respect to $x_n$, we get $$\int_0^{a} \left|u(x',x_n)\right|^2dx_n\leq a^2 \int_0^{a} \left|\dfrac{\partial u}{\partial x_n}(x',t)\right|^2dt.$$ Now the author of the proof claims that integrating with respect to $x'$ yields $$\int_\Omega |u(x)|^2dx\leq a^2 \int_\Omega\left|\dfrac{\partial u}{\partial x_n}(x)\right|^2 dx,$$ as desired. And I do not see why this is true; I understand that we integrates and then uses Fubini but it looks like he says that the "strip" where $x_n$ lives is $(0,a)$ but that need not be true, right? I would write something like $$\int_\Omega |u(x)|^2dx=\int_{\Omega_{x'}}\left( \int_{\Omega_{x_n}}|u(x',x_n)|^2 dx_n\right)dx' \leq \int_{\Omega_{x'}}\left( \int_0^a|u(x',x_n)|^2 dx_n\right)\leq a^2\int_{\Omega_{x'}}\left( \int_0^a\left|\dfrac{\partial u}{\partial x_n}(x)\right|^2 dx_n\right)$$ and now I don't know how to make the integral in $\Omega$ appear on the right handside.
I would really appreciate some hint on how to conclude! Thank you!