[proofplan]
We regard $\mathfrak g$ as a module over itself through the adjoint representation. [Weyl's complete reducibility theorem](/theorems/3755) decomposes this finite-dimensional adjoint module into simple submodules, and the adjoint submodules are exactly ideals of $\mathfrak g$. We then prove that distinct summands commute, which turns the vector-space direct sum into a Lie-algebra direct sum and also shows that each summand is simple as a Lie algebra.
[/proofplan]
[step:Handle the zero Lie algebra by the empty direct sum]
If $\mathfrak g = 0$, then
\begin{align*}
\mathfrak g = \bigoplus_{i=1}^{0} \mathfrak g_i
\end{align*}
is the empty direct sum. Thus assume for the rest of the proof that $\mathfrak g \neq 0$.
[/step]
[step:Decompose the adjoint module into simple submodules]
Define the adjoint representation
\begin{align*}
\operatorname{ad}: \mathfrak g &\to \mathfrak{gl}_F(\mathfrak g) \\
x &\mapsto \operatorname{ad}_x,
\end{align*}
where $\operatorname{ad}_x: \mathfrak g \to \mathfrak g$ is the $F$-[linear map](/page/Linear%20Map) given by
\begin{align*}
\operatorname{ad}_x(y) = [x,y].
\end{align*}
Since $\mathfrak g$ is finite-dimensional and semisimple over a field of characteristic $0$, Weyl's Theorem on Complete Reducibility applies to the finite-dimensional $\mathfrak g$-module $\mathfrak g$ under the adjoint action (citing a result not yet in the wiki: Weyl's Theorem on Complete Reducibility). Hence there exist nonzero simple $\mathfrak g$-submodules $\mathfrak g_1,\dots,\mathfrak g_r \subset \mathfrak g$ such that
\begin{align*}
\mathfrak g = \mathfrak g_1 \oplus \cdots \oplus \mathfrak g_r
\end{align*}
as $F$-vector spaces.
[guided]
The point of introducing the adjoint representation is that its invariant subspaces are exactly the ideals of $\mathfrak g$. We define
\begin{align*}
\operatorname{ad}: \mathfrak g &\to \mathfrak{gl}_F(\mathfrak g) \\
x &\mapsto \operatorname{ad}_x,
\end{align*}
where $\operatorname{ad}_x: \mathfrak g \to \mathfrak g$ is the $F$-linear map
\begin{align*}
\operatorname{ad}_x(y) = [x,y].
\end{align*}
Thus $\mathfrak g$ becomes a $\mathfrak g$-module whose underlying [vector space](/page/Vector%20Space) is the Lie algebra itself.
We now apply Weyl's Theorem on Complete Reducibility (citing a result not yet in the wiki: Weyl's Theorem on Complete Reducibility). Its hypotheses are satisfied because $\mathfrak g$ is semisimple, finite-dimensional, and defined over a field of characteristic $0$, and the adjoint module $\mathfrak g$ is finite-dimensional. Therefore the adjoint module splits as a direct sum of simple $\mathfrak g$-submodules. Hence there are nonzero simple $\mathfrak g$-submodules $\mathfrak g_1,\dots,\mathfrak g_r \subset \mathfrak g$ such that
\begin{align*}
\mathfrak g = \mathfrak g_1 \oplus \cdots \oplus \mathfrak g_r
\end{align*}
as $F$-vector spaces.
[/guided]
[/step]
[step:Identify the simple submodules as ideals of $\mathfrak g$]
For each $i \in \{1,\dots,r\}$, the subspace $\mathfrak g_i$ is stable under the adjoint action of every $x \in \mathfrak g$. Hence
\begin{align*}
[x,y] \in \mathfrak g_i
\end{align*}
for all $x \in \mathfrak g$ and all $y \in \mathfrak g_i$. Therefore
\begin{align*}
[\mathfrak g,\mathfrak g_i] \subset \mathfrak g_i,
\end{align*}
so $\mathfrak g_i \trianglelefteq \mathfrak g$.
[guided]
Fix $i \in \{1,\dots,r\}$. Since $\mathfrak g_i$ is a $\mathfrak g$-submodule of the adjoint module, it is invariant under every operator $\operatorname{ad}_x$ with $x \in \mathfrak g$. This means that for every $x \in \mathfrak g$ and every $y \in \mathfrak g_i$,
\begin{align*}
\operatorname{ad}_x(y) = [x,y] \in \mathfrak g_i.
\end{align*}
Equivalently,
\begin{align*}
[\mathfrak g,\mathfrak g_i] \subset \mathfrak g_i.
\end{align*}
This is precisely the condition that $\mathfrak g_i$ is an ideal of $\mathfrak g$.
[/guided]
[/step]
[step:Show that distinct summand ideals commute]
Let $i,j \in \{1,\dots,r\}$ with $i \neq j$. Since $\mathfrak g_i$ is an ideal of $\mathfrak g$ and $\mathfrak g_j \subset \mathfrak g$,
\begin{align*}
[\mathfrak g_i,\mathfrak g_j] \subset \mathfrak g_i.
\end{align*}
Since $\mathfrak g_j$ is also an ideal of $\mathfrak g$ and $\mathfrak g_i \subset \mathfrak g$,
\begin{align*}
[\mathfrak g_i,\mathfrak g_j] \subset \mathfrak g_j.
\end{align*}
Therefore
\begin{align*}
[\mathfrak g_i,\mathfrak g_j] \subset \mathfrak g_i \cap \mathfrak g_j.
\end{align*}
The vector-space sum is direct, so $\mathfrak g_i \cap \mathfrak g_j = 0$. Hence
\begin{align*}
[\mathfrak g_i,\mathfrak g_j] = 0.
\end{align*}
[/step]
[step:Prove that each summand is simple as a Lie algebra]
Fix $i \in \{1,\dots,r\}$. Let $\mathfrak a \trianglelefteq \mathfrak g_i$ be an ideal of the Lie algebra $\mathfrak g_i$. For $j \neq i$, the previous step gives
\begin{align*}
[\mathfrak g_j,\mathfrak a] \subset [\mathfrak g_j,\mathfrak g_i] = 0.
\end{align*}
Also, since $\mathfrak a \trianglelefteq \mathfrak g_i$,
\begin{align*}
[\mathfrak g_i,\mathfrak a] \subset \mathfrak a.
\end{align*}
Using the vector-space decomposition of $\mathfrak g$, we obtain
\begin{align*}
[\mathfrak g,\mathfrak a]
=
[\mathfrak g_1 \oplus \cdots \oplus \mathfrak g_r,\mathfrak a]
\subset \mathfrak a.
\end{align*}
Thus $\mathfrak a$ is a $\mathfrak g$-submodule of the simple adjoint submodule $\mathfrak g_i$. Hence $\mathfrak a = 0$ or $\mathfrak a = \mathfrak g_i$.
It remains only to exclude the possibility that $\mathfrak g_i$ is one-dimensional abelian. If $[\mathfrak g_i,\mathfrak g_i]=0$, then the previous commutation result gives
\begin{align*}
[\mathfrak g,\mathfrak g_i] = 0,
\end{align*}
so $\mathfrak g_i \subset Z(\mathfrak g)$, where $Z(\mathfrak g)$ denotes the center of $\mathfrak g$. Since $Z(\mathfrak g)$ is an abelian ideal and $\mathfrak g$ is semisimple, $Z(\mathfrak g)=0$, contradicting $\mathfrak g_i \neq 0$. Therefore $\mathfrak g_i$ is nonabelian and has no nonzero proper ideals, so $\mathfrak g_i$ is simple.
[guided]
Fix one summand $\mathfrak g_i$. To prove that it is simple as a Lie algebra, we must show that it has no nonzero proper ideals. Let $\mathfrak a \trianglelefteq \mathfrak g_i$ be an ideal inside $\mathfrak g_i$.
The obstacle is that $\mathfrak a$ is initially only known to be stable under bracketing with elements of $\mathfrak g_i$, not with all of $\mathfrak g$. The commutation of distinct summands removes this obstacle. If $j \neq i$, then
\begin{align*}
[\mathfrak g_j,\mathfrak a] \subset [\mathfrak g_j,\mathfrak g_i] = 0.
\end{align*}
Since $\mathfrak a$ is an ideal of $\mathfrak g_i$, we also have
\begin{align*}
[\mathfrak g_i,\mathfrak a] \subset \mathfrak a.
\end{align*}
Now every element of $\mathfrak g$ is a unique sum of elements from the $\mathfrak g_j$, so the two bracket estimates combine to give
\begin{align*}
[\mathfrak g,\mathfrak a]
=
[\mathfrak g_1 \oplus \cdots \oplus \mathfrak g_r,\mathfrak a]
\subset \mathfrak a.
\end{align*}
Thus $\mathfrak a$ is not merely an ideal of $\mathfrak g_i$; it is a $\mathfrak g$-submodule of the adjoint submodule $\mathfrak g_i$.
Because $\mathfrak g_i$ was chosen to be simple as a $\mathfrak g$-module, its only $\mathfrak g$-submodules are $0$ and $\mathfrak g_i$. Therefore $\mathfrak a = 0$ or $\mathfrak a = \mathfrak g_i$.
Finally we check that $\mathfrak g_i$ is not an abelian one-dimensional exception. If $[\mathfrak g_i,\mathfrak g_i]=0$, then the commutation of distinct summands gives
\begin{align*}
[\mathfrak g,\mathfrak g_i] = 0.
\end{align*}
Hence every element of $\mathfrak g_i$ lies in the center $Z(\mathfrak g)$ of $\mathfrak g$. But $Z(\mathfrak g)$ is an abelian ideal, and a semisimple Lie algebra has no nonzero abelian ideals. Therefore $Z(\mathfrak g)=0$, contradicting $\mathfrak g_i \neq 0$. Thus $\mathfrak g_i$ is nonabelian and has no nonzero proper ideals, which is exactly simplicity.
[/guided]
[/step]
[step:Conclude that the vector-space decomposition is a Lie-algebra direct sum]
The decomposition
\begin{align*}
\mathfrak g = \mathfrak g_1 \oplus \cdots \oplus \mathfrak g_r
\end{align*}
was obtained as a direct sum of $F$-vector spaces. The preceding steps show that each $\mathfrak g_i$ is a simple ideal and that
\begin{align*}
[\mathfrak g_i,\mathfrak g_j] = 0
\end{align*}
whenever $i \neq j$. Therefore the Lie bracket on $\mathfrak g$ is the componentwise Lie bracket on the direct sum, so the same decomposition is a direct sum of Lie algebras. This proves the theorem.
[/step]