[proofplan]
We first enumerate $K$ by dovetailing the computations $\varphi_e(e)$: at stage $s$, simulate all diagonal computations with index at most $s$ for at most $s$ steps and output exactly those newly observed to halt. For noncomputability, assume toward contradiction that a total computable characteristic function for $K$ exists. Using this decider, construct a partial computable function that halts exactly on inputs not in $K$; applying the function to its own index gives the diagonal contradiction.
[/proofplan]
[step:Enumerate the diagonal halting computations by dovetailing]
For each $s \in \mathbb{N}$, define the finite search stage $E_s$ to be the following effective procedure: for each $e \leq s$, simulate the computation $\varphi_e(e)$ for $s$ steps, and output $e$ if this simulation halts within those $s$ steps and no earlier stage $t < s$ has already output $e$.
This procedure is computable at each finite stage because the enumeration $(\varphi_e)_{e \in \mathbb{N}}$ is effective, so finite-time simulations of finitely many machines are decidable. If $e \in K$, then $\varphi_e(e)$ halts after some finite number $m \in \mathbb{N}$ of computation steps. At stage $s \geq \max\{e,m\}$, the procedure simulates $\varphi_e(e)$ long enough to observe the halt, so $e$ is output. Conversely, if $e$ is output at some stage, then the simulation of $\varphi_e(e)$ has halted, hence $e \in K$. Therefore this dovetailing procedure enumerates exactly the elements of $K$, and $K$ is computably enumerable.
[/step]
[step:Assume a computable decider for $K$ and build the diagonal partial function]
Assume, for contradiction, that $K$ is computable. Then there exists a total computable function
\begin{align*}
h: \mathbb{N} &\to \{0,1\}
\end{align*}
such that, for every $e \in \mathbb{N}$,
\begin{align*}
h(e) = 1 \iff e \in K.
\end{align*}
Define a partial function
\begin{align*}
g: \mathbb{N} &\rightharpoonup \mathbb{N}
\end{align*}
by the rule
\begin{align*}
g(e) =
\begin{cases}
0, & h(e) = 0,\\
\text{undefined}, & h(e) = 1.
\end{cases}
\end{align*}
Since $h$ is total computable, $g$ is partial computable: on input $e$, compute $h(e)$; if the result is $0$, halt and output $0$; if the result is $1$, enter a non-terminating loop. Because $(\varphi_e)_{e \in \mathbb{N}}$ enumerates all unary partial computable functions, there exists an index $d \in \mathbb{N}$ such that
\begin{align*}
\varphi_d = g.
\end{align*}
[guided]
We now turn the assumed decider into a function designed to disagree with the diagonal halting set. The assumption that $K$ is computable means that membership in $K$ is decided by a total computable function
\begin{align*}
h: \mathbb{N} &\to \{0,1\},
\end{align*}
with
\begin{align*}
h(e) = 1 \iff \varphi_e(e) \text{ is defined}.
\end{align*}
The diagonal construction reverses this answer. Define
\begin{align*}
g: \mathbb{N} &\rightharpoonup \mathbb{N}
\end{align*}
by
\begin{align*}
g(e) =
\begin{cases}
0, & h(e) = 0,\\
\text{undefined}, & h(e) = 1.
\end{cases}
\end{align*}
This function is partial computable because its computation is explicit. Given input $e \in \mathbb{N}$, first compute the total computable value $h(e)$. If $h(e)=0$, output $0$ and halt. If $h(e)=1$, run an infinite loop, for instance repeatedly do nothing and never enter a halting state. Thus the halting set of $g$ is exactly the complement of $K$ as judged by $h$.
Since the enumeration $(\varphi_e)_{e \in \mathbb{N}}$ contains every unary partial computable function, the partial computable function $g$ has some index. Let $d \in \mathbb{N}$ be such an index, so that
\begin{align*}
\varphi_d = g.
\end{align*}
This is the point at which self-reference enters the proof: we will evaluate the machine with index $d$ on its own input $d$.
[/guided]
[/step]
[step:Evaluate the diagonal function at its own index]
We derive a contradiction by considering the two possible values of $h(d)$.
If $h(d)=1$, then $d \in K$ by the defining property of $h$, so $\varphi_d(d)$ is defined. Since $\varphi_d = g$, this means $g(d)$ is defined. But the definition of $g$ gives that $g(d)$ is undefined whenever $h(d)=1$, a contradiction.
If $h(d)=0$, then $d \notin K$ by the defining property of $h$, so $\varphi_d(d)$ is undefined. Since $\varphi_d = g$, this means $g(d)$ is undefined. But the definition of $g$ gives $g(d)=0$ whenever $h(d)=0$, so $g(d)$ is defined, again a contradiction.
Both possible values of $h(d)$ are impossible. Therefore no total computable function $h: \mathbb{N} \to \{0,1\}$ decides $K$, and hence $K$ is not computable.
[/step]