[proofplan]
The proof is an induction on the number of splittings. At each stage the Cheeger-Gromoll Splitting Theorem supplies one new $\mathbb{R}$ factor from a line in the current residual manifold, while the residual factor remains complete and has nonnegative Ricci curvature because it is a totally geodesic product factor. Composing the successive product isometries gives a single isometry from $M$ to the final residual factor times $\mathbb{R}^k$. The maximality hypothesis then identifies the final residual factor as the desired line-free manifold $N$.
[/proofplan]
[step:Record the residual splittings supplied by the hypothesis]
Set $(M_0,g_0):=(M,g)$. For each integer $j$ with $1 \leq j \leq k$, the hypothesis gives a connected Riemannian manifold $(M_j,g_j)$ and an isometry
\begin{align*}
\Phi_j : (M_{j-1},g_{j-1}) \longrightarrow (M_j \times \mathbb{R},\, g_j + d t_j^2),
\end{align*}
where $t_j:\mathbb{R}\to\mathbb{R}$ denotes the standard coordinate on the $j$th extracted Euclidean factor. This isometry is obtained by applying the Cheeger-Gromoll Splitting Theorem (citing a result not yet in the wiki: Cheeger-Gromoll Splitting Theorem) to a line in $(M_{j-1},g_{j-1})$.
The condition that the chosen line lies in the residual factor means that the next application of the splitting theorem is made to $(M_j,g_j)$, not to one of the already produced Euclidean factors. Thus the data form an iterated residual decomposition rather than repeated rediscovery of the same Euclidean direction.
[/step]
[step:Show that each residual factor remains complete and has nonnegative Ricci curvature]
We prove by induction on $j$ that each residual factor $(M_j,g_j)$ is complete and satisfies $\operatorname{Ric}_{g_j}\geq 0$.
For $j=0$, this is exactly the hypothesis on $(M,g)$. Assume that $(M_{j-1},g_{j-1})$ is complete and satisfies $\operatorname{Ric}_{g_{j-1}}\geq 0$ for some $1\leq j\leq k$. The isometry
\begin{align*}
\Phi_j : (M_{j-1},g_{j-1}) \longrightarrow (M_j \times \mathbb{R},\, g_j+d t_j^2)
\end{align*}
shows that the product $(M_j\times\mathbb{R},g_j+d t_j^2)$ is complete and has nonnegative Ricci curvature.
For a point $a\in\mathbb{R}$, define the slice inclusion
\begin{align*}
\iota_a : M_j &\longrightarrow M_j\times\mathbb{R} \\
p &\longmapsto (p,a).
\end{align*}
The image $\iota_a(M_j)=M_j\times\{a\}$ is closed because $\{a\}$ is closed in $\mathbb{R}$. With the distance induced by the product metric, this slice is isometric to $(M_j,g_j)$; since a closed subspace of a [complete metric space](/page/Complete%20Metric%20Space) is complete, $(M_j,g_j)$ is complete.
It remains to identify the Ricci tensor on the product factor. Let $p\in M_j$, let $a\in\mathbb{R}$, and let $v\in T_pM_j$. Under the splitting
\begin{align*}
T_{(p,a)}(M_j\times\mathbb{R}) \cong T_pM_j \oplus T_a\mathbb{R},
\end{align*}
the product connection is the direct-sum connection, so the curvature of the product restricts on vectors tangent to $M_j$ to the curvature of $(M_j,g_j)$. Therefore
\begin{align*}
\operatorname{Ric}_{g_j}(v,v)
=
\operatorname{Ric}_{g_j+d t_j^2}((v,0),(v,0)).
\end{align*}
The right-hand side is nonnegative because the product is isometric to $(M_{j-1},g_{j-1})$, whose Ricci curvature is nonnegative by the induction hypothesis. Hence $\operatorname{Ric}_{g_j}\geq 0$.
By induction, $(M_j,g_j)$ is complete and has nonnegative Ricci curvature for every $0\leq j\leq k$.
[guided]
We need to justify that after splitting off one line, the remaining factor is still eligible for the next splitting. That requires two properties: completeness and nonnegative Ricci curvature.
The base case is $(M_0,g_0)=(M,g)$, and the theorem assumes that $(M,g)$ is complete with $\operatorname{Ric}_{g}\geq 0$. Now fix an integer $j$ with $1\leq j\leq k$ and assume that $(M_{j-1},g_{j-1})$ is complete with $\operatorname{Ric}_{g_{j-1}}\geq 0$. The splitting hypothesis gives an isometry
\begin{align*}
\Phi_j : (M_{j-1},g_{j-1}) \longrightarrow (M_j \times \mathbb{R},\, g_j+d t_j^2).
\end{align*}
Because isometries preserve metric completeness and Ricci curvature, the product manifold $(M_j\times\mathbb{R},g_j+d t_j^2)$ is complete and has nonnegative Ricci curvature.
First consider completeness of the residual factor. Choose a point $a\in\mathbb{R}$ and define the slice inclusion
\begin{align*}
\iota_a : M_j &\longrightarrow M_j\times\mathbb{R} \\
p &\longmapsto (p,a).
\end{align*}
The subset $M_j\times\{a\}$ is closed in $M_j\times\mathbb{R}$ because $\{a\}$ is closed in $\mathbb{R}$. The map $\iota_a$ is an isometry from $(M_j,g_j)$ onto this slice with the induced product metric. Since a closed subset of a complete [metric space](/page/Metric%20Space) is complete, the slice is complete, and therefore $(M_j,g_j)$ is complete.
Now consider Ricci curvature. At a point $(p,a)\in M_j\times\mathbb{R}$, the tangent space splits as
\begin{align*}
T_{(p,a)}(M_j\times\mathbb{R}) \cong T_pM_j \oplus T_a\mathbb{R}.
\end{align*}
This identification is the differential of the product coordinate projections. Let $v\in T_pM_j$. The corresponding tangent vector in the product is $(v,0)$. For the product metric $g_j+d t_j^2$, the Levi-Civita connection is the direct-sum connection, so the curvature tensor on vectors tangent to the $M_j$ factor is exactly the curvature tensor of $(M_j,g_j)$. Taking the trace over an [orthonormal basis](/page/Orthonormal%20Basis) of $T_pM_j$ gives
\begin{align*}
\operatorname{Ric}_{g_j}(v,v)
=
\operatorname{Ric}_{g_j+d t_j^2}((v,0),(v,0)).
\end{align*}
The product Ricci curvature is nonnegative because the product is isometric to $(M_{j-1},g_{j-1})$, and the induction hypothesis gives $\operatorname{Ric}_{g_{j-1}}\geq 0$. Thus $\operatorname{Ric}_{g_j}(v,v)\geq 0$ for every $p\in M_j$ and every $v\in T_pM_j$, which means $\operatorname{Ric}_{g_j}\geq 0$.
This proves the induction step. Therefore every residual factor $(M_j,g_j)$ remains complete and has nonnegative Ricci curvature.
[/guided]
[/step]
[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]
[step:Use maximality to identify the final residual factor]
Define
\begin{align*}
(N,h):=(M_k,g_k).
\end{align*}
The preceding step gives an isometry
\begin{align*}
(M,g)\cong (N\times\mathbb{R}^k,\, h+g_{\mathrm{Euc},k}).
\end{align*}
The second step proves that $(N,h)$ is complete and satisfies $\operatorname{Ric}_h\geq 0$. The maximality hypothesis says precisely that the final residual factor $(M_k,g_k)$ contains no line, and therefore $(N,h)$ contains no line. This is the asserted decomposition.
[/step]