I am currently reading the review article Continuous cohomology of groups and classifying spaces, by Stasheff (doi:10.1090/S0002-9904-1978-14488-7), on continuous group cohomology. On page 552, it is said that $BK\simeq BG$, where $K$ is the maximal compact subgroup of the Lie group $G$. I am curious about is it true in general even if $G$ is non-compact. I don't know how to prove it. Maybe it can be shown by using Milnor's construction somehow or using spectral sequences. Is there any good reference on it? I tried to search by using keywords but in vain.
Thanks in advance!
A connected Lie group $G$ is diffeomorphic to $K\times\mathbb{R}^d$ for some $d$ where $K$ is a maximal compact subgroup of $G$. This was proved by Élie Cartan in the semisimple case, and independently by Malcev and Iwasawa in the general case; see this MathOverflow question. It follows that $G$ is homotopy equivalent to $K$ and therefore $BG$ is homotopy equivalent to $BK$.