Averaging the mass of a Sobolev function $f\in W^{1,p}(\Omega)$ near $\partial\Omega$ Recently, I asked a somewhat related question here. In the comment section, I found the formula
$$
\lim_{r\to 0}\frac{1}{r}\int_{\Omega_r} f(x)\,dx = \int_{\partial \Omega}f(\sigma)\,d\mathcal{H}^{n-1}(\sigma),
$$
where $\Omega_r=\{x\in\Omega: \text{dist}(x,\partial\Omega)<r \}$ is the ring of thickness $r>0$ near the boundary of a (bounded) Lipschitz domain $\Omega\subset \Bbb R^n$. It appears that the formula holds at least for all $f\in C(\overline\Omega)$.
Question: Does similar formula hold for $f\in W^{1,p}(\Omega)$ ? In particular, do we have
$$
\lim_{r\to 0}\frac{1}{r}\int_{\Omega_r} |f(x)|^p\,dx = \int_{\partial \Omega}|f(\sigma)|^p \,d\mathcal{H}^{n-1}(\sigma) ?
$$
Of course, $f$ on the right-hand side should be thought of as the trace of $f$ in $L^p(\partial\Omega)$.

I notice that the coarea formula  almost gives us the result. If I let $d(x) := \text{dist}(x,\partial\Omega)$, then the coarea formula implies that
$$
\int_{\Omega_r} |f(x)|^p\,dx = \int_0^r \int_{\{d=t\}} |f(\sigma)|^p \,d\mathcal{H}^{n-1}(\sigma) \,dt
$$
hence it follows that
$$\lim_{r\to 0}\frac{1}{r}\int_{\Omega_r} |f(x)|^p\,dx = \int_{\{d=0\}} |f(\sigma)|^p \,d\mathcal{H}^{n-1}(\sigma) = \int_{\partial\Omega} |f(\sigma)|^p \,d\mathcal{H}^{n-1}(\sigma) 
$$
if we know that $t\mapsto \int_{\{d=t\}} |f(\sigma)|^p \,d\mathcal{H}^{n-1}(\sigma) $ is approximately continuous at $t=0$, which I do not know.

Edit: I forgot to mention that I assume $p<n$ otherwise the solution follows easily from the first formula (and Morrey's theorem).
 A: In Evans & Gariepy's "Measure theory and fine properties of functions", Sec. 5.3., they construct the trace operator on a bounded Lipschitz domain $\Omega$ for BV-functions (and thus by inclusion for the subspaces $W^{1,p}$) in a similar fashion, using averages. In their case, they simply consider each part of the boundary locally as a graph $x_n = \gamma(x_1,...,x_{n-1})$ and then average vertically in the form
$$Tf(x_1,...,x_{n-1}) = \lim_{r\to 0} \frac{1}{r}\int_0^r f(x_1,...,x_{n-1},\gamma(x_1,...,x_{n-1}))dr$$
but your construction should be close enough to allow for a similar proof.
They also prove the useful theorem 2 which says that for $\mathcal{H}^{n-1}$-almost all $x\in \partial \Omega$ we have
$$\lim_{r\to 0} \frac{1}{|B_r(x) \cap \Omega|} \int_{B_r(x) \cap \Omega} |f-Tf(x)| dy = 0 $$
which also might be helpful.
A: To add on the answer provided by mlk: I think the result can be more directly using Section 4.3 of Evans and Gariepy (revised edition).
First note that $f\in W^{1,p}(\Omega) \implies |f|^p \in W^{1,1}(\Omega)$, if $1\leq p$. So it suffices to prove it for the case $p = 1$. Now, in Section 4.3 of E&G you find:

Theorem 4.6 (part ii)
Let $\Omega$ be bounded with $\partial\Omega$ Lipschitz, and $1 \leq p < \infty$, and let $T:W^{1,p}(\Omega) \to L^p(\partial\Omega; \mathcal{H}^{n-1})$ be the trace operator. Then for all $\phi\in C^1(\mathbb{R}^n; \mathbb{R}^n)$ and $f\in W^{1,p}(\Omega)$,
$$ \int_\Omega f ~\mathrm{div}(\phi)~dx = - \int_\Omega Df\cdot \phi~dx + \int_{\partial\Omega} (\phi\cdot\nu) Tf~d\mathcal{H}^{n-1} $$
with $\nu$ the outward normal to $\Omega$.

You should be able to prove that you want by choosing an appropriate $\phi$ and possibly mollifying. For example, if you let $U_r = \Omega \setminus \Omega_r$ and set $\phi = \frac1{2r} D( \mathrm{dist}(\cdot, U_r)^2)$, you find that for all sufficiently small $r$ the function $\phi$ is Lipshitz continuous, and that $\mathrm{div}(\phi) \approx \frac{1}{r} \mathbf{1}_{\Omega_r}$.
