[step:Compose the product isometries into one global splitting]
For each integer $r$ with $0\leq r\leq k$, define the Euclidean metric
\begin{align*}
g_{\mathrm{Euc},r}:=d t_1^2+\cdots+d t_r^2
\end{align*}
on $\mathbb{R}^r$, with the convention that $\mathbb{R}^0$ is a point and $g_{\mathrm{Euc},0}$ is the zero metric.
We claim that for every $r$ with $0\leq r\leq k$ there is an isometry
\begin{align*}
\Psi_r : (M,g) \longrightarrow (M_r\times\mathbb{R}^r,\, g_r+g_{\mathrm{Euc},r}).
\end{align*}
For $r=0$, take $\Psi_0=\operatorname{id}_M$. Assume $\Psi_{r-1}$ has been constructed for some $1\leq r\leq k$. Define
\begin{align*}
\widehat{\Phi}_r : M_{r-1}\times\mathbb{R}^{r-1} &\longrightarrow M_r\times\mathbb{R}\times\mathbb{R}^{r-1} \\
(q,s) &\longmapsto (\Phi_r(q),s),
\end{align*}
where $q\in M_{r-1}$ and $s\in\mathbb{R}^{r-1}$. Since $\Phi_r$ is an isometry and the identity map on $\mathbb{R}^{r-1}$ is an isometry, $\widehat{\Phi}_r$ is an isometry from
\begin{align*}
(M_{r-1}\times\mathbb{R}^{r-1},\, g_{r-1}+g_{\mathrm{Euc},r-1})
\end{align*}
onto
\begin{align*}
(M_r\times\mathbb{R}\times\mathbb{R}^{r-1},\, g_r+d t_r^2+g_{\mathrm{Euc},r-1}).
\end{align*}
Composing with the coordinate permutation
\begin{align*}
\Pi_r : M_r\times\mathbb{R}\times\mathbb{R}^{r-1} &\longrightarrow M_r\times\mathbb{R}^r \\
(p,t,s_1,\dots,s_{r-1}) &\longmapsto (p,s_1,\dots,s_{r-1},t),
\end{align*}
which is an isometry of Euclidean factors, we define
\begin{align*}
\Psi_r:=\Pi_r\circ \widehat{\Phi}_r\circ \Psi_{r-1}.
\end{align*}
Thus $\Psi_r$ is an isometry. Induction gives an isometry
\begin{align*}
\Psi_k : (M,g) \longrightarrow (M_k\times\mathbb{R}^k,\, g_k+g_{\mathrm{Euc},k}).
\end{align*}
[/step]