I am currently working through a section of Peter Petersen's Riemannian Geometry in which he talks about weak second derivatives of functions. I am trying to work through the details of why a function on a Riemannian manifold $(M,g)$ with non-negative Hessian in the weak sense is convex.
I understand how one can reduce the problem to the case where $M$ is the real line with the Euclidean metric by precomposing with unit speed geodesics, so I have been able to reduce the problem to the following:
Proposition: Let $f$ be a continuous function defined on an open interval in $\mathbf{R}$. We say that $f''(p)\geq 0$ in the weak sense if for every $\varepsilon>0$ there exists a smooth function $f_\varepsilon$ defined in a neighborhood of $p$ such that
(1) $f(p)=f_\varepsilon(p)$
(2) $f\geq f_\varepsilon$
(3) $f_\varepsilon''(p)\geq -\varepsilon$.
Then if $f''\geq 0$ everywhere in the weak sense, then $f$ is convex.
I have tried for a while to come up with a direction to move in from here. My ideas keep running into the problem that the definition of $f_\varepsilon$ only necessarily has nice properties in a small neighborhood of $p$.
This makes the naive approach of trying to directly apply the definition of convexity more difficult (compared to when we assume our function is actually twice differentiable). Given $x_1$, $x_2$ and $t\in(0,1)$, for example, we cannot guarantee the function $f_\varepsilon$ defined around $p=tx_1+(1-t)x_2$ is even defined at $x_1$ or $x_2$.
I have a feeling I am over-thinking this problem. I would appreciate any input/hints anyone would be willing to provide as to how I might proceed from here.
Here's an outline of what I believe to be a proof. Simpler ones may exist, but this is what I came up with. I haven't really been pedantic at all about details (as you'll see) but maybe this will give you some ideas.
Lemma. If $f'' \geq 0$ everywhere in the weak sense, then for every smooth, compactly supported function $\varphi$ on $\mathbb{R}$ with $\varphi \geq 0$, $$ \int f \varphi'' \geq 0. $$
Proof sketch. For any $\epsilon$, show that one can cover the support of $\varphi$ with finitely many disjoint half-open intervals $J_1, \dots, J_k$ such that there exists for each $1 \leq i \leq k$ a smooth function $f_i$ defined on $J_i$ and satisfying $f \geq f_i$ and $f_i'' > -\epsilon$ on $J_i$. Estimate the integral above by breaking it up into integrals over the $J_i$ and using integration by parts and the functions $f_i$.
Proposition. If $f'' \geq 0$ everywhere in the weak sense, then $f$ is convex.
Proof sketch. By adding a linear function to $f$, it suffices to show that for $a,b \in \mathbb{R}$ with $f(a) = f(b) = 0$, we have $f(t) \leq 0$ for $a < t < b$.
Suppose otherwise. Then there is $c$ with $a < c < b$ such that $f(c) = C > 0$. By the intermediate value theorem there exists $c_1, c_2$ with $a < c_1 < c < c_2 < b$ such that $f(c_1) = f(c_2) = C/4$. By continuity, the values of $f$ are close (say, within $\epsilon$) to $c$ or $c/4$ respectively within an $\eta$-neighborhood of the points $c$ and $c_1, c_2$ respectively.
One now constructs an appropriate smooth function $\psi$ supported on the $\eta$-neighborhoods of these three points, positive near $c_1$ and $c_2$ and negative near $c$, and sufficiently well-controlled so that (1) There exists a second antiderivative $\varphi$ of $\psi$ which is smooth and of compact support, and (2) The integral $\int f \varphi''$ can be estimated (and proved to be negative). Together with the lemma, this proves the proposition.