Given $K\subset \mathbb{R}$ compact, we consider a regular function $f:K^n\to \mathbb{R}$ whose mean value is $0$. I was wondering if we can get the inequality $ n\|f\|_{L^q(K^n)}\leq C \sum_{i=1}^n\|\nabla_{x_i}f\|_{L^2(K^n)}$ for some $C$ that only depends on $K$ (not on $n$), where $q$ satisfies $1/q=1/2-1/n.$
I suppose that if this is true, it should be a consequence of applying Sobolev inequality . However, the constant here depends on $n$.
This is false.
Take $f(x_1,\dots,x_n) = g(x_1)\,\dots g(x_n)$ with $g$ with $0$ mean and with $\|g\|_{L^2} = 1$, $\|g\|_{L^q} > 1$ and $\|\nabla g\|_{L^2} < \infty$. Then your inequality would imply that for every $n\in\Bbb N$, $$ n \,\|g\|_{L^q(K)}^n \leq C\,\sum_{j=1}^n \|\nabla g\|_{L^2(K)} = C\,n\, \|\nabla g\|_{L^2(K)} $$ and so $$ \|g\|_{L^q(K)}^n \leq C\, \|\nabla g\|_{L^2(K)}. $$ Letting $n\to\infty$ gives $\|g\|_{L^q(K)}^n\to\infty$ contradicting the fact that $\|\nabla g\|_{L^2}<\infty$.