I'm reposting this question from math.stackexchange, as I haven't got answers so far.
At the beginning of "Brenier, Y. (1987) Décomposition polaire et réarrangement monotone des champs de vecteurs. C. R. Acad. Sci. Paris S´er. I Math. 305, no. 19, 805–808", there is: $\int_{K}\nabla{f} \cdot \overrightarrow{w} = 0$ for any $f \in C^1\left(K\right)$, where $K$ is a compact subspace of $\mathbb{R}^N$ and $\overrightarrow{w}:K\mapsto K$.
The author concludes that $div\left(\overrightarrow{w}\right)=0$ on $K$ and that on $\partial K$, $\overrightarrow{w}.\overrightarrow{n} = 0$. (I'm oversimplifying a bit, it's not actually $K$ but an open set whose $K$ is the closure)
I've only got, from divergence theorem, that $\oint f\overrightarrow{w} \partial\overrightarrow{S} =-\int f div\left(\overrightarrow{w}\right)$.
How can I prove the two properties on $w$?
An idea: building a serie of C1 functions that are converging to the indicator of $div\left(\overrightarrow{w}\right)$ support but can be virtually anything on the frontier, which would prove the second formula, then doing the same thing on the frontier to prove the divergence formula. If it can work, how can it be written rigorously?