\section{Semicontinuity}
\label{section:semicontinuity}

\begin{definition}[Semicontinuous]
\label{definition:semicontinuous}
    Let $X$ be a topological space, $f: X \to (-\infty, \infty]$, and $g: X \to [-\infty, \infty)$, then $f$ is \textbf{lower semicontinuous} if for each $a \in \real$, $\bracs{f > \alpha}$ is open, and $g$ is \textbf{upper semicontinuous} if for each $a \in \real$, $\bracs{f < \alpha}$ is open.
\end{definition}

\begin{proposition}[{{\cite[Proposition 7.11]{Folland}}}]
\label{proposition:semicontinuous-properties}
    Let $X$ be a topological space, then
    \begin{enumerate}
        \item For any $U \subset X$ open, $\one_U$ is lower semicontinuous.
        \item For any $f: X \to (-\infty, \infty]$ lower semicontinuous and $\alpha \ge 0$, $\alpha f$ is lower semicontinuous. 
        \item For any $f, g: X \to (-\infty, \infty]$ lower semicontinuous, $f + g$ is lower semicontinuous.
        \item For any collection $\mathcal{F} \subset (-\infty, \infty]^X$ of lower semicontinuous functions, $F = \sup_{f \in F}f$ is lower semicontinuous. 
        \item For any $f: X \to (-\infty, \infty]$ lower semicontinuous, $f$ is Borel measurable. 
    \end{enumerate}
\end{proposition}
\begin{proof}
    (1): For any $\alpha \in \real$, 
    \[
    \bracs{f > \alpha} = \begin{cases}
        \emptyset &\alpha \ge 1 \\
        U &\alpha \in [0, 1) \\
        X &\alpha < 0
    \end{cases}
    \]

    (2): If $\alpha = 0$, then $\alpha f = 0$ is continuous. If $\alpha > 0$, then for any $a \in \real$, $\bracs{\alpha f > a} = \bracs{f > a/\alpha}$ is open.

    (3): Let $a \in \real$, $x_0 \in \bracs{f + g > a}$, and $\eps \in (0, ((f + g)(x_0) - a)/2)$, then
    \[
    \bracs{f + g > a} \supset \bracs{f > f(x_0) - \eps} \cap \bracs{g > g(x_0) - \eps} \in \cn^o(x_0)
    \]

    As this holds for all $x_0 \in \bracs{f + g > a}$, $\bracs{f + g > a}$ is open by \autoref{lemma:openneighbourhood}.

    (4): For any $a \in \real$,
    \[
    \bracs{F > a} = \bigcup_{f \in \mathcal{F}} \bracs{f > a}
    \]

    is open. 

    (5): By \autoref{proposition:borel-sigma-real-generators}.
\end{proof}

\begin{proposition}
\label{proposition:semicontinuous-lch}
    Let $X$ be a LCH space and $f: X \to [0, \infty]$ be lower semicontinuous, then
    \[
    f = \sup_{\substack{\phi \in C_c(X) \\ 0 \le \phi \le f}}\phi
    \]
\end{proposition}
\begin{proof}
    Let $x \in X$ such that $f(x) > 0$ and $a \in (0, f(x))$, then $\bracs{f > a}$ is open. By \hyperref[Urysohn's lemma]{lemma:lch-urysohn}, there exists $\phi \in C_c(X; [0, a])$ such that $\phi(x) = a$ and $\supp{\phi} \subset \bracs{f > a}$. As this holds for all $a \in (0, f(x))$, 
    \[
    f(x) = \sup_{\substack{\phi \in C_c(X) \\ 0 \le \phi \le f}}\phi(x)
    \]
\end{proof}



