In the Averson's book, in the proof of the Von Neumann's Bicommutant theorem there is this passage: ($A $ is a self-adjoint algebra of operators in $L(H)$) "Let $\xi_1$ be an element of the Hilbert space $H$ and let $P$ be the projection onto the closed subspace $[A\xi_1 ]$. Note first that $P$ commutes with $A$. Indeed the range of $P$ is invariant under $A$; since $A=A^\ast$, so is the range of $P^\perp=I-P$ and this implies $P\in A'$"
I didn't understand how is used the self-adjointness of $A$ in order to prove that $P^\perp$ have invariant range.
When we have proved that the ranges of $P$ and $P^\perp$ are invariant i.e. $AP(H)=P(H)$ and the same with $P^\perp$ how can we conclude that $P \in A'$ (the commutant of $A$)?
Let's first check that $P^\perp$ has invariant range. Let $a \in A$ and let $\eta \in [A\xi_1]^\perp = (A\xi_1)^\perp$. Then, for any $b \in A$, $$ \langle a\eta, b\xi_1 \rangle = \langle \eta, a^\ast b \xi_1 \rangle = 0, $$ where $a^\ast b \in A$ and hence $a^\ast b \xi_1 \in A\xi_1$ precisely because $A$ is a self-adjoint algebra of operators in $B(H)$, which is to say, it is a $\mathbb{C}$-subalgebra of the $\mathbb{C}$-algebra $B(H)$ closed under taking adjoints—in contemporary terminology, $A$ is a $\ast$-subalgebra of $B(H)$.
Now, let's check that $P \in A^\prime$. Fix $a \in A$. For any $\xi \in H$, $$ P(a\xi) + (I-P)(a\xi) = a\xi = aP\xi + a(I-P)\xi;$$ since $[A\xi_1] = PH$ and $[A\xi_1]^\perp = (I-P)H$ are $A$-invariant, $aP\xi \in [A\xi_1]$ and $a(I-P) \in [A\xi_1]^\perp$, so that by uniqueness of the decomposition of $a\xi$ into the sum of a vector in $[A\xi_1]$ and a vector in $[A\xi_1]^\perp$, $$ Pa\xi = aP\xi, \quad (I-P)a\xi = a(I-P)\xi. $$ In particular, then, $Pa = aP$ since $\xi \in H$ was arbitary. Thus, $P$ commutes with every element of $A$.