Classification of (not necessarily connected) compact Lie groups I am looking for a classification of compact (not necessarily connected) Lie groups. Clearly, all such groups are extensions of a finite "component group" $\pi_0(G)$ by a compact connected Lie group $G_0$:
$\require{AMScd}$
\begin{CD}
0 @>>> G_0 @>>>  G @>p>>  \pi_0(G) @>>> 0
\end{CD}
The classification of compact connected Lie groups is familiar to me, so my question is how to classify such extensions.

UPDATE: I suspect the following is true (due to @LSpice, with my added requirement that $H$, $P$ are finite):
Hypothesis: $G$ can always be written as
$$
G= \frac{G_0 \rtimes H}{P}
$$
for finite groups $H,P$, where $P \subseteq Z(G_0 \rtimes H)$.
UPDATE 2: @LSpice has proven this below for the weaker requirement that $P$ intersects $G_0$ within $Z(G_0)$, and provided a counterexample where $P$ cannot be taken to be central.
UPDATE 3: See Improved classification of compact Lie groups for a follow-up question (which I won't write here to avoid excessive clutter.)

A less useful claim from my original question: any such $G$ can be constructed from $G_0$ in three steps:

*

*Take the direct product of $G_0$ with a finite group.


*Quotient the result by a finite subgroup of its center.


*Extend a finite subgroup of $\mathrm{Out}(G_0)$ by the result.
(Step 3 may always be is not a semidirect product in general.)
 A: $\DeclareMathOperator\U{U}$Consider the matrices $u = \begin{pmatrix}
0 & 1  \\
-1 & 0 \\
&& 0 & 1 \\
&& 1 & 0
\end{pmatrix}$ and $v = \begin{pmatrix}
0 && 1 \\
& 0 && 1 \\
-1 && 0 \\
& -1 && 0
\end{pmatrix}$.  These belong to the finite group of signed permutation matrices, so the group that they generate is finite and we call it $H$.  Put $G_0 = \left\{d(z, w) \mathrel{:=} \begin{pmatrix} z \\ & z^{-1} \\ && w \\ &&& w^{-1} \end{pmatrix} \mathrel: z, w \in \U(1)\right\}$.  Since $u d(z, w)u^{-1} = d(z^{-1}, w^{-1})$ and $v d(z, w)v^{-1} = d(w, z)$, the group $G$ generated by $G_0$, $u$, and $v$ has $G_0$ as its identity component.  Now let $G_0 \rtimes H \to G$ be any cover restricting to the inclusion $G_0 \to G$, and let $\tilde u$ be an element of $H$ whose image lies in $u G_0$; say the image is $u d(z, w)$.  Then $\tilde u^2$ maps to $(u d(z, w))^2 = u^2 = d(-1, 1)$, so $d(-1, 1) \rtimes \tilde u^2$ lies in $\ker(G_0 \rtimes H \to G)$.  If $\tilde v$ is an element of $H$ whose image lies in $v G_0$, then $\tilde v(d(-1, 1) \rtimes \tilde u^2)\tilde v^{-1}$ lies in $d(1, -1) \rtimes H$, hence does not equal $d(-1, 1) \rtimes H$.  That is, $\ker(G_0 \rtimes H \to G)$ is not central in $G_0 \rtimes H$.

What we can do is find (in general, not just for the specific example above) a finite subgroup $H$ of $G$ such that the multiplication map $G^\circ \times H \to G$ is surjective, and its kernel centralises $G^\circ$.  (In the specific example above, we could take $H = \langle u, v\rangle$.)
$\DeclareMathOperator\Ad{Ad}\DeclareMathOperator\Gal{Gal}\DeclareMathOperator\Norm{Norm}\DeclareMathOperator\Weyl{W}\DeclareMathOperator\Zent{Z}\newcommand\C{{\mathbb C}}\newcommand\R{\mathbb R}\newcommand\adform{_\text{ad}}\newcommand\scform{_\text{sc}}\newcommand\X{\mathcal X}$To prove this, I'll use a few pieces of structure theory:

*

*All maximal tori in $G$ are $G^\circ$-conjugate.

*All Borel subgroups of $G_\C$ are $G^\circ_\C$-conjugate.

*For every maximal torus $T$ in $G$, the map $\Weyl(G^\circ, T) \to \Weyl(G^\circ_\C, T_\C)$ is an isomorphism.

*If $G\scform$ and $(G_\C)\scform$ are the simply connected covers of the derived groups of $G^\circ$ and $G^\circ_\C$, then $(G\scform)_\C$ equals $(G_\C)\scform$.

*Every compact Lie group has a finite subgroup that meets every component.

I only need (4) to prove that, for every maximal torus $T$ in $G$, the map from $T$ to the set of conjugation-fixed elements of $T/\Zent(G^\circ)$ is surjective.  This is probably a well known fact in its own right for real-group theorists.
Now consider triples $(T, B_\C, \X)$ as follows:  $T$ is a maximal torus in $G$; $B_\C$ is a Borel subgroup of $G^\circ_\C$ containing $T_\C$, with a resulting set of simple roots $\Delta(B_\C, T_\C)$; and $\X$ is a set consisting of a real ray in each complex simple root space (i.e., the set of positive real multiples of some fixed non-$0$ vector).  (Sorry about the pair of modifiers "complex simple".)  I will call these 'pinnings', although it doesn't agree with the usual terminology (where we pick individual root vectors, not rays).  I claim that $G^\circ/\Zent(G^\circ)$ acts simply transitively on the set of pinnings.
Once we have transitivity, freeness is clear:  if $g \in G^\circ$ stabilises some pair $(T, B_\C)$, then it lies in $T$, and so stabilises every complex root space; but then, for it to stabilise some choice of rays $\X$, it has to have the property that $\alpha(g)$ is positive and real for each simple root $\alpha$; but also $\alpha(g)$ is a norm-$1$ complex number, hence trivial, for each simple root $\alpha$, hence for each root $\alpha$, so that $g$ is central.
For transitivity, since (1) all maximal tori in $G$ are $G^\circ$-conjugate, so (2) for every maximal torus $T$ in $G$, the Weyl group $\Weyl(G^\circ_\C, T_\C)$ acts transitively on the Borel subgroups of $G^\circ_\C$ containing $T_\C$, and (3) $\Weyl(G^\circ, T) \to \Weyl(G^\circ_\C, T_\C)$ is an isomorphism, it suffices to show that all possible sets $\X$ are conjugate.  Here's the argument that I came up with to show that they are even $T$-conjugate; I think it can probably be made much less awkward.  Fix a simple root $\alpha$, and two non-$0$ elements $X_\alpha$ and $X'_\alpha$ of the corresponding root space.  Then there are a positive real number $r$ and a norm-$1$ complex number $z$ such that $X'_\alpha = r z X_\alpha$.  Choose a norm-$1$ complex number $w$ such that $w^2 = z$.  There is then a unique element $s\adform$ of $T_\C/\Zent(G^\circ_\C)$ such that $\alpha(s\adform) = w$, and $\beta(s\adform) = 1$ for all simple roots $\beta \ne \alpha$.  By (4), we can choose a lift $s\scform$ of $s\adform$ to $(G\scform)_\C = (G_\C)\scform$, which necessarily lies in the preimage $(T_\C)\scform$ of (the intersection with the derived subgroup of) $T$, and put $t\scform = s\scform\cdot\overline{s\scform}$.  Then
$$
\alpha(t\scform) = \alpha(s\scform)\overline{\overline\alpha(s\scform)} = \alpha(s\scform)\overline{\alpha(s\scform)^{-1}} = w\cdot\overline{w^{-1}} = z,
$$
and, similarly, $\beta(t\scform) = 1$ for all simple roots $\beta \ne \alpha$.  Now the image $t$ of $t\scform$ in $G^\circ_\C$ lies in $T_\C$ and is fixed by conjugation, hence lies in $T$; and $\Ad(t)X_\alpha = z X_\alpha$ lies on the ray through $X'_\alpha$.
Since $G$ also acts on the set of pinnings, we have a well defined map $p : G \to G^\circ/\Zent(G^\circ)$ that restricts to the natural projection on $G^\circ$.  Now $\ker(p)$ meets every component, but it contains $\Zent(G^\circ)$, so it need not be finite.  Applying (5) to the Lie group $\ker(p)$ yields the desired subgroup $H$.  Note that, as requested in your improved classification, conjugation by any element of $H$ fixes a pinning, hence, if inner, must be trivial.
