Problem in understanding a proof of a version of spectral theorem for self-adjoint operators on Hilbert spaces. I am trying to understand the proof of the following proposition from the lecture note given by our instructor.

$\textbf {Proposition} :$ Let $A$ be a bounded self-adjoint operator on a separable Hilbert space $\mathcal H.$ Then there exists a sequence of probability measures $(\mu_n)_{n \geq 1}$ on the Borel-$\sigma$-algebra of subsets of $X = [-\|A\|,\|A\|]$ and a unitary operator $U : \mathcal H \longrightarrow \bigoplus L^2(\mu_n)$ such that $A = U^* M U,$ where $M$ is the canonical multiplication operator on $\bigoplus L^2(\mu_n).$

For the proof, a lemma has been proved first which is the following $:$

$\textbf {Lemma} :$ Let $A$ be a bounded self-adjoint operator on  a separable Hilbert space $\mathcal H.$ Let $x_0 \in \mathcal H$ be a cyclic vector of $\mathcal H.$ Then there exists a probability measure $\mu$ on the Borel-$\sigma$-algebra of subsets of $X = [-\|A\|,\|A\|]$ and a unitary operator $U : \mathcal H \longrightarrow L^2(\mu)$ such that $A = U^*MU,$ where $M$ is the canonical multiplication operator on $L^2(\mu).$

I have understood the proof of the above lemma given in the lecture note. Now the proof of the main proposition is based on the above lemma which I didn't able to follow completely. Here it is $:$

Let $x_1 \in  \mathcal H$ with $\|x_1\| = 1.$ Let $S_1 : = \overline {\text {span} \left \{x_1,Ax_1,A^2x_1, \cdots\right \}}.$ If $x_1$ is a cyclic vector of $\mathcal H$ then we are through by the lemma. $\color {red} {\text {Otherwise}\ S_1\ \text {is an invariant subspace of}\ A.}$ Since $A$ is self-adjoint it follows that $S_1^{\perp}$ is also invariant under $A.$ Let $x_2 \in S_1^{\perp}$ with $\|x_2\| = 1.$ Let $S_2 : = \overline {\text {span} \left \{x_2,Ax_2,A^2x_2, \cdots\right \}}.$ If $x_2$ is a cyclic vector of $\mathcal H$ then again we are through by the above lemma. $\color {red} {\text {Otherwise}\ S_2\ \text {is an invariant subspace of}\ A.}$ But then $S_2^{\perp}$ is also invariant under $A$ since $A$ is self-adjoint. Continuing this argument we can get a sequence of invariant subspaces $\{S_n\}_{n \geq 1}$ of $A$ $\color {red} {\text {such that}\ S_n \perp S_m\ \text {for}\ n \neq m.}$ $\color {red} {\text {An application of Zorn's lemma then shows that}\ \mathcal H = \bigoplus S_n.}$ Then by the above lemma there exist probability measures $(\mu_n)_{n \geq 1}$ on the Borel-$\sigma$-algebra of subsets of $X = [-\|A\|,\|A\|]$ and unitary operators $U_n : S_n \longrightarrow L^2(\mu_n)$ such that $A_n = {U_n}^* M_n U_n,$ where $A_n = A \big \rvert_{S_n}$ and $M_n$ is the canonical multiplication operator on $L^2(\mu_n).$ Then $A = \bigoplus A_n$ and $M = \bigoplus M_n,$ where $M$ is the canonical multiplication operator on $\bigoplus L^2(\mu_n)$ and $U : = \bigoplus U_n$ is an unitary operator on $\mathcal H$ such that $A = U^* M U.\ \ $ $\rule{1.5ex}{1.5ex}$

In the above proof I failed to understand the portion in red.  First of all if $S_i \neq \mathcal H,$ for some $i \geq 1$ why does that imply $S_i$ is invariant under $A\ $? Secondly, it is clear that $S_{n+1} \subseteq S_n^{\perp},$ for all $n \geq 1.$ Hence $S_{n+1} \perp S_n,$ for every $n \geq 1.$ But how does it imply that $S_n \perp S_m,$ for $n \neq m\ $? Thirdly, how Zorn's lemma is applied here to conclude that $\mathcal H = \bigoplus S_n\ $?
Could anyone please help me in understanding those red marked portions in the proof? Any help in this regard would be warmly appreciated.
Thanks for your time.
 A: It seems to me that this proof is written to skip some necessary details on how the $x_i$ are selected. I will fill those in.
First let me deal with both red marked claims involving $S_i$ being an invariant subspace of $A$. This follows from the definition of $S_i$. If $y = \sum_{j = 1}^n a_j A^{n_j} x_i \in \tilde{S}_i = \operatorname{Span}\{A^n x_i: n \geq 0\}$ then clearly $Ay \in \tilde{S}_i$ also. If $y \in S_i$ then there is a sequence $y_n$ in $\tilde{S}_i$ such that $y_n \to y$. Then $Ay_n \in \tilde{S}_i \subseteq S_i$ by the above and $Ay_n \to Ay$ since $A$ is bounded. Since $S_i$ is closed this shows that $Ay \in S_i$ so that $S_i$ is $A$-invariant. That $S_i$ is a strict subspace follows from the fact that $x_i$ is not cyclic by assumption.
Next we deal with orthogonality of the spaces $S_n$ and $S_{n + k}$. The thing that is maybe not immediately clear from what is written is that one should choose $x_{n+1}$ to be orthogonal to $\bigoplus_{j \leq n} S_j$ when defining $S_{n+1}$. Then for $A^m x_{n+k} \in \tilde{S}_{n+k}$ you have that $\langle A^m x_{n+k}, A^l x_n \rangle = \langle x_{n+k}, A^{l+m} x_n \rangle = 0$. This shows that $A^m x_{n+k}$ is orthogonal to $\tilde{S}_n$ and hence to $S_n$ also. A limiting argument like in the previous paragraph using continuity of the inner product then yields the red statement.
Finally, we are left to apply Zorn's lemma to see that $H = \bigoplus S_n$. In fact, this is not automatically true without careful selection of the $x_i$. For example, consider $H = \ell^2$, $Ax = 2x$ and choose $x_i = e_{2i}$ where $e_j$ is the j-th element of the usual orthonormal basis. An element of $\bigoplus S_n$ with this definition is only non-zero in even components.
However, by Zorn's lemma, $H$ (here $H$ is again an arbitrary separable Hilbert space) has a countable orthonormal basis $\{e_i: i \geq 1\}$. Then we pick $x_n$ to be the first occurring element of this orthonormal basis that is orthogonal to $\bigoplus_{k < n} S_k$. This guarantees that $\{e_i: i \geq 1\} \subseteq \bigoplus S_j$ which implies the desired claim.
A: For the first question, if $x$ is in the set $S'_1 := $ span $\{ x_1, A x_1,... \}$ then it is clear that $A x$ is in $S'_1$. Now if $y \in S_1$ then there exists a sequence $(y_n)$ in $S'_1$ that converges to $y$. As we mentioned, $(A y_n)$ is a sequence in the span, $S'_1$. Thus, from the inequality
$$|| A y_n -A y || \leq ||A|| || y_n - y || $$
we see that $(A y_n)$ converges to $A y$ and thus, $A y$ is also in the closure of $S'_1$.
