Artificial intelligent assistant

Show that $U(f - Ug) = U( Uf - Ug) \leq U(f-g).$ Let $X$ be a metric space. For any real-valued function $f:X\rightarrow \mathbb{R}$, we define its upper semicontinuous envelope $Uf$ as follows: For each $x \in X,$ $Uf(x)=\inf \\{ \sup_{y \in V} f(y): V \text{ is a neighbourhood of } x\\}.$ Prove that for any two bounded real-valued functions $f,g$ defined on $X$, $U(f - Ug) = U( Uf - Ug) \leq U(f-g).$ My attempt: Since $f \leq Uf$, by monotonicity, we have $U(f-Ug) \leq U(Uf - Ug).$ However, I fail to see why the reverse inequality $U(f-Ug) \geq U(Uf - Ug)$ and the inequality $U(Uf - Ug) \leq U(f-g)$ hold. Any hint would be appreciated.

Fix $x\in X$ and $\varepsilon>0$. There exists a neighborhood $V$ of $x$ such that $$U(f-Ug)(x)\ge\sup_V(f-Ug)-\varepsilon.$$ Let $y\in V$ be such that $$U(Uf-Ug)(x)\le\sup_V(Uf-Ug)\le Uf(y)-Ug(y)+\varepsilon.$$ Now taking a neighborhood $W$ of $y$ (assuming without loss of generality that $W\subset V$) such that $$Ug(y)\ge\sup_W g-\varepsilon$$ we find that $$U(Uf-Ug)(x)\le\sup_Wf-\sup_Wg+2\varepsilon\le\sup_W(f-g)+2\varepsilon$$ where the last inequality uses $\sup_A(F+G)\le\sup_AF+\sup_AG$. Finally, take $z\in W$ such that $\sup_W(f-g)\le f(z)-g(z)+\varepsilon$ to find $$U(Uf-Ug)(x)\le f(z)-g(z)+3\varepsilon\le f(z)-Ug(z)+3\varepsilon\le\sup_V(f-Ug)+3\varepsilon$$ and put it all together to conclude $$U(Uf-Ug)(x)\le U(f-Ug)(x)+4\varepsilon.$$

The inequality now becomes simple by monotonicity: $$U(f-Ug)\le U(f-g).$$

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 662bcf53564a73027a5193fd320bd5ce