Let $u$ be a upper semicontinuous function on a compact set $K$ in $\mathbb R^d$. Define a space of continuous function dominating $u$ by
$$A = \{\phi \in C(K): \phi \ge u\}.$$
[Q.] Is the following inequality true?
$$\inf\_{\phi \in A} \int\_K (\phi - u) dx = 0?$$


It seems true, if $d = 1$. Indeed, one can simply take linear interpolation from each discontinuous point of $u$ to its small neighborhood. However, I do not have idea when $d\ge 2$. Does it related to the geometry of discontinuous set of $u$?



Continuous upper envelope of upper semicontinuous function
The equality is true, independently of $d$.


By Theorem 2.1.3 of Ransford's book "Potential theory in the complex plane", since $u$ is bounded above on the compact set $K$, there is a decreasing sequence of continuous functions $f\_n$ that converge pointwise to $u$. 


Then, by the monotone convergence theorem,
$$\lim\_n\int f\_ndx=\int udx.$$


