Unresolved issues on Vitali-Caratheodory Theorem from RCA Rudin I have following issues with Rudin's proof of subject theorem. Statement and proof from RCA Rudin:

Which measureable sets $E_i$ is Rudin talking about is not clear. My understanding is. For $t_n$
$t_n(x)=2^{-n}\chi_{A_1}(x)+\Sigma_1^{2^{n}}(j-1)2^{-n}\chi_{B_j}(x)+\chi_{A_2}(x)$
Where
$A_1=\{x|f(x)<n-1,t_n(x)=2^{-n}\}$
$B_j=\{x|n-1\le f(x)<n,t_n(x)=(j-1)2^{-n}\}$
$A_2=\{x|f(x)\ge n,t_n(x)=1\}$
All above sets are measurable as they are inverse images of measurable sets under a measureable function.
$f$ being $\Sigma_1^{\infty}t_n(x)$ will be a sum of charecteristic functions of measurable sets.
Another issue is that Rudin states $\chi_{K_i}$ to be upper semicontinuous. However upper semicontinuosness of charecteristic functions was established only in case of closed sets, whereas $K_i$ are compact sets. How does it follow for compact sets.

Thanks.
 A: I would attempt to answer my own question here. Rudin states that $t_n$ is a linear combination of characteristic functions. First the definitions:
$Def: \varphi_n(x)=\begin{cases}
\lfloor{2^nx}\rfloor{2^{-n}}, & \text{if $0\le x<n$}\\
n, & \text{if $n\le x \le \infty$}
\end{cases}$
$Def: s_n(x)=\varphi_n\circ f(x), n\ge 1, s_{0}(x) = 0\\
Def: t_n(x) = s_n(x) - s_{n-1}(x), n \ge 1$
We consider the following cases:
$\mathbf I. {f(x)<n-1}$
$\phantom{{}++{}} \varphi_{n-1}(f(x)) = \lfloor 2^{n-1}f(x) \rfloor 2^{-n+1}$
$\phantom{{}++{}} \varphi_{n}(f(x)) = \lfloor 2^{n}f(x) \rfloor 2^{-n}$
$\phantom{{}++{}} \varphi_{n-1}(f(x))\le f(x)<\varphi_{n-1}(f(x))+2^{-n+1}$ using the definition of floor function
$\phantom{{}++{}} \varphi_{n}(f(x))\le f(x)<\varphi_{n}(f(x))+2^{-n}$ same as above.
We have $\varphi_{n}(f(x))=K_n2^{-n}$and $\varphi_{n-1}(f(x))=K_{n-1}2^{-n+1}$ where $K_n$ and $K_{n-1}$ are non-negative integers. so we have
$\phantom{{}++{}} K_n\le 2^n f(x)<K_n+1$
and
$\phantom{{}++{}} 2K_{n-1}\le 2^n f(x)<2K_{n-1}+2$
$\phantom{{}++{}} \Longrightarrow$
$\phantom{{}++{}} K_n\ge2K_{n-1}\Longrightarrow K_n - 2K_{n-1} \ge 0$
and
$\phantom{{}++{}} K_n + 1 \le 2K_{n-1} + 2 \Longrightarrow K_n-2K_{n-1} \le1$
i.e.
$\phantom{{}++{}} 0 \le K_n-2K_{n-1} \le 1$
as $K_n-2K_{n-1}$ is an integer, we have
$\phantom{{}++{}} K_n-2K_{n-1} = \begin{cases}
\phantom{{}++{}} 0, & \text{$K_n = 2K_{n-1}$}\\
\phantom{{}++{}} 1, & \text{$K_n = 2K_{n-1} + 1$}\\
\end{cases}$
i.e.
$\phantom{{}++{}} K_n2^{-n}-K_{n-1}2^{-n+1} = \begin{cases}
\phantom{{}++{}} 0, & \text{$K_n = 2K_{n-1}$}\\
\phantom{{}++{}} 2^{-n}, & \text{$K_n = 2K_{n-1} + 1$}\\
\end{cases}$
i.e.
$\phantom{{}++{}} \varphi_{n}(f(x))-\varphi_{n-1}(f(x)) = \begin{cases}
\phantom{{}++{}} 0, & \text{$K_n = 2K_{n-1}$}\\
\phantom{{}++{}} 2^{-n}, & \text{$K_n = 2K_{n-1} + 1$}\\
\end{cases}$
i.e.
$\phantom{{}++{}} \varphi_{n}(f(x))-\varphi_{n-1}(f(x))= \begin{cases}
\phantom{{}++{}} 0, & \text{$2k \le 2^nf(x) < 2k + 1$}\\
\phantom{{}++{}} 2^{-n}, & \text{$2k+1 \le 2^nf(x) < 2k + 2$}\\
\end{cases}$
Where $0 \le k < 2^{n-1}(n-1)$ as $k=\lfloor 2^{n-1}f(x) \rfloor$
So
$\phantom{{}++{}} t_n(x) = 2^{-n}\chi_{A}(x)$
Where $A = \{x|(f(x)<n-1) \wedge (2k+1 \le 2^n f(x) < 2k+2) \}$
$\mathbf {II}. n-1 \le f(x)< n$
$\phantom{{}++{}} t_n(x) = 2^{-n}\lfloor 2^{n}f(x) \rfloor - n +1 \\
 \phantom{{}++++{}} = k2^{-n}, k < 2^{n}, k \in \mathbf {I^+} \\
 \phantom{{}++++{}} = k2^{-n} \chi_{B_k}(x) \\
 \phantom{{}++{}} \text{where } B_k = \{x|k2^{-n} \le f(x)-n+1 < (k+1)2^{-n}\}, k < 2^{n}, k \in \mathbf {I^+}$
$\mathbf {III}. f(x) \ge n \\
\phantom{{}++{}} \varphi_{n-1}(f(x)) = n-1 \\
\phantom{{}++{}} \varphi_{n}(f(x)) = n \\
\phantom{{}++{}} t_n(x) = \varphi_{n}(f(x)) - \varphi_{n-1}(f(x)) = 1 \\
\phantom{{}++{}} = \chi_{C}(x), \\
\phantom{{}++{}} \text{where }C = \{x|f(x) \ge n\}$
Combining above three cases, we get $$t_n(x) = 2^{-n}\chi_{A}(x) + \sum_{k=0}^{2^n-1}k2^{-n}\chi_{B_k}(x) + \chi_{C}(x)$$. With $A$, $B$ and $C$ defined as above. Hence each $t_n$ is a linear combination of characteristic functions. Sets $A$, $B$ and $C$ are measurable as they are inverse images of measurable sets under a measurable function.
$$f(x) = \lim_{n \to \infty}s_n(x) = \lim_{n \to \infty}\sum_{i=1}^n t_i(x) = \sum_{i=1}^\infty t_i(x) \text { implies}$$
$$f(x) = \sum_{i=1}^\infty c_i\chi_{E_i}(x) \text { where } E_i \text { are measurable sets.}$$
Rudin further states that $$\sum_{i=0}^N\chi_{K_i}$$ is upper semicontinuous. I had overlooked the fact that Rudin is talking about euclidean spaces. So compactness of $K_i$ implies that it is a closed set. Everything else follows.
A: Focusing on the second part of your question, note that compact subsets of Hausdorff spaces are closed. This is an easy corollary of Theorem 2.5 in the Rudin's book you cited and given there explicitly.
Hence you do not need to limit your considerations to Euclidean spaces in Theorem 2.25 you mentioned.
