I am doing the exercises in Do Carmo's "Riemannian Geometry". I am stuck on exercise 3.12 which states the following:
Let $M$ be a compact orientalbe Riemannian manifold which is also connected. Let $f$ be a differentiable function on $M$ with $\Delta f \geq 0$. Then $f = const$.
A hint is given to take $X = gradf$ and applying stokes theorem to get $$\int_M \Delta f \, \nu \, = \, \int_{\partial M} i(X) \nu = 0$$ where $\nu$ is the volume form and $i(X) \nu$ is the interior product of $X$ and $\nu$.
From that we can conclude that $\Delta f = 0$. By applying a similar argument to the function $\frac{f^2}{2}$ and using an identity for the laplacian of the multiplication of two functions we get that $grad f = 0$. Then by connectedness of M we conclude that $f$ is constant.
I have two questions about the proof.
Why is the second integral over the boundary of $M$ zero? Do we assume that the manifold is without boundary?
Why isn't the function $f(x, y) = x$, defined on the unit ball in $\mathbb{R^2}$ (with or without boundary) a counterexample? Clearly $\Delta f = 0$ and it is differentiable. The unit ball is clearly compact and connected and it has orientation and metric induced from $\mathbb{R^2}$, so where am I mistaken?
Thank you.
For compact manifolds the boundary is usually assumed to be empty unless stated otherwise. This should answer both questions. (As you figured out yourself the statement is not true otherwise).
(Note: a (differentiable) manifold, by definition, is locally homeomorphic (diffeomorphic) to an open neighbourhood of $\mathbb{R}^n$. This is not true for manifolds with boundary. For those you need to introduce a different kind of chart. So by definition, a manifold does not have a boundary).