[step:Diagonalize the compact positive operator $|T|$]Let $A:=T^*T\in\mathcal{L}(H)$. Here $\mathcal{L}(H)$ denotes the bounded linear maps $H\to H$, and $\mathcal{L}(K,H)$ denotes the bounded linear maps $K\to H$. Since $T$ is compact and $T^*\in\mathcal{L}(K,H)$ is bounded, $A=T^*T$ is compact. For every $x\in H$, \begin{align*}(Ax,x)_H=(Tx,Tx)_K\ge 0.\end{align*} Thus $A$ is non-negative. Also $A$ is self-adjoint because, by the basic adjoint identity for products,
\begin{align*}
A^*=(T^*T)^*=T^*T=A.
\end{align*}
Let $|T|:=A^{1/2}$ be the unique non-negative square root of $A$; here we use the existence and basic properties of the positive square root for bounded non-negative [self-adjoint operators](/page/Self-Adjoint%20Operators) (citing a result not yet in the wiki: Existence and basic properties of $|T|=(T^*T)^{1/2}$). Since $A$ is compact and non-negative, $|T|$ is compact by the compactness part of the same square-root result.
We now apply the spectral theorem for compact positive self-adjoint operators to $|T|$ (citing a result not yet in the wiki: Spectral theorem for compact positive self-adjoint operators). It gives an index set $J$, where $J=\varnothing$, $J=\{1,\dots,m\}$ for some $m\in\mathbb N$, or $J=\mathbb N$, positive eigenvalues $(s_j)_{j\in J}$ repeated according to multiplicity and ordered non-increasingly, and an orthonormal family $(v_j)_{j\in J}$ in $H$ such that
\begin{align*}
|T|v_j=s_jv_j
\end{align*}
for every $j\in J$, and
\begin{align*}
\overline{\operatorname{span}}\{v_j:j\in J\}=(\ker |T|)^\perp.
\end{align*}
If $J=\mathbb N$, the same spectral theorem gives
\begin{align*}
s_j\to 0.
\end{align*}
It remains to identify $\ker |T|$ with $\ker T$. For $x\in H$, \begin{align*}\||T|x\|_H^2=(|T|^2x,x)_H=(T^*Tx,x)_H=\|Tx\|_K^2.\end{align*} Therefore $|T|x=0$ if and only if $Tx=0$, and hence
\begin{align*}
\ker |T|=\ker T.
\end{align*}
Thus
\begin{align*}
\overline{\operatorname{span}}\{v_j:j\in J\}=(\ker T)^\perp.
\end{align*}[/step]